:root {
  color-scheme: light;
  --paper: #f4f5f0;
  --paper-deep: #e8ebe4;
  --surface: #fffdfa;
  --ink: #111510;
  --muted: #626b61;
  --line: #d6dbd0;
  --accent: #245f4b;
  --accent-ink: #0f382c;
  --accent-soft: #dce8df;
  --warn: #7f473c;
  --shadow: 0 28px 80px rgb(29 42 34 / 0.14);
  --radius: 28px;
  --button-radius: 999px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--paper);
  color: var(--ink);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
  min-width: 320px;
  margin: 0;
  background:
    linear-gradient(145deg, rgb(255 255 255 / 0.72), transparent 38rem),
    linear-gradient(180deg, var(--paper), var(--paper-deep));
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgb(17 21 16 / 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgb(17 21 16 / 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, rgb(0 0 0 / 0.9), transparent 78%);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  border: 0;
  color: inherit;
  cursor: pointer;
  font: inherit;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
  padding: 0 clamp(18px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(18px);
}

.topbar a,
.topbar span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

main {
  width: min(1360px, calc(100% - 32px));
  margin: 0 auto;
  padding-bottom: 92px;
}

h1,
h2,
h3,
p,
figure {
  margin-top: 0;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(380px, 0.82fr);
  gap: clamp(32px, 7vw, 96px);
  align-items: center;
  min-height: clamp(590px, 72dvh, 720px);
  padding: clamp(32px, 6vw, 72px) 0 46px;
}

.hero-copy {
  width: 100%;
  min-width: 0;
  max-width: 720px;
}

.design-read {
  max-width: min(56ch, 100%);
  margin-bottom: 28px;
  color: var(--accent);
  font-size: 15px;
  font-weight: 760;
  line-height: 1.45;
}

h1 {
  max-width: 15ch;
  margin-bottom: 22px;
  color: var(--ink);
  font-size: clamp(54px, 8vw, 116px);
  font-weight: 840;
  letter-spacing: 0;
  line-height: 0.88;
}

.hero-copy > p:last-of-type {
  max-width: min(500px, 100%);
  margin-bottom: 28px;
  color: var(--muted);
  font-size: clamp(19px, 2vw, 24px);
  line-height: 1.35;
}

.hero-actions,
.preflight-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid var(--accent);
  border-radius: var(--button-radius);
  padding: 0 18px;
  font-size: 14px;
  font-weight: 780;
  line-height: 1;
  transition:
    transform 180ms var(--ease),
    background 180ms var(--ease),
    color 180ms var(--ease);
}

.primary-action {
  background: var(--accent);
  color: #f9fff9;
}

.secondary-action {
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  color: var(--accent-ink);
}

.primary-action:hover,
.secondary-action:hover {
  transform: translateY(-2px);
}

.primary-action:active,
.secondary-action:active {
  transform: translateY(1px);
}

.hero-stage {
  position: relative;
  min-height: 570px;
}

.hero-photo {
  position: absolute;
  overflow: hidden;
  margin: 0;
  border: 1px solid rgb(255 255 255 / 0.76);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.48) contrast(1.06);
}

.hero-photo-large {
  inset: 0 7% 0 18%;
}

.hero-photo-small {
  right: 0;
  bottom: 34px;
  width: 44%;
  height: 44%;
}

.hero-panel {
  position: absolute;
  left: 0;
  bottom: 88px;
  display: grid;
  gap: 8px;
  width: min(260px, 58%);
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
  border-radius: var(--radius);
  padding: 18px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.hero-panel span {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
  color: var(--accent-ink);
  font-size: 14px;
  font-weight: 760;
}

.hero-panel span:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.feature-lab,
.compare,
.preflight {
  padding: 86px 0 0;
  border-top: 1px solid var(--line);
}

.section-intro {
  display: grid;
  gap: 16px;
  min-width: 0;
  max-width: 720px;
  margin-bottom: 30px;
}

.section-intro.compact {
  max-width: 660px;
}

h2 {
  margin-bottom: 0;
  color: var(--ink);
  font-size: clamp(34px, 5vw, 68px);
  font-weight: 820;
  letter-spacing: 0;
  line-height: 0.95;
}

h1,
h2,
h3,
p,
li,
button,
a {
  overflow-wrap: break-word;
  word-break: normal;
}

.section-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.5;
}

.lab-shell {
  display: grid;
  grid-template-columns: minmax(210px, 0.45fr) minmax(0, 1fr) minmax(220px, 0.38fr);
  gap: 14px;
  align-items: stretch;
  min-width: 0;
}

