/* Stories Download — visual identity: "clear shelf".
 * Cool stone canvas, charcoal ink, one botanical-green accent.
 * A compact, trustworthy tool — not a grey-hat landing page, and not
 * Instagram's brand colours, glyph, or gradient.
 */
:root {
  --bg: #f3f1ec;
  --bg-spot: #e8f3ed;
  --surface: #ffffff;
  --ink: #161a22;
  --muted: #5b6370;
  --line: #ddd9d0;
  --accent: #0c6b4d;
  --accent-hover: #09583f;
  --accent-ink: #ffffff;
  --accent-soft: #e5f3ec;
  --danger: #b42318;
  --danger-bg: #fdeceb;
  --ok: #0c6b4d;
  --shadow: 0 1px 1px rgba(22, 26, 34, 0.04), 0 10px 28px rgba(22, 26, 34, 0.06);
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --radius: 16px;
  --wrap: 44rem;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151b;
    --bg-spot: #163328;
    --surface: #1c212b;
    --ink: #eef1f5;
    --muted: #9aa3b2;
    --line: #2c3340;
    --accent: #3dba8b;
    --accent-hover: #5ad0a2;
    --accent-ink: #0b1612;
    --accent-soft: #163328;
    --danger: #ff8a80;
    --danger-bg: #3a1c1a;
    --ok: #3dba8b;
    --shadow: 0 1px 1px rgba(0, 0, 0, 0.2), 0 10px 28px rgba(0, 0, 0, 0.28);
  }
}

*,
*::before,
*::after { box-sizing: border-box; }
html { color-scheme: light dark; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background:
    radial-gradient(1200px 420px at 100% -10%, var(--bg-spot), transparent 62%),
    var(--bg);
  color: var(--ink);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
img, video { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.wrap {
  width: min(var(--wrap), calc(100% - 2rem));
  margin-inline: auto;
}
.wrap-wide { --wrap: 52rem; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0;
  min-height: 3.1rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: inherit;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-size: 0.95rem;
}
.brand:hover { color: inherit; }
.brand-mark {
  width: 1.85rem;
  height: 1.85rem;
  flex: none;
}
.brand-mark rect:first-child { fill: var(--accent); }
.brand-mark [stroke] { stroke: var(--accent-ink); }
.nav {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.88rem;
}
.nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}
.nav a:hover,
.nav a[aria-current="page"] { color: var(--ink); }
.nav-more { display: none; }
@media (min-width: 640px) {
  .nav-more { display: inline; }
  .brand { font-size: 1.02rem; }
}

main { flex: 1; padding-bottom: 3.5rem; }

.hero { padding-top: 0.35rem; }
.hero h1 {
  margin: 0;
  font-size: clamp(1.42rem, 4.8vw, 2.4rem);
  line-height: 1.15;
  letter-spacing: -0.035em;
  font-weight: 800;
  max-width: 16ch;
}
.lede {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.98rem;
  max-width: 36em;
}
.hero .lede { margin-bottom: 0.9rem; }

.tool {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.75rem;
}
@media (min-width: 640px) {
  .tool { padding: 1rem; }
}
.tool label {
  display: block;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.4rem;
}
.tool textarea {
  width: 100%;
  min-height: 4.6rem;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  line-height: 1.4;
  padding: 0.7rem 0.8rem;
  margin: 0;
}
.tool textarea::placeholder { color: color-mix(in srgb, var(--muted) 80%, transparent); }
.tool textarea:focus {
  outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: 0;
  border-color: var(--accent);
}
.tool-actions {
  display: flex;
  gap: 0.55rem;
  margin-top: 0.65rem;
}
.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 12px;
  font: inherit;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  min-height: 2.85rem;
  padding: 0.55rem 1rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  text-align: center;
}
.btn:disabled { opacity: 0.65; cursor: progress; }
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  flex: 1 1 auto;
}
.btn-primary:hover { background: var(--accent-hover); color: var(--accent-ink); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
  flex: 0 0 auto;
  min-width: 5.4rem;
}
.btn-ghost:hover { background: var(--accent-soft); }
.btn-link {
  background: none;
  border: 0;
  color: var(--accent);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.status {
  margin: 0.7rem 0 0;
  font-size: 0.92rem;
  color: var(--muted);
  min-height: 0;
}
.status[data-state="parsing"] { color: var(--ink); }
.status[data-state="error"] {
  color: var(--danger);
  background: var(--danger-bg);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
}
.status[data-state="ready"] { color: var(--ok); }
.status[hidden], .results[hidden] { display: none; }

.spinner {
  display: inline-block;
  width: 0.85em;
  height: 0.85em;
  border: 2px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: -0.1em;
  margin-right: 0.35em;
}
@keyframes spin { to { transform: rotate(360deg); } }

.results { margin-top: 0.85rem; display: grid; gap: 0.7rem; }
.result-block { display: grid; gap: 0.55rem; }
.result-meta {
  font-size: 0.88rem;
  color: var(--muted);
}
.result-meta strong { color: var(--ink); font-weight: 700; }
.media-card {
  display: grid;
  grid-template-columns: 4.4rem 1fr auto;
  gap: 0.7rem;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.5rem;
  background: var(--bg);
}
.media-card img {
  width: 4.4rem;
  height: 4.4rem;
  object-fit: cover;
  border-radius: 8px;
  background: var(--line);
}
.media-card .ph {
  width: 4.4rem;
  height: 4.4rem;
  border-radius: 8px;
  background: var(--accent-soft);
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.media-info { min-width: 0; }
.media-info .kind {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}
.media-info .name {
  display: block;
  font-size: 0.86rem;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.media-card .btn { min-height: 2.4rem; padding: 0.4rem 0.75rem; flex: none; }
.download-all { margin-top: 0.15rem; }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
}
.chips li {
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
}

section { margin-top: 2.4rem; }
section h2 {
  margin: 0 0 0.9rem;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
}
.steps {
  display: grid;
  gap: 0.7rem;
  padding: 0;
  margin: 0;
  counter-reset: step;
  list-style: none;
}
.steps li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.9rem 1rem 0.95rem 3.1rem;
  position: relative;
}
.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0.85rem;
  top: 0.9rem;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
  font-size: 0.85rem;
  display: grid;
  place-items: center;
}
.steps strong { display: block; margin-bottom: 0.15rem; }

