/* Vibe Handling site. Four themes, one per FC Barcelona 26-27 kit. Home is the default. */

@font-face { font-family: "Archivo Black"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/archivo-black-400-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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Archivo Black"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/archivo-black-400-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: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("fonts/inter-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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("fonts/inter-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: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/jetbrains-mono-400-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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/jetbrains-mono-400-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; }

/* ---- Tokens ---------------------------------------------------------------- */

:root {
  --display: "Archivo Black", "Inter", system-ui, sans-serif;
  --text: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --r: 14px;
  --gutter: clamp(20px, 4vw, 48px);
  --measure: 66ch;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

/* Home: blaugrana. Navy for text, garnet for the one accent. */
:root, [data-theme="home"] {
  color-scheme: light;
  --ground: #E9EEF8;
  --surface: #FFFFFF;
  --ink: #1E2C53;
  --ink-2: #566389;
  --line: #C3CFE8;
  --accent: #9C1747;
  --accent-hover: #85133C;
  --on-accent: #FFFFFF;
  --accent-2: #1345A6;
  --inset: #1E2C53;
  --inset-ink: #E9EEF8;
  --theme-color: #E9EEF8;
}

/* Away: black fading into purple at the hem, gold logos. */
[data-theme="away"] {
  color-scheme: dark;
  --ground: linear-gradient(180deg, #131116 0%, #2A2145 45%, #3A2D63 100%) #131116;
  --surface: #271F3E;
  --ink: #E9E2F4;
  --ink-2: #B7ABD1;
  --line: #4B3F6C;
  --accent: #D2BF8E;
  --accent-hover: #E0D0A4;
  --on-accent: #1C1529;
  --accent-2: #A18BE0;
  --inset: #0E0C12;
  --inset-ink: #D9D0E8;
  --theme-color: #131116;
}

/* Third: Green Frost split by a zigzag into a deeper teal, navy collar, burgundy piping. */
[data-theme="third"] {
  color-scheme: light;
  --ground: #E0F3EF;
  --surface: #F8FCFB;
  --ink: #1C2A52;
  --ink-2: #4E6678;
  --line: #B4DCD7;
  --accent: #197689;
  --accent-hover: #13606F;
  --on-accent: #FFFFFF;
  --accent-2: #6A2540;
  --inset: #1C2A52;
  --inset-ink: #E0F3EF;
  --theme-color: #E0F3EF;
}

/* Fourth: light beige with navy and garnet. */
[data-theme="fourth"] {
  color-scheme: light;
  --ground: #EDE4D6;
  --surface: #FAF6EF;
  --ink: #161D36;
  --ink-2: #616880;
  --line: #D6C8B2;
  --accent: #6B2232;
  --accent-hover: #581B29;
  --on-accent: #FAF6EF;
  --accent-2: #161D36;
  --inset: #161D36;
  --inset-ink: #EDE4D6;
  --theme-color: #EDE4D6;
}

/* ---- Base ------------------------------------------------------------------ */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-color: var(--line) transparent;
}

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

body {
  margin: 0;
  /* At least one viewport tall, so the away kit's gradient ground reaches the bottom of a short page. 100% would be nothing here: html has no height. */
  min-height: 100vh;
  background: var(--ground);
  color: var(--ink);
  font: 400 17px/1.6 var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--accent); color: var(--on-accent); }
* { caret-color: var(--accent); }

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

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

img, svg { max-width: 100%; }
h1, h2, h3, p, ul, ol, dl, dd, pre { margin: 0; }
ul, ol { padding: 0; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -80px;
  z-index: 10;
  padding: 10px 16px;
  border-radius: var(--r);
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  transition: top .15s var(--ease);
}
.skip:focus { top: 12px; }

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

h1, h2 {
  font: 400 clamp(1.9rem, 1.3rem + 2vw, 2.9rem) / 1.12 var(--display);
  letter-spacing: -.02em;
  text-wrap: balance;
}
h1 { max-width: 22ch; }
h2 { font-size: clamp(1.35rem, 1.2rem + .7vw, 1.7rem); line-height: 1.2; }
h3 { font-size: 17px; font-weight: 700; line-height: 1.35; }
.hl { color: var(--accent); }
.nw { white-space: nowrap; }

/* 64px on a desktop leaves the next heading whole inside a 900px first screen, under the report and the prompt. */
.sec { margin-top: clamp(44px, 5vw, 64px); }

.sec-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 24px;
  margin-bottom: 16px;
}
.sec-head .more { font-size: 15px; font-weight: 600; white-space: nowrap; }

.meta { margin-top: 12px; color: var(--ink-2); font-size: 15px; }
.meta .hot { color: var(--ink); font-weight: 600; }

/* ---- Navigation and the theme switch --------------------------------------- */

header.wrap { padding-top: 22px; }

.nav {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "logo theme" "links links";
  align-items: center;
  gap: 10px 16px;
  min-height: 40px;
}
@media (min-width: 760px) {
  .nav {
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "logo links theme";
  }
}

.logo {
  grid-area: logo;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  justify-self: start;
  font: 400 20px/1 var(--display);
  white-space: nowrap;
  letter-spacing: -.02em;
  text-decoration: none;
}
.logo svg { width: 28px; height: 28px; flex: none; color: var(--accent); }

/* The name twice: the English wordmark in the display face, then the Chinese site name in a heavy sans at 85%, so the two read as one height. Under 640px the Chinese name drops to a second line (see the phone rules at the end of the nav), to keep the row with the theme swatches. */
.logo .en, .logo .zh { display: block; }
.logo .zh {
  margin-left: .5em;
  font: 700 .85em/1 "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  letter-spacing: .06em;
}

.nav .links {
  grid-area: links;
  display: flex;
  flex-wrap: wrap;
  gap: 2px 20px;
  margin-left: auto;
  font-weight: 600;
}
.nav .links a { text-decoration: none; }
.nav .links a:hover { text-decoration: underline; color: inherit; }
.nav .links a[aria-current="page"] { color: var(--accent); }

.theme {
  grid-area: theme;
  display: flex;
  align-items: center;
  gap: 10px;
}
.theme input {
  position: absolute;
  width: 1px; height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}
.theme label {
  display: block;
  width: 24px; height: 24px;
  border-radius: 50%;
  cursor: pointer;
  background: linear-gradient(90deg, var(--sw-a) 0 50%, var(--sw-b) 50% 100%);
  transition: outline-color .15s linear;
}
.theme input:checked + label { outline: 2px solid var(--ink); outline-offset: 3px; }
.theme input:focus-visible + label { outline: 2px solid var(--accent-2); outline-offset: 3px; }
.theme .sw-home   { --sw-a: #1345A6; --sw-b: #9C1747; }
.theme .sw-away   { --sw-a: #2A2145; --sw-b: #D2BF8E; }
.theme .sw-third  { --sw-a: #8BD9D9; --sw-b: #2E97AC; }
.theme .sw-fourth { --sw-a: #DCCCBC; --sw-b: #5E212E; }

/* ---- Buttons ---------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font: 600 16px/1.15 var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s linear, transform .15s var(--ease);
}
.btn:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn:active { transform: scale(.98); }
.btn-block { display: flex; width: 100%; }

/* A secondary action reads as a link, not a second button. */
.btn-text {
  min-height: 0;
  padding: 0;
  border-radius: 0;
  background: none;
  color: var(--ink);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: .16em;
}
.btn-text:hover { background: none; color: var(--accent); }

/* ---- Episode page ---------------------------------------------------------- */

.ep-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 40px;
  align-items: start;
  margin-top: clamp(20px, 3vw, 32px);
}
.ep-head h1 { max-width: none; }

.weather {
  margin-top: 14px;
  color: var(--ink-2);
  font-size: 15px;
  text-align: right;
  white-space: nowrap;
}
.weather .date { color: var(--ink); font-weight: 600; }

@media (max-width: 820px) {
  .ep-head { grid-template-columns: minmax(0, 1fr); }
  .weather { margin-top: 6px; text-align: left; white-space: normal; }
}

.lead {
  display: grid;
  grid-template-columns: minmax(0, 1.72fr) minmax(0, 1fr);
  gap: 40px 56px;
  align-items: start;
  margin-top: clamp(24px, 3vw, 36px);
}
@media (max-width: 979px) {
  .lead { grid-template-columns: minmax(0, 1fr); }
  .lead .try { order: -1; }
}

.report-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 20px;
  margin-bottom: 12px;
}

.receipt {
  list-style: none;
  font: 400 15px/1.5 var(--mono);
  font-variant-numeric: tabular-nums;
}
.receipt li {
  display: grid;
  grid-template-columns: minmax(7.5em, auto) minmax(0, 1fr);
  gap: 2px 18px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}
.receipt .k {
  padding-top: 2px;
  color: var(--ink-2);
  font-size: 13px;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.receipt .v { text-align: right; font-weight: 700; overflow-wrap: anywhere; }
.total {
  margin-top: 16px;
  font: 400 clamp(1.2rem, 1.05rem + .6vw, 1.5rem) / 1.2 var(--display);
  letter-spacing: -.02em;
  color: var(--accent);
}
.note { margin-top: 8px; max-width: 60ch; color: var(--ink-2); font-size: 15px; }

.stamp {
  flex: none;
  padding: 6px 14px;
  border: 2px solid var(--accent);
  border-radius: 8px;
  color: var(--accent);
  font: 400 15px/1.15 var(--display);
  letter-spacing: 0;
  text-transform: uppercase;
  transform: rotate(-6deg);
  pointer-events: none;
}
.js .stamp.will { opacity: 0; }
.js .stamp.landed { animation: stamp .42s var(--ease) both; }
@keyframes stamp {
  from { opacity: 0; transform: rotate(-16deg) scale(1.5); }
  60% { opacity: 1; }
  to { opacity: 1; transform: rotate(-6deg) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .js .stamp.will { opacity: 1; }
  .js .stamp.landed { animation: none; }
}

.try h2 { margin-bottom: 14px; }
.lead-more { margin-top: 14px; font-weight: 600; }
.prompt-toggle { display: none; }

.prompt {
  margin-bottom: 14px;
  padding: 16px 18px;
  border-radius: var(--r);
  background: var(--inset);
  color: var(--inset-ink);
  font: 400 14px/1.55 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.prompt-line {
  max-width: 52ch;
  margin-top: 8px;
  color: var(--ink-2);
  font-size: 15px;
}
.prompt-line code { color: var(--ink); font: 400 .88em var(--mono); overflow-wrap: anywhere; }

/* The experiment, embedded. One dark frame, nothing laid over it. */
.frame {
  height: clamp(440px, 76vh, 760px);
  overflow: hidden;
  border-radius: var(--r);
  background: #111111;
}
.frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #111111;
}
.experiment .caption { margin-top: 14px; max-width: var(--measure); }
.experiment .caption .more { display: inline-block; margin-top: 8px; font-weight: 600; }

.video {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--r);
  background: var(--inset);
  color: var(--inset-ink);
}
.video.is-pending {
  aspect-ratio: auto;
  border-radius: 0;
  background: none;
  color: var(--ink-2);
}
.video.is-pending strong { color: var(--ink); }
.video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.video > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.video .play {
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  display: grid;
  place-items: center;
  width: clamp(72px, 9vw, 104px);
  aspect-ratio: 1;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  cursor: pointer;
  transition: transform .15s var(--ease), background-color .15s linear;
}
.video .play:hover { transform: scale(1.06); background: var(--accent-hover); }
.video .play svg { width: 40%; height: 40%; margin-left: 6%; }
.video-cap { margin-top: 10px; max-width: 60ch; color: var(--ink-2); font-size: 15px; }

.covers { max-width: 62ch; padding-left: 1.25em; }
.covers li { padding: 6px 0; }
.covers li::marker { color: var(--accent); }

.qa { max-width: 62ch; }
.qa > div { padding: 14px 0; border-top: 1px solid var(--line); }
.qa dt { font-weight: 700; }
.qa dd { margin-top: 4px; }

.duo {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px 56px;
  align-items: start;
}
.duo .sec { margin-top: 0; }
/* The two-column block follows a section like any other, so it gets the same gap above it. */
.sec + .duo { margin-top: clamp(44px, 5vw, 64px); }
@media (max-width: 979px) {
  .duo { grid-template-columns: minmax(0, 1fr); }
  .duo .sec + .sec { margin-top: clamp(44px, 5vw, 64px); }
}

.src-intro { margin-bottom: 22px; max-width: var(--measure); }
.src-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 56px;
  align-items: start;
}
@media (max-width: 979px) { .src-cols { grid-template-columns: minmax(0, 1fr); } }
.src-col h3 { margin: 26px 0 6px; }
.src-col > h3:first-child { margin-top: 0; }
.src { list-style: none; }
.src li {
  padding: 12px 0;
  border-top: 1px solid var(--line);
  font-size: 15px;
  line-height: 1.55;
}
.src li p + p { margin-top: 4px; }
.src .u { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.src li.note { color: var(--ink-2); font-size: 15px; }

.sponsor {
  margin-top: clamp(44px, 5vw, 64px);
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--ink-2);
}

/* ---- Home page ------------------------------------------------------------- */

.home-intro { margin-top: clamp(28px, 5vw, 64px); }
.home-intro h1 { max-width: 22ch; }
.home-intro .lede {
  margin-top: 16px;
  max-width: 62ch;
  font-size: clamp(1.05rem, .95rem + .4vw, 1.25rem);
  line-height: 1.5;
}

.feature {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 32px 48px;
  align-items: center;
}
.feature .exp-line { margin-top: 14px; max-width: 52ch; }
.feature .actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 22px;
  margin-top: 20px;
}
.feature .cap { margin-top: 10px; color: var(--ink-2); font-size: 15px; }
.feature .preview .frame { height: clamp(360px, 56vh, 520px); }
@media (max-width: 979px) {
  .feature { grid-template-columns: minmax(0, 1fr); }
  .feature .preview .frame { height: min(64vh, 560px); }
}

.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px 36px;
  list-style: decimal;
  padding-left: 1.3em;
}
.steps li::marker { color: var(--accent); font-weight: 700; }
.steps p { color: var(--ink-2); }
.steps strong { color: var(--ink); }
@media (max-width: 979px) {
  .steps { grid-template-columns: minmax(0, 1fr); gap: 14px; }
}

.episodes { list-style: none; }
.episodes li { border-top: 1px solid var(--line); }

/* One episode: its cover and its title, the whole row one link. */
.ep {
  display: grid;
  grid-template-columns: clamp(150px, 24vw, 280px) minmax(0, 1fr);
  gap: 20px 28px;
  align-items: center;
  padding: 20px 0;
  color: inherit;
  text-decoration: none;
}
.ep:hover { color: inherit; }
.ep:hover .title { text-decoration: underline; }
.ep img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 10px;
}
.ep .k { display: block; color: var(--ink-2); font-size: 15px; }
.ep .title {
  display: block;
  margin-top: 2px;
  font-size: clamp(1.1rem, 1rem + .5vw, 1.35rem);
  font-weight: 700;
  line-height: 1.4;
}
.ep .m { display: block; margin-top: 6px; color: var(--ink-2); font-size: 15px; }

