/* Home page only.
 *
 * Deliberately NOT style.css. That file is shared by ten pages — the five
 * SEO landing pages plus guides, help, terms and privacy — and they depend
 * on .card, .wrap, .faq-group, .legal, .cta-btn and .about. Replacing it
 * with this design would have restyled nine pages nobody has designed yet,
 * including the landing pages the whole SEO plan rests on.
 *
 * So the redesign lands here first and spreads page by page, deliberately,
 * rather than arriving everywhere at once as a side effect. index.html
 * loads this INSTEAD OF style.css; every other page is untouched.
 *
 * Ported from the redesign prototype (1 Sep). Tokens, spacing and the mark
 * animation are the prototype's; the classes below the "carried forward"
 * divider are the live app's own and keep their existing behaviour.
 */

:root {
  --paper: #FBFBFA;
  --card: #FFFFFF;
  --ink: #0C0E0F;
  --ink-2: #4A5154;
  --ink-3: #8A9295;
  --rule: #E2E5E4;
  --rule-2: #CDD2D1;
  --action: #1B44E8;
  --action-hover: #1637C4;
  --action-ink: #FFFFFF;
  --ok: #0B7A55;
  --ok-soft: #E4F2EC;
  --warn: #8A5A00;
  --warn-soft: #FBF2DF;
  --danger: #B3261E;
  --danger-soft: #FBEAE8;
  --chrome: #F1F3F2;
  --radius: 4px;
  --shadow: 0 1px 2px rgba(12,14,15,.05), 0 8px 24px -12px rgba(12,14,15,.14);
}

/* Three theme states, not two: an explicit choice stamps data-theme, and the
   default "system" setting stamps nothing at all. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0B0D0E;
    --card: #141718;
    --ink: #ECEFEE;
    --ink-2: #A3ABAD;
    --ink-3: #6C7476;
    --rule: #242829;
    --rule-2: #343A3B;
    --action: #5B7BFF;
    --action-hover: #7590FF;
    --action-ink: #06080F;
    --ok: #4FC79B;
    --ok-soft: #10251E;
    --warn: #E0B056;
    --warn-soft: #241D0F;
    --danger: #F2938C;
    --danger-soft: #2A1614;
    --chrome: #171A1B;
    --shadow: 0 1px 2px rgba(0,0,0,.5), 0 8px 24px -12px rgba(0,0,0,.7);
  }
}

:root[data-theme="dark"] {
  --paper: #0B0D0E;
  --card: #141718;
  --ink: #ECEFEE;
  --ink-2: #A3ABAD;
  --ink-3: #6C7476;
  --rule: #242829;
  --rule-2: #343A3B;
  --action: #5B7BFF;
  --action-hover: #7590FF;
  --action-ink: #06080F;
  --ok: #4FC79B;
  --ok-soft: #10251E;
  --warn: #E0B056;
  --warn-soft: #241D0F;
  --danger: #F2938C;
  --danger-soft: #2A1614;
  --chrome: #171A1B;
  --shadow: 0 1px 2px rgba(0,0,0,.5), 0 8px 24px -12px rgba(0,0,0,.7);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  /* System stack on purpose. The prototype set Schibsted Grotesk, which is a
     webfont request on the critical path of the page the whole business
     depends on ranking. Core Web Vitals feed search, search is the entire
     acquisition channel, so a display face has to earn its render-blocking
     cost — and on a page whose job is one input and one button, it doesn't.
     The mark carries the brand instead; it's drawn, not set. */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

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

[hidden] { display: none !important; }

.site { max-width: 640px; margin: 0 auto; padding: 0 20px 80px; }

/* ---- masthead ---------------------------------------------------- */

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 26px 0 0;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 1px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--ink);
  text-decoration: none;
}

.brand .accent { color: var(--action); }

.nav { display: flex; gap: 20px; font-size: 14px; }
.nav a { color: var(--ink-2); text-decoration: none; }
.nav a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* ---- the mark ----------------------------------------------------
   One triangle and one rule. In this orientation it's a download glyph; a
   quarter-turn anticlockwise and the same two shapes are a play button.
   That rotation is the product in one gesture, so it's the thing that
   animates rather than anything decorative. */

