@font-face {
  font-family: "Big Shoulders Display";
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url("fonts/big-shoulders-latin.woff2") format("woff2");
}

:root {
  --felt: #1c1e21;
  --groove: #25282c;
  --stripe: #202225; /* felt groove at ~40% of the groove contrast */
  --raised: #2a2d32;
  --letter: #f1f1ee;
  --muted: #c3c7cc; /* 9.8:1 on felt */
  --crema: #d9a066;
  --crema-text: #e2b47e; /* lighter amber for small text, 8.8:1 on felt */
  --live: #6cc58a;
  --dim: #979da4; /* past and retired, 6.1:1 on felt */
  --metal: #4a4f56;

  --font-board: "Big Shoulders Display", "Arial Narrow", "Roboto Condensed", "Helvetica Neue", Arial, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --gutter: 16px;
  --radius: 8px; /* one radius for everything rounded: sheet, button, focus rings */
  --row: clamp(1.5rem, 3.4dvh, 2.25rem);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

html { height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  background-color: var(--felt);
  /* Letterboard felt: horizontal grooves the plastic letters slot into. */
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent calc(var(--row) - 2px),
    var(--stripe) calc(var(--row) - 2px),
    var(--stripe) var(--row)
  );
  color: var(--letter);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: var(--crema); }

