@font-face {
  font-family: 'Zum Grotesk';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/global/fonts/ZumGrotesk-Variable.woff2') format('woff2');
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/global/fonts/IBMPlexMono-Regular.woff2') format('woff2');
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/global/fonts/IBMPlexMono-Medium.woff2') format('woff2');
}

:root {
  --body-font: 'Zum Grotesk', 'Sans Fallback', sans-serif;
  --mono-font: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --ink: oklch(0.98 0.004 220);
  --muted: oklch(0.72 0.012 220);
  --faint: oklch(0.58 0.014 220);
  --void: oklch(0.14 0.012 220);

  /* Reveal. One 200ms fade per layer with 200ms of quiet between, so the page
     assembles back to front rather than arriving at once. Same easing as the
     landing hero. */
  --reveal-ease: cubic-bezier(0.42, 0.12, 0.22, 1);
  --reveal: 200ms;
  --step: 400ms;
}

/* This stylesheet is injected by the pattern, so it only ever loads on a page
   using it. No scoping selectors needed — the same reason home.css styles
   `body` directly. Nothing else is loaded either: head.html carries no
   stylesheet, so a pattern brings its own fonts and its own baseline. */
* { box-sizing: border-box; }

html,
body {
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background: var(--void);
  color: var(--ink);
  font-family: var(--body-font);
  -webkit-font-smoothing: antialiased;

  p {
    margin: 0;
  }

  h1 {
    font-weight: 500;
  }

  dl,
  dd {
    margin: 0;
  }

  img {
    max-width: 100%;
  }
}

main {
  position: relative;
  display: grid;
  grid-template-columns: 43fr 57fr;
  height: 100%;
}

/* 1 — the photograph. Everything waits on it, so the chain starts when there
   is something to reveal rather than on a timer. */
.background {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity var(--reveal) var(--reveal-ease);
}

.background picture,
.background img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body.is-ready .background { opacity: 1; }

/* 2 — the mark. */
.brand {
  position: relative;
  display: grid;
  place-items: center;
  padding: 2rem;
  opacity: 0;
  transition: opacity var(--reveal) var(--reveal-ease) var(--step);
}

body.is-ready .brand { opacity: 1; }

.brand img {
  display: block;
  width: clamp(9rem, 18vw, 15rem);
  height: auto;
}

/* 3 — the panel. Blurring the photograph in, rather than fading a flat colour
   over it, is what makes the two halves read as one image. */
.panel {
  position: relative;
  display: grid;
  align-content: center;
  padding: clamp(2rem, 5vw, 5rem);
  background: transparent;
  backdrop-filter: blur(0);
  transition:
    backdrop-filter var(--reveal) var(--reveal-ease) calc(var(--step) * 2),
    background-color var(--reveal) var(--reveal-ease) calc(var(--step) * 2);
}

body.is-ready .panel {
  background: color-mix(in oklch, var(--void) 55%, transparent);
  backdrop-filter: blur(32px);
}

/* 4 — the words. */
.panel > * {
  opacity: 0;
  transition: opacity var(--reveal) var(--reveal-ease) calc(var(--step) * 3);
}

body.is-ready .panel > * { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .background,
  .brand,
  .panel,
  .panel > * {
    transition: none;
  }
}

.panel h1 {
  margin: 0 0 0.75rem;
  max-width: 12ch;
  font-family: var(--body-font);
  font-size: clamp(2.25rem, 1.6rem + 2.4vw, 3.5rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.05;
  text-wrap: balance;
}

.panel > p {
  margin: 0;
  max-width: 40ch;
  color: var(--muted);
  font-size: clamp(1rem, 0.95rem + 0.2vw, 1.125rem);
  line-height: 1.5;
  text-wrap: balance;
}

/* One page, two outcomes: the CLI omits the fragment when it could not redeem
   a credential, and cli.js turns that into a state on the body. */
body[data-state='failed'] .fields {
  display: none;
}

.fields {
  /* A flat <dl> so the document stays a document: no wrapper divs for an
     author to remember. Grid placement does the pairing instead — each label
     sits directly above its value, and the address spans both columns because
     it is longer than either and has nothing to sit beside. */
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 3rem;
  margin: clamp(2.5rem, 6vh, 4.5rem) 0 0;
}

.fields dt:nth-of-type(1) { grid-area: 1 / 1; }
.fields dd:nth-of-type(1) { grid-area: 2 / 1; }
.fields dt:nth-of-type(2) { grid-area: 1 / 2; }
.fields dd:nth-of-type(2) { grid-area: 2 / 2; }
.fields dt:nth-of-type(3) { grid-area: 3 / 1 / auto / -1; margin-top: 2.5rem; }
.fields dd:nth-of-type(3) { grid-area: 4 / 1 / auto / -1; }

.fields dt {
  margin: 0 0 0.5rem;
  font-family: var(--mono-font);
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--faint);
}

.fields dd {
  margin: 0;
  font-size: clamp(1.375rem, 1.1rem + 1vw, 1.875rem);
  line-height: 1.15;
  overflow-wrap: anywhere;
}

@media (width < 900px) {
  body { overflow: auto; }

  main {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    height: auto;
    min-height: 100%;
  }

  .brand { padding: 3rem 2rem 1rem; }
  .brand img { width: 8rem; }
}
