:root {
  color-scheme: dark;
  --bg: #0a0b0d;
  --surface: #111316;
  --ink: #f5f5f3;
  --muted: #b0b0ad;
  --line: #292b2e;
  --amber: #efbe82;
  --green: #9cc5a5;
  --terracotta: #d69377;
  --red: #ff7678;
  --accent: var(--amber);
  --sans: "Instrument Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", monospace;
  --gutter: clamp(1rem, 4.75vw, 4.5rem);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { display: flex; min-height: 100vh; flex-direction: column; margin: 0; background: var(--bg); color: var(--ink); font: 1rem/1.6 var(--sans); }
main { flex: 1; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
[id] { scroll-margin-block-start: 1rem; }

.wrap {
  width: min(calc(100% - 2 * var(--gutter)), 82rem);
  margin-inline: auto;
}

.sr-only, .skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link:focus {
  position: fixed;
  inset: 1rem auto auto 1rem;
  z-index: 5;
  padding: .7rem 1rem;
  background: var(--ink);
  color: var(--bg);
}

.site-header { border-bottom: 1px solid var(--line); }
.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .15rem 1.25rem;
  padding-block: .6rem;
  min-height: 4.5rem;
}

.wordmark { font-size: 1.23rem; font-weight: 700; letter-spacing: -.055em; }
.wordmark span { color: var(--amber); }
.site-nav { display: flex; flex-wrap: wrap; gap: 0 clamp(.75rem, 2.8vw, 2.4rem); }
.site-nav a { display: flex; align-items: center; gap: .35rem; min-height: 2.75rem; color: var(--muted); font-size: .84rem; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); }
.site-nav a[aria-current="page"] { box-shadow: inset 0 -1px var(--amber); }

.hero {
  position: relative;
  isolation: isolate;
  padding-block: clamp(3rem, 7vw, 6.5rem) clamp(3.25rem, 7vw, 6.5rem);
}

