:root {
  --ink: #101411;
  --ink-soft: #19201b;
  --paper: #f5f7f2;
  --paper-soft: #dfe5dc;
  --signal: #d9ff67;
  --signal-fill: #d9ff67;
  --signal-deep: #a8c93b;
  --moss: #9aa796;
  --line: rgb(245 247 242 / 14%);
  --line-strong: rgb(245 247 242 / 28%);
  --surface: rgb(25 32 27 / 78%);
  --surface-solid: #19201b;
  --shadow: 0 24px 80px rgb(0 0 0 / 24%);
  --max: 1180px;
  --radius-sm: 14px;
  --radius-md: 24px;
  --radius-lg: 36px;
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

:root[data-theme="light"] {
  --ink: #f5f7f2;
  --ink-soft: #ffffff;
  --paper: #121713;
  --paper-soft: #374038;
  --signal: #536900;
  --signal-fill: #b6db43;
  --signal-deep: #455700;
  --moss: #687466;
  --line: rgb(16 20 17 / 13%);
  --line-strong: rgb(16 20 17 / 24%);
  --surface: rgb(255 255 255 / 78%);
  --surface-solid: #ffffff;
  --shadow: 0 24px 80px rgb(30 45 34 / 12%);
  color-scheme: light;
}

* { box-sizing: border-box; }

html {
  background: var(--ink);
  color: var(--paper);
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 88% 4%, rgb(217 255 103 / 10%), transparent 24rem),
    radial-gradient(circle at 12% 62%, rgb(217 255 103 / 5%), transparent 28rem),
    var(--ink);
  font-size: 1rem;
  line-height: 1.6;
  overflow-x: hidden;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 72px 72px;
  content: "";
  opacity: .18;
  pointer-events: none;
  mask-image: linear-gradient(to bottom, black, transparent 70%);
}

img { max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: .18em; }
p { margin: 0 0 1rem; }
h1, h2, h3 { margin: 0; font-weight: 720; letter-spacing: -.045em; line-height: 1.03; }
h1 { font-size: clamp(3.3rem, 8.3vw, 7.9rem); }
h2 { font-size: clamp(2.2rem, 5vw, 4.5rem); }
h3 { font-size: clamp(1.35rem, 2.2vw, 1.9rem); }

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--signal);
  color: #101411;
  font-weight: 750;
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

:focus-visible {
  outline: 3px solid var(--signal);
  outline-offset: 4px;
  border-radius: 6px;
}

.shell { width: min(calc(100% - 40px), var(--max)); margin-inline: auto; }
.site-header { position: relative; z-index: 20; padding-top: 18px; }
.header-inner {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 10px 12px 10px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--ink-soft) 78%, transparent);
  box-shadow: 0 12px 40px rgb(0 0 0 / 10%);
  backdrop-filter: blur(18px);
}

.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--paper); text-decoration: none; }
.brand-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  background: center / contain no-repeat url('/assets/brand/massdex-mark-light-128.png');
}
:root[data-theme="light"] .brand-mark { background-image: url('/assets/brand/massdex-mark-dark-128.png'); }
.brand-word { font-size: 1.12rem; font-weight: 760; letter-spacing: -.055em; }

.primary-nav { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.primary-nav a, .theme-toggle {
  min-height: 40px;
  padding: 8px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--paper-soft);
  font: inherit;
  font-size: .84rem;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}
.primary-nav a:hover, .theme-toggle:hover, .primary-nav a[aria-current="page"] { background: var(--line); color: var(--paper); }
.theme-toggle { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); }
.theme-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 0 4px rgb(217 255 103 / 10%); }

