/* ============================================================
   liamjordan.co.uk — Main Stylesheet
   All colours come from the active theme file (loaded before this).
   NEVER hardcode #fff or #000 in content elements — use variables.
   ============================================================ */

/* ── Reset ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; }
ul { list-style: none; }

/* ── Base ────────────────────────────────────────────────────── */
body {
    font-family: var(--font-body);
    font-size:   16px;
    line-height: 1.7;
    color:       var(--text);
    background:  var(--bg);
    transition:  background 0.2s, color 0.2s;
}
a           { color: var(--accent); text-decoration: none; }
a:hover     { color: var(--accent-hover); text-decoration: underline; }
strong      { font-weight: 600; }
p           { margin-bottom: 1em; }
p:last-child{ margin-bottom: 0; }

h1, h2, h3, h4, h5 {
    font-family: var(--font-heading);
    line-height: 1.2;
    color:       var(--heading);
    font-weight: 600;
}
h1 { font-size: clamp(2rem, 5vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.75rem); }
h3 { font-size: 1.15rem; }
h4 { font-size: 0.95rem; font-family: var(--font-body); font-weight: 700; }

/* ── Layout ──────────────────────────────────────────────────── */
.container    { max-width: 1080px; margin: 0 auto; padding: 0 2rem; }
.container-sm { max-width: 720px; }
.section      { padding: 4.5rem 0; }
.section-light{ background: var(--bg); }
.section-card { background: var(--surface); }

/* ── Type helpers ────────────────────────────────────────────── */
.eyebrow {
    display:        block;
    font-size:      0.68rem;
    font-weight:    700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color:          var(--accent);
    margin-bottom:  0.6rem;
}
.section-title { font-size: clamp(1.35rem, 2.5vw, 1.7rem); margin-bottom: 0.4rem; }
.section-lead  { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 2.5rem; max-width: 560px; }

/* ── Navigation (top-nav) ────────────────────────────────────── */
#site-nav {
    background:    var(--nav-bg);
    position:      sticky;
    top:           0;
    z-index:       200;
    border-bottom: 1px solid var(--nav-border);
    box-shadow:    0 1px 12px var(--nav-shadow);
}
.nav-inner {
    display:         flex;
    align-items:     center;
    justify-content: space-between;
    max-width:       1080px;
    margin:          0 auto;
    padding:         0 2rem;
    height:          58px;
}
.nav-brand {
    font-family:     var(--font-heading);
    font-size:       1.15rem;
    font-weight:     600;
    color:           var(--nav-brand);
    text-decoration: none;
    letter-spacing:  0.01em;
}
.nav-brand:hover { opacity: 0.8; text-decoration: none; }

.nav-links { display: flex; align-items: center; gap: 0.1rem; padding: 0; }
.nav-links a {
    font-size:       0.82rem;
    font-weight:     500;
    color:           var(--nav-link);
    padding:         0.4rem 0.65rem;
    border-radius:   4px;
    transition:      background 0.12s, color 0.12s;
    text-decoration: none;
}
.nav-links a:hover, .nav-links a.active {
    color:      var(--nav-link-active);
    background: var(--nav-link-active-bg);
}


/* Grouped desktop navigation */
.nav-submenu { position: relative; }
.nav-submenu-toggle {
    display: inline-flex;
    align-items: center;
    gap: .32rem;
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--nav-link);
    font: inherit;
    font-size: .82rem;
    font-weight: 500;
    padding: .4rem .65rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background .12s, color .12s;
}
.nav-submenu-toggle span { font-size: .9em; transition: transform .12s ease; }
.nav-submenu:hover > .nav-submenu-toggle,
.nav-submenu:focus-within > .nav-submenu-toggle,
.nav-submenu.active-parent > .nav-submenu-toggle {
    color: var(--nav-link-active);
    background: var(--nav-link-active-bg);
}
.nav-submenu-menu {
    display: none;
    position: absolute;
    top: calc(100% + .5rem);
    left: 0;
    min-width: 220px;
    margin: 0;
    padding: .4rem;
    list-style: none;
    background: var(--nav-bg);
    border: 1px solid var(--nav-border);
    border-radius: 8px;
    box-shadow: 0 14px 30px rgba(0,0,0,.18);
    z-index: 260;
}
.nav-submenu-menu::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: -.55rem;
    height: .6rem;
}
.nav-submenu:hover > .nav-submenu-menu,
.nav-submenu:focus-within > .nav-submenu-menu,
.nav-submenu.submenu-open > .nav-submenu-menu { display: block; }
.nav-submenu-menu li { width: 100%; }
.nav-submenu-menu a {
    display: block;
    width: 100%;
    padding: .58rem .7rem;
    white-space: nowrap;
}
.nav-submenu.submenu-open > .nav-submenu-toggle span { transform: rotate(180deg); }

.nav-actions  { display: flex; align-items: center; gap: 0.5rem; }

.btn-dark {
    background:    none;
    border:        1px solid var(--nav-toggle-border);
    border-radius: 4px;
    color:         var(--nav-toggle-color);
    width:         30px;
    height:        30px;
    cursor:        pointer;
    display:       grid;
    place-items:   center;
    font-size:     0.85rem;
    transition:    0.12s;
}
.btn-dark:hover { opacity: 1; filter: brightness(1.25); }

.nav-hamburger {
    display:        none;
    background:     none;
    border:         none;
    cursor:         pointer;
    padding:        0.35rem;
    color:          var(--nav-link);
    flex-direction: column;
    gap:            4px;
}
.nav-hamburger span {
    display:       block;
    width:         20px;
    height:        2px;
    background:    currentColor;
    border-radius: 2px;
}

/* ── Hero ────────────────────────────────────────────────────── */
.hero {
    background:  var(--hero-bg);
    padding:     5.5rem 0 5rem;
    position:    relative;
    overflow:    hidden;
}
.hero::after {
    content:        '';
    position:       absolute;
    inset:          0;
    background:     var(--hero-overlay);
    pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; max-width: 1080px; margin: 0 auto; padding: 0 2rem; }
.hero-grid  { display: grid; grid-template-columns: 1fr auto; gap: 3rem; align-items: center; }

.hero-tag {
    display:        inline-flex;
    align-items:    center;
    gap:            0.35rem;
    background:     var(--hero-tag-bg);
    border:         1px solid var(--hero-tag-border);
    color:          var(--hero-tag-color);
    font-size:      0.68rem;
    font-weight:    700;
    padding:        0.28rem 0.75rem;
    border-radius:  20px;
    margin-bottom:  1.25rem;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}
.hero-name {
    font-family:    var(--font-heading);
    font-size:      clamp(2.8rem, 7vw, 4.2rem);
    font-weight:    600;
    line-height:    1.0;
    color:          var(--hero-h1);
    margin-bottom:  0.5rem;
    letter-spacing: -0.01em;
}
.hero-role,
.hero-subtitle { font-size: 1.05rem; color: var(--hero-sub); margin-bottom: 0.2rem; font-weight: 400; }
.hero-inst  { font-size: 0.88rem; color: var(--hero-accent-text); font-weight: 500; margin-bottom: 1.5rem; }
.hero-bio   { font-size: 1rem; max-width: 580px; color: var(--hero-body); line-height: 1.8; margin-bottom: 2.25rem; }
.hero-actions { display: flex; gap: 0.85rem; flex-wrap: wrap; }

