:root {
  --ink: #15263d;
  --ink-soft: #51616b;
  --paper: #fff9ee;
  --paper-deep: #f7f0e3;
  --mint: #e5f6f1;
  --teal: #168d83;
  --teal-dark: #0a6f68;
  --amber: #f7d66d;
  --orange: #d36f3f;
  --rose: #ef9d8a;
  --blue: #5778c9;
  --line: #ddc9a6;
  --shadow: 0 22px 60px rgba(21, 38, 61, 0.12);
  --radius: 8px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 10% 8%, rgba(22, 141, 131, 0.17), transparent 26rem),
    radial-gradient(circle at 86% 12%, rgba(247, 214, 109, 0.42), transparent 25rem),
    linear-gradient(135deg, rgba(239, 157, 138, 0.18), transparent 35rem),
    var(--paper-deep);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.6;
  min-width: 320px;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(21, 38, 61, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 38, 61, 0.045) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 249, 238, 0.88);
  border-bottom: 1px solid rgba(221, 201, 166, 0.8);
  backdrop-filter: blur(16px);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 22px;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-family: "Courier New", monospace;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.brand img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(21, 38, 61, 0.14);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: "Courier New", monospace;
  font-size: 0.9rem;
}

.nav-links a {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  padding: 8px 12px;
  border-radius: var(--radius);
  color: var(--ink-soft);
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  background: var(--mint);
  color: var(--teal-dark);
}

.hero {
  position: relative;
  min-height: 88vh;
  overflow: hidden;
  display: grid;
  align-items: center;
}

.hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 9rem;
  background: linear-gradient(to bottom, transparent, var(--paper-deep));
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(320px, 0.98fr);
  gap: 56px;
  width: min(1180px, calc(100% - 44px));
  margin: 0 auto;
  padding: 70px 0 92px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  gap: 10px;
  margin: 0 0 18px;
  padding: 7px 11px;
  border: 1px solid rgba(21, 38, 61, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.5);
  color: var(--teal-dark);
  font-family: "Courier New", monospace;
  font-size: 0.82rem;
  font-weight: 700;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange);
}

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

h1,
.display {
  margin-bottom: 22px;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 4.8rem;
  line-height: 0.96;
}

.display span,
h1 span {
  color: var(--teal);
}

.lead {
  max-width: 640px;
  margin-bottom: 32px;
  color: var(--ink-soft);
  font-size: 1.22rem;
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 18px;
  border: 1px solid rgba(21, 38, 61, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.54);
  color: var(--ink);
  font-family: "Courier New", monospace;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(21, 38, 61, 0.08);
}

.button.primary {
  background: var(--teal);
  color: var(--paper);
  border-color: var(--teal);
}

.button:hover {
  transform: translateY(-1px);
}

.hero-art {
  position: relative;
  min-height: 560px;
}

.cipher-wheel {
  position: absolute;
  width: 430px;
  height: 430px;
  top: 18px;
  right: 20px;
  border: 18px solid var(--amber);
  border-radius: 50%;
  background:
    conic-gradient(from 8deg, var(--teal), var(--amber), var(--rose), var(--blue), var(--teal)),
    var(--paper);
  box-shadow: var(--shadow);
  animation: slow-turn 30s linear infinite;
}

.cipher-wheel::before,
.cipher-wheel::after {
  content: "";
  position: absolute;
  inset: 54px;
  border-radius: 50%;
  border: 2px dashed rgba(255, 249, 238, 0.9);
}

.cipher-wheel::after {
  inset: 118px;
  background: var(--paper);
  border: 12px solid var(--ink);
}

.tile {
  position: absolute;
  z-index: 2;
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper);
  font-family: "Courier New", monospace;
  font-size: 1.35rem;
  font-weight: 700;
  box-shadow: 8px 8px 0 rgba(21, 38, 61, 0.16);
}

.tile.a { top: 20px; left: 28px; transform: rotate(-8deg); }
.tile.b { top: 96px; right: 0; transform: rotate(9deg); }
.tile.c { bottom: 98px; left: 12px; transform: rotate(10deg); }
.tile.d { right: 52px; bottom: 30px; transform: rotate(-7deg); }

.phone {
  position: absolute;
  z-index: 4;
  right: 92px;
  bottom: 0;
  width: 265px;
  padding: 14px;
  border: 3px solid var(--ink);
  border-radius: 28px;
  background: var(--ink);
  box-shadow: 24px 28px 0 rgba(21, 38, 61, 0.13);
}

.phone-screen {
  min-height: 492px;
  overflow: hidden;
  border-radius: 18px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    #17314c;
  background-size: 22px 22px;
  color: var(--paper);
  padding: 22px 18px;
}

.app-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 36px;
  font-family: "Courier New", monospace;
  font-size: 0.78rem;
}

.app-mark {
  width: 44px;
  height: 44px;
  border-radius: 8px;
}

.puzzle-chip {
  display: inline-flex;
  margin-bottom: 16px;
  padding: 5px 9px;
  border-radius: var(--radius);
  background: rgba(247, 214, 109, 0.16);
  color: var(--amber);
  font-family: "Courier New", monospace;
  font-size: 0.76rem;
}

.cipher-line {
  margin-bottom: 14px;
  color: var(--paper);
  font-family: "Courier New", monospace;
  font-size: 1.45rem;
  font-weight: 700;
}

.decode-line {
  margin-bottom: 28px;
  color: rgba(255, 249, 238, 0.62);
  font-family: "Courier New", monospace;
  font-size: 1.05rem;
}

.keyboard {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 7px;
  margin-top: 22px;
}

