/*
  Entry point for the public site's stylesheet. scripts/build-site-assets.mjs
  inlines these @imports into one file: public/assets/site.css.
  Order matters: tokens and base first, shared pieces, then sections and pages.
*/

/* ---- src/styles/tokens.css ---- */
/*
  Design tokens. Every color/spacing/radius value used anywhere in the app
  should trace back to one of these custom properties — never hardcode a
  hex value or a one-off pixel size in a component stylesheet.
*/

:root {
  /* Colors — light (default) */
  --color-bg: #f5f5f2;
  --color-bg-subtle: #ecece7;
  --color-surface: #ffffff;
  --color-fg: #171717;
  --color-muted: #666666;
  --color-border: #ddddd8;
  --color-card: #ffffff;

  /* Near-black for primary buttons and the dark section */
  --color-ink: #111111;
  --color-ink-fg: #ffffff;
  --color-dark: #151515;

  /* Brand — warm electric yellow, used as an accent, not a background flood */
  --color-primary: #ffe300;
  --color-primary-strong: #ebd100;
  --color-primary-fg: #111111;
  --color-primary-wash: #fff8cc;
  /* Keyword colour in headings (<mark>): a darker gold that reads on white */
  --color-heading-accent: #8a7600;
  /* Blog card hover background */
  --color-card-hover: #fafafa;

  /* Interactive accent (links, focus, secondary CTAs) */
  --color-accent: #2f2f2f;
  --color-accent-fg: #ffffff;
  --color-ring: #111111;

  /* Restrained secondary accent — video/spotlight/live indicators only */
  --color-live: #ff5c5c;
  --color-live-fg: #ffffff;

  --color-destructive: #d9364a;
  --color-destructive-fg: #ffffff;
  --color-success: #1c8a53;
  --color-overlay: rgba(10, 10, 8, 0.66);

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --radius-xl: 12px;
  --radius-pill: 999px;

  /* Spacing scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;

  /* Shadows — kept subtle on purpose */
  --shadow-sm: 0 1px 2px rgba(22, 22, 22, 0.06);
  --shadow-md: 0 8px 24px rgba(22, 22, 22, 0.08);
  --shadow-lg: 0 20px 48px rgba(22, 22, 22, 0.12);
  --shadow-yellow: 0 0 0 3px rgba(17, 17, 17, 0.12);

  /* Layout */
  --container-site: 1180px;
  --container-content: 820px;
  /* Content sections below the hero (what is, tools, steps, FAQ, blog). */
  --container-section: 960px;
  --header-height: 68px;
  /* Side padding for full-width bars (header, footer). */
  --page-gutter: 16px;

  /* Typography — Manrope for everything; IBM Plex Mono only for tiny labels. */
  --font-sans: var(--font-manrope), Inter, Arial, sans-serif;
  --font-heading: var(--font-plex-mono), ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --font-mono: var(--font-plex-mono), ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Hero H1: 34px mobile -> 52px desktop */
  --fs-display: clamp(2.125rem, 1.5rem + 2.4vw, 3.25rem);
  /* Page H1 (About, blog posts...): 30px -> 44px */
  --fs-h1: clamp(1.875rem, 1.4rem + 1.8vw, 2.75rem);
  /* Section H2: 24px mobile -> 32px desktop */
  --fs-h2: clamp(1.5rem, 1.2rem + 1.1vw, 2rem);
  --fs-h3: 1.125rem;
  --fs-h4: 1rem;
  --fs-body: 1rem;
  --fs-lead: 1.0625rem;
  --fs-small: 0.9375rem;
  --fs-xs: 0.875rem;

  --lh-tight: 1.12;
  --lh-snug: 1.4;
  --lh-normal: 1.6;

  --transition-fast: 150ms ease;
  --transition-base: 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-bg: #121212;
    --color-bg-subtle: #1a1a19;
    --color-surface: #1c1c1b;
    --color-fg: #f5f4ef;
    --color-muted: #a5a49c;
    --color-border: #2c2c27;
    --color-card: #1c1c1b;
    --color-ink: #f2f2ee;
    --color-ink-fg: #111111;
    --color-dark: #0c0c0c;

    --color-primary: #ffe300;
    --color-primary-strong: #ffec66;
    --color-primary-fg: #161616;
    --color-primary-wash: #2a2610;
    --color-heading-accent: #ffe300;
    --color-card-hover: #121212;

    --color-accent: #f5f4ef;
    --color-accent-fg: #161616;
    --color-ring: #ffe300;

    --color-live: #ff6f6f;
    --color-live-fg: #161616;

    --color-destructive: #ff6b7a;
    --color-destructive-fg: #161616;
    --color-success: #35c17d;
    --color-overlay: rgba(0, 0, 0, 0.78);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.55);
    --shadow-yellow: 0 0 0 3px rgba(255, 252, 0, 0.2);
  }
}

:root[data-theme="dark"] {
  --color-bg: #121212;
  --color-bg-subtle: #1a1a19;
  --color-surface: #1c1c1b;
  --color-fg: #f5f4ef;
  --color-muted: #a5a49c;
  --color-border: #2c2c27;
  --color-card: #1c1c1b;
    --color-ink: #f2f2ee;
    --color-ink-fg: #111111;
    --color-dark: #0c0c0c;

  --color-primary: #ffe300;
  --color-primary-strong: #ffec66;
  --color-primary-fg: #161616;
  --color-primary-wash: #2a2610;
  --color-heading-accent: #ffe300;
  --color-card-hover: #121212;

  --color-accent: #f5f4ef;
  --color-accent-fg: #161616;
  --color-ring: #ffe300;

  --color-live: #ff6f6f;
  --color-live-fg: #161616;

  --color-destructive: #ff6b7a;
  --color-destructive-fg: #161616;
  --color-success: #35c17d;
  --color-overlay: rgba(0, 0, 0, 0.78);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.55);
  --shadow-yellow: 0 0 0 3px rgba(255, 252, 0, 0.2);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---- src/site/styles/fonts.css ---- */
/* Self-hosted fonts (SIL Open Font License). Latin subset only. */
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/fonts/manrope-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308,
    U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-500-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308,
    U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-700-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308,
    U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --font-manrope: "Manrope";
  --font-plex-mono: "IBM Plex Mono";
}

/* ---- src/styles/base.css ---- */
/* Reset + base element styles + layout containers. Plain semantic CSS,
   no utility classes — components get their own scoped .module.css. */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-fg);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-normal);
  -webkit-font-smoothing: antialiased;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 800;
  line-height: var(--lh-tight);
  letter-spacing: -0.025em;
}

h1 {
  font-size: var(--fs-h1);
}

h2 {
  font-size: var(--fs-h2);
}

h3 {
  font-size: var(--fs-h3);
}

h4 {
  font-size: var(--fs-h4);
}

p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
}

input,
textarea,
select,
button {
  font: inherit;
  color: inherit;
}

table {
  border-collapse: collapse;
  width: 100%;
}

/* Visible focus state everywhere — never remove outline without replacing it. */
:focus-visible {
  outline: 2px solid var(--color-ring);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.container-site {
  width: 100%;
  max-width: var(--container-site);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

@media (min-width: 768px) {
  .container-site {
    padding-inline: var(--space-6);
  }
}

@media (min-width: 1024px) {
  :root {
    --page-gutter: 32px;
  }
}

.container-content {
  width: 100%;
  max-width: var(--container-content);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

@media (min-width: 768px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Tiny uppercase label (e.g. "FREE · NO LOGIN · ONLINE"). Never for paragraphs. */
.mono-label {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

::selection {
  background: var(--color-primary);
  color: var(--color-primary-fg);
}

/* Shared */

/* ---- src/components/ui/Button.css ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-weight: 700;
  white-space: nowrap;
  transition: background-color var(--transition-fast), border-color var(--transition-fast),
    color var(--transition-fast);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Sizes */
.btn-sm {
  min-height: 38px;
  padding: var(--space-2) var(--space-4);
  font-size: var(--fs-small);
}

.btn-md {
  padding: var(--space-3) var(--space-5);
  font-size: 0.9375rem;
}

.btn-lg {
  padding: var(--space-4) var(--space-6);
  font-size: var(--fs-body);
}

.btn-full-width {
  width: 100%;
}

/* Variants */
.btn-primary {
  background: var(--color-primary);
  color: var(--color-primary-fg);
}

.btn-primary:hover:not(:disabled) {
  background: var(--color-primary-strong);
}

.btn-ink {
  background: var(--color-ink);
  color: var(--color-ink-fg);
}

.btn-ink:hover:not(:disabled) {
  background: color-mix(in srgb, var(--color-ink) 82%, var(--color-bg));
}

.btn-secondary {
  background: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-fg);
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--color-fg);
}

.btn-outline {
  background: transparent;
  border-color: var(--color-border);
  color: var(--color-fg);
}

.btn-outline:hover:not(:disabled) {
  border-color: var(--color-fg);
}

.btn-ghost {
  background: transparent;
  color: var(--color-fg);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--color-bg-subtle);
}

.btn-destructive {
  background: var(--color-destructive);
  color: var(--color-destructive-fg);
}

.btn-destructive:hover:not(:disabled) {
  filter: brightness(0.95);
}

/* ---- src/site/styles/section-header.css ---- */
.section-header-wrap {
  max-width: 680px;
}

.section-header-center {
  margin-inline: auto;
  text-align: center;
}

.section-header-eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-primary-fg);
  background: var(--color-primary);
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: var(--space-4);
}

.section-header-desc {
  margin-top: var(--space-4);
  color: var(--color-muted);
  font-size: var(--fs-lead);
  line-height: var(--lh-normal);
}

/* ---- src/site/styles/empty-state.css ---- */
.empty-state-wrap {
  padding: var(--space-10) var(--space-4);
  text-align: center;
}

.empty-state-heading {
  margin-top: var(--space-5);
  font-size: var(--fs-h4);
}

.empty-state-text {
  margin-top: var(--space-2);
  color: var(--color-muted);
  font-size: var(--fs-small);
  max-width: 42ch;
  margin-inline: auto;
}

.empty-state-action {
  margin-top: var(--space-5);
}

/* ---- src/site/styles/empty-art.css ---- */
.empty-art-wrap {
  width: 96px;
  height: 128px;
  margin-inline: auto;
  position: relative;
}