.hero-content { position: relative; }
.eyebrow { font: 500 .72rem/1.55 var(--mono); letter-spacing: .075em; text-transform: uppercase; }
.section-label { margin-bottom: .6rem; color: var(--amber); }
.hero h1 {
  margin-bottom: 1.15rem;
  font-size: clamp(2.7rem, 8vw, 7.35rem);
  font-weight: 600;
  letter-spacing: -.077em;
  line-height: .96;
}
.hero h1 span { display: block; color: #c3c3bf; }
.hero-lede { max-width: 37rem; color: var(--muted); font-size: clamp(1rem, 2vw, 1.27rem); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; }
.hero .actions { margin-top: 2rem; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: .7rem;
  min-height: 3rem;
  max-width: 100%;
  padding: .7rem .95rem;
  border: 1px solid transparent;
  border-radius: .3rem;
  font-size: .9rem;
  font-weight: 650;
  line-height: 1.35;
  transition: background-color .2s, border-color .2s, color .2s;
}
.button > [aria-hidden] { flex: none; font-weight: 500; }
.button-light { background: var(--ink); color: var(--bg); }
.button-light:hover { background: var(--amber); }
.button-outline { background: transparent; border-color: #484a4d; color: var(--ink); }
.button-outline:hover { border-color: var(--muted); background: #222428; }
.hero-drawing { display: none; }

.page-intro { padding-block: clamp(2.6rem, 6.5vw, 5.7rem) clamp(2rem, 4vw, 3.4rem); }
.page-intro h1 {
  font-size: clamp(2.65rem, 7vw, 6rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -.07em;
  text-wrap: balance;
}
.page-intro .hero-lede { margin-top: .85rem; }

.section { padding-block: clamp(2rem, 4.7vw, 4rem) clamp(2.6rem, 5.8vw, 5rem); border-top: 1px solid var(--line); }
.section-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .55rem 2rem;
  margin-bottom: clamp(1.55rem, 4vw, 3rem);
}
.section-heading h2, .contact h2 {
  font-size: clamp(2.1rem, 4.6vw, 4.2rem);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -.06em;
}
.section-heading p, .chapter-copy > p:last-child, .product-card > p, .focus-card > p, .contact p { color: var(--muted); }
.section-heading .section-label { color: var(--amber); }

.demo-grid { display: grid; gap: .8rem; }
.demo-card {
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: .55rem;
  background: var(--surface);
  transition: border-color .2s;
}
.demo-card:nth-child(2) { --accent: var(--green); }
.demo-card:nth-child(3) { --accent: var(--red); }
.demo-card:hover, .demo-card:focus-visible { border-color: var(--accent); }
.demo-card img { display: block; width: 100%; aspect-ratio: 2 / 1; object-fit: cover; border-bottom: 1px solid var(--line); }
.demo-card-copy { padding: clamp(1rem, 2vw, 1.55rem); }
.demo-card-copy .eyebrow { color: var(--accent); }
.demo-card-copy h3 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem;
  margin-block: .25rem;
  font-size: clamp(1.3rem, 2.35vw, 1.9rem);
  line-height: 1.15;
  letter-spacing: -.045em;
}
.demo-card-copy h3 span { color: var(--accent); font-size: 1rem; }
.demo-card-copy p:last-child { color: var(--muted); font-size: .93rem; }

[data-showcase][data-active="sorella"], #sorella { --accent: var(--green); --secondary-accent: var(--terracotta); }
[data-showcase][data-active="apex"], #apex { --accent: var(--red); }
#nexus { --accent: var(--amber); }

.stage-panels:empty { display: none; }
.chapter-nav { display: flex; align-items: center; gap: .4rem; margin-bottom: 1rem; }
.chapter-nav a {
  display: grid;
  min-width: 2.75rem;
  min-height: 2.75rem;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: .28rem;
  color: var(--muted);
  font: 500 .78rem var(--mono);
  transition: color .2s, border-color .2s, background-color .2s;
}
.chapter-nav a:hover { border-color: var(--muted); color: var(--ink); }
.chapter-nav a[aria-current] {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 11%, var(--bg));
  color: var(--accent);
}

.chapters { min-width: 0; }
.chapter { padding-block: 1.6rem 1.85rem; border-top: 1px solid var(--line); }
.chapter:last-child { border-bottom: 1px solid var(--line); }
.chapter-label { color: var(--accent); }
.chapter-label span { color: var(--secondary-accent, var(--accent)); }
.chapter h2 {
  margin-block: .6rem .65rem;
  font-size: clamp(1.8rem, 3.75vw, 3.8rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -.06em;
  text-wrap: balance;
}
.chapter-copy > p:last-child { max-width: 35ch; }
.preview { min-width: 0; margin-top: 1.2rem; }
.browser {
  position: relative;
  margin-bottom: .7rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-top-color: var(--secondary-accent, var(--accent));
  border-radius: .55rem;
  background: #17191d;
  box-shadow: 0 1rem 3rem #0007;
  transition: border-color .2s;
}
.browser-bar {
  position: relative;
  display: grid;
  min-height: 2.25rem;
  place-items: center;
  padding-inline: 3.3rem;
  border-bottom: 1px solid #282b30;
}
.browser-dots { position: absolute; left: .75rem; display: flex; gap: .24rem; }
.browser-dots i { width: .34rem; height: .34rem; border-radius: 50%; background: #5a5c61; }
.browser-dots i:first-child { background: var(--secondary-accent, var(--accent)); }
.browser-path { color: #d0d0d0; font: .67rem var(--mono); }
.browser-viewport { position: relative; aspect-ratio: 8 / 5; overflow: hidden; }
.browser-viewport iframe {
  position: absolute;
  inset: 0 auto auto 0;
  display: block;
  width: 1280px;
  height: 800px;
  border: 0;
  pointer-events: none;
  transform: scale(var(--preview-scale, 0));
  transform-origin: top left;
}
.button-demo {
  width: 100%;
  min-height: 3.2rem;
  background: var(--accent);
  color: #121316;
  font-size: .97rem;
}
.button-demo:hover { background: color-mix(in srgb, var(--accent), #fff 20%); }

.product-grid, .focus-grid { display: grid; gap: .8rem; }
.product-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: clamp(1.15rem, 3.4vw, 2.5rem);
  border: 1px solid var(--line);
  border-radius: .55rem;
  background: linear-gradient(145deg, #181a1e, var(--surface) 66%);
}
.product-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem 1rem; color: var(--muted); }
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .2rem .5rem;
  border: 1px solid #31533d;
  border-radius: 2rem;
  background: #18281f;
  color: #a9d8b6;
  font: 500 .69rem/1.4 var(--mono);
}
.live-badge::before { content: ""; width: .36rem; height: .36rem; flex: none; border-radius: 50%; background: currentColor; }
.product-card h2 {
  margin-block: 1.1rem .35rem;
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -.06em;
  font-weight: 600;
}
.product-card > p { max-width: 51ch; }
.product-features {
  display: grid;
  gap: .55rem;
  margin: 1.2rem 0 1.55rem;
  padding: 1rem 0 0 1.25rem;
  border-top: 1px solid var(--line);
}
.product-features li::marker { color: var(--amber); }
.product-card .button { align-self: flex-start; margin-top: auto; }
.focus-card { padding: 1.25rem; border: 1px solid var(--line); border-radius: .4rem; background: var(--surface); }
.focus-card h3 { margin-bottom: .3rem; font-size: 1.1rem; font-weight: 650; letter-spacing: -.025em; }
.focus-card p { font-size: .93rem; }

.contact {
  display: grid;
  align-items: center;
  gap: 1.25rem 2rem;
  margin-top: clamp(1.6rem, 4.8vw, 4rem);
  padding: clamp(1.2rem, 4.2vw, 3.7rem);
  border: 1px solid var(--line);
  border-radius: .55rem;
  background: radial-gradient(ellipse at top right, #20201d, var(--surface) 68%);
}
.contact h2 { margin-bottom: .65rem; }
.contact p { max-width: 45ch; }
.contact-panel { margin-top: 0; }
.contact .contact-email { font-size: 1rem; overflow-wrap: anywhere; }
.contact .copy-status { margin-top: .6rem; color: var(--amber); font-size: .85rem; }
.legal-details { display: grid; gap: 1.5rem; }
.legal-details section + section { border-top: 1px solid var(--line); padding-top: 1.5rem; }
.legal-details h2 { margin-bottom: .45rem; font-size: clamp(1.15rem, 2.4vw, 1.55rem); letter-spacing: -.025em; }
.legal-details p, .legal-details address { max-width: 65ch; color: var(--muted); font-style: normal; overflow-wrap: anywhere; }
.legal-details a { text-decoration: underline; text-underline-offset: .18em; }
.legal-details a:hover { color: var(--ink); }
.site-footer { border-top: 1px solid var(--line); padding-block: 1.4rem 1.7rem; color: var(--muted); font-size: .87rem; }
.site-footer strong { color: var(--ink); font-weight: 600; }
.footer-inner, .footer-links, .footer-links nav { display: flex; flex-wrap: wrap; gap: .4rem 1.15rem; }
.footer-inner { justify-content: space-between; }
.footer-links a:hover, .footer-links a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-underline-offset: .25em; }

@media (min-width: 37rem) {
  .header-inner { flex-wrap: nowrap; }
  .site-nav a { font-size: .93rem; }
  .hero-drawing {
    position: absolute;
    z-index: -1;
    display: grid;
    place-items: center;
    inset: 0 0 0 auto;
    width: min(53%, 38rem);
    overflow: hidden;
    color: #655746;
    background: repeating-linear-gradient(0deg, #413c3455 0 1px, transparent 1px 2.7rem),
      repeating-linear-gradient(90deg, #413c3455 0 1px, transparent 1px 2.7rem),
      radial-gradient(ellipse at 75% 46%, #523b2652, transparent 66%);
    mask-image: radial-gradient(ellipse at 70% 47%, #000, transparent 74%);
  }
  .hero-drawing i { grid-area: 1 / 1; width: 65%; aspect-ratio: 1; border: 1px solid currentColor; border-radius: 50%; }
  .hero-drawing i:nth-child(2) { width: 48%; }
  .hero-drawing i:nth-child(3) { width: 29%; }
  .hero-drawing::before, .hero-drawing::after { content: ""; grid-area: 1 / 1; width: 95%; height: 1px; background: currentColor; transform: rotate(-40deg); }
  .hero-drawing::after { transform: rotate(40deg); }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .demo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 54rem) {
  .is-ready .showcase {
    display: grid;
    grid-template-columns: minmax(0, .82fr) minmax(0, 1.45fr);
    align-items: start;
    gap: clamp(1.9rem, 5.4vw, 6.3rem);
  }
  .is-ready .stage {
    position: sticky;
    top: clamp(.75rem, 5vh, 2.75rem);
    grid-area: 1 / 2;
    width: min(100%, max(16rem, calc((100svh - 11rem) * 1.6)));
  }
  .is-ready .chapters { grid-area: 1 / 1; }
  .is-ready .chapter {
    display: flex;
    min-height: max(20rem, 68svh);
    align-items: center;
    padding-block: 2.25rem;
  }
  .is-ready .chapter-copy { opacity: .74; transition: opacity .2s; }
  .is-ready .chapter.is-active .chapter-copy { opacity: 1; }
  .stage .preview { margin-top: 0; }
  .focus-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .contact { grid-template-columns: 1fr auto; }
  .contact-panel { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
