/* ============================================================
   jordanshilling.com — personal record
   Editorial / archival: warm paper, deep ink, glacier accent.
   ============================================================ */

:root {
  --paper:      #F1EDE4;
  --paper-2:    #F7F4EE;
  --ink:        #191C1A;
  --ink-2:      #464A45;
  --ink-3:      #67675F;   /* dates & meta — must clear WCAG AA (4.5:1) */
  --rule:       #D8D2C5;
  --rule-soft:  #E6E1D6;
  --accent:     #24504E;

  --serif:   "Newsreader", Georgia, "Times New Roman", serif;
  --display: "Bodoni Moda", "Newsreader", Georgia, serif;
  --sans:    "Archivo", "Helvetica Neue", Arial, sans-serif;

  --rail-w: 20rem;
  --gap:    5rem;
  --ease:   cubic-bezier(.2, .7, .3, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:     #131614;
    --paper-2:   #191D1B;
    --ink:       #E9E4D9;
    --ink-2:     #A9A79C;
    --ink-3:     #8B8F87;   /* dates & meta — must clear WCAG AA (4.5:1) */
    --rule:      #2B302D;
    --rule-soft: #222724;
    --accent:    #86B5AE;
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 300;
  line-height: 1.62;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Paper grain — atmosphere without weight. */
.grain {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) { .grain { opacity: .05; } }

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: .75rem 1.25rem;
  z-index: 200;
  font-family: var(--sans);
  font-size: .8rem;
}
.skip:focus { left: 0; }

a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1px;
  transition: border-color .3s var(--ease), color .3s var(--ease);
}
a:hover { color: var(--accent); border-bottom-color: var(--accent); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 1px; }

/* ── Sheet ─────────────────────────────────────────────────── */

.sheet {
  max-width: 74rem;
  margin: 0 auto;
  padding: 6rem 3rem 7rem;
  display: grid;
  grid-template-columns: var(--rail-w) 1fr;
  column-gap: var(--gap);
  align-items: start;
}

/* ── Rail ──────────────────────────────────────────────────── */

.rail { position: sticky; top: 6rem; }

/* A sticky rail taller than the viewport makes its own tail unreachable.
   Below this height, let it scroll with the page instead. */
@media (max-height: 46rem) {
  .rail { position: static; }
}

.masthead { margin-bottom: 3.25rem; }

.name {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(3rem, 5.4vw, 4.15rem);
  line-height: .93;
  letter-spacing: -.018em;
  margin: 0 0 1.5rem;
}

.standfirst {
  margin: 0 0 .9rem;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 21rem;
}

.locale {
  margin: 0;
  font-family: var(--sans);
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.rail-block { margin-bottom: 2.5rem; }

.label {
  font-family: var(--sans);
  font-size: .66rem;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 .85rem;
  padding-bottom: .55rem;
  border-bottom: 1px solid var(--rule);
}

ul.plain { list-style: none; margin: 0; padding: 0; }
ul.plain li { font-size: .95rem; line-height: 1.75; }
ul.plain.muted li { color: var(--ink-2); }

/* ── Record ────────────────────────────────────────────────── */

.record { min-width: 0; }

.section { margin-bottom: 4.5rem; }

.section-head {
  display: flex;
  align-items: baseline;
  gap: .9rem;
  font-family: var(--sans);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0 0 2.25rem;
  padding-bottom: .8rem;
  border-bottom: 1px solid var(--ink);
}

.numeral {
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--accent);
}

/* Hanging year margin — the editorial device that carries the page. */
.entry {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  column-gap: 2.25rem;
  padding: 1.9rem 0;
  border-bottom: 1px solid var(--rule-soft);
}
.entry:last-child { border-bottom: 0; }

.years {
  font-family: var(--sans);
  font-size: .74rem;
  font-weight: 500;
  letter-spacing: .07em;
  color: var(--ink-3);
  padding-top: .38rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.org {
  font-family: var(--serif);
  font-size: 1.28rem;
  font-weight: 500;
  letter-spacing: -.005em;
  margin: 0 0 1.15rem;
}

.role + .role { margin-top: 1.6rem; }

.role-title {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 1.06rem;
  color: var(--accent);
  margin: 0 0 .2rem;
}

.meta {
  font-family: var(--sans);
  font-size: .7rem;
  font-weight: 400;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 .7rem;
}

.role p:not(.meta) {
  margin: 0;
  max-width: 40rem;
  color: var(--ink-2);
}

.tools {
  margin-top: 1.1rem !important;
  font-family: var(--sans);
  font-size: .74rem;
  letter-spacing: .04em;
  line-height: 1.9;
  color: var(--ink-3) !important;
  padding-top: .9rem;
  border-top: 1px solid var(--rule-soft);
}

.colophon {
  margin-top: 5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: .72rem;
  letter-spacing: .08em;
  color: var(--ink-3);
}
.colophon p { margin: 0 0 .3rem; }
.colophon .muted { color: var(--ink-3); opacity: .75; }

.nowrap { white-space: nowrap; }

/* ── Entrance ──────────────────────────────────────────────── */

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

.name, .standfirst, .locale, .rail-block, .section, .colophon {
  animation: rise .85s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 85ms + 60ms);
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ── Narrow ────────────────────────────────────────────────── */

@media (max-width: 60rem) {
  .sheet {
    grid-template-columns: 1fr;
    padding: 3.5rem 1.6rem 4.5rem;
    row-gap: 3rem;
  }
  .rail { position: static; }
  .name { font-size: clamp(2.8rem, 13vw, 4rem); }
  .entry {
    grid-template-columns: 1fr;
    row-gap: .55rem;
  }
  .years { padding-top: 0; }
  .section { margin-bottom: 3.25rem; }
}

/* ── Print: this should come out as a real CV ──────────────── */

@media print {
  @page { margin: 16mm 15mm; }

  :root {
    --paper: #fff; --paper-2: #fff;
    --ink: #000; --ink-2: #222; --ink-3: #555;
    --rule: #bbb; --rule-soft: #ddd; --accent: #000;
  }

  .grain, .skip { display: none; }

  body { font-size: 10.5pt; line-height: 1.45; background: #fff; }

  .sheet {
    display: block;
    max-width: none;
    padding: 0;
  }

  .rail { position: static; margin-bottom: 1.2rem; }
  .name { font-size: 30pt; margin-bottom: .5rem; }
  .standfirst { max-width: none; font-size: 11pt; }

  /* Collapse the rail lists onto single lines — saves ~1in of page height */
  .rail-block { margin-bottom: .7rem; break-inside: avoid; }
  .rail .label { margin-bottom: .45rem; padding-bottom: .3rem; }
  .rail ul.plain li {
    display: inline;
    font-size: 10pt;
    line-height: 1.5;
  }
  .rail ul.plain li:not(:last-child)::after {
    content: " · ";
    color: #888;
  }

  a { border-bottom: 0; color: #000; }

  .section { margin-bottom: 1.4rem; }
  .section-head { margin-bottom: .9rem; font-size: 9pt; }

  .entry, .role, .section-head { break-inside: avoid; }
  .entry { padding: .6rem 0; grid-template-columns: 5.5rem 1fr; column-gap: 1.2rem; }
  .role + .role { margin-top: .7rem; }
  .org { font-size: 12pt; margin-bottom: .5rem; }
  .role-title { font-size: 10.5pt; }

  .colophon { display: none; }
}