.empty-art-frame {
  position: absolute;
  inset: 0;
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-muted);
}

.empty-art-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--color-primary-fg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
}

/* ---- src/site/styles/theme-toggle.css ---- */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-fg);
  transition: border-color var(--transition-fast);
}

.theme-toggle:hover {
  border-color: var(--color-fg);
}

/* Both icons are in the markup; show the moon in light mode, the sun in dark. */
.theme-toggle-moon,
.theme-toggle-sun {
  display: inline-flex;
}

.theme-toggle-sun {
  display: none;
}

[data-theme="dark"] .theme-toggle-sun {
  display: inline-flex;
}

[data-theme="dark"] .theme-toggle-moon {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle-sun {
    display: inline-flex;
  }

  :root:not([data-theme="light"]) .theme-toggle-moon {
    display: none;
  }
}

/* Heart in the header: opens /saved, with a count of saved items. */
.site-header-saved {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-fg);
  transition: border-color var(--transition-fast);
}

.site-header-saved:hover,
.site-header-saved[aria-current="page"] {
  border-color: var(--color-fg);
}

.site-header-saved-count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border: 2px solid var(--color-bg);
  border-radius: 999px;
  background: #ffe300;
  color: #111111;
  font-size: 0.6875rem;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
}

/* Layout */

/* ---- src/site/styles/announcement.css ---- */
.announcement-bar {
  background: var(--color-fg);
  color: var(--color-bg);
}

.announcement-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: 9px var(--space-4);
  font-size: var(--fs-xs);
  font-weight: 700;
  text-align: center;
  position: relative;
}

.announcement-message {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.announcement-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  background: var(--color-primary);
  color: var(--color-primary-fg);
  flex-shrink: 0;
}

.announcement-close {
  position: absolute;
  right: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-bg);
  opacity: 0.7;
  flex-shrink: 0;
}

.announcement-close:hover {
  opacity: 1;
}

@media (max-width: 560px) {
  .announcement-message {
    max-width: 60vw;
  }
}

/* ---- src/site/styles/site-header.css ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}

/* Wider than the 1180px content container, capped at 1600px on very wide
   screens. The background and bottom border still span the full width. */
.site-header-bar.container-site {
  max-width: 1600px;
  margin-inline: auto;
  padding-inline: var(--page-gutter);
}

.site-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  height: var(--header-height);
}

/* Logo: ghost mark + "SnapStory" and "Viewer" on a short yellow marker
   stroke. Shared by the header and footer (.site-footer-logo). */
.site-header-logo,
.site-footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  /* 22px on desktop, ~18px on a 390px phone so it fits beside the buttons. */
  font-size: clamp(1rem, 0.6rem + 2.2vw, 1.375rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--color-fg);
}

.site-logo-mark {
  flex: none;
  width: auto;
  /* 36px tall beside the 22px desktop wordmark; scales with it. */
  height: 1.65em;
}

.site-logo-accent {
  position: relative;
  z-index: 0;
}

.site-logo-accent::after {
  content: "";
  position: absolute;
  left: -1px;
  right: -1px;
  bottom: 0.12em;
  height: 0.38em;
  background: var(--color-primary);
  z-index: -1;
}

.site-header-desktop-nav {
  display: none;
}

.site-header-nav-list {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.site-header-desktop-link {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-fg);
  padding-block: var(--space-2);
  border-bottom: 2px solid transparent;
  transition: border-color var(--transition-fast);
}

.site-header-desktop-link:hover,
.site-header-desktop-link:focus-visible,
.site-header-desktop-link--current {
  border-bottom-color: var(--color-fg);
}

.site-header-more-wrap {
  position: relative;
}

.site-header-more-trigger {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}

.site-header-more-trigger svg {
  transition: transform var(--transition-fast);
}

.site-header-more-trigger[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.site-header-more-menu {
  position: absolute;
  top: 100%;
  left: -12px;
  z-index: 30;
  padding-top: var(--space-2);
  min-width: 220px;
  display: none;
  flex-direction: column;
}

.site-header-more-menu-inner {
  padding: var(--space-2);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
}

.site-header-more-wrap:hover .site-header-more-menu,
.site-header-more-wrap:focus-within .site-header-more-menu,
.site-header-more-wrap.is-open .site-header-more-menu {
  display: flex;
}

/* Closed with Escape or a click outside, even while hovered or focused. */
.site-header-more-wrap.is-closed .site-header-more-menu {
  display: none;
}

.site-header-more-menu a {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: var(--fs-small);
  font-weight: 600;
}

.site-header-more-menu a {
  white-space: nowrap;
}

.site-header-more-menu a:hover,
.site-header-more-menu a[aria-current="page"] {
  background: var(--color-bg-subtle);
}

.site-header-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

@media (min-width: 768px) {
  .site-header-desktop-nav {
    display: flex;
  }
}

.site-header-desktop-link[aria-current="page"] {
  border-bottom-color: var(--color-primary);
}

/* ---- src/site/styles/mobile-nav.css ---- */
.mobile-nav-hamburger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-fg);
}

@media (min-width: 768px) {
  .mobile-nav-hamburger {
    display: none;
  }
}

.mobile-nav-overlay {
  position: fixed;
  inset: 0;
  background: var(--color-overlay);
  z-index: 50;
}

.mobile-nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 86vw);
  background: var(--color-bg);
  border-left: 1px solid var(--color-border);
  z-index: 51;
  display: flex;
  flex-direction: column;
  padding: var(--space-5);
  overflow-y: auto;
}

.mobile-nav-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
}

.mobile-nav-close-btn {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-fg);
}

.mobile-nav-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.mobile-nav-link {
  display: block;
  padding: var(--space-4) var(--space-1);
  font-size: var(--fs-lead);
  font-weight: 700;
  border-bottom: 1px solid var(--color-border);
}

.mobile-nav-group {
  border-bottom: none;
  padding-bottom: var(--space-1);
}

.mobile-nav-sublink {
  display: block;
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-5);
  font-size: var(--fs-small);
  color: var(--color-muted);
}

.mobile-nav-sublink[aria-current="page"] {
  color: var(--color-fg);
  font-weight: 700;
}

.mobile-nav-sublink:last-child {
  margin-bottom: var(--space-2);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: var(--space-4);
}

@media (min-width: 768px) {
  .mobile-nav-overlay,
  .mobile-nav-drawer {
    display: none;
  }
}

.mobile-nav-title {
  font-weight: 800;
}

/* ---- src/site/styles/site-footer.css ---- */
.site-footer {
  border-top: 1px solid var(--color-border);
  background: var(--color-bg);
}

.site-footer-featured {
  border-bottom: 1px solid var(--color-border);
  padding-block: var(--space-8);
}

.site-footer-featured-heading {
  text-align: center;
  color: var(--color-muted);
  margin-bottom: var(--space-5);
}

.site-footer-featured-logos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
}

.site-footer-featured-logos img {
  height: 22px;
  width: auto;
  filter: grayscale(1);
  opacity: 0.55;
  transition: opacity var(--transition-fast), filter var(--transition-fast);
}

.site-footer-featured-logos img:hover {
  opacity: 1;
  filter: grayscale(0);
}

.site-footer-main {
  display: grid;
  gap: var(--space-8);
  padding-block: var(--space-12);
}

/* One row like tik.ninja: copyright left, links right; full width. */
/* Same 1600px cap as the header bar; the top border spans the full width. */
.site-footer-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3) var(--space-6);
  max-width: 1600px;
  margin-inline: auto;
  padding: var(--space-6) var(--page-gutter);
}

.site-footer-brand {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-4);
}

/* Mark is 1.65em, so 28px tall here. */
.site-footer-logo {
  font-size: 1.0625rem;
}

.site-footer-copy,
.site-footer-links a {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  color: var(--color-muted);
}

.site-footer-copy a {
  color: var(--color-fg);
  font-weight: 700;
}

.site-footer-copy a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-6);
}

.site-footer-links a {
  display: inline-block;
  padding-block: 4px;
  transition: color var(--transition-fast);
}

.site-footer-links a:hover {
  color: var(--color-fg);
}

@media (max-width: 600px) {
  .site-footer-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-footer-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-1) var(--space-8);
  }
}

/* ---- src/site/styles/layout.css ---- */
/* Keyboard users can jump straight past the header. */
.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  z-index: 100;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  background: var(--color-ink);
  color: var(--color-ink-fg);
  font-weight: 700;
}

.skip-link:focus {
  top: var(--space-3);
}

/* Admin-managed ad slots: reserve space to avoid layout jumps, and honour
   the "show on desktop / show on mobile" switches. */
.ad-slot {
  margin: var(--space-8) auto;
  min-height: 90px;
}

@media (max-width: 767px) {
  .ad-slot-hide-mobile {
    display: none;
  }
}

@media (min-width: 768px) {
  .ad-slot-hide-desktop {
    display: none;
  }
}

/* Maintenance mode page */
.maintenance {
  padding-block: 120px;
  text-align: center;
}

.maintenance p {
  margin-top: var(--space-3);
  color: var(--color-muted);
}

/* The `hidden` attribute always wins over component display rules. */
[hidden] {
  display: none !important;
}

/* Footer always sits at the bottom: on short pages <main> grows to fill
   the space instead of the footer floating up the screen. */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
}

#main {
  flex: 1 0 auto;
}

/* Headings use IBM Plex Mono. Wrap the keyword in <mark> (e.g. "A Free
   <mark>Snapchat Viewer</mark>") to show it in the accent colour. */
h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.03em;
}

:is(h1, h2, h3, h4) mark {
  background: none;
  color: var(--color-heading-accent);
}

/* Homepage */

/* ---- src/site/styles/home.css ---- */
/* Homepage section rhythm: 64px on phones, 104px on desktop. */
.home-section {
  padding-block: 64px;
  scroll-margin-top: 88px;
}

@media (min-width: 768px) {
  .home-section {
    padding-block: 104px;
  }
}

/* The one white band, so the light-grey page doesn't run uninterrupted. */
.home-band-white {
  background: var(--color-surface);
  border-block: 1px solid var(--color-border);
}

.home-faq-heading {
  text-align: center;
  margin-bottom: var(--space-10);
}

/* Sections are told apart by background colour, not lines. */
.home-divider {
  border-top: 0;
}

