*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #ffffff;
  --fg: #000000;
  --fg-soft: #1a1a1a;
  --fg-mute: #8b8b8b;
  --line: rgba(0,0,0,0.08);
  --line-strong: rgba(0,0,0,0.15);
  --font: 'Heebo', -apple-system, BlinkMacSystemFont, sans-serif;
  --maxw: 1240px;
}

html { scroll-behavior: smooth; background: #fff; }
body {
  font-family: var(--font);
  font-weight: 300;
  color: var(--fg);
  background: var(--bg);
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* --- 3-layer horizontal-overflow guard (portfolio standard) --- */
html, body {
  min-height: 100%;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  overscroll-behavior-x: none;
}
@supports (overflow-x: clip) {
  html, body { overflow-x: clip; }
}
body { position: relative; }
.topbar, .phero, .psection, .foot, .cta-band, .crumbs-wrap { overflow-x: clip; max-width: 100%; }
h1, h2, h3, h4, p, li, td, th { overflow-wrap: anywhere; }

::selection { background: var(--fg); color: var(--bg); }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

.label {
  font-weight: 500; font-size: 11px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--fg-mute);
}

/* === GRID LINES === */
.grid-lines { position: fixed; inset: 0; pointer-events: none; z-index: 1; }
.grid-lines span {
  position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line);
}
.grid-lines span:nth-child(1) { inset-inline-start: 25%; }
.grid-lines span:nth-child(2) { inset-inline-start: 50%; }
.grid-lines span:nth-child(3) { inset-inline-start: 75%; }
@media (max-width: 880px) { .grid-lines { display: none; } }

/* === TOPBAR === */
.topbar {
  position: fixed; top: 0; inset-inline: 0; z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line-strong);
}
.topbar-inner {
  max-width: var(--maxw); margin: 0 auto;
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: 20px; padding: 14px 32px;
}
.topbar-brand { font-weight: 700; font-size: 16px; letter-spacing: -0.005em; }
.topbar-brand .slash { display: inline-block; margin: 0 8px; color: var(--fg-mute); font-weight: 300; }
.topbar-brand .en { font-weight: 400; color: var(--fg-mute); font-size: 13px; letter-spacing: 0.05em; }
.topnav { display: flex; gap: 22px; justify-content: center; }
.topnav a {
  font-weight: 500; font-size: 11px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--fg-mute);
  padding-bottom: 3px; border-bottom: 1px solid transparent; transition: all .2s;
}
.topnav a:hover, .topnav a[aria-current="page"] { color: var(--fg); border-bottom-color: var(--fg); }
.topbar-cta { text-align: end; font-weight: 500; font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; }
.topbar-cta a {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border: 1px solid var(--fg); transition: all 0.2s;
}
.topbar-cta a:hover { background: var(--fg); color: var(--bg); }
.topbar-cta a::after { content: '↗'; }
@media (max-width: 1080px) { .topnav { display: none; } .topbar-inner { grid-template-columns: 1fr auto; } }
@media (max-width: 720px) {
  .topbar-inner { grid-template-columns: 1fr auto; padding: 14px 20px; }
  .topbar-brand { font-size: 14px; }
  .topbar-brand .en { display: none; }
  .topbar-cta a { padding: 7px 11px; letter-spacing: .12em; }
}

/* === BREADCRUMBS === */
.crumbs-wrap { border-bottom: 1px solid var(--line); background: var(--bg); position: relative; z-index: 2; }
.crumbs {
  max-width: var(--maxw); margin: 0 auto; padding: 90px 32px 0;
  font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  font-weight: 500; color: var(--fg-mute);
}
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding-bottom: 14px; }
.crumbs li::after { content: '/'; margin-inline-start: 10px; color: var(--line-strong); }
.crumbs li:last-child::after { content: ''; }
.crumbs a:hover { color: var(--fg); }
.crumbs li:last-child { color: var(--fg); }
@media (max-width: 720px) { .crumbs { padding: 78px 20px 0; } }

/* === PAGE HERO === */
.phero { position: relative; z-index: 2; padding: 64px 32px 60px; border-bottom: 1px solid var(--fg); background: var(--bg); }
.phero-inner { max-width: var(--maxw); margin: 0 auto; }
.phero-kicker {
  font-weight: 500; font-size: 11px; letter-spacing: .25em; text-transform: uppercase;
  color: var(--fg-mute); display: flex; align-items: center; gap: 10px; margin-bottom: 26px;
}
.phero-kicker::before { content: ''; width: 26px; height: 1px; background: var(--fg-mute); }
.phero h1 {
  font-weight: 900; font-size: clamp(38px, 6.4vw, 84px); line-height: 1.02;
  letter-spacing: -0.035em; margin-bottom: 30px; max-width: 17ch;
}
.phero h1 .light { font-weight: 300; color: var(--fg-mute); }
.phero-lead {
  font-size: clamp(18px, 2.1vw, 23px); line-height: 1.55; font-weight: 300;
  color: var(--fg-soft); max-width: 62ch;
}
.phero-lead strong { font-weight: 600; color: var(--fg); }
.phero-meta {
  display: flex; flex-wrap: wrap; gap: 26px; margin-top: 38px; padding-top: 22px;
  border-top: 1px solid var(--line-strong);
  font-size: 11px; letter-spacing: .18em; text-transform: uppercase; font-weight: 500; color: var(--fg-mute);
}
.phero-meta b { color: var(--fg); font-weight: 600; }
@media (max-width: 720px) { .phero { padding: 40px 20px 44px; } }

