/* aero.mierzwa.net
 *
 * The palette, spacing grid and card chrome are lifted from the app's design
 * system (Aero/DesignSystem/Theme.swift + Components.swift) so the site and
 * the App Store screenshots read as one product. Where a value here looks
 * arbitrary it almost certainly is not: check Theme.swift before changing it.
 *
 * Typography is the app's too. Aero sets its headlines in the system sans with
 * one italic-serif accent word (AccentHeadline) and its small labels in
 * monospace (Eyebrow), so the page uses the same three roles from the system
 * stack. That also means no web font is fetched: nothing to self-host, nothing
 * loaded from a third-party CDN, and no layout shift while a face downloads.
 */

:root {
  /* Sky background, morning variant (Components.swift SkyBackground). */
  --paper-1: #faf2e6;
  --paper-2: #f5e6db;

  /* Ink ramp: warm near-black down to soft grey. */
  --ink: #211e1c;
  --ink-soft: #5c5752;
  --ink-light: #8c8782;

  /* Accent: paper-coral with its gold partner for the primary gradient. */
  --coral: #f05c57;
  --gold: #f5a84d;

  /* Difficulty tints, from the app's category accents. */
  --easy: #5c9e78;
  --medium: #6b8aa8;
  --hard: #b870a8;

  --rule: rgba(0, 0, 0, 0.08);
  --glass: rgba(255, 255, 255, 0.35);
  --glass-edge: rgba(255, 255, 255, 0.6);
  --card-shadow: rgba(0, 0, 0, 0.12);

  /* The 4pt spacing grid (Theme.Space). */
  --s-xs: 4px;
  --s-sm: 8px;
  --s-md: 12px;
  --s-lg: 16px;
  --s-xl: 20px;
  --s-2xl: 24px;
  --s-3xl: 32px;
  /* One screen margin app-wide. */
  --screen: 20px;

  /* Corner radii (Theme.Radius): nested surfaces step down the scale. */
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 20px;
  --r-xl: 24px;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --col: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: linear-gradient(180deg, var(--paper-1) 0%, var(--paper-2) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 { margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }

a { color: var(--coral); }

:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: 3px;
  border-radius: var(--s-xs);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: var(--s-sm);
  background: var(--ink);
  color: #fff;
  padding: var(--s-sm) var(--s-lg);
  border-radius: var(--r-sm);
  z-index: 100;
}
.skip-link:focus { left: var(--s-sm); }

.wrap {
  width: 100%;
  max-width: var(--col);
  margin: 0 auto;
  padding: 0 var(--screen);
}

/* ---------------------------------------------------------------- the sky */

/* The signature: paper planes actually gliding, with lift, drag and gravity,
 * blown around by the cursor. Fixed behind everything and never interactive.
 * sky.js freezes it under prefers-reduced-motion. */
#sky {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.page { position: relative; z-index: 1; }

/* --------------------------------------------------------------- surfaces */

/* GlassCard: ultra-thin material, white tint, hairline, soft shadow. */
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  backdrop-filter: blur(20px) saturate(140%);
  border: 0.5px solid var(--glass-edge);
  box-shadow: 0 4px 8px var(--card-shadow);
  border-radius: var(--r-xl);
}

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--coral);
}

/* ----------------------------------------------------------------- header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(250, 242, 230, 0.72);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid var(--rule);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: var(--s-lg);
  height: 60px;
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--s-sm);
  font-weight: 700;
  font-size: 18px;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.brand img { width: 30px; height: auto; display: block; }

.site-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--s-2xl);
  font-size: 15px;
  font-weight: 500;
}
.site-nav a { color: var(--ink-soft); text-decoration: none; }
.site-nav a:hover { color: var(--ink); }

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-sm);
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  padding: var(--s-lg) var(--s-2xl);
  border-radius: var(--r-md);
  border: none;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}
.btn:active { transform: translateY(1px); }

/* The signature coral to gold gradient (Theme.primaryGradient). */
.btn--primary {
  background: linear-gradient(135deg, var(--coral), var(--gold));
  color: #fff;
  box-shadow: 0 6px 18px rgba(240, 92, 87, 0.3);
}
.btn--primary:hover { box-shadow: 0 8px 24px rgba(240, 92, 87, 0.38); }