/* ---- src/site/styles/hero.css ---- */
/* Fills the screen below the sticky header (content centred), like
   tik.ninja. Back to normal height once a search shows results. */
.hero-section {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: calc(100vh - var(--header-height) - 1px);
  min-height: calc(100svh - var(--header-height) - 1px);
  padding-block: 80px 32px;
  scroll-margin-top: 88px;
}

.hero-section.is-compact {
  min-height: 0;
}

@media (min-width: 768px) {
  .hero-section {
    padding-block: 80px 40px;
  }
}

.hero-inner {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* Free space is split 1 : 2 above and below the heading + search
   (.hero-main), so they sit a little above centre; the features row
   (.hero-extras) is pinned to the bottom of the full-screen hero. */
.hero-inner::before {
  content: "";
  flex: 1 1 0;
}

.hero-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

/* "100% ANONYMOUS · NO LOGIN REQUIRED · FREE" — one yellow tag that wraps
   item by item on narrow phones instead of mid-phrase. */
.hero-label {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  row-gap: 2px;
  padding: 5px 10px;
  border-radius: 4px;
  background: #ffe300;
  color: #111111;
  font-size: 0.75rem;
  font-weight: 500;
  margin-bottom: var(--space-6);
}

.hero-label li {
  white-space: nowrap;
}

.hero-label li + li::before {
  content: "·";
  margin-inline: 0.6em;
}

/* Small phones: three separate chips that wrap cleanly. */
@media (max-width: 479px) {
  .hero-label {
    gap: 6px;
    padding: 0;
    background: none;
  }

  .hero-label li {
    padding: 4px 8px;
    border-radius: 4px;
    background: #ffe300;
  }

  .hero-label li + li::before {
    content: none;
  }
}

.hero-title {
  font-size: var(--fs-display);
  line-height: 1.05;
  letter-spacing: -0.035em;
  max-width: 820px;
}

.hero-desc {
  margin-top: var(--space-5);
  max-width: 620px;
  font-size: var(--fs-lead);
  line-height: var(--lh-normal);
  color: var(--color-muted);
}

@media (min-width: 768px) {
  .hero-desc {
    font-size: 1.125rem;
  }
}

.hero-tool {
  width: 100%;
  max-width: 820px;
  margin-top: var(--space-10);
  text-align: left;
}

/* ---- "Try" examples above the search box ---- */

.hero-try {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  /* Above the search box. */
  margin-bottom: var(--space-3);
  color: var(--color-muted);
  font-size: var(--fs-small);
  text-align: center;
}

.hero-try-chip {
  display: inline-block;
  padding: 3px 9px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-surface);
  color: var(--color-fg);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}

.hero-try-chip:hover {
  border-color: var(--color-fg);
  background: #ffe300;
  color: #111111;
}

/* ---- features row + link cards (hidden while results show) ---- */

.hero-extras {
  display: flex;
  flex: 2 1 0;
  flex-direction: column;
  justify-content: flex-end;
  width: 100%;
  max-width: 980px;
  /* Keeps a gap from the search box when the screen is short. */
  padding-top: var(--space-10);
}

/* No features row: the 2 parts of the space still go below the content. */
.hero-inner:not(:has(.hero-extras))::after {
  content: "";
  flex: 2 1 0;
}

.hero-features {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3) var(--space-6);
}

.hero-feature {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-small);
  font-weight: 600;
}

.hero-feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  color: var(--color-fg);
}

.hero-feature-icon img,
.hero-link-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Small links to other tools (default) */
.hero-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-6);
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-fg);
  font-size: var(--fs-small);
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.15s ease;
}

.hero-pill:hover {
  border-color: var(--color-fg);
}

.hero-pill-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: var(--color-muted);
}

.hero-pill-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.hero-pill:hover .hero-pill-icon {
  color: var(--color-fg);
}

/* Large link cards (optional) */
.hero-links {
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-8);
  text-align: left;
}

@media (min-width: 768px) {
  .hero-links {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4);
  }
}

.hero-link {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 100%;
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-fg);
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.hero-link:hover {
  border-color: var(--color-fg);
  transform: translateY(-1px);
}

.hero-link-icon {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--color-bg-subtle);
}

.hero-link-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.hero-link-title {
  font-weight: 700;
}

.hero-link-text {
  color: var(--color-muted);
  font-size: var(--fs-xs);
  line-height: 1.45;
}

.hero-link-arrow {
  display: inline-flex;
  color: var(--color-muted);
  transition: transform 0.15s ease;
}

.hero-link:hover .hero-link-arrow {
  color: var(--color-fg);
  transform: translateX(2px);
}

@media (prefers-reduced-motion: reduce) {
  .hero-link,
  .hero-pill,
  .hero-link-arrow,
  .hero-recent-chevron {
    transition: none;
  }
}

/* ---- src/site/styles/viewer.css ---- */
/* Search box outline: 2px black (light text colour in dark mode, so it stays visible). */
:root {
  --search-border: #000000;
}

[data-theme="dark"] {
  --search-border: var(--color-fg);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --search-border: var(--color-fg);
  }
}

/* ---- search form ----
   Desktop: one white box holding @ + input + Paste + the button.
   Phones: the box holds @ + input + Paste; the button sits full-width below. */

.viewer-input-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.viewer-field {
  display: flex;
  align-items: center;
  height: 60px;
  padding-inline: var(--space-4) var(--space-2);
  background: var(--color-surface);
  border: 2px solid var(--search-border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.viewer-field:focus-within {
  border-color: var(--color-fg);
  box-shadow: var(--shadow-yellow);
}

.viewer-input-at {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-muted);
  padding-right: var(--space-2);
}

.viewer-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: none;
  background: transparent;
  color: var(--color-fg);
  /* 16px+ stops iOS zooming into the field on focus */
  font-size: 1.0625rem;
  font-weight: 500;
}

.viewer-input:focus,
.viewer-input:focus-visible {
  outline: none;
}

.viewer-input::placeholder {
  color: var(--color-muted);
  opacity: 1;
}

.viewer-paste-btn {
  flex-shrink: 0;
  min-height: 40px;
  padding: 0 var(--space-3);
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-muted);
  font-size: var(--fs-small);
  font-weight: 600;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.viewer-paste-btn:hover {
  background: var(--color-bg-subtle);
  color: var(--color-fg);
}

.viewer-submit-btn {
  height: 52px;
  padding-inline: var(--space-6);
  font-size: var(--fs-body);
}

@media (min-width: 560px) {
  .viewer-input-row {
    flex-direction: row;
    align-items: center;
    gap: 0;
    height: 64px;
    padding: 6px;
    background: var(--color-surface);
    border: 2px solid var(--search-border);
    border-radius: var(--radius-md);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  }

  .viewer-input-row:focus-within {
    border-color: var(--color-fg);
    box-shadow: var(--shadow-yellow);
  }

  .viewer-field,
  .viewer-field:focus-within {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: none;
    box-shadow: none;
    background: transparent;
    padding-inline: var(--space-3) var(--space-2);
  }

  .viewer-submit-btn {
    height: 100%;
    min-height: 0;
  }
}

/* ---- recent searches: a closed dropdown under the search box ---- */

.hero-recent {
  position: relative;
  display: flex;
  justify-content: center;
  margin-top: var(--space-5);
}

.hero-recent-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-fg);
  font-size: var(--fs-small);
  font-weight: 600;
}

.hero-recent-toggle svg {
  color: var(--color-muted);
}

.hero-recent-toggle:hover {
  border-color: var(--color-fg);
}

.hero-recent-count {
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #ffe300;
  color: #111111;
  font-size: 0.75rem;
  line-height: 18px;
  text-align: center;
}

.hero-recent-chevron {
  display: inline-flex;
  transition: transform 0.15s ease;
}

.hero-recent-toggle[aria-expanded="true"] .hero-recent-chevron {
  transform: rotate(180deg);
}

.hero-recent-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  z-index: 20;
  width: min(320px, calc(100vw - 32px));
  padding: 6px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: 0 12px 32px rgba(17, 17, 17, 0.12);
  transform: translateX(-50%);
  text-align: left;
}

.hero-recent-list {
  max-height: 260px;
  overflow-y: auto;
}

.hero-recent-item {
  display: flex;
  align-items: center;
  border-radius: var(--radius-sm);
}

.hero-recent-item:hover {
  background: var(--color-bg-subtle);
}

.hero-recent-run {
  flex: 1;
  min-width: 0;
  min-height: 38px;
  padding: 0 10px;
  overflow: hidden;
  border: none;
  background: none;
  color: var(--color-fg);
  font-size: var(--fs-small);
  font-weight: 600;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero-recent-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--color-muted);
}

.hero-recent-remove:hover {
  color: var(--color-destructive);
}

.hero-recent-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
  padding: 8px 10px 4px;
  border-top: 1px solid var(--color-border);
  color: var(--color-muted);
  font-size: var(--fs-xs);
}

.hero-recent-clear {
  border: none;
  background: none;
  padding: 0;
  color: var(--color-fg);
  font-size: var(--fs-xs);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---- loading: our own animated scene + status + progress ---- */

.viewer-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 560px;
  margin: var(--space-10) auto 0;
  padding: 2rem 1.5rem 1.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  text-align: center;
}

.viewer-loader-svg {
  display: block;
  width: 200px;
  height: auto;
  overflow: visible;
}

.vl-cards {
  animation: vl-bob 2.4s ease-in-out infinite;
}

.vl-lens {
  animation: vl-scan 2.6s ease-in-out infinite;
}

.vl-spark {
  transform-box: fill-box;
  transform-origin: center;
  animation: vl-twinkle 1.8s ease-in-out infinite;
}

.vl-s2 { animation-delay: 0.6s; }
.vl-s3 { animation-delay: 1.2s; }

@keyframes vl-scan {
  0%, 100% { transform: translate(58px, 74px) rotate(-6deg); }
  50% { transform: translate(140px, 62px) rotate(6deg); }
}

@keyframes vl-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@keyframes vl-twinkle {
  0%, 100% { opacity: 0.2; transform: scale(0.6); }
  50% { opacity: 1; transform: scale(1.1); }
}

.viewer-loader-title {
  margin-top: var(--space-4);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.viewer-loader-status {
  min-height: 1.5em;
  margin-top: var(--space-1);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--color-muted);
}