/* === ARTICLE LAYOUT === */
.psection { position: relative; z-index: 2; background: var(--bg); padding: 84px 32px; }
.player { max-width: var(--maxw); margin: 0 auto; display: grid; grid-template-columns: 232px 1fr; gap: 72px; align-items: start; }
.pside { position: sticky; top: 92px; }
.toc-title {
  font-weight: 500; font-size: 10px; letter-spacing: .25em; text-transform: uppercase;
  color: var(--fg-mute); padding-bottom: 12px; border-bottom: 1px solid var(--fg); margin-bottom: 16px;
}
.toc { list-style: none; display: flex; flex-direction: column; gap: 11px; }
.toc a {
  font-size: 13.5px; font-weight: 400; color: var(--fg-mute); line-height: 1.4;
  display: block; padding-inline-start: 12px; border-inline-start: 1px solid var(--line-strong); transition: all .2s;
}
.toc a:hover { color: var(--fg); border-inline-start-color: var(--fg); }
.pbody { max-width: 760px; min-width: 0; }
@media (max-width: 1080px) {
  .player { grid-template-columns: 1fr; gap: 34px; }
  .pside { position: static; }
  .toc { flex-direction: row; flex-wrap: wrap; gap: 8px 16px; }
}
@media (max-width: 720px) { .psection { padding: 48px 20px; } }

/* === PROSE === */
.pbody h2 {
  font-weight: 800; font-size: clamp(27px, 3.6vw, 40px); line-height: 1.14;
  letter-spacing: -0.025em; margin: 68px 0 22px; scroll-margin-top: 96px;
}
.pbody h2:first-child { margin-top: 0; }
.pbody h3 {
  font-weight: 700; font-size: clamp(19px, 2.2vw, 23px); line-height: 1.3;
  letter-spacing: -0.012em; margin: 40px 0 14px; scroll-margin-top: 96px;
}
.pbody p { font-size: 17.5px; line-height: 1.78; color: var(--fg-soft); margin-bottom: 20px; font-weight: 300; }
.pbody p strong, .pbody li strong { font-weight: 600; color: var(--fg); }
.pbody a[href] { border-bottom: 1px solid var(--line-strong); font-weight: 400; color: var(--fg); transition: border-color .2s; }
.pbody a[href]:hover { border-bottom-color: var(--fg); }
.pbody .stand {
  font-size: 20.5px; font-weight: 400; color: var(--fg); line-height: 1.6;
  padding-bottom: 26px; margin-bottom: 34px; border-bottom: 1px solid var(--line-strong);
}
.pbody ul, .pbody ol { margin: 0 0 24px; padding-inline-start: 22px; }
.pbody li { font-size: 17.5px; line-height: 1.72; color: var(--fg-soft); margin-bottom: 10px; font-weight: 300; }
.pbody ul li::marker { color: var(--fg-mute); }
.pbody ol li::marker { color: var(--fg-mute); font-weight: 600; font-size: 14px; }

/* answer-first block: the paragraph AI engines lift */
.answer {
  border: 1px solid var(--fg); padding: 26px 28px; margin: 0 0 36px;
  background: var(--bg);
}
.answer .answer-k {
  font-weight: 500; font-size: 10px; letter-spacing: .25em; text-transform: uppercase;
  color: var(--fg-mute); display: block; margin-bottom: 12px;
}
.answer p { font-size: 18.5px; line-height: 1.65; color: var(--fg); font-weight: 400; margin: 0; }
.answer p + p { margin-top: 12px; }

/* pull quote */
.pq { margin: 44px 0; padding: 0 0 0 0; border-top: 1px solid var(--fg); border-bottom: 1px solid var(--fg); }
.pq blockquote {
  font-size: clamp(21px, 2.7vw, 28px); font-weight: 400; line-height: 1.42;
  letter-spacing: -0.018em; color: var(--fg); padding: 32px 0 18px;
}
.pq cite {
  font-style: normal; font-weight: 500; font-size: 11px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--fg-mute); display: block; padding-bottom: 26px;
}