.btn--ghost {
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 0.5px solid var(--glass-edge);
  color: var(--ink);
}
.btn--ghost:hover { background: rgba(255, 255, 255, 0.55); }

.btn--sm { font-size: 14px; padding: var(--s-md) var(--s-lg); border-radius: var(--r-sm); }

.btn__icon { width: 17px; height: 17px; flex: none; }

/* ------------------------------------------------------------------- hero */

.hero {
  position: relative;
  padding: clamp(56px, 11vw, 128px) 0 clamp(40px, 7vw, 80px);
  text-align: center;
}

/* Haze: the planes fly behind the headline, and a pale plane crossing a line
 * of body copy is the one place the background costs more than it gives. A
 * soft wash of the page's own paper tone lifts the text off without reading
 * as a panel. */
.hero::before {
  content: "";
  position: absolute;
  inset: -6% -10%;
  background: radial-gradient(
    52% 40% at 50% 44%,
    rgba(252, 246, 237, 0.62) 0%,
    rgba(252, 246, 237, 0.4) 45%,
    rgba(252, 246, 237, 0) 74%
  );
  pointer-events: none;
  z-index: -1;
}

.hero h1 {
  font-size: clamp(44px, 8.5vw, 92px);
  font-weight: 700;
  line-height: 1.02;
  margin-bottom: var(--s-2xl);
}
/* AccentHeadline: bold sans wrapping one italic-serif word. */
.hero h1 em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.hero__sub {
  font-size: clamp(17px, 2.1vw, 21px);
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 30em;
  margin: 0 auto var(--s-3xl);
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-md);
  justify-content: center;
}

.hero__note {
  margin-top: var(--s-xl);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.4px;
  color: var(--ink-light);
}

/* --------------------------------------------------------------- sections */

.section { padding: clamp(48px, 8vw, 96px) 0; }

/* The measure belongs on the text, NOT on this box. Section heads carry
 * `.wrap` too, and `.wrap` centres with `margin: 0 auto`: putting a narrow
 * max-width here made those auto margins centre the head while the grids and
 * buttons below it stayed at the column's left edge. */
.section__head {
  margin-bottom: var(--s-3xl);
}
.section__head h2 {
  font-size: clamp(30px, 4.4vw, 44px);
  font-weight: 700;
  line-height: 1.1;
  margin: var(--s-md) 0 var(--s-md);
  max-width: 14em;
}
.section__head h2 em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
}
.section__head p {
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 34em;
}

/* -------------------------------------------------------------- the cards */

/* One card per plane, built like the app's quick look: a difficulty-tinted
 * art panel with the poster floating on it, then the name, the stats and the
 * call to action. */
.hangar { position: relative; }

.carousel {
  display: flex;
  gap: var(--s-xl);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  /* Half a viewport of padding either side so the first and last card can
   * still reach the middle of the track. */
  padding: var(--s-lg) calc(50% - 190px) var(--s-3xl);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.carousel::-webkit-scrollbar { display: none; }

.card {
  flex: 0 0 380px;
  scroll-snap-align: center;
  border-radius: var(--r-xl);
  overflow: hidden;
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  backdrop-filter: blur(20px) saturate(140%);
  border: 0.5px solid var(--glass-edge);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.14);
  /* hangar.js writes --dist (0 at centre, 1 at the edges) on every frame of
   * the scroll, so neighbouring cards fall back continuously rather than
   * snapping between two states. */
  --dist: 1;
  transform: scale(calc(1 - 0.07 * var(--dist)));
  /* Only a light fall-off: a neighbouring card is the next thing you are
   * meant to reach for, so it must not read as disabled. */
  opacity: calc(1 - 0.22 * var(--dist));
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.5s ease;
}