.viewer-loader-bar {
  width: 100%;
  max-width: 360px;
  height: 6px;
  margin-top: var(--space-5);
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-bg);
}

.viewer-loader-fill {
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: var(--color-primary);
  transition: width 0.12s linear;
}

.viewer-loader-percent {
  margin-top: var(--space-2);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {
  .vl-cards,
  .vl-lens,
  .vl-spark {
    animation: none;
  }

  .vl-lens {
    transform: translate(100px, 68px);
  }
}

/* ---- clear (×) button inside the search box ---- */

.viewer-clear-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-muted);
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.viewer-clear-btn:hover {
  background: var(--color-bg-subtle);
  color: var(--color-fg);
}

/* ---- results ---- */

/* Results are 1200px wide, wider than the 820px search box they sit under:
   centred on the box and capped to the screen minus the page gutters. */
.viewer-results {
  width: max(100%, min(1200px, calc(100vw - 2 * var(--page-gutter) - 16px)));
  margin-top: var(--space-12);
  margin-left: 50%;
  translate: -50% 0;
}

.viewer-state-wrap {
  margin-top: var(--space-10);
}

.viewer-new-search {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0;
  border: none;
  background: none;
  color: var(--color-muted);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.viewer-new-search:hover {
  color: var(--color-fg);
}

/* Profile header card */
.viewer-profile {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-4) var(--space-5);
  margin-top: var(--space-3);
  padding: var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.viewer-profile-avatar {
  display: block;
  width: 64px;
  height: 64px;
  padding: 3px;
  border-radius: 50%;
  background: var(--color-primary);
  flex-shrink: 0;
}

.viewer-profile-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: var(--color-bg-subtle);
  border: 2px solid var(--color-surface);
}

.viewer-profile-main {
  min-width: 0;
}

.viewer-profile-name {
  font-size: 1.375rem;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.viewer-profile-name a:hover,
.viewer-profile-handle:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.viewer-profile-handle {
  display: inline-block;
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--color-muted);
}

.viewer-profile-bio {
  margin-top: var(--space-2);
  font-size: var(--fs-small);
  color: var(--color-muted);
  max-width: 52ch;
}

.viewer-profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  margin-top: var(--space-3);
}

.viewer-profile-links a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--fs-small);
  font-weight: 700;
  border-bottom: 2px solid var(--color-primary);
  line-height: 1.5;
}

.viewer-profile-links a:hover {
  border-bottom-color: var(--color-fg);
}

.viewer-profile-stats {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  margin: 0;
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
}

/* Number above its label. */
.viewer-profile-stat {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 2px;
}

.viewer-profile-stat dd {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.viewer-profile-stat dt {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-muted);
}

@media (min-width: 720px) {
  .viewer-profile {
    grid-template-columns: auto 1fr auto;
    align-items: center;
    padding: var(--space-6);
  }

  .viewer-profile-avatar {
    width: 76px;
    height: 76px;
  }

  .viewer-profile-stats {
    grid-column: auto;
    display: flex;
    gap: var(--space-6);
    padding: 0 0 0 var(--space-6);
    border-top: none;
    border-left: 1px solid var(--color-border);
    align-self: stretch;
    align-items: center;
  }
}

/* Tabs: one bordered row of buttons */
.viewer-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: var(--space-5);
  padding: 0;
  background: var(--color-border);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.viewer-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 46px;
  padding: 0 var(--space-3);
  border: none;
  background: var(--color-surface);
  color: var(--color-muted);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

/* Three tabs on one row, even on small phones. */
@media (max-width: 479px) {
  .viewer-tab {
    gap: 6px;
    padding: 0 6px;
    letter-spacing: 0.02em;
  }
}

.viewer-tab:hover {
  color: var(--color-fg);
  background: var(--color-bg);
}

.viewer-tab-count {
  min-width: 22px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--color-bg-subtle);
  color: var(--color-fg);
}

.viewer-tab-active,
.viewer-tab-active:hover {
  background: var(--color-primary);
  color: var(--color-primary-fg);
  font-weight: 600;
}

.viewer-tab-active .viewer-tab-count {
  background: var(--color-primary-fg);
  color: var(--color-primary);
}

.viewer-section-label {
  margin-top: var(--space-6);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-muted);
}

/* Grid: thumbnails sit edge to edge, divided by 1px lines */
.viewer-grid {
  display: grid;
  /* minmax(0, …): a long Highlight title must not widen its column. */
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: var(--space-3);
  padding: 0;
}

.viewer-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

.viewer-thumb {
  position: relative;
}

.viewer-thumb-wrap {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;
  padding: 0;
  border: none;
  background: var(--color-bg-subtle);
  cursor: pointer;
  overflow: hidden;
}

.viewer-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-base);
}

.viewer-card:hover .viewer-thumb-wrap img {
  transform: scale(1.03);
}

.viewer-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.18), transparent 22%, transparent 70%, rgba(0, 0, 0, 0.32));
}

.viewer-play-overlay svg {
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.55));
}

/* Small dark badges in the thumbnail corners */
.viewer-badge {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(17, 17, 17, 0.72);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
}

.viewer-badge-tl {
  top: 8px;
  left: 8px;
}

.viewer-badge-tr {
  top: 8px;
  right: 8px;
}

.viewer-badge-bl {
  bottom: 8px;
  left: 8px;
}

.viewer-badge-br {
  bottom: 8px;
  right: 8px;
}

.viewer-badge-type {
  background: #ffe300;
  color: #111111;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Round download (or play) button, bottom-right of the thumbnail */
.viewer-card-dl {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #ffffff;
  color: #111111;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.viewer-card-dl:hover,
.viewer-card-dl:focus-visible {
  background: #ffe300;
  transform: scale(1.06);
}

@media (prefers-reduced-motion: reduce) {
  .viewer-card-dl { transition: none; }
}

/* Buttons in the Highlight header (Play all) */
.viewer-card-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 44px;
  padding: 0 var(--space-2);
  border: none;
  background: var(--color-surface);
  color: var(--color-fg);
  font-size: var(--fs-small);
  font-weight: 700;
  transition: background-color var(--transition-fast);
}

.viewer-card-btn:hover {
  background: var(--color-bg);
}

.viewer-card-btn + .viewer-card-btn {
  border-left: 1px solid var(--color-border);
}

.viewer-card-btn-primary {
  background: var(--color-ink);
  color: var(--color-ink-fg);
}

.viewer-card-btn-primary:hover {
  background: color-mix(in srgb, var(--color-ink) 82%, var(--color-bg));
}

/* ---- Highlights shown as collections ---- */

.viewer-collection-title {
  overflow: hidden;
  padding: var(--space-2) var(--space-3) var(--space-3);
  font-size: var(--fs-small);
  font-weight: 700;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.viewer-collection-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-4);
  margin-top: var(--space-6);
}

.viewer-collection-head .viewer-section-label {
  flex: 1;
  min-width: 0;
  margin-top: 0;
}

.viewer-collection-head .viewer-card-btn {
  min-height: 36px;
  padding: 0 var(--space-4);
  border-radius: var(--radius-sm);
}

.viewer-load-more-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-6);
}

.viewer-load-more-count {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--color-muted);
}

/* Profile tab details */
.viewer-details {
  margin: var(--space-5) 0 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.viewer-details-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
}

.viewer-details-row + .viewer-details-row {
  border-top: 1px solid var(--color-border);
}

.viewer-details-row dt {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-muted);
  padding-top: 2px;
}

.viewer-details-row dd {
  margin: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.viewer-details-row a {
  border-bottom: 2px solid var(--color-primary);
}

.viewer-details-row a:hover {
  border-bottom-color: var(--color-fg);
}

@media (min-width: 560px) {
  .viewer-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
  }
}

@media (min-width: 768px) {
  .viewer-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .viewer-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

/* ---- results page (/profile/<username>) ---- */

.container-results {
  width: 100%;
  max-width: calc(1200px + 2 * var(--page-gutter));
  margin-inline: auto;
  padding-inline: var(--page-gutter);
}

.profile-page {
  padding-block: var(--space-8) var(--space-16);
}

/* The results page fills the screen below the header (so while it loads the
   footer stays out of view, at the bottom). The saved page is left as is. */
.profile-page:not(.saved-page) {
  min-height: calc(100vh - var(--header-height));
  min-height: calc(100svh - var(--header-height));
}

/* On this page the results already fill the 1200px container. */
.viewer-tool--page .viewer-results {
  width: 100%;
  margin-left: 0;
  translate: none;
  margin-top: var(--space-8);
}

.viewer-form--compact {
  max-width: 720px;
  margin-inline: auto;
}

.viewer-tool--page .hero-recent {
  margin-top: var(--space-3);
}

.profile-page-noscript {
  margin-top: var(--space-8);
  text-align: center;
  color: var(--color-muted);
}

/* ---- favourites (hearts) ---- */

/* Heart sits left of the round download button on each card. */
.viewer-card-fav {
  position: absolute;
  right: 54px;
  bottom: 8px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #ffffff;
  color: #111111;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.viewer-card-fav:hover,
.viewer-card-fav:focus-visible {
  transform: scale(1.06);
}

.viewer-card-fav.is-saved {
  background: #ffe300;
}

.viewer-card-fav.is-saved svg,
.viewer-profile-save.is-saved svg {
  fill: currentColor;
}

@media (prefers-reduced-motion: reduce) {
  .viewer-card-fav { transition: none; }
}

.viewer-profile-save {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-fg);
  font-size: var(--fs-small);
  font-weight: 700;
  cursor: pointer;
}

.viewer-profile-save:hover {
  border-color: var(--color-fg);
}

.viewer-profile-save.is-saved {
  border-color: #ffe300;
  background: #ffe300;
  color: #111111;
}

/* ---- Saved page ---- */

.saved-header h1 {
  font-size: var(--fs-h1);
  letter-spacing: -0.03em;
}

.saved-header p {
  margin-top: var(--space-2);
  color: var(--color-muted);
}

.saved-section {
  margin-top: var(--space-10);
}

.saved-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border);
}

.saved-section-head h2 {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-h3);
}

.saved-count {
  min-width: 24px;
  padding: 1px 7px;
  border-radius: 4px;
  background: var(--color-bg-subtle);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-align: center;
}

