/* Portexa — UX case study
   Soft-toned, minimal, accessible. Inter only, no gradients. */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap");

:root {
  --bg: #F4F2ED;
  --surface: #FFFFFF;
  --surface-2: #ECE9E2;
  --ink: #1C201D;
  --ink-2: #4C524D;
  --muted: #5F655F;
  --line: #DCD8CF;
  --line-strong: #BDB8AC;
  --brand: #2F4A3E;
  --brand-ink: #FFFFFF;
  --brand-soft: #DCE7DF;
  --focus: #2F4A3E;

  --sage: #DCE7DF;   --sage-ink: #24453A;
  --clay: #F3DED4;   --clay-ink: #84391F;
  --lilac: #E6E1F3;  --lilac-ink: #463A78;
  --sand: #F4ECCB;   --sand-ink: #5F4A0C;
  --mist: #DCE8F0;   --mist-ink: #24506B;

  --ok: #24614A;     --ok-bg: #DCEDE3;
  --bad: #A3301E;    --bad-bg: #FBE6E1;
  --warn: #6B4E06;   --warn-bg: #F7EDC8;

  --radius: 18px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(28, 32, 29, .05), 0 12px 32px -18px rgba(28, 32, 29, .22);
  --wrap: 1180px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131714; --surface: #1B201D; --surface-2: #232A26; --ink: #ECEEEA; --ink-2: #C3C9C4; --muted: #A4ABA5;
    --line: #313934; --line-strong: #4A544D; --brand: #A9CDB8; --brand-ink: #10201A; --brand-soft: #22332B; --focus: #A9CDB8;
    --sage: #22332B; --sage-ink: #BFDCCB; --clay: #3A2720; --clay-ink: #F2C3AF; --lilac: #2B2740; --lilac-ink: #D2CAF2;
    --sand: #352F18; --sand-ink: #EEDC9C; --mist: #1E2F3A; --mist-ink: #B8D6EA;
    --ok: #8FD3AE; --ok-bg: #1D3328; --bad: #F4A897; --bad-bg: #3B221D; --warn: #EAD18A; --warn-bg: #352D16;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 14px 34px -18px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #131714; --surface: #1B201D; --surface-2: #232A26; --ink: #ECEEEA; --ink-2: #C3C9C4; --muted: #A4ABA5;
  --line: #313934; --line-strong: #4A544D; --brand: #A9CDB8; --brand-ink: #10201A; --brand-soft: #22332B; --focus: #A9CDB8;
  --sage: #22332B; --sage-ink: #BFDCCB; --clay: #3A2720; --clay-ink: #F2C3AF; --lilac: #2B2740; --lilac-ink: #D2CAF2;
  --sand: #352F18; --sand-ink: #EEDC9C; --mist: #1E2F3A; --mist-ink: #B8D6EA;
  --ok: #8FD3AE; --ok-bg: #1D3328; --bad: #F4A897; --bad-bg: #3B221D; --warn: #EAD18A; --warn-bg: #352D16;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 14px 34px -18px rgba(0,0,0,.6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 132px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 17px/1.65 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-feature-settings: "cv11", "ss01"; overflow-wrap: anywhere;
  transition: background-color .3s ease, color .3s ease;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { line-height: 1.15; margin: 0; letter-spacing: -.02em; font-weight: 700; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; }
code, .mono { font-family: var(--mono); font-size: .86em; }

.skip { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--brand); color: var(--brand-ink); padding: 10px 16px; border-radius: 10px; font-weight: 600; }
.skip:focus { top: 12px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: min(100% - 32px, var(--wrap)); margin-inline: auto; }

