/* LazyTools landing page. Colours, fonts, spacing come from assets/tokens.css. */

:root {
  --keycap-base: #1c1f2a;
  --wrap: 1120px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --keycap-base: #0f1117; }
}
:root[data-theme="dark"] { --keycap-base: #0f1117; }

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

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

body {
  margin: 0;
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-weight: 600; line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: var(--coral); }
img { display: block; }

:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 3px; border-radius: var(--radius-sm); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--space-4); }
@media (min-width: 720px) { .wrap { padding: 0 var(--space-6); } }

.skip {
  position: absolute; left: var(--space-4); top: -100px;
  background: var(--sun); color: var(--on-sun);
  padding: var(--space-2) var(--space-4); border-radius: var(--radius-md); z-index: 10;
}
.skip:focus { top: var(--space-4); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); min-height: 68px; }

.wordmark {
  display: inline-flex; align-items: center; gap: 20px; /* half the mark's width */
  font-family: var(--font-display); font-weight: 600; font-size: 1.5rem;
  color: var(--ink); text-decoration: none;
}
.wordmark-sm { gap: 14px; font-size: 1.125rem; }

nav ul { display: flex; gap: var(--space-6); list-style: none; margin: 0; padding: 0; }
nav a { color: var(--ink); text-decoration: none; font-weight: 700; font-size: 0.95rem; }
nav a:hover { color: var(--coral); }
@media (max-width: 600px) {
  nav ul { gap: var(--space-4); }
  nav li:nth-child(2) { display: none; }
  .wordmark { gap: 12px; font-size: 1.25rem; }
  .wordmark img { width: 32px; height: 32px; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 var(--space-6);
  border-radius: var(--radius-md);
  font-family: var(--font-sans); font-weight: 700; font-size: 1rem;
  text-decoration: none; cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.btn-primary {
  background: var(--sun); color: var(--on-sun);
  box-shadow: 0 4px 0 var(--keycap-base);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 5px 0 var(--keycap-base); }
.btn-primary:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--keycap-base); }
.btn-ghost { color: var(--ink); border: 2px solid var(--line); background: transparent; }
.btn-ghost:hover { border-color: var(--ink-muted); }
.btn-lg { min-height: 56px; font-size: 1.0625rem; }

.text-link { font-weight: 700; }

/* ---------- Keycaps ---------- */
.keycap {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 52px; height: 52px; padding: 0 var(--space-4);
  background: var(--sun); color: var(--on-sun);
  border-radius: var(--radius-md);
  box-shadow: 0 5px 0 var(--keycap-base);
  font-family: var(--font-mono); font-weight: 700; font-size: 1rem;
  white-space: nowrap;
}
.keycap-wide { min-width: 96px; }
.keycap-tilt { transform: rotate(-8deg); }
.keycap-muted { background: var(--line); color: var(--ink-muted); }
.kbd-inline {
  font-family: var(--font-mono); font-size: 0.85em;
  background: var(--sun-soft); color: var(--ink);
  padding: 1px 6px; border-radius: var(--radius-sm);
}

/* ---------- Hero ---------- */
.hero { padding: var(--space-12) 0 72px; }
@media (min-width: 900px) { .hero { padding: 96px 0 112px; } }

.hero-grid { display: grid; gap: var(--space-12); align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.1fr 1fr; gap: 64px; } }

.eyebrow {
  display: inline-block;
  background: var(--sun-soft); color: var(--ink);
  font-weight: 700; font-size: 0.9rem;
  padding: var(--space-1) 12px; border-radius: 999px;
  margin-bottom: var(--space-6);
}
.hero h1 { font-size: clamp(2.4rem, 6vw, 4rem); margin-bottom: var(--space-6); }
.lead { font-size: 1.2rem; color: var(--ink-muted); max-width: 34ch; margin-bottom: 32px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: var(--space-4); }
.fine { font-size: 0.9rem; color: var(--ink-muted); }

/* ---------- Hero carousel ---------- */
.carousel { max-width: 520px; width: 100%; justify-self: center; min-width: 0; }

/* The frame always uses the dark theme: that's the app's home.
   Its background matches the screenshots so they blend in. */
.carousel-frame {
  --surface: #16181d; --surface-raised: #20232c; --line: #323643;
  --ink: #f4f1ea; --ink-muted: #a9abb6; --sun: #f7c548; --on-sun: #16181f;
  --mint: #6fd3bd; --keycap-base: #0f1117;
  background: var(--surface); color: var(--ink);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  overflow: hidden;
}
.carousel-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-track:focus-visible { outline-offset: -3px; }
.slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex; align-items: center; justify-content: center;
}
.slide img { width: 100%; height: auto; }

