/* Stamper — a vinyl pressing plant, over molten red-black metal.

   This plate is the most hostile one in the repo. Measured per pixel across the
   whole loop it covers the full 0.000 to 1.000 relative luminance range, and
   the highlights travel: the median pixel is blown past 0.55 at some point in
   the eight seconds. Over a copy-sized block the best any colour manages on the
   bare picture is 1.22:1 — paper, ink, warm or cold, it makes no difference,
   because sooner or later a specular ribbon rolls through and takes that patch
   to white.

   So this is the one hero here that needs a scrim, and the only question was
   how much. The first pass put it at 85-90% ink, which would have killed the
   clip — that was wrong, because it blended in linear light and CSS composites
   in sRGB. Done properly it is 74%, which puts paper at 8.14:1 over the copy
   against the worst frame the loop ever produces. That is well past AA on
   purpose. 66% cleared the standard at 5.96:1, but a number computed against a
   worst-case pixel flatters light strokes on a backdrop this busy: the ribbons
   move behind the letters, and type that merely passes still has to be hunted
   for. The extra 8% is what makes it simply readable.

   The scrim is an ellipse around the centred copy rather than a wash over the
   whole frame, so everything outside it stays at full strength — 41% of the
   picture here. How much that is depends on how big the type is set, which is
   the real cost of the headline size. */

/* What the scrim does not rescue is the plate's own red. #D35853 over the same
   scrimmed area is 1.72:1, so it is never type here — it is the button fill and
   the record in the mark, and that is all. The headline is paper. */

:root {
  --ink:    #0A0507;    /* the plate's black, taken a little further down */
  --ink-2:  #190D11;
  --ember:  #D35853;    /* the mean of the plate's lit pixels */
  --hot:    #F5746B;    /* the mean of its hot specular, 5.9% of the frame */
  --paper:  #F4EFEA;

  --rule: rgba(244, 239, 234, .22);

  /* One face, at four sizes. Picked for its x-height and its open counters
     rather than its character: over a plate that is moving behind every letter,
     how much of the glyph is actually ink is what decides whether it reads. */
  --sans: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --gutter: clamp(1.25rem, 4vw, 4rem);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
}

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

/* ---------- stage ---------- */

.hero {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr;
  padding: clamp(1.1rem, 2.4vw, 1.9rem) var(--gutter) clamp(2rem, 6vh, 4rem);
  overflow: hidden;
}

.hero__media {
  position: absolute;
  inset: 0;
  z-index: -2;
  background: var(--ink);
}

.hero__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* One flat ink layer at 74%, masked to an ellipse around the copy. The radii
   and the 80% plateau are set so the whole copy block sits inside the solid
   part rather than in the falloff — a gradient that only reaches full strength
   at the frame edge leaves the top of the block barely covered, which is what
   a first attempt here did and measured 1.3:1 for. */

.hero__scrim {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--ink);
  opacity: .74;
  pointer-events: none;

  -webkit-mask-image: radial-gradient(ellipse 52% 38% at 50% 50%, #000 0 80%, transparent 100%);
  mask-image: radial-gradient(ellipse 52% 38% at 50% 50%, #000 0 80%, transparent 100%);
}

/* ---------- topbar ---------- */

/* The masthead is out in the open picture, where nothing is legible, so both
   ends of it ride on their own fill. Same 74% ink as the scrim, with a blur
   behind it — a blur can only pull the extremes toward the local mean, so it
   can only improve on what the flat fill already measures. */

.glass {
  background: rgba(10, 5, 7, .74);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--rule);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: rgba(10, 5, 7, .88); }
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .4rem .95rem .4rem .45rem;
  border-radius: 999px;
  color: var(--paper);
  text-decoration: none;
    font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -.02em;
  line-height: 1;
}

.brand__mark { width: 26px; height: 26px; flex: none; }

.nav {
  display: flex;
  align-items: center;
  gap: .15rem;
  padding: .28rem;
  border-radius: 999px;
}