.mark { width: 22px; height: 22px; flex: none; margin-right: 8px; overflow: visible; }
.mark-tri, .mark-rule {
  fill: var(--action);
  transition: transform .42s cubic-bezier(.65,.05,.36,1);
  transform-origin: 12px 12px;
}
.brand:hover .mark-tri, .brand:hover .mark-rule { transform: rotate(-90deg); }

.act .mark { width: 15px; height: 15px; margin: 0 7px 0 -2px; vertical-align: -2px; }
.act.primary .mark-tri, .act.primary .mark-rule { fill: var(--action-ink); }
.act .mark-tri, .act .mark-rule { transition: transform .38s cubic-bezier(.65,.05,.36,1), opacity .2s; }
.act.is-starting .mark-tri, .act.is-busy .mark-tri { transform: rotate(-90deg); }

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

.hero { padding: 56px 0 30px; }

h1 {
  font-size: clamp(30px, 5.4vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.032em;
  font-weight: 600;
  margin: 0 0 12px;
  text-wrap: balance;
}

.sub { color: var(--ink-2); font-size: 17px; margin: 0; max-width: 46ch; }

.inputrow { display: flex; gap: 8px; margin: 26px 0 0; }

.field {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 15px;
  padding: 13px 14px;
  border: 1px solid var(--rule-2);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--ink);
}

.field::placeholder { color: var(--ink-3); }
.field:focus {
  border-color: var(--action);
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--action) 18%, transparent);
}

.go {
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  padding: 13px 22px;
  border: 1px solid var(--action);
  border-radius: var(--radius);
  background: var(--action);
  color: var(--action-ink);
  cursor: pointer;
  white-space: nowrap;
}

.go:hover { background: var(--action-hover); border-color: var(--action-hover); }
.go[disabled] { opacity: .6; cursor: default; }

.handles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 16px 0 0;
  font-size: 13.5px;
  color: var(--ink-3);
}

/* ---- status ------------------------------------------------------ */

.status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  font-size: 14.5px;
  color: var(--ink-2);
}

/* The spinner is drawn by CSS on the status element itself rather than a
   separate <span>, because script.js sets textContent on this node and any
   child element it owned would be wiped on the next message. */