.saved-clear {
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-muted);
  font-size: var(--fs-small);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.saved-clear:hover {
  color: var(--color-fg);
}

.saved-empty,
.saved-note {
  margin-top: var(--space-4);
  color: var(--color-muted);
  font-size: var(--fs-small);
}

.saved-profiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: var(--space-4);
}

@media (min-width: 560px) {
  .saved-profiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 900px) {
  .saved-profiles { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

.saved-profile {
  position: relative;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  transition: border-color var(--transition-fast);
}

.saved-profile:hover {
  border-color: var(--color-fg);
}

.saved-profile-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--space-5) var(--space-3) var(--space-4);
  text-align: center;
}

.saved-profile-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin-bottom: var(--space-2);
  overflow: hidden;
  border: 3px solid #ffe300;
  border-radius: 50%;
  background: var(--color-bg-subtle);
  color: var(--color-muted);
}

.saved-profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.saved-profile-name {
  max-width: 100%;
  overflow: hidden;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.saved-profile-handle {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-muted);
}

.saved-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--color-muted);
  cursor: pointer;
}

.saved-remove:hover {
  background: var(--color-bg-subtle);
  color: var(--color-fg);
}

.saved-snap .viewer-grid,
.saved-section .viewer-grid {
  margin-top: var(--space-4);
}

.saved-expired {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3);
  color: var(--color-muted);
  font-size: var(--fs-small);
  text-align: center;
}

.saved-expired[hidden] {
  display: none;
}

/* ---- src/site/styles/story-modal.css ---- */
.story-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--color-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.story-modal-stage {
  position: relative;
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.story-modal-top-bar {
  position: absolute;
  top: -46px;
  left: 0;
  right: 0;
  z-index: 1;
}

.story-modal-progress-row {
  display: flex;
  gap: 4px;
}

.story-modal-progress-track {
  flex: 1;
  height: 3px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.3);
  overflow: hidden;
}

.story-modal-progress-fill {
  height: 100%;
  background: #fff;
  transition: width 150ms linear;
}

.story-modal-top-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-2);
}

.story-modal-top-identity {
  display: flex;
  align-items: center;
  gap: 8px;
}

.story-modal-top-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.6);
}

.story-modal-top-user {
  color: #fff;
  font-size: var(--fs-small);
  font-weight: 700;
}

.story-modal-media-wrap {
  width: 100%;
  aspect-ratio: 9 / 16;
  max-height: 78vh;
  background: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.story-modal-media {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.story-modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: none;
  flex-shrink: 0;
}

.story-modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: none;
  display: none;
  align-items: center;
  justify-content: center;
}

.story-modal-nav-prev {
  left: -52px;
}

.story-modal-nav-next {
  right: -52px;
}

.story-modal-footer {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-3);
  color: #fff;
  font-size: var(--fs-small);
}

.story-modal-footer-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.story-modal-footer-stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  opacity: 0.85;
  font-size: var(--fs-xs);
  font-weight: 700;
}

.story-modal-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--color-primary);
  color: var(--color-primary-fg);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: var(--fs-small);
}

@media (min-width: 768px) {
  .story-modal-nav {
    display: flex;
  }
}

/* Heart + Download in the player footer */
.story-modal-footer-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.story-modal-fav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  background: transparent;
  color: #fff;
  cursor: pointer;
}

.story-modal-fav:hover {
  border-color: #fff;
}

.story-modal-fav.is-saved {
  border-color: #ffe300;
  background: #ffe300;
  color: #111111;
}

.story-modal-fav.is-saved svg {
  fill: currentColor;
}

/* ---- src/site/styles/profile-mockup.css ---- */
.profile-mockup-card {
  width: 100%;
  max-width: 420px;
  padding: var(--space-6);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
}

.profile-mockup-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.profile-mockup-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #cfcbbf;
  box-shadow: 0 0 0 2px var(--color-surface), 0 0 0 4px var(--color-primary);
  flex-shrink: 0;
}

.profile-mockup-name {
  font-weight: 800;
  letter-spacing: -0.01em;
}

.profile-mockup-handle {
  font-size: var(--fs-xs);
  color: var(--color-muted);
}

.profile-mockup-tabs {
  display: flex;
  gap: var(--space-5);
  margin-top: var(--space-5);
  border-bottom: 1px solid var(--color-border);
}

.profile-mockup-tab {
  position: relative;
  padding-bottom: var(--space-2);
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--color-muted);
}

.profile-mockup-tab-active {
  color: var(--color-fg);
}

.profile-mockup-tab-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 4px;
  background: var(--color-primary);
  border-bottom: 1px solid var(--color-ink);
}

.profile-mockup-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.profile-mockup-thumb {
  position: relative;
  aspect-ratio: 9 / 16;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

/* Flat stand-in tones for Story photos. */
.profile-mockup-thumb-a { background: #d8d3c4; }
.profile-mockup-thumb-b { background: #c6cfcc; }
.profile-mockup-thumb-c { background: #ffe300; }
.profile-mockup-thumb-d { background: #b9b4a8; }
.profile-mockup-thumb-e { background: #e3ddd0; }
.profile-mockup-thumb-f { background: #3a3a36; }

.profile-mockup-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--color-ink);
  color: var(--color-ink-fg);
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.profile-mockup-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.profile-mockup-play svg {
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

/* ---- src/site/styles/story-viewer-mockup.css ---- */
.story-viewer-mockup {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  width: 100%;
  max-width: 420px;
  padding: var(--space-8) var(--space-4);
  background: #151515;
  border-radius: var(--radius-xl);
}

.story-viewer-mockup-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid #3a3a36;
  color: #f2f2ee;
  flex-shrink: 0;
}

.story-viewer-mockup-stage {
  position: relative;
  width: 100%;
  max-width: 240px;
  aspect-ratio: 9 / 16;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #cfcbbf;
}

.story-viewer-mockup-bars {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  z-index: 2;
  display: flex;
  gap: 4px;
}

.story-viewer-mockup-bar {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.45);
}

.story-viewer-mockup-bar-done {
  background: #fff;
}

.story-viewer-mockup-top {
  position: absolute;
  top: 22px;
  left: 10px;
  right: 10px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 7px;
  color: #fff;
}

.story-viewer-mockup-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ffe300;
  border: 1.5px solid #fff;
}

.story-viewer-mockup-user {
  flex: 1;
  font-size: 0.75rem;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.story-viewer-mockup-close {
  display: inline-flex;
}

/* A simple flat "photo": sun over a hill. */
.story-viewer-mockup-media {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #b8c6c4 0 62%, #8c9a7a 62% 100%);
}

.story-viewer-mockup-sun {
  position: absolute;
  top: 34%;
  right: 22%;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #ffe300;
}

.story-viewer-mockup-hill {
  position: absolute;
  left: -20%;
  right: -20%;
  bottom: 18%;
  height: 34%;
  border-radius: 50% 50% 0 0;
  background: #6f7d5f;
}

.story-viewer-mockup-foot {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.story-viewer-mockup-count {
  font-size: 0.6875rem;
  font-weight: 700;
  color: #fff;
}

.story-viewer-mockup-download {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: #ffe300;
  color: #111;
  font-size: 0.75rem;
  font-weight: 700;
}

/* ---- src/site/styles/what-is.css ---- */
.what-is-section {
  scroll-margin-top: 88px;
}

.what-is-grid {
  display: grid;
  gap: var(--space-12);
  align-items: center;
}

.what-is-text {
  max-width: 600px;
}

.what-is-text p {
  margin-top: var(--space-4);
  font-size: var(--fs-lead);
  line-height: var(--lh-normal);
  color: var(--color-muted);
}

.what-is-text h2 + p {
  margin-top: var(--space-6);
}

.what-is-visual {
  display: flex;
  justify-content: center;
}

@media (min-width: 960px) {
  .what-is-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-16);
  }

  .what-is-visual {
    justify-content: flex-end;
  }
}

/* ---- src/site/styles/how-it-works.css ---- */
.how-it-works-section {
  scroll-margin-top: 88px;
}

/* Steps, like tik.ninja: one bordered list, a row per step with a large
   faint number, a mono title and muted text. */
.how-it-works-steps {
  margin-top: var(--space-10);
  border: 1px solid var(--color-border);
  text-align: left;
}

.how-it-works-step {
  display: flex;
  gap: 2rem;
  padding: 2rem;
  border-bottom: 1px solid var(--color-border);
  background: var(--section-bg, var(--color-bg));
  transition: background-color var(--transition-fast);
}

.how-it-works-step:last-child {
  border-bottom: none;
}

.how-it-works-step:hover {
  background: var(--color-surface);
}

/* On a white section, hover to the page colour instead. */
.block-section--bg-white .how-it-works-step:hover {
  background: var(--color-bg);
}

.how-it-works-num {
  min-width: 3rem;
  padding-top: 0.2rem;
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  color: var(--color-border);
}

.how-it-works-title {
  margin-bottom: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.how-it-works-body {
  font-size: 0.9rem;
  line-height: 1.75;
  color: var(--color-muted);
}

.how-it-works-body strong {
  color: var(--color-fg);
}

.how-it-works-body code {
  padding: 0.1em 0.4em;
  background: var(--color-border);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

@media (max-width: 600px) {
  .how-it-works-step {
    flex-direction: column;
    gap: 0.75rem;
  }

  .how-it-works-num {
    font-size: 1rem;
  }
}

/* Cards layout: steps side by side, a square screenshot above each step.
   Stacks into one column on narrow screens. */
.how-it-works-steps--cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-6, 1.5rem);
  border: none;
}

.how-it-works-steps--cards .how-it-works-step {
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.25rem;
  border: 1px solid var(--color-border);
  border-radius: 16px;
}

.how-it-works-steps--cards .how-it-works-step:last-child {
  border-bottom: 1px solid var(--color-border);
}

.how-it-works-media {
  margin: 0 0 0.5rem;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface);
}

.how-it-works-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.how-it-works-steps--cards .how-it-works-num {
  min-width: 0;
  padding-top: 0;
  font-size: 1.25rem;
}

@media (max-width: 900px) {
  .how-it-works-steps--cards {
    grid-template-columns: minmax(0, 1fr);
    max-width: 480px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .how-it-works-step {
    transition: none;
  }
}

/* ---- src/site/styles/features.css ---- */
.features-section {
  scroll-margin-top: 88px;
}

.features-grid {
  display: grid;
  grid-template-columns: 1fr;
  column-gap: var(--space-10);
  margin-top: var(--space-12);
}

.features-item {
  padding-block: var(--space-6);
  border-top: 1px solid var(--color-border);
}

/* Small tile: yellow glyph on black — the yellow stays readable. */
.features-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: #111111;
  color: #ffe300;
  border: 1px solid var(--color-border);
}

.features-title {
  margin-top: var(--space-4);
  font-size: var(--fs-h3);
}

.features-body {
  margin-top: var(--space-2);
  color: var(--color-muted);
  max-width: 36ch;
}

@media (min-width: 640px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .features-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ---- src/site/styles/view-download.css ---- */
.view-download-section {
  scroll-margin-top: 88px;
}

.view-download-grid {
  display: grid;
  gap: var(--space-12);
  align-items: center;
}

.view-download-visual {
  display: flex;
  justify-content: center;
}

.view-download-text {
  max-width: 600px;
}

.view-download-intro {
  margin-top: var(--space-5);
  font-size: var(--fs-lead);
  line-height: var(--lh-normal);
  color: var(--color-muted);
}

.view-download-items {
  margin-top: var(--space-8);
}

.view-download-item {
  padding-block: var(--space-5);
  border-top: 1px solid var(--color-border);
}

.view-download-item h3 {
  font-size: var(--fs-h3);
}

.view-download-item p {
  margin-top: var(--space-1);
  color: var(--color-muted);
}

.view-download-cta {
  margin-top: var(--space-6);
}

/* Text first on phones; mockup moves to the left from tablet up. */
@media (max-width: 959px) {
  .view-download-visual {
    order: 2;
  }
}

@media (min-width: 960px) {
  .view-download-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-16);
  }

  .view-download-visual {
    justify-content: flex-start;
  }
}

/* ---- src/site/styles/public-content.css ---- */
.public-content-section {
  padding-block: 64px;
  background: #151515;
  color: #f5f5f2;
  scroll-margin-top: 88px;
}

@media (min-width: 768px) {
  .public-content-section {
    padding-block: 104px;
  }
}

.public-content-heading {
  font-size: var(--fs-h2);
}

.public-content-desc {
  margin-top: var(--space-5);
  max-width: 620px;
  font-size: var(--fs-lead);
  line-height: var(--lh-normal);
  color: #b4b4ae;
}

.public-content-items {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-8) var(--space-6);
  margin-top: var(--space-12);
}

.public-content-item {
  padding-top: var(--space-5);
  border-top: 1px solid #34342f;
}

.public-content-item svg {
  color: #ffe300;
}

.public-content-item h3 {
  margin-top: var(--space-4);
  font-size: 1.125rem;
}

.public-content-item p {
  margin-top: var(--space-2);
  font-size: var(--fs-small);
  color: #b4b4ae;
}

@media (min-width: 900px) {
  .public-content-items {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-10);
  }

  .public-content-item h3 {
    font-size: var(--fs-h3);
  }

  .public-content-item p {
    font-size: var(--fs-body);
  }
}