.nav a {
  padding: .5rem .85rem;
  border-radius: 999px;
  color: var(--paper);
  text-decoration: none;
  font-size: .82rem;
  font-weight: 400;
}

.nav a:not(.nav__cta):hover { background: var(--ink-2); color: var(--hot); }

/* Matched to `.nav a` on specificity, not below it: the rule above sets the
   link colour, and a plain `.nav__cta` loses to it. */
.nav a.nav__cta {
  background: var(--ember);
  color: var(--ink);
  font-weight: 500;
}

.nav a.nav__cta:hover { background: var(--hot); color: var(--ink); }

.burger {
  display: none;
  width: 42px; height: 42px;
  padding: 0;
  border-radius: 999px;
  cursor: pointer;
}

.burger span {
  display: block;
  width: 16px; height: 1.5px;
  margin: 3px auto;
  background: var(--paper);
}

/* ---------- copy ---------- */

.hero__copy {
  place-self: center;
  max-width: 50rem;
  text-align: center;
}

.title {
  margin: 0;
  font-size: clamp(2.8rem, 6.5vw, 5.2rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.035em;
}

/* The second line separates itself by weight and a little transparency, not by
   hue: the plate's red over the scrim measures 1.72:1 and cannot be type
   anywhere on this page. */
.title em {
  font-style: normal;
  font-weight: 500;
  color: rgba(244, 239, 234, .88);
}

.lede {
  margin: 1.25rem auto 0;
  max-width: 27rem;
  font-size: clamp(1rem, 1.2vw, 1.15rem);
  line-height: 1.5;
  color: rgba(244, 239, 234, .86);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  margin-top: 1.9rem;
  padding: .85rem 1.6rem;
  border-radius: 999px;
  background: var(--ember);
  color: var(--ink);
  text-decoration: none;
  font-size: .95rem;
  font-weight: 600;
}

.btn svg { width: 26px; height: 10px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.btn:hover { background: var(--hot); }

/* ---------- load sequence ---------- */

@media (prefers-reduced-motion: no-preference) {
  .hero__copy > * { animation: rise .7s cubic-bezier(.2, .7, .3, 1) both; }
  .title { animation-delay: .18s; }
  .lede  { animation-delay: .3s; }
  .btn   { animation-delay: .38s; }

  @keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
}

/* ---------- tablet and phone sideways ---------- */

@media (max-width: 900px) {
  .burger { display: block; }

  .topbar { position: relative; }

  /* The row becomes a panel under the burger, still on its own fill because it
     is still hanging over the picture. */
  .nav {
    position: absolute;
    top: calc(100% + .55rem);
    right: 0;
    z-index: 2;
    flex-direction: column;
    align-items: stretch;
    gap: .15rem;
    padding: .35rem;
    min-width: 12.5rem;
    border-radius: 18px;
    /* Over the headline rather than over the plate, the fill has to carry more:
       at 74% the title reads straight through the open menu. */
    background: rgba(10, 5, 7, .92);
  }

  .nav[hidden] { display: none; }
  .nav a { padding: .68rem .8rem; border-radius: 12px; font-size: .9rem; }
  .nav a.nav__cta { margin-top: .25rem; text-align: center; }
}

/* ---------- phone ---------- */

@media (max-width: 700px) {
  /* Wider and flatter: at this width the copy runs nearly the full measure, so
     the ellipse has to as well. */
  .hero__scrim {
    -webkit-mask-image: radial-gradient(ellipse 74% 34% at 50% 50%, #000 0 80%, transparent 100%);
    mask-image: radial-gradient(ellipse 74% 34% at 50% 50%, #000 0 80%, transparent 100%);
  }

  .title { font-size: clamp(2.2rem, 9.5vw, 3rem); }
  .lede { margin-top: 1.05rem; font-size: 1rem; max-width: 21rem; }
  .btn { margin-top: 1.6rem; padding: .78rem 1.35rem; font-size: .9rem; }
  .btn svg { width: 22px; }
  .brand { font-size: 1.1rem; }
  .brand__mark { width: 23px; height: 23px; }
}
