:root {
  --ink: #101523;
  --navy: #071a3d;
  --blue: #0d3f86;
  --cyan: #24cdec;
  --cyan-soft: #a9f4f1;
  --gold: #f4b82d;
  --gold-soft: #ffe39b;
  --paper: #f5efdd;
  --paper-bright: #fffaf0;
  --paper-muted: #dfd5bc;
  --white: #fffdf6;
  --shadow: 7px 8px 0 var(--ink);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 9% 10%, rgba(13, 63, 134, 0.07) 0 1px, transparent 2px),
    radial-gradient(circle at 90% 40%, rgba(244, 184, 45, 0.08) 0 1px, transparent 2px),
    var(--paper);
  background-size: 19px 19px, 23px 23px, auto;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  opacity: 0.17;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.72' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.23'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

button {
  font: inherit;
}

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

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: -70px;
  z-index: 100;
  padding: 10px 16px;
  color: var(--white);
  background: var(--ink);
  border-radius: 0 0 10px 10px;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 0;
}

.site-header {
  position: fixed;
  z-index: 40;
  top: 14px;
  left: 50%;
  width: min(1240px, calc(100% - 28px));
  min-height: 66px;
  padding: 8px 10px 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  transform: translateX(-50%);
  color: var(--white);
  background: rgba(7, 26, 61, 0.9);
  border: 2px solid rgba(255, 255, 255, 0.24);
  border-radius: 20px;
  box-shadow: 4px 5px 0 rgba(16, 21, 35, 0.75);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-mark {
  width: 46px;
  height: 46px;
  overflow: hidden;
  flex: 0 0 auto;
  border: 2px solid var(--paper-bright);
  border-radius: 50%;
  box-shadow: 2px 2px 0 var(--cyan);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-copy {
  display: grid;
  line-height: 1.1;
}

.brand-copy strong {
  font-family: "Arial Black", "Trebuchet MS", sans-serif;
  letter-spacing: -0.04em;
}

.brand-copy small {
  margin-top: 5px;
  color: var(--cyan-soft);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.desktop-nav a {
  position: relative;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.9rem;
  font-weight: 800;
  text-decoration: none;
}

.desktop-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -5px;
  height: 3px;
  background: var(--gold);
  transform: rotate(-2deg);
  transition: right 0.2s ease;
}

.desktop-nav a:hover::after,
.desktop-nav a:focus-visible::after {
  right: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.round-link,
.menu-toggle {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: var(--paper-bright);
  border: 2px solid var(--ink);
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.round-link {
  box-shadow: 2px 2px 0 var(--cyan);
}

.round-link svg {
  width: 17px;
  fill: currentColor;
}

.round-link:hover,
.round-link:focus-visible,
.menu-toggle:hover,
.menu-toggle:focus-visible {
  transform: translate(-2px, -2px) rotate(-3deg);
  box-shadow: 4px 4px 0 var(--gold);
}

.menu-toggle {
  display: none;
  padding: 0;
}

.menu-toggle > span:not(.sr-only) {
  position: absolute;
  width: 18px;
  height: 2px;
  background: var(--ink);
  transition: transform 0.2s ease;
}

.menu-toggle > span:first-child {
  transform: translateY(-4px);
}

.menu-toggle > span:nth-child(2) {
  transform: translateY(4px);
}

.menu-toggle[aria-expanded="true"] > span:first-child {
  transform: rotate(45deg);
}

.menu-toggle[aria-expanded="true"] > span:nth-child(2) {
  transform: rotate(-45deg);
}

.mobile-nav {
  display: none;
}

.hero {
  position: relative;
  min-height: 100svh;
  padding: 118px 0 70px;
  display: grid;
  align-items: center;
  overflow: hidden;
  color: var(--white);
  background: var(--navy);
  border-bottom: 5px solid var(--ink);
}

.hero-image,
.hero-wash {
  position: absolute;
  inset: 0;
}

.hero-image {
  z-index: 0;
  background-image: url("assets/hero-bg.jpg");
  background-position: center;
  background-size: cover;
  transform: scale(1.02);
  animation: breathe 9s ease-in-out infinite alternate;
}

.hero-wash {
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(5, 17, 42, 0.91) 0%, rgba(5, 17, 42, 0.58) 43%, rgba(5, 17, 42, 0.05) 72%),
    linear-gradient(0deg, rgba(5, 17, 42, 0.85) 0%, transparent 30%);
}

#trail-canvas {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  mix-blend-mode: screen;
}

.hero-layout {
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-columns: minmax(0, 650px) minmax(250px, 330px);
  align-items: end;
  justify-content: space-between;
  gap: 52px;
}

.paper-card {
  position: relative;
  padding: clamp(28px, 4vw, 52px);
  color: var(--ink);
  background: rgba(255, 250, 240, 0.95);
  clip-path: polygon(0.7% 2%, 98.8% 0, 100% 96.5%, 96% 100%, 2% 98%, 0 5%);
  filter: drop-shadow(9px 11px 0 rgba(16, 21, 35, 0.78));
}

.paper-card::before {
  content: "";
  position: absolute;
  width: 90px;
  height: 24px;
  top: -5px;
  left: 38%;
  background: rgba(255, 227, 155, 0.75);
  transform: rotate(-2deg);
  box-shadow: inset 0 0 0 1px rgba(119, 82, 13, 0.12);
}

.eyebrow,
.page-label,
.console-topline,
.finale-kicker {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.76rem;
  font-weight: 900;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--blue);
}

.eyebrow-dot {
  width: 10px;
  height: 10px;
  background: var(--gold);
  border: 2px solid var(--ink);
  border-radius: 50%;
  box-shadow: 7px -3px 0 -2px var(--cyan);
}

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

h1,
h2,
h3 {
  font-family: "Arial Black", "Trebuchet MS", sans-serif;
  line-height: 0.98;
  letter-spacing: -0.055em;
}

h1 {
  max-width: 620px;
  margin: 22px 0 24px;
  font-size: clamp(3.3rem, 6.5vw, 6.5rem);
}

h1 em {
  position: relative;
  display: inline-block;
  color: var(--blue);
  font-style: normal;
}

h1 em::after {
  content: "";
  position: absolute;
  left: -2%;
  right: -4%;
  bottom: -7px;
  height: 12px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='14' viewBox='0 0 420 14'%3E%3Cpath d='M3 9c73-8 123 4 199-2s141-5 214 1' fill='none' stroke='%23f4b82d' stroke-width='7' stroke-linecap='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}

.hero-lede {
  max-width: 610px;
  margin-bottom: 28px;
  color: #354052;
  font-size: clamp(1.02rem, 1.45vw, 1.18rem);
  line-height: 1.65;
}

.hero-actions,
.finale-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  min-height: 52px;
  padding: 13px 19px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  font-weight: 900;
  text-decoration: none;
  border: 3px solid var(--ink);
  border-radius: 13px 9px 15px 10px;
  box-shadow: 4px 5px 0 var(--ink);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.button:hover,
.button:focus-visible {
  transform: translate(-2px, -3px) rotate(-1deg);
  box-shadow: 7px 8px 0 var(--ink);
}

.button-primary {
  color: var(--ink);
  background: var(--gold);
}

.button-primary:hover,
.button-primary:focus-visible {
  background: #ffc840;
}

.button-ink {
  color: var(--white);
  background: var(--blue);
}

.button-paper {
  color: var(--ink);
  background: var(--paper-bright);
}

.contract-card {
  margin-top: 24px;
  padding: 12px 12px 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #d7f6f5;
  border: 2px dashed var(--ink);
  border-radius: 12px;
}

.contract-card > div {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.contract-label {
  color: #4b6071;
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.13em;
}

.contract-card code,
.final-contract code {
  overflow: hidden;
  color: var(--ink);
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.88rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-button,
.final-contract button {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--white);
  background: var(--ink);
  border: 0;
  border-radius: 9px;
  padding: 9px 11px;
  font-size: 0.78rem;
  font-weight: 900;
  cursor: pointer;
}

.copy-button svg {
  width: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.copy-button:disabled,
.final-contract button:disabled {
  opacity: 0.62;
  cursor: default;
}

.trail-console {
  padding: 21px;
  color: var(--paper-bright);
  background: rgba(7, 26, 61, 0.88);
  border: 2px solid rgba(169, 244, 241, 0.7);
  border-radius: 22px 17px 25px 14px;
  box-shadow: 7px 8px 0 rgba(16, 21, 35, 0.8);
  backdrop-filter: blur(12px);
  transform: rotate(1.2deg);
}

.console-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--cyan-soft);
}

.console-topline i {
  width: 9px;
  height: 9px;
  background: var(--gold);
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(244, 184, 45, 0.16), 0 0 18px var(--gold);
  animation: blink 1.8s ease-in-out infinite;
}

.trail-console > p {
  margin: 15px 0 18px;
  color: rgba(255, 253, 246, 0.72);
  font-size: 0.92rem;
  line-height: 1.5;
}

.signal-readout {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 14px;
}

.signal-number {
  font-family: "Arial Black", sans-serif;
  color: var(--gold);
  font-size: 2.6rem;
  letter-spacing: -0.08em;
  line-height: 1;
}

.signal-number small {
  margin-left: 2px;
  font-size: 0.9rem;
}

.signal-readout strong {
  display: block;
  margin-bottom: 8px;
  font-size: 0.82rem;
}

.signal-bar {
  height: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
}

.signal-bar span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--gold));
  border-radius: inherit;
  transition: width 0.2s ease;
}

