/* ===========================================================
   andrewvallemounce.com
   Concept: three concurrent careers drawn as lanes on one axis.
   Colour carries meaning — one hue per lane, used nowhere else.
   =========================================================== */

:root {
  --paper:    #e9eae4;
  --paper-2:  #e2e3dc;
  --ink:      #1a1c18;
  --ink-2:    #565950;
  --rule:     rgba(26, 28, 24, 0.16);
  --rule-soft:rgba(26, 28, 24, 0.08);

  /* lane hues — meaning, not decoration */
  --games:    #8c2f39;
  --web:      #2f5d62;
  --ops:      #7d4e15;

  --display: 'Archivo', system-ui, sans-serif;
  --body:    'Newsreader', Georgia, serif;

  --measure: 62ch;
  --wrap: 1080px;
  --step: clamp(3.5rem, 7vw, 6.5rem);
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: clamp(1rem, 0.35vw + 0.95rem, 1.09rem);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 3rem);
}

a { color: inherit; }

:where(a):focus-visible,
:where(button):focus-visible {
  outline: 2px solid var(--games);
  outline-offset: 3px;
}

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

/* ---------- top bar ---------- */
.topbar {
  border-bottom: 1px solid var(--rule);
}
.topbar-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: baseline;
  justify-content: space-between;
  padding-block: 1.1rem;
}
.wordmark {
  font-family: var(--display);
  font-variation-settings: 'wdth' 118, 'wght' 700;
  font-size: 1rem;
  letter-spacing: 0.01em;
  text-decoration: none;
}
.topbar nav {
  display: flex;
  gap: clamp(1rem, 3vw, 2rem);
  font-family: var(--display);
  font-variation-settings: 'wdth' 100, 'wght' 500;
  font-size: 0.875rem;
}
.topbar nav a {
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}
.topbar nav a:hover { border-bottom-color: var(--ink); }

/* ---------- hero ---------- */
.hero { padding-block: clamp(3rem, 8vw, 6rem) clamp(2.5rem, 6vw, 4.5rem); }

h1 {
  font-family: var(--display);
  font-variation-settings: 'wdth' 122, 'wght' 800;
  font-size: clamp(2.6rem, 8.5vw, 5.75rem);
  line-height: 0.96;
  letter-spacing: -0.015em;
  margin: 0 0 1.5rem;
  text-wrap: balance;
}

.deck {
  font-size: clamp(1.1rem, 0.6vw + 1rem, 1.3rem);
  max-width: var(--measure);
  margin: 0 0 clamp(2.5rem, 6vw, 4rem);
  color: var(--ink-2);
}

/* ---------- the concurrency chart ---------- */
.chart {
  margin: 0 0 clamp(2.5rem, 6vw, 3.5rem);
  padding-top: 1.75rem;
  position: relative;
}

.chart-grid {
  position: absolute;
  inset: 0 0 2.9rem;
  margin-left: var(--gutter, 0);
  pointer-events: none;
}
.chart-grid span {
  position: absolute;
  left: var(--x);
  top: 0;
  bottom: 0;
  border-left: 1px solid var(--rule-soft);
}
.chart-grid span:last-child { border-left-color: transparent; }
.chart-grid i {
  position: absolute;
  top: -1.6rem;
  left: 0;
  transform: translateX(-50%);
  font-family: var(--display);
  font-variation-settings: 'wdth' 100, 'wght' 500;
  font-style: normal;
  font-size: 0.72rem;
  color: var(--ink-2);
}

.lanes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.85rem;
}

.lane {
  display: grid;
  grid-template-columns: minmax(0, 6.5rem) 1fr;
  align-items: center;
  gap: 1rem;
}

.lane-name {
  font-family: var(--display);
  font-variation-settings: 'wdth' 100, 'wght' 600;
  font-size: 0.8rem;
  text-align: right;
  color: var(--lane);
}

.track {
  position: relative;
  display: block;
  height: 2.6rem;
  border-bottom: 1px solid var(--rule-soft);
}

.bar {
  position: absolute;
  left: var(--start);
  top: 0.35rem;
  height: 1.9rem;
  width: var(--len);
  background: var(--lane);
  display: flex;
  align-items: center;
  padding-inline: 0.7rem;
  overflow: hidden;
  transform-origin: left center;
}

