/* ============================================================
   ethantyoung.com
   The resume as an editorial document: a label rail beside a
   record column. Warm ivory, one clay accent, hairline rules.
   ============================================================ */

@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('fonts/sourceserif-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 300 800;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url('fonts/archivo-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 300 800;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url('fonts/archivo-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* ground and ink */
  --paper:       #f4f1ea;
  --ink:         #1a1917;
  --ink-body:    #2e2b26;
  --ink-2:       #57534b;
  --ink-3:       #6b6357;

  /* the one accent: actions and measured figures, nothing else */
  --clay:        #a44a28;
  --clay-deep:   #7f3a1f;

  --rule:        #ddd7c8;
  --rule-strong: #c2bba8;

  --serif: 'Source Serif 4', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  --sans:  'Archivo', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;

  --bar:   3.5rem;                       /* sticky bar height */
  --gut:   clamp(1.5rem, 6vw, 4.5rem);   /* page margin */
  --rail:  9.5rem;                       /* label rail */
  --span:  clamp(2rem, 5vw, 4rem);       /* rail-to-record gap */
}

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

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

body {
  font-family: var(--sans);
  font-variation-settings: 'wdth' 100, 'wght' 400;
  font-size: 1rem;
  line-height: 1.6;
  background: var(--paper);
  color: var(--ink-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- browser surfaces belong to the design ---- */
::selection { background: var(--clay); color: var(--paper); }
body { caret-color: var(--clay); scrollbar-color: var(--rule-strong) var(--paper); scrollbar-width: thin; }
::-webkit-scrollbar { width: 11px; }
::-webkit-scrollbar-track { background: var(--paper); }
::-webkit-scrollbar-thumb { background: var(--rule-strong); border: 3px solid var(--paper); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-3); }

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

.wrap {
  max-width: 68rem;
  margin-inline: auto;
  padding-inline: var(--gut);
}

.skip { position: absolute; left: -9999px; }
.skip:focus {
  left: 0; top: 0; z-index: 90;
  background: var(--ink); color: var(--paper);
  padding: .75rem 1.25rem;
  font-size: .8125rem; letter-spacing: .06em; text-transform: uppercase;
  font-variation-settings: 'wdth' 92, 'wght' 600;
}

/* ============================================================
   STICKY BAR — arrives only once the masthead has left
   ============================================================ */
.bar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  height: var(--bar);
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  transform: translateY(-100%);
  opacity: 0;
  transition: transform .45s cubic-bezier(.16,1,.3,1), opacity .3s cubic-bezier(.16,1,.3,1);
}
.bar[data-shown] { transform: translateY(0); opacity: 1; }

.bar-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.bar-name {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.bar-nav {
  display: flex;
  align-items: center;
  gap: clamp(.875rem, 2.4vw, 1.75rem);
  list-style: none;
  min-width: 0;
}
.bar-nav a {
  font-variation-settings: 'wdth' 84, 'wght' 500;
  font-size: .8125rem;
  letter-spacing: .02em;
  color: var(--ink-2);
  text-decoration: none;
  white-space: nowrap;
  padding-block: .35rem;
  border-bottom: 1px solid transparent;
  transition: color .18s ease, border-color .18s ease;
}
.bar-nav a:hover { color: var(--ink); border-bottom-color: var(--rule-strong); }
.bar-nav a[aria-current="true"] { color: var(--ink); border-bottom-color: var(--clay); }

.bar-action {
  display: none;
  font-variation-settings: 'wdth' 88, 'wght' 600;
  font-size: .875rem;
  color: var(--clay);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--clay);
  text-underline-offset: 4px;
  white-space: nowrap;
}

/* ============================================================
   MASTHEAD
   ============================================================ */
.masthead {
  display: grid;
  grid-template-columns: minmax(0, var(--rail)) minmax(0, 1fr);
  grid-template-areas:
    "meta head"
    ".    contact";
  gap: 0 var(--span);
  padding-block: clamp(4.5rem, 13vw, 9rem) clamp(2.75rem, 6vw, 4.25rem);
}
.masthead-meta {
  grid-area: meta;
  font-variation-settings: 'wdth' 88, 'wght' 500;
  font-size: .875rem;
  line-height: 1.55;
  letter-spacing: .012em;
  color: var(--ink-3);
  padding-top: clamp(.4rem, 1.1vw, 1.05rem);
}
.masthead-head { grid-area: head; }
.masthead .contact { grid-area: contact; }

.name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.875rem, 8.5vw, 5.25rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
  color: var(--ink);
  text-wrap: balance;
}

.standfirst {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.1875rem, 2.6vw, 1.5rem);
  line-height: 1.45;
  color: var(--ink-2);
  margin-top: clamp(1rem, 2.4vw, 1.5rem);
  max-width: 38ch;
  text-wrap: pretty;
}

/* ---- contact row: one accented action, two quiet ones ---- */
.contact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem clamp(1.25rem, 3vw, 2.25rem);
  margin-top: clamp(1.75rem, 3.5vw, 2.5rem);
}
.contact a {
  font-variation-settings: 'wdth' 96, 'wght' 500;
  font-size: 1rem;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--rule-strong);
  text-underline-offset: 5px;
  transition: color .18s ease, text-decoration-color .18s ease;
}
.contact a:hover { color: var(--clay); text-decoration-color: var(--clay); }

