/* YouTube Notes Pro: the study in blue. A cobalt screen, a video with its paper notes beside it, the icon's pixel
   caret at the end of the lines that matter, and the bookmark's yellow as the only other colour. */

@font-face {
  font-family: 'Instrument Serif';
  src: url('/assets/worlds/fonts/instrument-serif-latin.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Instrument Serif';
  src: url('/assets/worlds/fonts/instrument-serif-italic-latin.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Onest';
  src: url('/assets/worlds/fonts/onest-latin-wght.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --cobalt: #1232c4;
  --cobalt-deep: #0d26a0;
  --paper: #f3f5fb;
  --sheet: #fbfcff;
  --ink: #0c1a4f;
  --ink-2: #47527e;
  --rule: rgb(12 26 79 / 0.14);
  --electric: #004dff;
  --note: #eaf6fa;
  --note-edge: #6d81ed;
  --stamp: #4e58d6;
  --mark: #fae175;
  --mark-edge: #d3b52a;
  --mark-ink: #4a3d00;
  --serif: 'Instrument Serif', 'Iowan Old Style', Georgia, serif;
  --sans: 'Onest', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --gutter: clamp(20px, 5vw, 80px);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  /* the world's colour all the way down, so the arrival fade and the overscroll are cobalt; paper is laid on top */
  background: var(--cobalt);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.6;
  font-weight: 420;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, p, ol, ul, dl, dd, figure, blockquote { margin: 0; padding: 0; }
ol, ul { list-style: none; }
img, video, svg { display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
a:focus-visible, button:focus-visible, summary:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--electric); outline-offset: 3px; border-radius: 6px;
}
.yn-hero a:focus-visible, .yn-last a:focus-visible,
.world-colophon a:focus-visible { outline-color: #fff; }

h1, h2 { font-family: var(--serif); font-weight: 400; letter-spacing: -0.012em; text-wrap: balance; }
p { max-width: 62ch; text-wrap: pretty; }
.yn-wrap { max-width: 1240px; margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.yn-nw { white-space: nowrap; }
.yn-caret { display: inline-block; height: 0.74em; width: auto; margin: 0 0 0 0.1em; vertical-align: -0.02em; fill: currentColor; }

/* ---------- Hero: what it does, and the picture of it ---------- */
.yn-hero { display: flex; flex-direction: column; min-height: min(100svh, 920px); background: var(--cobalt); color: #fff; }
.yn-top { display: flex; align-items: center; gap: clamp(16px, 3vw, 44px); min-height: 76px; padding: 0 var(--gutter); font-size: 16px; font-weight: 520; }
.yn-top .world-exit { margin-left: -4px; }
.world-exit:hover span { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.world-lang { display: inline-flex; align-items: center; justify-content: flex-end; min-width: 44px; min-height: 44px; margin-left: auto; margin-right: -4px; font-size: 16px; font-weight: 600; letter-spacing: 0.02em; }
.yn-brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 560; letter-spacing: -0.01em; }
.yn-logo { width: 21px; height: 21px; flex: none; }
.yn-logo__play { fill: currentColor; opacity: 0.55; }
.yn-logo__caret { fill: currentColor; }

.yn-hero__grid {
  display: grid; grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr); gap: clamp(40px, 5vw, 84px); align-items: center;
  width: 100%; margin-top: auto; margin-bottom: auto; padding-top: clamp(28px, 5vh, 64px); padding-bottom: clamp(56px, 10vh, 120px);
}
.yn-copy h1 { font-size: clamp(2.5rem, 4.1vw, 3.9rem); line-height: 1; }
.yn-copy .yn-caret { animation: yn-blink 1.1s steps(1, end) 0.9s 6; }
@keyframes yn-blink { 50% { opacity: 0; } }
.yn-lead { margin-top: clamp(18px, 2.6vh, 26px); max-width: 30em; font-size: clamp(1.06rem, 1.25vw, 1.2rem); line-height: 1.55; color: rgb(255 255 255 / 0.86); }
.yn-act { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; margin-top: clamp(26px, 4vh, 38px); }
.yn-site { display: inline-flex; align-items: center; min-height: 48px; font-size: 17px; font-weight: 560; text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 5px; text-decoration-color: rgb(255 255 255 / 0.45); }
@media (hover: hover) and (pointer: fine) { .yn-site:hover { text-decoration-color: #fff; } }

/* The button is a key: it sits on its edge and goes down when pressed. */
.yn-btn {
  display: inline-flex; align-items: center; min-height: 54px; padding: 0 28px 2px;
  background: #fff; color: var(--cobalt); text-decoration: none;
  font-size: 18px; font-weight: 620; letter-spacing: -0.01em;
  border-radius: 14px; box-shadow: 0 4px 0 rgb(4 14 70 / 0.42), 0 18px 40px -18px rgb(4 14 70 / 0.7);
  transition: transform 120ms var(--ease), box-shadow 120ms var(--ease);
}
.yn-btn:active { transform: translateY(4px); box-shadow: 0 0 0 rgb(4 14 70 / 0.42), 0 8px 20px -14px rgb(4 14 70 / 0.7); }
@media (hover: hover) and (pointer: fine) {
  .yn-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 rgb(4 14 70 / 0.42), 0 24px 46px -18px rgb(4 14 70 / 0.75); }
  .yn-btn:hover:active { transform: translateY(4px); box-shadow: 0 0 0 rgb(4 14 70 / 0.42), 0 8px 20px -14px rgb(4 14 70 / 0.7); }
}

/* The picture: a video, and the notes taken on it. Click a note and the playhead goes to its second. */
.yn-demo {
  display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 18px;
  padding: 14px; border-radius: 24px; background: var(--paper); color: var(--ink);
  box-shadow: 0 40px 80px -40px rgb(3 10 60 / 0.75);
}
.yn-vid { position: relative; display: flex; flex-direction: column; justify-content: flex-end; min-width: 0; min-height: 270px; border-radius: 14px; background: var(--ink); color: #fff; overflow: hidden; }
.yn-vid__play { position: absolute; left: 50%; top: 44%; display: grid; place-items: center; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%; background: rgb(255 255 255 / 0.12); }
.yn-vid__play svg { width: 26px; height: 26px; margin-left: 3px; fill: #fff; }
.yn-vid__bar { padding: 0 18px 16px; }
.yn-vid__time { font-size: 13.5px; font-weight: 520; font-variant-numeric: tabular-nums; color: rgb(255 255 255 / 0.8); }
.yn-line { position: relative; height: 4px; margin-top: 10px; border-radius: 2px; background: rgb(255 255 255 / 0.22); }
.yn-line__fill { position: absolute; inset: 0; border-radius: 2px; background: #fff; transform-origin: 0 50%; transition: transform 480ms var(--ease); }
.yn-line__dot { position: absolute; top: -4px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--mark); box-shadow: 0 0 0 3px var(--ink); }
.yn-line__pos { position: absolute; inset: 0; transition: transform 480ms var(--ease); }
.yn-line__pos i { position: absolute; left: -7px; top: -5px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px var(--ink); }

.yn-col { display: flex; flex-direction: column; min-width: 0; padding: 8px 6px 6px 0; }
.yn-hint { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; font-size: 14.5px; color: var(--ink-2); }
.yn-hint__keys { display: inline-flex; gap: 4px; }
.yn-k {
  display: inline-flex; align-items: center; gap: 4px; padding: 5px 8px 6px;
  font: 600 12.5px/1 var(--sans); letter-spacing: 0.01em; white-space: nowrap;
  color: var(--ink); background: #fff; border-radius: 7px;
  box-shadow: inset 0 0 0 1px rgb(12 26 79 / 0.16), 0 2px 0 rgb(12 26 79 / 0.18);
}
.yn-k svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }
.yn-notes { display: grid; gap: 8px; }
.yn-note {
  display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 11px 13px; text-align: left; cursor: pointer;
  font: 460 15px/1.4 var(--sans); color: var(--ink);
  border-radius: 12px; background: var(--note); border: 2px solid rgb(109 129 237 / 0.36);
  transition: border-color 160ms ease;
}
.yn-note b { flex: none; font-weight: 650; font-size: 13.5px; line-height: 1.55; font-variant-numeric: tabular-nums; color: var(--stamp); }
.yn-note[aria-current='true'] { border-color: var(--note-edge); }
.yn-note__flag { flex: none; width: 13px; height: 14px; margin: 4px -4px 0 0; fill: currentColor; }
.yn-note.is-mark { background: var(--mark); border-color: rgb(211 181 42 / 0.6); color: var(--mark-ink); font-weight: 650; }
.yn-note.is-mark b { color: rgb(74 61 0 / 0.66); }
.yn-note.is-mark[aria-current='true'] { border-color: var(--mark-edge); }
@media (hover: hover) and (pointer: fine) { .yn-note:hover { border-color: var(--note-edge); } .yn-note.is-mark:hover { border-color: var(--mark-edge); } }

/* ---------- Arrival: the screen is already cobalt; the words rise, the picture fades in ---------- */
@keyframes yn-up { from { opacity: 0; transform: translateY(16px); } }
@keyframes yn-fade { from { opacity: 0; } }
html.is-arriving body { animation: none; }
html.is-arriving .yn-copy { animation: yn-up 820ms var(--ease) 60ms both; }
html.is-arriving .yn-top > * { animation: yn-fade 600ms ease 420ms both; }
html.is-arriving .yn-demo { animation: yn-up 860ms var(--ease) 260ms both; }

/* ---------- Paper: two lines, three questions ---------- */
.yn-paper { background: var(--paper); color: var(--ink); padding: clamp(72px, 12vh, 130px) 0 clamp(80px, 13vh, 140px); }
.yn-beats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(36px, 6vw, 96px); }
.yn-beat { padding-top: 22px; border-top: 1px solid var(--rule); }
.yn-beat h2, .yn-faq h2 { font-size: clamp(1.8rem, 2.5vw, 2.3rem); line-height: 1.08; }
.yn-beat p { margin-top: 12px; max-width: 30em; color: var(--ink-2); }

.yn-faq { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(28px, 6vw, 96px); margin-top: clamp(72px, 12vh, 130px); }
.yn-faq__list > div { padding: 16px 0 18px; border-top: 1px solid var(--rule); }
.yn-faq__list > div:last-child { border-bottom: 1px solid var(--rule); }
.yn-faq h3 { font: 600 1rem/1.4 var(--sans); letter-spacing: -0.005em; }
.yn-faq p { margin-top: 2px; color: var(--ink-2); }

/* ---------- The last screen: cobalt again, one line and the two ways on ---------- */
.yn-last { padding: clamp(80px, 14vh, 150px) 0 clamp(70px, 12vh, 130px); background: var(--cobalt); color: #fff; }
.yn-last h2 { max-width: 13em; font-size: clamp(2.2rem, 3.6vw, 3.4rem); line-height: 1.02; }

.world-colophon {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 24px;
  padding: 26px var(--gutter) 30px; background: var(--cobalt); color: rgb(255 255 255 / 0.72); font-size: 15px;
  border-top: 1px solid rgb(255 255 255 / 0.16);
}
.world-colophon p { margin: 0; max-width: none; }
.world-colophon nav a { display: inline-flex; align-items: center; min-height: 44px; text-underline-offset: 3px; }

/* ---------- Narrower ---------- */
@media (max-width: 1000px) {
  .yn-hero { min-height: 0; }
  .yn-hero__grid { grid-template-columns: minmax(0, 1fr); padding-top: 36px; padding-bottom: 64px; }
  .yn-demo { max-width: 720px; }
}
@media (max-width: 700px) {
  body { font-size: 17px; }
  .yn-top { min-height: 64px; font-size: 15px; }
  .yn-demo { grid-template-columns: minmax(0, 1fr); padding: 10px; border-radius: 20px; }
  .yn-vid { min-height: 0; aspect-ratio: 16 / 9; }
  .yn-col { padding: 6px 4px 4px; }
  .yn-beats, .yn-faq { grid-template-columns: minmax(0, 1fr); }
  .world-colophon { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 420px) {
  .yn-brand span { font-size: 15px; }
  .yn-btn { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  html.is-arriving .yn-copy, html.is-arriving .yn-top > *, html.is-arriving .yn-demo { animation: yn-fade 240ms ease both; }
  .yn-copy .yn-caret { animation: none; }
  .yn-btn, .yn-note, .yn-line__fill, .yn-line__pos { transition: none; }
}