/* ---------- Header ---------- */
.top { position: sticky; top: 0; z-index: 40; background: color-mix(in oklab, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top__in { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; text-decoration: none; min-width: 0; }
.brand__mark { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--brand); color: var(--brand-ink); font-size: 13px; font-weight: 800; flex: none; }
.brand__sub { color: var(--muted); font-weight: 500; }
.top__sp { flex: 1; }
.btn-ghost { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; font-weight: 600; font-size: 15px; text-decoration: none; }
.btn-ghost:hover { border-color: var(--ink-2); }
.progress { position: absolute; left: 0; bottom: -1px; height: 3px; width: 100%; transform-origin: 0 50%; transform: scaleX(0); background: var(--brand); }

/* loop nav */
.loop { border-top: 1px solid var(--line); }
.loop ol { list-style: none; display: flex; gap: 6px; overflow-x: auto; padding: 8px 0; scrollbar-width: thin; }
.loop a { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; padding: 6px 12px; min-height: 36px; border-radius: 999px; text-decoration: none; font-size: 14px; font-weight: 500; color: var(--ink-2); }
.loop a span { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.loop a:hover { background: var(--surface-2); }
.loop a[aria-current="true"] { background: var(--brand); color: var(--brand-ink); }
.loop a[aria-current="true"] span { color: inherit; opacity: .85; }

/* ---------- Hero ---------- */
.hero { padding: 64px 0 40px; }
.hero__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 48px; align-items: center; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; font-size: 14px; font-weight: 600; background: var(--surface); border: 1px solid var(--line); }
.chip--sage { background: var(--sage); color: var(--sage-ink); border-color: transparent; }
.chip--clay { background: var(--clay); color: var(--clay-ink); border-color: transparent; }
.chip--lilac { background: var(--lilac); color: var(--lilac-ink); border-color: transparent; }
.chip--sand { background: var(--sand); color: var(--sand-ink); border-color: transparent; }
.chip--mist { background: var(--mist); color: var(--mist-ink); border-color: transparent; }
.kicker { font: 600 13px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 24px 0 12px; }
.hero h1 { font-size: clamp(56px, 9vw, 112px); letter-spacing: -.055em; font-weight: 800; line-height: .95; }
.hero__lede { font-size: clamp(21px, 2.3vw, 27px); line-height: 1.4; letter-spacing: -.015em; margin: 22px 0 18px; max-width: 34ch; }
.hero__body { color: var(--ink-2); max-width: 56ch; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 12px; font-weight: 600; text-decoration: none; border: 1px solid transparent; cursor: pointer; }
.btn--primary { background: var(--brand); color: var(--brand-ink); }
.btn--primary:hover { filter: brightness(1.08); }
.btn--line { border-color: var(--line-strong); background: var(--surface); }
.btn--line:hover { border-color: var(--ink-2); }

.stage { position: relative; padding: 18px 0 40px; }
.browser { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.browser__bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.browser__bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); }
.browser__bar span { margin-left: 10px; font: 500 12px var(--mono); color: var(--muted); }
.phone { position: absolute; right: -10px; bottom: 0; width: 30%; max-width: 190px; border-radius: 26px; padding: 6px; background: #1C201D; box-shadow: var(--shadow); }
.phone img { border-radius: 20px; }
.float { position: absolute; display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 14px; font-weight: 600; }
.float b { font-family: var(--mono); font-weight: 500; }
.float--a { left: -18px; top: 0; }
.float--b { left: 8%; bottom: 6px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); flex: none; }

.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin-top: 48px; }
.facts > div { padding: 18px 20px; border-left: 1px solid var(--line); }
.facts > div:first-child { border-left: 0; }
.facts dt { font: 600 12px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.facts dd { margin: 0; font-size: 15px; line-height: 1.55; }

/* ---------- Sections ---------- */
.sec { padding: 88px 0; border-top: 1px solid var(--line); }
.sec--tint { background: var(--surface-2); }
.sec__head { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 32px; margin-bottom: 40px; }
.sec__num { font: 500 13px/1.6 var(--mono); color: var(--muted); padding-top: 8px; }
.sec__num strong { display: block; color: var(--ink); font-family: Inter, sans-serif; font-size: 15px; font-weight: 600; }
.sec h2 { font-size: clamp(30px, 4vw, 46px); letter-spacing: -.035em; max-width: 22ch; }
.sec__intro { color: var(--ink-2); font-size: 19px; max-width: 62ch; margin-top: 16px; }
.body { margin-left: 212px; }
h3 { font-size: 22px; letter-spacing: -.02em; margin-bottom: 10px; }
h4 { font-size: 17px; letter-spacing: -.01em; margin-bottom: 6px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; min-width: 0; }
.card p:last-child { margin-bottom: 0; }
.card--flat { background: transparent; }
.stat { font-size: clamp(38px, 5vw, 52px); font-weight: 800; letter-spacing: -.045em; line-height: 1; margin-bottom: 10px; }
.tag { display: inline-flex; align-items: center; gap: 6px; font: 600 12px/1 var(--mono); letter-spacing: .04em; text-transform: uppercase; padding: 6px 9px; border-radius: 7px; }
.tag::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: currentColor; }
.tag--designed { background: var(--sage); color: var(--sage-ink); }
.tag--annotated { background: var(--lilac); color: var(--lilac-ink); }
.tag--assumed { background: var(--sand); color: var(--sand-ink); }
.tag--planned { background: var(--mist); color: var(--mist-ink); }

