:root {
  --bg: #0c0f14;
  --bg-elevated: #12161e;
  --bg-card: rgba(255, 255, 255, 0.03);
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.14);
  --text: #f0f2f5;
  --text-muted: #8b95a8;
  --accent: #38bdf8;
  --accent-secondary: #2563eb;
  --accent-dim: rgba(56, 189, 248, 0.12);
  --accent-glow: rgba(56, 189, 248, 0.22);
  --radius: 12px;
  --radius-lg: 20px;
  --font: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, sans-serif;
  --header-h: 64px;
  --transition: 0.2s ease;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
  scrollbar-gutter: stable;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--accent);
  color: #0a0f0d;
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: 8px;
  transition: top 0.2s ease;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.nav-open {
  overflow: hidden;
}

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

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

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

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: #7dd3fc;
}

.logo img {
  border-radius: 6px;
  object-fit: contain;
}

.hero-logo {
  margin-bottom: 20px;
  filter: drop-shadow(0 0 24px var(--accent-glow));
  object-fit: contain;
}

.download-logo {
  object-fit: contain;
}

.studio-logo {
  display: inline-block;
  height: 26px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  vertical-align: middle;
}

.container {
  width: min(1120px, calc(100% - 48px));
  margin-inline: auto;
}

.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(56, 189, 248, 0.08), transparent),
    radial-gradient(ellipse 60% 40% at 100% 50%, rgba(37, 99, 235, 0.06), transparent),
    radial-gradient(ellipse 50% 30% at 0% 80%, rgba(56, 189, 248, 0.05), transparent);
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  border-bottom: 1px solid var(--border);
  background: rgba(12, 15, 20, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: background var(--transition), box-shadow var(--transition);
}

.site-header.scrolled {
  background: rgba(12, 15, 20, 0.96);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 600;
  font-size: 1.05rem;
  flex-shrink: 0;
}

.logo:hover {
  color: var(--text);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
  flex-shrink: 1;
  min-width: 0;
}

.nav-links a {
  display: inline-block;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.2;
  padding: 6px 0;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}

.nav-links a:hover {
  color: var(--text);
}

.nav-links a:focus-visible {
  outline: none;
  border-bottom-color: var(--accent);
}

.nav-links a.is-active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.nav-cta {
  color: var(--accent) !important;
}

.nav-cta.is-active {
  color: #7dd3fc !important;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: transform var(--transition), opacity var(--transition);
}

.nav-toggle[aria-expanded="true"] span:first-child {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:last-child {
  transform: translateY(-7px) rotate(-45deg);
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.925rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), transform 0.15s ease;
  text-decoration: none;
  color: inherit;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--accent);
  color: #0a0f0d;
}

.btn-primary:hover {
  background: #7dd3fc;
  color: #0a0f0d;
}

.btn-secondary {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: rgba(56, 189, 248, 0.25);
}

.btn-secondary:hover {
  background: rgba(56, 189, 248, 0.18);
  color: #7dd3fc;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--border-hover);
  background: var(--bg-card);
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1rem;
}

.btn-block {
  width: 100%;
}

/* Hero */

.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
  padding: 80px 0 96px;
  min-height: calc(100vh - var(--header-h));
}

.hero-content {
  max-width: 520px;
}

.eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

