/* ===========================================================================
   evanferguson.com — vertical timeline, one page.
   Paper ground, charcoal ink, hairlines, one restrained accent. Whitespace
   does the work; nothing on the page is decorative.
   =========================================================================== */

:root {
  --paper:        #F6F4F1;
  --paper-raised: #FCFBF9;

  --ink:   #16161A;
  --ink-2: #43434B;
  --ink-3: #75757F;
  --ink-4: #A3A3AC;

  --rule:        #E2DED8;
  --rule-strong: #CFC9C0;

  --accent: #2F6E82;

  --font-sans: "Inter", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --measure: 60ch;
  --gutter: clamp(22px, 6vw, 60px);
  --rail: 96px;          /* width of the year column, incl. its padding      */
  --line-x: 95px;        /* where the vertical timeline sits                 */

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:        #131315;
    --paper-raised: #1B1B1E;
    --ink:   #F0EEEA;
    --ink-2: #BFBCB6;
    --ink-3: #8A8781;
    --ink-4: #66635E;
    --rule:        #2A2A2E;
    --rule-strong: #3E3E44;
    --accent: #7FBACC;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --paper:        #131315;
  --paper-raised: #1B1B1E;
  --ink:   #F0EEEA;
  --ink-2: #BFBCB6;
  --ink-3: #8A8781;
  --ink-4: #66635E;
  --rule:        #2A2A2E;
  --rule-strong: #3E3E44;
  --accent: #7FBACC;
  color-scheme: dark;
}

/* --------------------------------------------------------------- reset --- */

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.65;
  font-feature-settings: "tnum" 1;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img { max-width: 100%; }

.shell { max-width: 880px; margin: 0 auto; padding: 0 var(--gutter); }

.label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-4);
  font-weight: 500;
}

/* ---------------------------------------------------------------- header */

.masthead { padding: clamp(72px, 16vw, 180px) 0 clamp(56px, 10vw, 110px); }

.masthead h1 {
  font-size: clamp(30px, 5.2vw, 46px);
  font-weight: 550;
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin: 0;
}

.masthead .intro {
  max-width: var(--measure);
  color: var(--ink-2);
  margin: 20px 0 0;
}

.contact-row {
  display: flex; flex-wrap: wrap; gap: 10px 24px;
  margin-top: clamp(32px, 5vw, 48px);
}
.contact-row a {
  font-family: var(--font-mono); font-size: 12px;
  color: var(--ink-3); text-decoration: none;
  border-bottom: 1px solid var(--rule-strong); padding-bottom: 2px;
  transition: color .18s var(--ease), border-color .18s var(--ease);
}
.contact-row a:hover { color: var(--accent); border-color: var(--accent); }

/* ------------------------------------------------------- current work --- */

/* Lifted out of the timeline: full shell width, no year rail, so it reads as
   a different kind of thing rather than a taller row. */
.current { padding: 0 0 clamp(56px, 9vw, 92px); }

.current-meta {
  display: flex; align-items: baseline; gap: 14px;
  margin-bottom: 18px;
}
.current-dates {
  font-family: var(--font-mono); font-size: 12px;
  letter-spacing: 0.06em; color: var(--ink-4);
}

.current h2 {
  font-size: clamp(24px, 3.6vw, 33px);
  font-weight: 550; letter-spacing: -0.02em; line-height: 1.18;
  margin: 0 0 14px;
}
.current h2 a { text-decoration: none; }
.current h2 a::after {
  content: " \2197"; font-size: 0.62em; color: var(--ink-4);
  transition: color .18s var(--ease);
}
.current h2 a:hover, .current h2 a:hover::after { color: var(--accent); }

.current p { margin: 0; max-width: var(--measure); line-height: 1.66; }
.current .summary { color: var(--ink); font-size: 17px; }
.current .value { margin-top: 8px; color: var(--ink-3); font-size: 16px; }
.current .value + .preview, .current .summary + .preview { margin-top: clamp(26px, 4vw, 36px); }
.entry .summary + .preview { margin-top: clamp(22px, 3.5vw, 32px); }

.current .skills { margin-top: 18px; }

/* -------------------------------------------------------- previously --- */

.timeline-head {
  padding-top: clamp(26px, 4vw, 38px);
  padding-bottom: clamp(30px, 5vw, 46px);
  border-top: 1px solid var(--rule);
}

/* -------------------------------------------------------------- timeline */

.timeline { position: relative; padding-bottom: clamp(80px, 12vw, 140px); }

/* the single continuous hairline, fading out at the bottom */
.timeline::before {
  content: "";
  position: absolute; left: var(--line-x); top: 8px; bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom,
    var(--rule) 0%, var(--rule) 88%, transparent 100%);
}

.entry {
  position: relative;
  display: grid;
  grid-template-columns: var(--rail) 1fr;
  gap: 0 clamp(28px, 5vw, 52px);
  padding-bottom: clamp(72px, 11vw, 132px);
}
.entry:last-child { padding-bottom: 0; }

