/* Portfolio: Georges Sainte-Rose. Tokens first; dark theme follows the system unless the visitor picks one. */
:root {
  --bg: #f4f5f7; --surface: #ffffff; --surface-2: #eef1f5; --ink: #0d1424; --ink-2: #4a5568; --ink-3: #7b8597;
  --line: #dfe4ec; --accent: #0f9f97; --accent-ink: #0b7c76; --accent-soft: #e2f5f3; --gold: #c99412; --gold-soft: #fbf3df;
  --confirm-bg: #fff6e0; --confirm-line: #f0c96a; --confirm-ink: #7a5300;
  --hero-bg: #070d1a; --hero-ink: #eef2f8; --hero-ink-2: #a8b3c7; --hero-cell: #121c31; --hero-cell-line: #1d2a44;
  --shadow: 0 1px 2px rgb(13 20 36 / .06), 0 8px 24px rgb(13 20 36 / .06);
  --shadow-lg: 0 24px 64px rgb(0 0 0 / .28);
  --radius: 14px; --wrap: 1180px;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", "SF Mono", Consolas, ui-monospace, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0f19; --surface: #111827; --surface-2: #172033; --ink: #e8ecf3; --ink-2: #a9b3c4; --ink-3: #7d889b;
    --line: #222d42; --accent: #2dd4c4; --accent-ink: #5eead4; --accent-soft: #0f2a2b; --gold: #e5b437; --gold-soft: #2a2312;
    --confirm-bg: #2a2111; --confirm-line: #6b5216; --confirm-ink: #f3cd73;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px rgb(0 0 0 / .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0f19; --surface: #111827; --surface-2: #172033; --ink: #e8ecf3; --ink-2: #a9b3c4; --ink-3: #7d889b;
  --line: #222d42; --accent: #2dd4c4; --accent-ink: #5eead4; --accent-soft: #0f2a2b; --gold: #e5b437; --gold-soft: #2a2312;
  --confirm-bg: #2a2111; --confirm-line: #6b5216; --confirm-ink: #f3cd73;
  --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px rgb(0 0 0 / .25);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--font); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