.hero h1 {
  font-size: clamp(2.4rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}

.hero-lead {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 480px;
  margin-bottom: 32px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 40px;
}

.hero-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  list-style: none;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.hero-trust li::before {
  content: "✓ ";
  color: var(--accent);
}

.hero-studio {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.hero-studio-link {
  display: inline-flex;
  opacity: 0.92;
  transition: opacity var(--transition);
}

.hero-studio-link:hover {
  opacity: 1;
}

.hero-studio-link img {
  height: 24px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
}

/* Screens & imagery */

.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-stage {
  position: relative;
  width: min(100%, 540px);
  margin-inline: auto;
  padding: 32px;
}

.stage-grid {
  position: absolute;
  inset: 8% 4% 12%;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 20px 20px;
  mask-image: radial-gradient(ellipse 85% 75% at 55% 45%, #000 20%, transparent 72%);
  pointer-events: none;
}

.screen-frame {
  position: relative;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: #080b10;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 28px 56px rgba(0, 0, 0, 0.42);
  line-height: 0;
}

.screen-frame img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
}

.screen-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1;
  padding: 4px 10px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: #080b10;
  border: 1px solid var(--border);
  border-radius: 999px;
}

.screen-frame-hero {
  position: relative;
  z-index: 1;
}

.screen-frame-inset {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  width: 44%;
  border-color: rgba(56, 189, 248, 0.22);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 18px 40px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(56, 189, 248, 0.08);
}

.app-showcase {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}

.app-showcase-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: calc(var(--header-h) + 24px);
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(8, 11, 16, 0.55);
}

.app-tab {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  text-align: left;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  border-left: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition:
    color var(--transition),
    background var(--transition),
    border-color var(--transition);
}

.app-tab-index {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: rgba(139, 149, 168, 0.75);
  font-variant-numeric: tabular-nums;
  padding-top: 2px;
}

.app-tab-copy {
  display: grid;
  gap: 2px;
}

