/* ---------- Tokens ---------- */
:root {
  --bg: #f5f3ee;
  --surface: #ebe8e0;
  --ink: #131313;
  --ink-2: #55524b;
  --line: #d9d5ca;
  --accent: #ff4d1c;
  --accent-ink: #ffffff;
  --radius: 14px;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1280px;
  --font-sans: "Inter Tight", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Instrument Serif", ui-serif, Georgia, serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f0f0e;
    --surface: #1a1a18;
    --ink: #f2efe8;
    --ink-2: #a19d93;
    --line: #2a2926;
    --accent: #ff6a3d;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f0f0e;
  --surface: #1a1a18;
  --ink: #f2efe8;
  --ink-2: #a19d93;
  --line: #2a2926;
  --accent: #ff6a3d;
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color .3s, color .3s;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.serif { font-family: var(--font-serif); font-weight: 400; font-style: italic; letter-spacing: -0.01em; }
.eyebrow {
  font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-2);
}
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; z-index: 100; background: var(--ink); color: var(--bg); padding: 8px 12px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.site-header.scrolled { border-bottom-color: var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; letter-spacing: -0.01em; }
.logo svg { width: 34px; height: auto; fill: currentColor; }
.logo span { white-space: nowrap; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  text-decoration: none; font-size: 15px; font-weight: 500;
  padding: 8px 12px; border-radius: 999px; color: var(--ink-2);
  transition: color .2s, background-color .2s;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); background: var(--surface); }
.theme-toggle {
  appearance: none; border: 1px solid var(--line); background: transparent; color: var(--ink);
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  margin-left: 6px; transition: background-color .2s;
}
.theme-toggle:hover { background: var(--surface); }
.theme-toggle svg { width: 16px; height: 16px; }
@media (max-width: 560px) {
  .logo span { display: none; }
  .nav a { padding: 8px 9px; font-size: 14px; }
}

/* ---------- Hero ---------- */
.hero { padding: clamp(56px, 12vw, 160px) 0 clamp(48px, 8vw, 96px); }
.hero h1 {
  font-size: clamp(42px, 8.4vw, 124px);
  line-height: .98; letter-spacing: -0.045em; font-weight: 600;
  margin: 20px 0 0; max-width: 13ch;
}
.hero h1 .serif { font-size: 1.06em; letter-spacing: -0.02em; }
.hero-foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end;
  gap: 32px; margin-top: clamp(40px, 6vw, 72px);
}
.hero-foot p { max-width: 46ch; margin: 0; font-size: clamp(17px, 1.6vw, 20px); color: var(--ink-2); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--ink); color: var(--bg);
  padding: 14px 22px; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: 15px;
  transition: transform .2s, background-color .2s;
}
.btn:hover { background: var(--accent); color: var(--accent-ink); }
.btn svg { width: 16px; height: 16px; transition: transform .2s; }
.btn:hover svg { transform: translateX(3px); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { border-color: var(--ink); background: transparent; color: var(--ink); }

/* ---------- Section heading ---------- */
.section { padding: clamp(48px, 8vw, 112px) 0; }
.section-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  border-top: 1px solid var(--line); padding-top: 20px; margin-bottom: clamp(28px, 4vw, 48px);
}
.section-head h2 { margin: 0; font-size: clamp(28px, 3.4vw, 44px); letter-spacing: -0.03em; font-weight: 600; line-height: 1.1; }