.carousel-controls {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: "cap cap cap" "prev dots next";
  align-items: center;
  gap: 12px var(--space-4);
  margin-top: var(--space-4);
}
.carousel-caption {
  grid-area: cap; text-align: center;
  color: var(--ink-muted); font-size: 0.95rem; min-height: 1.6em;
}
.carousel-btn[data-dir="-1"] { grid-area: prev; }
.carousel-btn[data-dir="1"] { grid-area: next; }
.carousel-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0;
  border-radius: var(--radius-md);
  border: 2px solid var(--line); background: var(--surface-raised); color: var(--ink);
  cursor: pointer;
}
.carousel-btn:hover { border-color: var(--ink-muted); }
.carousel-dots { grid-area: dots; display: flex; justify-content: center; gap: var(--space-2); }
.carousel-dots button {
  width: 12px; height: 12px; padding: 0;
  border-radius: 999px; border: 0;
  background: var(--line); cursor: pointer;
  transition: width 200ms ease, background 200ms ease;
}
.carousel-dots button[aria-selected="true"] { width: 28px; background: var(--sun); }
/* Bigger tap area without changing the look */
.carousel-dots button { position: relative; }
.carousel-dots button::after { content: ""; position: absolute; inset: -10px -4px; }

.app-preview { width: 100%; padding: var(--space-4); }
.app-bar { display: flex; align-items: center; gap: 6px; padding: var(--space-1) var(--space-2) var(--space-4); }
.app-bar .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.app-title { margin-left: var(--space-2); font-size: 0.85rem; color: var(--ink-muted); font-weight: 700; }

.macro-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.macro {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--space-4);
  background: var(--surface-raised);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-4) 20px;
}
.macro-info { display: grid; gap: var(--space-2); min-width: 0; }
.macro-name { font-size: 0.9rem; font-weight: 700; }
.bar { display: block; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; background: var(--mint); border-radius: inherit; }
.is-running .bar span { animation: fill var(--period) linear infinite; }
.status { font-size: 0.8rem; font-weight: 700; color: var(--mint); display: inline-flex; align-items: center; gap: 6px; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status-off { color: var(--ink-muted); }
.macro:not(.is-running) .keycap { background: var(--line); color: var(--ink-muted); }
/* Phones: keep the illustration about as tall as the screenshots.
   The status shrinks to just its dot (the word stays for screen readers). */
@media (max-width: 520px) {
  .app-preview { padding: 12px; }
  .app-bar { padding-bottom: 12px; }
  .macro { gap: 12px; padding: 10px 12px 14px; }
  .macro .keycap { height: 40px; min-width: 40px; padding: 0 10px; font-size: 0.85rem; box-shadow: 0 4px 0 var(--keycap-base); }
  .macro-name { font-size: 0.85rem; }
  .status { font-size: 0; gap: 0; }
}

@keyframes fill { from { width: 0; } to { width: 100%; } }
@media (prefers-reduced-motion: reduce) {
  .is-running .bar span { animation: none; width: 60%; }
  .btn, .carousel-dots button { transition: none; }
}

/* ---------- Sections ---------- */
.section { padding: 72px 0; }
@media (min-width: 900px) { .section { padding: 96px 0; } }
.section-tight { padding-top: 0; }
.section-soft { background: var(--sun-soft); }
.section h2 { font-size: clamp(1.8rem, 4vw, 2.5rem); margin-bottom: 12px; }
.section-lead { color: var(--ink-muted); font-size: 1.125rem; margin-bottom: var(--space-12); }

.card {
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px;
}
@media (max-width: 600px) { .card { padding: var(--space-6); } }

/* Tools */
.tool-grid { display: grid; gap: var(--space-6); }
@media (min-width: 800px) { .tool-grid { grid-template-columns: 1.4fr 1fr; } }
.tool-card { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-4); }
.tool-card h3 { font-size: 1.6rem; }
.tool-card p { color: var(--ink-muted); }
.download-row { display: flex; align-items: center; gap: 12px; margin-top: auto; }
.release-line { margin-top: 12px; }
.tool-head { display: flex; align-items: center; justify-content: space-between; width: 100%; margin-bottom: var(--space-2); }
.card-soon { background: transparent; border-style: dashed; }

.tag {
  font-size: 0.8rem; font-weight: 700;
  padding: var(--space-1) 10px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--ink-muted);
}
.tag-live { color: var(--mint); border-color: currentColor; }

.checks { list-style: none; padding: 0; margin: 0 0 var(--space-2); display: grid; gap: var(--space-2); }
.checks li { position: relative; padding-left: 28px; }
.checks li::before {
  content: ""; position: absolute; left: 2px; top: 0.45em;
  width: 14px; height: 8px;
  border-left: 2.5px solid var(--mint); border-bottom: 2.5px solid var(--mint);
  border-radius: 1px; transform: rotate(-45deg);
}