/* ---- src/site/styles/faq.css ---- */
/* FAQ rows are native <details>/<summary>: open/close needs no JavaScript. */
.faq-list {
  border-top: 1px solid var(--color-fg);
}

.faq-item {
  border-bottom: 1px solid var(--color-border);
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  min-height: 64px;
  padding: var(--space-5) 0;
  cursor: pointer;
  list-style: none;
  font-size: 1rem;
  font-weight: 700;
  line-height: var(--lh-snug);
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-question:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

@media (min-width: 768px) {
  .faq-question {
    font-size: 1.0625rem;
  }
}

/* + that turns into − */
.faq-icon {
  position: relative;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

.faq-icon::before,
.faq-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  background: var(--color-fg);
  transform: translate(-50%, -50%);
  transition: transform var(--transition-base), opacity var(--transition-base);
}

.faq-icon::before {
  width: 16px;
  height: 1.5px;
}

.faq-icon::after {
  width: 1.5px;
  height: 16px;
}

.faq-item[open] .faq-icon::after {
  transform: translate(-50%, -50%) rotate(90deg);
  opacity: 0;
}

.faq-answer {
  padding: 0 var(--space-10) var(--space-6) 0;
  color: var(--color-muted);
  line-height: var(--lh-normal);
}

/* Smooth open/close where the browser supports animating <details>. */
@supports (interpolate-size: allow-keywords) {
  .faq-list {
    interpolate-size: allow-keywords;
  }

  .faq-item::details-content {
    height: 0;
    overflow: clip;
    transition: height var(--transition-base), content-visibility var(--transition-base) allow-discrete;
  }

  .faq-item[open]::details-content {
    height: auto;
  }
}

/* ---- src/site/styles/latest-posts.css ---- */
/* "From the Blog" on the homepage: heading row + the shared blog cards (blog-list.css). */
/* White band; sections are told apart by background, not lines. */
.latest-posts-section {
  padding-block: 64px;
  background: var(--color-surface);
  scroll-margin-top: 88px;
}

@media (min-width: 768px) {
  .latest-posts-section {
    padding-block: 80px;
  }
}

.latest-posts-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: 2rem;
}

.latest-posts-all {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-muted);
  transition: color 0.2s;
}

.latest-posts-all:hover {
  color: var(--color-fg);
}

/* ---- src/site/styles/mini-search.css ---- */
/* Same shape as the hero search: one white box on desktop, stacked on phones. */
.mini-search-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.mini-search-field {
  display: flex;
  align-items: center;
  height: 56px;
  padding-inline: var(--space-4);
  background: var(--color-surface);
  border: 1px solid #111111;
  border-radius: var(--radius-md);
}

.mini-search-at {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--color-muted);
  padding-right: var(--space-2);
}

.mini-search-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: none;
  background: transparent;
  color: var(--color-fg);
  font-size: 1.0625rem;
  font-weight: 500;
}

.mini-search-input:focus,
.mini-search-input:focus-visible {
  outline: none;
}

.mini-search-input::placeholder {
  color: var(--color-muted);
  opacity: 1;
}

.mini-search-btn {
  height: 52px;
}

@media (min-width: 560px) {
  .mini-search-form {
    flex-direction: row;
    align-items: center;
    gap: 0;
    height: 60px;
    padding: 5px;
    background: var(--color-surface);
    border: 1px solid #111111;
    border-radius: var(--radius-md);
  }

  .mini-search-form:focus-within {
    box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.18);
  }

  .mini-search-field {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: none;
    padding-inline: var(--space-3);
  }

  .mini-search-btn {
    height: 100%;
    min-height: 0;
  }
}

/* ---- src/site/styles/final-cta.css ---- */
.final-cta-section {
  padding-block: 56px;
  background: #ffe300;
  color: #111111;
}

@media (min-width: 768px) {
  .final-cta-section {
    padding-block: 72px;
  }
}

.final-cta-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.final-cta-heading {
  font-size: var(--fs-h2);
}

.final-cta-desc {
  margin-top: var(--space-3);
  font-size: var(--fs-lead);
}

.final-cta-tool {
  width: 100%;
  max-width: 640px;
  margin-top: var(--space-8);
  text-align: left;
}

/* Other pages */

/* ---- src/site/styles/page-hero.css ---- */
.page-hero {
  padding-block: var(--space-12) var(--space-8);
  text-align: center;
}

@media (min-width: 768px) {
  .page-hero {
    padding-block: var(--space-20) var(--space-10);
  }
}

/* Same as the site's yellow tag (.block-tagline.mono-label). */
.page-hero-eyebrow {
  display: inline-block;
  margin-bottom: var(--space-4);
  padding: 4px 10px;
  border-radius: 4px;
  background: var(--color-primary);
  color: #111111;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.page-hero-heading {
  font-size: var(--fs-h1);
  max-width: 24ch;
  margin-inline: auto;
}

.page-hero-desc {
  margin-top: var(--space-4);
  color: var(--color-muted);
  font-size: var(--fs-lead);
  max-width: 72ch;
  margin-inline: auto;
}

/* ---- src/site/styles/builder.css ---- */
/* Page builder blocks (Admin → Pages → Edit page). */

/* ---- Section ---------------------------------------------------------- */

.block-section {
  --section-bg: var(--color-bg);
  scroll-margin-top: 88px;
}

.block-section--pad-none { padding-block: 0; }
.block-section--pad-small { padding-block: var(--space-10); }
.block-section--pad-medium { padding-block: 64px; }
.block-section--pad-large { padding-block: 88px; }

@media (min-width: 768px) {
  .block-section--pad-small { padding-block: var(--space-16); }
  .block-section--pad-medium { padding-block: 80px; }
  .block-section--pad-large { padding-block: 140px; }
}

/* Back-to-back sections on the same background read as one area: the
   second one drops its top padding so the gap isn't doubled (legal pages).
   A page header (title + intro) straight above a plain section works the same. */
.block-section--bg-page + .block-section--bg-page,
.block-section--bg-white + .block-section--bg-white,
.block-section--bg-subtle + .block-section--bg-subtle,
.block-section--bg-dark + .block-section--bg-dark,
.block-section--bg-yellow + .block-section--bg-yellow,
.page-hero + .block-section--bg-page {
  padding-top: 0;
}

.block-section--bg-white {
  --section-bg: var(--color-surface);
  background: var(--color-surface);
}

.block-section--bg-subtle {
  --section-bg: var(--color-bg-subtle);
  background: var(--color-bg-subtle);
}

/* Dark and yellow re-set the colour tokens, so every block inside adapts. */
.block-section--bg-dark {
  --section-bg: #151515;
  --color-fg: #f5f5f2;
  --color-muted: #b4b4ae;
  --color-border: #34342f;
  --color-surface: #1c1c1b;
  --color-bg-subtle: #232320;
  --color-ink: #f5f5f2;
  --color-ink-fg: #111111;
  background: #151515;
  color: var(--color-fg);
}

.block-section--bg-yellow {
  --section-bg: #ffe300;
  --color-fg: #111111;
  --color-muted: #3a3a2c;
  --color-border: rgba(17, 17, 17, 0.25);
  --color-ink: #111111;
  --color-ink-fg: #ffffff;
  background: #ffe300;
  color: #111111;
}

.block-section--center {
  text-align: center;
}

