/* ---------- font ---------- */
/* One variable file covers every weight. The file name is frozen: it is cached for a year,
   so a changed font must be renamed (-v2) here and in the preload link in _Layout.cshtml. */
@font-face {
  font-family: "Figtree";
  src: url("../fonts/figtree-latin-wght-normal-v1.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

/* Arial reshaped to Figtree's metrics, so the text does not jump when the web font arrives */
@font-face {
  font-family: "Figtree Fallback";
  src: local("Arial");
  size-adjust: 100.72%;
  ascent-override: 94.32%;
  descent-override: 24.82%;
  line-gap-override: 0%;
}

/* ---------- design tokens ---------- */
/* Same palette as the CV. Contrast against --bg is noted where a colour carries text;
   4.5:1 is the floor for anything readable. */
:root {
  color-scheme: only light;

  --bg: #f7f4ee;            /* warm off-white page */
  --ink: #23293a;           /* main text, 13.2:1 */
  --muted: #5a6070;         /* secondary text, 5.7:1 */
  --accent: #e8710a;        /* tangerine: fills and decoration only, 2.8:1 is too low for text */
  --accent-hover: #f08a2c;
  --accent-text: #ad4a00;   /* tangerine dark enough for links, 5.1:1 */
  --placeholder: #dcd6ca;   /* behind the portrait while it loads */
  --selection: #fde5cc;     /* light enough that a selected link still reads, 4.6:1 */

  --font: "Figtree", "Figtree Fallback", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;

  --measure: 36rem;         /* longest line of text, about 60 characters */
  --portrait-col: 10rem;    /* the portrait, and the column it gets on wide screens */
  --col-gap: 2.5rem;
  --page-pad: clamp(1.25rem, 5vw, 2.5rem);
}

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--selection); }

h1, p { margin: 0; }

a {
  color: var(--accent-text);
  text-decoration-thickness: 0.07em;
  text-underline-offset: 0.2em;
}
a:hover { text-decoration-thickness: 0.14em; }

:focus-visible {
  outline: 3px solid var(--accent-text);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  max-width: calc(var(--portrait-col) + var(--col-gap) + var(--measure) + 2 * var(--page-pad));
  margin-inline: auto;
  padding-inline: var(--page-pad);
}

/* the page is short, so in a tall window it is centred instead of hugging the top */
main {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: clamp(3rem, 1.5rem + 7vw, 5rem);
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  padding: 0.5rem 1rem;
  background: var(--ink);
  color: var(--bg);
  border-radius: 0 0 8px 8px;
}
.skip-link:focus { top: 0; }

/* ---------- home page ---------- */
.hero {
  display: grid;
  gap: 1.75rem;
}

.portrait {
  display: block;
  width: 7.5rem;
  height: 7.5rem;
  border-radius: 50%;
  object-fit: cover;
  background: var(--placeholder);
}

h1 {
  font-size: clamp(2.5rem, 1.75rem + 3.75vw, 3.75rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.tagline {
  margin-top: 0.75rem;
  font-weight: 500;
  color: var(--muted);
}

.about {
  max-width: var(--measure);
  margin-top: 1.75rem;
  font-size: clamp(1.125rem, 1.05rem + 0.4vw, 1.25rem);
  text-wrap: pretty;
}
.about p + p { margin-top: 1.1em; }
.about a { font-weight: 600; }

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1.75rem;
  margin-top: 1.25rem;
  font-weight: 600;
}
/* every link in the row is at least 44px tall, a comfortable tap target */
.actions a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
}

/* ---------- 404 and error pages ---------- */
.eyebrow {
  margin-bottom: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--muted);
}

.lead {
  max-width: var(--measure);
  margin-top: 1.25rem;
  font-size: clamp(1.25rem, 1.15rem + 0.5vw, 1.375rem);
  line-height: 1.5;
}

.notice .actions { margin-top: 1.75rem; }

.button {
  padding-inline: 1.5rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--ink);        /* ink on tangerine is 4.7:1; white would be 3.1:1 */
  font-weight: 700;
  text-decoration: none;
}
.button:hover { background: var(--accent-hover); }

/* ---------- wide screens: portrait beside the text ---------- */
@media (min-width: 48em) {
  .hero {
    grid-template-columns: var(--portrait-col) minmax(0, 1fr);
    column-gap: var(--col-gap);
  }

  .portrait {
    width: var(--portrait-col);
    height: var(--portrait-col);
  }
}

/* ---------- print ---------- */
@media print {
  body { background: none; font-size: 11pt; }
  main { display: block; min-height: 0; padding-block: 0; }
  a { color: inherit; text-decoration: none; }
  .actions .button, .skip-link { display: none; }
}
