:root {
  --navy-950: #071025;
  --navy-900: #0a141f;
  --navy-850: #0d1830;
  --navy-800: #10213a;
  --paper: #f5f7fb;
  --paper-soft: #dce8f6;
  --muted: #94a7bd;
  --cyan: #2ac8ff;
  --blue: #1869ff;
  --violet: #7b3dff;
  --gold: #d8a548;
  --green: #4fd0a8;
  --line: rgba(148, 167, 189, 0.26);
  --panel: rgba(10, 20, 31, 0.76);
  --panel-solid: #0d1830;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.34);
  color-scheme: dark light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  color: var(--paper);
  background: var(--navy-900);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 18% 12%, rgba(42, 200, 255, 0.18), transparent 28rem),
    radial-gradient(circle at 80% 10%, rgba(216, 165, 72, 0.15), transparent 24rem),
    linear-gradient(180deg, #071025 0%, #0a141f 48%, #08121f 100%);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(42, 200, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(42, 200, 255, 0.06) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent 90%);
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--cyan);
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 50;
  padding: 10px 14px;
  color: var(--navy-950);
  background: var(--paper);
  border-radius: 6px;
  transform: translateY(-140%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
  min-height: 76px;
  padding: 12px clamp(16px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
  background: rgba(7, 16, 37, 0.88);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 160px;
}

.brand img {
  width: min(190px, 34vw);
  height: auto;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.nav-links a,
.source-button,
.badge-row span,
.backend-row span,
.boundary-list span,
.tile-list span,
.dash-tabs span {
  border: 1px solid var(--line);
  border-radius: 999px;
}

.nav-links a,
.source-button {
  padding: 8px 12px;
  color: var(--paper-soft);
  font-size: 0.88rem;
  font-weight: 700;
}

.source-button {
  color: var(--paper);
  background: linear-gradient(135deg, rgba(24, 105, 255, 0.22), rgba(123, 61, 255, 0.24));
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.94fr) minmax(360px, 1.06fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  min-height: calc(100vh - 76px);
  padding: clamp(54px, 8vw, 108px) clamp(18px, 5vw, 72px) clamp(42px, 6vw, 84px);
}

.hero-copy {
  max-width: 760px;
}

.status-line,
.kicker {
  margin: 0 0 14px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  font-size: clamp(4.1rem, 9.4vw, 9.6rem);
  line-height: 0.88;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 18px;
  font-size: clamp(2.1rem, 4.2vw, 4.5rem);
  line-height: 1.03;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.1rem;
}

.hero-lede {
  margin-bottom: 14px;
  color: var(--paper);
  font-size: clamp(1.35rem, 2.4vw, 2.2rem);
  font-weight: 800;
}

.hero-body,
.section-heading p,
.split-section p,
.boundary-copy p {
  color: var(--paper-soft);
  font-size: 1.05rem;
}

.badge-row,
.cta-row,
.backend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.badge-row span,
.backend-row span,
.boundary-list span {
  padding: 8px 11px;
  color: var(--paper);
  background: rgba(255, 255, 255, 0.055);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 900;
}

.button.primary {
  color: var(--navy-950);
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  border-color: transparent;
}

.button.secondary {
  color: var(--navy-950);
  background: var(--gold);
  border-color: transparent;
}

.button.ghost {
  color: var(--paper);
  background: rgba(255, 255, 255, 0.06);
}

.hero-panel {
  position: relative;
  padding: 16px;
  border: 1px solid rgba(42, 200, 255, 0.32);
  border-radius: 12px;
  background: rgba(7, 16, 37, 0.85);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 240, 255, 0.08);
  backdrop-filter: blur(12px);
}

.stitch-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.stitch-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(0, 240, 255, 0.15);
  font-size: 0.8rem;
}