.hero-stats {
    display:         flex;
    flex-direction:  column;
    gap:             1rem;
    background:      var(--hero-stats-bg);
    border:          1px solid var(--hero-stats-border);
    border-radius:   12px;
    padding:         1.5rem 1.75rem;
    min-width:       170px;
}
.hero-stat-val { font-size: 1.6rem; font-weight: 700; color: var(--hero-h1); display: block; line-height: 1; }
.hero-stat-lbl { font-size: 0.68rem; font-weight: 600; color: var(--hero-sub); text-transform: uppercase; letter-spacing: 0.08em; display: block; margin-top: 3px; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
    display:         inline-flex;
    align-items:     center;
    gap:             0.4rem;
    padding:         0.62rem 1.4rem;
    border-radius:   6px;
    font-size:       0.88rem;
    font-weight:     600;
    cursor:          pointer;
    border:          2px solid transparent;
    transition:      0.15s;
    text-decoration: none;
    white-space:     nowrap;
    font-family:     var(--font-body);
}
.btn--primary        { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn--primary:hover  { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; text-decoration: none; }
.btn--white          { background: #fff; color: var(--nav-bg); border-color: #fff; }
.btn--white:hover    { background: rgba(255,255,255,0.85); text-decoration: none; }
.btn--outline-white  { background: transparent; color: var(--hero-sub); border-color: var(--hero-tag-border); }
.btn--outline-white:hover { background: var(--hero-tag-bg); color: var(--hero-h1); text-decoration: none; }
.btn--secondary      { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn--secondary:hover{ background: var(--accent-bg); text-decoration: none; }
.btn--ghost          { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn--ghost:hover    { background: var(--border); text-decoration: none; }
.btn--sm             { padding: 0.38rem 0.9rem; font-size: 0.8rem; }

/* ── Cards ───────────────────────────────────────────────────── */
.card {
    background:    var(--card-bg);
    border:        1px solid var(--border);
    border-radius: 10px;
    padding:       1.75rem;
    box-shadow:    var(--card-shadow);
    transition:    box-shadow 0.2s;
}
.card:hover { box-shadow: var(--card-shadow-hover); }
.card-eyebrow { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); margin-bottom: 0.5rem; display: block; }
.card-title   { font-size: 1.05rem; margin-bottom: 0.4rem; }
.card-body    { font-size: 0.9rem; color: var(--text-muted); }

/* ── Snapshot cards ──────────────────────────────────────────── */
.snapshot-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.snapshot-card {
    background:    var(--card-bg);
    border:        1px solid var(--border);
    border-top:    3px solid var(--accent);
    border-radius: 10px;
    padding:       1.6rem;
    box-shadow:    var(--card-shadow);
}
.snapshot-card h3 {
    font-size:      0.68rem;
    font-family:    var(--font-body);
    font-weight:    700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color:          var(--accent);
    margin-bottom:  1rem;
}
.snapshot-card ul  { padding-left: 1.2rem; list-style: disc; }
.snapshot-card li  { font-size: 0.9rem; margin-bottom: 0.45rem; color: var(--text); }
.snapshot-card p   { font-size: 0.9rem; color: var(--text-muted); margin: 0; }

/* ── Milestones ──────────────────────────────────────────────── */
.milestone-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; }
.milestone {
    display:       flex;
    gap:           0.85rem;
    align-items:   flex-start;
    background:    var(--card-bg);
    border:        1px solid var(--border);
    border-radius: 10px;
    padding:       1.25rem;
    box-shadow:    var(--card-shadow);
}
.milestone-icon            { font-size: 1.35rem; flex-shrink: 0; line-height: 1.4; }
.milestone-body strong     { display: block; font-size: 0.9rem; font-weight: 600; color: var(--heading); margin-bottom: 2px; }
.milestone-body span       { font-size: 0.8rem; color: var(--text-muted); line-height: 1.45; display: block; }

/* ── PhD tracker ─────────────────────────────────────────────── */
.ljt-wrap {
    background:    var(--card-bg);
    border:        1px solid var(--border);
    border-radius: 10px;
    padding:       1.75rem;
    box-shadow:    var(--card-shadow);
}
.ljt-sub  { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.ljt-bar-wrap { position: relative; padding-top: 1.6rem; }
.ljt-bar {
    width:         100%;
    height:        12px;
    background:    var(--border);
    border-radius: 20px;
    position:      relative;
    overflow:      hidden;
}
.ljt-fill {
    height:        100%;
    border-radius: 20px;
    width:         0%;
    background:    linear-gradient(90deg, var(--accent) 0%, var(--accent-hover) 100%);
    transition:    width 900ms cubic-bezier(.2, .8, .2, 1);
}
.ljt-marker {
    position:      absolute;
    top:           50%;
    transform:     translate(-50%, -50%);
    width:         40px;
    height:        40px;
    display:       grid;
    place-items:   center;
    border-radius: 12px;
    background:    var(--gold);
    border:        1px solid rgba(0, 0, 0, 0.12);
    box-shadow:    0 4px 14px rgba(0, 0, 0, 0.2);
    transition:    left 900ms cubic-bezier(.2, .8, .2, 1);
    z-index:       3;
}
.ljt-marker svg { width: 20px; height: 20px; color: var(--nav-bg); }
.ljt-labels {
    display:         flex;
    justify-content: space-between;
    margin-top:      10px;
    font-size:       0.8rem;
    font-weight:     600;
    color:           var(--text-muted);
}
.ljt-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 1.25rem; }
.ljt-meta-card {
    background:    var(--surface);
    border:        1px solid var(--border);
    border-radius: 8px;
    padding:       0.85rem 1rem;
}
.ljt-meta-card .k { display: block; color: var(--text-muted); font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 3px; }
.ljt-meta-card .v { display: block; color: var(--accent); font-size: 0.95rem; font-weight: 700; }

/* ── Grid helpers ────────────────────────────────────────────── */
.grid-2    { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.grid-3    { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.25rem; }

/* ── Timeline ────────────────────────────────────────────────── */
.timeline { position: relative; }
.timeline-item {
    display:        grid;
    grid-template-columns: 130px 1fr;
    gap:            1.5rem;
    padding-bottom: 2rem;
    position:       relative;
}
.timeline-item::before {
    content:    '';
    position:   absolute;
    left:       138px; top: 10px; bottom: 0;
    width:      1px;
    background: var(--border);
}
.timeline-item:last-child::before { display: none; }
.timeline-date      { font-size: 0.78rem; color: var(--text-muted); font-weight: 600; text-align: right; padding-top: 2px; line-height: 1.45; }
.timeline-content   { padding-left: 1.5rem; position: relative; }
.timeline-content::before {
    content:       '';
    position:      absolute;
    left:          -5px; top: 8px;
    width:         10px; height: 10px;
    border-radius: 50%;
    background:    var(--accent);
    border:        2px solid var(--surface);
}
.timeline-content h3  { font-size: 1rem; margin-bottom: 0.2rem; }
.timeline-content .org{ font-size: 0.84rem; color: var(--accent); font-weight: 500; display: block; margin-bottom: 0.4rem; }
.timeline-content p   { font-size: 0.9rem; color: var(--text-muted); margin-top: 0.2rem; }

/* ── Badges ──────────────────────────────────────────────────── */
.badge {
    display:       inline-block;
    background:    var(--accent-bg);
    color:         var(--accent);
    font-size:     0.7rem;
    font-weight:   700;
    padding:       0.2rem 0.58rem;
    border-radius: 20px;
    margin:        0 0.3rem 0.3rem 0;
}

/* ── Skills ──────────────────────────────────────────────────── */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.skill-group {
    background:    var(--card-bg);
    border:        1px solid var(--border);
    border-radius: 10px;
    padding:       1.25rem;
    box-shadow:    var(--card-shadow);
}
.skill-group h3 {
    font-size:      0.68rem;
    font-family:    var(--font-body);
    font-weight:    700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color:          var(--accent);
    margin-bottom:  0.75rem;
    padding-bottom: 0.5rem;
    border-bottom:  1px solid var(--border);
}
.skill-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.skill-tag  { background: var(--surface); border: 1px solid var(--border); color: var(--text); font-size: 0.78rem; padding: 0.22rem 0.6rem; border-radius: 20px; }

/* ── Publications ────────────────────────────────────────────── */
.pub-filter      { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 2rem; }
.pub-filter-btn  { background: var(--surface); border: 1px solid var(--border); color: var(--text-muted); font-size: 0.78rem; font-weight: 600; padding: 0.3rem 0.85rem; border-radius: 20px; cursor: pointer; transition: 0.12s; font-family: var(--font-body); }
.pub-filter-btn.active, .pub-filter-btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

.pub-section-heading { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); border-bottom: 1px solid var(--border); padding-bottom: 0.5rem; margin: 2rem 0 1rem; }
.pub-section-heading:first-child { margin-top: 0; }

.pub-item       { padding: 1.25rem 0; border-bottom: 1px solid var(--border); }
.pub-item:last-child { border-bottom: none; }
.pub-authors    { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 0.35rem; }
.pub-authors strong { color: var(--text); }
.pub-title      { font-family: var(--font-heading); font-size: 1.05rem; margin-bottom: 0.3rem; color: var(--heading); }
.pub-venue      { font-size: 0.84rem; color: var(--text-muted); font-style: italic; }
.pub-links      { margin-top: 0.6rem; display: flex; gap: 0.4rem; flex-wrap: wrap; }
.pub-link {
    font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
    padding: 0.2rem 0.6rem; border: 1px solid var(--accent); border-radius: 4px;
    color: var(--accent); cursor: pointer; background: none; font-family: var(--font-body); transition: 0.12s;
}
.pub-link:hover { background: var(--accent); color: #fff; text-decoration: none; }

/* ── Page header (inner pages) ───────────────────────────────── */
.page-header {
    background:    var(--hero-bg);
    padding:       3rem 0 2.75rem;
    border-bottom: 1px solid var(--border);
}
.page-header h1        { color: var(--hero-h1); margin-bottom: 0.4rem; }
.page-header-desc      { color: var(--hero-sub); font-size: 0.95rem; max-width: 560px; }

/* ── Info / Alerts ───────────────────────────────────────────── */
.info-box  { background: var(--accent-bg); border-left: 3px solid var(--accent); border-radius: 0 6px 6px 0; padding: 0.85rem 1.1rem; font-size: 0.9rem; margin-bottom: 1.5rem; color: var(--text); }
.alert-ok  { background: var(--alert-ok-bg);  border-left: 3px solid var(--alert-ok-border);  color: var(--alert-ok-text);  padding: .85rem 1.1rem; border-radius: 0 6px 6px 0; margin-bottom: 1rem; }
.alert-err { background: var(--alert-err-bg); border-left: 3px solid var(--alert-err-border); color: var(--alert-err-text); padding: .85rem 1.1rem; border-radius: 0 6px 6px 0; margin-bottom: 1rem; }

/* ── Contact ─────────────────────────────────────────────────── */
.contact-grid  { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.contact-block { background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; padding: 1.75rem; box-shadow: var(--card-shadow); }
.contact-block-title { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); margin-bottom: 1rem; display: block; }
.contact-row {
    display:         flex;
    align-items:     center;
    gap:             0.75rem;
    padding:         0.7rem 0;
    border-bottom:   1px solid var(--border);
    color:           var(--text);
    font-size:       0.9rem;
    text-decoration: none;
    transition:      color 0.12s;
}
.contact-row:last-child { border-bottom: none; }
.contact-row:hover      { color: var(--accent); text-decoration: none; }
.contact-row .cr-icon   { font-size: 1rem; width: 1.35rem; text-align: center; flex-shrink: 0; }
.contact-row .cr-label  { font-size: 0.72rem; color: var(--text-muted); display: block; }
.contact-row .cr-value  { font-weight: 500; }

/* ── Forms ───────────────────────────────────────────────────── */
.form-group    { margin-bottom: 1.15rem; }
.form-label    { display: block; font-size: 0.82rem; font-weight: 600; margin-bottom: 0.35rem; color: var(--text); }
.form-input, .form-textarea {
    width:         100%;
    background:    var(--input-bg);
    border:        1px solid var(--border);
    border-radius: 6px;
    padding:       0.6rem 0.9rem;
    font-size:     0.9rem;
    color:         var(--text);
    transition:    border-color 0.12s, box-shadow 0.12s;
    font-family:   var(--font-body);
}
.form-input:focus, .form-textarea:focus {
    outline:      none;
    border-color: var(--accent);
    box-shadow:   0 0 0 3px var(--accent-bg);
    background:   var(--card-bg);
}
.form-textarea { min-height: 120px; resize: vertical; }

/* ── CV ──────────────────────────────────────────────────────── */
.cv-dl-bar {
    background:    var(--accent-bg);
    border:        1px solid var(--border);
    border-radius: 8px;
    padding:       1rem 1.4rem;
    display:       flex;
    align-items:   center;
    justify-content: space-between;
    flex-wrap:     wrap;
    gap:           1rem;
    margin-bottom: 2.25rem;
    font-size:     0.9rem;
}
.cv-section       { margin-bottom: 3rem; }
.cv-section-title { font-size: 1.15rem; color: var(--heading); border-bottom: 2px solid var(--accent); padding-bottom: 0.4rem; margin-bottom: 1.5rem; }

/* ── ProtocolDock page ───────────────────────────────────────── */
/* Hero is ALWAYS white — logo is dark and must never sit on a dark bg */
.pd-page-hero {
    background:    #ffffff;
    padding:       4.5rem 0;
    border-bottom: 1px solid #e2e8f0;
    color:         #0f172a;   /* force dark text — never inherit light body colour */
}
html[data-mode="dark"] .pd-page-hero {
    background:    #ffffff;
    border-color:  #e2e8f0;
    color:         #0f172a;
}
.pd-page-logo    { height: 48px; width: auto; margin-bottom: 1rem; }
.pd-hero-eyebrow { font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 1.25rem; }
.pd-hero-sub     { font-size: 1rem; margin: 0; }
.pd-solo-title   { display: block; font-size: 0.92rem; font-weight: 600; margin-bottom: 2px; }
.pd-solo-desc    { font-size: .85rem; margin: 0; }

/* pd-page-hero is ALWAYS white — lock down every text colour explicitly */
.pd-page-hero,
html[data-mode="dark"] .pd-page-hero        { background: #ffffff !important; border-bottom: 1px solid #e2e8f0 !important; }
.pd-page-hero .pd-hero-eyebrow              { color: #94a3b8 !important; }
.pd-page-hero .pd-hero-sub                  { color: #475569 !important; }
.pd-page-hero .pd-solo-title                { color: #0f172a !important; }
.pd-page-hero .pd-solo-desc                 { color: #64748b !important; }
.pd-page-hero .pd-solo-badge                { background: #f8fafc !important; border-color: #e2e8f0 !important; }
html[data-mode="dark"] .pd-page-hero .pd-hero-eyebrow { color: #94a3b8 !important; }
html[data-mode="dark"] .pd-page-hero .pd-hero-sub     { color: #475569 !important; }
html[data-mode="dark"] .pd-page-hero .pd-solo-title   { color: #0f172a !important; }
html[data-mode="dark"] .pd-page-hero .pd-solo-desc    { color: #64748b !important; }
html[data-mode="dark"] .pd-page-hero .pd-solo-badge   { background: #f8fafc !important; border-color: #e2e8f0 !important; }

.pd-solo-badge   {
    display:     inline-flex;
    align-items: center;
    gap:         0.75rem;
    background:  var(--accent-bg);
    border:      1px solid var(--border);
    border-radius: 10px;
    padding:     0.9rem 1.25rem;
    margin-top:  1.5rem;
}
.pd-solo-badge strong { color: var(--heading); display: block; font-size: 0.92rem; }
.pd-solo-badge p      { color: var(--text-muted); font-size: 0.82rem; margin: 0; }
.feature-grid  { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; }
.feature-card  { background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; padding: 1.25rem; box-shadow: var(--card-shadow); }
.feature-card h4 { color: var(--accent); margin-bottom: 0.4rem; font-size: 0.9rem; }
.feature-card p  { font-size: 0.85rem; color: var(--text-muted); margin: 0; }

/* ── Sidebar layout (ProtocolDock theme) ─────────────────────── */
.pd-shell  { display: flex; min-height: 100vh; }
.pd-sidebar {
    width:        250px;
    flex-shrink:  0;
    background:   var(--nav-bg);
    border-right: 1px solid var(--nav-border);
    position:     sticky;
    top:          0;
    height:       100vh;
    overflow-y:   auto;
    display:      flex;
    flex-direction: column;
}
.pd-sidebar-brand {
    padding:         1.25rem;
    font-family:     var(--font-heading);
    font-size:       1.05rem;
    font-weight:     600;
    color:           var(--nav-brand);
    border-bottom:   1px solid var(--nav-border);
    margin-bottom:   0.5rem;
    display:         block;
    text-decoration: none;
}
.pd-sidebar-brand:hover { opacity: 0.8; text-decoration: none; }
.pd-nav     { padding: 0.5rem 0.6rem; flex: 1; }
.pd-nav a {
    display:         flex;
    align-items:     center;
    gap:             0.55rem;
    font-size:       0.84rem;
    font-weight:     500;
    color:           var(--nav-link);
    padding:         0.58rem 0.75rem;
    border-radius:   7px;
    margin-bottom:   2px;
    text-decoration: none;
    transition:      background 0.12s, color 0.12s;
}
.pd-nav a:hover, .pd-nav a.active { color: var(--nav-link-active); background: var(--nav-link-active-bg); text-decoration: none; }
.pd-sidebar-footer { padding: 1rem; border-top: 1px solid var(--nav-border); }
.pd-main    { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pd-topbar  {
    background:    var(--card-bg);
    border-bottom: 1px solid var(--border);
    height:        54px;
    display:       flex;
    align-items:   center;
    justify-content: space-between;
    padding:       0 2rem;
    position:      sticky;
    top:           0;
    z-index:       100;
}
.pd-topbar-title { font-size: 0.9rem; font-weight: 600; color: var(--text); }
.pd-content { flex: 1; }

/* ── Footer ──────────────────────────────────────────────────── */
#site-footer {
    background: var(--nav-bg);
    padding:    2.25rem 0;
    font-size:  0.84rem;
}
.footer-inner {
    max-width:       1080px;
    margin:          0 auto;
    padding:         0 2rem;
    display:         flex;
    align-items:     center;
    justify-content: space-between;
    flex-wrap:       wrap;
    gap:             0.75rem;
}
.footer-inner span { color: var(--footer-text); }
.footer-links      { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.footer-links a    { color: var(--footer-link); font-size: 0.82rem; transition: color 0.12s; }
.footer-links a:hover { color: var(--footer-link-hover); text-decoration: none; }

/* ── Rich content (posts, pages — HTML from Quill editor) ───── */
.rich-content { line-height: 1.8; font-size: 1rem; color: var(--text); }
.rich-content p         { margin-bottom: 1.1em; }
.rich-content p:empty,
.rich-content p br:only-child { display: none; }
.rich-content h1        { font-size: 1.8rem; margin: 1.5em 0 0.5em; }
.rich-content h2        { font-size: 1.4rem; margin: 1.4em 0 0.5em; }
.rich-content h3        { font-size: 1.15rem; margin: 1.2em 0 0.4em; }
.rich-content strong, .rich-content b { font-weight: 700; }
.rich-content em, .rich-content i    { font-style: italic; }
.rich-content a         { color: var(--accent); text-decoration: underline; }
.rich-content a:hover   { color: var(--accent-hover); }
.rich-content ul        { list-style: disc; padding-left: 1.5em; margin-bottom: 1em; }
.rich-content ol        { list-style: decimal; padding-left: 1.5em; margin-bottom: 1em; }
.rich-content li        { margin-bottom: 0.35em; }
.rich-content blockquote{
    border-left: 3px solid var(--accent);
    padding:     0.5em 1em;
    margin:      1em 0;
    color:       var(--text-muted);
    font-style:  italic;
    background:  var(--surface);
    border-radius: 0 6px 6px 0;
}
.rich-content pre       { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 1em; overflow-x: auto; font-size: 0.88em; margin-bottom: 1em; }
.rich-content code      { background: var(--surface); padding: 0.1em 0.35em; border-radius: 3px; font-size: 0.88em; font-family: 'Courier New', monospace; }
.rich-content img       { max-width: 100%; height: auto; border-radius: 6px; margin: 0.5em 0; }
.rich-content hr        { border: none; border-top: 1px solid var(--border); margin: 1.5em 0; }

/* ── Utilities ───────────────────────────────────────────────── */
.text-muted  { color: var(--text-muted) !important; }
.text-accent { color: var(--accent) !important; }
.text-center { text-align: center; }
.mt-1 { margin-top:    .75rem; } .mt-2 { margin-top:    1.5rem; } .mt-3 { margin-top:    3rem; }
.mb-0 { margin-bottom: 0 !important; } .mb-1 { margin-bottom: .75rem; } .mb-2 { margin-bottom: 1.5rem; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 900px) {
    .snapshot-grid, .contact-grid, .grid-3 { grid-template-columns: 1fr; }
    .hero-grid   { grid-template-columns: 1fr; }
    .hero-stats  { display: none; }
    .timeline-item { grid-template-columns: 1fr; gap: 0.15rem; }
    .timeline-item::before, .timeline-content::before { display: none; }
    .timeline-date { text-align: left; }
    .timeline-content { padding-left: 0; }
    .ljt-meta { grid-template-columns: 1fr 1fr; }
    .pd-sidebar { display: none; }
}
@media (max-width: 768px) {
    /* Hide nav links and the desktop dark-mode toggle */
    .nav-links              { display: none; }
    .nav-actions .btn-dark  { display: none; }

    /* Show the hamburger — nav-actions stays visible as its container */
    .nav-hamburger { display: flex; }
    #site-nav      { position: relative; }

    /* Dropdown menu when open */
    .nav-links.open {
        display:        flex;
        flex-direction: column;
        position:       absolute;
        top:            58px;
        left:           0;
        right:          0;
        background:     var(--nav-bg);
        padding:        0.5rem 0.75rem 0.75rem;
        border-top:     1px solid var(--nav-border);
        z-index:        200;
        box-shadow:     0 8px 20px rgba(0,0,0,0.25);
    }
    .nav-links.open li  { width: 100%; }
    .nav-links.open a   { display: block; padding: 0.75rem 1rem; border-radius: 6px; font-size: 0.92rem; }
    .nav-links.open .nav-submenu-toggle {
        width: 100%;
        justify-content: space-between;
        padding: .75rem 1rem;
        font-size: .92rem;
        color: var(--nav-link);
    }
    .nav-links.open .nav-submenu-menu {
        position: static;
        min-width: 0;
        margin: .15rem 0 .35rem;
        padding: .15rem 0 .15rem .75rem;
        border: 0;
        border-left: 1px solid var(--nav-border);
        border-radius: 0;
        box-shadow: none;
        background: transparent;
    }
    .nav-links.open .nav-submenu-menu::before { display: none; }
    .nav-links.open .nav-submenu-menu a { padding: .62rem 1rem; font-size: .88rem; }
    .nav-links.open .nav-submenu:not(.submenu-open) > .nav-submenu-menu { display: none; }
    .nav-links.open .nav-submenu.submenu-open > .nav-submenu-menu { display: block; }

    /* Layout adjustments */
    .section        { padding: 2.75rem 0; }
    .container      { padding: 0 1.25rem; }
    .hero           { padding: 3.5rem 0 3rem; }
    .grid-2         { grid-template-columns: 1fr; }
    .milestone-grid { grid-template-columns: 1fr 1fr; }
    .cv-dl-bar      { flex-direction: column; align-items: flex-start; }
    .snapshot-grid  { grid-template-columns: 1fr; }
    .contact-grid   { grid-template-columns: 1fr; }
    .skills-grid    { grid-template-columns: 1fr; }
    .hero-grid      { grid-template-columns: 1fr; }
    .hero-aside     { display: none; }
    .ljt-meta       { grid-template-columns: 1fr 1fr 1fr; }
    .feature-grid   { grid-template-columns: 1fr 1fr; }
    .footer-inner   { flex-direction: column; gap: 0.5rem; }

    /* Timeline: single column */
    .timeline-item              { grid-template-columns: 1fr; gap: 0.1rem; }
    .timeline-item::before,
    .timeline-content::before   { display: none; }
    .timeline-date              { text-align: left; font-style: italic; margin-bottom: 0.1rem; }
    .timeline-content           { padding-left: 0; }
}
@media (max-width: 480px) {
    .milestone-grid { grid-template-columns: 1fr; }
    .ljt-meta       { grid-template-columns: 1fr 1fr; }
    .hero-name      { font-size: 2rem; }
    .feature-grid   { grid-template-columns: 1fr; }
    .grid-2         { grid-template-columns: 1fr; }
    .cv-dl-bar      { flex-direction: column; }
    .pub-filter     { gap: 0.3rem; }
    .pub-filter-btn { font-size: 0.72rem; padding: 0.25rem 0.65rem; }
    .hero-actions   { flex-direction: column; }
    .hero-actions .btn { text-align: center; justify-content: center; }
}

/* ── Print ───────────────────────────────────────────────────── */
@media print {
    #site-nav, #site-footer, .cv-dl-bar, .btn, .nav-hamburger { display: none !important; }
    body { background: #fff; color: #000; font-size: 11pt; }
    a    { color: #000; text-decoration: none; }
    .card, .skill-group { box-shadow: none; }
}


/* Academic site refinements */
.hero--research .hero-bio { max-width: 760px; font-size: 1.05rem; line-height: 1.8; }
.hero-aside--focus .hero-aside-val { font-size: 1.15rem; }
.research-focus-panel { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.research-focus-panel > div { background: var(--card-bg); border: 1px solid var(--border); border-radius: 14px; padding: 1.2rem; box-shadow: var(--shadow-sm); }
.research-focus-panel h3 { margin: 0 0 .45rem; font-size: 1rem; }
.research-focus-panel p { margin: 0; color: var(--text-muted); line-height: 1.65; font-size: .94rem; }
.split-panel { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: 1.5rem; align-items: stretch; }
.software-metric-card, .method-stack { background: var(--card-bg); border: 1px solid var(--border); border-radius: 14px; padding: 1.25rem; box-shadow: var(--shadow-sm); }
.software-metric-card strong { display: block; font-size: 1.15rem; margin-bottom: .6rem; }
.software-metric-card span { display: block; color: var(--text-muted); line-height: 1.65; }
.method-stack { display: grid; gap: .9rem; }
.method-stack div { padding-bottom: .85rem; border-bottom: 1px solid var(--border); }
.method-stack div:last-child { border-bottom: 0; padding-bottom: 0; }
.method-stack strong, .method-stack span { display: block; }
.method-stack span { color: var(--text-muted); font-size: .92rem; line-height: 1.55; margin-top: .2rem; }
.card-link { text-decoration: none; display: block; }
.card-link p { color: var(--text-muted); font-size: .94rem; margin-bottom: 0; }
.section-heading-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.5rem; }
.compact-actions { margin-top: 1.25rem; }
.meta-line { font-size: .84rem; color: var(--text-muted); margin-bottom: 1rem; }
.rich-text { line-height: 1.75; }
.project-card .card-title { font-size: 1.35rem; }
.text-centre { text-align: center; }
.hp-field { position: absolute; left: -5000px; width: 1px; height: 1px; overflow: hidden; }
.pd-page-hero--academic .pd-hero-sub { max-width: 720px; }
.pd-solo-icon { font-size: 1.5rem; }
@media (max-width: 860px) {
    .research-focus-panel, .split-panel { grid-template-columns: 1fr; }
    .section-heading-row { align-items: flex-start; flex-direction: column; }
}

/* Homepage research-focus side panel */
.hero-stats--focus {
    min-width: 280px;
    max-width: 330px;
}
.hero-stat-lbl--long {
    font-size: 0.78rem;
    line-height: 1.45;
    text-transform: none;
    letter-spacing: 0.01em;
    margin-top: 0.4rem;
}
.hero-stat-val--orcid {
    font-size: 1.1rem;
    line-height: 1.25;
    word-break: break-word;
}

/* ProtocolDock interlinked cluster map */
.pd-cluster-figure {
    margin-top: 1.75rem;
    background: #ffffff;
    border: 1px solid #d8dee8;
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    padding: 0.75rem;
    overflow: hidden;
}
.pd-cluster-svg {
    display: block;
    width: 100%;
    height: auto;
}
.pd-cluster-svg text {
    font-family: Inter, Arial, sans-serif;
}
.pd-svg-bg {
    fill: #ffffff;
    stroke: #e2e8f0;
    stroke-width: 1.5;
}
.pd-legend-bg,
.pd-corridor-label-bg {
    fill: rgba(255,255,255,0.92);
    stroke: #e2e8f0;
    stroke-width: 1;
}
.pd-cluster-panel {
    stroke-width: 1.8;
    fill-opacity: 0.52;
}
.pd-cluster-build {
    fill: #ecfdf5;
    stroke: #86efac;
}
.pd-cluster-write {
    fill: #fff7ed;
    stroke: #fdba74;
}
.pd-cluster-gov {
    fill: #fef9c3;
    stroke: #f59e0b;
}
.pd-cluster-output {
    fill: #eff6ff;
    stroke: #7dd3fc;
}
.pd-cluster-label {
    font-size: 21px;
    font-weight: 800;
    fill: #111827;
}
.pd-svg-note {
    font-size: 15px;
    fill: #334155;
}
.pd-svg-small {
    font-size: 13px;
    fill: #475569;
}
.pd-hub-panel {
    fill: #eef2ff;
    stroke: #818cf8;
    stroke-width: 2.2;
}
.pd-hub-title {
    font-size: 22px;
    font-weight: 800;
    fill: #111827;
}
.pd-hub-text {
    font-size: 16px;
    fill: #334155;
}
.pd-mini {
    stroke-width: 1.5;
}
.pd-mini-title {
    font-size: 15px;
    font-weight: 800;
    fill: #111827;
}
.pd-mini-text {
    font-size: 12px;
    fill: #334155;
}
.pd-mini-blue {
    fill: #e0f2fe;
    stroke: #7dd3fc;
}
.pd-mini-green {
    fill: #dcfce7;
    stroke: #86efac;
}
.pd-mini-orange {
    fill: #ffedd5;
    stroke: #fdba74;
}
.pd-mini-purple {
    fill: #ede9fe;
    stroke: #c4b5fd;
}
.pd-mini-yellow {
    fill: #fef3c7;
    stroke: #f59e0b;
}
.pd-svg-link {
    stroke: #334155;
    stroke-width: 2.2;
    fill: none;
    marker-end: url(#clusterArrow);
}
.pd-svg-link-soft {
    stroke: #94a3b8;
    stroke-width: 1.9;
    stroke-dasharray: 7 6;
    fill: none;
    marker-end: url(#clusterArrowSoft);
}
@media (max-width: 768px) {
    .hero-stats--focus {
        min-width: 100%;
        max-width: 100%;
    }
    .pd-cluster-figure {
        padding: 0.4rem;
    }
}

/* ProtocolDock-emulated portfolio and interactive lab */
.pdock-hero {
    background:
        radial-gradient(circle at top left, rgba(79,70,229,0.12), transparent 34%),
        linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-bottom: 1px solid #e2e8f0;
    padding: 5.4rem 0 4.4rem;
}
html[data-mode="dark"] .pdock-hero {
    background:
        radial-gradient(circle at top left, rgba(129,140,248,0.16), transparent 36%),
        linear-gradient(180deg, #020617 0%, #0f172a 100%);
    border-bottom-color: rgba(148,163,184,0.22);
}
.pdock-hero h1 {
    color: #0f172a;
    font-size: clamp(2.25rem, 5vw, 4.2rem);
    max-width: 840px;
    margin-bottom: 1rem;
    letter-spacing: -0.04em;
}
html[data-mode="dark"] .pdock-hero h1 { color: #f8fafc; }
.pdock-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: #4f46e5;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 1.2rem;
}
html[data-mode="dark"] .pdock-eyebrow {
    background: rgba(79,70,229,0.18);
    border-color: rgba(129,140,248,0.35);
    color: #c7d2fe;
}
.pdock-hero-lead {
    max-width: 760px;
    color: #475569;
    font-size: 1.08rem;
    line-height: 1.8;
    margin-bottom: 1.65rem;
}
html[data-mode="dark"] .pdock-hero-lead { color: #cbd5e1; }
.pdock-hero-actions,
.pdock-demo-controls {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}
.pdock-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    border-radius: 0.62rem;
    padding: 0.72rem 1rem;
    border: 1px solid transparent;
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.12s, box-shadow 0.12s, background 0.12s, border-color 0.12s;
}
.pdock-btn:hover {
    text-decoration: none;
    transform: translateY(-1px);
}
.pdock-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}
.pdock-btn-primary {
    background: #4f46e5;
    color: #ffffff;
    box-shadow: 0 10px 22px rgba(79,70,229,0.2);
}
.pdock-btn-primary:hover { background: #4338ca; color: #ffffff; }
.pdock-btn-secondary {
    background: #ffffff;
    color: #334155;
    border-color: #cbd5e1;
}
.pdock-btn-secondary:hover { background: #f8fafc; color: #111827; }
.pdock-btn-ghost {
    background: transparent;
    color: #475569;
    border-color: #e2e8f0;
}
.pdock-btn-ghost:hover { background: #f8fafc; color: #111827; }
html[data-mode="dark"] .pdock-btn-secondary,
html[data-mode="dark"] .pdock-btn-ghost {
    background: rgba(15,23,42,0.8);
    color: #e2e8f0;
    border-color: rgba(148,163,184,0.32);
}
html[data-mode="dark"] .pdock-btn-secondary:hover,
html[data-mode="dark"] .pdock-btn-ghost:hover {
    background: rgba(30,41,59,0.95);
    color: #ffffff;
}
.pdock-metric-grid,
.pdock-portfolio-grid,
.pdock-demo-index {
    display: grid;
    gap: 1rem;
}
.pdock-metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pdock-portfolio-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pdock-demo-index { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pdock-metric-card,
.pdock-portfolio-card,
.pdock-demo-tile,
.pdock-lab-card,
.pdock-cta-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(15,23,42,0.06), 0 1px 2px rgba(15,23,42,0.04);
}
html[data-mode="dark"] .pdock-metric-card,
html[data-mode="dark"] .pdock-portfolio-card,
html[data-mode="dark"] .pdock-demo-tile,
html[data-mode="dark"] .pdock-lab-card,
html[data-mode="dark"] .pdock-cta-card {
    background: rgba(15,23,42,0.9);
    border-color: rgba(148,163,184,0.25);
}
.pdock-metric-card {
    padding: 1.2rem;
}
.pdock-metric-card strong,
.pdock-portfolio-card h3,
.pdock-demo-tile strong,
.pdock-cta-card strong {
    display: block;
    color: #0f172a;
    margin-bottom: 0.45rem;
}
html[data-mode="dark"] .pdock-metric-card strong,
html[data-mode="dark"] .pdock-portfolio-card h3,
html[data-mode="dark"] .pdock-demo-tile strong,
html[data-mode="dark"] .pdock-cta-card strong {
    color: #f8fafc;
}
.pdock-metric-card span,
.pdock-portfolio-card p,
.pdock-demo-tile em,
.pdock-cta-card span {
    display: block;
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.62;
    font-style: normal;
}
html[data-mode="dark"] .pdock-metric-card span,
html[data-mode="dark"] .pdock-portfolio-card p,
html[data-mode="dark"] .pdock-demo-tile em,
html[data-mode="dark"] .pdock-cta-card span {
    color: #cbd5e1;
}
.pdock-showcase {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
    gap: 1.25rem;
    align-items: stretch;
}
.pdock-browser-card {
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(15,23,42,0.2);
}
.pdock-browser-top {
    height: 42px;
    border-bottom: 1px solid rgba(148,163,184,0.22);
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0 0.85rem;
    color: #94a3b8;
    font-size: 0.78rem;
}
.pdock-browser-top span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #475569;
}
.pdock-browser-top span:first-child { background: #ef4444; }
.pdock-browser-top span:nth-child(2) { background: #f59e0b; }
.pdock-browser-top span:nth-child(3) { background: #22c55e; }
.pdock-browser-top em {
    margin-left: auto;
    font-style: normal;
}
.pdock-browser-body {
    display: grid;
    grid-template-columns: 190px 1fr;
    min-height: 360px;
}
.pdock-sidebar-mock {
    background: #020617;
    border-right: 1px solid rgba(148,163,184,0.18);
    padding: 1rem;
    display: grid;
    gap: 0.55rem;
    align-content: start;
}
.pdock-sidebar-mock b {
    color: #ffffff;
    margin-bottom: 0.8rem;
}
.pdock-sidebar-mock span {
    color: #cbd5e1;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 0.55rem;
    padding: 0.52rem 0.6rem;
    font-size: 0.82rem;
}
.pdock-main-mock {
    background: #f8fafc;
    padding: 1rem;
}
.pdock-main-head {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.85rem;
    padding: 1rem;
    margin-bottom: 1rem;
}
.pdock-main-head strong { display: block; color: #0f172a; margin-bottom: 0.25rem; }
.pdock-main-head span { display: block; color: #64748b; font-size: 0.84rem; }
.pdock-progress-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.45rem;
    margin-bottom: 1rem;
}
.pdock-progress-row span {
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    padding: 0.35rem 0.4rem;
    text-align: center;
    font-size: 0.72rem;
    color: #475569;
    background: #ffffff;
}
.pdock-progress-row span.active {
    background: #eef2ff;
    border-color: #c7d2fe;
    color: #4f46e5;
    font-weight: 700;
}
.pdock-mini-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}
.pdock-mini-grid div {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.8rem;
    padding: 0.8rem;
}
.pdock-mini-grid b { display: block; color: #0f172a; font-size: 0.84rem; margin-bottom: 0.2rem; }
.pdock-mini-grid span { display: block; color: #64748b; font-size: 0.76rem; line-height: 1.45; }
.pdock-showcase-copy,
.pdock-cta-card {
    padding: 1.25rem;
}
.pdock-showcase-copy h3 { margin-bottom: 0.75rem; }
.pdock-check-list {
    list-style: none;
    display: grid;
    gap: 0.55rem;
    margin-top: 1rem;
    padding: 0;
}
.pdock-check-list li {
    color: #334155;
    font-size: 0.9rem;
    line-height: 1.5;
    padding-left: 1.6rem;
    position: relative;
}
.pdock-check-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 0;
    color: #4f46e5;
    font-weight: 900;
}
html[data-mode="dark"] .pdock-check-list li { color: #cbd5e1; }
.pdock-portfolio-card {
    padding: 1.2rem;
    position: relative;
}
.pdock-icon-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.6rem;
    background: #eef2ff;
    color: #4f46e5;
    font-weight: 800;
    font-size: 0.75rem;
    margin-bottom: 0.85rem;
}
.pdock-tags {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}
.pdock-tags span {
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #475569;
    border-radius: 999px;
    padding: 0.25rem 0.55rem;
    font-size: 0.72rem;
    font-weight: 700;
}
.pdock-split {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
    gap: 1.4rem;
    align-items: stretch;
}
.pdock-cta-card {
    display: grid;
    gap: 0.75rem;
    align-content: center;
}

/* Interactive Lab */
.pdock-demo-tile {
    padding: 1.15rem;
    color: #0f172a;
    text-decoration: none;
}
.pdock-demo-tile:hover {
    text-decoration: none;
    border-color: #c7d2fe;
    box-shadow: 0 10px 28px rgba(79,70,229,0.12);
}
.pdock-demo-tile span {
    display: inline-flex;
    width: 2rem;
    height: 2rem;
    border-radius: 0.65rem;
    align-items: center;
    justify-content: center;
    background: #eef2ff;
    color: #4f46e5;
    font-weight: 800;
    margin-bottom: 0.8rem;
}
.pdock-lab-card {
    padding: 1.25rem;
}
.pdock-lab-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}
.pdock-lab-header strong {
    display: block;
    color: #0f172a;
    font-size: 1.02rem;
}
.pdock-lab-header span {
    display: block;
    color: #64748b;
    font-size: 0.86rem;
}
html[data-mode="dark"] .pdock-lab-header strong { color: #f8fafc; }
html[data-mode="dark"] .pdock-lab-header span { color: #cbd5e1; }
.pdock-lab-status {
    display: flex;
    gap: 0.55rem;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    text-align: right;
}
.pdock-lab-status span,
.pdock-lab-status b {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    padding: 0.25rem 0.65rem;
    color: #475569;
    font-size: 0.78rem;
}
.gaze-stage {
    display: grid;
    place-items: center;
    gap: 1rem;
    min-height: 330px;
    background:
        radial-gradient(circle at center, rgba(79,70,229,0.08), transparent 38%),
        #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    margin-bottom: 1rem;
    padding: 1.5rem;
}
html[data-mode="dark"] .gaze-stage {
    background:
        radial-gradient(circle at center, rgba(129,140,248,0.14), transparent 40%),
        rgba(15,23,42,0.7);
    border-color: rgba(148,163,184,0.25);
}
.gaze-face {
    width: 230px;
    height: 230px;
    border-radius: 48% 48% 52% 52%;
    background: linear-gradient(180deg, #fff7ed, #fed7aa);
    border: 2px solid #fdba74;
    position: relative;
    box-shadow: inset 0 -18px 30px rgba(154,52,18,0.08), 0 22px 48px rgba(15,23,42,0.12);
}
.gaze-eye {
    position: absolute;
    top: 88px;
    width: 54px;
    height: 34px;
    background: #ffffff;
    border: 2px solid #0f172a;
    border-radius: 50%;
    overflow: hidden;
}
.gaze-eye-left { left: 52px; }
.gaze-eye-right { right: 52px; }
.gaze-eye span {
    position: absolute;
    width: 15px;
    height: 15px;
    background: #0f172a;
    border-radius: 50%;
    top: 8px;
    left: 8px;
    transition: left 0.12s ease;
}
.gaze-face.is-direct .gaze-eye span { left: 18px; }
.gaze-brow {
    position: absolute;
    top: 68px;
    width: 54px;
    height: 4px;
    background: #7c2d12;
    border-radius: 999px;
}
.gaze-brow-left { left: 52px; transform: rotate(-5deg); }
.gaze-brow-right { right: 52px; transform: rotate(5deg); }
.gaze-mouth {
    position: absolute;
    left: 50%;
    bottom: 55px;
    width: 48px;
    height: 16px;
    border-bottom: 3px solid #7c2d12;
    border-radius: 50%;
    transform: translateX(-50%);
}
.gaze-cue {
    color: #334155;
    font-weight: 800;
    text-align: center;
}
html[data-mode="dark"] .gaze-cue { color: #e2e8f0; }
.pdock-result-box {
    margin-top: 1rem;
    border: 1px solid #c7d2fe;
    background: #eef2ff;
    border-radius: 0.9rem;
    padding: 1rem;
}
.pdock-result-box strong {
    display: block;
    color: #312e81;
    margin-bottom: 0.4rem;
}
.pdock-result-box span {
    display: block;
    color: #334155;
    font-size: 0.9rem;
    line-height: 1.55;
    margin-top: 0.35rem;
}
.workflow-play-area {
    display: grid;
    grid-template-columns: minmax(260px, 0.85fr) minmax(0, 1.15fr);
    gap: 1.1rem;
}
.workflow-play-area h3 {
    margin-bottom: 0.7rem;
    color: #0f172a;
}
.workflow-tile-bank,
.workflow-sequence {
    display: grid;
    gap: 0.55rem;
}
.workflow-tile,
.workflow-sequence-item {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    border-radius: 0.75rem;
    padding: 0.75rem;
    color: #0f172a;
    cursor: pointer;
    text-align: left;
}
.workflow-tile {
    font-weight: 800;
}
.workflow-tile:hover {
    border-color: #a5b4fc;
    background: #f8fafc;
}
.workflow-tile.is-used,
.workflow-tile:disabled {
    opacity: 0.42;
    cursor: not-allowed;
}
.workflow-sequence {
    min-height: 260px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 0.9rem;
    padding: 0.75rem;
    margin-bottom: 1rem;
}
.workflow-placeholder {
    color: #64748b;
    align-self: center;
    justify-self: center;
}
.workflow-sequence-item {
    background: #ffffff;
    border-color: #c7d2fe;
}
.workflow-sequence-item strong {
    display: block;
    color: #0f172a;
    margin-bottom: 0.25rem;
}
.workflow-sequence-item span {
    display: block;
    color: #64748b;
    font-size: 0.82rem;
    line-height: 1.45;
}
.reader-demo-text {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 1.4rem;
    min-height: 170px;
    margin-bottom: 1rem;
    transition: transform 0.12s ease;
    will-change: transform;
}
.reader-demo-text p {
    max-width: 820px;
    margin: 0 auto;
    font-size: 1.05rem;
    line-height: 1.95;
    color: #1f2937;
}
.reader-unstable {
    box-shadow: 0 0 0 4px rgba(79,70,229,0.06);
}
[data-instability-mode].is-active {
    background: #4f46e5;
    border-color: #4f46e5;
    color: #ffffff;
}
html[data-mode="dark"] .workflow-play-area h3,
html[data-mode="dark"] .workflow-sequence-item strong { color: #f8fafc; }
html[data-mode="dark"] .workflow-tile,
html[data-mode="dark"] .workflow-sequence-item,
html[data-mode="dark"] .reader-demo-text {
    background: rgba(15,23,42,0.75);
    border-color: rgba(148,163,184,0.28);
    color: #e2e8f0;
}
html[data-mode="dark"] .workflow-sequence {
    background: rgba(15,23,42,0.45);
    border-color: rgba(148,163,184,0.35);
}
html[data-mode="dark"] .reader-demo-text p,
html[data-mode="dark"] .workflow-sequence-item span { color: #cbd5e1; }

@media (max-width: 980px) {
    .pdock-metric-grid,
    .pdock-portfolio-grid,
    .pdock-demo-index,
    .pdock-showcase,
    .pdock-split,
    .workflow-play-area {
        grid-template-columns: 1fr;
    }
    .pdock-browser-body {
        grid-template-columns: 1fr;
    }
    .pdock-sidebar-mock {
        display: none;
    }
}
@media (max-width: 720px) {
    .pdock-progress-row,
    .pdock-mini-grid {
        grid-template-columns: 1fr;
    }
    .pdock-lab-header {
        flex-direction: column;
    }
    .pdock-lab-status {
        justify-content: flex-start;
        text-align: left;
    }
    .gaze-stage {
        min-height: 285px;
    }
    .gaze-face {
        width: 190px;
        height: 190px;
    }
    .gaze-eye {
        top: 74px;
        width: 46px;
        height: 29px;
    }
    .gaze-eye-left { left: 42px; }
    .gaze-eye-right { right: 42px; }
    .gaze-brow { top: 58px; width: 46px; }
    .gaze-brow-left { left: 42px; }
    .gaze-brow-right { right: 42px; }
}

/* Mobile fixes for portfolio, interactive lab and ProtocolDock figure */
.pd-cluster-mobile {
    display: none;
}
@media (max-width: 860px) {
    html, body {
        overflow-x: hidden;
    }

    .section {
        padding: 3rem 0;
    }

    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .pd-cluster-figure {
        padding: 0;
        border: 0;
        box-shadow: none;
        background: transparent;
    }

    .pd-cluster-svg {
        display: none;
    }

    .pd-cluster-mobile {
        display: grid;
        gap: 1rem;
        margin-top: 1rem;
    }

    .pd-mobile-cluster,
    .pd-mobile-hub {
        border: 1.5px solid #d8dee8;
        border-radius: 14px;
        padding: 1rem;
        background: #ffffff;
        box-shadow: var(--shadow-sm);
    }

    html[data-mode="dark"] .pd-mobile-cluster,
    html[data-mode="dark"] .pd-mobile-hub {
        background: rgba(15,23,42,0.92);
        border-color: rgba(148,163,184,0.28);
    }

    .pd-mobile-cluster h3 {
        font-size: 1rem;
        margin-bottom: 0.35rem;
        color: #111827;
    }

    html[data-mode="dark"] .pd-mobile-cluster h3 {
        color: #f8fafc;
    }

    .pd-mobile-cluster p,
    .pd-mobile-hub span {
        color: #475569;
        font-size: 0.86rem;
        line-height: 1.55;
        margin-bottom: 0.85rem;
    }

    html[data-mode="dark"] .pd-mobile-cluster p,
    html[data-mode="dark"] .pd-mobile-hub span {
        color: #cbd5e1;
    }

    .pd-mobile-hub {
        text-align: center;
        border-color: #818cf8;
        background: #eef2ff;
        position: relative;
    }

    .pd-mobile-hub::before,
    .pd-mobile-hub::after,
    .pd-mobile-cluster:not(:last-child)::after {
        content: "↓";
        position: absolute;
        left: 50%;
        bottom: -1.05rem;
        transform: translateX(-50%);
        width: 1.8rem;
        height: 1.8rem;
        border-radius: 999px;
        display: grid;
        place-items: center;
        background: #ffffff;
        border: 1px solid #cbd5e1;
        color: #475569;
        font-weight: 900;
        z-index: 2;
    }

    .pd-mobile-hub::before {
        top: -1.05rem;
        bottom: auto;
    }

    .pd-mobile-hub strong {
        display: block;
        color: #111827;
        font-size: 1.02rem;
        margin-bottom: 0.25rem;
    }

    .pd-mobile-hub span {
        display: block;
        margin-bottom: 0;
    }

    .pd-mobile-node-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.55rem;
    }

    .pd-mobile-node-grid span {
        display: block;
        border: 1px solid #e2e8f0;
        background: rgba(255,255,255,0.75);
        border-radius: 0.75rem;
        padding: 0.7rem;
        color: #111827;
        font-weight: 800;
        line-height: 1.35;
    }

    html[data-mode="dark"] .pd-mobile-node-grid span {
        background: rgba(2,6,23,0.38);
        border-color: rgba(148,163,184,0.25);
        color: #f8fafc;
    }

    .pd-mobile-node-grid em {
        display: block;
        color: #64748b;
        font-style: normal;
        font-weight: 500;
        font-size: 0.78rem;
        margin-top: 0.15rem;
    }

    html[data-mode="dark"] .pd-mobile-node-grid em {
        color: #cbd5e1;
    }

    .pd-mobile-build {
        background: #ecfdf5;
        border-color: #86efac;
    }

    .pd-mobile-write {
        background: #fff7ed;
        border-color: #fdba74;
    }

    .pd-mobile-governance {
        background: #fef9c3;
        border-color: #f59e0b;
    }

    .pd-mobile-output {
        background: #eff6ff;
        border-color: #7dd3fc;
    }

    .pd-mobile-flow-pair {
        display: grid;
        gap: 1rem;
    }

    .pdock-hero {
        padding: 3.4rem 0 2.8rem;
    }

    .pdock-hero h1 {
        font-size: clamp(2rem, 11vw, 3rem);
        line-height: 1.05;
        letter-spacing: -0.035em;
    }

    .pdock-hero-lead {
        font-size: 1rem;
        line-height: 1.65;
    }

    .pdock-hero-actions,
    .pdock-demo-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .pdock-btn {
        width: 100%;
        min-height: 44px;
        text-align: center;
    }

    .pdock-metric-grid,
    .pdock-portfolio-grid,
    .pdock-demo-index,
    .pdock-showcase,
    .pdock-split,
    .workflow-play-area {
        grid-template-columns: 1fr !important;
    }

    .pdock-showcase-copy,
    .pdock-cta-card,
    .pdock-lab-card,
    .pdock-portfolio-card,
    .pdock-metric-card,
    .pdock-demo-tile {
        padding: 1rem;
    }

    .pdock-browser-card {
        border-radius: 0.85rem;
    }

    .pdock-browser-body {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .pdock-sidebar-mock {
        display: none;
    }

    .pdock-main-mock {
        padding: 0.85rem;
    }

    .pdock-progress-row,
    .pdock-mini-grid {
        grid-template-columns: 1fr;
    }

    .pdock-lab-header {
        flex-direction: column;
        align-items: stretch;
    }

    .pdock-lab-status {
        justify-content: flex-start;
        text-align: left;
    }

    .gaze-stage {
        min-height: 275px;
        padding: 1rem;
    }

    .gaze-face {
        width: 176px;
        height: 176px;
    }

    .gaze-eye {
        top: 68px;
        width: 43px;
        height: 27px;
    }

    .gaze-eye-left {
        left: 38px;
    }

    .gaze-eye-right {
        right: 38px;
    }

    .gaze-eye span {
        width: 13px;
        height: 13px;
        top: 6px;
    }

    .gaze-face.is-direct .gaze-eye span {
        left: 14px;
    }

    .gaze-brow {
        top: 53px;
        width: 43px;
    }

    .gaze-brow-left {
        left: 38px;
    }

    .gaze-brow-right {
        right: 38px;
    }

    .workflow-sequence {
        min-height: 180px;
    }

    .reader-demo-text {
        padding: 1rem;
    }

    .reader-demo-text p {
        font-size: 0.98rem;
        line-height: 1.75;
    }
}

@media (min-width: 861px) and (max-width: 1120px) {
    .pd-cluster-figure {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .pd-cluster-svg {
        min-width: 980px;
    }
}

/* Block 17 game page */
.b17-hero {
    background:
        radial-gradient(circle at 74% 24%, rgba(208,82,68,0.16), transparent 28%),
        radial-gradient(circle at 30% 18%, rgba(189,137,83,0.12), transparent 32%),
        linear-gradient(180deg, #080b0c 0%, #111719 66%, #0c1012 100%);
    color: #e8eee8;
    padding: 5.2rem 0 4.4rem;
    border-bottom: 1px solid rgba(197, 142, 82, 0.2);
}
.b17-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.92fr) minmax(420px, 1.08fr);
    gap: 2rem;
    align-items: center;
}
.b17-eyebrow,
.b17-section-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: #ffd29a;
    background: rgba(189,137,83,0.12);
    border: 1px solid rgba(189,137,83,0.38);
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 1rem;
}
.b17-hero h1 {
    color: #f7f2df;
    font-size: clamp(2.5rem, 6vw, 5rem);
    letter-spacing: -0.055em;
    margin-bottom: 1rem;
}
.b17-lead {
    color: #e1e4d9;
    font-size: 1.2rem;
    line-height: 1.75;
    max-width: 720px;
}
.b17-sublead {
    color: #aeb9b2;
    font-size: 1rem;
    line-height: 1.75;
    max-width: 660px;
}
.b17-hero-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin: 1.5rem 0 1rem;
}
.b17-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.7rem;
    padding: 0.76rem 1rem;
    border: 1px solid transparent;
    font-weight: 800;
    font-size: 0.9rem;
    text-decoration: none;
    transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}
.b17-btn:hover {
    transform: translateY(-1px);
    text-decoration: none;
}
.b17-btn-primary {
    background: #c7763e;
    color: #fff7ec;
    box-shadow: 0 12px 28px rgba(199,118,62,0.22);
}
.b17-btn-primary:hover { color: #fff7ec; background: #d28346; }
.b17-btn-secondary {
    color: #f0e7d5;
    background: rgba(255,255,255,0.04);
    border-color: rgba(229,218,196,0.22);
}
.b17-btn-secondary:hover {
    color: #ffffff;
    background: rgba(255,255,255,0.08);
}
.b17-quick-tags,
.b17-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.b17-quick-tags span,
.b17-card-tags span {
    border: 1px solid rgba(174,185,178,0.22);
    color: #c8d1ca;
    background: rgba(255,255,255,0.04);
    border-radius: 999px;
    padding: 0.3rem 0.65rem;
    font-size: 0.76rem;
    font-weight: 700;
}
.b17-hero-visual,
.b17-brand-card img,
.b17-showcase-image img {
    width: 100%;
    height: auto;
}
.b17-hero-visual {
    border: 1px solid rgba(189,137,83,0.28);
    border-radius: 1.25rem;
    overflow: hidden;
    box-shadow: 0 25px 90px rgba(0,0,0,0.38);
    background: #080b0c;
}
.b17-dark-section,
.b17-simulator-section {
    background: #0c1012;
    color: #e8eee8;
}
.b17-section-title {
    color: #f7f2df;
    font-size: clamp(1.65rem, 3.2vw, 2.3rem);
    max-width: 860px;
    margin-bottom: 0.8rem;
}
.b17-section-lead {
    color: #aeb9b2;
    max-width: 780px;
    margin-bottom: 2rem;
}
.b17-principle-grid,
.b17-system-grid,
.b17-mech-grid,
.b17-roadmap {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}
.b17-principle-card,
.b17-system-card,
.b17-showcase,
.b17-simulator,
.b17-roadmap > div,
.b17-brand-card,
.b17-mech-card,
.b17-feature-panel,
.b17-timeline-item,
.b17-steam-callout {
    border: 1px solid rgba(148,163,184,0.22);
    border-radius: 1rem;
    background: rgba(255,255,255,0.04);
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}
.b17-principle-card,
.b17-system-card,
.b17-mech-card,
.b17-roadmap > div {
    padding: 1.1rem;
}
.b17-principle-card span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.65rem;
    background: rgba(199,118,62,0.14);
    color: #ffd29a;
    font-weight: 900;
    font-size: 0.75rem;
    margin-bottom: 0.8rem;
}
.b17-principle-card h3,
.b17-system-card h3,
.b17-showcase-copy h3,
.b17-brand-copy h3,
.b17-mech-card h3,
.b17-feature-panel h3,
.b17-steam-callout h3 {
    color: #f7f2df;
    margin-bottom: 0.55rem;
}
.b17-principle-card p,
.b17-system-card p,
.b17-brand-copy p,
.b17-mech-card p,
.b17-feature-panel p,
.b17-feature-panel li,
.b17-timeline-item p,
.b17-steam-callout p {
    color: #b9c2bc;
    font-size: 0.9rem;
    line-height: 1.65;
}
.b17-brand-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}
.b17-brand-card {
    overflow: hidden;
}
.b17-brand-card img {
    display: block;
    background: #06090a;
    border-bottom: 1px solid rgba(148,163,184,0.18);
}
.b17-brand-copy {
    padding: 1rem;
}
.b17-showcase {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
    gap: 1rem;
    background: #101719;
    padding: 1rem;
}
.b17-showcase-image {
    border-radius: 0.9rem;
    overflow: hidden;
    border: 1px solid rgba(148,163,184,0.2);
}
.b17-showcase-copy {
    padding: 1rem;
}
.b17-checks,
.b17-bullets {
    display: grid;
    gap: 0.75rem;
    padding: 0;
    margin: 1rem 0 0;
}
.b17-checks li,
.b17-bullets li {
    position: relative;
    color: var(--text-muted);
    padding-left: 1.5rem;
    font-size: 0.92rem;
    line-height: 1.55;
}
.b17-checks li::before,
.b17-bullets li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.55rem;
    width: 0.55rem;
    height: 0.55rem;
    background: #c7763e;
    border-radius: 2px;
    transform: rotate(45deg);
}
.b17-loop {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.75rem;
}
.b17-loop-step {
    position: relative;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(148,163,184,0.22);
    border-radius: 1rem;
    padding: 1rem;
    min-height: 150px;
}
.b17-loop-step:not(:last-child)::after {
    content: "→";
    position: absolute;
    right: -0.72rem;
    top: 50%;
    transform: translateY(-50%);
    color: #c7763e;
    font-size: 1.4rem;
    font-weight: 900;
}
.b17-loop-step strong {
    display: block;
    color: #ffd29a;
    font-size: 1.4rem;
    margin-bottom: 0.75rem;
}
.b17-loop-step span {
    color: #d3dbd5;
    font-size: 0.9rem;
    line-height: 1.5;
}
.b17-system-card {
    background: var(--surface);
}
.b17-system-card h3 {
    color: var(--heading);
}
.b17-system-card p {
    color: var(--text-muted);
}
.b17-system-card .b17-card-tags span {
    color: var(--text-muted);
    border-color: var(--border);
    background: var(--bg);
}
.b17-mech-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 1rem;
}
.b17-feature-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}
.b17-feature-panel {
    padding: 1rem;
}
.b17-simulator {
    display: grid;
    grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.2fr);
    gap: 1rem;
    padding: 1rem;
    background: #111719;
}
.b17-sim-panel {
    display: grid;
    gap: 0.85rem;
}
.b17-sim-panel label {
    display: grid;
    gap: 0.38rem;
    color: #f1eadb;
    font-size: 0.86rem;
    font-weight: 800;
}
.b17-sim-panel select,
.b17-sim-panel input[type="range"] {
    width: 100%;
}
.b17-sim-panel select {
    border: 1px solid rgba(148,163,184,0.3);
    background: #0c1012;
    color: #e8eee8;
    border-radius: 0.7rem;
    padding: 0.7rem;
}
.b17-sim-panel input[type="range"] {
    accent-color: #c7763e;
}
.b17-sim-panel label span {
    color: #aeb9b2;
    font-weight: 600;
}
.b17-sim-output {
    display: grid;
    gap: 1rem;
    align-content: start;
}
.b17-heat-gauge {
    height: 24px;
    background: #222a2d;
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid rgba(148,163,184,0.24);
}
.b17-heat-bar {
    width: 65%;
    height: 100%;
    border-radius: 999px;
    transition: width 0.2s ease, background 0.2s ease;
    background: linear-gradient(90deg, #55b579, #e0b552, #d05244);
}
.b17-sim-result {
    border: 1px solid rgba(148,163,184,0.22);
    background: rgba(255,255,255,0.04);
    border-radius: 1rem;
    padding: 1.1rem;
}
.b17-sim-result span {
    display: inline-flex;
    border-radius: 999px;
    padding: 0.25rem 0.65rem;
    background: rgba(199,118,62,0.16);
    color: #ffd29a;
    font-size: 0.75rem;
    font-weight: 900;
    margin-bottom: 0.7rem;
    text-transform: uppercase;
}
.b17-sim-result span[data-band="low"] { background: rgba(85,181,121,0.14); color: #a9f4c3; }
.b17-sim-result span[data-band="moderate"] { background: rgba(224,181,82,0.15); color: #ffe2a2; }
.b17-sim-result span[data-band="high"] { background: rgba(199,118,62,0.18); color: #ffd29a; }
.b17-sim-result span[data-band="critical"] { background: rgba(208,82,68,0.18); color: #ffc0b8; }
.b17-sim-result strong {
    display: block;
    color: #f7f2df;
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}
.b17-sim-result p {
    color: #c6d0ca;
    line-height: 1.65;
}
.b17-sim-warnings {
    display: grid;
    gap: 0.5rem;
}
.b17-sim-warnings span {
    border: 1px solid rgba(148,163,184,0.2);
    background: rgba(255,255,255,0.035);
    color: #d4ddd8;
    border-radius: 0.75rem;
    padding: 0.65rem 0.8rem;
    font-size: 0.86rem;
}
.b17-timeline {
    display: grid;
    gap: 1rem;
}
.b17-timeline-item {
    padding: 1rem 1.1rem;
    background: rgba(255,255,255,0.04);
}
.b17-timeline-item strong {
    display: block;
    color: #f7f2df;
    margin-bottom: 0.45rem;
}
.b17-steam-callout {
    margin-top: 1rem;
    padding: 1rem 1.1rem;
    border-color: rgba(199,118,62,0.35);
    background: rgba(199,118,62,0.08);
}
.b17-roadmap > div {
    background: var(--surface);
}
.b17-roadmap strong {
    display: block;
    color: var(--heading);
    margin-bottom: 0.45rem;
}
.b17-roadmap span {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
}
@media (max-width: 1060px) {
    .b17-hero-grid,
    .b17-showcase,
    .b17-simulator,
    .b17-brand-grid,
    .b17-feature-columns {
        grid-template-columns: 1fr;
    }
    .b17-principle-grid,
    .b17-system-grid,
    .b17-roadmap {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .b17-mech-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .b17-loop {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .b17-loop-step:not(:last-child)::after {
        display: none;
    }
}
@media (max-width: 720px) {
    .b17-hero {
        padding: 3.2rem 0 2.8rem;
    }
    .b17-hero-grid {
        gap: 1.25rem;
    }
    .b17-hero-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .b17-btn {
        width: 100%;
    }
    .b17-principle-grid,
    .b17-system-grid,
    .b17-roadmap,
    .b17-loop,
    .b17-mech-grid,
    .b17-feature-columns,
    .b17-brand-grid {
        grid-template-columns: 1fr;
    }
    .b17-showcase,
    .b17-simulator {
        padding: 0.75rem;
    }
    .b17-quick-tags {
        display: none;
    }
}


/* Block 17 branding dark section fix */
#branding {
    background: #06090a;
    color: #e8eee8;
}

#branding .section-eyebrow {
    color: #ffd29a;
    background: rgba(189,137,83,0.12);
    border-color: rgba(189,137,83,0.38);
}

#branding .section-title {
    color: #f7f2df;
}

#branding .section-lead {
    color: #aeb9b2;
}

#branding .b17-brand-card {
    background: #0b0f11;
    border-color: rgba(148,163,184,0.22);
}

#branding .b17-brand-copy h3 {
    color: #f7f2df;
}

#branding .b17-brand-copy p {
    color: #b9c2bc;
}

html[data-mode="dark"] #branding {
    background: #06090a;
    color: #e8eee8;
}

html[data-mode="dark"] #branding .section-title {
    color: #f7f2df;
}

html[data-mode="dark"] #branding .section-lead,
html[data-mode="dark"] #branding .b17-brand-copy p {
    color: #b9c2bc;
}

/* Block 17 mechanics readability fix */
#mechanics .b17-mech-card,
#mechanics .b17-feature-panel {
    background: #ffffff;
    border-color: #d8dee8;
}

#mechanics .b17-mech-card h3,
#mechanics .b17-feature-panel h3 {
    color: #111827;
}

#mechanics .b17-mech-card p,
#mechanics .b17-feature-panel p,
#mechanics .b17-feature-panel li {
    color: #475569;
}

#mechanics .b17-bullets li::before {
    background: #c7763e;
}

html[data-mode="dark"] #mechanics .b17-mech-card,
html[data-mode="dark"] #mechanics .b17-feature-panel {
    background: rgba(15,23,42,0.9);
    border-color: rgba(148,163,184,0.28);
}

html[data-mode="dark"] #mechanics .b17-mech-card h3,
html[data-mode="dark"] #mechanics .b17-feature-panel h3 {
    color: #f7f2df;
}

html[data-mode="dark"] #mechanics .b17-mech-card p,
html[data-mode="dark"] #mechanics .b17-feature-panel p,
html[data-mode="dark"] #mechanics .b17-feature-panel li {
    color: #cbd5e1;
}
