@import 'tailwindcss';

/* ============================================================================
   DESIGN SYSTEM — "Meridian"

   The idea: one unbroken line. A career that starts in 1998 and has not
   stopped is drawn literally down the left edge of the page, filling as you
   scroll. Geography gets the same treatment turned on its side — a span of
   longitude rather than a decorative globe.

   Palette is deep petrol-graphite rather than near-black, warm bone for type,
   and a single desaturated brass accent. Brass was chosen because it reads as
   an instrument marking rather than as luxury gilding, and because a low
   saturation accent sits behind photography instead of fighting it.

   Type inverts the usual arrangement: a wide-cut grotesque (Archivo, width
   axis pushed out) does the display work, and a serif (Newsreader) carries the
   reading text.
   ========================================================================= */

@font-face {
  font-family: 'Archivo';
  src: url('/fonts/archivo-var.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Newsreader';
  src: url('/fonts/newsreader-var.woff2') format('woff2-variations');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

@theme {
  --color-ink: #131b21;
  --color-ink-deep: #0e141a;
  --color-ink-raise: #1a242b;
  --color-bone: #ede6da;
  --color-brass: #c79a4b;
  --color-mineral: #c4ccc8;

  --font-display: 'Archivo', ui-sans-serif, system-ui, sans-serif;
  --font-text: 'Newsreader', ui-serif, Georgia, serif;
}

:root {
  /* Palette -------------------------------------------------------------- */
  --ink: #131b21;
  --ink-deep: #0e141a;
  --ink-raise: #1a242b;
  --bone: #ede6da;
  --brass: #c79a4b;
  --brass-deep: #8e6d33;
  --mineral: #c4ccc8;

  /* Semantic aliases. Panes reassign these; components only ever use these. */
  --bg: var(--ink);
  --fg: var(--bone);
  --fg-dim: rgb(237 230 218 / 0.66);
  --fg-faint: rgb(237 230 218 / 0.4);
  --line: rgb(237 230 218 / 0.14);
  --line-strong: rgb(237 230 218 / 0.28);
  --accent: var(--brass);
  --plate-bg: #232f38;

  /* Measure -------------------------------------------------------------- */
  --shell: 1360px;
  --gutter: clamp(1.25rem, 4.5vw, 4.5rem);
  --spine-inset: 0px;
  --rhythm: clamp(5rem, 11vw, 10.5rem);

  /* Type scale (1.28 ratio at the top end, tightening toward body copy) --- */
  --t-hero: clamp(2.9rem, 10.4vw, 8.1rem);
  --t-1: clamp(2rem, 5.4vw, 4rem);
  --t-2: clamp(1.45rem, 3.1vw, 2.3rem);
  --t-3: clamp(1.1rem, 1.8vw, 1.4rem);
  --t-body: clamp(1.0625rem, 0.42vw + 0.95rem, 1.1875rem);
  --t-sm: 0.9375rem;
  --t-xs: 0.8125rem;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 40rem) {
  :root { --spine-inset: clamp(1.75rem, 4.2vw, 4rem); }
}

/* Light pane. Cool mineral, not cream — the palette stays in one family. */
.pane-light {
  --bg: var(--mineral);
  --fg: #10171d;
  --fg-dim: rgb(16 23 29 / 0.68);
  --fg-faint: rgb(16 23 29 / 0.42);
  --line: rgb(16 23 29 / 0.16);
  --line-strong: rgb(16 23 29 / 0.3);
  --accent: #7d5c1f;
  --plate-bg: #a7b1ac;
}
.pane-deep { --bg: var(--ink-deep); }
.pane-raise { --bg: var(--ink-raise); }

/* ============================================================================
   BASE
   ========================================================================= */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--font-text);
  font-size: var(--t-body);
  line-height: 1.62;
  font-weight: 380;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 620;
  font-stretch: 112%;
  line-height: 1.02;
  letter-spacing: -0.012em;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; }
img { display: block; max-width: 100%; height: auto; }
ul, ol { margin: 0; padding: 0; list-style: none; }

a { color: inherit; text-decoration: none; }

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