:focus-visible {
  outline: 2px solid var(--crema);
  outline-offset: 4px;
  border-radius: var(--radius);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.page {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr;
  align-items: center;
  gap: clamp(0.25rem, 1.5dvh, 1.25rem);
  padding: max(var(--gutter), env(safe-area-inset-top)) var(--gutter) max(var(--gutter), env(safe-area-inset-bottom));
  max-width: 84rem;
  margin-inline: auto;
}

/* Cup scene */
.scene {
  margin: 0;
  justify-self: center;
  height: clamp(7rem, 23dvh, 20rem);
  aspect-ratio: 220 / 300;
}

.cup {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.spout { opacity: 0; } /* only exists during the pour */
.spout__body { fill: var(--metal); }

.stream,
.drop { fill: #6b3d1f; opacity: 0; }

.glass {
  fill: rgba(241, 241, 238, 0.06);
  stroke: rgba(241, 241, 238, 0.7);
  stroke-width: 2;
  stroke-linejoin: round;
}
.glass--inner { fill: none; stroke: rgba(241, 241, 238, 0.28); stroke-width: 1.25; }
.glass__shine { stroke: rgba(241, 241, 238, 0.35); stroke-width: 3; stroke-linecap: round; fill: none; }
.saucer { fill: var(--groove); }
.crema { fill: url(#crema); }

.steam path,
.steam-extra {
  fill: none;
  stroke: var(--letter);
  stroke-width: 3;
  stroke-linecap: round;
  opacity: 0.18;
}

/* Cup reactions to the menu (main.js). Everything here is hidden until a row asks for it. */
.steam-extra,
.crema-shade,
.spark,
.ice,
.glass-tint,
.ball { opacity: 0; }
.crema-shade { fill: url(#shade); } /* darker crema, fading into the coffee */
.spark {
  fill: none;
  stroke: var(--crema);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ice rect {
  fill: rgba(225, 238, 248, 0.28);
  stroke: rgba(232, 242, 250, 0.75);
  stroke-width: 1.2;
}
.glass-tint { fill: #8cc4ec; }
.ball circle { fill: #cddc4b; }
.ball path {
  fill: none;
  stroke: #f4f6e8;
  stroke-width: 1.2;
  stroke-linecap: round;
}

/* Board */
.board {
  align-self: start;
  justify-self: center;
  width: 100%;
  max-width: 34rem;
  display: flex;
  flex-direction: column;
}

.menu { margin-top: clamp(0.75rem, 3.6dvh, 2.75rem); }

.name {
  margin: 0;
  font-family: var(--font-board);
  font-weight: 800;
  font-size: clamp(2.25rem, min(12.5vw, 7.5dvh), 6rem);
  line-height: 0.95;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  text-align: center;
  text-decoration: underline 2px var(--crema);
  text-underline-offset: 0.14em;
}

.tagline {
  margin: clamp(0.6rem, 2dvh, 1.25rem) auto 0;
  max-width: 34ch;
  color: var(--muted);
  font-size: clamp(0.9375rem, min(4vw, 2.3dvh), 1.15rem);
  line-height: 1.45;
  text-align: center;
  text-wrap: balance;
}
.tagline__lead { display: block; } /* one thought per line: what I am, then what I do */

/* Menu: one job or project per row. */
.menu__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Phones: drink line, then date, then description. */
.row {
  /* The drink is twice the size of the project name, so a shared baseline makes the name look
     like it hangs low. Lift the project side by the cap-height difference so both tops line up,
     and raise the dots to meet the name's baseline. */
  --drink-size: clamp(1.35rem, min(6.6vw, 4.2dvh), 2.25rem);
  --name-size: clamp(0.95rem, min(4.2vw, 2.5dvh), 1.15rem);
  --lift: calc(0.7 * (var(--drink-size) - var(--name-size)));
  display: grid;
  grid-template-columns: minmax(min-content, 1fr) auto auto;
  align-items: baseline;
  column-gap: 0.5rem;
  padding: clamp(0.25rem, 0.75dvh, 0.6rem) 0;
  cursor: pointer;
}
.item { grid-column: 1; grid-row: 1; }
.item__work { grid-column: 2; grid-row: 1; }
.item__toggle { grid-column: 3; grid-row: 1; }
.item__work,
.item__date,
.item__toggle { position: relative; top: calc(-1 * var(--lift)); }
.item__date { grid-column: 1 / -1; grid-row: 2; }
.item__desc { grid-column: 1 / -1; grid-row: 3; }
.more { grid-column: 1 / -1; grid-row: 4; }

.item {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.item__drink {
  font-family: var(--font-board);
  font-weight: 700;
  font-size: var(--drink-size);
  line-height: 1.05;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color 0.2s var(--ease);
}

/* Dot leaders, like the gap between a drink and its price. */
.item__leader {
  flex: 1;
  min-width: 2.25rem;
  height: calc(var(--lift) + 0.5em);
  background: radial-gradient(circle, var(--muted) 1.1px, transparent 1.6px) 0 calc(100% - var(--lift)) / 9px 4px repeat-x;
  opacity: 0.45;
  position: relative;
  transition: opacity 0.2s var(--ease);
}
/* Opening a row pours amber along the dots, left to right. */
.item__leader::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, var(--crema) 1.1px, transparent 1.6px) 0 calc(100% - var(--lift)) / 9px 4px repeat-x;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}
.item[aria-expanded="true"] .item__leader { opacity: 1; }
.item[aria-expanded="true"] .item__leader::after { transform: scaleX(1); }

.item__work {
  min-width: 0; /* the project side wraps; the drink name never does */
  font-size: var(--name-size);
  font-weight: 600;
  line-height: 1.25;
  text-align: right;
}
.item__work a { text-decoration-color: rgba(241, 241, 238, 0.4); }
.item__work a:hover,
.item__work a:focus-visible { color: var(--crema); text-decoration-color: currentColor; }

.item__tags {
  display: inline-flex;
  flex-wrap: wrap;
  column-gap: 0.6em;
  margin-left: 0.4em;
}

.tag,
.item__date {
  font-size: 0.875rem;
  font-weight: 400;
  white-space: nowrap;
}
.tag { color: var(--muted); }
.tag--job,
.tag--oss,
.tag--wip { color: var(--crema-text); }
.tag--retired { color: var(--dim); }
.tag--live::before {
  content: "";
  display: inline-block;
  width: 0.5em;
  height: 0.5em;
  margin-right: 0.35em;
  border-radius: 50%;
  background: var(--live);
  vertical-align: 0.05em;
}

.item__date {
  margin-top: 0.15rem;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

.item__desc {
  margin: calc(0.1rem - var(--lift)) 0 0;
  max-width: 60ch;
  color: var(--muted);
  font-size: clamp(0.875rem, min(3.7vw, 2.1dvh), 1rem);
  line-height: 1.4;
}

/* Retired: same structure, quieter. Colours, not opacity, so contrast stays measurable (6.1:1). */
.row--retired .item__drink { color: #b3b7bc; }
.row--retired .item__name,
.row--retired .item__desc { color: var(--dim); }

.row:hover .item__drink,
.item[aria-expanded="true"] .item__drink { color: var(--crema); }
.row:hover .item__leader { opacity: 0.85; }

/* Plus that turns into a minus when the row is open. */
.item__toggle {
  position: relative;
  width: 0.75rem;
  height: 0.75rem;
  align-self: baseline; /* sits on the project name's line, even when its labels wrap */
  color: var(--dim);
  transition: color 0.2s var(--ease);
}
.item__toggle::before,
.item__toggle::after {
  content: "";
  position: absolute;
  inset: calc(50% - 1px) 0 auto;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
}
.item__toggle::after {
  transform: rotate(90deg);
  transition: transform 0.25s var(--ease);
}
.row:hover .item__toggle,
.row.is-open .item__toggle { color: var(--crema); }
.row.is-open .item__toggle::after { transform: rotate(0deg); }

/* Details: open inside the row, pushing the rows below down. */
.more {
  overflow: hidden; /* lets main.js animate the height */
}
.more__body {
  margin: 0.35rem 0 0;
  max-width: 60ch;
  line-height: 1.4;
}
.more__body + .more__body { margin-top: 0.2rem; }
.more__notes {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.875rem;
}
.more__notes span { color: var(--crema-text); font-weight: 600; margin-right: 0.4em; }
.more__links {
  margin: 0.15rem 0 0;
  font-size: 0.9375rem;
}
.more__links a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  color: var(--crema);
  font-weight: 600;
}

/* Wider: rows share one grid, so names, dates and descriptions line up down the menu. */
@media (min-width: 44rem) {
  .menu__list {
    display: grid;
    /* Drink column hugs the longest drink plus a minimum leader; the project column takes the rest. */
    grid-template-columns: max-content minmax(0, 1fr) max-content max-content;
    column-gap: 0.5rem;
  }
  .row {
    grid-column: 1 / -1;
    grid-template-columns: subgrid;
    column-gap: 0.5rem;
  }
  .item__work { text-align: left; }
  .item__date { grid-column: 3; grid-row: 1; margin-top: 0; text-align: right; }
  .item__toggle { grid-column: 4; }
  .item__desc { grid-column: 2 / -1; grid-row: 2; }
  .more { grid-column: 2 / -1; grid-row: 3; }
}

@media (hover: none) {
  .item { min-height: 36px; } /* fingers need a taller target than a cursor */
}
@media (max-width: 43.99rem) {
  .item__leader { min-width: 1.25rem; } /* phones: leave room for name, labels and the toggle */
}

/* Stacked layouts (phones, tablets) may scroll, so lift the profile icons to just under the
   tagline where they're seen first. Side-by-side desktop keeps them under the menu. */
@media (max-width: 55.99rem), (max-aspect-ratio: 1/1) {
  .board > header { order: 0; }
  /* Equal ~20px visible gaps: tagline text to icons, icons to the first drink. The 44px tap
     areas already add 11px above and below each 22px glyph, so the margins stay small. */
  .board > .links { order: 1; margin-top: 0.4375rem; }
  .board > .menu { order: 2; margin-top: 0.25rem; }
  .board > .menu .row:first-child { padding-top: 0; }
}

.about__close {
  margin-top: 0.75rem;
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(241, 241, 238, 0.35);
  border-radius: var(--radius);
  background: none;
  color: var(--letter);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.about__close:hover { border-color: var(--crema); color: var(--crema); }

/* Links: about 48px under the last menu row. */
.links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  column-gap: 0.25rem;
  margin-top: 2.25rem;
  font-weight: 600;
}
.links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.links__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--muted);
  border-radius: var(--radius);
  transition: color 0.2s var(--ease);
}
.links__icon:hover,
.links__icon:focus-visible { color: var(--crema); }
.icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.about-open { margin-left: 0.75rem; }

/* Footer button that looks like its link neighbours. */
.about-open {
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.about-open:hover { color: var(--crema); }

/* About: a bottom sheet on phones, a centred card on larger screens. */
.about {
  width: 100%;
  max-width: 100%;
  margin: auto 0 0;
  padding: 0; /* padding lives on .about__body so backdrop clicks are the only clicks on <dialog> */
  border: 0;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--raised);
  color: var(--letter);
  box-shadow: 0 -12px 32px rgba(8, 9, 10, 0.5);
}
.about__body { padding: 1.25rem var(--gutter) max(1rem, env(safe-area-inset-bottom)); }
.about[open] { animation: about-in 0.25s var(--ease); }
.about::backdrop { background: rgba(8, 9, 10, 0.6); }
@keyframes about-in { from { opacity: 0; transform: translateY(12px); } }

.about__title {
  margin: 0;
  font-family: var(--font-board);
  font-weight: 700;
  font-size: 1.75rem;
  letter-spacing: 0.02em;
  color: var(--crema-text);
}
.about__list { margin: 0.75rem 0 0; }
.about__list div + div { margin-top: 0.5rem; }
.about__list dt {
  color: var(--crema-text);
  font-size: 0.875rem;
  font-weight: 600;
}
.about__list dd { margin: 0; }

@media (min-width: 44rem) {
  .about__body { padding: 1.5rem; }
  .about {
    max-width: 28rem;
    margin: auto;
    border: 1px solid rgba(217, 160, 102, 0.35);
    border-radius: var(--radius);
    box-shadow: 0 16px 40px rgba(8, 9, 10, 0.55);
  }
}

/* Intro: hidden until main.js plays the pour. main.js drops the class if GSAP is missing. */
.intro .reveal,
.intro .scene { opacity: 0; }

/* Tablets and up: a wider board and a name that doesn't dwarf the menu. */
@media (min-width: 44rem) {
  .board { max-width: 48rem; }
  .name { font-size: clamp(2.5rem, min(8vw, 7.5dvh), 6rem); }
}

/* Wide or landscape: cup on the left, board on the right. */
@media (min-width: 56rem) and (min-aspect-ratio: 1/1), (max-height: 32rem) and (min-aspect-ratio: 4/3) {
  /* Columns hug their content and centre together, so cup and text read as one group. */
  .page {
    grid-template-columns: auto minmax(0, 54rem);
    grid-template-rows: 1fr;
    justify-content: center;
    gap: clamp(1rem, 2.5vw, 2.5rem);
  }
  .scene { height: clamp(10rem, 46dvh, 26rem); }
  .board {
    align-self: center;
    justify-self: start;
    max-width: 54rem;
  }
  .name,
  .tagline { text-align: left; }
  .tagline { margin-left: 0; max-width: 68ch; }
  .links { justify-content: flex-start; margin-left: -11px; } /* icon glyph, not its tap area, meets the text edge */
}

/* Short desktops (around 720px tall): the longest details need a little vertical room back. */
@media (min-width: 56rem) and (max-height: 50rem) {
  .menu { margin-top: clamp(0.75rem, 2.4dvh, 1.5rem); }
  .row { padding: 0.2rem 0; }
}

/* Short screens: status sits beside the project name, rows tighten, cup shrinks. */
@media (max-height: 40rem) and (max-aspect-ratio: 1/1) {
  .scene { height: clamp(6rem, 19dvh, 20rem); }
}
@media (max-height: 40rem) {
  .row { padding: 0.15rem 0; }
  .item__desc { margin-top: calc(-1 * var(--lift)); }
  .menu { margin-top: clamp(0.5rem, 2.5dvh, 1.25rem); }
  .links a { min-height: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  .about[open] { animation: none; }
  .item__drink,
  .item__leader,
  .item__leader::after,
  .item__toggle,
  .item__toggle::after { transition: none; }
}

/* 404: one centred message, no cup. */
.page.page--404 {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  place-items: center;
}
.page--404 .board { align-self: center; justify-self: center; }
.page--404 .name,
.page--404 .tagline { text-align: center; margin-inline: auto; }
.notfound__back {
  margin: 1.5rem 0 0;
  text-align: center;
  font-weight: 600;
}
.notfound__back a { color: var(--crema); }
