:root {
  color-scheme: dark;
  --bg: #041f1d;
  --bg-2: #062f2b;
  --surface: rgba(247, 255, 250, 0.08);
  --surface-strong: rgba(247, 255, 250, 0.14);
  --line: rgba(214, 255, 235, 0.18);
  --line-strong: rgba(214, 255, 235, 0.3);
  --text: #f4fff8;
  --muted: #b8d8ca;
  --soft: #dff7ea;
  --accent: #47e09b;
  --accent-2: #9be7c1;
  --gold: #d6b56a;
  --danger: #ffd7c2;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  --radius: 8px;
  --max: 1180px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 12% 10%, rgba(71, 224, 155, 0.16), transparent 28rem),
    radial-gradient(circle at 82% 0%, rgba(214, 181, 106, 0.12), transparent 24rem),
    linear-gradient(180deg, var(--bg), #021412 64%, #031b18);
  color: var(--text);
  line-height: 1.6;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.76), transparent 75%);
}

a {
  color: inherit;
}

img {
  max-width: 100%;
  height: auto;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 20;
  padding: 10px 14px;
  background: var(--accent);
  color: #04221e;
  border-radius: var(--radius);
  font-weight: 800;
}

.skip-link:focus {
  top: 16px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(4, 31, 29, 0.76);
  backdrop-filter: blur(18px);
}

.nav-shell,
.section-shell {
  width: min(var(--max), calc(100% - 40px));
  margin-inline: auto;
}

.nav-shell {
  display: flex;
  min-height: 74px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 850;
  letter-spacing: 0;
}

.brand img {
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  object-fit: cover;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-links a {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border-radius: var(--radius);
  color: var(--muted);
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 720;
}

.nav-links a:hover,
.nav-links a:focus-visible,
.nav-links a[aria-current="page"] {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}

.nav-toggle {
  display: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border-radius: var(--radius);
  min-height: 42px;
  padding: 0 14px;
  font: inherit;
  font-weight: 760;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.92fr);
  gap: 64px;
  align-items: center;
  min-height: calc(100vh - 74px);
  padding: 84px 0 62px;
}

.hero h1,
.legal-shell h1,
.support-hero h1 {
  margin: 0;
  font-size: clamp(3.8rem, 9vw, 8.4rem);
  line-height: 0.88;
  letter-spacing: 0;
  font-weight: 920;
}

.hero-title {
  max-width: 680px;
  margin: 24px 0 0;
  color: var(--soft);
  font-size: clamp(1.65rem, 3.4vw, 3.35rem);
  line-height: 1.02;
  font-weight: 850;
  letter-spacing: 0;
}

.hero-text {
  max-width: 640px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.hero-actions,
.support-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  text-decoration: none;
  font-size: 0.98rem;
  font-weight: 820;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
  outline: none;
}

.button-primary {
  background: linear-gradient(135deg, var(--accent), #bff4d3);
  color: #06231f;
  box-shadow: 0 14px 34px rgba(71, 224, 155, 0.24);
}

.button-secondary {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.hero-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 680px;
  margin: 34px 0 0;
}

.hero-facts div,
.glass-card,
.partner-strip,
.use-case-panel,
.testflight-strip,
.faq-item,
.api-panel,
.node {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-facts div {
  padding: 14px;
}

.hero-facts dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 780;
  text-transform: uppercase;
}

.hero-facts dd {
  margin: 3px 0 0;
  font-weight: 820;
}

.hero-visual {
  min-height: 600px;
  position: relative;
}

.device-stage {
  position: relative;
  min-height: 600px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04)),
    radial-gradient(circle at 70% 18%, rgba(71, 224, 155, 0.22), transparent 16rem);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.device-stage::before {
  position: absolute;
  inset: 22px;
  content: "";
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
}

.orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(2px);
  opacity: 0.88;
}

.orb-a {
  width: 160px;
  height: 160px;
  right: -24px;
  top: 22px;
  background: rgba(71, 224, 155, 0.24);
}

.orb-b {
  width: 110px;
  height: 110px;
  left: -34px;
  bottom: 80px;
  background: rgba(214, 181, 106, 0.22);
}

.phone {
  position: absolute;
  left: 52px;
  top: 58px;
  width: min(310px, 62%);
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 34px;
  background: linear-gradient(180deg, #102f2b, #041514);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.45);
}

.phone-speaker {
  width: 70px;
  height: 5px;
  margin: 2px auto 10px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.24);
}

