/* Lamé — a mill that draws metal into weavable ribbon.

   The page is one button on a moving plate, so the only two things that have
   to hold are the masthead and that button's boundary, and they are solved
   differently because the plate treats them differently.

   The top right of this plate measures 19.10:1 bare on every frame of the
   loop, so the nav sits straight on the picture. The top left does not — the
   drape rolls through it — so the wordmark gets a corner fade, 0.80 ink
   reaching a third of the way in, which holds it at 11.43:1 for 5% of the
   frame — and only on a landscape viewport. The phone cut is a column taken
   from that same wedge, where the wordmark measures 19.14:1 bare, so on a
   phone this page has no scrim anywhere.

   The button needed none, which took some getting to. It is filled in the
   plate's own copper, so its boundary is the whole question, and the usual
   answer — darken what is behind it — cannot work here: a scrim sweeps the
   plate down through the button's own luminance on its way to black, so
   somewhere in its falloff there is always a ring of plate that matches the
   fill exactly. Measured, every size of scrim came out at 2.84:1, the same as
   no scrim at all, and only one large enough to put its full-strength plateau
   past the whole button got to 3.69:1 — for 14% of the picture.

   So the button carries its own edge instead, in three layers: a void ring,
   which separates it wherever the plate is lit; the copper fill itself, which
   separates it wherever the plate is dark; and a chrome hairline outside the
   ring for the narrow band in between, around L=0.1, where neither of the
   other two reaches 3:1. One of the three always clears it. Against the real
   plate, across eight viewport shapes and the whole loop, the worst the
   boundary ever gets is 3.63:1, and the picture is untouched. */

:root {
  --void:   #070203;    /* the plate's black, 49.8% of its pixel-time */
  --chrome: #FCF7F2;    /* its specular, 0.3% of pixel-time and the type colour */
  --copper: #F68070;    /* the mean of the lit drape, 20.7% */
  --lit:    #FBB5A0;    /* the brighter copper, for hover */
  --oxide:  #AB4740;    /* the shadowed fold — 3.64:1, so hairlines only */
  --rim:    #3E7FBF;    /* the one cool note in the clip, lifted to be visible */

  /* Two faces, as far apart as the plate's own two materials. Instrument Serif
     is the drawn one: its hairlines are the thinnest thing here and they hold
     at 8.66:1. The mono carries everything else, because a mill's own
     documents are set in one. */
  --display: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

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

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--void);
  color: var(--chrome);
  font-family: var(--mono);
}

:focus-visible {
  outline: 2px solid var(--rim);
  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.2vw, 1.75rem) var(--gutter) clamp(2rem, 6vh, 4rem);
  overflow: hidden;
}

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

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

/* The plateau runs to 55% of the radius so the wordmark sits in the solid part
   rather than in the falloff — a gradient that only reaches full strength at
   its own centre leaves the far end of the word barely covered, which measures
   around 1.3:1 and looks, wrongly, like it should work. */

.hero__scrim,
.hero__corner {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--void);
  pointer-events: none;
}

/* Over the line of text and the pill under it. The plateau has to run past the
   whole block, not just to its middle: sized to stop at 60% of the radius it
   leaves the ends of the line sitting in the falloff and measures 5.04:1,
   against 11.12:1 once it clears them. */
.hero__scrim {
  opacity: .90;
  -webkit-mask-image: radial-gradient(ellipse 32% 25% at 50% 50.5%, #000 0 66%, transparent 100%);
  mask-image: radial-gradient(ellipse 32% 25% at 50% 50.5%, #000 0 66%, transparent 100%);
}

.hero__corner {
  opacity: .80;

  -webkit-mask-image: radial-gradient(ellipse 32% 22% at 0% 0%, #000 0 55%, transparent 100%);
  mask-image: radial-gradient(ellipse 32% 22% at 0% 0%, #000 0 55%, transparent 100%);
}

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

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

/* No plate of its own: the corner scrim is what makes this legible, so the
   mark and the name sit straight on the picture. */
.tag {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  color: var(--chrome);
  text-decoration: none;
  font-family: var(--display);
  font-size: 1.35rem;
  line-height: 1;
}

.tag__mark { width: 25px; height: 25px; flex: none; }

/* The nav sits in the open picture with no fill of its own, because the top
   right of this plate measures 19:1 bare across the whole loop. */
.nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav a {
  color: var(--chrome);
  text-decoration: none;
  font-size: .76rem;
  letter-spacing: .04em;
  padding: .3rem 0;
  border-bottom: 1px solid transparent;
}

.nav a:hover { border-bottom-color: var(--copper); }

.burger {
  display: none;
  width: 40px; height: 40px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.burger span {
  display: block;
  width: 15px; height: 1px;
  margin: 3px auto;
  background: var(--chrome);
}

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

.hero__copy {
  place-self: center;
  text-align: center;
}

/* One line, set in the drawn face. Kept to a size that reads as a sentence
   rather than a banner — the plate is the loud thing on this page. */
.line {
  margin: 0 0 1.8rem;
  font-family: var(--display);
  font-size: clamp(1.5rem, 3.2vw, 2.4rem);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -.005em;
}

/* A pill, and deliberately a large one: it is the only control on the page,
   so there is nothing else for it to be in proportion to.

   The two rings are not decoration — they are what the measurement above calls
   for. The drop shadow is, and it earns its place by darkening the plate right
   where the boundary is. */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 1.05rem 2.3rem;
  border-radius: 999px;
  background: var(--copper);
  color: var(--void);
  text-decoration: none;
  font-size: .88rem;
  font-weight: 500;
  letter-spacing: .01em;
  box-shadow:
    0 0 0 1.5px var(--void),
    0 0 0 3px rgba(252, 247, 242, .55),
    0 16px 36px rgba(7, 2, 3, .55);
}

.btn:hover {
  background: var(--lit);
  box-shadow:
    0 0 0 1.5px var(--void),
    0 0 0 3px rgba(252, 247, 242, .8),
    0 20px 44px rgba(7, 2, 3, .6);
}

@media (prefers-reduced-motion: no-preference) {
  .btn { transition: background .2s, box-shadow .2s, transform .2s; }
  .btn:hover { transform: translateY(-2px); }
  .btn:active { transform: translateY(0); }
}

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

@media (prefers-reduced-motion: no-preference) {
  .line { animation: rise .75s cubic-bezier(.2, .7, .3, 1) .18s both; }
  .btn  { animation: rise .75s cubic-bezier(.2, .7, .3, 1) .32s both; }

  @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. Unlike the row, this hangs over
     the headline rather than over the void, so here it does need a fill. */
  .nav {
    position: absolute;
    top: calc(100% + .5rem);
    right: 0;
    z-index: 2;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: .3rem .2rem;
    min-width: 11.5rem;
    border-radius: 4px;
    background: rgba(7, 2, 3, .94);
  }

  .nav[hidden] { display: none; }
  .nav a { padding: .6rem .7rem; font-size: .84rem; border-bottom: 0; }
  .nav a:hover { color: var(--copper); }
}

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

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

  /* The corner has nothing to do here. The portrait cut is a column taken from
     the wedge the drape never reaches, so the wordmark measures 19.14:1 on the
     bare picture. */
  .hero__corner { display: none; }

  .line { margin-bottom: 1.5rem; }

  .btn { padding: .95rem 2rem; font-size: .84rem; }
  .tag { font-size: 1.2rem; }
  .tag__mark { width: 22px; height: 22px; }
}