::selection { background: var(--brass); color: #0e141a; }

:where(a, button, [tabindex]):focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 3px;
  border-radius: 1px;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: 0;
  z-index: 200;
  transform: translateY(-140%);
  background: var(--brass);
  color: #0e141a;
  padding: 0.7rem 1.1rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--t-sm);
  transition: transform 0.2s var(--ease);
}
.skip-link:focus { transform: translateY(0.6rem); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ============================================================================
   LAYOUT
   ========================================================================= */

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  /* Left padding is a variable so .bay can extend it without the two rules
     fighting over the same longhand. */
  --pad-l: var(--gutter);
  padding-inline: var(--pad-l) var(--gutter);
}

.pane {
  position: relative;
  background: var(--bg);
  color: var(--fg);
  padding-block: var(--rhythm);
}

/* Content clears the spine by widening the shell's left padding. */
.bay { --pad-l: calc(var(--gutter) + var(--spine-inset)); }

/* The spine. Each pane draws its own segment; they abut, so the line reads as
   continuous down the whole document while still taking each pane's colour. */
.spine {
  position: absolute;
  /* Aligns to the shell's inner gutter at every width, including when the
     shell stops growing and starts centring. */
  left: max(var(--gutter), calc((100% - var(--shell)) / 2 + var(--gutter)));
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--line);
  pointer-events: none;
}
.spine::after {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 1px;
  background: var(--accent);
  transform: scaleY(var(--fill, 0));
  transform-origin: top;
  will-change: transform;
}
@media (max-width: 39.99rem) { .spine { display: none; } }

/* Grain. Fixed so it does not scroll with content and reads as film, not
   texture pasted onto the boxes. */
.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.038;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

/* ============================================================================
   TYPOGRAPHY UTILITIES
   ========================================================================= */

.wide { font-stretch: 122%; }
.display { font-family: var(--font-display); }
.num { font-variant-numeric: tabular-nums lining-nums; font-feature-settings: 'tnum' 1; }

/* Small structural text. Sentence case — no tracked-out caps anywhere. */
.tag {
  font-family: var(--font-display);
  font-size: var(--t-xs);
  font-weight: 500;
  font-stretch: 100%;
  letter-spacing: 0.01em;
  color: var(--fg-faint);
  line-height: 1.4;
}

.lede {
  font-size: var(--t-3);
  line-height: 1.5;
  color: var(--fg-dim);
  max-width: 46ch;
}

.prose { max-width: 62ch; color: var(--fg-dim); }
.prose p + p { margin-top: 1.1em; }

/* Section heading block ---------------------------------------------------- */
.sec-head { display: grid; gap: 1.1rem; margin-bottom: clamp(2.5rem, 5vw, 4.5rem); }
.sec-head h2 { font-size: var(--t-1); max-width: 20ch; }
@media (min-width: 64rem) {
  .sec-head {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    column-gap: clamp(2rem, 5vw, 5rem);
    align-items: end;
  }
  .sec-head .sec-index { grid-column: 1 / -1; }
  .sec-head .lede { padding-bottom: 0.45em; max-width: 40ch; }
}
.sec-index {
  display: flex; align-items: baseline; gap: 0.75rem;
  font-family: var(--font-display); font-size: var(--t-xs);
  color: var(--fg-faint); font-weight: 500;
}
.sec-index::before {
  content: '';
  width: clamp(1.5rem, 4vw, 3rem);
  height: 1px;
  background: var(--accent);
  transform: translateY(-0.25em);
}

/* ============================================================================
   CONTROLS
   ========================================================================= */

