@font-face {
  font-family: "Jost";
  src: url("fonts/jost-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Jost";
  src: url("fonts/jost-latin-500-normal.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}

:root {
  --bg: #c8c5c0;        /* warm grey board */
  --bg-2: #bdbab5;
  --ink: #1f1f22;
  --ink-2: #4a4a4e;
  --red: #e1262e;
  --yellow: #f6c800;
  --blue: #1670c0;
  --pad: clamp(18px, 4vw, 48px);
  --max: 1080px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.55 "Jost", "Avenir Next", "Century Gothic", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button { font: inherit; color: inherit; cursor: pointer; }
img, svg { display: block; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

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

/* ---------- hero ---------- */
.hero {
  position: relative;
  padding: calc(var(--pad) + 14px) var(--pad) 0;
  max-width: 1280px;
  margin: 0 auto;
}

.key {
  position: absolute; top: 12px; right: var(--pad);
  display: flex; gap: 0;
}
.key i { display: block; width: 14px; height: 14px; background: var(--bg-2); transition: background-color .3s var(--ease); }
.key i:nth-child(2) { background: #b3b0ab; }
.key i:nth-child(3) { background: #a9a6a1; width: 20px; }
.key i.on[data-g="picture"]  { background: var(--red); }
.key i.on[data-g="branding"] { background: var(--yellow); }
.key i.on[data-g="scoring"]  { background: var(--blue); }

.name { margin: 0; font-weight: 500; }
.overlay { width: 100%; height: auto; max-width: 1000px; margin: 0 auto; overflow: visible; }

/* block-type shading: every word is greys until its link is active */
.overlay rect { transition: fill .32s var(--ease) var(--d, 0ms); shape-rendering: crispEdges; }
.w-name .c0 { fill: #1f1f22; } .w-name .c1 { fill: #3a3a3e; } .w-name .c2 { fill: #55555a; } .w-name .c3 { fill: #2c2c30; }
.w-scoring  .c0 { fill: #bebbb6; } .w-scoring  .c1 { fill: #b5b2ad; } .w-scoring  .c2 { fill: #c2bfba; } .w-scoring  .c3 { fill: #b9b6b1; }
.w-picture  .c0 { fill: #aeaba6; } .w-picture  .c1 { fill: #a5a29d; } .w-picture  .c2 { fill: #b4b1ac; } .w-picture  .c3 { fill: #9c9994; }
.w-branding .c0 { fill: #a19e99; } .w-branding .c1 { fill: #989590; } .w-branding .c2 { fill: #aaa7a2; } .w-branding .c3 { fill: #918e89; }

.w-picture.on  .c0 { fill: #e1262e; } .w-picture.on  .c1 { fill: #c41d25; } .w-picture.on  .c2 { fill: #ee4a4f; } .w-picture.on  .c3 { fill: #a8161d; }
.w-branding.on .c0 { fill: #f6c800; } .w-branding.on .c1 { fill: #e6b400; } .w-branding.on .c2 { fill: #ffd736; } .w-branding.on .c3 { fill: #d9a600; }
.w-scoring.on  .c0 { fill: #1670c0; } .w-scoring.on  .c1 { fill: #1a8fd8; } .w-scoring.on  .c2 { fill: #0f5ea3; } .w-scoring.on  .c3 { fill: #2ba3e6; }

/* the one line: three links in primary colours */
.line {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: 10px 12px;
  margin: clamp(20px, 3.5vw, 40px) auto 0;
  font-weight: 500;
}
.word {
  border: 0; border-radius: 0;
  padding: .62em .9em .58em;
  font-size: clamp(12px, 1.25vw, 15px);
  letter-spacing: .12em;
  line-height: 1;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.word.red    { background: var(--red);    color: #fff; }
.word.yellow { background: var(--yellow); color: var(--ink); }
.word.blue   { background: var(--blue);   color: #fff; }
.word:hover, .word[aria-pressed="true"] { transform: translateY(-2px); box-shadow: 0 2px 0 var(--ink); }
.sep { color: #8d8a86; }
@media (max-width: 560px) { .sep { display: none; } }

/* ---------- player ---------- */
main { padding: 0 var(--pad); }
section { max-width: var(--max); margin: 0 auto; }

.player { margin-top: clamp(24px, 3.5vw, 40px); max-width: 960px; }
.screen {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--ink);
  overflow: hidden;
}
.poster, .mount, .shield { position: absolute; inset: 0; }
.poster img, .poster svg { width: 100%; height: 100%; object-fit: cover; }
.poster img { filter: grayscale(1) contrast(1.05); }
.mount iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.shield { border: 0; background: transparent; display: none; }
.screen.started .shield { display: block; }
.screen.started .poster { opacity: 0; transition: opacity .4s; }
.screen.dummy.started .poster { opacity: 1; }
.screen.blocked .shield { display: none; }

.start {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center; gap: 16px;
}
.screen.started .start { display: none; }
.bigplay {
  position: relative;
  width: clamp(72px, 10vw, 104px); aspect-ratio: 1;
  border: 0; background: var(--bg);
  display: grid; place-items: center;
}
.bigplay svg { width: 44%; fill: var(--ink); margin-left: 6%; }
.bigplay::after {
  content: ""; position: absolute; inset: 0;
  border: 2px solid var(--bg);
  animation: pulse 2.4s var(--ease) infinite;
  pointer-events: none;
}
@keyframes pulse {
  0%   { transform: scale(1);    opacity: .7; }
  70%  { transform: scale(1.32); opacity: 0; }
  100% { transform: scale(1.32); opacity: 0; }
}
.len {
  background: var(--ink); color: var(--bg);
  font-weight: 500; font-size: clamp(15px, 1.6vw, 19px);
  letter-spacing: .06em; font-variant-numeric: tabular-nums;
  padding: .35em .6em .3em;
}
.len:empty { display: none; }

/* dummy poster animates while "playing" so the controls can be tried with no video */
.screen.dummy.playing .poster rect.m { animation: blink 1.1s steps(2, jump-none) infinite; animation-delay: var(--d); }
@keyframes blink { 50% { fill: #8d8a86; } }

.controls {
  display: grid;
  grid-template-columns: 48px 48px 1fr auto 48px;
  align-items: center; gap: 4px 10px;
  background: var(--ink); color: var(--bg);
  padding: 2px 6px;
}
.controls[hidden] { display: none; }
.ctl {
  height: 48px; border: 0; background: transparent; color: var(--bg);
  display: grid; place-items: center;
  font-weight: 500; font-size: 14px; letter-spacing: .04em; font-variant-numeric: tabular-nums;
}
.ctl svg { width: 22px; fill: currentColor; }
.ctl .i-play { display: none; }
.controls.paused .ctl .i-play { display: inline; }
.controls.paused .ctl .i-pause { display: none; }
.ctl:hover { color: #fff; }
.time { font-size: 14px; font-variant-numeric: tabular-nums; letter-spacing: .04em; white-space: nowrap; }
.slash { opacity: .5; }

.scrub {
  --p: 0%;
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 44px; margin: 0;
  background: transparent; cursor: pointer;
}
.scrub::-webkit-slider-runnable-track {
  height: 4px;
  background: linear-gradient(to right, var(--bg) var(--p), #5b5b60 var(--p));
}
.scrub::-moz-range-track { height: 4px; background: #5b5b60; }
.scrub::-moz-range-progress { height: 4px; background: var(--bg); }
.scrub::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 14px; margin-top: -5px;
  background: var(--yellow); border: 0; border-radius: 0;
}
.scrub::-moz-range-thumb { width: 14px; height: 14px; background: var(--yellow); border: 0; border-radius: 0; }

.now {
  min-height: 1.5em; margin: 12px 0 0;
  font-weight: 500; font-size: 14px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-2);
}

@media (max-width: 560px) {
  .controls { grid-template-columns: 48px 48px 1fr 48px; padding: 0 4px 4px; }
  .scrub { grid-column: 1 / -1; grid-row: 1; }
  .time { justify-self: center; }
}

/* ---------- rescores ---------- */
.rescores { margin-top: clamp(64px, 9vw, 112px); }
.label {
  margin: 0 0 20px;
  font-weight: 500; font-size: 13px; letter-spacing: .18em; text-transform: uppercase;
  display: flex; align-items: center; gap: 10px;
}
.label::before { content: ""; width: 12px; height: 12px; background: var(--ink); }
.group + .group { margin-top: 44px; }
.group h3 {
  margin: 0 0 14px;
  font-weight: 500; font-size: 13px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-2);
}
.grid { display: grid; grid-template-columns: 1fr; gap: 28px 22px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .grid { grid-template-columns: repeat(3, 1fr); } }

.tile {
  display: block; width: 100%; padding: 0; border: 0; background: none; text-align: left;
  -webkit-tap-highlight-color: transparent;
}
.thumb { position: relative; aspect-ratio: 16 / 9; background: var(--bg-2); overflow: hidden; }
.thumb img, .thumb svg { width: 100%; height: 100%; object-fit: cover; transition: filter .35s var(--ease), transform .5s var(--ease); }
@media (hover: hover) {
  .thumb img { filter: grayscale(1); }
  .tile:hover .thumb img { filter: none; transform: scale(1.03); }
  .tile:hover .thumb rect.m { fill: var(--tc); }
}
.thumb rect.m { transition: fill .3s var(--ease) var(--d, 0ms); }
.tile.active .thumb rect.m { fill: var(--tc); }
.tile.active .thumb img { filter: none; }
.tile.active .thumb { outline: 3px solid var(--ink); outline-offset: 3px; }
.rtag, .tlen {
  position: absolute;
  font-weight: 500; font-size: 11px; letter-spacing: .14em; line-height: 1;
  padding: 5px 7px 4px;
  background: var(--ink); color: var(--bg);
}
.rtag { top: 10px; left: 10px; }
.tlen { bottom: 10px; right: 10px; font-variant-numeric: tabular-nums; letter-spacing: .06em; }
.tlen:empty { display: none; }
.brand {
  display: block; margin-top: 12px;
  font-weight: 500; font-size: 15px; letter-spacing: .1em; text-transform: uppercase;
}
.spot { display: block; color: var(--ink-2); font-size: 16px; }

.note {
  margin: 36px 0 0; max-width: 46em;
  font-size: 15px; color: var(--ink-2);
}

/* ---------- me ---------- */
.me {
  margin-top: clamp(72px, 10vw, 128px);
  display: grid; gap: 28px;
}
.photo img { width: 100%; height: auto; background: var(--bg-2); }
.bio p { margin: 0 0 1em; font-size: clamp(18px, 1.9vw, 21px); line-height: 1.5; max-width: 34em; }
.bio p:first-child { font-weight: 500; }
@media (min-width: 900px) {
  .me { grid-template-columns: 460px 1fr; gap: 56px; align-items: center; }
}

/* ---------- contact ---------- */
.contact {
  margin-top: clamp(72px, 10vw, 128px);
  padding-bottom: clamp(72px, 10vw, 128px);
  display: flex; justify-content: center;
}
.mail {
  display: inline-block;
  background: var(--ink); color: var(--bg);
  text-decoration: none;
  font-weight: 500; font-size: clamp(17px, 2.6vw, 28px); letter-spacing: .06em;
  padding: .9em 1.4em .85em;
  max-width: 100%; overflow-wrap: anywhere; text-align: center;
  transition: background-color .25s var(--ease), color .25s var(--ease);
}
.mail:hover { background: var(--blue); color: #fff; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; transition-delay: 0ms !important; }
}