.legend { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; padding: 14px 18px; border: 1px dashed var(--line-strong); border-radius: 14px; margin-top: 28px; font-size: 14px; color: var(--ink-2); }
.legend h2 { font-size: 14px; letter-spacing: 0; font-weight: 600; color: var(--ink); max-width: none; }
.legend ul { list-style: none; display: flex; flex-wrap: wrap; gap: 10px 22px; }
.legend li { display: inline-flex; align-items: center; gap: 8px; }

/* problem */
.problem { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.scatter { position: relative; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.scatter li { padding: 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); font-size: 15px; }
.scatter li b { display: block; font-size: 16px; margin-bottom: 2px; }
.scatter li:nth-child(1) { background: var(--sage); border-color: transparent; color: var(--sage-ink); }
.scatter li:nth-child(2) { background: var(--clay); border-color: transparent; color: var(--clay-ink); }
.scatter li:nth-child(3) { background: var(--lilac); border-color: transparent; color: var(--lilac-ink); }
.scatter li:nth-child(4) { background: var(--sand); border-color: transparent; color: var(--sand-ink); }
.scatter li:nth-child(5) { background: var(--mist); border-color: transparent; color: var(--mist-ink); }
.quote { font-size: clamp(22px, 2.6vw, 30px); line-height: 1.3; letter-spacing: -.02em; font-weight: 600; margin: 0 0 18px; }
.hmw { list-style: none; display: grid; gap: 10px; margin-top: 18px; }
.hmw li { padding: 14px 16px 14px 46px; position: relative; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.hmw li::before { content: "HMW"; position: absolute; left: 12px; top: 16px; font: 600 10px var(--mono); color: var(--muted); letter-spacing: .04em; writing-mode: vertical-rl; transform: rotate(180deg); }

/* personas */
.persona { display: flex; flex-direction: column; gap: 10px; }
.avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 15px; }
.persona ul { list-style: none; display: grid; gap: 6px; font-size: 15px; color: var(--ink-2); }
.persona li { padding-left: 18px; position: relative; }
.persona li::before { content: ""; position: absolute; left: 2px; top: .7em; width: 7px; height: 7px; border-radius: 2px; background: var(--line-strong); }

/* tabs */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); width: fit-content; max-width: 100%; }
.tabs [role="tab"] { border: 0; background: transparent; padding: 9px 16px; min-height: 44px; border-radius: 10px; cursor: pointer; font-weight: 600; font-size: 15px; color: var(--ink-2); }
.tabs [role="tab"]:hover { background: var(--surface-2); }
.tabs [role="tab"][aria-selected="true"] { background: var(--brand); color: var(--brand-ink); }
.panel { margin-top: 20px; }

.concept { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.verdict { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; padding: 6px 12px; border-radius: 10px; font-size: 14px; }
.verdict--keep { background: var(--ok-bg); color: var(--ok); }
.verdict--drop { background: var(--bad-bg); color: var(--bad); }
.verdict svg { width: 16px; height: 16px; }
.pc { list-style: none; display: grid; gap: 8px; font-size: 15px; }
.pc li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; }
.pc .i { font-weight: 700; }