.btn {
  --btn-fg: var(--fg);
  display: inline-flex; align-items: center; gap: 0.65rem;
  font-family: var(--font-display); font-size: var(--t-sm); font-weight: 550;
  padding: 0.85rem 1.5rem;
  border: 1px solid var(--line-strong);
  color: var(--btn-fg);
  position: relative; overflow: hidden;
  transition: color 0.35s var(--ease), border-color 0.35s var(--ease), transform 0.25s var(--ease-out);
}
.btn::before {
  content: ''; position: absolute; inset: 0; background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.45s var(--ease-out);
}
.btn > * { position: relative; }
.btn svg { transition: transform 0.35s var(--ease-out); }
.btn:hover, .btn:focus-visible { color: #0e141a; border-color: var(--accent); }
.btn:hover::before, .btn:focus-visible::before { transform: scaleX(1); }
.btn:hover svg, .btn:focus-visible svg { transform: translateX(3px); }
.btn-solid { background: var(--accent); color: #0e141a; border-color: var(--accent); }
.btn-solid::before { background: var(--fg); }
.btn-solid:hover, .btn-solid:focus-visible { color: var(--bg); }

.social {
  display: inline-grid; place-items: center;
  width: 2.5rem; height: 2.5rem;
  border: 1px solid var(--line);
  color: var(--fg-dim);
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}
.social:hover, .social:focus-visible { color: var(--accent); border-color: var(--accent); }
.social svg { width: 1.05rem; height: 1.05rem; }

/* ============================================================================
   IMAGE PLATES
   Placeholders are designed, not broken. Each states what belongs there.
   ========================================================================= */

.plate {
  position: relative;
  overflow: hidden;
  background: var(--plate-bg);
  aspect-ratio: var(--ratio, 4 / 3);
}
.plate img {
  width: 100%; height: 100%; object-fit: cover;
  /* One grade for every photograph on the site. The source photographs were
     shot in wildly different light — a grey studio backdrop, event-hall LED
     walls, gold-lit awards stages — and reads as a random snapshot dump
     unless something ties them together. A slight desaturate + contrast
     lift plus a warm-to-cool duotone wash (below) is that unifying pass; it
     also quietly disguises the modest source resolution as "graded",
     rather than "soft". */
  filter: grayscale(14%) saturate(0.88) contrast(1.07) brightness(0.99);
  transition: transform 0.9s var(--ease-out), filter 0.9s var(--ease);
}
.plate:has(img)::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(155deg, rgb(14 20 25 / 0.34) 0%, rgb(14 20 25 / 0) 46%, rgb(199 154 75 / 0.12) 100%);
  mix-blend-mode: multiply;
  pointer-events: none;
}
.pane-light .plate:has(img)::before {
  background: linear-gradient(155deg, rgb(16 23 29 / 0.16) 0%, rgb(16 23 29 / 0) 46%, rgb(125 92 31 / 0.09) 100%);
}

.plate-empty {
  position: absolute; inset: 0;
  display: grid; align-content: end; gap: 0.4rem;
  padding: clamp(1rem, 2.2vw, 1.6rem);
  background:
    radial-gradient(140% 100% at 72% 0%, rgb(199 154 75 / 0.17), transparent 60%),
    linear-gradient(158deg, rgb(237 230 218 / 0.13), rgb(237 230 218 / 0.02) 62%),
    var(--plate-bg);
  box-shadow: inset 0 0 0 1px var(--line-strong), inset 0 0 60px rgb(0 0 0 / 0.12);
}
/* Corner crop marks — the mark of a plate held for an image, not a broken box. */
.plate-empty::before {
  content: '';
  position: absolute;
  inset: clamp(0.7rem, 1.6vw, 1.1rem);
  --m: linear-gradient(var(--accent), var(--accent));
  background:
    var(--m) 0 0 / 15px 1px no-repeat, var(--m) 0 0 / 1px 15px no-repeat,
    var(--m) 100% 0 / 15px 1px no-repeat, var(--m) 100% 0 / 1px 15px no-repeat,
    var(--m) 0 100% / 15px 1px no-repeat, var(--m) 0 100% / 1px 15px no-repeat,
    var(--m) 100% 100% / 15px 1px no-repeat, var(--m) 100% 100% / 1px 15px no-repeat;
  opacity: 0.62;
}
.plate-empty::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: clamp(1.75rem, 6%, 2.75rem); aspect-ratio: 1;
  transform: translate(-50%, -60%);
  border: 1px solid rgb(199 154 75 / 0.5);
  border-radius: 50%;
  background:
    linear-gradient(to right, transparent calc(50% - 0.5px), rgb(199 154 75 / 0.5) calc(50% - 0.5px), rgb(199 154 75 / 0.5) calc(50% + 0.5px), transparent calc(50% + 0.5px)),
    linear-gradient(to bottom, transparent calc(50% - 0.5px), rgb(199 154 75 / 0.5) calc(50% - 0.5px), rgb(199 154 75 / 0.5) calc(50% + 0.5px), transparent calc(50% + 0.5px));
}
.pane-light .plate-empty {
  background:
    radial-gradient(140% 100% at 72% 0%, rgb(125 92 31 / 0.14), transparent 60%),
    linear-gradient(158deg, rgb(16 23 29 / 0.09), rgb(16 23 29 / 0.02) 58%),
    var(--plate-bg);
}

