@import url("https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Manrope:wght@400;500;600;700;800&family=Newsreader:ital,opsz,wght@1,6..72,600&display=swap");

:root {
  --ink: #17211e;
  --muted: #65706b;
  --paper: #f7f2e7;
  --paper-deep: #ede6d8;
  --white: #fffdf8;
  --orange: #e85b2b;
  --orange-dark: #c9461d;
  --teal: #0e6d65;
  --teal-light: #cce4dc;
  --sky: #d9e9eb;
  --line: rgba(23, 33, 30, 0.14);
  --shadow: 0 18px 50px rgba(49, 43, 31, 0.1);
  --display: "Manrope", system-ui, sans-serif;
  --serif: "Newsreader", Georgia, serif;
  --mono: "DM Mono", ui-monospace, monospace;
}

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

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

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 0%, rgba(255,255,255,.9), transparent 30rem),
    var(--paper);
  font-family: var(--display);
  -webkit-font-smoothing: antialiased;
}

body.dialog-open { overflow: hidden; }

a { color: inherit; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button { color: inherit; }

:focus-visible { outline: 3px solid #147f76; outline-offset: 3px; }

.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;
  z-index: 100;
  left: 1rem;
  top: 1rem;
  padding: .75rem 1rem;
  transform: translateY(-180%);
  background: var(--ink);
  color: white;
  border-radius: .5rem;
}

.skip-link:focus { transform: none; }

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 10px clamp(20px, 5vw, 76px);
  background: rgba(247, 242, 231, .88);
  border-bottom: 1px solid rgba(23, 33, 30, .09);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--orange);
}

.brand-mark svg { width: 29px; overflow: visible; }
.brand-mark path:first-child { fill: var(--white); stroke: var(--ink); stroke-width: 1.5; stroke-linejoin: round; }
.brand-mark path:last-child { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.brand b, .brand small { display: block; }
.brand b { font-size: .84rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; text-transform: uppercase; }
.brand small { margin-top: 3px; color: var(--muted); font-family: var(--mono); font-size: .58rem; letter-spacing: .07em; text-transform: uppercase; }

nav { display: flex; align-items: center; gap: clamp(13px, 2.4vw, 34px); }
nav a, .text-button { border: 0; background: none; font-size: .84rem; font-weight: 700; text-decoration: none; }
nav a:hover, .text-button:hover { color: var(--orange-dark); }
.install-button { padding: .65rem .9rem; border: 1px solid var(--ink); border-radius: .55rem; background: var(--ink); color: white; font-size: .78rem; font-weight: 700; }

.hero {
  position: relative;
  display: grid;
  min-height: min(740px, calc(100svh - 76px));
  grid-template-columns: minmax(0, .85fr) minmax(430px, 1.15fr);
  align-items: center;
  gap: 1rem;
  max-width: 1500px;
  margin: auto;
  padding: clamp(68px, 9vw, 124px) clamp(24px, 7.5vw, 120px);
  overflow: hidden;
}

.hero::before {
  position: absolute;
  z-index: -1;
  width: 26rem;
  height: 26rem;
  right: -12rem;
  top: -10rem;
  border: 1px solid rgba(23,33,30,.09);
  border-radius: 50%;
  content: "";
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--teal);
  font-family: var(--mono);
  font-size: clamp(.66rem, .8vw, .78rem);
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
}

h1, h2, h3, p { text-wrap: pretty; }

h1 {
  max-width: 670px;
  margin: 0;
  font-size: clamp(3.25rem, 7.2vw, 7.4rem);
  font-weight: 800;
  letter-spacing: -.075em;
  line-height: .84;
}

h1 em {
  display: block;
  margin-top: .12em;
  color: var(--orange);
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -.04em;
}