.entry-year {
  font-family: var(--font-mono);
  font-size: 12px; letter-spacing: 0.06em;
  line-height: 1.5;
  color: var(--ink-3);
  text-align: right; padding-right: 22px;
  padding-top: 4px;
}
.entry-year span { display: block; }
.entry-year .to { color: var(--ink-4); }

/* the dot on the line */
.entry::before {
  content: "";
  position: absolute; left: var(--line-x); top: 10px;
  width: 7px; height: 7px; margin-left: -3px;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: inset 0 0 0 1.5px var(--ink-3);
  transition: background .2s var(--ease), box-shadow .2s var(--ease);
}
.entry:hover::before { background: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }

.entry h2 {
  font-size: clamp(19px, 2.4vw, 23px);
  font-weight: 550; letter-spacing: -0.015em; line-height: 1.3;
  margin: 0 0 10px;
}
.entry h2 a { text-decoration: none; }
.entry h2 a::after {
  content: " ↗"; font-size: 0.68em; color: var(--ink-4);
  transition: color .18s var(--ease);
}
.entry h2 a:hover { color: var(--accent); }
.entry h2 a:hover::after { color: var(--accent); }

/* Two lines: what it is, then what I did. Weight and colour separate them,
   so neither needs a label. */
.entry p { margin: 0; max-width: var(--measure); }
.entry .summary { color: var(--ink); font-size: 16px; }
.entry .value {
  margin-top: 7px;
  color: var(--ink-3);
}
/* Labelled record. Mono micro-labels match the CURRENTLY / PREVIOUSLY marks. */
.rec {
  display: grid; grid-template-columns: 62px 1fr;
  gap: 4px 20px;
  margin: 18px 0 clamp(22px, 3.5vw, 32px);
  max-width: var(--measure);
}
.rec dt { padding-top: 3px; }
/* Values share the labels' family. Prose is sans, data is mono - the same
   split the skills line and the year rail already use. */
.rec dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12.5px; letter-spacing: 0.02em; line-height: 1.7;
  color: var(--ink-2);
}
@media (max-width: 620px) {
  .rec { grid-template-columns: 1fr; gap: 2px; }
  .rec dt { padding-top: 11px; }
  .rec dt:first-of-type { padding-top: 0; }
}

/* Facts rather than prose: who did it, then what happened to it. */
.entry .role { color: var(--ink); font-size: 16px; }
.entry .outcome { margin-top: 6px; color: var(--ink-3); font-size: 15px; }
.entry .role + .preview, .entry .outcome + .preview { margin-top: clamp(22px, 3.5vw, 32px); }
.entry .value, .entry .summary { margin-bottom: 0; }
.entry .value + .preview, .entry .summary + .preview { margin-top: clamp(22px, 3.5vw, 32px); }

/* ------------------------------------------------------------- previews */

.preview {
  display: block;
  border: 1px solid var(--rule);
  background: var(--paper-raised);
  aspect-ratio: 16 / 10;
  overflow: hidden;
  transition: border-color .22s var(--ease);
}
a.preview:hover { border-color: var(--rule-strong); }
.preview img {
  display: block; width: 100%; height: 100%;
  object-fit: cover; object-position: top center;
}

/* placeholder when there's no screenshot yet */
.preview.empty {
  display: grid; place-items: center;
  background-image:
    repeating-linear-gradient(45deg,
      transparent 0 9px, var(--rule) 9px 10px);
  opacity: 0.85;
}
.preview.empty span {
  background: var(--paper);
  padding: 6px 12px;
  font-family: var(--font-mono); font-size: 11px;
  color: var(--ink-4); letter-spacing: 0.06em;
}

.skills {
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.05em;
  color: var(--ink-4);
  line-height: 1.9;
}
.skills span::after { content: " · "; color: var(--rule-strong); }
.skills span:last-child::after { content: ""; }

/* ---------------------------------------------------------------- footer */

.colophon {
  padding: 44px 0 72px;
  border-top: 1px solid var(--rule);
  display: flex; flex-wrap: wrap; gap: 14px 28px;
}

/* ---------------------------------------------------------------- mobile */

@media (max-width: 620px) {
  :root { --rail: 0px; --line-x: 3px; }

  .entry {
    grid-template-columns: 1fr;
    gap: 0;
    padding-left: 26px;
  }
  .entry-year {
    text-align: left; padding: 0 0 6px;
  }
  .entry-year span { display: inline; }
  .entry::before { top: 7px; }
  .timeline::before { top: 6px; }
}

/* --------------------------------------------------------- theme toggle */

.theme-btn {
  position: fixed; right: 18px; bottom: 18px; z-index: 20;
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--rule-strong); background: var(--paper-raised);
  color: var(--ink-3); cursor: pointer; font-size: 13px; line-height: 1;
  display: grid; place-items: center;
  transition: color .18s var(--ease), border-color .18s var(--ease);
}
.theme-btn:hover { color: var(--accent); border-color: var(--accent); }

/* ------------------------------------------------------------- reveal fx */

.reveal { opacity: 0; transform: translateY(12px); }
.reveal.in {
  opacity: 1; transform: none;
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal.in { opacity: 1; transform: none; transition: none; }
}