/* write-once model */
.model { display: grid; grid-template-columns: minmax(0, 1fr) 48px minmax(0, .9fr) 48px minmax(0, 1fr); align-items: center; gap: 8px; }
.model__col { display: grid; gap: 8px; list-style: none; }
.model__col li { padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; font-size: 15px; font-weight: 500; }
.model__col li small { display: block; font-weight: 400; color: var(--muted); font-size: 13px; }
.model__core { padding: 22px; border-radius: 18px; background: var(--brand); color: var(--brand-ink); text-align: center; }
.model__core strong { display: block; font-size: 20px; margin-bottom: 6px; }
.model__core span { font-size: 14px; opacity: .9; }
.model__arrow { display: grid; place-items: center; color: var(--muted); }
.model__arrow svg { width: 32px; height: 32px; }
.model__label { font: 600 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }

/* compare slider */
.compare { position: relative; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); --pos: 50%; }
.compare img { width: 100%; }
.compare .cmp-after { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--pos)); }
.compare .cmp-line { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 3px; margin-left: -1.5px; background: var(--brand); pointer-events: none; }
.compare .cmp-line::after { content: "⇆"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: var(--brand-ink); font-weight: 700; }
.compare__tags { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; justify-content: space-between; pointer-events: none; }
.compare__tags span { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; font: 600 12px var(--mono); }
.range { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; margin-top: 14px; font-size: 14px; color: var(--ink-2); }
.range input { width: 100%; accent-color: var(--brand); min-height: 32px; }
.changes { list-style: none; display: grid; gap: 10px; margin-top: 20px; }
.changes li { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; font-size: 15px; }
.changes .n { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--sage); color: var(--sage-ink); font: 600 12px var(--mono); }