.block-section-full {
  width: 100%;
}

/* Space between stacked blocks inside a section or a column. */
.block-section > div > * + *,
.block-column > * + * {
  margin-top: var(--space-6);
}

.block-section > div > .block-heading + *,
.block-column > .block-heading + * {
  margin-top: var(--space-8);
}

.block-section > div > .block-heading + .how-it-works-steps {
  margin-top: var(--space-10);
}

/* ---- Columns ---------------------------------------------------------- */

.block-columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
}

.block-columns--gap-small { gap: var(--space-4); }
.block-columns--gap-large { gap: var(--space-12); }
.block-columns--align-center { align-items: center; }
.block-columns--align-end { align-items: end; }

.block-column {
  min-width: 0;
}

@media (max-width: 767px) {
  .block-columns--mobile-reverse > .block-column:first-child {
    order: 2;
  }
}

@media (min-width: 640px) {
  .block-columns--1-1-1-1 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 768px) {
  .block-columns--1-1 { grid-template-columns: 1fr 1fr; }
  .block-columns--1-2 { grid-template-columns: 1fr 2fr; }
  .block-columns--2-1 { grid-template-columns: 2fr 1fr; }
  .block-columns--3-2 { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
  .block-columns--2-3 { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
  .block-columns--1-1-1 { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1024px) {
  .block-columns--1-1-1-1 { grid-template-columns: repeat(4, 1fr); }
  .block-columns--gap-large { gap: var(--space-16); }
}

/* ---- Heading ---------------------------------------------------------- */

.block-heading--center { text-align: center; }
.block-heading--right { text-align: right; }

/* Tagline: small yellow label above a section heading */
/* The gap to the heading below is padding on the row; the label has no margin. */
.block-tagline-row { padding-bottom: 0; }
.block-tagline-row--left { text-align: left; }
.block-tagline-row--center { text-align: center; }
.block-tagline-row--right { text-align: right; }

.block-tagline {
  display: inline-block;
  margin: 0;
  padding: 4px 10px;
  border-radius: 4px;
  background: var(--color-primary);
  color: #111111;
  font-size: var(--fs-small);
  font-weight: 600;
  line-height: 1.4;
}

.block-tagline.mono-label {
  font-size: 0.75rem;
  font-weight: 500;
}

.block-tagline a {
  color: inherit;
}

.block-eyebrow {
  display: inline-block;
  margin-bottom: var(--space-4);
  padding: 3px 8px;
  border-radius: 4px;
  background: #ffe300;
  color: #111111;
}

.block-heading-title--display {
  font-size: var(--fs-display);
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.block-heading-title--large { font-size: var(--fs-h2); }
.block-heading-title--medium { font-size: 1.5rem; }
.block-heading-title--small { font-size: var(--fs-h3); }

.block-heading-desc {
  margin-top: var(--space-4);
  max-width: 640px;
  font-size: var(--fs-lead);
  line-height: var(--lh-normal);
  color: var(--color-muted);
}

.block-heading--center .block-heading-desc,
.block-section--center .block-heading-desc {
  margin-inline: auto;
}

/* ---- Text ------------------------------------------------------------- */

.block-text {
  max-width: 72ch;
  line-height: var(--lh-normal);
}

.block-section--center .block-text,
.block-text--center {
  margin-inline: auto;
  text-align: center;
}

.block-text--right { margin-left: auto; text-align: right; }
.block-text--lead { font-size: var(--fs-lead); }
.block-text--small { font-size: var(--fs-small); }
.block-text--muted { color: var(--color-muted); }

.block-text * + :is(p, ul, ol, blockquote, h2, h3, h4, figure, table) { margin-top: 1em; }
.block-text :is(h1, h2, h3, h4) { margin-top: 1.4em; }
.block-text > :first-child { margin-top: 0; }
.block-text :is(ul, ol) { padding-left: 1.4em; list-style: revert; }
.block-text li + li { margin-top: 0.35em; }
.block-text a { text-decoration: underline; text-underline-offset: 3px; }
.block-text blockquote {
  padding-left: var(--space-4);
  border-left: 3px solid #ffe300;
}
.block-text img { border-radius: var(--radius-md); }

/* ---- Image & video ---------------------------------------------------- */

.block-image,
.block-video {
  margin: 0;
}

.block-image img {
  width: 100%;
}

.block-image--large,
.block-video--large { max-width: 860px; }
.block-image--medium,
.block-video--medium { max-width: 560px; }
.block-image--small,
.block-video--small { max-width: 320px; }

.block-image--center,
.block-section--center .block-image,
.block-section--center .block-video { margin-inline: auto; }
.block-image--right { margin-left: auto; }

.block-image--ratio-16-9 img { aspect-ratio: 16 / 9; }
.block-image--ratio-4-3 img { aspect-ratio: 4 / 3; }
.block-image--ratio-1-1 img { aspect-ratio: 1 / 1; }
.block-image--ratio-3-4 img { aspect-ratio: 3 / 4; }
.block-image--ratio-9-16 img { aspect-ratio: 9 / 16; }
.block-image--cover img { object-fit: cover; }
.block-image--contain img { object-fit: contain; }

.block-image--rounded img,
.block-video video,
.block-video-frame { border-radius: var(--radius-xl); overflow: hidden; }
.block-image--border img { border: 1px solid var(--color-border); }

.block-image figcaption,
.block-video figcaption {
  margin-top: var(--space-2);
  font-size: var(--fs-small);
  color: var(--color-muted);
}

.block-video video { width: 100%; }

.block-video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #111111;
}

.block-video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---- Buttons ---------------------------------------------------------- */

.block-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.block-buttons--center,
.block-section--center .block-buttons { justify-content: center; }
.block-buttons--right { justify-content: flex-end; }

/* Sections below the hero are 960px wide (plus the side padding). */
.block-section > .container-site,
.latest-posts-section > .container-site {
  max-width: calc(var(--container-section) + 2 * var(--space-6));
}

/* ---- Cards ------------------------------------------------------------ */

.block-cards {
  display: grid;
  grid-template-columns: 1fr;
  column-gap: var(--space-10);
  text-align: left;
}

.block-cards--boxes { gap: var(--space-5); }

/* Grid: one bordered box split into cells by 1px lines (tik.ninja feature
   grid). Lines are drawn on the cells, so a short last row stays clean. */
.block-cards.block-cards--grid {
  gap: 0;
  border-top: 1px solid var(--color-border);
  border-left: 1px solid var(--color-border);
}

.block-cards--grid .block-card {
  padding: 2rem 1.75rem;
  border-right: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  /* White cells (#fff; the dark card colour in dark mode). */
  background: var(--color-surface);
  transition: background-color 0.2s;
}

.block-cards--grid .block-card:hover {
  background: var(--color-bg);
}

/* A linked cell is clickable edge to edge. */
.block-cards--grid .block-card:has(> .block-card-link) {
  padding: 0;
}

.block-cards--grid .block-card-link {
  height: 100%;
  padding: 2rem 1.75rem;
}

.block-cards--grid .block-card-title {
  margin-bottom: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.block-cards--grid .block-card-text {
  margin-top: 0;
  font-size: 0.875rem;
  line-height: 1.75;
}

.block-cards--grid .block-card-text strong {
  color: var(--color-fg);
}

.block-cards--grid.block-cards--icon-plain .block-card-icon {
  margin-bottom: 1rem;
}

@media (prefers-reduced-motion: reduce) {
  .block-cards--grid .block-card {
    transition: none;
  }
}
.block-cards--cols-4 { grid-template-columns: repeat(2, 1fr); column-gap: var(--space-6); }

@media (min-width: 640px) {
  .block-cards--cols-2,
  .block-cards--cols-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .block-cards--cols-3 { grid-template-columns: repeat(3, 1fr); }
  .block-cards--cols-4 { grid-template-columns: repeat(4, 1fr); column-gap: var(--space-10); }
}

.block-cards--lines .block-card {
  padding-block: var(--space-6);
  border-top: 1px solid var(--color-border);
}

.block-cards--boxes .block-card {
  padding: var(--space-6);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}

.block-card-link {
  display: block;
}

.block-card-link:hover .block-card-title {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.block-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-4);
}

.block-cards--icon-tile .block-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: #111111;
  color: #ffe300;
  border: 1px solid var(--color-border);
}

.block-cards--icon-soft .block-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--color-primary-wash);
  color: var(--color-fg);
}

.block-section--bg-dark .block-cards--icon-plain .block-card-icon { color: #ffe300; }

.block-card-title {
  font-size: var(--fs-h3);
}

.block-cards--boxes .block-card-title { font-size: 1.0625rem; }

.block-card-text {
  margin-top: var(--space-2);
  color: var(--color-muted);
}

.block-cards--cols-4 .block-card-text { font-size: var(--fs-small); }

@media (min-width: 1024px) {
  .block-cards--cols-4 .block-card-text { font-size: var(--fs-body); }
}

/* ---- Spacer, divider, mockups, placeholders --------------------------- */

.block-spacer--small { height: var(--space-6); }
.block-spacer--medium { height: var(--space-12); }
.block-spacer--large { height: var(--space-24); }
.block-spacer--none { height: 0; }

.block-divider {
  border: 0;
  border-top: 1px solid var(--color-border);
}

.block-mockup {
  display: flex;
  justify-content: center;
}

@media (min-width: 768px) {
  .block-mockup { justify-content: flex-start; }
  .block-mockup--center { justify-content: center; }
  .block-mockup--right { justify-content: flex-end; }
}

.block-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 120px;
  padding: var(--space-6);
  border: 1.5px dashed var(--color-border);
  border-radius: var(--radius-lg);
  color: var(--color-muted);
  text-align: center;
}

/* Full-width SnapStoryViewer blocks placed inside a section drop their own outer spacing. */
.block-section .hero-section,
.block-section .latest-posts-section {
  padding-block: 0;
  border-top: 0;
}

/* A yellow tagline would vanish on a yellow section: invert it there. */
.block-section--bg-yellow .block-tagline {
  background: #111111;
  color: #ffe300;
}

/* ---- src/site/styles/cms.css ---- */
.cms-section {
  padding-block: var(--space-10);
}

@media (min-width: 768px) {
  .cms-section {
    padding-block: var(--space-16);
  }
}

