/* ============================================================================
   jjoe.co — Joe Reynolds
   Built to design spec (2026-06-24). Hand-written, no framework, no
   build step. Serif (Fraunces) for voice, sans (Inter) for structure.
   Principle when in doubt: more space, less colour, nothing that doesn't earn
   its place.
   ========================================================================== */

/* --- Tokens ---------------------------------------------------------------- */
:root {
  /* Colour (spec §2.1) — warm neutrals + one muted terracotta */
  --ground:       #FBF8F3;   /* page background — warm paper, not screen-white */
  --ground-sink:  #F4EEE4;   /* link-card resting fill — a whisper warmer */
  --ink:          #2A2622;   /* primary text — warm near-black (≈13.5:1 on ground) */
  --ink-soft:     #6E665C;   /* secondary text — warm grey-taupe (≈4.9:1, AA) */
  --hairline:     #E4DCCF;   /* borders / dividers — warm low-contrast line */
  --accent:       #C2602F;   /* the orange — muted terracotta (≈4.6:1, AA) */
  --accent-deep:  #A44E22;   /* pressed/active accent */
  --accent-tint:  #F3E4D7;   /* fill-only wash; never used as text colour */

  /* Type scale (spec §1.4). Headings clamp() to scale without a media query. */
  --t-wordmark:   clamp(2.25rem, 1.6rem + 3.2vw, 3.5rem);    /* 36–56px */
  --t-hero:       clamp(1.5rem, 1.15rem + 1.7vw, 2.125rem);  /* 24–34px */
  --t-h-section:  0.75rem;                                    /* 12px overline */
  --t-about:      clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem); /* 17–19px */
  --t-link-label: 1.0625rem;                                  /* 17px */
  --t-link-meta:  0.875rem;                                   /* 14px */
  --t-link-domain:0.8125rem;                                  /* 13px */
  --t-body:       1rem;                                       /* 16px */
  --t-footer:     0.8125rem;                                  /* 13px */

  /* Spacing scale — 8px base (spec §3.3) */
  --space-2:  0.5rem;   /*  8px */
  --space-3:  0.75rem;  /* 12px */
  --space-4:  1rem;     /* 16px */
  --space-6:  1.5rem;   /* 24px */
  --space-8:  2rem;     /* 32px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */
  --space-20: 5rem;     /* 80px */

  /* Layout */
  --measure: 34rem;     /* content column ≈ 544px */

  font-size: 100%;      /* 1rem = 16px; honours user zoom */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* --- Reset (light touch) --------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
body, h1, p, figure { margin: 0; }

/* --- Base ------------------------------------------------------------------ */
body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-weight: 400;
  line-height: 1.6;
  color: var(--ink);
  background: var(--ground);
}

/* Fraunces does the talking. If it fails to load, Georgia holds the register. */
.serif {
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-optical-sizing: auto;   /* lets the opsz axis work where supported */
}

/* --- Page container (spec §3.2) -------------------------------------------- */
.page {
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: 1.5rem;                    /* gutter on mobile */
  padding-block: clamp(4rem, 8vh, 7rem);     /* generous top/bottom air */
}

/* --- Wordmark + accent rule (spec §6) -------------------------------------- */
.wordmark {
  font-weight: 400;             /* confidence through size + air, not weight */
  font-size: var(--t-wordmark);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--ink);
}

/* the one structural orange accent — a short rule under the name */
.accent-rule {
  width: 40px;
  height: 2px;
  background: var(--accent);
  border: 0;
  margin: var(--space-4) 0 0;
}

/* --- Hero line (spec §1.4 / §11) ------------------------------------------- */
.hero {
  font-size: var(--t-hero);
  line-height: 1.3;
  letter-spacing: -0.01em;
  max-width: 30rem;             /* hold the measure so it wraps to ~2 lines */
  margin: var(--space-6) 0 0;
  color: var(--ink);
}

/* --- Overline label (spec §1.4 note) --------------------------------------- */
/* The only uppercase, wide-tracked text on the page. Signals "section". */
.overline {
  font-family: "Inter", system-ui, sans-serif;
  font-size: var(--t-h-section);
  font-weight: 600;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
  margin: 0 0 var(--space-3);
}

/* --- About (spec §1.5 / §11) ----------------------------------------------- */
/* Serif body at 17–19px / 1.65 — the one place a serif body is right. */
.about { margin-top: var(--space-16); }   /* hero → about (steps up on desktop) */