.phone-screen {
  min-height: 500px;
  padding: 18px;
  border-radius: 24px;
  background:
    radial-gradient(circle at 25% 8%, rgba(71, 224, 155, 0.24), transparent 16rem),
    linear-gradient(180deg, #062d28, #031817);
}

.screen-topline,
.queue-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.75rem;
}

.screen-topline strong,
.queue-row strong {
  color: var(--accent-2);
}

.metric-card {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.07);
}

.metric-card-main {
  margin-top: 20px;
}

.metric-card span,
.metric-card small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.metric-card strong {
  display: block;
  margin-top: 5px;
  font-size: 1.9rem;
  line-height: 1;
}

.waveform {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 108px;
  margin: 18px 0;
  padding: 14px;
  border: 1px solid rgba(71, 224, 155, 0.18);
  border-radius: var(--radius);
  background: rgba(2, 18, 17, 0.5);
}

.waveform span {
  flex: 1;
  height: 24px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent), rgba(71, 224, 155, 0.08));
}

.waveform span:nth-child(2n) { height: 54px; }
.waveform span:nth-child(3n) { height: 82px; }
.waveform span:nth-child(5n) { height: 34px; }

.screen-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.screen-grid .metric-card strong {
  font-size: 1.05rem;
}

.queue-row {
  margin-top: 16px;
  padding: 12px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.node {
  position: absolute;
  right: 42px;
  padding: 14px 16px;
  width: 154px;
}

.node span,
.api-panel span {
  display: block;
  color: var(--accent-2);
  font-size: 0.72rem;
  font-weight: 840;
  text-transform: uppercase;
}

.node strong,
.api-panel strong {
  display: block;
  margin-top: 4px;
  font-size: 0.96rem;
}

.node-rx { top: 132px; }
.node-tx { top: 252px; }

.api-panel {
  position: absolute;
  right: 42px;
  bottom: 66px;
  width: 250px;
  padding: 16px;
}

.api-panel small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}

.connection-line {
  position: absolute;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.9;
}

.line-rx {
  top: 210px;
  left: 290px;
  right: 178px;
}

.line-api {
  top: 420px;
  left: 294px;
  right: 216px;
  transform: rotate(12deg);
}

.partner-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 24px;
  margin-top: 10px;
}

.partner-copy p {
  max-width: 570px;
  margin: 0;
  color: var(--muted);
}

.partner-logos {
  display: flex;
  align-items: center;
  gap: 24px;
}

.kaust-wordmark {
  min-width: 210px;
  color: var(--text);
}

.kaust-wordmark strong {
  display: block;
  font-size: 1.7rem;
  letter-spacing: 0.08em;
}

.kaust-wordmark span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.ccsl-logo {
  width: 116px;
  height: 116px;
  object-fit: contain;
  filter: drop-shadow(0 16px 24px rgba(0, 0, 0, 0.28));
}

.feature-section,
.use-case,
.faq-section,
.support-shell {
  padding: 110px 0;
}

.section-heading {
  max-width: 740px;
  margin-bottom: 34px;
}

.section-label {
  margin: 0 0 12px;
  color: var(--accent-2);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.section-heading h2,
.use-case-copy h2,
.testflight-strip h2,
.support-grid h2,
.legal-shell h2 {
  margin: 0;
  color: var(--text);
  font-size: clamp(2.1rem, 4.5vw, 4.2rem);
  line-height: 1;
  letter-spacing: 0;
}

.section-heading p:not(.section-label),
.use-case-copy p,
.testflight-strip p,
.support-hero p,
.legal-shell p,
.legal-shell li {
  color: var(--muted);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.glass-card {
  padding: 22px;
}

.feature-index {
  display: block;
  color: var(--accent-2);
  font-size: 0.76rem;
  font-weight: 840;
}

.glass-card h3,
.use-case-panel h3,
.pipeline-list h3 {
  margin: 16px 0 10px;
  color: var(--text);
  font-size: 1.15rem;
  line-height: 1.16;
}

.glass-card p,
.use-case-panel li,
.pipeline-list p,
.faq-item p,
.site-footer p,
.support-grid li {
  color: var(--muted);
}

.pipeline-section {
  padding: 110px 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(71, 224, 155, 0.05));
  border-block: 1px solid rgba(255, 255, 255, 0.08);
}

.pipeline-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 52px;
  align-items: start;
}