.stitch-status {
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-dot-active {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan, #00f0ff);
  box-shadow: 0 0 8px #00f0ff;
}

.status-label {
  color: var(--cyan, #00f0ff);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.stitch-title {
  flex: 1 1 180px;
  color: #e2e8f0;
  font-weight: 600;
  font-size: 0.82rem;
  text-align: center;
}

.stitch-badge-preview {
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(0, 240, 255, 0.12);
  border: 1px solid rgba(0, 240, 255, 0.3);
  color: #00f0ff;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.stitch-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

@media (max-width: 640px) {
  .stitch-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stitch-title {
    order: 3;
    flex-basis: 100%;
    text-align: left;
  }
}

.stitch-metric-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  background: rgba(13, 27, 48, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 6px;
}

.metric-key {
  color: #8b949e;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric-val {
  color: #f0f6fc;
  font-size: clamp(0.72rem, 1.2vw, 0.88rem);
  font-weight: 700;
  font-family: var(--font-mono, monospace);
}

.metric-val.status-accent {
  color: #00f0ff;
  text-shadow: 0 0 6px rgba(0, 240, 255, 0.4);
}

.stitch-canvas-container {
  width: 100%;
  border-radius: 8px;
  background: radial-gradient(circle at center, rgba(12, 28, 52, 0.8) 0%, rgba(5, 12, 24, 0.95) 100%);
  border: 1px solid rgba(0, 240, 255, 0.18);
  padding: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 30px;
}

.stitch-graph-svg {
  width: 100%;
  height: auto;
  max-height: 190px;
}

.panel-chips {
  position: absolute;
  right: 16px;
  bottom: 14px;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: min(520px, calc(100% - 32px));
}

.panel-chips span {
  padding: 5px 10px;
  color: var(--paper, #f0f6fc);
  background: rgba(7, 16, 37, 0.92);
  border: 1px solid rgba(42, 200, 255, 0.45);
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
}

.notice-strip,
.section,
.site-footer {
  padding-inline: clamp(18px, 5vw, 72px);
}

.notice-strip {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding-block: 18px;
  color: var(--paper);
  border-block: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(216, 165, 72, 0.12), rgba(42, 200, 255, 0.08));
}

.notice-strip span {
  color: var(--paper-soft);
}

.section {
  padding-block: clamp(60px, 8vw, 104px);
}

.section-heading {
  max-width: 940px;
  margin-bottom: 32px;
}

.step-grid,
.surface-grid,
.api-grid,
.dash-grid {
  display: grid;
  gap: 16px;
}

.step-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.surface-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.api-grid,
.dash-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.step-card,
.surface-card,
.api-grid article,
.dashboard-mock,
.network-board,
.boundary-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.028)),
    rgba(10, 20, 31, 0.76);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.18);
}

.step-card,
.surface-card,
.api-grid article {
  padding: 20px;
}

.step-index,
.surface-icon {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 18px;
  color: var(--cyan);
  border: 1px solid rgba(42, 200, 255, 0.48);
  border-radius: 8px;
  background: rgba(42, 200, 255, 0.08);
  font-weight: 900;
}

code,
pre {
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
}

code {
  display: inline-block;
  max-width: 100%;
  padding: 4px 7px;
  overflow-wrap: anywhere;
  color: var(--cyan);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(42, 200, 255, 0.18);
  border-radius: 5px;
}

pre {
  margin: 14px 0 0;
  padding: 14px;
  overflow: auto;
  color: var(--green);
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(79, 208, 168, 0.25);
  border-radius: 8px;
}

.flow {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.flow li {
  position: relative;
  min-height: 150px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(10, 20, 31, 0.74);
}

.flow strong,
.flow span {
  display: block;
}

.flow strong {
  margin-bottom: 10px;
}

.flow span,
.step-card p,
.surface-card p,
.api-grid span,
.site-footer span {
  color: var(--muted);
}

.utility-dock {
  position: fixed;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 30;
  display: grid;
  gap: 8px;
  justify-items: end;
  pointer-events: none;
}

.utility-button {
  pointer-events: auto;
  min-width: 118px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border: 1px solid rgba(216, 165, 72, 0.68);
  border-radius: 999px;
  color: var(--paper);
  background: rgba(5, 16, 34, 0.92);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}

.support-button {
  min-width: 178px;
  border-color: rgba(42, 200, 255, 0.78);
  background: linear-gradient(135deg, rgba(24, 105, 255, 0.94), rgba(111, 66, 255, 0.96));
}

.utility-button:hover {
  transform: translateY(-1px);
}

.utility-button:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 4px;
}

