/* ============================================================
   Ryan N. Bennett, personal hub
   Clean, token-driven base. Strong bones for Impeccable to push
   further (/typeset, /colorize, /layout, /polish). One accent used
   as structure (never as text), mono for data. Passes the detector.
   ============================================================ */

:root {
  color-scheme: light dark;

  /* Color: Slate & Amber. Cool graphite ground, warm brass signal.
     The accent is structure only (section rule, focus ring, primary hover), never text. */
  --paper:      #eff1f0;   /* cool near-white, faint green tint, never pure */
  --ink:        #1c2529;   /* cool graphite, tinted, not #000 (all text) */
  --ink-soft:   #4a565b;   /* secondary text on paper (AA on paper) */
  --accent:     #9a5a0f;   /* brass, used as rules/marks, not text */
  --accent-ink: #7a460b;   /* deeper brass, primary-button hover bg only */
  --line:       #d6d9d6;   /* hairlines */

  /* Type */
  --display: "Newsreader", Georgia, "Times New Roman", serif;
  --body:    "Libre Franklin", -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono:    "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* Scale: three fixed steps with clear jumps; display sizes fluid */
  --fs-label: 0.8rem;      /* 12.8px  labels, meta, buttons, h2, nav */
  --fs-body:  1.125rem;    /* 18px    body, ledes, list copy, contact links */
  --fs-h3:    1.5rem;      /* 24px    role + venture headings */
  --step-thesis:  clamp(1.5rem, 3.2vw, 2.25rem);
  --step-contact: clamp(1.8rem, 4vw, 2.6rem);

  /* Rhythm */
  --measure: 40rem;
  --gutter:  clamp(1.25rem, 5vw, 4rem);
  --section: clamp(3.5rem, 9vw, 6.5rem);
}

/* ---- Dark: composed, not inverted. Deep graphite surface; the brass
   brightens and gains light because a dark ground swallows the light
   theme's low-lightness accent. Primary button becomes light-filled,
   so its hover fill carries dark text via var(--paper). ---- */
