/* FROMBIT — layout: full-bleed alternating ink/paper chapters, sticky scroll scenes, 12-col content well (max 1180px) */
:root {
  --ink: #04150f;          /* near-black, tinted with brand green */
  --ink-2: #0a2219;
  --deep: #003926;         /* CI main green */
  --red: #ec1b23;          /* CI point red — the "bit" */
  --paper: #f2f4f1;        /* cool green-tinted white */
  --paper-2: #e6ebe7;
  --line-d: rgba(206, 228, 216, .14);
  --line-l: rgba(0, 57, 38, .14);
  --fg-d: #eef3ef;
  --fg-d-2: #9fb3a8;
  --fg-l: #0b1f17;
  --fg-l-2: #50665b;
  --glow: #8fd3b0;

  --f-body: "IBM Plex Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --f-disp: "Chakra Petch", "IBM Plex Sans KR", "Apple SD Gothic Neo", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --gutter: clamp(16px, 4vw, 48px);
  --well: 1180px;
  --nav-h: 56px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--fg-d);
  font: 400 16px/1.7 var(--f-body);
  letter-spacing: -0.01em;
  word-break: keep-all;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
a { color: inherit; }
h1, h2, h3 { text-wrap: balance; margin: 0; font-weight: 700; letter-spacing: -0.035em; line-height: 1.15; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

.well { width: 100%; max-width: calc(var(--well) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.eyebrow {
  font: 500 12px/1 var(--f-mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 10px;
}
.eyebrow::before { content: ""; width: 7px; height: 7px; background: var(--red); flex: none; }

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  padding-top: env(safe-area-inset-top, 0px);
  background: rgba(4, 21, 15, .62);
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  border-bottom: 1px solid var(--line-d);
  transition: background .4s;
}
.nav.on-light { background: rgba(242, 244, 241, .72); border-bottom-color: var(--line-l); }
.nav.on-light .nav-links a { color: var(--fg-l); }
.nav.on-light .logo-w { opacity: 0; }
.nav.on-light .logo-g { opacity: 1; }
.nav-in { height: var(--nav-h); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { position: relative; display: block; width: 116px; height: 15px; flex: none; }
.brand img { position: absolute; inset: 0; width: 100%; height: auto; transition: opacity .4s; }
.logo-g { opacity: 0; }
.nav-links { display: flex; gap: clamp(14px, 2.6vw, 34px); list-style: none; margin: 0; padding: 0; }
.nav-links a { text-decoration: none; font-size: 13px; color: var(--fg-d); opacity: .82; transition: opacity .2s, color .4s; }
.nav-links a:hover, .nav-links a[aria-current="page"] { opacity: 1; }
@media (max-width: 640px) {
  .nav-links { gap: 14px; }
  .nav-links li.opt { display: none; }
}

/* ---------- hero ---------- */
.hero { position: relative; height: 180vh; }
.hero-stick { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; display: grid; place-items: center; }
#bitfield { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-copy { position: relative; text-align: center; padding-inline: var(--gutter); will-change: transform, opacity; }
.hero-copy .eyebrow { color: var(--fg-d-2); margin-bottom: 28px; }
.hero h1 {
  font-size: clamp(40px, 8.4vw, 112px);
  line-height: 1.04;
  letter-spacing: -0.05em;
}
.hero h1 .thin { font-weight: 300; color: var(--fg-d-2); }
.hero-sub { margin: 28px auto 0; max-width: 34em; color: var(--fg-d-2); font-size: clamp(15px, 1.6vw, 19px); }
.scroll-cue {
  position: absolute; left: 50%; bottom: 32px; transform: translateX(-50%);
  font: 500 11px/1 var(--f-mono); letter-spacing: .2em; color: var(--fg-d-2);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.scroll-cue i { width: 1px; height: 40px; background: linear-gradient(var(--fg-d-2), transparent); animation: cue 2.2s infinite; transform-origin: top; }
@keyframes cue { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

/* ---------- statement: scroll-scrubbed words ---------- */
.statement { position: relative; height: 240vh; }
.statement-stick { position: sticky; top: 0; height: 100vh; height: 100svh; display: flex; align-items: center; }
.statement p {
  font-size: clamp(28px, 4.6vw, 64px);
  line-height: 1.32;
  font-weight: 700;
  letter-spacing: -0.04em;
  max-width: 18em;
}
.statement .w { color: rgba(238, 243, 239, .16); transition: color .25s; }
.statement .w.lit { color: var(--fg-d); }
.statement .w.red.lit { color: var(--red); }

/* ---------- light chapters ---------- */
.light { background: var(--paper); color: var(--fg-l); color-scheme: light; }
.light .eyebrow { color: var(--fg-l-2); }
.chapter { padding-block: clamp(96px, 14vw, 180px); }
.chapter-head { display: grid; gap: 22px; margin-bottom: clamp(48px, 7vw, 88px); max-width: 860px; }
.chapter-head h2 { font-size: clamp(34px, 5.4vw, 72px); }
.chapter-head p { font-size: clamp(16px, 1.5vw, 19px); color: var(--fg-l-2); max-width: 40em; }
.dark .chapter-head p { color: var(--fg-d-2); }
.dark .eyebrow { color: var(--fg-d-2); }

/* two business lines */
.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 820px) { .duo { grid-template-columns: 1fr; } }
.biz {
  position: relative; overflow: hidden; border-radius: 28px;
  min-height: 520px; padding: clamp(28px, 4vw, 48px);
  display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
  text-decoration: none;
  transition: transform .5s cubic-bezier(.2, .7, .2, 1);
}
.biz:hover { transform: translateY(-6px); }
.biz-edu { background: #fff; color: var(--fg-l); }
.biz-ai { background: var(--ink); color: var(--fg-d); }
.biz .tag { font: 500 12px/1 var(--f-mono); letter-spacing: .14em; opacity: .7; }
.biz h3 { font-size: clamp(28px, 3.4vw, 44px); margin-top: 18px; }
.biz p { opacity: .74; max-width: 26em; margin-top: 16px; }
.biz .more { font-weight: 600; font-size: 15px; display: inline-flex; gap: 8px; align-items: center; }
.biz .more::after { content: "→"; transition: transform .3s; }
.biz:hover .more::after { transform: translateX(4px); }
.biz-edu .art { margin: -10px -20px -60px auto; width: min(88%, 440px); border-radius: 18px; transform: rotate(-4deg); box-shadow: 0 30px 60px -20px rgba(0, 57, 38, .35); }
.biz-ai .art { position: relative; height: 220px; margin: 0 -10px -20px; }

/* ---------- platform stack (exploded layers) ---------- */
.stack-scene { position: relative; height: 460vh; }
.stack-stick { position: sticky; top: 0; height: 100vh; height: 100svh; display: grid; align-items: center; overflow: clip; }
.stack-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 5vw, 80px); align-items: center; }
@media (max-width: 860px) {
  .stack-grid { grid-template-columns: 1fr; gap: 8px; }
  .stack-steps { order: 2; min-height: 200px; }
}
.stack-steps { position: relative; min-height: 300px; }
.step {
  position: absolute; inset: 0 auto auto 0;
  opacity: 0; transform: translateY(24px);
  transition: opacity .5s, transform .5s;
  pointer-events: none;
}
.step.on { opacity: 1; transform: none; pointer-events: auto; }
.step .k { font: 500 12px/1 var(--f-mono); letter-spacing: .14em; color: var(--red); }
.step h3 { font-size: clamp(26px, 3.2vw, 42px); margin: 16px 0 16px; }
.step p { color: var(--fg-l-2); max-width: 28em; }
.step ul { margin: 18px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.step li { display: flex; gap: 12px; color: var(--fg-l); font-size: 15px; }
.step li::before { content: ""; width: 6px; height: 6px; margin-top: .7em; background: var(--deep); flex: none; }

.stack-vis { perspective: 1400px; height: min(64vh, 560px); display: grid; place-items: center; }
.stack-3d { position: relative; width: min(100%, 520px); aspect-ratio: 1.45; transform-style: preserve-3d; transform: rotateX(58deg) rotateZ(-38deg); }
.layer {
  position: absolute; inset: 0; border-radius: 14px;
  display: grid; place-items: center;
  font: 700 clamp(15px, 1.7vw, 19px)/1.3 var(--f-body); text-align: center; padding: 10px; letter-spacing: -0.02em;
  transform-style: preserve-3d;
  transition: background .4s, color .4s, box-shadow .4s;
  backface-visibility: hidden;
}
.layer span { transform: rotateZ(38deg); display: block; max-width: 70%; }
.layer[data-i="0"] { background: #c7d2cb; color: var(--fg-l); border: 1px solid rgba(0,57,38,.25); }
.layer[data-i="0"]::after {
  content: ""; position: absolute; inset: 14%;
  background-image: radial-gradient(circle, rgba(0,57,38,.4) 1.2px, transparent 1.6px); background-size: 12px 12px; border-radius: 6px; z-index: -1;
}
.layer[data-i="1"] { background: #9db3a6; color: var(--fg-l); }
.layer[data-i="2"] { background: var(--deep); color: #fff; }
.layer[data-i="3"] { background: #0f5a3f; color: #fff; }
.layer[data-i="4"] { background: rgba(255,255,255,.88); color: var(--fg-l); border: 1px solid var(--line-l); }
.layer.hot { box-shadow: 0 0 0 2px var(--red), 0 40px 80px -30px rgba(0,0,0,.45); }
.layer-label { font: 500 11px/1 var(--f-mono); font-style: normal; letter-spacing: .14em; opacity: .7; display: block; margin-bottom: 8px; }

/* ---------- product rail (vertical scroll → horizontal) ---------- */
.rail-scene { position: relative; }
.rail-stick { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; display: flex; flex-direction: column; justify-content: center; gap: 36px; }
.rail-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; }
.rail-head h2 { font-size: clamp(30px, 4.4vw, 56px); }
.rail-head p { color: var(--fg-l-2); max-width: 26em; }
.rail { display: flex; gap: 20px; will-change: transform; padding-inline: var(--gutter); }
.card {
  flex: none; width: min(78vw, 520px);
  background: #fff; border-radius: 24px; overflow: hidden;
  display: flex; flex-direction: column;
}
.card figure { margin: 0; aspect-ratio: 4 / 3.1; overflow: hidden; background: var(--paper-2); }
.card img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.2,.7,.2,1); }
.card:hover img { transform: scale(1.04); }
.card .meta { padding: 24px 26px 28px; display: grid; gap: 8px; }
.card .meta b { font-size: 21px; letter-spacing: -0.03em; }
.card .meta small { font: 500 11px/1 var(--f-mono); letter-spacing: .14em; color: var(--fg-l-2); text-transform: uppercase; }
.card .meta span { color: var(--fg-l-2); font-size: 15px; }
.card.intro { background: var(--deep); color: #fff; justify-content: space-between; padding: 36px; }
.card.intro b { font-size: clamp(26px, 3vw, 36px); line-height: 1.25; letter-spacing: -0.04em; }
.card.intro p { color: rgba(255,255,255,.72); }
.rail-progress { height: 2px; background: var(--line-l); position: relative; overflow: hidden; }
.rail-progress i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--deep); }

/* ---------- numbers ---------- */
.numbers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line-l); }
@media (max-width: 860px) { .numbers { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.num { padding: 32px 20px 8px 0; display: grid; gap: 12px; align-content: start; }
.num b { font: 600 clamp(40px, 5.4vw, 72px)/1 var(--f-disp); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; color: var(--deep); }
.num b sup { font-size: .42em; color: var(--red); margin-left: 4px; vertical-align: top; position: relative; top: .3em; }
.num span { color: var(--fg-l-2); font-size: 14px; max-width: 16em; }

/* ---------- edge AI (dark) ---------- */
.dark { background: var(--ink); color: var(--fg-d); }
.ai-hero h2 { font-size: clamp(38px, 7vw, 96px); line-height: 1.06; letter-spacing: -0.05em; }
.ai-hero h2 em { font-style: normal; color: var(--glow); }
.why { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line-d); border: 1px solid var(--line-d); border-radius: 24px; overflow: hidden; margin-top: clamp(56px, 8vw, 96px); }
@media (max-width: 820px) { .why { grid-template-columns: 1fr; } }
.why > div { background: var(--ink); padding: clamp(28px, 3.4vw, 44px); display: grid; gap: 14px; align-content: start; }
.why .ic { width: 40px; height: 40px; }
.why h3 { font-size: 22px; letter-spacing: -0.03em; }
.why p { color: var(--fg-d-2); font-size: 15px; }

.quant-scene { position: relative; height: 380vh; }
.quant-stick { position: sticky; top: 0; height: 100vh; height: 100svh; display: grid; align-items: center; }
.quant-grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(24px, 5vw, 72px); align-items: center; }
@media (max-width: 860px) { .quant-grid { grid-template-columns: 1fr; gap: 28px; } }
.chip {
  position: relative; border-radius: 28px; padding: clamp(24px, 3.4vw, 40px);
  background: radial-gradient(120% 90% at 50% 0%, #0d3325 0%, var(--ink-2) 60%);
  border: 1px solid var(--line-d);
  display: grid; gap: 22px;
}
.chip-top { display: flex; justify-content: space-between; font: 500 12px/1 var(--f-mono); letter-spacing: .12em; color: var(--fg-d-2); }
.chip-model { font: 600 clamp(48px, 7vw, 92px)/1 var(--f-disp); letter-spacing: -0.03em; }
.chip-model small { font-size: .26em; color: var(--fg-d-2); font-family: var(--f-mono); letter-spacing: .08em; margin-left: 10px; font-weight: 500; }
.bits { display: grid; grid-template-columns: repeat(16, 1fr); gap: 5px; }
.bits i { aspect-ratio: 1; border-radius: 3px; background: var(--glow); transition: background .35s, opacity .35s, transform .35s; }
.bits i.off { background: rgba(143, 211, 176, .08); transform: scale(.7); }
.bits i.sign { background: var(--red); }
.chip-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.chip-row b { font: 600 clamp(28px, 3.4vw, 40px)/1 var(--f-disp); font-variant-numeric: tabular-nums; }
.chip-row span { color: var(--fg-d-2); font-size: 14px; }
.meter { height: 8px; border-radius: 99px; background: rgba(143, 211, 176, .1); overflow: hidden; }
.meter i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--glow), #d6f3e4); border-radius: inherit; transition: width .5s cubic-bezier(.2,.7,.2,1); }
.chip-dev { display: flex; gap: 10px; flex-wrap: wrap; }
.chip-dev span { font: 500 12px/1 var(--f-mono); padding: 8px 12px; border-radius: 99px; border: 1px solid var(--line-d); color: var(--fg-d-2); transition: all .35s; }
.chip-dev span.on { border-color: var(--glow); color: var(--ink); background: var(--glow); }

.pipeline { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; counter-reset: p; }
.pipeline li { padding: 18px 0 18px 56px; position: relative; border-top: 1px solid var(--line-d); opacity: .36; transition: opacity .4s; }
.pipeline li.on { opacity: 1; }
.pipeline li::before { counter-increment: p; content: "0" counter(p); position: absolute; left: 0; top: 20px; font: 500 13px/1 var(--f-mono); color: var(--glow); }
.pipeline li.on::after { content: ""; position: absolute; left: 0; top: -1px; height: 1px; width: 56px; background: var(--red); }
.pipeline b { display: block; font-size: 19px; letter-spacing: -0.02em; }
.pipeline span { color: var(--fg-d-2); font-size: 14px; display: block; margin-top: 4px; }
@media (max-width: 860px) {
  .quant-stick .chip { gap: 14px; padding: 20px; }
  .quant-stick .chip-model { font-size: 44px; }
  .quant-copy .eyebrow, .quant-copy h3 { display: none; }
  .pipeline li { padding: 10px 0 10px 44px; }
  .pipeline li::before { top: 13px; }
  .pipeline li span { display: none; }
  .pipeline li.cur span { display: block; }
  .pipeline b { font-size: 16px; }
}
.pipeline em { font-style: normal; font: 500 11px/1 var(--f-mono); letter-spacing: .1em; color: var(--glow); margin-left: 8px; }

.targets { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.targets span { border: 1px solid var(--line-d); border-radius: 99px; padding: 10px 18px; font-size: 14px; color: var(--fg-d); }

/* ---------- technology ---------- */
.tech { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 820px) { .tech { grid-template-columns: 1fr; } }
.tech article { background: #fff; border-radius: 24px; padding: clamp(26px, 3.2vw, 40px); display: grid; gap: 14px; align-content: start; }
.tech .code { font: 500 12px/1 var(--f-mono); letter-spacing: .12em; color: var(--fg-l-2); }
.tech h3 { font-size: clamp(22px, 2.4vw, 28px); }
.tech p { color: var(--fg-l-2); font-size: 15px; }
.tech .proof { margin-top: 6px; padding-top: 16px; border-top: 1px solid var(--line-l); font-size: 14px; color: var(--fg-l); display: grid; gap: 6px; }
.tech .proof div { display: flex; gap: 10px; }
.tech .proof div::before { content: ""; width: 5px; height: 5px; background: var(--red); flex: none; margin-top: .65em; }

.people { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 5vw, 80px); margin-top: clamp(80px, 11vw, 140px); align-items: start; }
@media (max-width: 820px) { .people { grid-template-columns: 1fr; } }
.people h3 { font-size: clamp(26px, 3vw, 38px); }
.people .who { display: grid; gap: 6px; margin-top: 18px; }
.people .who b { font-size: 19px; }
.people .who span { color: var(--fg-l-2); font-size: 15px; }
.partners { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line-l); }
@media (max-width: 560px) { .partners { grid-template-columns: 1fr; } }
.partners div { padding: 22px 16px 22px 0; display: grid; gap: 6px; }
.partners b { font: 600 22px/1.1 var(--f-disp); letter-spacing: -0.01em; }
.partners span { color: var(--fg-l-2); font-size: 14px; }

/* ---------- news ---------- */
.news-list { display: grid; border-top: 1px solid var(--line-d); }
.light .news-list { border-top-color: var(--line-l); }
.news-item {
  display: grid; grid-template-columns: 110px 96px minmax(0, 1fr) 24px; gap: 20px; align-items: baseline;
  padding: 24px 0; border-bottom: 1px solid var(--line-d); text-decoration: none;
  transition: padding .3s;
}
.light .news-item { border-bottom-color: var(--line-l); }
.news-item:hover { padding-left: 10px; }
.news-item time { font: 500 13px/1 var(--f-mono); color: var(--fg-d-2); font-variant-numeric: tabular-nums; }
.light .news-item time { color: var(--fg-l-2); }
.news-item .cat { font: 500 11px/1 var(--f-mono); letter-spacing: .1em; padding: 6px 9px; border-radius: 99px; border: 1px solid currentColor; justify-self: start; opacity: .8; }
.news-item .cat.disclosure { color: var(--red); opacity: 1; }
.news-item b { font-weight: 600; font-size: 18px; letter-spacing: -0.02em; min-width: 0; }
.news-item .pin { color: var(--red); font-size: 12px; margin-right: 8px; }
.news-item::after { content: "→"; opacity: .4; }
@media (max-width: 640px) {
  .news-item { grid-template-columns: auto 1fr; gap: 10px 14px; }
  .news-item b { grid-column: 1 / -1; }
  .news-item::after { display: none; }
}
.news-empty { padding: 40px 0; color: var(--fg-d-2); }
.light .news-empty { color: var(--fg-l-2); }
.btn {
  display: inline-flex; align-items: center; gap: 8px; border: 0; cursor: pointer;
  padding: 13px 22px; border-radius: 99px; font: 600 15px/1 var(--f-body); text-decoration: none;
  background: var(--fg-d); color: var(--ink); transition: transform .2s, background .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn.ghost { background: transparent; color: inherit; border: 1px solid currentColor; }
.light .btn { background: var(--deep); color: #fff; }
.light .btn.ghost { background: transparent; color: var(--fg-l); }

/* ---------- contact & footer ---------- */
.contact { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(32px, 6vw, 96px); align-items: end; }
@media (max-width: 820px) { .contact { grid-template-columns: 1fr; } }
.contact h2 { font-size: clamp(36px, 6vw, 84px); line-height: 1.08; letter-spacing: -0.05em; }
.contact dl { margin: 0; display: grid; gap: 22px; }
.contact dt { font: 500 11px/1 var(--f-mono); letter-spacing: .16em; color: var(--fg-d-2); margin-bottom: 8px; }
.contact dd { margin: 0; font-size: 18px; }
.contact dd a { text-decoration: none; border-bottom: 1px solid var(--line-d); }
footer.site { border-top: 1px solid var(--line-d); padding-block: 32px 40px; color: var(--fg-d-2); font-size: 13px; }
footer.site .row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center; }
footer.site .legal { display: flex; gap: 6px 18px; flex-wrap: wrap; }
footer.site .admin { color: inherit; opacity: .28; text-decoration: none; font-size: 12px; }
footer.site .admin:hover { opacity: .8; }

/* ---------- reveal ---------- */
.js .rv { opacity: 0; transform: translateY(36px); transition: opacity 1s cubic-bezier(.2,.7,.2,1), transform 1s cubic-bezier(.2,.7,.2,1); }
.js .rv.in { opacity: 1; transform: none; }
.js .rv.d1 { transition-delay: .1s; } .js .rv.d2 { transition-delay: .2s; } .js .rv.d3 { transition-delay: .3s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .rv { opacity: 1; transform: none; transition: none; }
  .scroll-cue i { animation: none; }
}

/* ---------- sub pages (news, admin) ---------- */
.page { padding-top: calc(var(--nav-h) + 72px); padding-bottom: 120px; min-height: 80vh; }
.page h1 { font-size: clamp(40px, 6vw, 80px); letter-spacing: -0.05em; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 40px 0 8px; }
.filters button { font: 500 14px/1 var(--f-body); padding: 10px 16px; border-radius: 99px; border: 1px solid var(--line-l); background: transparent; color: var(--fg-l); cursor: pointer; }
.filters button[aria-pressed="true"] { background: var(--deep); color: #fff; border-color: var(--deep); }
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 40px; }
.pager button { min-width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line-l); background: #fff; color: var(--fg-l); cursor: pointer; font: 500 14px/1 var(--f-mono); }
.pager button[aria-current="page"] { background: var(--deep); color: #fff; border-color: var(--deep); }
.article { max-width: 760px; }
.article .back { font-size: 14px; color: var(--fg-l-2); text-decoration: none; }
.article h1 { font-size: clamp(30px, 4.2vw, 52px); margin: 24px 0 16px; letter-spacing: -0.04em; }
.article .info { display: flex; gap: 14px; align-items: center; color: var(--fg-l-2); font: 500 13px/1 var(--f-mono); padding-bottom: 28px; border-bottom: 1px solid var(--line-l); flex-wrap: wrap; }
.article .body { padding-top: 32px; font-size: 17px; line-height: 1.85; display: grid; gap: 1.1em; }
.article .body h2 { font-size: 24px; margin-top: .6em; }
.article .body h3 { font-size: 19px; }
.article .body ul { margin: 0; padding-left: 1.2em; }
.article .body a { color: var(--deep); }
.files { margin-top: 40px; border: 1px solid var(--line-l); border-radius: 16px; padding: 18px 22px; display: grid; gap: 10px; }
.files b { font: 500 11px/1 var(--f-mono); letter-spacing: .14em; color: var(--fg-l-2); }
.files a { color: var(--deep); text-decoration: none; font-weight: 500; }
.files a:hover { text-decoration: underline; }

/* ---------- content package layer ---------- */
.layer.pkg { background: rgba(255,255,255,.92); border: 1px solid var(--line-l); padding: 14px; }
.tiles { width: 100%; height: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tiles b { position: relative; border-radius: 8px; background: var(--c); display: grid; place-items: center; transition: transform .5s cubic-bezier(.2,.7,.2,1), box-shadow .4s, opacity .4s; overflow: hidden; }
.tiles b::before { content: ""; position: absolute; inset: 18% 22%; border-radius: 3px; background: repeating-linear-gradient(0deg, rgba(0,0,0,.08) 0 2px, transparent 2px 7px); }
.tiles em { position: relative; font: 700 clamp(13px, 1.5vw, 17px)/1.2 var(--f-body); font-style: normal; color: var(--fg-l); transform: rotateZ(38deg); white-space: nowrap; background: rgba(255,255,255,.85); padding: 3px 7px; border-radius: 5px; }
.tiles b.new { opacity: .35; }
.tiles b.new::after { content: ""; position: absolute; inset: 4px; border: 2px dashed rgba(0,57,38,.45); border-radius: 6px; }
.stack-3d.authoring .tiles b { transform: translateZ(18px); box-shadow: 0 10px 18px -8px rgba(0,0,0,.35); }
.stack-3d.authoring .tiles b.new { opacity: 1; animation: drop 1.6s cubic-bezier(.2,.7,.2,1) infinite alternate; }
.stack-3d.authoring .tiles b.new::after { border-color: transparent; }
@keyframes drop { from { transform: translateZ(70px); } to { transform: translateZ(18px); } }
.layer small { font-weight: 500; opacity: .75; font-size: .78em; }

/* ---------- authoring studio ---------- */
.authoring { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 80px); align-items: center; }
@media (max-width: 900px) { .authoring { grid-template-columns: 1fr; } }
.auth-copy { display: grid; gap: 22px; align-content: start; }
.auth-copy h2 { font-size: clamp(30px, 4vw, 52px); }
.auth-copy p { color: var(--fg-l-2); }
.flow { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 0; counter-reset: f; }
.flow li { display: grid; grid-template-columns: 40px 1fr; gap: 2px 8px; padding: 14px 0; border-top: 1px solid var(--line-l); }
.flow li::before { counter-increment: f; content: "0" counter(f); grid-row: span 2; font: 500 13px/1.6 var(--f-mono); color: var(--red); }
.flow b { font-size: 17px; }
.flow span { color: var(--fg-l-2); font-size: 14px; }
.studio { background: #fff; border-radius: 22px; overflow: hidden; box-shadow: 0 40px 80px -40px rgba(0, 57, 38, .35), 0 0 0 1px var(--line-l); min-width: 0; }
.studio-bar { display: flex; align-items: center; gap: 7px; padding: 12px 16px; border-bottom: 1px solid var(--line-l); background: var(--paper); font: 500 12px/1 var(--f-mono); color: var(--fg-l-2); }
.studio-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--paper-2); flex: none; }
.studio-bar span { margin-left: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.studio-bar em { margin-left: auto; font-style: normal; padding: 4px 8px; border-radius: 99px; border: 1px solid var(--line-l); white-space: nowrap; }
.studio-body { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
@media (max-width: 640px) { .studio-body { grid-template-columns: 1fr; } }
.sheet-wrap { overflow-x: auto; padding: 8px 6px 8px 16px; }
.sheet { width: 100%; border-collapse: collapse; font-size: 14px; }
.sheet th { text-align: left; font: 500 11px/1 var(--f-mono); letter-spacing: .1em; color: var(--fg-l-2); padding: 12px 8px; border-bottom: 1px solid var(--line-l); }
.sheet td { padding: 13px 8px; border-bottom: 1px solid var(--line-l); vertical-align: middle; }
.sheet tr { transition: opacity .5s, transform .5s, background .4s; }
.js .studio .sheet tbody tr { opacity: 0; transform: translateX(-12px); }
.studio.play .sheet tbody tr { opacity: 1; transform: none; }
.studio.play .sheet tbody tr:nth-child(2) { transition-delay: .5s; }
.studio.play .sheet tbody tr:nth-child(3) { transition-delay: 1s; }
.studio.play .sheet tbody tr:nth-child(4) { transition-delay: 1.5s; }
.sheet tr.hl { background: rgba(143, 211, 176, .18); }
.chip-in { font: 500 11px/1 var(--f-body); padding: 5px 8px; border-radius: 6px; white-space: nowrap; }
.chip-in.pen { background: #fde7ec; color: #a3324e; }
.chip-in.blk { background: #fff1c9; color: #8a5a00; }
.studio-dev { margin: 0; position: relative; background: var(--paper-2); }
.studio-dev img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 1; }
.bubble { position: absolute; left: 12px; bottom: 12px; display: inline-flex; gap: 8px; align-items: center; background: var(--deep); color: #fff; font-size: 14px; font-weight: 600; padding: 9px 13px; border-radius: 14px 14px 14px 4px; opacity: 0; transform: translateY(8px) scale(.96); transition: opacity .5s 2.1s, transform .5s 2.1s; }
.studio.play .bubble { opacity: 1; transform: none; }
.studio-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 13px 16px; border-top: 1px solid var(--line-l); font-size: 13px; color: var(--fg-l-2); }
.studio-foot .ok { color: var(--deep); font-weight: 600; display: inline-flex; gap: 8px; align-items: center; }
.studio-foot .ok::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #2fb174; }
.studio-foot b { color: var(--red); font-family: var(--f-disp); font-size: 15px; }
@media (prefers-reduced-motion: reduce) {
  .js .studio .sheet tbody tr { opacity: 1; transform: none; }
  .bubble { opacity: 1; transform: none; transition: none; }
  .stack-3d.authoring .tiles b.new { animation: none; }
}

@media (max-width: 860px) {
  .stack-vis { height: 44vh; }
  .stack-3d { width: min(78%, 420px); }
}

/* ---------- SW credit ---------- */
.credit-head { display: grid; gap: 22px; max-width: 900px; margin-bottom: clamp(40px, 6vw, 72px); }
.credit-head h2 { font-size: clamp(32px, 4.8vw, 64px); }
.credit-head h2 em { font-style: normal; color: var(--deep); box-shadow: inset 0 -.32em 0 rgba(236, 27, 35, .18); }
.credit-head p { color: var(--fg-l-2); font-size: clamp(16px, 1.5vw, 19px); max-width: 40em; }
.sw-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line-l); border: 1px solid var(--line-l); border-radius: 24px; overflow: hidden; }
@media (max-width: 900px) { .sw-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .sw-grid { grid-template-columns: 1fr; } }
.sw-grid li { background: #fff; padding: clamp(22px, 2.6vw, 32px); display: grid; gap: 10px; align-content: start; }
.sw-grid .code { font: 500 11px/1 var(--f-mono); letter-spacing: .14em; color: var(--red); }
.sw-grid b { font-size: 19px; letter-spacing: -0.02em; }
.sw-grid span:not(.code) { color: var(--fg-l-2); font-size: 15px; }
.credit-line { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.credit-line span { display: inline-flex; gap: 10px; align-items: center; padding: 10px 16px; border-radius: 99px; border: 1px solid var(--line-l); font-weight: 600; font-size: 15px; background: #fff; }
.credit-line i { font-style: normal; font: 500 11px/1 var(--f-mono); letter-spacing: .08em; color: var(--fg-l-2); }
.credit-line .me { background: var(--deep); color: #fff; border-color: var(--deep); }
.credit-line .me i { color: rgba(255, 255, 255, .7); }

/* ---------- products page ---------- */
.prod { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(28px, 5vw, 72px); align-items: center; padding-block: clamp(48px, 7vw, 96px); border-top: 1px solid var(--line-l); }
.prod.flip > figure { order: 2; }
@media (max-width: 820px) { .prod { grid-template-columns: 1fr; } .prod.flip > figure { order: 0; } }
.prod figure { margin: 0; border-radius: 24px; overflow: hidden; background: var(--paper-2); }
.prod figure img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.prod-copy { display: grid; gap: 16px; align-content: start; min-width: 0; }
.prod-copy h2 { font-size: clamp(28px, 3.6vw, 44px); }
.prod-copy h2 small { display: block; font: 500 13px/1.4 var(--f-mono); letter-spacing: .1em; color: var(--fg-l-2); margin-top: 10px; }
.prod-copy p { color: var(--fg-l-2); }
.prod-copy ul { margin: 6px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.prod-copy li { display: flex; gap: 12px; font-size: 15px; }
.prod-copy li::before { content: ""; width: 6px; height: 6px; background: var(--red); flex: none; margin-top: .72em; }
.prod-copy li b { white-space: nowrap; }
.prod-copy .buy { font-size: 14px; color: var(--fg-l-2); }
.prod-copy .buy a { color: var(--deep); font-weight: 600; }
.lead { font-size: clamp(17px, 1.7vw, 21px); color: var(--fg-l-2); max-width: 38em; margin-top: 20px; }
