/* Stories Download — visual identity: "highlights home" (v3-B).
 * Warm paper canvas, stone ink, clay / sand / slate highlight rings.
 * Not Instagram's brand colours, glyph, or gradient.
 * The v1 wordmark (green rounded square) keeps its own official fills.
 */
@font-face {
  font-family: "Albert Sans";
  src: url("/assets/AlbertSans.e95c387bfe.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #F5F2EC;
  --card: #FFFFFF;
  --ink: #1C1917;
  --muted: #57534E;
  --hint: #6B6560;
  --line: #E4DFD6;
  --clay: #8A5A3C;
  --sand: #C4B49A;
  --slate: #4A5560;
  --danger: #8A2B2B;
  --danger-bg: #F8EEEE;
  --ok: #3F5D46;
  --font: "Albert Sans", ui-sans-serif, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  color-scheme: light;
}
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  font-weight: 430;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
img, video { max-width: 100%; height: auto; }
a { color: var(--clay); text-underline-offset: 2px; }
a:hover { color: var(--ink); }
button, textarea, input { font: inherit; }

.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  z-index: 20;
  padding: 8px 12px;
  background: var(--ink);
  color: #fff;
  border-radius: 6px;
}
.skip:focus { top: 8px; }

.wrap,
.footer-row,
.not-affiliated {
  width: min(100% - 40px, 760px);
  margin-left: auto;
  margin-right: auto;
}

/* Header — same centered column as the page */
.site-header {
  padding: 0;
  border-bottom: 1px solid var(--line);
}
.header-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 48px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.02em;
  min-height: 44px;
}
.brand:hover { color: var(--ink); }
.brand-mark {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  display: block;
}
.nav {
  display: none;
  margin-left: auto;
  gap: 18px;
}
.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.nav a:hover,
.nav a[aria-current="page"] { color: var(--ink); }
.menu-btn {
  margin-left: auto;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 44px;
  min-width: 44px;
  padding: 0 12px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}
.menu-panel {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 8px 0 14px;
}
.menu-panel[hidden] { display: none; }
.menu-panel a {
  display: flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
}
.menu-panel a[aria-current="page"] { color: var(--ink); }