.feature-rail,
.specimen,
.coverage-meter,
.page-specimen,
.critique-panel,
.preflight-grid article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  box-shadow: var(--shadow);
}

.feature-rail {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 12px;
}

.feature-rail button,
.mode-switch button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  border-radius: 18px;
  padding: 12px 14px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 740;
  text-align: left;
  white-space: normal;
  transition:
    transform 180ms var(--ease),
    background 180ms var(--ease),
    color 180ms var(--ease);
}

.feature-rail button::after {
  content: "+";
  color: color-mix(in srgb, var(--muted) 60%, transparent);
}

.feature-rail button.is-active,
.mode-switch button.is-active {
  background: var(--accent);
  color: #f8fff8;
}

.feature-rail button.is-active::after {
  color: #f8fff8;
}

.feature-rail button:hover,
.mode-switch button:hover {
  transform: translateY(-1px);
}

.specimen {
  min-height: 580px;
  overflow: hidden;
  padding: clamp(22px, 4vw, 42px);
}

.specimen-head {
  display: flex;
  align-items: flex-start;
  gap: 22px;
  margin-bottom: clamp(30px, 5vw, 58px);
}

.specimen-head span {
  display: inline-grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--accent);
  font-weight: 820;
}

.specimen-head h3 {
  max-width: 12ch;
  margin: 0;
  color: var(--ink);
  font-size: clamp(42px, 6vw, 86px);
  font-weight: 820;
  letter-spacing: 0;
  line-height: 0.9;
}

.specimen-body {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(280px, 0.58fr);
  gap: clamp(24px, 5vw, 58px);
  align-items: stretch;
}

#featureSummary {
  max-width: 520px;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.5;
}

.feature-points {
  display: grid;
  gap: 10px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.feature-points li {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.4;
}

.living-preview {
  display: grid;
  align-content: end;
  min-height: 340px;
  overflow: hidden;
  border-radius: calc(var(--radius) - 6px);
  padding: 24px;
  background:
    linear-gradient(140deg, color-mix(in srgb, var(--accent-soft) 76%, transparent), transparent 62%),
    url("https://picsum.photos/seed/interface-method-panel/760/880") center / cover;
  color: #fbfff7;
  isolation: isolate;
  position: relative;
}

.living-preview::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, transparent, rgb(12 24 18 / 0.74));
}

.living-preview span {
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 780;
}

.living-preview strong {
  max-width: 12ch;
  font-size: clamp(28px, 4vw, 52px);
  line-height: 0.95;
}

.living-preview p {
  max-width: 32ch;
  margin: 16px 0 0;
  color: rgb(251 255 247 / 0.82);
  line-height: 1.45;
}

.coverage-meter {
  display: grid;
  align-content: end;
  gap: 14px;
  min-height: 360px;
  padding: 22px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent-soft) 44%, transparent), transparent),
    var(--surface);
}

.coverage-meter span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 780;
}

.coverage-meter strong {
  color: var(--accent);
  font-size: clamp(84px, 9vw, 132px);
  font-weight: 780;
  line-height: 0.8;
}

.coverage-meter p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.compare {
  margin-top: 86px;
}

.compare-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.34fr);
  gap: 14px;
}

.mode-switch {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px;
  background: color-mix(in srgb, var(--surface) 76%, transparent);
}

.mode-switch button {
  display: flex;
  justify-content: center;
  min-height: 46px;
  text-align: center;
}

.page-specimen {
  overflow: hidden;
  padding: clamp(18px, 3vw, 32px);
  transition:
    background 220ms var(--ease),
    border-color 220ms var(--ease);
}

.mini-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 12%, transparent);
}

.mini-nav span,
.mini-nav a {
  font-size: 14px;
  font-weight: 800;
}

.mini-nav a {
  border: 1px solid currentColor;
  border-radius: var(--button-radius);
  padding: 8px 12px;
}

.mini-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(280px, 0.6fr);
  gap: clamp(24px, 5vw, 64px);
  align-items: center;
  min-height: 480px;
  padding-top: 26px;
}

.mini-copy span {
  color: var(--accent);
  font-size: 14px;
  font-weight: 800;
}

.mini-copy h3 {
  max-width: 9ch;
  margin: 14px 0 18px;
  color: var(--ink);
  font-size: clamp(42px, 7vw, 96px);
  font-weight: 840;
  line-height: 0.88;
}