.contact .action {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-variation-settings: 'wdth' 96, 'wght' 600;
  color: var(--clay);
  text-decoration-color: var(--clay);
}
.contact .action:hover { color: var(--clay-deep); text-decoration-color: var(--clay-deep); }
.action svg { flex: none; }
.action svg path, .action svg polyline, .action svg line {
  stroke: currentColor; stroke-width: 1.5; fill: none; stroke-linecap: round; stroke-linejoin: round;
}

/* ============================================================
   RECORD — label rail beside the entries
   ============================================================ */
.section {
  display: grid;
  grid-template-columns: minmax(0, var(--rail)) minmax(0, 1fr);
  gap: 0 var(--span);
  padding-block: clamp(2.75rem, 6vw, 4.5rem);
  border-top: 1px solid var(--rule);
  scroll-margin-top: calc(var(--bar) + 1rem);
}

/* the label holds its place while its entries pass it */
.section-label {
  position: sticky;
  top: calc(var(--bar) + 1.75rem);
  align-self: start;
  font-variation-settings: 'wdth' 78, 'wght' 600;
  font-size: .75rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding-top: .45rem;
}

.entry + .entry { margin-top: clamp(2.25rem, 4.5vw, 3.25rem); }

.entry-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.3125rem, 2.6vw, 1.625rem);
  line-height: 1.22;
  letter-spacing: -0.011em;
  color: var(--ink);
  text-wrap: balance;
}

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .25rem clamp(.875rem, 2vw, 1.375rem);
  margin-top: .5rem;
  font-variation-settings: 'wdth' 96, 'wght' 400;
  font-size: .9375rem;
  color: var(--ink-2);
}
.entry-meta time { font-variant-numeric: tabular-nums; }
/* spacing alone separates these; a glyph divider orphans on wrap */

/* the one measured figure, where a real one exists */
.entry-meta .figure {
  font-variation-settings: 'wdth' 92, 'wght' 600;
  font-size: .8125rem;
  letter-spacing: .045em;
  text-transform: uppercase;
  color: var(--clay);
  font-variant-numeric: tabular-nums;
}

.points {
  list-style: none;
  margin-top: clamp(.875rem, 2vw, 1.125rem);
  max-width: 68ch;
}
.points li {
  position: relative;
  padding-left: 1.5rem;
  font-size: 1rem;
  line-height: 1.68;
  color: var(--ink-body);
}
.points li + li { margin-top: .75rem; }
.points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .82em;
  width: .5rem;
  height: 1px;
  background: var(--clay);
}
.points strong {
  font-variation-settings: 'wdth' 100, 'wght' 600;
  color: var(--ink);
}

/* ---- skills: quiet rows, never badges ---- */
.skill-row {
  display: grid;
  grid-template-columns: minmax(0, 7.5rem) minmax(0, 1fr);
  gap: .25rem 1.5rem;
  padding-block: .875rem;
  max-width: 68ch;
}
.skill-row + .skill-row { border-top: 1px solid var(--rule); }
.skill-row dt {
  font-variation-settings: 'wdth' 78, 'wght' 600;
  font-size: .75rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding-top: .28rem;
}
.skill-row dd { font-size: 1rem; color: var(--ink-body); line-height: 1.62; }

/* ============================================================
   COLOPHON
   ============================================================ */
.contact--close {
  grid-column: 2;
  margin-top: 0;
}
.contact--close { gap: .75rem clamp(1.75rem, 4vw, 2.75rem); }
.contact--close a { font-size: 1.125rem; }
.contact--close .action { font-variation-settings: 'wdth' 96, 'wght' 600; }
@media (max-width: 820px) { .contact--close { grid-column: 1; } }

.colophon {
  border-top: 1px solid var(--rule);
  padding-block: clamp(2.5rem, 5vw, 3.5rem) clamp(3rem, 7vw, 5rem);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .75rem 2rem;
}
.colophon p, .colophon a {
  font-variation-settings: 'wdth' 92, 'wght' 400;
  font-size: .8125rem;
  letter-spacing: .04em;
  color: var(--ink-3);
}
.colophon a {
  color: var(--ink-2);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--rule-strong);
  text-underline-offset: 4px;
}
.colophon a:hover { color: var(--clay); text-decoration-color: var(--clay); }

/* ============================================================
   NARROW — the rail becomes a heading above its own entries
   ============================================================ */
@media (max-width: 820px) {
  :root { --bar: 3.25rem; }
  .section {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding-block: 1.5rem clamp(2.75rem, 6vw, 4.5rem);
  }
  /* tied to the rule above it, so it reads as a divider label, not an eyebrow */
  .section-label { position: static; padding-top: 0; margin-bottom: 2.5rem; }

  .masthead {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "head" "meta" "contact";
  }
  .masthead-meta { padding-top: 0; margin-top: clamp(1.25rem, 3vw, 2rem); }

  .bar-action { display: inline; }
  .skill-row { grid-template-columns: minmax(0, 1fr); gap: .2rem; }
  .bar-nav { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}
