:root {
  --ink: #0b0d09;
  --panel: #13160f;
  --panel-2: #1a1e14;
  --line: #2a2e22;
  --paper: #ecebe2;
  --muted: #9b9d8d;
  --amber: #dc8a26;
  --amber-deep: #b56a17;
  --ok: #9dbb62;
  --bad: #e5593c;

  --heli-fill: url(#skin);
  --heli-line: #6a6f58;
  --heli-glass: url(#glass);

  --display: "Michroma", "Eurostile", "Arial Black", sans-serif;
  --body: "Hanken Grotesk", system-ui, sans-serif;

  --gutter: clamp(20px, 5vw, 72px);
  --max: 1280px;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font: 400 1rem/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 400;
  margin: 0;
  text-wrap: balance;
}

h1 { font-size: clamp(1.7rem, 3.5vw, 3.1rem); line-height: 1.22; }
h2 { font-size: clamp(1.3rem, 2.3vw, 2rem); line-height: 1.3; }
h3 { font-size: clamp(1.05rem, 1.5vw, 1.3rem); line-height: 1.35; }

p { margin: 0; }

.nowrap { white-space: nowrap; }

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  padding: .6em 1.25em;
  border-radius: 999px;
  border: 1px solid transparent;
  font: 500 .9rem/1.2 var(--body);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn--amber { background: var(--amber); color: #1a1205; }
.btn--amber:hover { background: #eea03f; }
.btn--light { background: var(--paper); color: var(--ink); }
.btn--light:hover { background: #fff; }
.btn--ghost { border-color: #4a4e3f; color: var(--paper); }
.btn--ghost:hover { border-color: var(--paper); }

/* Nav */

.nav {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 18px var(--gutter);
  border-bottom: 1px solid var(--line);
}
.nav__links { display: flex; gap: clamp(16px, 3vw, 40px); }
.nav__links a {
  font-size: .9rem;
  color: var(--muted);
  text-decoration: none;
}
.nav__links a:hover { color: var(--paper); }
.nav__actions { display: flex; justify-content: flex-end; }

.wordmark {
  font-family: var(--display);
  font-size: 1.05rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  text-decoration: none;
}

/* Hero */

.hero {
  position: relative;
  min-height: min(100svh, 980px);
  padding: clamp(120px, 17vh, 190px) var(--gutter) 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(60% 34% at 62% 100%, rgba(220, 138, 38, .2), transparent 70%),
    linear-gradient(to bottom, var(--ink) 55%, #12140d 100%);
}

.hero__copy {
  position: relative;
  z-index: 2;
  max-width: 40rem;
}
.hero__copy p {
  margin-top: 1.4rem;
  max-width: 30rem;
  color: var(--muted);
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 2rem;
}

.hero__stage {
  margin-top: auto;
  width: min(100%, 1320px);
  margin-left: auto;
  /* the top of the drawing is empty sky on the left, so it can tuck up under the copy */
  margin-top: max(-7%, -110px);
  padding-top: 1rem;
}
#heli { width: 100%; height: auto; overflow: visible; }

.beacon {
  fill: #ff4a2e;
  filter: drop-shadow(0 0 6px #ff4a2e);
  animation: beacon 1.6s steps(1) infinite;
}
@keyframes beacon {
  0%, 12% { opacity: 1; }
  12.01%, 100% { opacity: 0; }
}

/* Sections */

.section {
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin: 0 auto;
  padding: clamp(72px, 11vw, 150px) var(--gutter) 0;
}

.section__head {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 24px clamp(32px, 8vw, 140px);
  align-items: end;
  margin-bottom: clamp(32px, 5vw, 64px);
}
.section__head p { color: var(--muted); max-width: 26rem; justify-self: end; }

/* Calculator cards */

.calcs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.calc {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px;
}
.calc__photo {
  margin: 0;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 16 / 10;
}
.calc__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) sepia(.4) saturate(1.3) brightness(.82) contrast(1.08);
}
/* tall photos: keep the aircraft in the frame */
.calc__photo .photo--longline { object-position: 50% 26%; }
.calc__photo .photo--bucket { object-position: 50% 57%; }
.calc__body { padding: 26px 14px 18px; }
.calc__body p { margin-top: .8rem; color: var(--muted); max-width: 30rem; }

/* Chart sequence */

.steps {
  margin-top: 20px;
  padding: clamp(24px, 3.5vw, 44px);
  border: 1px solid var(--line);
  border-radius: 18px;
}
.steps h3 { max-width: 34rem; }
.steps ol {
  list-style: none;
  counter-reset: step;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  margin: 32px 0 0;
  padding: 0;
}
.steps li {
  counter-increment: step;
  padding-top: 16px;
  border-top: 1px solid var(--amber);
  color: var(--muted);
  font-size: .95rem;
}
.steps li::before {
  content: counter(step);
  display: block;
  margin-bottom: 10px;
  font-family: var(--display);
  color: var(--amber);
}
.steps li strong { display: block; color: var(--paper); font-weight: 500; margin-bottom: 4px; }

/* Preview */

.demo {
  display: grid;
  grid-template-columns: minmax(240px, 340px) minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  overflow: hidden;
}

.demo__inputs {
  padding: clamp(20px, 3vw, 36px);
  background: var(--panel-2);
  border-right: 1px solid var(--line);
  display: grid;
  gap: 28px;
  align-content: start;
}
.demo__inputs fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 18px; }
.demo__inputs legend {
  padding: 0;
  margin-bottom: 14px;
  font-family: var(--display);
  font-size: .85rem;
}
.demo__inputs label { display: grid; gap: 8px; font-size: .9rem; color: var(--muted); }
.demo__inputs label span { display: flex; justify-content: space-between; gap: 12px; }
.demo__inputs output { color: var(--paper); font-variant-numeric: tabular-nums; }

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 24px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: #3a3f30; }
input[type="range"]::-moz-range-track { height: 4px; border-radius: 2px; background: #3a3f30; }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  margin-top: -7px;
  border-radius: 50%;
  background: var(--amber);
  border: 3px solid var(--panel-2);
  box-shadow: 0 0 0 1px var(--amber);
}
input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--amber);
  border: 3px solid var(--panel-2);
  box-shadow: 0 0 0 1px var(--amber);
}

.demo__out {
  padding: clamp(20px, 3vw, 36px);
  display: grid;
  gap: 26px;
  min-width: 0;
}

.demo__craft {
  width: 100%;
  height: auto;
  --heli-fill: #1b1f15;
  --heli-line: #565b47;
  --heli-glass: #0f110c;
}
.loads circle {
  fill: rgba(220, 138, 38, .28);
  stroke: var(--amber);
  stroke-width: 1.5;
  transition: r .2s ease-out;
}
#cg-mark { transition: transform .25s ease-out; color: var(--ok); }
#cg-mark.is-out { color: var(--bad); }
#cg-mark line { stroke: currentColor; stroke-width: 2; stroke-dasharray: 5 5; }
#cg-mark path { fill: currentColor; }

.gauge__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  font-size: .9rem;
  color: var(--muted);
}
.gauge__row strong,
.readouts dd:not(.note) {
  font-family: var(--display);
  font-weight: 400;
  color: var(--paper);
  font-variant-numeric: tabular-nums;
}
/* Michroma's percent sign reads poorly at this size */
#r-tq { font-family: var(--body); font-weight: 600; }
.gauge__track {
  position: relative;
  height: 12px;
  margin-top: 10px;
  border-radius: 6px;
  background: #24281c;
  overflow: hidden;
}
.gauge__track--cg { overflow: visible; }
.gauge__band {
  position: absolute;
  inset: 0 25%;
  background: rgba(157, 187, 98, .28);
  border-inline: 1px solid var(--ok);
}
.gauge__pin {
  position: absolute;
  top: -5px; bottom: -5px;
  width: 4px;
  margin-left: -2px;
  border-radius: 2px;
  background: var(--ok);
  transition: left .25s ease-out, background-color .2s;
}
.gauge__pin.is-out { background: var(--bad); }
.gauge__fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 6px;
  transition: width .25s ease-out, background-color .2s;
}
.gauge__fill--avail { background: #4c5140; }
.gauge__fill--req { background: var(--amber); }
.gauge__fill--req.is-out { background: var(--bad); }
.gauge__scale {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: .8rem;
  color: var(--muted);
}
.gauge__track--cg + .gauge__scale { padding: 0 25%; }
.gauge__track--cg + .gauge__scale span:first-child { transform: translateX(-50%); }
.gauge__track--cg + .gauge__scale span:last-child { transform: translateX(50%); }

.readouts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin: 0;
  padding: 22px 0;
  border-block: 1px solid var(--line);
}
.readouts dt { font-size: .9rem; color: var(--muted); }
.readouts dd { margin: 6px 0 0; font-size: clamp(1.1rem, 2vw, 1.5rem); }
.readouts dd.note { font-size: .8rem; color: var(--muted); }
.readouts dd.note.is-out { color: var(--bad); }

.verdict {
  padding: 14px 18px;
  border-radius: 10px;
  background: rgba(157, 187, 98, .12);
  color: var(--ok);
  font-weight: 500;
}
.verdict.is-out { background: rgba(229, 89, 60, .12); color: var(--bad); }

/* Aircraft */

.drawing {
  margin: 0;
  padding: clamp(16px, 3vw, 40px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
}
.drawing {
  /* drafting grid */
  background-image:
    linear-gradient(rgba(236, 235, 226, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(236, 235, 226, .035) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: center;
}
.blueprint {
  width: 100%;
  height: auto;
  --heli-fill: #171a12;
  --heli-line: #a9ad96;
  --heli-glass: #0d0f0a;
}
.bp-line { fill: #171a12; stroke: #a9ad96; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.bp-detail { fill: #0d0f0a; stroke: #a9ad96; stroke-width: 1.4; stroke-linejoin: round; opacity: .8; }
.bp-blade { fill: #23271b; stroke: #a9ad96; stroke-width: 1.3; }
.bp-hub { fill: #171a12; stroke: #a9ad96; stroke-width: 1.3; }
.bp-disc { fill: none; stroke: #a9ad96; stroke-width: 1; stroke-dasharray: 3 7; opacity: .5; }
.bp-ground { stroke: #4a4e3f; stroke-width: 1; }
.bp-rotor { animation: bp-spin 24s linear infinite; }
@keyframes bp-spin { to { transform: rotate(360deg); } }
.bp-dim path { fill: none; stroke: var(--amber); stroke-width: 1.2; }
.bp-dim .bp-ext { stroke-dasharray: 2 5; opacity: .55; }
.bp-dim text, .bp-view text { font: 400 17px var(--body); fill: var(--muted); }
.bp-dim .val { fill: var(--paper); font-weight: 600; }
.bp-view text { font-family: var(--display); font-size: 14px; }

.specs {
  display: none;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 28px 0 0;
}
.specs div { padding: 4px 24px 4px 0; }
.specs div + div { padding-left: 24px; border-left: 1px solid var(--line); }
.specs dt { font-size: .9rem; color: var(--muted); }
.specs dd { margin: 8px 0 0; font-family: var(--display); font-size: clamp(.95rem, 1.5vw, 1.25rem); }

/* Call to action */

.cta {
  position: relative;
  margin-top: clamp(72px, 11vw, 150px);
  min-height: clamp(320px, 42vw, 520px);
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--amber-deep);
}
.cta img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 30% 62%;
  filter: grayscale(1) contrast(1.15);
  mix-blend-mode: multiply;
  opacity: .9;
}
.cta__inner {
  position: relative;
  /* the aircraft sits in the left half of the photo, so the copy takes the right */
  justify-self: end;
  width: min(100%, 34rem);
  margin-right: clamp(0px, 6vw, 110px);
  padding: 48px var(--gutter);
  display: grid;
  justify-items: start;
  gap: 28px;
}
.cta h2 { font-size: clamp(1.4rem, 3vw, 2.4rem); text-shadow: 0 2px 24px rgba(0, 0, 0, .55); }

/* Footer */

.footer {
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 56px var(--gutter) 40px;
  color: var(--muted);
  font-size: .85rem;
}
.footer__top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding-bottom: 28px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--line);
  color: var(--paper);
}
.footer nav { display: flex; flex-wrap: wrap; gap: 12px 28px; }
.footer nav a { text-decoration: none; color: var(--muted); font-size: .9rem; }
.footer nav a:hover { color: var(--paper); }
.footer p { max-width: 68ch; }
.footer p + p { margin-top: .8rem; }

/* Small screens */

@media (max-width: 860px) {
  .nav { grid-template-columns: auto 1fr; }
  .nav__links { display: none; }
  .nav .wordmark { grid-column: 1; }

  .hero { min-height: 0; padding-top: 120px; }
  .hero__stage { width: 124%; margin: 24px 0 0 -12%; }

  .section__head { grid-template-columns: 1fr; }
  .section__head p { justify-self: start; }
  .calcs { grid-template-columns: 1fr; }
  .cta { place-items: end start; }
  .cta__inner { justify-self: start; margin-right: 0; padding-block: 32px; }
  .cta img { object-position: 38% 62%; }
  .steps ol { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .demo { grid-template-columns: 1fr; }
  .demo__inputs { border-right: 0; border-bottom: 1px solid var(--line); }
  /* labels in the drawing are too small to read here, so the list takes over */
  .bp-dim text, .bp-view text { display: none; }
  .specs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 24px; }
  .specs div:nth-child(odd) { padding-left: 0; border-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .beacon, .bp-rotor { animation: none; }
  * { transition-duration: 0s !important; }
}