/* On the away kit's dark ground a dark block needs a hairline to be seen. */
[data-theme="away"] .prompt,
[data-theme="away"] .frame,
[data-theme="away"] .video { border: 1px solid var(--line); }

/* ---- Footer and the not-found page ----------------------------------------- */

.site-foot {
  margin-top: clamp(44px, 5vw, 64px);
  padding: 24px 0 40px;
  border-top: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 15px;
}
.site-foot .row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
}
.site-foot .row + .row { margin-top: 8px; }
.site-foot .logo { font-size: 17px; gap: 8px; color: var(--ink); }
.site-foot .logo svg { width: 24px; height: 24px; }

.nf { padding: clamp(48px, 10vh, 110px) var(--gutter) 64px; }
.nf h1 { max-width: 14ch; }
.nf p { margin-top: 14px; max-width: var(--measure); }
.nf .btn { margin-top: 22px; }

@media (max-width: 640px) {
  /* The logo becomes a two-row grid: mark and English name on top, the Chinese name under the English one. It stays as wide as the English name alone, so the theme swatches still sit beside it. */
  .logo { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 9px; row-gap: 3px; }
  .logo svg { grid-column: 1; grid-row: 1; width: 26px; height: 26px; }
  .logo .en { grid-column: 2; grid-row: 1; }
  .logo .zh { grid-column: 2; grid-row: 2; margin-left: 0; white-space: nowrap; }
  .site-foot .logo { column-gap: 8px; }
  .site-foot .logo svg { width: 24px; height: 24px; }
  .theme { gap: 9px; }
  .theme label { width: 22px; height: 22px; }
  .nav .links { font-size: 15px; }
  .prompt:not(.open) { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 5; overflow: hidden; }
  .prompt-toggle { display: inline-flex; margin: 10px 0 2px; }
  .feature .exp-line, .feature .prompt-line { display: none; }
  .receipt li { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .receipt .k { padding-top: 0; }
  .receipt .v { text-align: left; }
  .stamp { font-size: 13px; padding: 5px 12px; }
  .frame { height: min(74vh, 620px); }
  .ep { grid-template-columns: minmax(0, 1fr); gap: 12px; }
}