.status.loading::before {
  content: "";
  width: 13px;
  height: 13px;
  flex: none;
  border: 2px solid var(--rule-2);
  border-top-color: var(--action);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

.status.error { color: var(--danger); }

.status.error::before {
  content: "";
  width: 13px;
  height: 13px;
  flex: none;
  border-radius: 50%;
  background: var(--danger);
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---- result ------------------------------------------------------ */

.result {
  margin-top: 28px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.result-top { display: flex; gap: 16px; padding: 16px; align-items: flex-start; }

.thumb {
  width: 88px;
  flex: none;
  border-radius: 2px;
  background: linear-gradient(145deg, #2a3138, #4c565e);
  overflow: hidden;
  display: block;
}

/* Both the <img> and the <video> preview live in this slot. Height is not
   fixed: a 4:5 photo and a 9:16 reel are different shapes and letterboxing
   either one to a single ratio looks like a bug. */
.thumb img, .thumb video { display: block; width: 100%; height: auto; }

.meta { min-width: 0; flex: 1; }

.author { font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }

.caption {
  color: var(--ink-2);
  font-size: 14px;
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  cursor: pointer;
}

/* Click to expand — the behaviour predates the redesign and is kept. */
.caption.expanded {
  display: block;
  -webkit-line-clamp: unset;
  line-clamp: unset;
  overflow: visible;
  cursor: default;
}

.datastrip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 10px;
  font-size: 11.5px;
  letter-spacing: 0.02em;
  color: var(--ink-3);
  text-transform: uppercase;
}

.datastrip span { display: inline-flex; align-items: center; gap: 10px; }
.datastrip span + span::before { content: "\00b7"; color: var(--rule-2); }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 16px;
}

.act {
  display: inline-flex;
  align-items: center;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 9px 15px;
  border: 1px solid var(--rule-2);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
}

.act:hover { border-color: var(--ink-3); }

.act.primary {
  background: var(--action);
  border-color: var(--action);
  color: var(--action-ink);
  font-weight: 600;
}

.act.primary:hover { background: var(--action-hover); border-color: var(--action-hover); }

/* Feedback states. These class names are set by script.js and are not
   negotiable here — .is-starting and .is-downloading come from the per-item
   link handler, .is-busy and .is-waiting from runButtonFeedback(). */
.act.is-starting, .act.is-downloading, .act.is-busy { opacity: .82; }
.act.is-waiting { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.act.primary.is-waiting { background: var(--ok); border-color: var(--ok); color: var(--action-ink); }

.note {
  border-top: 1px solid var(--rule);
  padding: 11px 16px;
  font-size: 13px;
  color: var(--ink-2);
  background: var(--warn-soft);
}

/* ---- carousel slides --------------------------------------------- */

.slides { border-top: 1px solid var(--rule); }

.slide {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--rule);
}

.slide:last-child { border-bottom: 0; }

.slide-thumb {
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 2px;
  background: linear-gradient(140deg, #333b42, #59646c);
  object-fit: cover;
  display: block;
}

.slide-meta { flex: 1; min-width: 0; }
.slide-kind { font-size: 14px; font-weight: 500; }
.slide-data { font-size: 11.5px; color: var(--ink-3); letter-spacing: .02em; }

.slide .act { padding: 7px 13px; font-size: 13px; }

/* ---- below the fold ---------------------------------------------- */

.more { margin-top: 52px; padding-top: 26px; border-top: 1px solid var(--rule); }

.more h2 {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 14px;
}

.more p { color: var(--ink-2); font-size: 14.5px; margin: 0 0 14px; max-width: 62ch; }
.more .disclaimer { color: var(--ink-3); font-size: 13px; }

.linkgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 2px 24px; }

.linkgrid a {
  display: block;
  padding: 7px 0;
  font-size: 14.5px;
  color: var(--ink-2);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
}

.linkgrid a:hover { color: var(--action); }

.soon {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  letter-spacing: .06em;
  color: var(--ink-3);
  border: 1px solid var(--rule-2);
  padding: 1px 4px;
  border-radius: 2px;
  margin-left: 7px;
  vertical-align: 1px;
}

/* ---- carried forward from style.css ------------------------------
   The ad slots keep the exact behaviour they had. Reserving a minimum
   height matters more here than it did before: these sit below the primary
   action, and an ad that arrives late and pushes the page around is both a
   layout-shift penalty and a misclick generator. `:empty` collapses the
   slot entirely when a network is blocked or ?noads= is set, so a blocked
   ad leaves no gap rather than a hole. */

.ad-slot {
  margin-top: 32px;
  display: flex;
  justify-content: center;
  min-height: 92px;
}

.ad-slot:empty { display: none; margin-top: 0; min-height: 0; }

/* ---- footer ------------------------------------------------------ */

.footer {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 20px 48px;
  color: var(--ink-3);
  font-size: 13px;
}

.footer a { color: var(--ink-2); text-decoration: none; }
.footer a:hover { color: var(--action); text-decoration: underline; text-underline-offset: 3px; }
.footer .sep { color: var(--rule-2); margin: 0 6px; }
.footer .copyright { margin: 0 0 4px; }

@media (prefers-reduced-motion: reduce) {
  .status.loading::before { animation: none; }
  * { transition: none !important; }
}

@media (max-width: 560px) {
  .hero { padding: 36px 0 22px; }
  .inputrow { flex-direction: column; }
  .go { width: 100%; }
  .nav { gap: 14px; font-size: 13.5px; }
  .result-top { gap: 12px; padding: 14px; }
  .thumb { width: 68px; }
}
