/* ---------------------------------------------------------------
   Fonts, self-hosted from ./fonts. See fonts/README.md.
----------------------------------------------------------------- */

@font-face {
  font-family: "Imperial Script";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/imperial-script-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
    U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
    U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Imperial Script";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/imperial-script-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
    U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F,
    U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}

@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("fonts/space-grotesk-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
    U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
    U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("fonts/space-grotesk-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
    U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F,
    U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}

/* ---------------------------------------------------------------
   Palette
   Blush ground, blue black ink, cobalt and rose blocks, a gold
   accent on hover. Theme follows the system. There is no toggle.
----------------------------------------------------------------- */

:root {
  --bg: #faefea;
  --ink: #1c2130;
  --muted: #6e5c59;
  --rule: rgba(28, 33, 48, 0.16);
  --accent: #9c7a2c;

  --mark-a: #f3cfc7;
  --mark-b: #2b4fa0;
  --mark-blend: multiply;

  /* Swap the first family for another script if this reads too formal:
     "Mrs Saint Delafield" is lighter, "Parisienne" is rounder. Both need
     their own woff2 in ./fonts and a matching @font-face above. */
  --script: "Imperial Script", "Snell Roundhand", "Brush Script MT", cursive;

  /* Stand-in for Acid Grotesk: the same clean, techy neo-grotesque with
     elongated forms and long descenders. */
  --sans: "Space Grotesk", "Helvetica Neue", Helvetica, Arial, sans-serif;

  --pad: clamp(1.25rem, 3.2vw, 2.5rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161821;
    --ink: #f2e4de;
    --muted: #9b8c88;
    --rule: rgba(242, 228, 222, 0.18);
    --accent: #d6ae5c;

    --mark-a: #23386e;
    --mark-b: #e8b4aa;
    --mark-blend: normal;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  font-feature-settings: "kern" 1, "liga" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* --- Page frame ------------------------------------------------
   Three rows: intro at the top, name in the open middle, details
   pinned to the bottom. Sized to sit inside one screen.
----------------------------------------------------------------- */

.page {
  position: relative;
  min-height: 100svh;
  padding: var(--pad);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: clamp(1rem, 3vh, 2.25rem);
  animation: rise 800ms cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

/* --- Top -------------------------------------------------------- */

.top {
  display: grid;
  gap: 0.875rem;
}

.eyebrow {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.lede {
  margin: 0;
  max-width: 24rem;
  font-size: 0.875rem;
  color: var(--muted);
  text-wrap: pretty;
}

/* --- Marks -----------------------------------------------------
   Two blocks in the open corner, the smaller one crossing the
   larger. They arrive with the page, on no timing of their own.
----------------------------------------------------------------- */

.marks {
  position: absolute;
  top: var(--pad);
  right: var(--pad);
  width: clamp(8rem, 20vw, 17rem);
  aspect-ratio: 5 / 4;
  pointer-events: none;
}

.mark {
  position: absolute;
  display: block;
}

.mark--a {
  top: 0;
  right: 22%;
  width: 64%;
  height: 62%;
  background: var(--mark-a);
}

.mark--b {
  top: 30%;
  right: 0;
  width: 44%;
  height: 58%;
  background: var(--mark-b);
  mix-blend-mode: var(--mark-blend);
}

@media (max-width: 46rem) {
  .marks {
    display: none;
  }
}

/* --- Name ------------------------------------------------------
   Two lines, the surname stepped in, so the block sits off the
   centre axis and reads like a signature. The size is capped
   against viewport height as well as width so it never scrolls.
----------------------------------------------------------------- */

.name {
  margin: 0;
  align-self: center;
  font-family: var(--script);
  font-weight: 400;
  font-size: clamp(3rem, min(20vw, 25svh), 15rem);
  line-height: 0.78;
  letter-spacing: normal;
  display: grid;
  justify-items: start;
}

.name__first,
.name__last {
  display: block;
}

.name__last {
  margin-left: clamp(1.25rem, 11vw, 9rem);
}

/* --- Details ---------------------------------------------------- */

.details {
  display: grid;
  gap: clamp(1.25rem, 3vw, 2.5rem);
  padding-top: clamp(1rem, 2vh, 1.5rem);
  border-top: 1px solid var(--rule);
}

@media (min-width: 46rem) {
  .details {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
  }
}

.block {
  display: grid;
  gap: 0.375rem;
  align-content: start;
}

.label {
  margin: 0;
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.value {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.55;
  max-width: 22rem;
}

/* --- Links ------------------------------------------------------ */

.link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1px;
  transition: border-color 200ms ease;
}

.link:hover,
.link:focus-visible {
  border-bottom-color: var(--accent);
}

.link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 2px;
}

/* --- Motion ----------------------------------------------------- */

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

::selection {
  background: var(--ink);
  color: var(--bg);
}