/* Steps */
#how h2 { margin-bottom: var(--space-12); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-6); }
@media (min-width: 800px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step { display: grid; gap: 12px; align-content: start; border-color: transparent; }
.step h3 { font-size: 1.35rem; }
.step p { color: var(--ink-muted); }
.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; margin-bottom: var(--space-2);
  background: var(--sun); color: var(--on-sun);
  border-radius: var(--radius-md); box-shadow: 0 4px 0 var(--keycap-base);
  font-family: var(--font-display); font-weight: 600; font-size: 1.25rem;
  transform: rotate(-8deg);
}

/* Why this one */
.compare { display: grid; gap: var(--space-6); }
@media (min-width: 800px) { .compare { grid-template-columns: repeat(3, 1fr); } }
.compare-item { display: grid; gap: 12px; align-content: start; }
.compare-item h3 { font-size: 1.35rem; }
.compare-item p { color: var(--ink-muted); }
.compare-item .kbd-inline { color: var(--ink); }

/* Price */
.price-card {
  display: grid; gap: 32px; align-items: center;
  background: var(--surface-raised);
  border: 2px solid var(--sun);
  border-radius: var(--radius-lg);
  padding: var(--space-12) 32px;
}
@media (min-width: 860px) { .price-card { grid-template-columns: 1.3fr 1fr; padding: 64px; } }
.price-copy p { color: var(--ink-muted); font-size: 1.125rem; max-width: 46ch; margin-top: var(--space-2); }
.price-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: var(--space-6); }
.kofi-fallback { margin-top: var(--space-4); }

/* Ko-fi's form is always light, so it sits on a light, rounded tile in both themes. */
.kofi-panel {
  background: #f9f9f9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  width: 100%; max-width: 420px; justify-self: center;
}
.kofi-panel iframe { display: block; width: 100%; height: 712px; border: 0; }
@media (max-width: 600px) { .price-card { padding: 32px var(--space-6); } }

/* FAQ */
.faq-wrap { max-width: 760px; }
.faq-wrap h2 { margin-bottom: var(--space-6); }
details { border-bottom: 1px solid var(--line); }
summary {
  cursor: pointer; list-style: none;
  padding: 20px 0; font-weight: 700; font-size: 1.1rem;
  display: flex; justify-content: space-between; gap: var(--space-4);
}
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-family: var(--font-display); font-size: 1.4rem; line-height: 1; color: var(--coral); }
details[open] summary::after { content: "–"; }
details p { color: var(--ink-muted); padding-bottom: 20px; max-width: 60ch; }

/* Contact form */
.contact-card {
  display: grid; gap: 32px;
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px var(--space-6);
}
@media (min-width: 860px) { .contact-card { grid-template-columns: 1fr 1.3fr; padding: var(--space-12); gap: var(--space-12); } }
.contact-copy p { color: var(--ink-muted); font-size: 1.125rem; margin-top: var(--space-2); max-width: 40ch; }

.contact-form { display: grid; gap: 20px; min-width: 0; }
.topic { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-2); }
.topic legend, .field label { font-weight: 700; font-size: 0.95rem; margin-bottom: var(--space-2); padding: 0; }
.topic label {
  position: relative;
  display: inline-flex; align-items: center;
  min-height: 40px; padding: 0 var(--space-4);
  border: 2px solid var(--line); border-radius: 999px;
  font-weight: 700; font-size: 0.9rem; cursor: pointer;
}
.topic input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.topic label:has(input:checked) { background: var(--sun); border-color: var(--sun); color: var(--on-sun); }
.topic label:has(input:focus-visible) { outline: 3px solid var(--focus-ring); outline-offset: 2px; }

.field { display: grid; }
.field .optional { font-weight: 400; color: var(--ink-muted); }
.field input, .field textarea {
  width: 100%;
  font: inherit; color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px var(--space-4);
}
.field textarea { resize: vertical; min-height: 130px; }
.field input::placeholder, .field textarea::placeholder { color: var(--ink-muted); opacity: 0.8; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--focus-ring); }

.trap { position: absolute; left: -9999px; width: 1px; height: 1px; }

.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px var(--space-4); }
.btn:disabled { opacity: 0.6; cursor: progress; transform: none; }
.form-status { font-size: 0.95rem; color: var(--ink-muted); }
.form-status[data-kind="ok"] { color: var(--mint); font-weight: 700; }
.form-status[data-kind="error"] { color: var(--coral); font-weight: 700; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 32px 0; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4) var(--space-6); }
.footer-note { color: var(--ink-muted); font-size: 0.95rem; }
.footer-links { display: flex; gap: var(--space-6); list-style: none; margin: 0 0 0 auto; padding: 0; }
.footer-links a { color: var(--ink); font-weight: 700; text-decoration: none; }
.footer-links a:hover { color: var(--coral); }
@media (max-width: 600px) {
  .footer-links { margin-left: 0; width: 100%; }
  /* Room for Ko-fi's floating button so it doesn't cover the links */
  .site-footer { padding-bottom: 96px; }
}

/* Anchor links land below the sticky header */
section[id] { scroll-margin-top: 80px; }