/* IA */
.ia { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.ia__grp { border-radius: 16px; padding: 18px; background: var(--surface); border: 1px solid var(--line); }
.ia__grp h3 { font-size: 15px; font-family: var(--mono); letter-spacing: .06em; text-transform: uppercase; font-weight: 600; margin-bottom: 12px; }
.ia__grp ol { list-style: none; display: grid; gap: 8px; }
.ia__grp li { font-size: 15px; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 6px; }
.ia__grp li span { font: 500 12px/1.9 var(--mono); color: var(--muted); }
.ia__grp--admin { background: var(--lilac); border-color: transparent; color: var(--lilac-ink); }
.ia__grp--admin li span { color: inherit; opacity: .8; }

/* plan explorer */
.plans { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 20px; align-items: start; }
.seg { display: grid; gap: 10px; border: 0; padding: 0; margin: 0; }
.seg legend { font-weight: 600; margin-bottom: 10px; padding: 0; }
.opt { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.opt:hover { border-color: var(--line-strong); }
.opt:has(input:checked) { border: 2px solid var(--brand); padding: 13px 15px; }
.opt:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 3px; }
.opt input { width: 18px; height: 18px; accent-color: var(--brand); margin: 0; }
.opt b { display: block; }
.opt small { color: var(--muted); font-size: 13px; }
.opt .price { font: 600 15px var(--mono); }
.feat { list-style: none; display: grid; gap: 8px; }
.feat li { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: 15px; }
.feat li[data-on="true"] .ic { background: var(--ok-bg); color: var(--ok); }
.feat li[data-on="false"] { background: transparent; border-style: dashed; }
.feat li[data-on="false"] .ic { background: var(--surface-2); color: var(--muted); }
.feat .ic { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.feat small { display: block; color: var(--muted); font-size: 13px; }
.feat .state { font: 600 11px var(--mono); letter-spacing: .05em; text-transform: uppercase; }

/* state machine */
.flow { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.flow li { display: inline-flex; align-items: center; gap: 8px; }
.node { padding: 8px 14px; border-radius: 10px; font-weight: 600; font-size: 14px; border: 1px solid var(--line); background: var(--surface); }
.node--req { background: var(--sand); color: var(--sand-ink); border-color: transparent; }
.node--ok { background: var(--sage); color: var(--sage-ink); border-color: transparent; }
.node--alt { background: var(--mist); color: var(--mist-ink); border-color: transparent; }
.node--end { background: var(--clay); color: var(--clay-ink); border-color: transparent; }
.arrow { color: var(--muted); }
.lanes { display: grid; gap: 14px; }
.lane { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 14px; align-items: center; padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.lane__k { font: 600 12px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

/* journey viewer */
.journey { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 24px; align-items: start; }
.steps { list-style: none; display: grid; gap: 6px; counter-reset: s; }
.steps button { width: 100%; text-align: left; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; align-items: start; padding: 11px 12px; border-radius: 12px; background: transparent; border: 1px solid transparent; cursor: pointer; min-height: 44px; }
.steps button:hover { background: var(--surface); border-color: var(--line); }
.steps button[aria-current="step"] { background: var(--surface); border-color: var(--brand); box-shadow: inset 3px 0 0 var(--brand); }
.steps .k { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font: 600 12px var(--mono); background: var(--surface-2); }
.steps button[aria-current="step"] .k { background: var(--brand); color: var(--brand-ink); }
.steps b { display: block; font-size: 15px; }
.steps small { color: var(--muted); font-size: 13px; }
.viewer figure { margin: 0; }
.viewer__img { border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.viewer__img--phone { max-width: 320px; margin-inline: auto; }
.viewer figcaption { margin-top: 14px; color: var(--ink-2); font-size: 16px; }
.viewer__nav { display: flex; gap: 10px; align-items: center; justify-content: space-between; margin-top: 14px; }
.viewer__nav p { margin: 0; font: 500 13px var(--mono); color: var(--muted); }

/* decisions */
.decisions { display: grid; gap: 16px; counter-reset: d; }
.decision { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 0; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.decision__txt { padding: 26px; }
.decision__img { background: var(--surface-2); padding: 18px; display: flex; align-items: center; border-left: 1px solid var(--line); }
.decision__img img { border-radius: 10px; border: 1px solid var(--line); }
.decision__img button { padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 10px; width: 100%; }
.decision h3 { display: flex; gap: 12px; align-items: baseline; }
.decision h3::before { counter-increment: d; content: "D" counter(d); font: 600 13px var(--mono); color: var(--muted); }
.dl { display: grid; gap: 12px; margin: 14px 0 0; }
.dl div { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; font-size: 15px; }
.dl dt { font: 600 12px/1.9 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.dl dd { margin: 0; }

/* accessibility labs */
.lab { border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); padding: 24px; }
.lab__head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: baseline; margin-bottom: 14px; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; border: 0; padding: 0; margin: 0 0 16px; }
.swatches legend { font-weight: 600; font-size: 15px; margin-bottom: 10px; padding: 0; }
.sw { position: relative; }
.sw input { position: absolute; opacity: 0; width: 44px; height: 44px; margin: 0; cursor: pointer; }
.sw span { display: block; width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--line-strong); }
.sw input:checked + span { box-shadow: 0 0 0 3px var(--ink); }
.sw input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 4px; }
.custom { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: 15px; margin-bottom: 18px; }
.custom input[type="color"] { width: 48px; height: 44px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); padding: 3px; cursor: pointer; }
.preview { border-radius: 14px; padding: 22px; border: 1px solid var(--line); display: grid; gap: 12px; }
.preview__btn { display: inline-flex; width: fit-content; padding: 10px 18px; border-radius: 10px; font-weight: 600; }
.preview__link { font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.results { list-style: none; display: grid; gap: 8px; margin-top: 16px; }
.results li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 12px; font-size: 15px; }
.results li[data-pass="true"] { background: var(--ok-bg); color: var(--ok); }
.results li[data-pass="false"] { background: var(--bad-bg); color: var(--bad); }
.results .ratio { font: 600 14px var(--mono); }
.results .ic { font-weight: 800; }

.form { display: grid; gap: 16px; }
.field label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.field .hint { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input { width: 100%; min-height: 46px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--bg); color: var(--ink); font: inherit; font-size: 16px; }
.field input[aria-invalid="true"] { border: 2px solid var(--bad); }
.field .err { display: flex; gap: 6px; margin-top: 6px; font-size: 14px; font-weight: 600; color: var(--bad); }
.prefix { display: flex; align-items: stretch; }
.prefix span { display: grid; place-items: center; padding: 0 10px; font: 500 13px var(--mono); color: var(--muted); border: 1px solid var(--line-strong); border-right: 0; border-radius: 10px 0 0 10px; background: var(--surface-2); white-space: nowrap; }
.prefix input { border-radius: 0 10px 10px 0; }
.summary { border: 2px solid var(--bad); background: var(--bad-bg); border-radius: 14px; padding: 16px 18px; }
.summary h4 { color: var(--bad); }
.summary ul { list-style: none; display: grid; gap: 4px; }
.summary a { color: var(--bad); font-weight: 600; }
.success { border-radius: 14px; padding: 14px 18px; background: var(--ok-bg); color: var(--ok); font-weight: 600; }
.anno { display: flex; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--lilac); color: var(--lilac-ink); font-size: 14px; margin-top: 16px; }
.anno b { font-family: var(--mono); font-size: 12px; letter-spacing: .04em; white-space: nowrap; padding-top: 2px; }

.checks { list-style: none; display: grid; gap: 10px; }
.checks li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); font-size: 15px; }
.checks .ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--sage); color: var(--sage-ink); font: 600 12px var(--mono); }
.checks b { display: block; font-size: 16px; }

