/*
 * guide.texs.org. Looks like vhs.texs.org's article pages on purpose: the
 * paper-and-grid ground (vhs-label-maker's .page-grid-bg), Geist throughout,
 * bold centered section heads, gray-800 copy, magenta links
 * (ContentWrapper.js), and its FAQSection accordion.
 */

:root {
  --canvas: #f6f0eb;
  --grid: rgba(0, 0, 0, .05);
  --surface: #ffffff;
  --surface-muted: #f3f4f6;
  --line-subtle: #e5e7eb;
  --line: #d1d5db;
  --ink: #1f2937;
  --strong: #111827;
  --muted: #6b7280;
  --faint: #9ca3af;
  --link: #ff00d7;
  --link-hover: #ff5ee5;
  --quote: #3b82f6;
  --btn: #171717;
  --btn-ink: #fafafa;
  --code-bg: #111827;
  --code-ink: #e5e7eb;
  --sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}

[data-theme="dark"] {
  --canvas: #111318;
  --grid: rgba(255, 255, 255, .045);
  --surface: #1f2937;
  --surface-muted: #374151;
  --line-subtle: #374151;
  --line: #4b5563;
  --ink: #e5e7eb;
  --strong: #f3f4f6;
  --muted: #9ca3af;
  --faint: #6b7280;
  --btn: #fafafa;
  --btn-ink: #171717;
  --code-bg: #0b0d11;
  color-scheme: dark;
}

/* CHROME-SPEC §10: the same highlighter on every texs.org site. */
::selection { background: rgba(255, 232, 41, .75); color: currentColor; text-shadow: none; }
[data-theme="dark"] ::selection { background: rgba(0, 255, 181, .42); }

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 24px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background-color: var(--canvas);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 20px 20px;
  background-position: center top;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.625;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--link); text-decoration: underline; }
a:hover { color: var(--link-hover); }

button { font: inherit; }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ── The home badge (CHROME-SPEC §9) ─────────────────────────────────────── */

a #menu {
  position: absolute;
  top: 32px;
  left: 32px;
  width: 72px;
  height: 72px;
  border-radius: 40px;
  background: url(https://texs.org/assets/tex-sound.avif) center / contain no-repeat;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .1);
  transition: transform .2s ease;
  z-index: 9999;
  display: inline-block;
}
a #menu:hover { transform: scale(1.1); }

@media (max-width: 768px) {
  a #menu { top: 24px; left: 24px; }
}

/* ── Page frame ──────────────────────────────────────────────────────────── */

.wrap { max-width: 672px; margin: 0 auto; padding: 0 16px; }
.wrap-wide { max-width: 900px; margin: 0 auto; padding: 0 16px; }

.hero { padding: 128px 16px 32px; text-align: center; }
@media (max-width: 768px) { .hero { padding-top: 116px; } }

.hero h1 {
  margin: 0;
  font-size: clamp(30px, 5vw, 40px);
  line-height: 1.15;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -.01em;
  text-wrap: balance;
}
.hero .dek { margin: 12px auto 0; max-width: 520px; font-size: 18px; }