.hero-deck {
  max-width: 580px;
  margin: 32px 0;
  color: #4d5a55;
  font-size: clamp(1rem, 1.45vw, 1.24rem);
  line-height: 1.65;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  padding: .83rem 1.12rem;
  border: 1px solid var(--ink);
  border-radius: .45rem;
  box-shadow: 3px 3px 0 var(--ink);
  font-size: .84rem;
  font-weight: 800;
  text-decoration: none;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.button:hover { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.button-primary { background: var(--orange); }
.button-primary:hover { background: #f06c3f; }
.button-quiet { background: var(--white); }
.button-dark { background: var(--ink); color: white; box-shadow: 3px 3px 0 #7baca1; }
.button-dark:hover { box-shadow: 1px 1px 0 #7baca1; }
.button-icon { font-size: 1.1em; }
.hero-note { margin: 22px 0 0; color: var(--muted); font-family: var(--mono); font-size: .68rem; }
.hero-note span { color: var(--orange); }

.hero-art { position: relative; min-height: 460px; }
.hero-plane { position: absolute; z-index: 2; width: min(48vw, 670px); left: 3%; top: 8%; filter: drop-shadow(13px 25px 22px rgba(48, 41, 26, .18)); transform: rotate(-4deg); }
.plane-shadow { fill: rgba(18,41,38,.16); transform: translate(-7px, 15px); }
.plane-main { fill: #fffcf4; stroke: var(--ink); stroke-width: 2.4; stroke-linejoin: round; }
.plane-wing { fill: #e2dccd; stroke: var(--ink); stroke-width: 2.4; stroke-linejoin: round; }
.plane-fold { fill: var(--teal-light); stroke: var(--ink); stroke-width: 2.4; stroke-linejoin: round; }
.plane-line { fill: none; stroke: var(--orange); stroke-width: 3; stroke-dasharray: 7 8; }
.flight-path { position: absolute; width: 85%; height: 67%; left: -8%; top: 7%; border-top: 2px dashed rgba(14,109,101,.34); border-radius: 50%; transform: rotate(-24deg); }
.art-label { position: absolute; z-index: 3; padding: 7px 10px; border: 1px solid var(--ink); background: var(--white); box-shadow: 2px 2px 0 var(--ink); font-family: var(--mono); font-size: .66rem; text-transform: uppercase; transform: rotate(-4deg); }
.label-one { left: 7%; bottom: 27%; }
.label-two { right: 5%; top: 26%; transform: rotate(5deg); }
.label-three { right: 10%; bottom: 13%; color: white; background: var(--teal); transform: rotate(-2deg); }

.catalog-section {
  padding: clamp(76px, 10vw, 132px) clamp(20px, 5vw, 76px);
  background: var(--white);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.catalog-section > *, .how-it-works > *, .classic-callout, footer > * { max-width: 1360px; margin-left: auto; margin-right: auto; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 42px; }
.section-heading h2, .classic-callout h2, .classic-dialog h2 { margin: 0; font-size: clamp(2.1rem, 4.2vw, 4rem); letter-spacing: -.055em; line-height: .98; }
.section-heading > p { max-width: 430px; margin: 0; color: var(--muted); font-size: .88rem; line-height: 1.65; }

.filter-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 210px auto;
  align-items: end;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: .75rem;
  background: var(--paper);
}

.search-field { position: relative; display: flex; align-items: center; }
.search-field svg { position: absolute; width: 18px; left: 13px; fill: none; stroke: var(--muted); stroke-width: 1.8; pointer-events: none; }
.search-field input, select {
  width: 100%;
  min-height: 46px;
  padding: 0 38px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: .45rem;
  background: var(--white);
  outline: none;
  font-size: .82rem;
}

.search-field input:focus, select:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(14,109,101,.1); }
.search-field button { position: absolute; right: 7px; width: 32px; height: 32px; border: 0; background: transparent; font-size: 1.25rem; }
.select-label { display: block; margin: 0 0 6px 2px; color: var(--muted); font-family: var(--mono); font-size: .57rem; letter-spacing: .08em; text-transform: uppercase; }
select { padding: 0 32px 0 12px; }
.favorite-filter { display: flex; min-height: 46px; align-items: center; justify-content: center; gap: 7px; padding: 0 15px; border: 1px solid var(--line); border-radius: .45rem; background: var(--white); font-size: .78rem; font-weight: 700; white-space: nowrap; }
.favorite-filter input { width: 1px; height: 1px; opacity: 0; position: absolute; }
.favorite-filter span { color: #a9aaa3; font-size: 1rem; }
.favorite-filter:has(input:checked) { border-color: var(--orange); background: #fff0ea; }
.favorite-filter:has(input:checked) span { color: var(--orange); }
.favorite-filter:focus-within { outline: 3px solid #147f76; outline-offset: 3px; }

.results-bar { display: flex; min-height: 68px; align-items: center; justify-content: space-between; }
.results-bar p { margin: 0; color: var(--muted); font-family: var(--mono); font-size: .68rem; }
.reset-button { border: 0; border-bottom: 1px solid; background: none; color: var(--teal); font-family: var(--mono); font-size: .66rem; }
.plane-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }

.plane-card {
  position: relative;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: .7rem;
  background: var(--white);
  box-shadow: 0 2px 0 rgba(23,33,30,.05);
  overflow: hidden;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.plane-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card-art { position: relative; display: grid; min-height: 205px; place-items: center; overflow: hidden; background: var(--card-bg, #dfe9df); border-bottom: 1px solid var(--line); }
.card-art::before { position: absolute; width: 180px; height: 180px; border: 1px solid rgba(23,33,30,.1); border-radius: 50%; content: ""; transform: translate(40%, -35%); }
.card-art::after { position: absolute; inset: 0; opacity: .19; background-image: radial-gradient(var(--ink) .65px, transparent .65px); background-size: 8px 8px; content: ""; pointer-events: none; }
.card-number { position: absolute; z-index: 2; left: 14px; top: 14px; font-family: var(--mono); font-size: .6rem; }
.favorite-button { position: absolute; z-index: 3; display: grid; width: 38px; height: 38px; right: 11px; top: 10px; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: rgba(255,253,248,.84); }
.favorite-button span:first-child { font-size: 1.25rem; line-height: 1; }
.favorite-button:hover { background: white; transform: scale(1.06); }
.favorite-button[aria-pressed="true"] { color: var(--orange); background: #fff0e9; border-color: rgba(232,91,43,.35); }
.preview-link { position: absolute; z-index: 1; inset: 0; display: grid; place-items: center; padding: 24px 18px; text-decoration: none; }
.card-plane-preview { display: block; width: 90%; max-width: 260px; height: auto; object-fit: contain; background: #fff; border: 1px solid rgba(23,33,30,.27); box-shadow: 6px 8px 13px rgba(35,43,38,.21); transform: rotate(-1deg); transition: transform 240ms ease, box-shadow 240ms ease; }
.plane-card:hover .card-plane-preview { box-shadow: 8px 11px 16px rgba(35,43,38,.24); transform: rotate(0deg) translateY(-3px); }
.preview-link:focus-visible { outline: 3px solid var(--teal); outline-offset: -5px; }
.category-badge { position: absolute; z-index: 2; left: 13px; bottom: 12px; padding: 5px 8px; border: 1px solid rgba(23,33,30,.23); border-radius: 99px; background: rgba(255,253,248,.72); font-family: var(--mono); font-size: .54rem; letter-spacing: .07em; text-transform: uppercase; backdrop-filter: blur(5px); }
.card-body { padding: 17px 16px 16px; }
.card-title-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.card-title-row h3 { margin: 0; overflow: hidden; font-size: 1.05rem; font-weight: 800; letter-spacing: -.025em; text-overflow: ellipsis; white-space: nowrap; }
.print-link { display: flex; align-items: center; justify-content: space-between; margin-top: 17px; padding-top: 13px; color: var(--teal); border-top: 1px solid var(--line); font-size: .71rem; font-weight: 800; text-decoration: none; }
.print-link:hover { color: var(--orange-dark); }

.empty-state { padding: 70px 20px; text-align: center; }
.empty-state > span { display: block; color: var(--orange); font-size: 4rem; }
.empty-state h3 { margin: 0; font-size: 1.5rem; }
.empty-state p { margin-bottom: 24px; color: var(--muted); }

.how-it-works { padding: clamp(76px, 10vw, 132px) clamp(20px, 7vw, 110px); }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin-top: 50px; padding: 0; border-top: 1px solid var(--ink); list-style: none; }
.steps li { display: grid; min-height: 150px; grid-template-columns: 44px 1fr; gap: 15px; padding: 26px 8% 22px 0; border-bottom: 1px solid var(--line); }
.steps li + li { padding-left: 8%; border-left: 1px solid var(--line); }
.steps li > span { color: var(--orange); font-family: var(--mono); font-size: .68rem; }
.steps h3 { margin: 0 0 9px; font-size: 1.1rem; }
.steps p { margin: 0; color: var(--muted); font-size: .83rem; line-height: 1.65; }

.classic-callout { display: grid; grid-template-columns: minmax(300px, .9fr) minmax(350px, 1.1fr); align-items: center; gap: clamp(50px, 8vw, 120px); margin-bottom: clamp(72px, 10vw, 140px); padding: clamp(42px, 7vw, 90px); background: var(--teal); color: white; border-radius: 1.3rem; overflow: hidden; }
.classic-callout .eyebrow { color: #c9e5d9; }
.classic-callout h2 { max-width: 650px; }
.classic-callout p:not(.eyebrow) { max-width: 560px; margin: 25px 0 31px; color: #d5e3de; font-size: .9rem; line-height: 1.7; }
.retro-window { padding: 8px; background: #d5d4cb; border: 2px solid #101414; box-shadow: 15px 16px 0 rgba(1,23,20,.28); transform: rotate(-2deg); }
.retro-bar { display: flex; height: 28px; align-items: center; gap: 5px; padding: 0 7px; background: #142d55; font-family: var(--mono); font-size: .55rem; }
.retro-bar i { display: block; width: 9px; height: 9px; background: #fff; border: 1px solid #111; }
.retro-bar span { margin-left: auto; }
.retro-screen { position: relative; min-height: 280px; padding: 35px; background: linear-gradient(#619dcc 0 57%, #318a68 57%); overflow: hidden; }
.retro-sun { position: absolute; width: 90px; height: 90px; right: 18px; top: 19px; border-radius: 50%; background: #f3c945; }
.retro-horizon { position: absolute; width: 140%; height: 60%; left: -20%; bottom: -42%; border-radius: 50%; background: #287255; }
.retro-screen svg { position: absolute; z-index: 2; width: 55%; right: 4%; top: 40%; filter: drop-shadow(5px 5px 0 rgba(0,0,0,.25)); }
.retro-screen svg path:first-child { fill: #eee4d2; stroke: #15201d; stroke-width: 2; }
.retro-screen svg path:last-child { fill: #baad93; stroke: #15201d; stroke-width: 2; }
.retro-screen strong { position: relative; z-index: 3; display: block; color: #fff6c8; font-family: var(--mono); font-size: clamp(1rem, 2vw, 1.65rem); line-height: 1.15; text-shadow: 3px 3px 0 #153458; }

footer { padding: 50px clamp(20px, 5vw, 76px) 56px; border-top: 1px solid var(--line); }
footer { display: grid; grid-template-columns: minmax(190px, .7fr) minmax(280px, 1.3fr) minmax(220px, 1fr); align-items: start; gap: 6vw; }
footer p { margin: 4px 0 0; color: var(--muted); font-size: .7rem; line-height: 1.7; }
footer p a { color: var(--teal); }
.safety-note { padding-left: 17px; border-left: 3px solid var(--orange); }

.classic-dialog {
  width: min(1200px, calc(100% - 28px));
  height: min(850px, calc(100% - 28px));
  max-width: none;
  max-height: none;
  padding: 0;
  color: var(--ink);
  border: 1px solid var(--ink);
  border-radius: .9rem;
  background: var(--paper);
  box-shadow: 0 30px 90px rgba(0,0,0,.35);
  overflow: hidden;
}

.classic-dialog::backdrop { background: rgba(12,27,24,.76); backdrop-filter: blur(4px); }
.dialog-shell { display: flex; height: 100%; flex-direction: column; }
.classic-dialog header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 17px 20px; border-bottom: 1px solid var(--line); }
.classic-dialog .eyebrow { margin-bottom: 5px; font-size: .55rem; }
.classic-dialog h2 { font-size: 1.35rem; }
.dialog-close { display: grid; width: 42px; height: 42px; flex: none; place-items: center; border: 1px solid var(--ink); border-radius: 50%; background: var(--white); font-size: 1.45rem; }
.dialog-close:hover { background: var(--orange); }
.classic-help { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 9px 20px; background: #e6ddca; font-size: .68rem; }
.classic-help p { margin: 0; }
.classic-help a { flex: none; color: var(--teal); font-weight: 700; }
.emulator-frame { position: relative; flex: 1; min-height: 0; background: #111; }
.emulator-frame iframe { display: block; width: 100%; height: 100%; border: 0; }
.emulator-placeholder { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; color: #eee; font-family: var(--mono); font-size: .7rem; }
.spinner { width: 34px; height: 34px; border: 3px solid #444; border-top-color: var(--orange); border-radius: 50%; animation: spin 800ms linear infinite; }
@keyframes spin { to { transform: rotate(1turn); } }

@media (max-width: 1120px) {
  .hero { grid-template-columns: .95fr 1.05fr; padding-left: 6vw; padding-right: 6vw; }
  .plane-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filter-panel { grid-template-columns: 1fr 190px auto; }
}

@media (max-width: 820px) {
  .site-header { min-height: 66px; padding-inline: 18px; }
  .brand-mark { width: 40px; height: 40px; }
  .brand small, nav a, nav .text-button { display: none; }
  .hero { min-height: auto; grid-template-columns: 1fr; padding-top: 70px; }
  .hero-art { min-height: 350px; order: -1; }
  .hero-plane { width: min(90vw, 570px); left: 5%; }
  .hero-copy { text-align: center; }
  .hero-deck { margin-inline: auto; }
  .hero-actions { justify-content: center; }
  .section-heading { align-items: start; flex-direction: column; }
  .plane-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: 1fr; }
  .steps li, .steps li + li { padding: 24px 0; border-left: 0; }
  .classic-callout { grid-template-columns: 1fr; margin-inline: 20px; }
  .retro-window { max-width: 520px; }
  footer { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 600px) {
  html { scroll-padding-top: 68px; }
  h1 { font-size: clamp(3.5rem, 18vw, 5.2rem); }
  .hero { padding-inline: 20px; }
  .hero-art { min-height: 270px; }
  .art-label { font-size: .52rem; }
  .label-one { bottom: 12%; }
  .label-three { bottom: 3%; }
  .hero-actions { flex-direction: column; }
  .button { width: 100%; }
  .filter-panel { grid-template-columns: 1fr; }
  .search-field { grid-column: 1 / -1; }
  .favorite-filter { justify-self: stretch; grid-column: 1 / -1; }
  .plane-grid { gap: 10px; }
  .card-art { min-height: 155px; }
  .preview-link { padding: 17px 8px; }
  .card-plane-preview { width: 92%; }
  .card-body { padding: 13px 12px; }
  .card-title-row { align-items: start; flex-direction: column; gap: 4px; }
  .card-title-row h3 { width: 100%; font-size: .94rem; }
  .print-link { margin-top: 11px; padding-top: 10px; font-size: .65rem; }
  .print-link span { display: none; }
  .category-badge { font-size: .48rem; }
  .classic-callout { margin-inline: 12px; padding: 27px 20px 34px; border-radius: .8rem; }
  .retro-screen { min-height: 200px; padding: 25px; }
  footer { grid-template-columns: 1fr; }
  .footer-brand { grid-column: auto; }
  .classic-dialog { width: 100%; height: 100%; border: 0; border-radius: 0; }
  .classic-help { align-items: start; flex-direction: column; gap: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media print {
  .site-header, .hero, .filter-panel, .how-it-works, .classic-callout, footer { display: none; }
  .catalog-section { padding: 0; }
}