.card__art {
  position: relative;
  height: 208px;
  overflow: hidden;
  /* PlaneArtBackdrop: the difficulty tint, top-leading to bottom-trailing. */
  background: linear-gradient(135deg, var(--tint-strong), var(--tint-soft));
}
.card[data-difficulty="easy"] { --tint: var(--easy); }
.card[data-difficulty="medium"] { --tint: var(--medium); }
.card[data-difficulty="hard"] { --tint: var(--hard); }
.card__art {
  --tint-strong: color-mix(in srgb, var(--tint) 28%, transparent);
  --tint-soft: color-mix(in srgb, var(--tint) 10%, transparent);
}

.card__art img {
  position: absolute;
  inset: var(--s-md);
  margin: auto;
  max-width: calc(100% - var(--s-2xl));
  max-height: calc(100% - var(--s-2xl));
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.18));
}

/* "Takeoff": the poster flies in over the card's top edge, banked and low,
 * levels off as it settles, then breathes on the spot. Ported from
 * PlaneQuickLook.swift, which picked it over a lightbox zoom and a paper
 * unfold in a three-way bake-off. Only the centred card flies. */
.card.is-active .card__art img {
  animation: takeoff 0.62s cubic-bezier(0.2, 1.5, 0.4, 1) both,
             breathe 2.6s ease-in-out 0.7s infinite alternate;
}

@keyframes takeoff {
  from { transform: translate(70px, 40px) rotate(16deg) scale(0.6); }
  to { transform: translate(0, 0) rotate(0deg) scale(1); }
}

@keyframes breathe {
  from { transform: translateY(2px) rotate(1.5deg); }
  to { transform: translateY(-6px) rotate(-1.5deg); }
}

.card__body { padding: var(--s-lg); }

.card__name {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.4px;
  margin: var(--s-xs) 0 0;
}

.card__desc {
  margin-top: var(--s-sm);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-soft);
  /* Two lines for every card, so the stat row lines up across the track. */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 42px;
}

.card__stats {
  display: flex;
  margin: var(--s-lg) 0;
}
.stat { flex: 1; text-align: center; }
.stat__label {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--ink-light);
  display: block;
  margin-bottom: var(--s-xs);
}
.stat__value { font-size: 15px; font-weight: 600; }

.dots { display: flex; gap: var(--s-xs); justify-content: center; height: 18px; align-items: center; }
.dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink-light);
  opacity: 0.28;
}
.dots i.on { background: var(--tint); opacity: 1; }

.card__actions { display: flex; flex-direction: column; gap: var(--s-sm); }
.card__actions .btn { width: 100%; }

/* Carousel controls */
.carousel-nav {
  display: flex;
  gap: var(--s-sm);
  justify-content: center;
  align-items: center;
  margin-top: var(--s-sm);
}
.carousel-nav button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0.5px solid var(--glass-edge);
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  color: var(--ink);
  font-size: 17px;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 3px 6px var(--card-shadow);
}
.carousel-nav button:hover { background: rgba(255, 255, 255, 0.55); }
.carousel-nav button[disabled] { opacity: 0.35; cursor: default; }

.carousel-dots { display: flex; gap: var(--s-sm); margin: 0 var(--s-md); }
.carousel-dots button {
  width: 7px;
  height: 7px;
  padding: 0;
  border-radius: 50%;
  border: none;
  background: var(--ink);
  opacity: 0.2;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.carousel-dots button[aria-current="true"] { opacity: 1; background: var(--coral); transform: scale(1.4); }

/* ------------------------------------------------------------ the folder */

/* No preview panel here on purpose. A screenshot of the editor was tried and
 * dropped: coplanar facets z-fight in a still, which made a working tool look
 * broken. The copy above describes it and the button goes there. */
.folder__cta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s-lg);
}

.folder__hint {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-light);
}

/* ---------------------------------------------------------------- how/faq */

.steps {
  display: grid;
  gap: var(--s-2xl);
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.step__num {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--coral);
}
.step h3 { font-size: 19px; font-weight: 600; margin: var(--s-sm) 0 var(--s-sm); }
.step p { color: var(--ink-soft); font-size: 15px; line-height: 1.55; }