/* ---------- Work grid ---------- */
.work-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(16px, 2.4vw, 32px); row-gap: clamp(40px, 5vw, 72px); }
.card { grid-column: span 6; text-decoration: none; display: block; }
.card.wide { grid-column: span 12; }
.card.wide .card-media { aspect-ratio: 21 / 10; }
.card-media {
  position: relative; overflow: hidden; border-radius: var(--radius);
  background: var(--surface); aspect-ratio: 4 / 3;
}
.card-media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .8s cubic-bezier(.2,.7,.2,1);
}
.card:hover .card-media img { transform: scale(1.035); }
.card-media .arrow {
  position: absolute; right: 16px; bottom: 16px; width: 48px; height: 48px; border-radius: 50%;
  background: var(--bg); color: var(--ink); display: grid; place-items: center;
  opacity: 0; transform: translateY(8px) rotate(-45deg);
  transition: opacity .3s, transform .3s;
}
.card-media .arrow svg { width: 18px; height: 18px; }
.card:hover .arrow, .card:focus-visible .arrow { opacity: 1; transform: translateY(0) rotate(-45deg); }
.card-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-top: 16px; }
.card-meta h3 { margin: 0; font-size: clamp(20px, 2vw, 26px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; }
.card-meta p { margin: 4px 0 0; color: var(--ink-2); font-size: 15px; }
.card-meta .eyebrow { white-space: nowrap; }
@media (max-width: 760px) {
  .card, .card.wide { grid-column: span 12; }
  .card.wide .card-media { aspect-ratio: 4 / 3; }
  .card-meta { flex-direction: column-reverse; gap: 6px; }
}

/* ---------- About strip ---------- */
.about-strip { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(28px, 5vw, 80px); align-items: center; }
.about-strip img { border-radius: var(--radius); aspect-ratio: 4 / 5; object-fit: cover; width: 100%; filter: grayscale(.15); }
.about-strip h2 { font-size: clamp(30px, 4vw, 56px); line-height: 1.05; letter-spacing: -0.035em; font-weight: 600; margin: 16px 0 24px; }
.about-strip p { color: var(--ink-2); max-width: 54ch; }
@media (max-width: 760px) { .about-strip { grid-template-columns: 1fr; } .about-strip img { max-width: 420px; } }

/* ---------- Skills / list ---------- */
.pill-list { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 24px 0 0; list-style: none; }
.pill-list li { border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: 14px; color: var(--ink-2); }

/* ---------- Contact ---------- */
.contact { padding: clamp(72px, 12vw, 160px) 0; text-align: left; border-top: 1px solid var(--line); }
.contact h2 { font-size: clamp(44px, 9vw, 132px); line-height: .95; letter-spacing: -0.05em; font-weight: 600; margin: 16px 0 36px; }
.contact h2 a { text-decoration: none; background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 6px no-repeat; transition: background-size .5s cubic-bezier(.2,.7,.2,1); }
.contact h2 a:hover { background-size: 100% 6px; }
.contact p { color: var(--ink-2); font-size: clamp(17px, 1.6vw, 20px); max-width: 44ch; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0 36px; font-size: 14px; color: var(--ink-2); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; align-items: center; }
.socials { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.socials a {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line); color: var(--ink); transition: background-color .2s, border-color .2s, color .2s;
}
.socials a:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.socials svg { width: 16px; height: 16px; fill: currentColor; }

/* ---------- Case study ---------- */
.case-hero { padding: clamp(48px, 9vw, 120px) 0 clamp(32px, 5vw, 56px); }
.back { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink-2); font-size: 15px; margin-bottom: 32px; }
.back:hover { color: var(--ink); }
.back svg { width: 16px; height: 16px; transform: rotate(180deg); }
.case-hero h1 { font-size: clamp(44px, 8vw, 112px); line-height: .98; letter-spacing: -0.045em; font-weight: 600; margin: 16px 0 24px; }
.case-hero .lede { font-size: clamp(20px, 2.2vw, 28px); line-height: 1.35; color: var(--ink-2); max-width: 30ch; margin: 0; letter-spacing: -0.01em; }
.case-cover { border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.case-cover img { width: 100%; }
.case-body { display: grid; grid-template-columns: 4fr 8fr; gap: clamp(28px, 6vw, 96px); padding: clamp(48px, 8vw, 112px) 0; }
.facts { display: grid; gap: 20px; align-content: start; margin: 0; }
.facts dt { font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
.facts dd { margin: 4px 0 0; font-size: 16px; }
.prose { font-size: clamp(17px, 1.4vw, 19px); max-width: 64ch; }
.prose p { margin: 0 0 1.2em; }
.prose a { text-decoration-color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 2px; }
.prose a:hover { color: var(--accent); }
@media (max-width: 760px) { .case-body { grid-template-columns: 1fr; } .facts { grid-template-columns: 1fr 1fr; } }

.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(12px, 2vw, 24px); padding-bottom: clamp(48px, 8vw, 112px); }
.gallery figure { margin: 0; border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.gallery figure.full { grid-column: 1 / -1; }
.gallery figure.phone { display: grid; place-items: center; padding: clamp(24px, 4vw, 56px); }
.gallery figure.phone img { max-height: 640px; width: auto; border-radius: 24px; box-shadow: 0 20px 60px rgba(0,0,0,.15); }
.gallery img { width: 100%; }
.gallery.thirds { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 760px) { .gallery, .gallery.thirds { grid-template-columns: 1fr; } }

.next-project { display: block; text-decoration: none; border-top: 1px solid var(--line); padding: clamp(48px, 8vw, 96px) 0; }
.next-project .eyebrow { display: block; margin-bottom: 12px; }
.next-project strong { display: inline-flex; align-items: center; gap: .3em; font-size: clamp(36px, 7vw, 96px); letter-spacing: -0.045em; line-height: 1; font-weight: 600; transition: color .2s; }
.next-project strong svg { width: .6em; height: .6em; transition: transform .3s; }
.next-project:hover strong { color: var(--accent); }
.next-project:hover strong svg { transform: translateX(8px); }

.notice { border: 1px dashed var(--line); border-radius: var(--radius); padding: 20px 24px; color: var(--ink-2); font-size: 15px; }

/* ---------- Timeline (About) ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.tl-org { display: grid; grid-template-columns: 4fr 8fr; gap: clamp(20px, 6vw, 96px); padding: clamp(28px, 4vw, 48px) 0; border-top: 1px solid var(--line); }
.tl-org h3 { margin: 0; font-size: clamp(24px, 2.6vw, 34px); letter-spacing: -0.025em; font-weight: 600; line-height: 1.1; }
.tl-org .tl-sub { margin: 6px 0 0; color: var(--ink-2); font-size: 15px; }
.tl-roles { list-style: none; margin: 0; padding: 0; position: relative; }
.tl-role { position: relative; padding: 0 0 32px 28px; }
.tl-role:last-child { padding-bottom: 0; }
.tl-role::before { content: ""; position: absolute; left: 0; top: 9px; width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--ink-2); background: var(--bg); }
.tl-role::after { content: ""; position: absolute; left: 5.5px; top: 24px; bottom: 4px; width: 1px; background: var(--line); }
.tl-role:last-child::after { display: none; }
.tl-role.current::before { border-color: var(--accent); background: var(--accent); }
.tl-role h4 { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: -0.01em; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.tl-role time, .tl-role .tl-date { display: block; color: var(--ink-2); font-size: 14px; margin-top: 2px; }
.tl-role ul { margin: 12px 0 0; padding-left: 1.1em; color: var(--ink-2); font-size: 16px; }
.tl-role li { margin: 0 0 6px; }
.tl-role li::marker { color: var(--line); }
.badge { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); border-radius: 999px; padding: 2px 9px; }
@media (max-width: 760px) { .tl-org { grid-template-columns: 1fr; } }

/* ---------- Design system feature ---------- */
.ds-section { padding: clamp(48px, 8vw, 112px) 0; border-top: 1px solid var(--line); }
.ds-section > .wrap > .eyebrow { display: block; margin-bottom: 14px; }
.ds-section h2 { margin: 0 0 20px; font-size: clamp(30px, 4vw, 56px); line-height: 1.05; letter-spacing: -0.035em; font-weight: 600; max-width: 20ch; }
.ds-section .intro { color: var(--ink-2); font-size: clamp(17px, 1.5vw, 20px); max-width: 60ch; margin: 0 0 clamp(32px, 5vw, 56px); }
.panel { background: var(--surface); border-radius: var(--radius); padding: clamp(20px, 3.5vw, 44px); }

/* --- DS: pipeline --- */
.flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(10px, 1.6vw, 16px); position: relative; }
.flow-step { appearance: none; font: inherit; color: inherit; text-align: left; cursor: pointer; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: clamp(16px, 2vw, 22px); display: grid; gap: 10px; align-content: start; transition: border-color .3s, box-shadow .3s, transform .3s; }
.flow-step:hover { border-color: var(--ink-2); }
.flow-step[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); transform: translateY(-2px); }
.flow-step .n { font: 600 11px/1 var(--font-sans); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
.flow-step[aria-pressed="true"] .n { color: var(--accent); }
.flow-step h3 { margin: 0; font-size: 18px; letter-spacing: -0.01em; }
.flow-step p { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.flow-art { height: 84px; border-radius: 8px; background: var(--surface); display: grid; place-items: center; overflow: hidden; }
.flow-art svg { width: 100%; height: 100%; }
.flow-track { grid-column: 1 / -1; height: 3px; background: var(--line); border-radius: 3px; position: relative; overflow: hidden; margin-top: 6px; }
.flow-track i { position: absolute; inset: 0 auto 0 0; width: 25%; background: var(--accent); border-radius: 3px; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
@media (max-width: 860px) { .flow { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .flow { grid-template-columns: 1fr; } .flow-track { display: none; } }

/* --- DS: problem blocks --- */
.problem { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(24px, 5vw, 72px); align-items: start; }
.problem + .problem { margin-top: clamp(56px, 8vw, 104px); padding-top: clamp(40px, 6vw, 72px); border-top: 1px solid var(--line); }
.problem h3 { margin: 10px 0 18px; font-size: clamp(24px, 2.6vw, 34px); letter-spacing: -0.03em; line-height: 1.1; }
.problem dl { margin: 0; display: grid; gap: 18px; }
.problem dt { font: 600 11px/1 var(--font-sans); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 6px; }
.problem dd { margin: 0; color: var(--ink-2); font-size: 16px; }
.problem .tag { font: 600 12px/1 var(--font-sans); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.demo { background: var(--surface); border-radius: var(--radius); padding: clamp(16px, 2.6vw, 28px); min-width: 0; }
.demo-cap { margin: 12px 0 0; font-size: 13px; color: var(--ink-2); }
.demo-btn { appearance: none; font: 600 14px/1 var(--font-sans); border: 0; cursor: pointer; background: var(--ink); color: var(--bg); padding: 11px 16px; border-radius: 999px; display: inline-flex; align-items: center; gap: 8px; transition: background-color .2s; }
.demo-btn:hover { background: var(--accent); color: var(--accent-ink); }
.demo-btn[disabled] { opacity: .5; cursor: default; background: var(--ink); color: var(--bg); }
.demo-btn svg { width: 14px; height: 14px; }
@media (max-width: 860px) { .problem { grid-template-columns: 1fr; } }

/* token plugin demo */
.plugin { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: stretch; }
.pane { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.pane-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); font: 600 12px/1 var(--font-sans); color: var(--ink-2); }
.pane-head i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.pane-body { padding: 10px; display: grid; gap: 6px; align-content: start; flex: 1; }
.tk { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 7px; background: var(--surface); font: 500 12px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; transition: opacity .35s, transform .35s; }
.tk b { width: 14px; height: 14px; border-radius: 4px; flex: none; background: var(--ink-2); opacity: .5; }
.tk.shape b { border-radius: 50%; }
.tk.type b { background: none; opacity: 1; font: 700 11px/14px var(--font-sans); text-align: center; color: var(--ink-2); }
.plugin.run .tk { opacity: .35; transform: translateX(6px); }
.plugin-mid { display: grid; place-items: center; }
.plugin-mid svg { width: 22px; height: 22px; color: var(--ink-2); }
.out { font: 12px/1.75 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--ink-2); padding: 12px; margin: 0; white-space: pre; overflow: hidden; flex: 1; }
.out span { display: block; opacity: 0; transform: translateY(4px); transition: opacity .3s, transform .3s; }
.out span.on { opacity: 1; transform: none; }
.out em { font-style: normal; color: var(--accent); }
.plugin-status { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.plugin-status .msg { font-size: 14px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 8px; }
.plugin-status .msg.ok { color: var(--ink); }
.plugin-status .msg.ok::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
@media (max-width: 640px) { .plugin { grid-template-columns: 1fr; } .plugin-mid svg { transform: rotate(90deg); } }

.sub-problem { margin-top: clamp(32px, 4vw, 48px); padding-top: clamp(24px, 3vw, 32px); border-top: 1px solid var(--line); }
.demo-sticky { position: sticky; top: 92px; }

/* library structure demo */
.seg { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); margin-bottom: 16px; }
.seg button { appearance: none; border: 0; background: transparent; font: 600 13px/1 var(--font-sans); color: var(--ink-2); padding: 9px 14px; border-radius: 999px; cursor: pointer; transition: background-color .2s, color .2s; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.libs { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; transition: gap .5s cubic-bezier(.2,.7,.2,1), padding .5s cubic-bezier(.2,.7,.2,1); border-radius: 14px; border: 1px dashed transparent; }
.lib { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: grid; gap: 10px; align-content: start; transition: border-radius .5s, border-color .5s, transform .5s cubic-bezier(.2,.7,.2,1); min-width: 0; }
.lib h4 { margin: 0; font-size: 15px; letter-spacing: -0.01em; }
.lib p { margin: 0; font-size: 13px; color: var(--ink-2); line-height: 1.45; }
.lib .glyphs { display: flex; flex-wrap: wrap; gap: 5px; height: 44px; align-content: flex-start; }
.lib .glyphs i { display: block; height: 18px; border-radius: 999px; background: var(--surface); }
.lib .glyphs i.sq { width: 18px; border-radius: 5px; }
.lib .glyphs i.dot { width: 18px; border-radius: 50%; }
.lib .glyphs i.ln { height: 6px; border-radius: 3px; margin-top: 6px; }
.lib.core .glyphs i { background: color-mix(in srgb, var(--accent) 30%, var(--surface)); }
.lib .uses { font: 600 11px/1 var(--font-sans); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.libs-badge { position: absolute; left: 50%; top: 0; transform: translate(-50%, -50%) scale(.9); opacity: 0; background: var(--accent); color: var(--accent-ink); font: 600 12px/1 var(--font-sans); letter-spacing: .06em; padding: 7px 12px; border-radius: 999px; white-space: nowrap; transition: opacity .4s, transform .4s; pointer-events: none; }
.libs.app { gap: 0; padding: 22px 10px 10px; border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, transparent); }
.libs.app .lib { border-radius: 0; border-color: transparent; border-right-color: var(--line); }
.libs.app .lib:first-of-type { border-radius: 12px 0 0 12px; }
.libs.app .lib:last-of-type { border-radius: 0 12px 12px 0; border-right-color: transparent; }
.libs.app .libs-badge { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.libs-note { margin: 14px 0 0; font-size: 14px; color: var(--ink-2); min-height: 3em; }
@media (max-width: 640px) {
  .libs { grid-template-columns: 1fr; }
  .libs.app .lib, .libs.app .lib:first-of-type, .libs.app .lib:last-of-type { border-radius: 0; border-right-color: transparent; border-bottom-color: var(--line); }
  .libs.app .lib:first-of-type { border-radius: 12px 12px 0 0; }
  .libs.app .lib:last-of-type { border-radius: 0 0 12px 12px; border-bottom-color: transparent; }
}

/* --- DS page: Medscape blue accent --- */
.theme-mscp { --accent: #064aa7; --accent-ink: #ffffff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .theme-mscp { --accent: #6f9df0; --accent-ink: #0b1220; } }
:root[data-theme="dark"] .theme-mscp { --accent: #6f9df0; --accent-ink: #0b1220; }

/* multi-brand demo */
.brands { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.brands button { appearance: none; font: 600 13px/1 var(--font-sans); padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--ink-2); cursor: pointer; display: inline-flex; align-items: center; gap: 7px; transition: border-color .2s, color .2s; }
.brands button i { width: 10px; height: 10px; border-radius: 50%; background: var(--sw); }
.brands button[aria-pressed="true"] { border-color: var(--ink); color: var(--ink); }
.mock { --b: #064aa7; --b-soft: #e6eefa; --r: 999px; --r-card: 14px; --hf: var(--font-sans); --hw: 600;
  background: #ffffff; color: #1b1f29; border-radius: var(--r-card); overflow: hidden; border: 1px solid var(--line);
  transition: border-radius .5s; }
.mock * { transition: background-color .5s, color .5s, border-color .5s, border-radius .5s, font-family 0s; }
.mock-bar { height: 44px; background: var(--b); display: flex; align-items: center; padding: 0 16px; gap: 8px; }
.mock-bar span { width: 70px; height: 10px; border-radius: 5px; background: rgba(255,255,255,.9); }
.mock-bar em { margin-left: auto; width: 26px; height: 10px; border-radius: 5px; background: rgba(255,255,255,.45); }
.mock-body { padding: 18px 18px 20px; display: grid; gap: 12px; }
.mock-kicker { font: 700 11px/1 var(--font-sans); letter-spacing: .1em; text-transform: uppercase; color: var(--b); }
.mock-title { margin: 0; font-family: var(--hf); font-weight: var(--hw); font-size: 22px; line-height: 1.2; letter-spacing: -0.01em; }
.mock-text { margin: 0; font-size: 14px; color: #5b6377; }
.mock-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mock-chips span { font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: var(--r); border: 1px solid #c9ced8; color: #1b1f29; }
.mock-chips span.on { background: var(--b-soft); border-color: var(--b); color: var(--b); }
.mock-actions { display: flex; gap: 8px; margin-top: 4px; }
.mock-actions span { font-size: 13px; font-weight: 600; padding: 9px 16px; border-radius: var(--r); }
.mock-actions .p { background: var(--b); color: #fff; }
.mock-actions .s { border: 1.5px solid var(--b); color: var(--b); }
.layers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.layers div { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-size: 13px; color: var(--ink-2); }
.layers b { display: block; font: 600 11px/1.4 var(--font-sans); letter-spacing: .1em; text-transform: uppercase; color: var(--ink); margin-bottom: 4px; }
.layers .chg b { color: var(--accent); }

/* adoption demo */
.teams { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.team { aspect-ratio: 4 / 3; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); position: relative; overflow: hidden; transition: background-color .5s, border-color .5s; }
.team::before, .team::after { content: ""; position: absolute; left: 14%; height: 12%; border-radius: 99px; background: var(--line); transition: background-color .5s; }
.team::before { top: 22%; width: 56%; }
.team::after { bottom: 20%; width: 32%; }
.team.on { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.team.on::after { background: var(--accent); }
.team.pulse { animation: pulse 1s ease-out; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); } 100% { box-shadow: 0 0 0 10px transparent; } }
.adopt-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; font-size: 14px; color: var(--ink-2); flex-wrap: wrap; }
.adopt-bar { flex: 1; min-width: 120px; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.adopt-bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 3px; transition: width .5s; }
.adopt-phase { font-weight: 600; color: var(--ink); min-width: 15ch; }
@media (max-width: 520px) { .teams { grid-template-columns: repeat(4, 1fr); } }
@media (prefers-reduced-motion: reduce) { .mock *, .team, .team::after, .adopt-bar i { transition: none !important; } .team.pulse { animation: none; } }

/* role list */
.role-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 clamp(24px, 5vw, 72px); list-style: none; margin: 0; padding: 0; }
.role-grid li { border-top: 1px solid var(--line); padding: 20px 0; }
.role-grid b { display: block; font-size: 18px; letter-spacing: -0.01em; margin-bottom: 4px; }
.role-grid span { color: var(--ink-2); font-size: 15px; }
@media (max-width: 760px) { .role-grid { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) { .libs, .lib, .tk, .out span, .flow-step, .flow-track i { transition: none !important; } }

/* pillars */
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(12px, 2vw, 20px); }
.pillar { border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(20px, 2.6vw, 32px); }
.pillar .eyebrow { color: var(--accent); }
.pillar h3 { margin: 12px 0 10px; font-size: 21px; letter-spacing: -0.02em; line-height: 1.2; }
.pillar p { margin: 0; color: var(--ink-2); font-size: 15px; }
.pillar ul { margin: 14px 0 0; padding-left: 1.1em; color: var(--ink-2); font-size: 15px; }
@media (max-width: 860px) { .pillars { grid-template-columns: 1fr; } }

/* ---------- Motion ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s cubic-bezier(.2,.7,.2,1), transform .8s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  * { transition-duration: 0s !important; }
}