:root[data-theme="day"] {
  color: #071025;
  background: #f7fbff;
}

:root[data-theme="day"] body {
  color: #071025;
  background:
    radial-gradient(circle at 70% 12%, rgba(42, 200, 255, 0.18), transparent 24rem),
    radial-gradient(circle at 80% 10%, rgba(216, 165, 72, 0.16), transparent 24rem),
    linear-gradient(180deg, #fbfdff 0%, #edf6ff 48%, #fbfdff 100%);
}

:root[data-theme="day"] .site-header,
:root[data-theme="day"] .step-card,
:root[data-theme="day"] .surface-card,
:root[data-theme="day"] .api-grid article,
:root[data-theme="day"] .dashboard-mock,
:root[data-theme="day"] .network-board,
:root[data-theme="day"] .boundary-section,
:root[data-theme="day"] .flow li,
:root[data-theme="day"] .site-footer,
:root[data-theme="day"] .education-grid article,
:root[data-theme="day"] .stitch-panel {
  color: #071025;
  background: rgba(255, 255, 255, 0.88);
}

:root[data-theme="day"] .stitch-metric-card {
  background: rgba(240, 244, 248, 0.9);
  border-color: rgba(0, 0, 0, 0.1);
}

:root[data-theme="day"] .stitch-title {
  color: #071025;
}

:root[data-theme="day"] .hero-body,
:root[data-theme="day"] .section-heading p,
:root[data-theme="day"] .split-section p,
:root[data-theme="day"] .boundary-copy p,
:root[data-theme="day"] .notice-strip span,
:root[data-theme="day"] .education-grid p {
  color: #203654;
}

:root[data-theme="day"] .nav-links a,
:root[data-theme="day"] .source-button,
:root[data-theme="day"] .button.ghost,
:root[data-theme="day"] .badge-row span,
:root[data-theme="day"] .backend-row span,
:root[data-theme="day"] .boundary-list span,
:root[data-theme="day"] .utility-button {
  color: #071025;
  background: rgba(255, 255, 255, 0.86);
}

:root[data-theme="day"] .support-button {
  color: #ffffff;
  background: linear-gradient(135deg, #1869ff, #6f42ff);
}

:root[data-access-profile="autism-calm"] {
  --cyan: #69d8ff;
  --violet: #8e7bff;
  --gold: #d8b46a;
}

:root[data-access-profile="adhd-sprint"] .status-line,
:root[data-access-profile="adhd-sprint"] .kicker,
:root[data-access-profile="adhd-sprint"] .button,
:root[data-access-profile="adhd-sprint"] .utility-button {
  text-transform: uppercase;
}

:root[data-access-profile="deep-work"] .hero-panel,
:root[data-access-profile="deep-work"] body::before {
  opacity: 0.32;
}

.education-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.education-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background: rgba(5, 16, 34, 0.72);
}

.education-grid h3 {
  margin: 0 0 10px;
}

.education-grid p {
  margin: 0;
  color: var(--muted);
}

.inline-link {
  display: inline-flex;
  margin-top: 14px;
  color: var(--cyan);
  font-weight: 800;
  text-decoration: none;
}

.inline-link:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 4px;
}

.surface-card ul {
  padding-left: 18px;
  margin-bottom: 0;
}

.tile-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.tile-list span,
.dash-tabs span {
  padding: 8px 10px;
  color: var(--paper);
  background: rgba(42, 200, 255, 0.07);
  font-size: 0.84rem;
  font-weight: 800;
}