.plate-empty .plate-label {
  position: relative;
  font-family: var(--font-display);
  font-size: var(--t-xs);
  font-weight: 550;
  color: var(--fg-dim);
  max-width: 30ch;
  line-height: 1.35;
}
.plate-empty .plate-note {
  position: relative;
  font-family: var(--font-display);
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--accent);
}

/* A floating editorial annotation over a photograph's corner — used
   sparingly (see Plate.astro's `tag` prop), never on every image. */
.plate-chip {
  position: absolute;
  left: clamp(0.75rem, 2vw, 1.1rem);
  bottom: clamp(0.75rem, 2vw, 1.1rem);
  z-index: 2;
  font-family: var(--font-display);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--bone);
  padding: 0.4rem 0.7rem;
  background: rgb(14 20 25 / 0.55);
  backdrop-filter: blur(6px) saturate(140%);
  border: 1px solid rgb(237 230 218 / 0.18);
}

figure { margin: 0; }
figcaption {
  margin-top: 0.7rem;
  display: flex; flex-wrap: wrap; gap: 0.35rem 0.9rem;
  font-family: var(--font-display);
  font-size: var(--t-xs);
  color: var(--fg-faint);
}
figcaption b { font-weight: 550; color: var(--fg-dim); }

/* ============================================================================
   MOTION
   Small amplitude by design: 10px and opacity. You should feel the page settle,
   not watch things fly in.
   ========================================================================= */

.rv { opacity: 0; transform: translateY(10px); }
.rv-in {
  opacity: 1; transform: none;
  transition: opacity 0.75s var(--ease) var(--d, 0ms), transform 0.75s var(--ease-out) var(--d, 0ms);
}

/* Image reveal mask. Opt-in via <Plate mask />; timed off the wrapping
   figure's own .rv/.rv-in state and --d, so it plays alongside the fade
   rather than against it. A closed shutter that lifts, not a fade. */
.img-mask { clip-path: inset(0 0 100% 0); transition: clip-path 1.05s var(--ease-out) var(--d, 0ms); }
.rv-in .img-mask { clip-path: inset(0 0 0% 0); }

/* Clip wipe, used only for the hero name — the one bold moment. */
.wipe > span {
  display: block;
  clip-path: inset(0 100% 0 0);
  transform: translateY(0.12em);
}
.wipe-in > span {
  clip-path: inset(0 0 0 0);
  transform: none;
  transition: clip-path 1.15s var(--ease-out) var(--d, 0ms), transform 1.15s var(--ease-out) var(--d, 0ms);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .rv, .wipe > span, .img-mask { opacity: 1; transform: none; clip-path: none; }
  .spine::after { transform: scaleY(1); }
  .parallax { transform: none !important; }
}

/* ============================================================================
   AUDIT OVERLAY
   Append ?audit=1 to outline every claim that has not been independently
   corroborated, with its provenance note. A build tool, not a public feature.
   ========================================================================= */

[data-audit] { position: relative; }
body.audit [data-audit='needs-verification'] { outline: 1px dashed #e2703a; outline-offset: 4px; }
body.audit [data-audit='client-provided'] { outline: 1px dashed rgb(199 154 75 / 0.7); outline-offset: 4px; }
body.audit [data-audit='verified'] { outline: 1px dashed #5aa17f; outline-offset: 4px; }
body.audit [data-audit-note]::after {
  content: attr(data-audit-note);
  position: absolute; left: 0; bottom: 100%;
  z-index: 60;
  transform: translateY(-6px);
  background: #e2703a; color: #10171d;
  font-family: var(--font-display); font-size: 0.6875rem; font-weight: 600;
  padding: 0.2rem 0.45rem; white-space: nowrap;
  pointer-events: none; opacity: 0;
}
body.audit [data-audit-note]:hover::after { opacity: 1; }
body:not(.audit) .audit-only { display: none !important; }