.cms-section-inner {
  max-width: var(--container-content);
  margin-inline: auto;
}

.cms-section-heading {
  margin-bottom: var(--space-5);
}

.cms-text-body {
  color: var(--color-fg);
  line-height: var(--lh-normal);
}

.cms-text-body :is(h2, h3) {
  margin-top: var(--space-6);
  margin-bottom: var(--space-2);
}

.cms-text-body p {
  margin-bottom: var(--space-4);
}

.cms-text-body ul,
.cms-text-body ol {
  margin-bottom: var(--space-4);
  padding-left: var(--space-5);
  list-style: revert;
}

.cms-grid {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: 1fr;
}

.cms-card {
  position: relative;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  background: var(--color-surface);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.cms-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.cms-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--color-primary-wash);
  margin-bottom: var(--space-3);
}

.cms-card h3 {
  font-size: 1.0625rem;
}

.cms-card p {
  margin-top: var(--space-2);
  color: var(--color-muted);
  font-size: var(--fs-small);
}

.cms-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--color-primary-fg);
  font-weight: 800;
  font-size: var(--fs-small);
  margin-bottom: var(--space-3);
}

.cms-cta {
  text-align: center;
}

.cms-cta p,
.cms-cta-text {
  margin-top: var(--space-3);
  color: var(--color-muted);
}

.cms-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  margin-top: var(--space-5);
  padding: var(--space-3) var(--space-6);
  background: var(--color-primary);
  color: var(--color-primary-fg);
  border-radius: var(--radius-md);
  font-weight: 700;
}

@media (min-width: 768px) {
  .cms-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.cms-grid,
.cms-faq {
  margin-top: var(--space-8);
}

/* ---- src/site/styles/blog-cover.css ---- */
/* Cover for posts without a featured image: flat brand colour + the title. */
.blog-cover {
  display: flex;
  align-items: flex-end;
  width: 100%;
  height: 100%;
  padding: 7%;
  overflow: hidden;
}

.blog-cover--yellow { background: #ffe300; color: #111111; }
.blog-cover--ink { background: #111111; color: #ffe300; }
.blog-cover--stone { background: #ecece7; color: #111111; }

.blog-cover-title {
  display: -webkit-box;
  overflow: hidden;
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}

.blog-cover--small .blog-cover-title { font-size: clamp(1rem, 2.4vw, 1.375rem); }
.blog-cover--large .blog-cover-title { font-size: clamp(1.5rem, 5vw, 2.75rem); }

/* ---- src/site/styles/blog-list.css ---- */
/* Blog listing + post cards, mirroring tik.ninja/blog. */
.blog-wrap {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 5rem 2rem;
}

.blog-header {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--color-border);
}

.blog-header h1 {
  margin-bottom: 0.4rem;
  font-family: var(--font-mono);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.04em;
}

.blog-header p {
  max-width: 600px;
  font-size: 0.9rem;
  color: var(--color-muted);
}

/* Separate bordered cards with a 16px gap. On /blog the first (newest)
   post is featured across the full row. */
.blog-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

/* /blog: two posts per row under the featured one. */
@media (min-width: 640px) {
  .blog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.latest-posts-section .blog-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.blog-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.75rem;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: inherit;
  text-decoration: none;
  transition: background-color 0.2s;
}

.blog-card:hover {
  /* #fafafa in light mode */
  background: var(--color-card-hover);
}

.blog-card-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--color-border);
}

.blog-card-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.blog-card:hover .blog-card-image img {
  transform: scale(1.03);
}

/* Date on the left, the primary category on the right. */
.blog-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.blog-card-tag {
  padding: 0.1rem 0.45rem;
  background: var(--color-border);
  color: var(--color-muted);
  font-size: 0.55rem;
}

.blog-card-title {
  font-family: var(--font-mono);
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: var(--color-fg);
}

.blog-card--featured {
  grid-column: 1 / -1;
  gap: 1rem;
  padding: 2.25rem;
}

.blog-card--featured .blog-card-title {
  max-width: 32ch;
  font-size: clamp(1.375rem, 1.1rem + 1vw, 1.75rem);
  line-height: 1.25;
  letter-spacing: -0.03em;
}

.blog-card--featured .blog-card-excerpt {
  max-width: 70ch;
  font-size: 1rem;
}

.blog-card-excerpt {
  flex: 1;
  font-size: 0.88rem;
  line-height: 1.75;
  color: var(--color-muted);
}

.blog-card-arrow {
  margin-top: 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-fg);
}

.blog-card:hover .blog-card-arrow {
  text-decoration: underline;
  text-decoration-color: var(--color-primary);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

@media (max-width: 600px) {
  .blog-wrap {
    padding: 3rem 1.25rem;
  }

  .blog-card--featured {
    padding: 1.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .blog-card,
  .blog-card-image img {
    transition: none;
  }
}

/* ---- src/site/styles/blog-post.css ---- */
/* Single post, mirroring tik.ninja's blog post page. */
.blog-post-wrap {
  width: 100%;
  max-width: 960px;
  margin: 2rem auto;
  padding: 2rem;
  /* #fff in light mode; follows the theme in dark mode. */
  background: var(--color-surface);
}

.page-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 2.5rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted);
  transition: color 0.2s;
}

.page-back:hover {
  color: var(--color-fg);
}

.blog-post-feature {
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-bottom: 2.5rem;
  overflow: hidden;
  background: var(--color-border);
}

.blog-post-feature img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.blog-post-wrap h1 {
  margin-bottom: 0.75rem;
  font-family: var(--font-mono);
  font-size: clamp(1.6rem, 4vw, 2.5rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.04em;
}

/* Date on the left, the primary category on the right. */
.blog-post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--color-border);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.blog-post-tag {
  padding: 0.15rem 0.5rem;
  background: var(--color-border);
  color: var(--color-muted);
  font-size: 0.55rem;
}

.blog-post-body {
  font-size: 0.975rem;
  line-height: 1.85;
  color: var(--color-muted);
}

.blog-post-body :is(h1, h2, h3, h4) {
  margin: 2rem 0 0.6rem;
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-fg);
}

.blog-post-body h1 { font-size: 1.4rem; }
.blog-post-body h2 { font-size: 1.1rem; letter-spacing: 0.02em; text-transform: uppercase; }
.blog-post-body h3 { font-size: 0.9rem; }
.blog-post-body h4 { font-size: 0.85rem; }

.blog-post-body p { margin-bottom: 1rem; }

.blog-post-body ul,
.blog-post-body ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
  list-style: revert;
}

.blog-post-body li { margin-bottom: 0.35rem; }

.blog-post-body a {
  color: var(--color-fg);
  border-bottom: 1px solid var(--color-border);
  transition: border-color 0.2s;
}

.blog-post-body a:hover { border-color: var(--color-fg); }

.blog-post-body strong { color: var(--color-fg); font-weight: 600; }
.blog-post-body em { font-style: italic; }

.blog-post-body blockquote {
  margin: 1.5rem 0;
  padding: 0.5rem 1.25rem;
  border-left: 3px solid var(--color-primary);
  font-style: italic;
  color: var(--color-muted);
}

.blog-post-body pre {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.blog-post-body img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.5rem 0;
}

.blog-post-body table {
  width: 100%;
  margin-bottom: 1rem;
  border-collapse: collapse;
}

.blog-post-body :is(th, td) {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-border);
  text-align: left;
}

@media (max-width: 600px) {
  .blog-post-wrap {
    padding: 2rem 1.25rem;
  }
}

/* "Share this article" row under the post body. */
.blog-share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}

.blog-share-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.blog-share-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.blog-share-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-fg);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}

.blog-share-link:hover,
.blog-share-link:focus-visible {
  border-color: var(--color-fg);
  background: var(--color-card-hover);
}

/* ---- src/site/styles/contact-form.css ---- */
.contact-form {
  max-width: 560px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  /* White card (#fff; the dark card colour in dark mode). */
  background: var(--color-surface);
  padding: 12px 24px 36px;
  border-radius: 12px;
}

.contact-form-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.contact-form-label {
  font-size: var(--fs-small);
  font-weight: 600;
}

.contact-form-input,
.contact-form-textarea {
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  color: var(--color-fg);
  font: inherit;
}

.contact-form-textarea {
  min-height: 140px;
  resize: vertical;
}

.contact-form-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.contact-form-success {
  background: color-mix(in srgb, var(--color-success) 12%, transparent);
  color: var(--color-success);
  border: 1px solid var(--color-success);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
  font-size: var(--fs-small);
}

.contact-form-error {
  background: color-mix(in srgb, var(--color-destructive) 12%, transparent);
  color: var(--color-destructive);
  border: 1px solid var(--color-destructive);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
  font-size: var(--fs-small);
}

.contact-page {
  padding-bottom: var(--space-16);
}

/* Type dropdown matches the text inputs. */
select.contact-form-input {
  appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
}

.contact-form-note {
  margin-top: var(--space-4);
  color: var(--color-muted);
  font-size: var(--fs-small);
}

.contact-form-note a {
  color: var(--color-fg);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---- src/site/styles/not-found.css ---- */
.not-found-wrap {
  padding-block: var(--space-20);
  text-align: center;
}

.not-found-art {
  position: relative;
  width: 140px;
  height: 190px;
  margin-inline: auto;
}

.not-found-frame {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-xl);
  background: linear-gradient(155deg, #fff2c4, #ffd84d 55%, #2f2c22);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
}

.not-found-code {
  font-size: 2.25rem;
  font-weight: 900;
  color: #161616;
  letter-spacing: -0.02em;
}

.not-found-badge {
  position: absolute;
  bottom: -10px;
  right: -10px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-fg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
}

.not-found-wrap h1 {
  margin-top: var(--space-8);
}

.not-found-desc {
  margin-top: var(--space-4);
  color: var(--color-muted);
  max-width: 48ch;
  margin-inline: auto;
}

.not-found-actions {
  margin-top: var(--space-8);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: center;
}

/* 404: a plain heading and one line with links, nothing else. */
.not-found-simple {
  padding-block: var(--space-20);
  text-align: center;
}

.not-found-simple h1 {
  margin-bottom: var(--space-3);
}

.not-found-simple p {
  color: var(--color-muted);
}

.not-found-simple a {
  color: var(--color-fg);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--color-primary-strong, var(--color-primary));
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