.pipeline-list {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.pipeline-list li {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
}

.pipeline-list span {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  background: rgba(71, 224, 155, 0.14);
  color: var(--accent-2);
  font-weight: 860;
}

.pipeline-list h3,
.pipeline-list p {
  margin-top: 0;
}

.pipeline-list p {
  margin-bottom: 0;
}

.use-case {
  display: grid;
  grid-template-columns: minmax(0, 0.98fr) minmax(320px, 0.72fr);
  gap: 40px;
  align-items: center;
}

.use-case-panel {
  padding: 28px;
}

.use-case-panel ul,
.support-grid ul,
.legal-shell ul {
  padding-left: 1.1rem;
}

.faq-grid,
.support-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.faq-item {
  padding: 20px;
}

.faq-item summary {
  cursor: pointer;
  color: var(--text);
  font-weight: 820;
}

.testflight-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 30px;
  margin-bottom: 90px;
}

.testflight-strip h2 {
  font-size: clamp(1.8rem, 3.4vw, 3.2rem);
}

.support-hero {
  max-width: 860px;
  padding-top: 62px;
}

.support-hero h1 {
  font-size: clamp(3rem, 8vw, 6rem);
}

.support-grid {
  margin-top: 46px;
}

.legal-page {
  background:
    radial-gradient(circle at 0 0, rgba(71, 224, 155, 0.12), transparent 24rem),
    linear-gradient(180deg, var(--bg), #031715);
}

.legal-shell {
  width: min(840px, calc(100% - 40px));
  margin: 0 auto;
  padding: 88px 0 110px;
}

.legal-shell h1 {
  font-size: clamp(3.1rem, 8vw, 6.8rem);
}

.legal-shell h2 {
  margin-top: 42px;
  font-size: clamp(1.4rem, 2.6vw, 2.1rem);
}

.legal-updated {
  margin-top: 14px;
  font-weight: 760;
}

.legal-shell a {
  color: var(--accent-2);
}

.site-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 34px 0;
  background: rgba(2, 16, 15, 0.78);
}

.footer-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.footer-brand {
  margin-bottom: 12px;
}

.footer-grid p {
  max-width: 600px;
  margin: 0;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

.reveal {
  opacity: 1;
  transform: none;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

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

  .button {
    transition: none;
  }

  .button:hover,
  .button:focus-visible {
    transform: none;
  }
}

@media (max-width: 1040px) {
  .hero,
  .pipeline-layout,
  .use-case {
    grid-template-columns: 1fr;
  }

  .hero {
    gap: 38px;
    min-height: auto;
  }

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

  .hero-visual {
    min-height: 560px;
  }
}

@media (max-width: 760px) {
  .nav-shell,
  .section-shell,
  .legal-shell {
    width: min(100% - 28px, var(--max));
  }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
  }

  .nav-links {
    position: absolute;
    top: 74px;
    left: 14px;
    right: 14px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(4, 31, 29, 0.96);
    box-shadow: var(--shadow);
  }

  .nav-links.is-open {
    display: flex;
  }

  .nav-links a {
    justify-content: center;
  }

  .hero {
    padding-top: 50px;
  }

  .hero h1 {
    font-size: clamp(3.3rem, 18vw, 5.6rem);
  }

  .hero-facts,
  .feature-grid,
  .faq-grid,
  .support-grid {
    grid-template-columns: 1fr;
  }

  .partner-strip,
  .partner-logos,
  .testflight-strip,
  .footer-grid {
    flex-direction: column;
    align-items: flex-start;
  }

  .device-stage {
    display: grid;
    gap: 10px;
    min-height: auto;
    padding: 22px;
    overflow: visible;
  }

  .phone {
    position: relative;
    left: auto;
    top: auto;
    width: 100%;
  }

  .node,
  .api-panel {
    position: relative;
    inset: auto;
    left: auto;
    right: auto;
    width: auto;
    margin: 0;
  }

  .node-rx {
    top: auto;
  }

  .node-tx {
    top: auto;
  }

  .api-panel {
    top: auto;
  }

  .connection-line {
    display: none;
  }

  .feature-section,
  .pipeline-section,
  .use-case,
  .faq-section,
  .support-shell,
  .legal-shell {
    padding-top: 72px;
    padding-bottom: 72px;
  }
}