.key {
  display: grid;
  height: 30px;
  place-items: center;
  border-radius: 6px;
  background: rgba(255, 249, 238, 0.12);
  color: var(--paper);
  font-family: "Courier New", monospace;
  font-size: 0.72rem;
}

.key.hit {
  background: var(--amber);
  color: var(--ink);
}

.section {
  position: relative;
  z-index: 1;
  padding: 84px 22px;
}

.section.alt {
  border-top: 1px solid rgba(221, 201, 166, 0.7);
  border-bottom: 1px solid rgba(221, 201, 166, 0.7);
  background: rgba(229, 246, 241, 0.68);
}

.section-inner {
  width: min(1080px, 100%);
  margin: 0 auto;
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(260px, 0.55fr);
  gap: 36px;
  align-items: end;
  margin-bottom: 34px;
}

.section-kicker {
  margin-bottom: 10px;
  color: var(--orange);
  font-family: "Courier New", monospace;
  font-size: 0.9rem;
  font-weight: 700;
}

h2 {
  margin-bottom: 12px;
  font-size: 2.7rem;
  line-height: 1.08;
}

h3 {
  margin-bottom: 9px;
  font-size: 1.28rem;
}

.muted {
  color: var(--ink-soft);
}

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

.card {
  min-height: 220px;
  padding: 24px;
  border: 1px solid rgba(21, 38, 61, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 249, 238, 0.82);
  box-shadow: 0 18px 42px rgba(21, 38, 61, 0.08);
}

.card:nth-child(2n) {
  background: rgba(255, 255, 255, 0.64);
}

.code-badge {
  display: inline-flex;
  margin-bottom: 18px;
  padding: 6px 9px;
  border-radius: 6px;
  background: var(--ink);
  color: var(--amber);
  font-family: "Courier New", monospace;
  font-weight: 700;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(300px, 1.05fr);
  gap: 54px;
  align-items: center;
}

.cipher-board {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  padding: 24px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: rgba(255, 249, 238, 0.78);
  box-shadow: var(--shadow);
}

.board-cell {
  display: grid;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(21, 38, 61, 0.2);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  font-family: "Courier New", monospace;
  font-weight: 700;
}

.board-cell:nth-child(3n) {
  background: var(--amber);
}

.board-cell:nth-child(5n) {
  background: var(--mint);
}

.board-cell:nth-child(7n) {
  background: #f9d8cd;
}

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

.stat {
  padding: 22px;
  border: 1px solid rgba(21, 38, 61, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 249, 238, 0.82);
}

.stat strong {
  display: block;
  color: var(--teal-dark);
  font-family: "Courier New", monospace;
  font-size: 2.1rem;
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.pill {
  padding: 9px 12px;
  border: 1px solid rgba(21, 38, 61, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink-soft);
  font-family: "Courier New", monospace;
  font-size: 0.9rem;
}

.doc-shell {
  position: relative;
  z-index: 1;
  width: min(900px, calc(100% - 44px));
  margin: 0 auto;
  padding: 72px 0 92px;
}

.doc-header {
  margin-bottom: 34px;
  padding: 34px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: rgba(255, 249, 238, 0.82);
  box-shadow: var(--shadow);
}

.doc-header h1 {
  font-size: 3.35rem;
}

.doc-meta {
  color: var(--ink-soft);
  font-family: "Courier New", monospace;
  font-size: 0.92rem;
}

.legal-note {
  padding: 18px 20px;
  border-left: 5px solid var(--teal);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: rgba(229, 246, 241, 0.84);
}

.doc-section {
  margin-bottom: 22px;
  padding: 30px;
  border: 1px solid rgba(21, 38, 61, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 249, 238, 0.78);
}

.doc-section h2 {
  font-size: 1.55rem;
}

.doc-section p:last-child,
.doc-section ul:last-child {
  margin-bottom: 0;
}

.doc-section li {
  margin-bottom: 8px;
}

.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid rgba(221, 201, 166, 0.8);
  background: rgba(255, 249, 238, 0.7);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  width: min(1180px, calc(100% - 44px));
  margin: 0 auto;
  padding: 30px 0;
  color: var(--ink-soft);
  font-family: "Courier New", monospace;
  font-size: 0.9rem;
}

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

.footer-links a {
  color: var(--ink-soft);
  text-decoration: none;
}

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

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 600ms ease, transform 600ms ease;
}

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

@keyframes slow-turn {
  to {
    transform: rotate(360deg);
  }
}

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

  .cipher-wheel {
    animation: none;
  }

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

@media (max-width: 920px) {
  .hero-inner,
  .split,
  .section-head {
    grid-template-columns: 1fr;
  }

  .hero-art {
    min-height: 510px;
  }

  .cipher-wheel {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }

  .phone {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }

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

@media (max-width: 680px) {
  .nav {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-links {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  h1,
  .display {
    font-size: 3.15rem;
  }

  h2 {
    font-size: 2.1rem;
  }

  .lead {
    font-size: 1.05rem;
  }

  .hero {
    min-height: auto;
  }

  .hero-inner {
    padding-top: 46px;
  }

  .hero-art {
    min-height: 430px;
  }

  .cipher-wheel {
    width: 330px;
    height: 330px;
  }

  .phone {
    width: 226px;
    padding: 11px;
  }

  .phone-screen {
    min-height: 400px;
  }

  .tile {
    width: 46px;
    height: 46px;
  }

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

  .cipher-board {
    grid-template-columns: repeat(5, 1fr);
    padding: 14px;
  }

  .doc-header,
  .doc-section {
    padding: 22px;
  }

  .doc-header h1 {
    font-size: 2.45rem;
  }

  .footer-inner {
    flex-direction: column;
  }
}