.console-actions {
  margin-top: 18px;
  display: flex;
  gap: 8px;
}

.draw-toggle,
.clear-trail {
  min-height: 44px;
  color: var(--ink);
  background: var(--paper-bright);
  border: 2px solid var(--ink);
  border-radius: 10px;
  font-size: 0.84rem;
  font-weight: 900;
  cursor: pointer;
}

.draw-toggle {
  flex: 1;
  padding: 8px 12px;
}

.draw-toggle[aria-pressed="true"] {
  background: var(--gold);
}

.pencil-icon {
  margin-right: 5px;
  font-size: 1.15rem;
}

.clear-trail {
  padding: 8px 12px;
  background: transparent;
  color: var(--paper-bright);
  border-color: rgba(255, 255, 255, 0.3);
}

.scroll-cue {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: 20px;
  display: grid;
  justify-items: center;
  gap: 7px;
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-decoration: none;
  text-transform: uppercase;
  transform: translateX(-50%);
}

.scroll-cue i {
  width: 2px;
  height: 20px;
  background: var(--gold);
  animation: scroll 1.4s ease-in-out infinite;
}

.chapter {
  position: relative;
  padding: clamp(90px, 11vw, 160px) 0;
  overflow: hidden;
}

.chapter-number {
  position: absolute;
  top: -0.22em;
  right: -0.03em;
  color: rgba(13, 63, 134, 0.07);
  font-family: "Arial Black", sans-serif;
  font-size: clamp(12rem, 34vw, 34rem);
  line-height: 1;
  letter-spacing: -0.13em;
  pointer-events: none;
}