.bar-label {
  font-family: var(--display);
  font-variation-settings: 'wdth' 92, 'wght' 500;
  font-size: 0.75rem;
  line-height: 1;
  color: var(--paper);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lane-web   { --lane: var(--web); }
.lane-ops   { --lane: var(--ops); }
.lane-games { --lane: var(--games); }

/* award marks */
.mark {
  position: absolute;
  left: var(--x);
  top: -0.2rem;
  width: 2px;
  height: 0.85rem;   /* overlaps the bar top so the mark reads as attached */
  background: var(--ink);
}
.mark::after {
  content: '';
  position: absolute;
  left: 50%;
  top: -0.4rem;
  width: 0.48rem;
  height: 0.48rem;
  transform: translateX(-50%) rotate(45deg);
  background: var(--ink);
}

figcaption {
  margin-top: 1.5rem;
  font-size: 0.95rem;
  color: var(--ink-2);
  max-width: var(--measure);
}

/* ---------- figures ---------- */
.figures {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 1.75rem 2rem;
  margin: 0;
  padding-top: clamp(2rem, 5vw, 3rem);
  border-top: 1px solid var(--rule);
}
.figures div { margin: 0; }
.figures dt {
  font-family: var(--display);
  font-variation-settings: 'wdth' 100, 'wght' 500;
  font-size: 0.78rem;
  color: var(--ink-2);
  margin-bottom: 0.3rem;
}
.figures dd {
  margin: 0;
  font-family: var(--display);
  font-variation-settings: 'wdth' 118, 'wght' 700;
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  line-height: 1;
}

/* ---------- bands ---------- */
.band {
  padding-block: var(--step);
  border-top: 1px solid var(--rule);
}
.band-alt { background: var(--paper-2); }
.band-close { padding-bottom: calc(var(--step) * 0.7); }

h2 {
  font-family: var(--display);
  font-variation-settings: 'wdth' 118, 'wght' 700;
  font-size: clamp(1.75rem, 3.5vw, 2.6rem);
  line-height: 1.05;
  margin: 0 0 1rem;
}

h3 {
  font-family: var(--display);
  font-variation-settings: 'wdth' 110, 'wght' 700;
  font-size: 1.25rem;
  line-height: 1.15;
  margin: 0 0 0.4rem;
}

.lede {
  font-size: 1.14rem;
  max-width: var(--measure);
  color: var(--ink-2);
  margin: 0 0 clamp(2rem, 5vw, 3rem);
}

/* ---------- work list ---------- */
.work {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: clamp(2.5rem, 6vw, 4rem);
}

.piece {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 2.75rem);
  align-items: start;
}

.piece-media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--paper-2);
  overflow: hidden;
}
.piece-media img,
.piece-media iframe {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border: 0;
}

/* click-to-play facade, only present when a video id is set */
.play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 0;
  padding: 0;
  background: rgba(26, 28, 24, 0.28);
  cursor: pointer;
  color: var(--paper);
  font-family: var(--display);
  font-variation-settings: 'wdth' 105, 'wght' 600;
  font-size: 0.85rem;
}
.play span {
  background: var(--games);
  padding: 0.55rem 1.1rem;
}
.play:hover span { background: var(--ink); }

.piece-text p { margin: 0 0 0.75rem; }

.award {
  font-family: var(--display);
  font-variation-settings: 'wdth' 100, 'wght' 600;
  font-size: 0.82rem;
  line-height: 1.35;
  color: var(--games);
}

.links a {
  font-family: var(--display);
  font-variation-settings: 'wdth' 100, 'wght' 600;
  font-size: 0.85rem;
  text-decoration: none;
  border-bottom: 2px solid var(--games);
  padding-bottom: 1px;
}
.links a:hover { background: var(--games); color: var(--paper); }

.aside {
  margin: clamp(2.5rem, 6vw, 3.5rem) 0 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  max-width: var(--measure);
  color: var(--ink-2);
}

/* ---------- plain lists / two-up ---------- */
.plain {
  margin: 0 0 1.5rem;
  padding-left: 1.1rem;
  max-width: var(--measure);
}
.plain li { margin-bottom: 0.5rem; }

.two-up {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  gap: clamp(1.75rem, 4vw, 3rem);
}
.two-up p { margin: 0 0 0.6rem; }

.contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
  font-family: var(--display);
  font-variation-settings: 'wdth' 105, 'wght' 500;
  font-size: 1.05rem;
}
.contact-list a { text-decoration: none; border-bottom: 1px solid var(--rule); }
.contact-list a:hover { border-bottom-color: var(--ink); }

/* award tooltip, positioned by main.js */
.tip {
  position: absolute;
  z-index: 40;
  max-width: 20rem;
  background: var(--ink);
  color: var(--paper);
  padding: 0.5rem 0.75rem;
  font-family: var(--display);
  font-variation-settings: 'wdth' 100, 'wght' 500;
  font-size: 0.8rem;
  line-height: 1.35;
  pointer-events: none;
}
.mark:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* ---------- footer ---------- */
.foot {
  border-top: 1px solid var(--rule);
  padding-block: 2rem;
  font-size: 0.9rem;
  color: var(--ink-2);
}
.foot p { margin: 0; }

/* ---------- the one motion moment ---------- */
@media (prefers-reduced-motion: no-preference) {
  .chart .bar {
    transform: scaleX(0);
    animation: draw 900ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
  }
  .lane-web   .bar { animation-delay: 120ms; }
  .lane-ops   .bar { animation-delay: 320ms; }
  .lane-games .bar { animation-delay: 520ms; }

  .chart .mark {
    opacity: 0;
    animation: appear 320ms ease-out forwards;
  }
  .mark:nth-of-type(2) { animation-delay: 1000ms; }
  .mark:nth-of-type(3) { animation-delay: 1090ms; }
  .mark:nth-of-type(4) { animation-delay: 1180ms; }
  .mark:nth-of-type(5) { animation-delay: 1270ms; }

  @keyframes draw   { to { transform: scaleX(1); } }
  @keyframes appear { to { opacity: 1; } }
}

/* ---------- narrow screens ---------- */
@media (max-width: 720px) {
  .piece { grid-template-columns: 1fr; }

  .lane {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
  .lane-name { text-align: left; }
  .chart-grid { inset: 0 0 2.9rem; }
  .bar-label { font-size: 0.68rem; }
}

@media (max-width: 420px) {
  .bar-label { display: none; }
}