/* stat strip */
.statrow { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--fg); margin: 40px 0; }
.statrow > div { padding: 26px 22px; border-inline-end: 1px solid var(--line-strong); }
.statrow > div:last-child { border-inline-end: 0; }
.statrow b { display: block; font-weight: 700; font-size: clamp(28px, 3.4vw, 40px); line-height: 1; letter-spacing: -0.04em; margin-bottom: 9px; font-variant-numeric: tabular-nums; }
.statrow span { font-size: 13px; color: var(--fg-mute); line-height: 1.45; display: block; }
@media (max-width: 720px) {
  .statrow { grid-template-columns: 1fr; }
  .statrow > div { border-inline-end: 0; border-bottom: 1px solid var(--line-strong); }
  .statrow > div:last-child { border-bottom: 0; }
}

/* tables */
.tbl-wrap { overflow-x: auto; margin: 34px 0; border: 1px solid var(--fg); }
.pbody table { width: 100%; border-collapse: collapse; min-width: 520px; }
.pbody th, .pbody td { text-align: start; padding: 14px 16px; font-size: 15px; border-bottom: 1px solid var(--line-strong); }
.pbody th { font-weight: 600; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--fg-mute); background: rgba(0,0,0,0.02); }
.pbody td { color: var(--fg-soft); font-weight: 300; }
.pbody tr:last-child td { border-bottom: 0; }

/* note / caution */
.note { border-inline-start: 2px solid var(--fg); padding: 4px 0 4px 0; padding-inline-start: 22px; margin: 34px 0; }
.note p { margin-bottom: 10px; font-size: 16.5px; }
.note p:last-child { margin-bottom: 0; }
.note .note-k { font-weight: 600; font-size: 10px; letter-spacing: .25em; text-transform: uppercase; color: var(--fg-mute); display: block; margin-bottom: 10px; }

/* defer — hands a shared topic to the canonical Ymedia page */
.defer {
  border: 1px solid var(--line-strong); border-inline-start: 2px solid var(--fg);
  background: rgba(0,0,0,0.02); padding: 20px 22px; margin: 0 0 34px;
}
.defer .defer-k {
  font-weight: 600; font-size: 10px; letter-spacing: .25em; text-transform: uppercase;
  color: var(--fg-mute); display: block; margin-bottom: 10px;
}
.defer p { font-size: 16px; line-height: 1.65; color: var(--fg-soft); margin: 0; font-weight: 300; }
.defer a { font-weight: 600; color: var(--fg); border-bottom: 1px solid var(--fg); }
.defer a::after { content: ' ↗'; font-weight: 300; color: var(--fg-mute); }

/* === FAQ === */
.faq { margin-top: 68px; border-top: 1px solid var(--fg); }
.faq h2 { margin-top: 34px; }
.faq details { border-bottom: 1px solid var(--line-strong); }
.faq summary {
  cursor: pointer; list-style: none; padding: 22px 0;
  font-weight: 600; font-size: 18px; line-height: 1.4; letter-spacing: -0.012em;
  display: flex; justify-content: space-between; gap: 18px; align-items: baseline;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-weight: 300; font-size: 22px; color: var(--fg-mute); flex-shrink: 0; }
.faq details[open] summary::after { content: '–'; }
.faq details > div { padding-bottom: 24px; }
.faq details p { font-size: 16.5px; line-height: 1.72; margin-bottom: 12px; }
.faq details p:last-child { margin-bottom: 0; }

/* === RELATED === */
.related { margin-top: 68px; padding-top: 30px; border-top: 1px solid var(--fg); }
.related .label { margin-bottom: 20px; display: block; }
.related-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line-strong); border: 1px solid var(--line-strong); }
.related-grid a { background: var(--bg); padding: 22px 20px; display: block; transition: background .2s; }
.related-grid a:hover { background: var(--fg); color: var(--bg); }
.related-grid a:hover small { color: rgba(255,255,255,.6); }
.related-grid b { display: block; font-weight: 600; font-size: 16.5px; line-height: 1.35; letter-spacing: -0.012em; margin-bottom: 7px; }
.related-grid small { font-size: 13px; color: var(--fg-mute); line-height: 1.5; font-weight: 300; display: block; }
@media (max-width: 720px) { .related-grid { grid-template-columns: 1fr; } }