body.noscroll { overflow: hidden; }
img, video { display: block; max-width: 100%; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; margin: 0; letter-spacing: -0.015em; }
p { margin: 0; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ico { display: inline-flex; width: 18px; height: 18px; flex: none; }
.ico svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- nav ---------- */
.nav { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--hero-bg) 88%, transparent); backdrop-filter: saturate(140%) blur(12px); border-bottom: 1px solid rgb(255 255 255 / .06); color: var(--hero-ink); }
.nav-in { max-width: 1400px; margin: 0 auto; padding: 0 20px; height: 60px; display: flex; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--hero-ink); font-weight: 600; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.mono { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, #22d3c5, #0f766e); color: #04211f; font: 700 12px/1 var(--mono); letter-spacing: .04em; }
.nav-links { display: flex; gap: 2px; margin: 0 auto; overflow-x: auto; scrollbar-width: none; }
.nav-links a { color: var(--hero-ink-2); padding: 6px 11px; border-radius: 999px; font-size: 14px; white-space: nowrap; transition: color .2s, background .2s; }
.nav-links a:hover { color: var(--hero-ink); text-decoration: none; background: rgb(255 255 255 / .06); }
.nav-links a.on { color: #04211f; background: #5eead4; }
.nav-tools { display: flex; gap: 6px; align-items: center; }
.tbtn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 11px; border-radius: 9px; border: 1px solid rgb(255 255 255 / .12); background: rgb(255 255 255 / .04); color: var(--hero-ink); cursor: pointer; font-size: 13.5px; white-space: nowrap; }
.tbtn:hover { background: rgb(255 255 255 / .1); text-decoration: none; }
.tbtn[aria-pressed="true"] { border-color: #f0c96a; color: #ffe3a3; background: rgb(240 201 106 / .12); }
.tbtn.cta { background: #5eead4; color: #04211f; border-color: transparent; font-weight: 600; }
.tbtn.icon-only { padding: 0 8px; }
.tbtn .n:empty { display: none; }
.tbtn .n { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: #f0c96a; color: #3a2600; font-size: 12px; font-weight: 700; display: grid; place-items: center; }
@media (max-width: 1080px) { .brand-name { display: none; } }
@media (max-width: 860px) { .nav-links { display: none; } .nav-tools { margin-left: auto; } }
@media (max-width: 520px) { .tbtn .lbl { display: none; } .tbtn { padding: 0 8px; } }
body:not(.edit) .only-edit { display: none !important; }

/* ---------- hero ---------- */
.hero { position: relative; background: var(--hero-bg); color: var(--hero-ink); overflow: hidden; isolation: isolate; }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background:
  radial-gradient(60% 70% at 18% 40%, rgb(7 13 26 / .97) 0%, rgb(7 13 26 / .86) 45%, rgb(7 13 26 / .35) 100%),
  linear-gradient(180deg, transparent 70%, var(--hero-bg)); }
.hero-grid { position: absolute; inset: 0; z-index: -2; opacity: .9; }
.hero-grid svg { width: 100%; height: 100%; }
.hero-grid .el { fill: var(--hero-cell); stroke: var(--hero-cell-line); stroke-width: .35; transition: fill .5s ease; }
.hero-grid .el.on { fill: #3b2d0a; stroke: #e5b437; }
.hero-grid .drop { fill: rgb(94 234 212 / .5); stroke: #5eead4; stroke-width: .5; transition: transform .6s cubic-bezier(.5, 0, .3, 1); filter: drop-shadow(0 0 2px #2dd4c4); }
.hero-in { max-width: var(--wrap); margin: 0 auto; padding: 88px 24px 40px; display: grid; grid-template-columns: 1.35fr 0.85fr; gap: 56px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; color: #5eead4; font-size: 14px; letter-spacing: .02em; margin-bottom: 18px; }
.hero h1 { font-size: clamp(40px, 6vw, 72px); font-weight: 700; letter-spacing: -0.03em; }
.roles { margin-top: 12px; color: var(--hero-ink-2); font-size: clamp(16px, 1.7vw, 19px); }
.roles .dot { margin: 0 10px; color: #5eead4; }
.tagline { margin-top: 26px; font-size: clamp(17px, 1.6vw, 20px); line-height: 1.6; color: #d6deea; max-width: 40em; }
.hero-cta { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 10px; }
.btn { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 11px; font-weight: 600; font-size: 15px; border: 1px solid transparent; cursor: pointer; }
.btn:hover { text-decoration: none; }
.btn.primary { background: #5eead4; color: #04211f; }
.btn.primary:hover { background: #99f6e4; }
.btn.ghost { border-color: rgb(255 255 255 / .18); color: var(--hero-ink); background: rgb(255 255 255 / .03); }
.btn.ghost:hover { background: rgb(255 255 255 / .09); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13.5px; border-radius: 8px; }
.portrait { position: relative; margin: 0; justify-self: center; width: min(100%, 380px); }
.portrait img { width: 100%; height: auto; aspect-ratio: 517 / 687; object-fit: cover; border-radius: 22px; box-shadow: 0 30px 80px rgb(0 0 0 / .55), 0 0 0 1px rgb(255 255 255 / .08); }
.portrait::before { content: ""; position: absolute; inset: -14px -14px 14px 14px; border-radius: 26px; border: 1px solid rgb(94 234 212 / .35); z-index: -1; }
.hero-stats { max-width: var(--wrap); margin: 0 auto; padding: 8px 24px 64px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: rgb(255 255 255 / .08); border: 1px solid rgb(255 255 255 / .08); border-radius: 16px; overflow: hidden; }
.stat { background: rgb(9 16 31 / .92); padding: 22px 22px 20px; display: flex; flex-direction: column; gap: 6px; }
.stat b { font: 700 40px/1 var(--font-display); color: #5eead4; letter-spacing: -0.02em; }
.stat:nth-child(even) b { color: #e5b437; }
.stat span { color: var(--hero-ink-2); font-size: 14px; line-height: 1.45; }
@media (max-width: 900px) {
  .hero-in { grid-template-columns: 1fr; padding-top: 48px; gap: 36px; }
  .portrait { order: -1; width: min(70%, 280px); justify-self: start; }
  .stats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) { .stats { grid-template-columns: 1fr; } .hero-cta .btn { width: 100%; justify-content: center; } .portrait::before { display: none; } }

/* ---------- sections ---------- */
.section { padding: 96px 0; }
.section + .section { border-top: 1px solid var(--line); }
.sec-head { max-width: 760px; margin-bottom: 48px; }
.kicker { font: 600 12.5px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--accent-ink); }
.sec-head h2, .ch-main h2 { font-size: clamp(30px, 3.6vw, 46px); font-weight: 700; margin-top: 10px; }
.lede { margin-top: 18px; font-size: clamp(17px, 1.5vw, 19px); color: var(--ink-2); line-height: 1.65; }

/* journey */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 150px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(var(--accent), var(--gold) 60%, var(--line)); border-radius: 2px; }
.tl-item { position: relative; display: grid; grid-template-columns: 130px 40px 1fr; align-items: start; padding: 10px 0; }
.tl-years { font: 600 14px/1.4 var(--mono); color: var(--ink-2); text-align: right; padding-top: 18px; }
.tl-dot { width: 14px; height: 14px; border-radius: 50%; margin: 21px 0 0 14px; background: var(--surface); border: 3px solid var(--accent); z-index: 1; }
.k-award .tl-dot { border-color: var(--gold); }
.k-edu .tl-dot { border-color: var(--ink-3); }
.tl-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; box-shadow: var(--shadow); }
.tl-head { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.tl-role { font-weight: 650; font-size: 16.5px; }
.tl-org { color: var(--accent-ink); font-weight: 600; font-size: 15px; }
.k-award .tl-org { color: var(--gold); }
.k-edu .tl-org { color: var(--ink-2); }
.tl-card p { margin-top: 6px; color: var(--ink-2); font-size: 15px; }
.tl-more { display: inline-block; margin-top: 8px; font-size: 14px; font-weight: 600; }
.k-edu .tl-card { background: transparent; box-shadow: none; border-style: dashed; padding: 10px 20px; }
.legend { display: flex; gap: 18px; margin: 20px 0 0 170px; font-size: 13px; color: var(--ink-3); }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; border: 2.5px solid var(--accent); vertical-align: -1px; }
.legend .k-award::before { border-color: var(--gold); }
.legend .k-edu::before { border-color: var(--ink-3); }
@media (max-width: 700px) {
  .timeline::before { left: 7px; }
  .tl-item { grid-template-columns: 1fr; padding-left: 30px; }
  .tl-years { text-align: left; padding: 0 0 6px; }
  .tl-dot { position: absolute; left: 1px; top: 12px; margin: 0; }
  .legend { margin-left: 30px; flex-wrap: wrap; }
}

/* chapters */
.chapter:nth-of-type(even) { background: var(--surface-2); }
.ch-head { display: grid; grid-template-columns: 220px 1fr; gap: 40px; margin-bottom: 56px; }
.ch-side { display: flex; flex-direction: column; gap: 6px; padding-top: 8px; border-top: 2px solid var(--ink); align-self: start; position: sticky; top: 84px; }
.ch-num { font: 700 64px/1 var(--font-display); color: var(--accent); letter-spacing: -0.04em; margin-top: 10px; }
.ch-period { font: 600 14px/1.4 var(--mono); color: var(--ink); }
.ch-org { color: var(--ink-2); font-size: 14.5px; line-height: 1.45; }
.ch-main { max-width: 820px; }
.ch-main h2 { margin-top: 0; }
.highlights { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 10px; }
.highlights li { position: relative; padding: 12px 16px 12px 44px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; color: var(--ink); font-size: 15.5px; }
.highlights li::before { content: ""; position: absolute; left: 16px; top: 18px; width: 12px; height: 12px; border-radius: 3px; background: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
@media (max-width: 860px) { .ch-head { grid-template-columns: 1fr; gap: 20px; } .ch-side { position: static; flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; } .ch-num { font-size: 44px; } }

.group { margin-top: 56px; }
.group:first-of-type { margin-top: 0; }
.group h3 { font-size: 22px; font-weight: 650; display: inline-block; }
.group-text { margin-top: 10px; max-width: 820px; color: var(--ink-2); }
.group > .confirm { max-width: 820px; }
.gallery { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 22px; align-items: flex-start; }
@media (max-width: 560px) { .gallery { gap: 12px; } }

/* cards */
.card { margin: 0; cursor: zoom-in; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; transition: transform .25s ease, box-shadow .25s ease; width: 300px; }
.card:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgb(13 20 36 / .08), 0 16px 40px rgb(13 20 36 / .12); }
.frame { position: relative; height: 240px; background: #0b1220; overflow: hidden; }
.frame img, .frame video { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.card:hover .frame img { transform: scale(1.03); }
.badge { position: absolute; left: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px 3px 6px; border-radius: 99px; background: rgb(7 13 26 / .72); color: #fff; font: 600 12px/1.4 var(--mono); backdrop-filter: blur(4px); }
.badge .ico { width: 14px; height: 14px; }
.badge .ico svg { fill: currentColor; stroke: none; }
.badge .ico svg path[d^="M4 12"] { fill: none; stroke: currentColor; }
.qflag { position: absolute; right: 10px; top: 10px; display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px 3px 6px; border-radius: 99px; background: #f6c453; color: #3a2600; font-size: 12px; font-weight: 700; box-shadow: 0 2px 8px rgb(0 0 0 / .25); }
.qflag .ico { width: 14px; height: 14px; }
body:not(.edit) .qflag, body:not(.edit) .confirm { display: none; }
.card figcaption { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 3px; }
.card figcaption b { font-size: 15px; font-weight: 650; line-height: 1.35; }
.card figcaption span { font-size: 13.5px; color: var(--ink-2); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.feature { margin: 22px 0 0; border-radius: 18px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.feature-frame { position: relative; background: #000; max-height: 72vh; width: 100%; }
.feature-frame video { width: 100%; height: 100%; object-fit: contain; }
.feature figcaption { padding: 18px 22px 20px; display: grid; gap: 6px; }
.feature figcaption b { font-size: 18px; }
.feature figcaption span { color: var(--ink-2); }
.linkbtn { justify-self: start; background: none; border: 0; padding: 0; color: var(--accent-ink); font-weight: 600; cursor: pointer; font-size: 14.5px; }

/* confirm notes */
.confirm { margin-top: 12px; padding: 10px 14px; border-radius: 10px; background: var(--confirm-bg); border: 1px solid var(--confirm-line); color: var(--confirm-ink); font-size: 14px; line-height: 1.5; }
.confirm b { display: inline-block; margin-right: 8px; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; }

/* skills */
.skill-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.skill { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 22px 18px; box-shadow: var(--shadow); }
.skill h3 { font-size: 18px; font-weight: 650; padding-bottom: 12px; margin-bottom: 10px; border-bottom: 1px solid var(--line); }
.skill ul, .langs ul { list-style: none; margin: 0; padding: 0; }
.skill li { padding: 4px 0 4px 18px; position: relative; color: var(--ink-2); font-size: 15px; }
.skill li::before { content: ""; position: absolute; left: 0; top: 13px; width: 7px; height: 7px; border-radius: 2px; background: var(--accent); }
.langs { margin-top: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: center; }
.langs h3 { font-size: 18px; font-weight: 650; }
.langs ul { display: flex; flex-wrap: wrap; gap: 10px 28px; }
.langs li { display: flex; gap: 10px; align-items: center; color: var(--ink-2); }
.meter { display: inline-flex; gap: 4px; }
.meter i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.meter i.on { background: var(--accent); }
@media (max-width: 960px) { .skill-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .skill-grid { grid-template-columns: 1fr; } }

/* bridge */
.bridge { background: var(--hero-bg); color: var(--hero-ink); --ink: var(--hero-ink); --ink-2: var(--hero-ink-2); --line: #1d2a44; --surface: #0d1628; --accent-ink: #5eead4; --accent: #5eead4; }
.section.bridge + * { border-top: 0; }
.bridge .ch-side { border-top-color: #5eead4; }
.bridge-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.bp { position: relative; background: #0d1628; border: 1px solid #1d2a44; border-radius: var(--radius); padding: 22px; }
.bp-n { font: 700 13px/1 var(--mono); color: #e5b437; }
.bp h3 { margin-top: 12px; font-size: 18px; }
.bp p { margin-top: 8px; color: var(--hero-ink-2); font-size: 14.5px; }
@media (max-width: 1000px) { .bridge-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .bridge-grid { grid-template-columns: 1fr; } }

.footer { background: var(--hero-bg); color: var(--hero-ink); border-top: 1px solid #1d2a44; padding: 36px 0 44px; }
.foot-in { display: flex; flex-wrap: wrap; gap: 20px 40px; justify-content: space-between; align-items: center; }
.foot-links { display: flex; flex-wrap: wrap; gap: 10px 26px; }
.foot-links a { color: var(--hero-ink-2); display: inline-flex; gap: 6px; align-items: center; }
.foot-links a:hover { color: #5eead4; }

/* ---------- comment targets ---------- */
.c-target { position: relative; }
.c-btn { position: absolute; top: 8px; right: 8px; z-index: 5; display: none; align-items: center; gap: 3px; height: 28px; min-width: 28px; padding: 0 6px; border-radius: 99px; border: 1px solid var(--confirm-line); background: var(--surface); color: var(--confirm-ink); cursor: pointer; box-shadow: 0 2px 10px rgb(0 0 0 / .18); }
.c-btn .ico { width: 16px; height: 16px; }
.c-count { font-size: 12px; font-weight: 700; }
.c-count:empty { display: none; }
body.edit .c-btn.has, body.edit .c-target:hover > .c-btn, body.edit .c-target:focus-within > .c-btn { display: inline-flex; }
body.edit .c-btn.open { background: #f6c453; color: #3a2600; border-color: #f6c453; }
body.edit .c-target:hover { outline: 1.5px dashed var(--confirm-line); outline-offset: 4px; border-radius: 6px; }
body.edit .card.c-target:hover, body.edit .feature.c-target:hover { outline-offset: 2px; border-radius: var(--radius); }
.card > .c-btn { top: auto; bottom: auto; right: 10px; top: 44px; }
.card:not(:has(.qflag)) > .c-btn { top: 10px; }
.hero .c-btn { background: #1b2740; color: #ffe3a3; border-color: #6b5216; }
.tl-item > .c-btn, .highlights li > .c-btn { top: 50%; transform: translateY(-50%); right: 10px; }
.flash { animation: flash 2.2s ease; }
@keyframes flash { 0%, 30% { box-shadow: 0 0 0 4px #f6c453; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ---------- lightbox ---------- */
.lb { position: fixed; inset: 0; z-index: 80; display: grid; grid-template-columns: 1fr 400px; background: rgb(4 8 16 / .94); backdrop-filter: blur(6px); }
.lb[hidden] { display: none; }
.lb-stage { position: relative; display: grid; place-items: center; padding: 28px 72px; min-width: 0; min-height: 0; }
.lb-media { max-width: 100%; max-height: 100%; display: grid; place-items: center; min-height: 0; }
.lb-media img, .lb-media video { max-width: 100%; max-height: calc(100vh - 56px); object-fit: contain; border-radius: 8px; box-shadow: var(--shadow-lg); background: #000; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgb(255 255 255 / .15); background: rgb(255 255 255 / .06); color: #fff; cursor: pointer; display: grid; place-items: center; }
.lb-nav:hover { background: rgb(255 255 255 / .16); }
.lb-nav.prev { left: 14px; } .lb-nav.next { right: 14px; }
.lb-nav .ico { width: 22px; height: 22px; }
.lb-side { background: var(--surface); color: var(--ink); overflow-y: auto; padding: 22px 22px 28px; position: relative; display: flex; flex-direction: column; gap: 18px; }
.lb-close { position: absolute; right: 12px; top: 12px; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; display: grid; place-items: center; }
.lb-close:hover { background: var(--surface-2); }
.lb-info { padding-right: 40px; display: grid; gap: 10px; }
.lb-info h3 { font-size: 21px; }
.lb-info p { color: var(--ink-2); font-size: 15px; }
.lb-info .confirm { margin-top: 0; }
.lb-info .file { font: 12.5px/1.5 var(--mono); color: var(--ink-3); word-break: break-all; }
@media (max-width: 900px) {
  .lb { grid-template-columns: 1fr; grid-template-rows: minmax(0, 55vh) 1fr; }
  .lb-stage { padding: 12px 56px; }
  .lb-media img, .lb-media video { max-height: calc(55vh - 24px); }
  .lb-nav { width: 38px; height: 38px; }
  .lb-nav.prev { left: 8px; } .lb-nav.next { right: 8px; }
}

/* ---------- threads & drawer ---------- */
.lb-thread, .dr-thread { border-top: 1px solid var(--line); padding-top: 16px; }
.th-title { display: flex; align-items: center; gap: 6px; font-weight: 650; margin-bottom: 10px; }
.th-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 10px; }
.th-item { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.th-item.other { background: var(--accent-soft); }
.th-item.resolved { opacity: .6; }
.th-item.resolved .th-text { text-decoration: line-through; text-decoration-color: var(--ink-3); }
.th-meta { display: flex; gap: 8px; align-items: baseline; font-size: 13px; }
.th-text { margin-top: 4px; white-space: pre-wrap; font-size: 14.5px; color: var(--ink); }
.th-tools { display: flex; gap: 12px; margin-top: 6px; }
.th-tools button { background: none; border: 0; padding: 0; font-size: 12.5px; color: var(--ink-3); cursor: pointer; }
.th-tools button:hover { color: var(--accent-ink); text-decoration: underline; }
.th-form textarea, .th-edit textarea { width: 100%; resize: vertical; min-height: 84px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: 14.5px/1.5 var(--font); }
.th-form textarea:focus, .th-edit textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.th-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 8px; }
.th-edit { display: grid; gap: 6px; margin-top: 6px; justify-items: end; }
.lb-thread .btn.primary, .drawer .btn.primary { background: var(--accent); color: #fff; }
:root[data-theme="dark"] .lb-thread .btn.primary, :root[data-theme="dark"] .drawer .btn.primary { color: #04211f; }
.btn.ghost.sm { color: var(--ink); border-color: var(--line); background: var(--surface); }

.drawer { position: fixed; z-index: 70; top: 60px; right: 0; bottom: 0; width: min(440px, 100vw); background: var(--surface); border-left: 1px solid var(--line); box-shadow: -20px 0 60px rgb(0 0 0 / .18); display: flex; flex-direction: column; }
.drawer[hidden] { display: none; }
.dr-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 12px 16px; border-bottom: 1px solid var(--line); }
.dr-head .lb-close { position: static; }
.dr-tabs { display: flex; gap: 4px; }
.dr-tabs button { border: 1px solid transparent; background: none; padding: 6px 12px; border-radius: 8px; cursor: pointer; color: var(--ink-2); font-size: 14px; }
.dr-tabs button.on { background: var(--surface-2); border-color: var(--line); color: var(--ink); font-weight: 600; }
.dr-body { overflow-y: auto; padding: 18px 18px 28px; display: flex; flex-direction: column; gap: 14px; }
.dr-label { font-size: 18px; margin-top: -6px; }
.dr-summary { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; font-size: 14px; color: var(--ink-2); }
.dr-summary b { color: var(--ink); }
.chk { margin-left: auto; display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.dr-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.dr-list > li { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.dr-jump { background: none; border: 0; padding: 0; font-weight: 650; cursor: pointer; text-align: left; color: var(--ink); font-size: 14.5px; }
.dr-jump:hover { color: var(--accent-ink); }
.dr-list ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 8px; }
.dr-list ul li p { font-size: 14px; white-space: pre-wrap; }
.dr-list ul li.resolved { opacity: .55; }
.dr-export { display: flex; gap: 8px; margin-top: 6px; }
.note { padding: 10px 12px; border-radius: 10px; background: var(--confirm-bg); border: 1px solid var(--confirm-line); color: var(--confirm-ink); font-size: 13.5px; }
.empty { padding: 18px; border: 1px dashed var(--line); border-radius: 12px; display: grid; gap: 6px; font-size: 14.5px; }
@media (min-width: 1300px) { body.drawer-open main, body.drawer-open .footer { margin-right: 440px; } }

/* ---------- print ---------- */
@media print {
  .nav, .c-btn, .qflag, .confirm, .drawer, .lb, .hero-grid, .hero-cta, .badge { display: none !important; }
  .hero, .bridge, .footer { background: #fff !important; color: #000 !important; }
  .hero::after { display: none; }
  .hero h1, .tagline, .stat b, .stat span, .roles, .bp p, .bp h3 { color: #000 !important; }
  .stat { background: #fff; }
  .section { padding: 32px 0; break-inside: avoid-page; }
  .card { break-inside: avoid; box-shadow: none; }
  .ch-side { position: static; }
}

/* short groups: text beside pictures */
.group.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 20px 48px; align-items: start; }
.group.split .gallery { margin-top: 4px; }
.group.split .group-text { font-size: 16.5px; }
@media (max-width: 860px) { .group.split { grid-template-columns: 1fr; } }
.nw { white-space: nowrap; }
.frame img { object-position: center 30%; }

/* questions list in the drawer */
.q-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; counter-reset: q; }
.q-list li button { width: 100%; text-align: left; display: grid; gap: 4px; padding: 10px 12px 10px 40px; position: relative; border-radius: 12px; border: 1px solid var(--confirm-line); background: var(--confirm-bg); cursor: pointer; }
.q-list li button::before { counter-increment: q; content: counter(q); position: absolute; left: 10px; top: 10px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: #f6c453; color: #3a2600; font-size: 12px; font-weight: 700; }
.q-list li.done button { background: var(--surface); border-color: var(--line); }
.q-list li.done button::before { content: "✓"; background: var(--accent); color: #fff; }
.q-label { font-weight: 650; font-size: 14px; color: var(--ink); }
.q-ok { color: var(--accent-ink); font-weight: 600; }
.q-text { font-size: 13.5px; color: var(--confirm-ink); line-height: 1.45; }
.q-list li.done .q-text { color: var(--ink-3); }
.dr-summary .linkbtn { font-size: 14px; color: var(--ink-2); font-weight: 400; }
.dr-summary .linkbtn b { color: var(--confirm-ink); }
