/* Hallmark · redesign · macrostructure: Workbench (the product performs) · tone: quiet, exact · anchor hue: teal 195°
 * Gtube · hero only · palette "Cool white and crimson" · Bricolage Grotesque only
 */

*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--step-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-optical-sizing: auto;
}
button, input { font: inherit; color: inherit; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
::selection { background: var(--ink); color: var(--bg); }

/* ---------------------------------------------------------------- bar */

.bar {
  display: flex;
  align-items: center;
  gap: var(--gap);
  padding: 24px var(--margin);
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: var(--step-lead);
  font-weight: 600;
  letter-spacing: -0.03em;
  text-decoration: none;
}

/* ---------------------------------------------------------------- hero */

.hero {
  display: grid;
  gap: 24px;
  width: min(100% - 2 * var(--margin), 860px);
  margin-inline: auto;
  padding-block: clamp(32px, 8vh, 96px) clamp(48px, 8vh, 96px);
}
.hero-lede {
  max-width: 44ch;
  margin: 0;
  font-size: var(--step-lead);
  line-height: 1.35;
}

/* the tool: a real interface fragment */
.tool {
  background: var(--paper);
  border-radius: var(--radius);
  padding: clamp(16px, 2vw, 28px);
}
.grab { display: flex; gap: 10px; }
.grab-field {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding-inline: 14px 6px;
  background: #fff;
  border: 1.5px solid var(--ui-line);
  border-radius: var(--radius);
  transition: border-color var(--dur-fast) var(--ease-out);
}
.grab-field:focus-within { border-color: var(--ink); }
.grab[data-state="error"] .grab-field { border-color: var(--danger); }
.grab-field input {
  flex: 1;
  min-width: 0;
  height: 52px;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: var(--step-body);
}
.grab-field input::placeholder { color: var(--muted); }
.field-msg { min-height: 1.5em; margin: 12px 0 0; font-size: var(--step-small); color: var(--muted); }
.field-msg[data-tone="error"] { color: var(--danger); }

.btn-primary {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding-inline: 28px;
  border: 0;
  border-radius: 0;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 500;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { transform: translateY(1px) scale(0.99); }
.btn-text, .btn-icon {
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  border-radius: var(--radius);
  transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.btn-text { height: 40px; padding-inline: 12px; font-size: var(--step-small); font-weight: 500; }
.btn-icon { width: 40px; height: 40px; display: grid; place-items: center; }
.btn-icon svg { width: 18px; height: 18px; }
.btn-text:hover, .btn-icon:hover { background: var(--bg); color: var(--ink); }

.spinner {
  display: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 0.7s linear infinite;
}
[data-loading="true"] .spinner { display: inline-block; }
[data-loading="true"] { cursor: progress; }
@keyframes spin { to { transform: rotate(1turn); } }

/* result inside the tool */
.result { margin-top: 20px; }
.result.is-entering { animation: rise var(--dur-slow) var(--ease-out); }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }

.video { display: grid; grid-template-columns: minmax(0, 13rem) minmax(0, 1fr); gap: 18px; align-items: start; }
.video-media { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.video-media img { width: 100%; height: 100%; object-fit: cover; }
.video-duration {
  position: absolute; right: 6px; bottom: 6px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--ink);
  color: var(--bg);
  font-size: var(--step-small);
  font-variant-numeric: tabular-nums;
}
.video-meta { min-width: 0; }
.video-title { margin: 0; font-size: var(--step-lead); font-weight: 600; line-height: 1.15; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.video-byline { margin: 6px 0 0; font-size: var(--step-small); color: var(--muted); }
.video-byline a { color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: var(--step-small); }
.chip { color: var(--muted); }
.chip.is-accent { color: var(--accent); font-weight: 500; }

.video.is-skeleton .video-media, .video.is-skeleton .sk { background: var(--surface); animation: pulse 1.2s var(--ease-in-out) infinite alternate; }
.sk { display: block; height: 1rem; border-radius: 4px; margin-bottom: 8px; }
@keyframes pulse { from { opacity: 1; } to { opacity: 0.45; } }

.picker { margin-top: 20px; }
.rows-head {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 10px;
  margin: 18px 0 6px;
  font-size: var(--step-body);
  font-weight: 600;
}
.rows-head span { font-weight: 400; color: var(--muted); font-size: var(--step-small); }
.rows { list-style: none; margin: 0; padding: 0; }
.row {
  display: grid;
  grid-template-columns: minmax(0, 9rem) minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  min-height: 56px;
  padding: 6px 10px;
  border-radius: var(--radius);
  transition: background-color var(--dur-fast) var(--ease-out);
}
.row:nth-child(odd) { background: #fff; }
.row:hover { background: var(--surface); }
.row-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.row-q { font-size: var(--step-body); font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; }
.row-badge { font-size: var(--step-small); color: var(--muted); font-weight: 500; }
.row-badge.is-accent { color: var(--accent); }
.row-detail { min-width: 0; font-size: var(--step-small); color: var(--muted); }
.row-detail strong { color: var(--ink); font-weight: 500; }
.row-size { font-size: var(--step-small); font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.rows-empty { padding: 16px 10px; color: var(--muted); }

.btn-secondary {
  min-height: 40px;
  padding-inline: 18px;
  border: 0;
  border-radius: 0;
  background: var(--ink);
  color: var(--bg);
  font-size: var(--step-small);
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.btn-secondary:hover { background: var(--accent); color: var(--accent-ink); }
.btn-secondary:active { transform: translateY(1px); }
.btn-secondary[data-state="preparing"] { background: var(--surface-2); color: var(--ink); cursor: progress; }
.btn-secondary[data-state="started"] { background: var(--ok); color: #fff; }
.btn-secondary:disabled { cursor: progress; }

/* ---------------------------------------------------------------- about + footer (plain text for readers and search engines) */

.about, .footer {
  width: min(100% - 2 * var(--margin), 860px);
  margin-inline: auto;
}
.about { padding-bottom: clamp(48px, 8vh, 96px); }
.about h2 {
  margin: 48px 0 12px;
  font-size: var(--step-lead);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.about h2:first-child { margin-top: 0; }
.about p { max-width: 68ch; margin: 0; }
.steps { margin: 0; padding-left: 1.4em; display: grid; gap: 8px; max-width: 68ch; }
.steps li::marker { color: var(--accent); font-weight: 600; }
.faq { display: grid; gap: 6px; }
.faq details { background: var(--paper); border-radius: var(--radius); }
.faq summary {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-weight: 600; transition: transform var(--dur-fast) var(--ease-out); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq summary:hover { color: var(--accent); }
.faq details p { padding: 0 18px 16px; color: var(--ink); }

.footer {
  display: grid;
  gap: 6px;
  padding-block: 28px 40px;
  font-size: var(--step-small);
  color: var(--muted);
}
.footer p { margin: 0; }
.footer strong { color: var(--ink); font-weight: 600; }

/* ---------------------------------------------------------------- toast (a real overlay) */

.toast {
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 10;
  width: max-content;
  max-width: calc(100% - 2 * var(--margin));
  margin: 0;
  padding: 14px 20px;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--bg);
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.25); /* taste-skill-ignore: a real floating overlay */
  font-size: var(--step-small);
  animation: rise var(--dur) var(--ease-out);
}
.toast[data-tone="ok"] { background: var(--ok); color: #fff; }
.toast[data-tone="error"] { background: var(--danger); color: #fff; }
.noscript { padding: 20px; text-align: center; color: var(--danger); }

/* ---------------------------------------------------------------- motion: entrances + masked headline */

.js .hero-lede, .js .tool { opacity: 0; transform: translateY(16px); }
.js.is-loaded .hero-lede, .js.is-loaded .tool { opacity: 1; transform: none; transition: opacity 600ms var(--ease-out) 80ms, transform 600ms var(--ease-out) 80ms; }
.js.is-loaded .tool { transition-delay: 180ms; }


@media (prefers-reduced-motion: reduce) {
  .js .hero-lede, .js .tool { transform: none !important; opacity: 1 !important; }
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; }
  .spinner { animation: spin 1.4s linear infinite !important; }
}

/* ---------------------------------------------------------------- responsive */

@media (max-width: 760px) {
  .grab { flex-direction: column; }
  .grab-submit { width: 100%; }
  .video { grid-template-columns: minmax(0, 1fr); }
  .row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 2px; padding: 8px 10px; }
  .row-name { grid-column: 1; grid-row: 1; }
  .row-detail { grid-column: 1; grid-row: 2; }
  .row-size { grid-column: 1; grid-row: 3; text-align: left; }
  .row > .btn-secondary { grid-column: 2; grid-row: 1 / span 3; }
}