.hero { display: grid; min-height: 760px; grid-template-columns: minmax(0, 1.28fr) minmax(320px, .72fr); align-items: center; gap: clamp(38px, 7vw, 100px); padding-block: clamp(92px, 14vw, 180px) 90px; }
.eyebrow { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; color: var(--signal); font-size: .75rem; font-weight: 760; letter-spacing: .13em; text-transform: uppercase; }
.eyebrow::before { width: 28px; height: 1px; background: currentColor; content: ""; }
.hero h1 span { display: block; color: var(--moss); }
.lede { max-width: 650px; margin-top: 30px; color: var(--paper-soft); font-size: clamp(1.15rem, 2.1vw, 1.45rem); line-height: 1.55; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.button { display: inline-flex; min-height: 48px; align-items: center; justify-content: center; gap: 9px; padding: 0 18px; border: 1px solid var(--line-strong); border-radius: 13px; font-size: .87rem; font-weight: 730; text-decoration: none; transition: transform .18s ease, border-color .18s ease, background .18s ease; }
.button:hover { transform: translateY(-2px); border-color: var(--signal); }
.button-primary { border-color: var(--signal-fill); background: var(--signal-fill); color: #101411; }
.button-quiet { background: var(--surface); }
.button svg { width: 16px; height: 16px; fill: currentColor; }

.hero-index { position: relative; padding: 18px; }
.hero-index::before, .hero-index::after { position: absolute; z-index: -1; border-radius: 50%; content: ""; filter: blur(1px); }
.hero-index::before { inset: -20% 8% 16% -10%; border: 1px solid var(--line); }
.hero-index::after { right: -5%; bottom: 0; width: 160px; height: 160px; background: rgb(217 255 103 / 8%); }
.index-board { position: relative; padding: 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow); transform: rotate(2deg); }
.index-board-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 16px; color: var(--moss); font-size: .71rem; font-weight: 720; letter-spacing: .1em; text-transform: uppercase; }
.live-signal { display: inline-flex; align-items: center; gap: 7px; color: var(--paper); }
.live-signal::before { width: 8px; height: 8px; border-radius: 50%; background: var(--signal); content: ""; }
.signal-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.signal-list li { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; background: color-mix(in srgb, var(--paper) 5%, transparent); }
.signal-list .number { color: var(--signal); font-size: .72rem; font-weight: 760; }
.signal-list strong { font-size: .9rem; letter-spacing: -.02em; }
.signal-list small { color: var(--moss); font-size: .7rem; }
.signal-list .state { width: 7px; height: 7px; border-radius: 50%; background: var(--moss); }
.signal-list li:first-child .state, .signal-list li:nth-child(3) .state { background: var(--signal); }

.section { padding-block: clamp(82px, 11vw, 140px); }
.section-rule { border-top: 1px solid var(--line); }
.section-heading { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, .55fr); align-items: end; gap: 40px; margin-bottom: 54px; }
.section-heading p { max-width: 520px; margin: 0; color: var(--moss); }

.product-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.product-card { position: relative; min-height: 390px; padding: clamp(24px, 4vw, 42px); border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); overflow: hidden; }
.product-card::after { position: absolute; right: -40px; bottom: -46px; width: 160px; height: 160px; border: 1px solid var(--line); border-radius: 38%; content: ""; transform: rotate(24deg); }
.product-card:nth-child(2)::after { border-radius: 50%; }
.product-card:nth-child(3)::after { width: 210px; height: 75px; bottom: 20px; border-radius: 999px; transform: rotate(-12deg); }
.product-card:nth-child(4)::after { width: 115px; height: 115px; border-color: rgb(217 255 103 / 32%); }
.product-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 54px; color: var(--moss); font-size: .71rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.product-meta span:last-child { color: var(--signal); }
.product-card p { max-width: 520px; margin-top: 22px; color: var(--paper-soft); }
.card-links { display: flex; position: absolute; left: clamp(24px, 4vw, 42px); bottom: 34px; z-index: 2; flex-wrap: wrap; gap: 16px; }
.text-link { display: inline-flex; align-items: center; gap: 8px; color: var(--paper); font-size: .82rem; font-weight: 700; text-decoration-color: var(--signal); }
.text-link::after { color: var(--signal); content: "↗"; }
.text-link.internal::after { content: "→"; }

.principle-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.principle { min-height: 250px; padding: 26px 22px 26px 0; border-bottom: 1px solid var(--line); }
.principle + .principle { padding-left: 22px; border-left: 1px solid var(--line); }
.principle .number { display: block; margin-bottom: 76px; color: var(--signal); font-size: .72rem; font-weight: 750; }
.principle h3 { margin-bottom: 12px; font-size: 1.05rem; letter-spacing: -.025em; }
.principle p { color: var(--moss); font-size: .82rem; line-height: 1.55; }