.chapter-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.84fr) minmax(460px, 1.16fr);
  align-items: center;
  gap: clamp(50px, 8vw, 110px);
}

.page-label {
  color: var(--blue);
}

.chapter h2,
.section-heading h2,
.flight-intro h2,
.finale h2 {
  margin: 18px 0 26px;
  font-size: clamp(3rem, 6vw, 6.2rem);
}

.chapter-lede {
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  font-weight: 800;
  line-height: 1.45;
}

.chapter-copy > p:not(.chapter-lede) {
  color: #495261;
}

blockquote {
  position: relative;
  margin: 34px 0 0;
  padding: 16px 20px;
  color: var(--navy);
  background: var(--gold-soft);
  border-left: 5px solid var(--gold);
  font-size: 1.05rem;
  font-weight: 900;
  transform: rotate(-1deg);
}

.star-map {
  position: relative;
  margin: 0;
  padding: 16px;
  background: var(--paper-bright);
  border: 3px solid var(--ink);
  border-radius: 9px 18px 12px 20px;
  box-shadow: 12px 14px 0 var(--ink);
  transform: rotate(1.4deg);
}

.star-map img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 4px 10px 6px 12px;
}

.star-map figcaption {
  padding: 13px 4px 2px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.star-map figcaption span {
  color: #68717e;
}

.tape {
  position: absolute;
  z-index: 2;
  width: 98px;
  height: 27px;
  background: rgba(255, 227, 155, 0.77);
  border: 1px solid rgba(102, 74, 19, 0.12);
}

.tape-one {
  top: -13px;
  left: 42px;
  transform: rotate(-7deg);
}

.tape-two {
  right: 36px;
  bottom: 38px;
  transform: rotate(8deg);
}

.signal {
  color: var(--white);
  background:
    radial-gradient(circle at 50% 35%, rgba(36, 205, 236, 0.2), transparent 31%),
    repeating-radial-gradient(ellipse at 50% 45%, transparent 0 80px, rgba(36, 205, 236, 0.08) 81px 83px, transparent 84px 130px),
    var(--navy);
  border-block: 5px solid var(--ink);
}

.signal::before,
.signal::after {
  content: "✦";
  position: absolute;
  color: var(--gold);
  font-size: 3rem;
  animation: spin 12s linear infinite;
}

.signal::before {
  left: 6vw;
  top: 12%;
}

.signal::after {
  right: 8vw;
  bottom: 10%;
  font-size: 1.7rem;
  animation-direction: reverse;
}

.section-heading {
  display: grid;
  grid-template-columns: 1.15fr 0.65fr;
  align-items: end;
  gap: 80px;
}

.page-label-light {
  color: var(--cyan-soft);
}

.section-heading h2 {
  max-width: 820px;
  margin-bottom: 0;
}

.section-heading > p {
  margin-bottom: 10px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 1.08rem;
}

.signal-grid {
  margin-top: 70px;
  display: grid;
  grid-template-columns: 1fr 1.25fr 1fr;
  align-items: center;
  gap: 20px;
}

.signal-card {
  position: relative;
  min-height: 300px;
  padding: 30px;
  color: var(--ink);
  background: var(--paper-bright);
  border: 3px solid var(--ink);
  border-radius: 16px 24px 14px 20px;
  box-shadow: 6px 7px 0 var(--cyan);
}

.signal-card:first-child {
  transform: rotate(-2deg);
}

.signal-card:last-child {
  transform: rotate(2deg);
}

.signal-card-featured {
  min-height: 510px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: var(--gold-soft);
  box-shadow: 8px 9px 0 var(--gold);
}

.card-index {
  position: absolute;
  top: 17px;
  right: 20px;
  color: var(--blue);
  font-family: "Arial Black", sans-serif;
  font-size: 1.2rem;
}

.signal-card h3 {
  margin: 0 0 14px;
  font-size: 1.9rem;
}

.signal-card p {
  margin-bottom: 0;
  color: #46505e;
}

.portrait-orbit {
  position: absolute;
  top: 40px;
  left: 50%;
  width: min(72%, 270px);
  aspect-ratio: 1;
  transform: translateX(-50%);
}

.portrait-orbit img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 4px solid var(--ink);
  border-radius: 50%;
}