/* === INDEX / HUB GRIDS === */
.hub { max-width: var(--maxw); margin: 0 auto; }
.hub-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line-strong); border: 1px solid var(--fg); }
.hub-grid > a { background: var(--bg); padding: 32px 26px; display: flex; flex-direction: column; gap: 12px; transition: background .2s; min-height: 200px; }
.hub-grid > a:hover { background: var(--fg); color: var(--bg); }
.hub-grid > a:hover .hub-n, .hub-grid > a:hover p { color: rgba(255,255,255,.65); }
.hub-n { font-weight: 500; font-size: 10px; letter-spacing: .25em; text-transform: uppercase; color: var(--fg-mute); }
.hub-grid h3 { font-weight: 700; font-size: 21px; line-height: 1.22; letter-spacing: -0.02em; }
.hub-grid p { font-size: 14.5px; line-height: 1.6; color: var(--fg-mute); font-weight: 300; margin-top: auto; }
@media (max-width: 980px) { .hub-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .hub-grid { grid-template-columns: 1fr; } }

/* glossary A-Z */
.gaz { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 42px; }
.gaz a {
  border: 1px solid var(--line-strong); padding: 8px 14px; font-size: 13px; font-weight: 500;
  transition: all .2s;
}
.gaz a:hover { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.gterms { border: 1px solid var(--fg); }
.gterm { display: grid; grid-template-columns: 1fr 2fr; gap: 26px; padding: 22px 24px; border-bottom: 1px solid var(--line-strong); transition: background .2s; }
.gterm:last-child { border-bottom: 0; }
.gterm:hover { background: rgba(0,0,0,.02); }
.gterm b { font-weight: 700; font-size: 17.5px; letter-spacing: -0.015em; }
.gterm b small { display: block; font-weight: 400; font-size: 12px; letter-spacing: .1em; color: var(--fg-mute); text-transform: uppercase; margin-top: 4px; }
.gterm p { font-size: 15px; line-height: 1.6; color: var(--fg-mute); font-weight: 300; }
@media (max-width: 720px) { .gterm { grid-template-columns: 1fr; gap: 8px; } }

/* === CTA BAND === */
.cta-band { position: relative; z-index: 2; background: var(--fg); color: var(--bg); padding: 86px 32px; }
.cta-inner { max-width: var(--maxw); margin: 0 auto; display: grid; grid-template-columns: 1.35fr 1fr; gap: 60px; align-items: end; }
.cta-inner h2 { font-weight: 800; font-size: clamp(30px, 4.6vw, 56px); line-height: 1.06; letter-spacing: -0.03em; }
.cta-inner h2 .light { font-weight: 300; color: rgba(255,255,255,.55); }
.cta-inner p { font-size: 17px; line-height: 1.65; color: rgba(255,255,255,.62); font-weight: 300; margin-top: 22px; max-width: 52ch; }
.cta-actions { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 17px 30px;
  font-family: var(--font); font-weight: 600; font-size: 12.5px; letter-spacing: .18em;
  text-transform: uppercase; border: 1px solid currentColor; cursor: pointer;
  transition: all .25s ease; white-space: nowrap;
}
.cta-band .btn-primary { background: var(--bg); color: var(--fg); border-color: var(--bg); }
.cta-band .btn-primary:hover { background: transparent; color: var(--bg); }
.cta-band .btn-primary::after { content: '→'; }
.cta-band .btn-ghost { background: transparent; color: var(--bg); }
.cta-band .btn-ghost:hover { background: var(--bg); color: var(--fg); }
.cta-band .btn-ghost::after { content: '↗'; }
@media (max-width: 880px) { .cta-inner { grid-template-columns: 1fr; gap: 34px; align-items: start; } .cta-band { padding: 56px 20px; } }

/* === FOOTER === */
.foot { position: relative; z-index: 2; background: var(--bg); border-top: 1px solid var(--fg); padding: 70px 32px 34px; }
.foot-inner { max-width: var(--maxw); margin: 0 auto; }
.foot-top { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 46px; padding-bottom: 46px; border-bottom: 1px solid var(--line-strong); }
.foot-brand b { display: block; font-weight: 800; font-size: 24px; letter-spacing: -0.025em; margin-bottom: 5px; }
.foot-brand .en { font-weight: 400; font-size: 13px; letter-spacing: .1em; color: var(--fg-mute); text-transform: uppercase; display: block; margin-bottom: 18px; }
.foot-brand p { font-size: 14.5px; line-height: 1.65; color: var(--fg-mute); font-weight: 300; max-width: 42ch; }
.foot-col .label { display: block; margin-bottom: 16px; }
.foot-col ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.foot-col a { font-size: 14.5px; color: var(--fg-soft); font-weight: 300; transition: color .2s; }
.foot-col a:hover { color: var(--fg); }
.foot-bottom { display: flex; justify-content: space-between; gap: 20px; padding-top: 24px; flex-wrap: wrap; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; font-weight: 500; color: var(--fg-mute); }
@media (max-width: 980px) { .foot-top { grid-template-columns: 1fr 1fr; gap: 34px; } }
@media (max-width: 640px) { .foot-top { grid-template-columns: 1fr; } .foot { padding: 48px 20px 28px; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
