:root {
  --ink:        #07080a;
  --fg:         #e9eaee;
  --fg-mid:     rgba(233, 234, 238, 0.78);
  --fg-dim:     rgba(233, 234, 238, 0.56);
  --fg-faint:   rgba(233, 234, 238, 0.34);
  --gutter:     clamp(22px, 4vw, 72px);
  --fallback:   system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

/* One face for the whole page; ?font= switches it for comparing wordmarks */
html[data-font="space"]  { --font: "Space Grotesk", var(--fallback); --display-tracking: -0.028em; --display-weight: 400; }
html[data-font="inter"]  { --font: "Inter Tight", var(--fallback);   --display-tracking: -0.035em; --display-weight: 400; }
html[data-font="sora"]   { --font: "Sora", var(--fallback);          --display-tracking: -0.03em;  --display-weight: 300; }
html[data-font="figtree"]{ --font: "Figtree", var(--fallback);       --display-tracking: -0.032em; --display-weight: 400; }

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  background: var(--ink);
}

body {
  color: var(--fg);
  font-family: var(--font);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
  overscroll-behavior: none;
}

/* ───────────────── background field ───────────────── */

#field,
.scrim {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#field { z-index: 0; display: block; }


/* keeps type legible wherever the light lands */
.scrim {
  z-index: 2;
  background:
    radial-gradient(58% 42% at 50% 50%, rgba(7, 8, 10, 0.5) 0%, rgba(7, 8, 10, 0) 100%),
    linear-gradient(to top, rgba(7, 8, 10, 0.7) 0%, rgba(7, 8, 10, 0) 40%),
    linear-gradient(to bottom, rgba(7, 8, 10, 0.45) 0%, rgba(7, 8, 10, 0) 26%);
}

/* ───────────────── layout ───────────────── */

.shell {
  position: relative;
  z-index: 3;
  height: 100%;
  min-height: 100svh;
  padding: calc(var(--gutter) + env(safe-area-inset-top)) var(--gutter)
           calc(var(--gutter) + env(safe-area-inset-bottom));
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: clamp(16px, 3vh, 36px);
}

.row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.row--bottom { justify-content: center; }

.stage {
  place-self: center;
  min-width: 0;
  text-align: center;
}

/* ───────────────── type ───────────────── */

.wordmark {
  font-family: var(--font);
  font-weight: var(--display-weight);
  font-size: clamp(12px, 1vw, 14px);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--fg);
  text-decoration: none;
}

.wordmark .mark {
  color: var(--fg-dim);
  transition: color 0.5s ease;
}

.wordmark:hover .mark { color: var(--fg); }

.meta,
.email {
  font-size: clamp(12px, 1.05vw, 13.5px);
  letter-spacing: 0.01em;
  color: var(--fg-faint);
}

.email {
  /* held at Inter Tight regardless of the page face */
  font-family: "Inter Tight", var(--fallback);
  display: inline-block;
  margin-top: clamp(34px, 4.2vw, 56px);
  color: var(--fg-dim);
  text-decoration: none;
  position: relative;
}

.email::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.email:hover { color: var(--fg); }
.email:hover::after { transform: scaleX(1); }

.headline {
  font-family: var(--font);
  font-weight: var(--display-weight);
  font-size: clamp(2.1rem, 5.2vw, 4.5rem);
  line-height: 1.06;
  letter-spacing: var(--display-tracking);
  margin: 0 auto;
  max-width: 15ch;
  color: var(--fg-mid);
  text-wrap: balance;
  will-change: transform, opacity, filter;
}

.headline em {
  font-style: normal;
  color: var(--fg);
}


/* ───────────────── entrance ───────────────── */

html[data-noanim] .headline,
html[data-noanim] .email,
html[data-noanim] .row {
  opacity: 1 !important;
  transform: none !important;
  filter: none !important;
  transition: none !important;
}

@media (prefers-reduced-motion: no-preference) {
  .headline,
  .email,
  .row {
    opacity: 0;
    transform: translateY(16px);
    filter: blur(12px);
  }

  body.ready .headline,
  body.ready .email,
  body.ready .row {
    opacity: 1;
    transform: none;
    filter: none;
    transition:
      opacity 1.1s cubic-bezier(0.22, 1, 0.36, 1) var(--d, 0s),
      transform 1.25s cubic-bezier(0.22, 1, 0.36, 1) var(--d, 0s),
      filter 1.1s cubic-bezier(0.22, 1, 0.36, 1) var(--d, 0s);
  }

  .headline    { --d: 0.28s; }
  .row--top    { --d: 0.10s; }
  .email       { --d: 0.86s; }
  .row--bottom { --d: 1.00s; }
}

/* ───────────────── small screens ───────────────── */

@media (max-width: 680px) {
  .scrim {
    background:
      radial-gradient(70% 34% at 50% 34%, rgba(7, 8, 10, 0.62) 0%, rgba(7, 8, 10, 0) 100%),
      linear-gradient(to top, rgba(7, 8, 10, 0.7) 0%, rgba(7, 8, 10, 0) 34%);
  }

  /* sit the block in the upper middle rather than dead centre: centred left
     a large, empty headroom above the headline */
  /* optically centred: with the headline this large, anchoring it high
     left a void below it instead of above */
  .stage {
    align-self: center;
    margin-top: 0;
  }

  .headline {
    /* allowed to wrap freely — sized for presence, not for a line count */
    font-size: clamp(2.3rem, 13vw, 4.2rem);
    line-height: 1.02;
    letter-spacing: -0.034em;
    max-width: none;
  }


  .email { margin-top: clamp(22px, 4vh, 34px); }
  .row { align-items: center; }
}

/* short landscape (laptops at 1366x600, phones on their side): tighten up
   rather than dropping the description altogether */
@media (max-height: 620px) and (orientation: landscape) {
  .headline { font-size: clamp(1.75rem, 4.4vw, 2.75rem); }
  .email { margin-top: 20px; }
  .shell { gap: 20px; }
}