.about__body {
  max-width: var(--measure);    /* ≤ ~62 chars per line */
  color: var(--ink);            /* never --ink-soft for the about copy */
  font-size: var(--t-about);
  line-height: 1.65;
}
.about__body p + p { margin-top: var(--space-4); }   /* rhythm between paragraphs */

/* --- The link cards (spec §4) — the hero of the page ----------------------- */
.links {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);                       /* 12px between cards */
  margin-top: var(--space-12);               /* about → links (steps up desktop) */
  padding: 0;
}

.link-card {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-6);                    /* 24px — tap target ≈ 70px tall */
  background: var(--ground-sink);            /* a whisper warmer than the page */
  border: 1px solid var(--hairline);
  border-radius: 10px;
  text-decoration: none;
  color: var(--ink);
  transition: border-color 220ms ease,
              background-color 220ms ease,
              transform 220ms ease,
              color 220ms ease;
  will-change: transform;
}

.link-card__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.link-card__label {
  font: 500 var(--t-link-label)/1.3 "Inter", sans-serif;
  color: var(--ink);
}
.link-card__domain {
  font: 400 var(--t-link-domain)/1.3 "Inter", sans-serif;
  color: var(--ink-soft);
  letter-spacing: 0.01em;
}

.link-card__arrow {
  font-size: 1.125rem;
  line-height: 1;
  color: var(--ink-soft);
  transform: translateX(0);
  transition: transform 220ms ease, color 220ms ease;
  flex: none;
}

/* HOVER — the quiet lovely moment: outline + label warm to terracotta, arrow
   eases 4px right, the gentlest 1px lift. None of them loud alone. */
.link-card:hover {
  border-color: var(--accent);
  background: var(--ground);                  /* lifts to page-white */
  transform: translateY(-1px);
}
.link-card:hover .link-card__label { color: var(--accent); }
.link-card:hover .link-card__arrow {
  color: var(--accent);
  transform: translateX(4px);                 /* the signature detail */
}

/* ACTIVE / pressed */
.link-card:active {
  transform: translateY(0);
  border-color: var(--accent-deep);
}

/* FOCUS — keyboard accessibility, never removed */
.link-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* --- Contact / email (spec §5) — the one orange resting element ------------ */
.contact-block { margin-top: var(--space-12); }

.contact {
  font: 400 var(--t-body)/1.6 "Inter", sans-serif;
  color: var(--ink-soft);
}
/* The one orange resting element. specced --accent (#C2602F) here, but at
   16px/400 that lands ~3.96:1 on the ground — just under WCAG AA (4.5:1) for
   normal text. We use --accent-deep (#A44E22, ~5.37:1) at rest instead: a token
   Lynne already defines, same terracotta family, now AA-legible for everyone.
   The hover still reads clearly via the underline strengthening to full accent. */
.contact a {
  color: var(--accent-deep);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-tint);   /* faint underline at rest */
  padding-bottom: 1px;
  transition: border-color 200ms ease, color 200ms ease;
}
.contact a:hover { color: var(--accent-deep); border-bottom-color: var(--accent); }
.contact a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* --- Portrait slot (spec §7) — styles wait; markup stays commented out ----- */
.portrait {
  /* width: 160px; */
  /* height: 160px; */
  object-fit: cover;
  border-radius: 10px;          /* echoes the cards */
  display: block;
  margin-top: var(--space-6);
}
@media (max-width: 600px) {
  .portrait { width: 96px; height: 96px; }
}

/* --- Responsive (spec §8) — mobile-first; one enhancement breakpoint ------- */
@media (min-width: 600px) {
  .page  { padding-block: clamp(5rem, 9vh, 7rem); }
  .about { margin-top: clamp(4rem, 6vw, 5rem); }   /* step the big gaps up */
  .links { margin-top: clamp(3rem, 5vw, 4rem); }
}

/* --- Motion & finish (spec §9) -------------------------------------------- */
/* One grace note: a single fade+settle on load. Tasteful, never repeated. */
@media (prefers-reduced-motion: no-preference) {
  .page { animation: settle 500ms ease both; }
  @keyframes settle {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
  }
}

/* Non-negotiable: honour reduced-motion. Kills the load fade and all hover
   transitions for anyone who's asked the OS to calm things down. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