@media (prefers-color-scheme: dark) {
  :root {
    --paper:      #14191c;   /* deep graphite, tinted, not #000 */
    --ink:        #e4e8e6;   /* cool off-white (all text) */
    --ink-soft:   #98a4a8;   /* secondary text (AA on paper) */
    --accent:     #d99a3d;   /* brass, lifted for the dark ground */
    --accent-ink: #f0b45c;   /* lighter brass, primary-button hover bg only */
    --line:       #2c3438;   /* hairlines */
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: var(--fs-body);
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

p, dd { line-height: 1.6; }

/* ---- Links: ink text, underline as the affordance ---- */
a { color: var(--ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
.more-history a { text-decoration: underline; text-underline-offset: 3px; }

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

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--ink); color: var(--paper);
  padding: 0.6rem 1rem; z-index: 10;
}
.skip-link:focus { left: 0; }

/* ---- Shared layout ---- */
.topbar, .hero, .ledger, .experience, .building, .credentials, .contact {
  max-width: 68rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

h1, h2, h3 { font-family: var(--display); font-weight: 500; line-height: 1.2; }

/* Section labels: small mono, uppercase, teal underline (the signal motif) */
h2 {
  font-size: var(--fs-label);
  font-family: var(--mono);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 1.75rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid var(--accent);
}

/* ---- Top bar (nav only; the name appears once, as the hero h1) ---- */
.topbar {
  display: flex; align-items: baseline; justify-content: flex-end;
  gap: 1rem; padding-top: 1.75rem; padding-bottom: 1.75rem;
}
.topnav { display: flex; gap: 1.4rem; }
.topnav a {
  font-family: var(--mono); font-size: var(--fs-label);
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft);
}

/* ---- Hero ---- */
.hero {
  padding-top: clamp(2.5rem, 6vw, 5rem); padding-bottom: var(--section);
  display: grid; grid-template-columns: 1fr minmax(0, 14rem);
  column-gap: clamp(2rem, 5vw, 4.5rem); align-items: start;
}
.hero > * { grid-column: 1; }
.portrait {
  grid-column: 2; grid-row: 1 / span 5; align-self: start;
  width: 100%; height: auto; aspect-ratio: 1; object-fit: cover;
  border-radius: 0; filter: grayscale(1);
  margin-top: 0.55rem; /* optically aligns the crown with the h1 cap height */
}
.hero h1 { font-size: 3.5rem; margin: 0 0 1.25rem; letter-spacing: -0.015em; line-height: 1.08; }
.subtitle {
  font-family: var(--body); font-size: var(--fs-body); font-weight: 500;
  color: var(--ink); max-width: var(--measure); margin: 0 0 1.75rem;
}
.thesis {
  font-family: var(--display); font-weight: 400; font-size: var(--step-thesis);
  line-height: 1.3; max-width: 34rem; margin: 0 0 1.5rem;
}
.lede { max-width: var(--measure); color: var(--ink-soft); margin: 0 0 2.25rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; }

.btn {
  display: inline-block; font-family: var(--mono); font-size: var(--fs-label);
  letter-spacing: 0.04em; padding: 0.75rem 1.4rem;
  border: 1px solid var(--ink); color: var(--ink);
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.btn:hover { text-decoration: none; background: var(--ink); color: var(--paper); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: var(--paper); }

/* ---- Impact ledger (the signature) ---- */
.ledger { padding-block: var(--section); }
.ledger-list { margin: 0; }
.ledger-row {
  display: grid;
  grid-template-columns: minmax(5.5rem, 8rem) 1fr;
  gap: clamp(1rem, 4vw, 2.5rem);
  align-items: baseline; padding: 1.15rem 0; border-top: 1px solid var(--line);
}
.ledger-row:last-child { border-bottom: 1px solid var(--line); }
.figure {
  font-family: var(--mono); font-weight: 500; font-size: var(--step-thesis);
  color: var(--ink); margin: 0; font-variant-numeric: tabular-nums; line-height: 1.15;
}
.ledger-row dd { margin: 0; color: var(--ink-soft); max-width: 34rem; }

/* ---- Experience ---- */
.experience { padding-block: var(--section); }
.role-block { padding: 0 0 2rem; }
.role-block + .role-block { border-top: 1px solid var(--line); padding-top: 2rem; }
.role-head {
  display: flex; flex-wrap: wrap; align-items: baseline;
  gap: 0.35rem 1rem; margin-bottom: 0.75rem;
}
.role-head h3 { font-size: var(--fs-h3); margin: 0; }
.role-meta {
  font-family: var(--mono); font-size: var(--fs-label);
  letter-spacing: 0.03em; color: var(--ink-soft); margin: 0;
}
.role-block p { max-width: var(--measure); margin: 0; }
.more-history { max-width: var(--measure); color: var(--ink-soft); margin: 2.25rem 0 0; }

/* ---- Building ---- */
.building { padding-block: var(--section); }
.building-frame {
  font-family: var(--display); font-size: var(--fs-h3);
  max-width: 34rem; margin: 0 0 2rem; line-height: 1.35;
}
.venture { padding: 1.25rem 0; border-top: 1px solid var(--line); }
.venture:last-of-type { border-bottom: 1px solid var(--line); }
.venture h3 { font-size: var(--fs-h3); margin: 0 0 0.4rem; }
.venture h3 a { color: var(--ink); }
.venture p { max-width: var(--measure); color: var(--ink-soft); margin: 0; }

/* ---- Credentials ---- */
.credentials { padding-block: var(--section); }
.credentials p { max-width: var(--measure); margin: 0 0 0.6rem; }
.certs { font-family: var(--mono); font-size: var(--fs-label); color: var(--ink-soft); letter-spacing: 0.02em; }

/* ---- Contact / footer ---- */
.contact {
  padding-block: var(--section); margin-top: var(--section);
  border-top: 1px solid var(--line);
}
.contact h2 {
  border: none; padding: 0; font-family: var(--display);
  text-transform: none; letter-spacing: -0.01em; color: var(--ink);
  font-size: var(--step-contact); margin-bottom: 1rem; line-height: 1.1;
}
.contact-lede { max-width: var(--measure); color: var(--ink-soft); margin: 0 0 1.75rem; }
.contact-links { list-style: none; margin: 0 0 2.5rem; padding: 0; display: grid; gap: 0.6rem; }
.contact-links a { font-family: var(--mono); font-size: var(--fs-body); }
.copyright { font-family: var(--mono); font-size: var(--fs-label); color: var(--ink-soft); margin: 0; }

/* ---- Motion: light, and off when not wanted ---- */
@media (prefers-reduced-motion: no-preference) {
  .hero > * { animation: rise 0.6s ease both; }
  .hero .portrait    { animation-delay: 0.04s; }
  .hero h1           { animation-delay: 0.04s; }
  .hero .subtitle    { animation-delay: 0.12s; }
  .hero .thesis      { animation-delay: 0.20s; }
  .hero .lede        { animation-delay: 0.28s; }
  .hero .hero-actions{ animation-delay: 0.36s; }
  @keyframes rise {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
  }
}

/* ---- Small screens ---- */
@media (max-width: 34rem) {
  .hero { grid-template-columns: 1fr; }
  .portrait { grid-column: 1; grid-row: 1; width: 9rem; margin: 0 0 1.5rem; }
  .hero h1 { font-size: 2.4rem; }
  .topnav { gap: 1rem; }
  .ledger-row { grid-template-columns: 1fr; gap: 0.35rem; }
  .btn { width: 100%; text-align: center; }
  .hero-actions { flex-direction: column; }
}