.orbit {
  position: absolute;
  inset: -11px;
  border: 3px solid var(--blue);
  border-radius: 50%;
}

.orbit::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  top: 16%;
  right: 0;
  background: var(--cyan);
  border: 2px solid var(--ink);
  border-radius: 50%;
}

.orbit-a {
  animation: spin 8s linear infinite;
}

.orbit-b {
  inset: -22px 7px;
  border-color: var(--gold);
  transform: rotate(37deg);
  animation: spin 13s linear infinite reverse;
}

.orbit-b::after {
  width: 11px;
  height: 11px;
  background: var(--gold);
}

.flight-log {
  background: var(--paper);
}

.flight-layout {
  display: grid;
  grid-template-columns: 0.72fr 1.28fr;
  gap: clamp(50px, 9vw, 120px);
}

.flight-intro {
  position: sticky;
  top: 125px;
  align-self: start;
}

.flight-intro h2 {
  font-size: clamp(3.2rem, 6vw, 6rem);
}

.flight-intro p {
  color: #596170;
  font-size: 1.08rem;
}

.flight-steps {
  margin: 0;
  padding: 0;
  display: grid;
  list-style: none;
}

.flight-steps li {
  position: relative;
  padding: 12px 0 58px 94px;
  display: grid;
  grid-template-columns: 1fr;
}