/* Small uppercase label, kept for the legal pages and 404. */
.kicker { font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

/* ── Video ───────────────────────────────────────────────────────────────── */

.player {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: #111318;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, .1), 0 4px 6px -4px rgba(0, 0, 0, .1);
  color: #f3f4f6;
}
[data-theme="dark"] .player { background: #000; box-shadow: 0 0 0 1px #374151; }

.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.player-cover {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
}
.player-cover .lock { width: 28px; height: 28px; color: #9ca3af; }
.player-cover h2 { margin: 0; font-size: clamp(20px, 3vw, 26px); line-height: 1.2; font-weight: 700; }
.player-cover p { margin: 0; max-width: 440px; color: #d1d5db; font-size: 15px; line-height: 1.5; }
.player-cover .actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 6px; }

@media (max-width: 520px) {
  .player { aspect-ratio: auto; min-height: 280px; }
  .player-cover { position: relative; min-height: 280px; }
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: opacity .15s, background-color .15s;
}
.btn:hover { opacity: .9; }
/* On the dark player, primary is always the light button. */
.btn-primary { background: #fafafa; color: #171717; }
.btn-primary:hover { color: #171717; }
.btn-ghost { background: transparent; color: #f3f4f6; border-color: rgba(255, 255, 255, .3); }
.btn-ghost:hover { color: #fff; background: rgba(255, 255, 255, .08); opacity: 1; }

.player-note { margin: 10px 0 0; font-size: 14px; color: var(--muted); text-align: center; }

/* ── On this page ───────────────────────────────────────────────────────── */

.jump { margin-top: 28px; text-align: center; font-size: 15px; line-height: 2; }
.jump a { color: var(--ink); text-decoration: none; font-weight: 500; }
.jump a:hover { color: var(--link); text-decoration: underline; }
.jump span { color: var(--faint); margin: 0 8px; }

/* ── Article (ContentWrapper's markdown styles) ─────────────────────────── */

.article { padding-top: 16px; padding-bottom: 64px; }
.article section { padding-top: 48px; }

.article h2 {
  margin: 0 0 16px;
  font-size: 24px;
  line-height: 1.3;
  font-weight: 700;
  color: var(--ink);
  text-align: center;
}
.article h2.big { font-size: 30px; margin-top: 16px; margin-bottom: 24px; }

.article h3 {
  margin: 32px 0 12px;
  font-size: 20px;
  line-height: 1.35;
  font-weight: 700;
  color: var(--ink);
}

.article p { margin: 0 0 16px; }
.article strong { font-weight: 600; color: var(--ink); }

.article ul, .article ol { margin: 0 0 16px; padding-left: 24px; }
.article ul { list-style: disc outside; }
.article ol { list-style: decimal outside; }
.article li { padding-left: 8px; }
.article li + li { margin-top: 8px; }

.article blockquote {
  margin: 16px 0;
  padding-left: 16px;
  border-left: 4px solid var(--quote);
  color: var(--muted);
}
.article blockquote strong { color: inherit; }

kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--sans);
  font-size: .85em;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
}

/* Content Tex hasn't written yet. Deliberately loud. */
.todo-inline { background: #fef08a; color: #422006; padding: 0 4px; border-radius: 4px; }

/* The Claude Code switch, drawn rather than recorded. Swap for a real
   screen recording later. */
.mode-demo {
  margin: 8px 0 16px;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, .1), 0 4px 6px -4px rgba(0, 0, 0, .1);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.mode-switch {
  position: relative;
  display: inline-flex;
  gap: 6px;
  padding: 5px;
  border-radius: 14px;
  background: var(--surface-muted);
}
.mode-switch span {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 46px;
  height: 40px;
  color: var(--muted);
  animation: mode-ink 4s ease-in-out infinite;
}
.mode-switch span:nth-of-type(2) { animation-name: mode-ink-2; }
.mode-switch svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.mode-switch i {
  position: absolute;
  top: 5px;
  left: 5px;
  width: 46px;
  height: 40px;
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 0 0 1px rgba(127, 127, 127, .25), 0 1px 3px rgba(0, 0, 0, .15);
  animation: mode-slide 4s ease-in-out infinite;
}
@keyframes mode-slide { 0%, 35% { transform: translateX(0); } 50%, 85% { transform: translateX(52px); } 100% { transform: translateX(0); } }
@keyframes mode-ink { 0%, 35% { color: var(--ink); } 50%, 85% { color: var(--muted); } 100% { color: var(--ink); } }
@keyframes mode-ink-2 { 0%, 35% { color: var(--muted); } 50%, 85% { color: #d97757; } 100% { color: var(--muted); } }
.mode-demo small { color: var(--muted); font-size: 13px; text-align: center; }
@media (prefers-reduced-motion: reduce) {
  .mode-switch i, .mode-switch span { animation: none; }
}

/* ── Clips ──────────────────────────────────────────────────────────────── */

.clips { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 16px; margin-top: 8px; }
.clip { margin: 0; }
.clip .frame {
  aspect-ratio: 9 / 16;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--surface-muted);
  color: var(--faint);
  font-size: 13px;
  font-weight: 500;
}
.clip figcaption { margin-top: 8px; font-size: 15px; font-weight: 600; color: var(--ink); line-height: 1.35; }
.clip figcaption small { display: block; font-weight: 400; color: var(--muted); font-size: 13px; }

/* ── FAQ (vhs-label-maker's FAQSection) ─────────────────────────────────── */

.faq summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  cursor: pointer;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--strong);
  transition: color .15s;
}
.faq summary:hover { color: var(--muted); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  flex: 0 0 20px;
  height: 20px;
  background-color: var(--strong);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 9l-7 7-7-7'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 9l-7 7-7-7'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform .2s;
}
.faq details[open] summary::after { transform: rotate(180deg); }
.faq .answer { padding: 4px 0 12px; }
.faq .answer p { margin: 0 0 8px; }
.faq figure { margin: 4px 0 12px; }
.faq figure img { border-radius: 8px; background: #fff; box-shadow: 0 10px 15px -3px rgba(0, 0, 0, .1); }
.faq figcaption { margin-top: 6px; font-size: 13px; color: var(--muted); }

/* ── Bio ────────────────────────────────────────────────────────────────── */

/* vhs-label-maker's About Tex card: a solid card so the grid ground
   doesn't run behind the text. */
.bio {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  padding: 24px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid #f3f4f6;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
}
[data-theme="dark"] .bio { background: #1b1f27; border-color: rgba(55, 65, 81, .6); }
.bio > a { flex-shrink: 0; }
.bio img { display: block; width: 96px; height: auto; border-radius: 16px; object-fit: contain; }
.bio p { margin: 0 0 12px; color: var(--muted); }
.socials { display: flex; flex-wrap: wrap; gap: 8px; }
.article .socials a {
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background .15s, color .15s, border-color .15s;
}
.article .socials a:hover { background: var(--ink); color: var(--surface); border-color: var(--ink); }
@media (max-width: 640px) {
  .bio { gap: 16px; padding: 20px; }
  .bio img { width: 72px; }
}

/* ── Footer (crossword's) ───────────────────────────────────────────────── */

.site-footer { background: #0a0a0a; padding: 40px 24px; text-align: center; font-size: 13px; color: #999; }
.site-footer a { color: #999; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer .dot { color: #555; margin: 0 8px; }
.site-footer .row + .row { margin-top: 12px; }

/* ── Legal pages ────────────────────────────────────────────────────────── */

.legal { padding: 132px 16px 72px; }
.legal h1 { font-size: 34px; line-height: 1.15; margin: 8px 0 0; color: var(--ink); }
.legal .updated { color: var(--muted); font-size: 14px; margin-top: 8px; }
.legal h2 { font-size: 19px; margin: 34px 0 0; color: var(--ink); }
.legal p { margin: 10px 0 0; }
.legal ul { margin: 10px 0 0; padding-left: 22px; }
.legal li + li { margin-top: 6px; }
.legal .back { font-size: 14px; }