/* gallery */
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; list-style: none; }
.shot { margin: 0; }
.shot button { display: block; width: 100%; padding: 0; border: 1px solid var(--line); background: var(--surface); border-radius: 14px; overflow: hidden; cursor: zoom-in; box-shadow: var(--shadow); transition: transform .2s ease; }
.shot button:hover { transform: translateY(-2px); }
.shot img { aspect-ratio: 1440 / 1024; object-fit: cover; object-position: top; width: 100%; }
.shot figcaption { margin-top: 10px; font-size: 14px; color: var(--ink-2); }
.shot figcaption b { display: block; color: var(--ink); font-size: 15px; }
.phones { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; list-style: none; }
.phones .shot img { aspect-ratio: 390 / 844; }
.phones .shot button { border-radius: 22px; padding: 5px; background: #1C201D; border: 0; }
.phones .shot button img { border-radius: 18px; }

/* validation */
.plan-tbl { width: 100%; border-collapse: collapse; font-size: 15px; background: var(--surface); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
/* Indented to line up with the column text and to stay clear of the rounded, clipped corner
   of the table and its scroll wrapper (which cut off the first letter at the left edge). */
.plan-tbl caption { text-align: left; font-weight: 600; margin-bottom: 10px; padding: 0 16px; }
.plan-tbl th, .plan-tbl td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.plan-tbl thead th { font: 600 12px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); overflow-wrap: normal; word-break: keep-all; }
.plan-tbl tr:last-child td, .plan-tbl tr:last-child th { border-bottom: 0; }
.tbl-scroll { overflow-x: auto; border-radius: var(--radius); }

.lessons { list-style: none; display: grid; gap: 14px; counter-reset: l; }
.lessons li { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 14px; padding: 18px 0; border-top: 1px solid var(--line); }
.lessons li::before { counter-increment: l; content: "0" counter(l); font: 500 26px var(--mono); color: var(--muted); }

.foot { padding: 48px 0 64px; border-top: 1px solid var(--line); font-size: 14px; color: var(--ink-2); }
.foot__in { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center; }

/* lightbox */
dialog.lightbox { width: min(1200px, 100% - 24px); max-height: calc(100% - 24px); border: 0; border-radius: 18px; padding: 0; background: var(--surface); color: var(--ink); box-shadow: 0 30px 80px rgba(0,0,0,.35); }
dialog.lightbox::backdrop { background: rgba(14, 18, 15, .72); }
.lightbox__bar { position: sticky; top: 0; display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--line); z-index: 1; }
.lightbox__bar h2 { font-size: 16px; letter-spacing: 0; max-width: none; }
.lightbox__body { padding: 16px; }
.lightbox__body img { margin-inline: auto; border-radius: 10px; border: 1px solid var(--line); }
.lightbox__body p { margin: 12px 0 0; color: var(--ink-2); font-size: 15px; }