/* Homepage / shared page intro — tight column, starts near the top */
main { flex: 1; padding: 20px 0 0; }
.profile { padding: 0; }
h1 {
  margin: 0 0 8px;
  font-size: clamp(1.7rem, 5.2vw, 2.35rem);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.lede {
  margin: 0 0 18px;
  max-width: 60ch;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.45;
}
.profile-home .lede {
  font-size: 0.9375rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Highlights row — homepage tool entries */
.highlights { padding: 0 0 14px; }
.row-label {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--hint);
}
.ring-row {
  display: flex;
  gap: 14px;
}
.hl {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  color: var(--ink);
  text-decoration: none;
  min-width: 64px;
  min-height: 44px;
}
.cover {
  position: relative;
  width: 48px;
  height: 48px;
  color: var(--ink);
}
.cover svg { display: block; width: 48px; height: 48px; }
.cover i {
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-style: normal;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.02em;
}
.cover-story i { background: #E8D5C4; color: #5C3A28; }
.cover-high i { background: #E6DCC8; color: #5C4E38; }
.cover-reels i { background: #D7DCE0; color: #2E363C; }
.hl-name { font-size: 11px; font-weight: 650; color: var(--muted); }
.hl.is-active .hl-name { color: var(--ink); }
.hl:not(.is-active) .cover { opacity: 0.78; }
.hl:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 8px; }

/* Tool card — compact, no side preview, so the form stays on the first screen */
.viewer {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 14px 16px;
  box-shadow: 0 1px 0 rgba(28, 25, 23, 0.04);
}
.viewer-cover { display: none; }
.tool { min-width: 0; }
.tool label {
  display: block;
  font-size: 12px;
  font-weight: 650;
  margin-bottom: 6px;
  color: var(--hint);
}
.tool textarea {
  width: 100%;
  min-height: 52px;
  resize: vertical;
  border: 1px solid #D6D0C7;
  background: #FBFAF7;
  color: var(--ink);
  border-radius: 10px;
  padding: 10px 12px;
  line-height: 1.4;
  outline: none;
  margin: 0;
}
.tool textarea:focus { border-color: var(--ink); }
.tool textarea::placeholder { color: #6B6560; }
.tool-actions { display: flex; gap: 8px; margin-top: 8px; }

.btn {
  appearance: none;
  min-height: 44px;
  border-radius: 10px;
  border: 1px solid transparent;
  padding: 0 16px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  text-align: center;
  text-decoration: none;
  letter-spacing: -0.01em;
  color: inherit;
}
.btn:disabled { opacity: 0.65; cursor: default; }
.btn-ghost {
  flex: 0 0 auto;
  min-width: 88px;
  background: #fff;
  color: var(--ink);
  border-color: #D6D0C7;
}
.btn-ghost:hover { background: #F5F2EC; color: var(--ink); }
.btn-primary { flex: 1; background: var(--ink); color: #fff; }
.btn-primary:hover { background: #2A2420; color: #fff; }
.btn-link {
  background: none;
  border: 0;
  color: var(--clay);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  min-height: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
  border-radius: 0;
}
.btn-link:hover { color: var(--ink); }

.btn:focus-visible,
.tool textarea:focus-visible,
.nav a:focus-visible,
.menu-btn:focus-visible,
.brand:focus-visible,
.skip:focus-visible,
.status:focus-visible,
.menu-panel a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.tool-hint,
.noscript-note,
.download-all-note {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--hint);
}
.status {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--muted);
}
.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(--ink) 22%, transparent);
  border-top-color: var(--ink);
  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: 12px; display: grid; gap: 8px; }
.result-block { display: grid; gap: 8px; }
.result-meta { font-size: 13px; 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: 10px;
  padding: 0.5rem;
  background: #FBFAF7;
}
.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: #E8D5C4;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #5C3A28;
  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(--clay);
}
.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: 44px; padding: 0.4rem 0.75rem; flex: none; }
.download-all { margin-top: 0.15rem; }

/* How / FAQ / disclaimer */
.below { padding: 28px 0 48px; }
.block { margin-bottom: 32px; }
.block:first-child { margin-top: 0; }
h2 {
  margin: 0 0 16px;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  font-weight: 700;
}
.steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
  display: grid;
  gap: 14px;
}
.steps li {
  counter-increment: step;
  padding-left: 36px;
  position: relative;
  color: var(--muted);
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}
.steps strong { display: block; color: var(--ink); font-weight: 700; margin-bottom: 2px; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: 650;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq details p { margin: 0 0 16px; color: var(--muted); }
.faq a { color: var(--clay); }
.disclaimer, .note {
  color: var(--hint);
  font-size: 13px;
  line-height: 1.5;
}
.disclaimer { margin: 0; }
.note { margin: 0 0 24px; }

/* Blog / legal / 404 */
.prose { padding: 0 0 48px; }
.prose h1 {
  margin: 0 0 8px;
  font-size: clamp(1.7rem, 5.2vw, 2.35rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
  font-weight: 700;
}
.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, .prose ol { padding-left: 1.2rem; }
.prose .disclaimer { color: var(--hint); margin-top: 2rem; }
.legal h1 { font-size: clamp(1.7rem, 5.2vw, 2.35rem); }

.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(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem 1.1rem;
}
.blog-list a:hover { border-color: var(--ink); color: inherit; }
.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; }

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

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 24px 0 32px;
  color: var(--hint);
  font-size: 13px;
}
.footer-row,
.footer-cols,
.footer-links { display: flex; flex-wrap: wrap; gap: 12px 20px; }
.footer-row { justify-content: space-between; align-items: flex-start; }
.footer-links a {
  color: var(--muted);
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  font-weight: 600;
}
.footer-links a:hover { color: var(--ink); }
.not-affiliated { margin-top: 8px; }

@media (min-width: 720px) {
  .menu-btn { display: none; }
  .nav { display: flex; }
  .header-bar { min-height: 52px; }
  main { padding: 28px 0 0; }
  .profile-home .lede {
    -webkit-line-clamp: unset;
    overflow: visible;
    display: block;
  }
  .cover { width: 56px; height: 56px; }
  .cover svg { width: 56px; height: 56px; }
  .cover i { inset: 6px; font-size: 15px; }
  .hl-name { font-size: 12px; }
  .viewer { padding: 16px 18px 18px; }
  .tool textarea { min-height: 64px; }
  .btn-primary { flex: 0 1 auto; min-width: 168px; }
}

/* Short screens: keep the paste box and Download button on the first screen */
@media (max-height: 700px) {
  main { padding-top: 14px; }
  .lede { margin-bottom: 12px; }
  .highlights { padding-bottom: 10px; }
  .profile-home .lede {
    font-size: 0.875rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}

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