.app-tab-copy strong {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

.app-tab-copy span {
  font-size: 0.78rem;
  line-height: 1.35;
}

.app-tab:hover {
  background: rgba(255, 255, 255, 0.025);
  border-color: rgba(255, 255, 255, 0.06);
}

.app-tab.is-active {
  background: rgba(56, 189, 248, 0.06);
  border-color: rgba(56, 189, 248, 0.14);
  border-left-color: var(--accent);
}

.app-tab.is-active .app-tab-index {
  color: var(--accent);
}

.app-showcase-viewport {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.viewport-header {
  padding: 0 4px;
  text-align: center;
}

.viewport-header p {
  font-size: 0.92rem;
  color: var(--text-muted);
  max-width: 52ch;
  margin-inline: auto;
}

.screen-frame-viewport {
  margin-top: 4px;
}

.viewport-eyebrow {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

#app-showcase-image {
  transition: opacity 0.18s ease;
}

#app-showcase-image.is-swapping {
  opacity: 0.35;
}

.viewport-header h3 {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.download-preview {
  padding: 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.download-preview .screen-frame {
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}

.download-preview .specimen-label {
  margin-bottom: 12px;
}

.download-preview .specimen-note {
  margin-top: 12px;
  margin-bottom: 0;
}

.specimen-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.specimen-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.specimen-note {
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.download-aside {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Sections */

.section {
  padding: 96px 0;
}

.section-alt {
  background: rgba(255, 255, 255, 0.015);
  border-block: 1px solid var(--border);
}

.section-head {
  text-align: center;
  max-width: 560px;
  margin: 0 auto 48px;
}

.section-head h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.section-head p {
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* Features */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  align-items: stretch;
}

.feature-card {
  height: 100%;
  padding: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.feature-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.feature-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-dim);
  border-radius: 10px;
  margin-bottom: 18px;
  color: var(--accent);
}

.feature-icon svg {
  width: 22px;
  height: 22px;
}

.feature-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.feature-card code,
.pillar-card code {
  font-size: 0.85em;
  padding: 0.12em 0.4em;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  color: var(--text);
}

/* Stats strip */

.stats-strip {
  border-block: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  padding: 28px 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.stat {
  text-align: center;
  padding: 8px 12px;
}

.stat-value {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--accent);
  margin-bottom: 6px;
}

.stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Why Fortiva */

.pillar-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 40px;
}

.pillar-card {
  padding: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.pillar-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.pillar-card p {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.crypto-flow {
  padding: 28px 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
}

.flow-title {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
}

.flow-steps {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 8px;
}

.flow-steps li {
  display: flex;
  align-items: center;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.flow-steps li:not(:last-child)::after {
  content: "→";
  margin-left: 12px;
  color: var(--accent);
  opacity: 0.7;
}

.flow-steps li span {
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  white-space: nowrap;
}

/* Editions */

.edition-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  align-items: stretch;
}

.edition-card {
  height: 100%;
  padding: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
}

.edition-featured {
  border-color: rgba(56, 189, 248, 0.3);
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.06) 0%, var(--bg-card) 100%);
  box-shadow: 0 0 40px var(--accent-glow);
}

.edition-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-bottom: 12px;
}

.edition-card h3 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.edition-card > p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.edition-card ul {
  list-style: none;
  margin-bottom: 28px;
  flex: 1;
}

.edition-card li {
  font-size: 0.875rem;
  color: var(--text-muted);
  padding: 6px 0;
  padding-left: 20px;
  position: relative;
}

.edition-card li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.8rem;
}

/* Download */

.download-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
  padding: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.download-content {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.download-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.download-header h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.download-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.download-logo {
  margin-bottom: 0;
  flex-shrink: 0;
}

.download-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 24px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.download-meta div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  background: var(--bg-elevated);
}

.download-meta-wide {
  grid-column: 1 / -1;
}

.download-meta dt {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.download-meta dd {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
}

.download-hash code {
  font-family: ui-monospace, "Cascadia Code", "Segoe UI Mono", monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
  word-break: break-all;
}

.release-pending {
  opacity: 0.55;
}

.download-note {
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.download-requirements {
  display: flex;
  flex-direction: column;
  padding: 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.download-requirements h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.download-requirements ul {
  list-style: none;
}

.download-requirements li {
  font-size: 0.875rem;
  color: var(--text-muted);
  padding: 6px 0;
  padding-left: 18px;
  position: relative;
}

.download-requirements li::before {
  content: "-";
  position: absolute;
  left: 4px;
  color: var(--accent);
  font-weight: 700;
}

/* Contact */

.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: stretch;
}

.contact-intro,
.contact-email-card {
  display: flex;
  flex-direction: column;
  padding: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.contact-intro h2,
.contact-email-card h3 {
  font-size: clamp(1.65rem, 2.8vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}

.contact-intro > p,
.contact-email-card > p {
  color: var(--text-muted);
  line-height: 1.55;
}

.contact-intro > p {
  margin-bottom: 24px;
}

.contact-publisher {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding-top: 24px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.contact-publisher a {
  display: inline-flex;
  align-items: center;
  color: var(--text-muted);
}

.contact-publisher a:hover {
  color: var(--text);
}

.contact-benefits {
  list-style: none;
}

.contact-email-card > p {
  margin-bottom: 20px;
}

.contact-benefits li {
  font-size: 0.9rem;
  color: var(--text-muted);
  padding: 8px 0;
  padding-left: 22px;
  position: relative;
}

.contact-benefits li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--accent);
}

.contact-email-card h3 {
  margin-bottom: 14px;
}

.contact-email-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  align-self: flex-start;
}

.contact-email-note {
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.site-footer {
  padding: 48px 0;
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 24px;
  align-items: center;
}

.footer-brand {
  justify-self: start;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: center;
  justify-self: center;
}

.footer-studio-logo {
  display: inline-block;
  margin-top: 14px;
  opacity: 0.9;
  transition: opacity var(--transition);
}

.footer-studio-logo:hover {
  opacity: 1;
}

.footer-studio-logo img {
  height: 26px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
}

/* Legal pages */

.legal-page {
  padding: 80px 0 100px;
  max-width: 720px;
}

.legal-page h1 {
  font-size: clamp(2rem, 4vw, 2.6rem);
  font-weight: 700;
  margin-bottom: 8px;
}

.legal-updated {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 40px;
}

.legal-page section {
  margin-bottom: 32px;
}

.legal-page h2 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.legal-page p,
.legal-page li {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.65;
}

.legal-page ul {
  padding-left: 20px;
  margin-top: 8px;
}

.legal-page li + li {
  margin-top: 6px;
}

.error-page {
  padding: 100px 0 120px;
  text-align: center;
  max-width: 520px;
}

.error-logo {
  margin: 0 auto 24px;
  filter: drop-shadow(0 0 24px var(--accent-glow));
  object-fit: contain;
}

.error-page h1 {
  font-size: clamp(2rem, 4vw, 2.6rem);
  font-weight: 700;
  margin-bottom: 12px;
}

.error-page p {
  color: var(--text-muted);
  margin-bottom: 28px;
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

img {
  display: block;
  max-width: 100%;
}

.footer-links a {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.footer-links a:hover {
  color: var(--text);
}

.footer-brand p {
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-copy {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  opacity: 0.7;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* Responsive */

@media (max-width: 1100px) {
  .nav-links {
    gap: 14px;
  }

  .nav-links a {
    font-size: 0.8rem;
  }
}

@media (max-width: 960px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 48px;
    padding: 48px 0 72px;
    min-height: auto;
  }

  .hero-content {
    max-width: none;
    text-align: center;
    margin-inline: auto;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-trust {
    justify-content: center;
  }

  .hero-studio {
    justify-content: center;
  }

  .hero-visual {
    order: -1;
    justify-content: center;
  }

  .hero-stage {
    width: min(100%, 640px);
  }

  .screen-frame-inset {
    width: 42%;
    right: 0;
  }

  .app-showcase {
    grid-template-columns: 1fr;
  }

  .app-showcase-nav {
    position: static;
    flex-direction: row;
    overflow-x: auto;
    flex-wrap: nowrap;
    gap: 8px;
    padding: 10px;
    -webkit-overflow-scrolling: touch;
  }

  .app-tab {
    flex: 0 0 auto;
    min-width: 220px;
    grid-template-columns: 1fr;
    gap: 4px;
    border-left: 1px solid transparent;
  }

  .app-tab.is-active {
    border-left-color: transparent;
    border-top: 2px solid var(--accent);
  }

  .app-tab-index {
    display: none;
  }

  .feature-grid,
  .edition-grid,
  .pillar-grid {
    grid-template-columns: 1fr 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .download-panel,
  .contact-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .download-panel {
    padding: 24px;
  }

  .download-meta {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .container {
    width: calc(100% - 32px);
  }

  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    background: rgba(12, 15, 20, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid transparent;
    padding: 0 24px;
    opacity: 0;
    pointer-events: none;
    transition: max-height 0.25s ease, opacity 0.2s ease, padding 0.25s ease, border-color 0.2s ease;
  }

  .nav-links.open {
    max-height: 420px;
    padding: 16px 24px 24px;
    opacity: 1;
    pointer-events: auto;
    border-bottom-color: var(--border);
  }

  .nav-links li {
    width: 100%;
  }

  .nav-links a {
    display: block;
    padding: 12px 0;
    font-size: 1rem;
    white-space: normal;
    border-bottom: none;
    border-left: 2px solid transparent;
    padding-left: 10px;
  }

  .nav-links a.is-active,
  .nav-links a:focus-visible {
    border-bottom: none;
    border-left-color: var(--accent);
  }

  .feature-grid,
  .edition-grid,
  .pillar-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .flow-steps {
    flex-direction: column;
  }

  .flow-steps li:not(:last-child)::after {
    content: "↓";
    margin-left: 0;
    margin-top: 4px;
  }

  .flow-steps li {
    flex-direction: column;
  }

  .hero-actions {
    flex-direction: column;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-brand,
  .footer-links {
    justify-self: center;
  }

  .footer-links {
    justify-content: center;
  }

  .screen-frame-inset {
    display: none;
  }

  .hero-stage {
    padding: 24px;
  }

  .app-tab {
    min-width: 180px;
  }

  .footer-links {
    flex-wrap: wrap;
    gap: 16px;
  }

  .doc-layout {
    grid-template-columns: 1fr;
  }

  .doc-sidebar {
    position: fixed;
    inset: var(--header-h) auto 0 0;
    width: min(300px, 88vw);
    transform: translateX(-105%);
    z-index: 90;
    border-right: 1px solid var(--border);
    background: var(--bg-elevated);
    overflow-y: auto;
    transition: transform var(--transition);
  }

  .doc-sidebar.open {
    transform: translateX(0);
  }

  .doc-sidebar-toggle {
    display: inline-flex;
  }

  .doc-main {
    padding: 32px 0 72px;
  }

  body.doc-sidebar-open {
    overflow: hidden;
  }
}

/* Documentation layout (install + user guide) */

.doc-shell {
  padding-top: 24px;
}

.doc-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
  width: min(1200px, calc(100% - 48px));
  margin-inline: auto;
}

.doc-sidebar {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  max-height: calc(100vh - var(--header-h) - 48px);
  overflow-y: auto;
  padding: 20px 0 24px;
}

.doc-sidebar-inner {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.doc-sidebar-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 16px;
}

.doc-nav-group {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 12px 16px 6px;
  margin: 0;
}

.doc-nav ul {
  list-style: none;
  margin: 0;
  padding: 0 8px;
}

.doc-nav li + li {
  margin-top: 2px;
}

.doc-nav a {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.35;
  transition: background var(--transition), color var(--transition);
}

.doc-nav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.doc-nav a.is-active {
  color: var(--text);
  background: var(--accent-dim);
}

.doc-nav a.doc-nav-switch {
  color: var(--accent);
  font-weight: 600;
}

.doc-sidebar-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elevated);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.doc-main {
  padding: 8px 0 100px;
  min-width: 0;
}

.doc-hero {
  margin-bottom: 48px;
}

.doc-hero h1 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 700;
  line-height: 1.15;
  margin: 8px 0 12px;
}

.doc-lead {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 640px;
  line-height: 1.65;
}

.doc-section {
  scroll-margin-top: calc(var(--header-h) + 24px);
  margin-bottom: 56px;
  padding-bottom: 56px;
  border-bottom: 1px solid var(--border);
}

.doc-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.doc-section > h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.doc-section-intro {
  color: var(--text-muted);
  font-size: 0.98rem;
  max-width: 680px;
  margin-bottom: 24px;
  line-height: 1.65;
}

.doc-card {
  padding: 24px;
  margin-top: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.doc-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.doc-card p,
.doc-card li {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.65;
}

.doc-card ul,
.doc-card ol {
  padding-left: 20px;
  margin-top: 10px;
}

.doc-card li + li {
  margin-top: 6px;
}

.doc-card + .doc-card {
  margin-top: 16px;
}

.doc-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 32px 0;
}

.doc-steps {
  list-style: none;
  counter-reset: doc-step;
  margin: 16px 0 0;
  padding: 0;
}

.doc-steps li {
  counter-increment: doc-step;
  position: relative;
  padding-left: 44px;
  margin-top: 16px;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.65;
}

.doc-steps li::before {
  content: counter(doc-step);
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
}

.doc-table-wrap {
  overflow-x: auto;
  margin-top: 16px;
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.doc-table th,
.doc-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.doc-table th {
  color: var(--text);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.02);
}

.doc-table td {
  color: var(--text-muted);
}

.doc-figure {
  margin: 28px 0 0;
}

.doc-figure .screen-frame {
  margin: 0;
}

.doc-figure img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  object-fit: contain;
}

.doc-figure > img {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #080b10;
}

.doc-figure figcaption {
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.doc-callout {
  margin-top: 16px;
  padding: 14px 16px;
  border-left: 3px solid var(--accent);
  background: var(--accent-dim);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.doc-callout strong {
  color: var(--text);
}

.doc-kbd {
  display: inline-block;
  padding: 2px 7px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-elevated);
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 0.82rem;
  color: var(--text);
}

.doc-inline-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding: 0;
  list-style: none;
}

.doc-inline-list li {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