/* reveal */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
  .reveal.is-in { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .body { margin-left: 0; }
  .sec__head { grid-template-columns: 1fr; gap: 10px; }
  .ia { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .hero__grid, .problem, .concept, .plans, .journey, .decision { grid-template-columns: minmax(0, 1fr); }
  .decision__img { border-left: 0; border-top: 1px solid var(--line); }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts > div:nth-child(3) { border-left: 0; }
  .facts > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .model { grid-template-columns: minmax(0, 1fr); }
  .model__arrow svg { transform: rotate(90deg); }
  .phones { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stage { margin-top: 10px; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .sec { padding: 64px 0; }
  .brand__sub { display: none; }
  .g2, .g3, .g4, .ia, .gallery, .scatter { grid-template-columns: minmax(0, 1fr); }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .facts > div { border-left: 0 !important; border-top: 1px solid var(--line); }
  .facts > div:first-child { border-top: 0; }
  .lane { grid-template-columns: minmax(0, 1fr); }
  .dl div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .float--a { left: 0; }
  .phone { right: 0; }
  .btn-ghost .lbl { display: none; }
  .lessons li { grid-template-columns: 40px minmax(0, 1fr); }
}
@media print {
  .top, .loop, .cta, .viewer__nav, .range { display: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .sec { padding: 24px 0; break-inside: avoid-page; }
}
.tag--demo { background: var(--clay); color: var(--clay-ink); }
.decision h3::before { flex: none; white-space: nowrap; }

/* ---------- Live site section ---------- */
.dir { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 28px; align-items: start; }
.mini { display: grid; gap: 10px; margin: 18px 0; }
.mini div { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 12px; font-size: 15px; }
.mini dt { font: 600 12px/1.9 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.mini dd { margin: 0; }
.chips--sm .chip { font-size: 13px; padding: 4px 10px; font-weight: 500; }
.scroller { margin: 0; }
.scroller__win { height: 560px; overflow-y: auto; overscroll-behavior: contain; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.scroller__win img { width: 100%; }
.scroller figcaption { margin-top: 10px; font-size: 14px; color: var(--muted); }
.roles { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 20px; align-items: start; }
.roles__out h4 { font-size: 18px; margin-bottom: 12px; }
.modchips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.modchips li { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px 8px 8px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: 15px; font-weight: 500; }
.modchips .k { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; background: var(--brand); color: var(--brand-ink); font: 600 12px var(--mono); }
.lib { border-radius: 16px; padding: 18px; background: var(--surface-2); border: 1px solid var(--line); }
.lib__grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-top: 8px; }
.lib__grp h5 { margin: 0 0 8px; font-size: 14px; font-weight: 700; }
.lib__grp h5 span { font: 500 12px var(--mono); color: var(--muted); margin-left: 4px; }
.lib__grp ul { list-style: none; display: grid; gap: 4px; font-size: 14px; color: var(--ink-2); }
@media (max-width: 1080px) { .lib__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) { .dir, .roles { grid-template-columns: minmax(0, 1fr); } .scroller__win { height: 460px; } }
@media (max-width: 600px) { .lib__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .mini div { grid-template-columns: minmax(0, 1fr); gap: 2px; } }

/* ---------- Back to portfolio (single, prominent) ---------- */
.brand { margin: 0; }
.btn-back { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px 0 14px; border-radius: 999px; background: var(--brand); color: var(--brand-ink); font-weight: 600; font-size: 15px; text-decoration: none; white-space: nowrap; flex: none; }
.btn-back:hover { filter: brightness(1.1); }
.btn-back svg { flex: none; transition: transform .2s ease; }
.btn-back:hover svg { transform: translateX(-3px); }
.top__in { gap: 10px; }
@media (max-width: 600px) {
  .btn-back__more { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .btn-back { padding: 0 14px 0 12px; }
}
@media (max-width: 374px) {
  .brand__name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