.faq { display: grid; gap: 0.5rem; }
.faq details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.15rem 0.9rem;
}
.faq summary {
  cursor: pointer;
  font-weight: 700;
  padding: 0.7rem 0;
  letter-spacing: -0.01em;
}
.faq details p { margin: 0 0 0.85rem; color: var(--muted); }

.disclaimer, .note {
  font-size: 0.9rem;
  color: var(--muted);
}
.disclaimer {
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  margin-top: 2.2rem;
}

.cta-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem;
  box-shadow: var(--shadow);
  display: grid;
  gap: 0.7rem;
  margin: 1.2rem 0 0;
}
.cta-panel p { margin: 0; color: var(--muted); }
.cta-panel .btn { justify-self: start; }

.prose { max-width: 40rem; }
.prose h1 {
  margin: 0.4rem 0 0.6rem;
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.prose h2 {
  margin: 1.8rem 0 0.6rem;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}
.prose p, .prose li { color: var(--ink); }
.prose .lede, .prose .meta { color: var(--muted); }
.prose .meta { font-size: 0.88rem; margin: 0 0 1.2rem; }
.prose ul { padding-left: 1.2rem; }
.legal h1 { font-size: clamp(1.5rem, 4vw, 2rem); }

.blog-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.75rem; }
.blog-list a {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
}
.blog-list a:hover { border-color: var(--accent); }
.blog-list h2 { margin: 0 0 0.3rem; font-size: 1.05rem; letter-spacing: -0.02em; color: var(--ink); }
.blog-list p { margin: 0; color: var(--muted); font-size: 0.92rem; }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.2rem 0 1.6rem;
  color: var(--muted);
  font-size: 0.85rem;
}
.footer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
  align-items: flex-start;
  justify-content: space-between;
}
.footer-cols {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1.4rem;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; }
.footer-links a { color: var(--muted); text-decoration: none; font-weight: 600; }
.footer-links a:hover { color: var(--ink); }
.not-affiliated { margin: 0.55rem 0 0; }

.skip {
  position: absolute;
  left: 0.75rem;
  top: -3rem;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  z-index: 10;
}
.skip:focus { top: 0.5rem; }

@media (max-width: 399px) {
  .wrap { width: min(var(--wrap), calc(100% - 1.5rem)); }
  .hero h1 { max-width: none; }
}

.tool-hint,
.noscript-note,
.download-all-note {
  margin: 0.45rem 0 0;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--muted);
}
.status:focus,
.status:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