.flight-steps li:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 37px;
  top: 68px;
  bottom: 0;
  width: 5px;
  background: repeating-linear-gradient(to bottom, var(--blue) 0 13px, transparent 13px 20px);
  transform: rotate(1deg);
}

.step-marker {
  position: absolute;
  left: 0;
  top: 0;
  width: 74px;
  height: 66px;
  display: grid;
  place-items: center;
  color: var(--paper-bright);
  background: var(--blue);
  border: 3px solid var(--ink);
  border-radius: 50% 44% 51% 47%;
  box-shadow: 4px 4px 0 var(--gold);
  font-family: "Arial Black", sans-serif;
}

.flight-steps small {
  color: var(--blue);
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.flight-steps h3 {
  margin: 7px 0 12px;
  font-size: clamp(2rem, 4vw, 3.6rem);
}

.flight-steps p {
  max-width: 610px;
  color: #555e6a;
  font-size: 1.05rem;
}

.finale {
  position: relative;
  min-height: 82svh;
  padding: 110px 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--white);
  text-align: center;
  background: var(--blue);
  border-top: 5px solid var(--ink);
}

.finale::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 50%, rgba(36, 205, 236, 0.36), transparent 26%),
    repeating-radial-gradient(ellipse at 50% 50%, transparent 0 70px, rgba(255, 255, 255, 0.06) 72px 75px, transparent 77px 130px);
}

.finale-orbit {
  position: absolute;
  width: min(78vw, 1000px);
  aspect-ratio: 2 / 1;
  border: 5px solid var(--gold);
  border-radius: 50%;
  transform: rotate(-8deg);
  box-shadow: 0 0 60px rgba(244, 184, 45, 0.24);
}

.finale-orbit::before,
.finale-orbit::after {
  content: "✦";
  position: absolute;
  color: var(--gold);
  font-size: 2rem;
}

.finale-orbit::before {
  left: 7%;
  top: 6%;
}

.finale-orbit::after {
  right: 4%;
  bottom: 8%;
  font-size: 3.5rem;
}

.finale-inner {
  position: relative;
  z-index: 2;
}

.finale-kicker {
  color: var(--cyan-soft);
}

.finale h2 {
  margin: 22px auto 38px;
  font-size: clamp(3.8rem, 9vw, 8.4rem);
  text-shadow: 7px 7px 0 var(--navy);
}

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

.final-contract {
  width: min(720px, 100%);
  margin: 34px auto 0;
  padding: 10px 10px 10px 16px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  background: rgba(255, 255, 255, 0.9);
  border: 3px dashed var(--ink);
  border-radius: 12px;
}

.final-contract > span {
  color: var(--blue);
  font-weight: 900;
}

.final-contract code {
  text-align: left;
}

footer {
  padding: 46px 0;
  color: rgba(255, 255, 255, 0.72);
  background: var(--ink);
}

.footer-grid {
  display: grid;
  grid-template-columns: 0.75fr 1.25fr auto;
  align-items: end;
  gap: 40px;
}

.footer-brand {
  display: grid;
}

.footer-brand strong {
  color: var(--white);
  font-family: "Arial Black", sans-serif;
  font-size: 1.2rem;
  letter-spacing: -0.04em;
}

.footer-brand span,
.footer-grid p,
.footer-note {
  font-size: 0.78rem;
}

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

.footer-note {
  text-align: right;
  white-space: nowrap;
}

.toast {
  position: fixed;
  z-index: 90;
  left: 50%;
  bottom: 24px;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  color: var(--ink);
  background: var(--gold);
  border: 2px solid var(--ink);
  border-radius: 10px;
  box-shadow: 4px 5px 0 var(--ink);
  font-weight: 900;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 20px) rotate(-1deg);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0) rotate(-1deg);
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