.split-section,
.boundary-section {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(360px, 1.18fr);
  gap: 28px;
  align-items: center;
}

.network-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 18px;
}

.network-board div {
  min-height: 54px;
  padding: 13px;
  border: 1px solid rgba(42, 200, 255, 0.22);
  border-radius: 8px;
  background: rgba(42, 200, 255, 0.06);
  font-weight: 800;
}

.api-grid article {
  display: grid;
  align-content: start;
  gap: 8px;
}

.dashboard-mock {
  padding: 18px;
}

.dash-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.dash-grid div {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.dash-grid strong,
.dash-grid span {
  display: block;
}

.dash-grid span {
  margin-top: 6px;
  color: var(--green);
}

.boundary-section {
  padding: clamp(24px, 5vw, 44px);
}

.boundary-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.site-footer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
  padding-block: 26px;
  border-top: 1px solid var(--line);
  background: rgba(7, 16, 37, 0.84);
}

.site-footer > div {
  display: grid;
  grid-template-columns: 58px 1fr;
  column-gap: 12px;
  align-items: center;
}

.site-footer img {
  grid-row: span 2;
  width: 58px;
  height: 58px;
  object-fit: contain;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
}

.site-footer > span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.88rem;
}

@media (prefers-color-scheme: light) {
  :root {
    color: #071025;
    background: #f7fbff;
  }

  body {
    background:
      radial-gradient(circle at 18% 12%, rgba(42, 200, 255, 0.18), transparent 28rem),
      radial-gradient(circle at 80% 10%, rgba(216, 165, 72, 0.16), transparent 24rem),
      linear-gradient(180deg, #fbfdff 0%, #edf6ff 48%, #fbfdff 100%);
  }

  body::before {
    background-image:
      linear-gradient(rgba(24, 105, 255, 0.08) 1px, transparent 1px),
      linear-gradient(90deg, rgba(24, 105, 255, 0.08) 1px, transparent 1px);
  }

  .site-header,
  .step-card,
  .surface-card,
  .api-grid article,
  .dashboard-mock,
  .network-board,
  .boundary-section,
  .flow li,
  .site-footer {
    color: #071025;
    background: rgba(255, 255, 255, 0.86);
  }

  .hero-body,
  .section-heading p,
  .split-section p,
  .boundary-copy p,
  .notice-strip span {
    color: #203654;
  }

  .nav-links a,
  .source-button,
  .button.ghost,
  .badge-row span,
  .backend-row span,
  .boundary-list span {
    color: #071025;
    background: rgba(255, 255, 255, 0.64);
  }
}

@media (max-width: 1180px) {
  .hero,
  .split-section,
  .education-grid,
  .boundary-section {
    grid-template-columns: 1fr;
  }

  .step-grid,
  .surface-grid,
  .api-grid,
  .flow,
  .dash-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  body {
    padding-bottom: 230px;
  }

  .site-header {
    position: static;
    grid-template-columns: 1fr;
  }

  .nav-links {
    justify-content: flex-start;
  }

  .source-button {
    justify-self: start;
  }

  .hero {
    min-height: auto;
    padding-top: 36px;
  }

  .step-grid,
  .surface-grid,
  .api-grid,
  .flow,
  .education-grid,
  .dash-grid,
  .network-board,
  .boundary-list,
  .tile-list {
    grid-template-columns: 1fr;
  }

  .notice-strip,
  .site-footer {
    grid-template-columns: 1fr;
  }

  .notice-strip {
    display: block;
  }

  .panel-chips {
    position: static;
    margin-top: 10px;
    justify-content: flex-start;
  }

  h1 {
    font-size: clamp(3.4rem, 18vw, 5.4rem);
  }

  .utility-dock {
    right: 14px;
    bottom: 14px;
  }

  .utility-button {
    min-height: 40px;
    min-width: 112px;
    padding: 9px 13px;
  }

  .support-button {
    min-width: 166px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