.callout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr); gap: 50px; padding: clamp(34px, 6vw, 68px); border: 1px solid var(--line-strong); border-radius: var(--radius-lg); background: var(--signal-fill); color: #101411; }
.callout p { max-width: 510px; margin: 0; align-self: end; color: #27301d; font-size: 1rem; }
.callout .button { border-color: #101411; }

.page-hero { display: grid; min-height: 560px; grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr); align-items: end; gap: 64px; padding-block: 120px 84px; }
.page-hero h1 { font-size: clamp(3.7rem, 8vw, 7.2rem); }
.page-hero .lede { margin: 0 0 10px; }
.page-kicker { color: var(--signal); }

.detail-grid { display: grid; grid-template-columns: minmax(220px, .36fr) minmax(0, 1fr); gap: clamp(44px, 8vw, 120px); }
.detail-aside { align-self: start; position: sticky; top: 24px; color: var(--moss); font-size: .82rem; }
.detail-aside strong { display: block; margin-bottom: 10px; color: var(--paper); }
.detail-content { max-width: 760px; }
.detail-content section { padding-block: 42px; border-top: 1px solid var(--line); }
.detail-content section:first-child { padding-top: 0; border-top: 0; }
.detail-content h2 { margin-bottom: 22px; font-size: clamp(1.65rem, 3vw, 2.55rem); }
.detail-content h3 { margin: 28px 0 10px; font-size: 1.02rem; letter-spacing: -.02em; }
.detail-content p, .detail-content li { color: var(--paper-soft); }
.detail-content ul { display: grid; gap: 10px; padding-left: 1.2rem; }

.product-list { display: grid; gap: 12px; }
.product-row { display: grid; grid-template-columns: 90px minmax(0, .8fr) minmax(260px, 1.2fr) auto; align-items: start; gap: 24px; padding: 28px 0; border-top: 1px solid var(--line); }
.product-row:last-child { border-bottom: 1px solid var(--line); }
.product-row .index { color: var(--signal); font-size: .75rem; font-weight: 750; }
.product-row h2 { font-size: 1.45rem; }
.product-row p { margin: 0; color: var(--moss); font-size: .9rem; }
.product-row .status { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; color: var(--paper-soft); font-size: .72rem; font-weight: 700; }
.product-row .status::before { width: 7px; height: 7px; border-radius: 50%; background: var(--signal); content: ""; }
.product-row .status.preview::before { background: var(--moss); }

.fact-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 38px; }
.fact { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.fact dt { margin-bottom: 9px; color: var(--moss); font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.fact dd { margin: 0; color: var(--paper); font-weight: 650; }

.notice { padding: 24px; border: 1px solid var(--line-strong); border-left: 4px solid var(--signal); border-radius: var(--radius-sm); background: var(--surface); }
.notice strong { display: block; margin-bottom: 8px; }
.notice p:last-child { margin-bottom: 0; }

.site-footer { padding-block: 70px 34px; }
.footer-main { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 36px; padding-top: 34px; border-top: 1px solid var(--line); }
.footer-main p { max-width: 420px; margin-top: 16px; color: var(--moss); font-size: .84rem; }
.footer-nav { display: grid; grid-template-columns: repeat(2, minmax(100px, 1fr)); gap: 10px 26px; }
.footer-nav a { color: var(--paper-soft); font-size: .82rem; text-decoration: none; }
.footer-nav a:hover { color: var(--signal); }
.footer-lower { display: flex; justify-content: space-between; gap: 24px; margin-top: 50px; color: var(--moss); font-size: .71rem; }

@media (max-width: 900px) {
  .hero { min-height: auto; grid-template-columns: 1fr; padding-top: 100px; }
  .hero-copy { max-width: 760px; }
  .hero-index { width: min(100%, 540px); justify-self: end; }
  .section-heading, .page-hero, .callout { grid-template-columns: 1fr; }
  .section-heading { align-items: start; }
  .principle-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .principle:nth-child(3) { border-left: 0; }
  .principle:last-child { grid-column: 1 / -1; }
  .product-row { grid-template-columns: 60px minmax(0, .8fr) minmax(240px, 1.2fr); }
  .product-row .status { grid-column: 2; }
}

@media (max-width: 720px) {
  .shell { width: min(calc(100% - 24px), var(--max)); }
  .site-header { padding-top: 10px; }
  .header-inner { align-items: flex-start; flex-direction: column; gap: 4px; padding: 12px; }
  .primary-nav { display: grid; width: 100%; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 2px; }
  .primary-nav a, .theme-toggle { min-width: 0; justify-content: center; padding-inline: 6px; font-size: .8rem; }
  .theme-toggle [data-theme-label] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .hero { gap: 64px; padding-block: 82px 70px; }
  .hero-index { width: 100%; padding: 0; }
  .index-board { transform: none; }
  .product-grid, .detail-grid, .fact-grid { grid-template-columns: 1fr; }
  .product-card { min-height: 410px; }
  .principle-grid { grid-template-columns: 1fr; }
  .principle, .principle + .principle { min-height: 0; padding: 24px 0; border-left: 0; }
  .principle .number { margin-bottom: 36px; }
  .principle:last-child { grid-column: auto; }
  .detail-aside { position: static; }
  .page-hero { min-height: 480px; padding-top: 90px; }
  .product-row { grid-template-columns: 44px 1fr; gap: 12px; }
  .product-row p, .product-row .status { grid-column: 2; }
  .footer-main { grid-template-columns: 1fr; }
  .footer-lower { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 460px) {
  h1 { font-size: clamp(3rem, 17vw, 4.4rem); }
  .hero .lede { font-size: 1.06rem; }
  .signal-list li { grid-template-columns: 34px 1fr; }
  .signal-list .state { display: none; }
  .actions .button { width: 100%; }
  .product-card { min-height: 450px; }
  .callout { padding: 28px; }
}

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

@media (forced-colors: active) {
  .button, .header-inner, .product-card, .notice, .callout { border: 2px solid CanvasText; }
  .theme-dot, .live-signal::before, .product-row .status::before { background: Highlight; }
  .brand-mark { background-image: none; border: 2px solid CanvasText; border-radius: 50%; }
}