@keyframes breathe {
  from { transform: scale(1.02); }
  to { transform: scale(1.055); }
}

@keyframes blink {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes scroll {
  0%, 100% { transform: scaleY(0.55); transform-origin: top; opacity: 0.5; }
  50% { transform: scaleY(1); opacity: 1; }
}

@media (max-width: 980px) {
  .desktop-nav {
    display: none;
  }

  .menu-toggle {
    display: grid;
  }

  .mobile-nav {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    padding: 14px;
    display: none;
    gap: 8px;
    background: rgba(7, 26, 61, 0.97);
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 16px;
    box-shadow: 5px 6px 0 var(--ink);
  }

  .mobile-nav.is-open {
    display: grid;
  }

  .mobile-nav a {
    padding: 11px 12px;
    font-weight: 900;
    text-decoration: none;
    border-radius: 9px;
  }

  .mobile-nav a:last-child {
    color: var(--ink);
    background: var(--gold);
  }

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

  .trail-console {
    width: min(100%, 520px);
  }

  .chapter-grid,
  .flight-layout {
    grid-template-columns: 1fr;
  }

  .chapter-grid {
    gap: 70px;
  }

  .flight-intro {
    position: static;
  }

  .section-heading {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .signal-grid {
    grid-template-columns: 1fr;
    width: min(600px, 100%);
    margin-inline: auto;
  }

  .signal-card,
  .signal-card-featured {
    min-height: 260px;
  }

  .signal-card-featured {
    min-height: 520px;
  }

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

  .footer-note {
    grid-column: 1 / -1;
    text-align: left;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 24px, 1200px);
  }

  .site-header {
    top: 8px;
    width: calc(100% - 16px);
  }

  .brand-copy strong {
    font-size: 0.9rem;
  }

  .brand-copy small {
    font-size: 0.58rem;
  }

  .round-link {
    display: none;
  }

  .hero {
    min-height: auto;
    padding: 102px 0 78px;
  }

  .hero-image {
    background-image: url("assets/dogestar-portrait.jpg");
    background-position: center top;
  }

  .hero-wash {
    background: linear-gradient(180deg, rgba(5, 17, 42, 0.36) 0%, rgba(5, 17, 42, 0.92) 47%, rgba(5, 17, 42, 0.98) 100%);
  }

  .hero-layout {
    gap: 28px;
  }

  .paper-card {
    margin-top: 190px;
    padding: 28px 20px 25px;
  }

  h1 {
    font-size: clamp(3rem, 15vw, 4.5rem);
  }

  .hero-actions,
  .finale-actions {
    display: grid;
  }

  .button {
    width: 100%;
  }

  .contract-card {
    align-items: stretch;
    flex-direction: column;
  }

  .copy-button {
    justify-content: center;
  }

  .scroll-cue {
    display: none;
  }

  .chapter {
    padding: 90px 0;
  }

  .chapter h2,
  .section-heading h2,
  .flight-intro h2 {
    font-size: clamp(2.8rem, 13vw, 4.2rem);
  }

  .star-map {
    padding: 9px;
    box-shadow: 7px 8px 0 var(--ink);
  }

  .star-map figcaption {
    display: grid;
  }

  .signal-card:first-child,
  .signal-card:last-child {
    transform: none;
  }

  .flight-steps li {
    padding-left: 72px;
  }

  .step-marker {
    width: 56px;
    height: 52px;
    font-size: 0.8rem;
  }

  .flight-steps li:not(:last-child)::before {
    left: 28px;
    top: 56px;
  }

  .finale {
    min-height: 680px;
  }

  .finale h2 {
    font-size: clamp(3.3rem, 16vw, 5.2rem);
  }

  .final-contract {
    grid-template-columns: auto 1fr;
  }

  .final-contract button {
    grid-column: 1 / -1;
    justify-content: center;
  }

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

  .footer-note {
    grid-column: auto;
  }
}

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

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

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