/* Same reason as .section__head: .faq carries .wrap, so a max-width here would
 * let .wrap's auto margins centre the list away from everything else. The
 * measure goes on the text, and the dividers run the full column. */
.faq__item {
  border-bottom: 1px solid var(--rule);
  padding: var(--s-xl) 0;
}
.faq__item summary {
  cursor: pointer;
  font-size: 18px;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: var(--s-lg);
  align-items: baseline;
  max-width: 46em;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after {
  content: "+";
  font-family: var(--mono);
  font-weight: 400;
  color: var(--coral);
  font-size: 20px;
  flex: none;
}
.faq__item[open] summary::after { content: "\2212"; }
.faq__answer { padding-top: var(--s-md); max-width: 44em; }
.faq__answer p { color: var(--ink-soft); font-size: 16px; line-height: 1.6; margin-top: var(--s-md); }
.faq__answer p:first-child { margin-top: 0; }

/* ------------------------------------------------------------- closing cta */

.closing {
  text-align: center;
  padding: clamp(40px, 6vw, 64px) var(--screen);
  border-radius: var(--r-xl);
}
.closing h2 { font-size: clamp(28px, 4vw, 40px); font-weight: 700; margin-bottom: var(--s-md); }
.closing h2 em { font-family: var(--serif); font-style: italic; font-weight: 400; }
.closing p { color: var(--ink-soft); margin-bottom: var(--s-2xl); font-size: 17px; }

/* -------------------------------------------------------- legal documents */

.doc {
  max-width: 46em;
  margin: 0 auto;
  padding: clamp(32px, 6vw, 64px) var(--screen) clamp(24px, 5vw, 48px);
}
.doc h1 { font-size: clamp(30px, 5vw, 42px); font-weight: 700; margin-bottom: var(--s-sm); }
.doc h2 {
  font-size: 20px;
  font-weight: 600;
  margin: var(--s-3xl) 0 var(--s-md);
}
.doc__meta { color: var(--ink-light); font-size: 14px; margin-bottom: var(--s-2xl); }
.doc p, .doc li { font-size: 16px; line-height: 1.65; color: var(--ink-soft); }
.doc p { margin: 0 0 var(--s-lg); }
.doc ul { margin: 0 0 var(--s-lg); padding-left: var(--s-2xl); }
.doc li { margin-bottom: var(--s-sm); }
.doc strong { color: var(--ink); font-weight: 600; }
.doc address { font-style: normal; font-size: 16px; line-height: 1.7; color: var(--ink-soft); }
.doc a { text-decoration: underline; text-underline-offset: 2px; }

.callout {
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 0.5px solid var(--glass-edge);
  border-left: 3px solid var(--coral);
  border-radius: var(--r-md);
  padding: var(--s-xl);
  margin: 0 0 var(--s-2xl);
}
.callout p:last-child { margin-bottom: 0; }

.lang-switch {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.4px;
  color: var(--ink-light);
  margin-bottom: var(--s-2xl);
  display: flex;
  gap: var(--s-md);
}
.lang-switch [aria-current] { color: var(--ink); }

/* ----------------------------------------------------------------- footer */

.site-footer {
  border-top: 1px solid var(--rule);
  margin-top: clamp(48px, 8vw, 96px);
  padding: var(--s-3xl) 0;
  font-size: 14px;
}
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-lg);
}
.site-footer a { color: var(--ink-soft); text-decoration: none; }
.site-footer a:hover { color: var(--ink); text-decoration: underline; }
.site-footer__copy { color: var(--ink-light); margin-right: auto; }
.site-footer__legal {
  margin-top: var(--s-lg);
  color: var(--ink-light);
  font-size: 13px;
  line-height: 1.5;
}

/* ------------------------------------------------------------- responsive */

@media (max-width: 760px) {
  .site-nav { gap: var(--s-lg); }
  .site-nav .nav-hide { display: none; }
  .carousel { padding-left: var(--screen); padding-right: var(--screen); gap: var(--s-lg); }
  .card { flex-basis: min(340px, 84vw); }
  .folder__cta .btn { width: 100%; }
}

@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;
  }
  .card { transform: none; opacity: 1; }
}