.mini-copy p {
  max-width: 420px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.5;
}

.mini-image {
  margin: 0;
  overflow: hidden;
  border-radius: calc(var(--radius) - 6px);
}

.mini-image img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  filter: saturate(0.62) contrast(1.04);
}

.page-specimen.generic {
  border-color: color-mix(in srgb, #7562df 35%, var(--line));
  background:
    radial-gradient(circle at 78% 10%, rgb(117 98 223 / 0.22), transparent 32%),
    var(--surface);
}

.page-specimen.generic .mini-copy span,
.page-specimen.generic .mini-nav a {
  color: #7562df;
}

.page-specimen.studio {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent-soft) 52%, transparent), transparent 56%),
    var(--surface);
}

.critique-panel {
  align-self: stretch;
  padding: 22px;
}

.critique-panel h3 {
  margin-bottom: 18px;
  color: var(--ink);
  font-size: 24px;
}

.critique-panel ul {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.critique-panel li {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  color: var(--muted);
  line-height: 1.45;
}

.preflight {
  margin-top: 86px;
}

.preflight-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(170px, 1fr));
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 10px;
  scroll-snap-type: x mandatory;
}

.preflight-grid article {
  display: grid;
  align-content: space-between;
  min-height: 230px;
  box-shadow: none;
  padding: 18px;
  scroll-snap-align: start;
  transition:
    transform 180ms var(--ease),
    background 180ms var(--ease),
    border-color 180ms var(--ease);
}

.preflight-grid article::before {
  content: attr(data-check);
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
}

.preflight-grid strong {
  margin-top: 36px;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.05;
}

.preflight-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.preflight-grid article.is-passed {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 46%, var(--line));
  background: color-mix(in srgb, var(--accent-soft) 64%, var(--surface));
}

.preflight-actions {
  margin-top: 18px;
}

#preflightResult {
  margin: 0;
  color: var(--accent);
  font-weight: 800;
}

@media (prefers-reduced-motion: no-preference) {
  .hero-copy,
  .hero-stage,
  .feature-lab,
  .compare,
  .preflight {
    animation: rise 620ms var(--ease) both;
  }

  .hero-stage {
    animation-delay: 80ms;
  }

  .feature-lab,
  .compare,
  .preflight {
    animation-delay: 120ms;
  }

  @keyframes rise {
    from {
      opacity: 0;
      transform: translateY(18px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #111410;
    --paper-deep: #171c16;
    --surface: #1b211b;
    --ink: #f3f6ef;
    --muted: #aab5a8;
    --line: #334033;
    --accent: #9bd4ad;
    --accent-ink: #d9f4df;
    --accent-soft: #203426;
    --shadow: 0 28px 80px rgb(0 0 0 / 0.34);
  }

  body {
    background:
      linear-gradient(145deg, rgb(255 255 255 / 0.045), transparent 38rem),
      linear-gradient(180deg, var(--paper), var(--paper-deep));
  }

  .primary-action,
  .feature-rail button.is-active,
  .mode-switch button.is-active {
    color: #0e160f;
  }

  .hero-photo img,
  .mini-image img {
    filter: saturate(0.54) contrast(0.98) brightness(0.86);
  }
}

@media (max-width: 1080px) {
  .hero,
  .lab-shell,
  .compare-board,
  .mini-layout,
  .specimen-body {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .hero-stage {
    min-height: 520px;
  }

  .coverage-meter {
    min-height: 220px;
  }
}

@media (max-width: 720px) {
  main {
    width: calc(100vw - 24px);
    max-width: 1360px;
    overflow-x: clip;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    min-height: auto;
    padding: 14px 18px;
  }

  .hero {
    padding-top: 38px;
  }

  .design-read {
    font-size: 14px;
  }

  h1 {
    max-width: 8ch;
  }

  .hero-actions,
  .preflight-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-action,
  .secondary-action {
    width: 100%;
  }

  .hero-stage {
    min-height: 440px;
  }

  .hero-photo-large {
    inset: 0 0 44px 0;
  }

  .hero-photo-small,
  .hero-panel {
    display: none;
  }

  .specimen-head {
    display: grid;
    gap: 14px;
  }

  .feature-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .feature-rail button {
    min-height: 58px;
    padding: 12px;
    font-size: 13px;
  }

  .mode-switch {
    grid-template-columns: 1fr;
  }

  .preflight-grid {
    grid-template-columns: repeat(6, minmax(230px, 78vw));
  }
}
