/* Tiny Pip — site styles. Colors, fonts and shapes follow the app's theme
   (TinyPip app/src/theme/theme.ts, "meadow" palette). Mobile first. */

/* ─── Fonts (self-hosted copies of the Google Fonts files, OFL) ─────────── */

@font-face {
  font-family: "Fredoka";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../assets/fonts/fredoka-600-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
  src: url("../assets/fonts/nunito-latin.woff2") format("woff2");
}

/* ─── Tokens ──────────────────────────────────────────────────────────── */

:root {
  --paper: #fff9ec;
  --ink: #173b2e;
  --brand: #3fcb82;
  --brand-deep: #1f7a4d; /* brand green dark enough for text on paper */
  --pop: #ff7657;
  --sun: #ffc83d;

  --surface: #fffdf9;
  --spotlight: #e0f2db;
  --text-muted: #5d7467;
  --divider: #dcdcd0;

  --font-display: "Fredoka", "Nunito", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;

  --outline: 2px;
  --depth: 4px;
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --radius-pill: 999px;

  --gutter: 20px;
  --max: 1080px;

  color-scheme: light;
}

/* ─── Base ────────────────────────────────────────────────────────────── */

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.0625rem;
  line-height: 1.5;
  overflow-x: hidden;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0;
}

p {
  margin: 0;
}

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

a {
  color: var(--ink);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-color: var(--pop);
}

strong {
  font-weight: 800;
}

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

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

.skip-link {
  position: absolute;
  left: 12px;
  top: -100px;
  z-index: 10;
  padding: 10px 16px;
  background: var(--surface);
  border: var(--outline) solid var(--ink);
  border-radius: var(--radius-pill);
  font-weight: 800;
}

.skip-link:focus {
  top: 12px;
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section {
  padding: 56px 0;
}

.section-title {
  font-size: clamp(1.75rem, 6vw, 2.5rem);
  text-align: center;
  margin-bottom: 12px;
}

.section-lede {
  text-align: center;
  color: var(--text-muted);
  max-width: 34em;
  margin: 0 auto 32px;
}

/* ─── Buttons (pill, ink outline, 3D bottom edge, like the app) ───────── */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 12px 28px;
  border: var(--outline) solid var(--ink);
  border-radius: var(--radius-pill);
  background: var(--brand);
  color: var(--ink);
  box-shadow: 0 var(--depth) 0 var(--ink);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.button:hover {
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 calc(var(--depth) + 1px) 0 var(--ink);
}

.button:active {
  transform: translateY(var(--depth));
  box-shadow: 0 0 0 var(--ink);
}

.button:focus-visible {
  border-radius: var(--radius-pill);
  outline-offset: 4px;
}

.button[disabled] {
  cursor: progress;
  opacity: 0.7;
}

/* ─── Hero ────────────────────────────────────────────────────────────── */

.hero {
  padding: 20px 0 40px;
  text-align: center;
}

.hero-grid {
  display: grid;
  gap: 16px;
  align-items: center;
}

/* Pip, big and first. Cropped wide on phones so the headline and button
   still fit on the first screen. */
.hero-art {
  overflow: hidden;
  border: 3px solid var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: 0 6px 0 var(--ink);
  background: var(--spotlight);
  aspect-ratio: 2 / 1;
}

.hero-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 45%;
}

.hero h1 {
  font-size: clamp(1.85rem, 8.2vw, 3.4rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin-top: 4px;
}

.hero h1 span {
  display: block;
  color: var(--brand-deep);
}

.hero-sub {
  margin: 12px auto 20px;
  max-width: 30em;
  font-size: 1.05rem;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 20px;
}

.hero-hint {
  margin-top: 10px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.hero-fine {
  margin-top: 14px;
  font-size: 0.95rem;
}

.hero-switch {
  display: none;
  margin-top: 8px;
  font-size: 0.95rem;
}

/* On a phone, show only that phone's button, plus a link for the other one */
[data-os="ios"] .hero-cta--android,
[data-os="android"] .hero-cta--ios {
  display: none;
}

[data-os="ios"] .hero-switch--ios,
[data-os="android"] .hero-switch--android {
  display: block;
}

/* The phone-specific hint says what tapping does; on a computer, the two
   buttons sit side by side and the hints would be noise */
[data-os="other"] .hero-hint {
  display: none;
}

/* Android visitors inside TikTok's browser: Google sign-in can fail there */
.inapp-tip {
  display: none;
  margin: 0 0 12px;
  padding: 10px 14px;
  border: var(--outline) solid var(--ink);
  border-radius: var(--radius-sm);
  background: #fff1c9;
  font-size: 0.95rem;
}

[data-os="android"][data-inapp] .inapp-tip {
  display: block;
}

/* Phone-shaped frame for the showreel and screenshots */
.phone {
  position: relative;
  width: min(100%, 290px);
  margin: 0 auto;
  border: 3px solid var(--ink);
  border-radius: 36px;
  background: var(--ink);
  padding: 8px;
  box-shadow: 0 6px 0 var(--ink);
}

.phone-screen {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  background: var(--spotlight);
  aspect-ratio: 9 / 16;
}

.phone-screen video,
.phone-screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.showreel {
  position: relative;
  margin: 48px auto 8px;
}

.showreel::before {
  content: "";
  position: absolute;
  inset: -4% -10%;
  z-index: -1;
  background: radial-gradient(closest-side, var(--spotlight), transparent);
}

.showreel-caption {
  margin-top: 16px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.1rem;
}

.video-controls {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.video-controls[hidden] {
  display: none;
}

.video-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 6px 14px;
  border: var(--outline) solid var(--ink);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 3px 0 var(--ink);
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
}

.video-toggle svg {
  width: 14px;
  height: 14px;
}

/* Each button carries two icons: one for when it's on (playing, sound on), one for off */
.video-toggle[data-on="true"] .icon-off,
.video-toggle[data-on="false"] .icon-on {
  display: none;
}

.video-toggle[data-on="true"].video-sound {
  background: var(--sun);
}

/* ─── Features ────────────────────────────────────────────────────────── */

.cards {
  display: grid;
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.card {
  background: var(--surface);
  border: var(--outline) solid var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: 0 var(--depth) 0 var(--ink);
  overflow: hidden;
}

.card-art {
  aspect-ratio: 4 / 3;
  border-bottom: var(--outline) solid var(--ink);
  background: var(--spotlight);
}

.card-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-body {
  padding: 20px 22px 24px;
}

.card h3 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.card p {
  color: var(--ink);
}

.promise {
  margin: 32px auto 0;
  max-width: 34em;
  text-align: center;
  color: var(--text-muted);
}

/* ─── Screenshots ─────────────────────────────────────────────────────── */

.shots {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(72%, 260px);
  gap: 20px;
  margin: 0 calc(-1 * var(--gutter));
  padding: 8px var(--gutter) 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  list-style: none;
}

.shots li {
  scroll-snap-align: center;
}

.shots figure {
  margin: 0;
}

.shots .phone {
  width: 100%;
}

.shots .phone-screen {
  aspect-ratio: 600 / 1182;
}

.shots figcaption {
  margin-top: 16px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.1rem;
}

/* ─── Join the beta ───────────────────────────────────────────────────── */

.waitlist-card {
  max-width: 560px;
  margin: 0 auto;
  padding: 32px 22px;
  background: var(--spotlight);
  border: var(--outline) solid var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: 0 6px 0 var(--ink);
}

.waitlist-card .section-title,
.waitlist-card .section-lede {
  margin-bottom: 8px;
}

.store-line {
  text-align: center;
  font-weight: 800;
  margin-bottom: 24px;
}

.beta-rewards {
  margin-bottom: 24px;
  padding: 18px 20px;
  border: var(--outline) solid var(--ink);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.beta-rewards h3 {
  margin-bottom: 4px;
}

.beta-rewards ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.beta-rewards li + li {
  margin-top: 6px;
}

.beta-platforms {
  display: grid;
  gap: 16px;
  margin-bottom: 24px;
}

.beta-platform {
  padding: 18px 20px;
  border: var(--outline) solid var(--ink);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.beta-platform h3 {
  margin-bottom: 12px;
}

.beta-platform .button {
  width: 100%;
  margin: 10px 0 14px;
}

.beta-steps {
  margin: 0 0 12px;
  padding-left: 22px;
}

.beta-steps li + li {
  margin-top: 10px;
}

.beta-steps .button {
  margin-bottom: 4px;
}

.beta-rewards p {
  margin: 0;
}

.form-hint {
  margin: -4px 0 10px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.form-note {
  margin-top: 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ─── Footer ──────────────────────────────────────────────────────────── */

.site-footer {
  padding: 32px 0 48px;
  border-top: var(--outline) solid var(--divider);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 24px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

.social-title {
  margin-bottom: 10px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.2rem;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 18px;
  border: var(--outline) solid var(--ink);
  border-radius: var(--radius-pill);
  background: var(--surface);
  box-shadow: 0 3px 0 var(--ink);
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.social-links a span {
  padding: 0 8px;
  border-radius: var(--radius-pill);
  background: var(--sun);
}

.social-links a:hover {
  background: var(--spotlight);
}

.social-links a:focus-visible {
  border-radius: var(--radius-pill);
}

.footer-links a {
  color: var(--ink);
  font-weight: 800;
}

/* ─── Privacy page ────────────────────────────────────────────────────── */

.page-header {
  padding: 24px 0;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.4rem;
  text-decoration: none;
}

.brand-link img {
  width: 40px;
  height: 40px;
  border: var(--outline) solid var(--ink);
  border-radius: 11px;
}

.prose {
  max-width: 42rem;
  margin: 0 auto;
  padding-bottom: 56px;
}

.prose h1 {
  font-size: clamp(2.2rem, 9vw, 3rem);
  margin: 16px 0 8px;
}

.prose h2 {
  font-size: 1.5rem;
  margin: 40px 0 12px;
}

.prose p,
.prose ul {
  margin: 0 0 16px;
}

.prose ul {
  padding-left: 1.4em;
}

.prose li {
  margin-bottom: 6px;
}

.prose .effective {
  color: var(--text-muted);
  margin-bottom: 28px;
}

.prose .callout {
  padding: 20px 22px;
  margin: 32px 0 0;
  background: var(--spotlight);
  border: var(--outline) solid var(--ink);
  border-radius: var(--radius-lg);
}

.prose .callout h2 {
  margin-top: 0;
}

/* ─── How it works ────────────────────────────────────────────────────── */

.section--tight {
  padding-top: 24px;
}

.steps {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.step {
  position: relative;
  padding: 20px 22px 22px 76px;
  background: var(--surface);
  border: var(--outline) solid var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: 0 var(--depth) 0 var(--ink);
  counter-increment: step;
}

.step::before {
  content: counter(step);
  position: absolute;
  left: 20px;
  top: 18px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: var(--outline) solid var(--ink);
  border-radius: 50%;
  background: var(--brand);
  font-family: var(--font-display);
  font-size: 1.25rem;
}

.step:nth-child(2)::before { background: var(--sun); }
.step:nth-child(3)::before { background: var(--pop); }
.step:nth-child(4)::before { background: var(--spotlight); }

.step h3 {
  font-size: 1.3rem;
  margin-bottom: 6px;
}

/* ─── FAQ ─────────────────────────────────────────────────────────────── */

.faq {
  display: grid;
  gap: 12px;
  max-width: 720px;
  margin: 0 auto;
}

.faq-item {
  background: var(--surface);
  border: var(--outline) solid var(--ink);
  border-radius: var(--radius-md);
  box-shadow: 0 3px 0 var(--ink);
}

.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  padding: 14px 20px;
  font-family: var(--font-display);
  font-size: 1.15rem;
  cursor: pointer;
  list-style: none;
}

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

.faq-item summary::after {
  content: "+";
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: var(--outline) solid var(--ink);
  border-radius: 50%;
  background: var(--spotlight);
  font-size: 1.1rem;
  line-height: 1;
}

.faq-item[open] summary::after {
  content: "−";
  background: var(--sun);
}

.faq-item summary:focus-visible {
  border-radius: var(--radius-md);
  outline-offset: 2px;
}

.faq-item p {
  padding: 0 20px 18px;
}

/* ─── Larger screens ──────────────────────────────────────────────────── */

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

  .section {
    padding: 80px 0;
  }

  .waitlist-card {
    padding: 40px 40px;
  }
}

@media (min-width: 900px) {
  .hero {
    padding: 72px 0 48px;
    text-align: left;
  }

  .hero-grid {
    grid-template-columns: 1.1fr 0.9fr;
    column-gap: 56px;
    grid-template-areas: "copy art";
    align-content: center;
    row-gap: 20px;
  }

  .hero-copy {
    grid-area: copy;
    align-self: start;
  }

  .hero-art {
    grid-area: art;
    aspect-ratio: 4 / 3;
  }

  .hero-sub {
    margin-left: 0;
  }

  .hero-ctas {
    justify-content: flex-start;
  }

  .phone {
    width: 300px;
  }

  .cards {
    grid-template-columns: repeat(3, 1fr);
  }

  .steps {
    grid-template-columns: repeat(4, 1fr);
  }

  .step {
    padding: 72px 20px 22px;
  }

  .shots {
    grid-auto-flow: row;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-columns: auto;
    margin: 0;
    padding: 8px 0 16px;
    overflow: visible;
  }
}

/* ─── Reduced motion ──────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* The skip link focuses the waitlist section; no ring around the whole section */
#waitlist:focus {
  outline: none;
}

/* ─── Site header and the Features menu (partials/header.html) ───────────
   The menu is a <details>, so it opens without JavaScript; js/main.js only
   closes it on Escape, an outside tap or a link tap. */

.site-header {
  position: relative;
  z-index: 20;
  padding: 14px 0;
}

.site-header-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-menu > summary,
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  list-style: none;
}

.nav-menu > summary::-webkit-details-marker {
  display: none;
}

.nav-menu > summary::after {
  content: "";
  width: 8px;
  height: 8px;
  margin-top: -4px;
  border-right: 2.5px solid currentColor;
  border-bottom: 2.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}

.nav-menu[open] > summary {
  background: var(--spotlight);
}

.nav-menu[open] > summary::after {
  margin-top: 4px;
  transform: rotate(-135deg);
}

.nav-menu > summary:hover,
.nav-link:hover {
  background: var(--spotlight);
}

.nav-menu > summary:focus-visible {
  border-radius: var(--radius-pill);
}

.button--small {
  min-height: 44px;
  padding: 8px 18px;
  font-size: 1rem;
  box-shadow: 0 3px 0 var(--ink);
}

/* On phones the panel opens in the page flow, under the bar */
.mega {
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  top: calc(100% - 4px);
  max-height: calc(100vh - 90px);
  overflow-y: auto;
  padding: 20px;
  background: var(--surface);
  border: var(--outline) solid var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: 0 6px 0 var(--ink);
}

.mega-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 20px 24px;
}

.mega-group h2 {
  margin-bottom: 8px;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-deep);
}

.mega ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.mega-group a {
  display: block;
  padding: 5px 0;
  font-weight: 800;
  text-decoration: none;
}

.mega-group a span {
  display: block;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.3;
}

.mega-group a:hover {
  text-decoration: underline;
  text-decoration-color: var(--pop);
}

.mega-group a:hover span {
  text-decoration: none;
}

.mega-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: var(--outline) solid var(--divider);
}

.mega-foot a {
  padding: 6px 14px;
  border: var(--outline) solid var(--ink);
  border-radius: var(--radius-pill);
  background: var(--spotlight);
  font-size: 0.95rem;
  font-weight: 800;
  text-decoration: none;
}

.mega-foot a:first-child {
  background: var(--sun);
}

.mega-foot a:hover {
  background: var(--surface);
}

[aria-current="page"] {
  text-decoration: underline;
  text-decoration-color: var(--pop);
}

.brand-link[aria-current="page"] {
  text-decoration: none;
}

.site-header .brand-link,
.site-nav > a,
.nav-menu > summary {
  white-space: nowrap;
}

/* Phones: the icon alone stands for Tiny Pip, so Features and the beta button fit on one line */
@media (max-width: 459px) {
  .site-header .brand-link span {
    display: none;
  }

  .site-nav {
    gap: 4px;
  }

  .nav-menu > summary {
    padding: 8px 10px;
  }
}

/* ─── Content pages: features and the topic pages ─────────────────────── */

.breadcrumbs {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.breadcrumbs li + li::before {
  content: "›";
  margin-right: 4px;
}

.breadcrumbs a {
  color: var(--text-muted);
}

.page-hero {
  padding: 24px 0 40px;
}

.page-hero-grid {
  display: grid;
  gap: 28px;
  align-items: center;
}

.eyebrow {
  margin-bottom: 10px;
  color: var(--brand-deep);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.page-hero h1 {
  font-size: clamp(2rem, 7.5vw, 3.2rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.page-hero .lede {
  margin-top: 14px;
  max-width: 34em;
  font-size: 1.12rem;
}

.answer {
  margin-top: 18px;
  padding: 16px 18px;
  max-width: 36em;
  background: var(--spotlight);
  border: var(--outline) solid var(--ink);
  border-radius: var(--radius-md);
}

.page-hero .hero-ctas {
  justify-content: flex-start;
  margin-top: 22px;
}

.page-hero .phone {
  width: min(78%, 280px);
}

.page-hero .phone-screen,
.feature .phone-screen,
.shot-pair .phone-screen {
  aspect-ratio: 600 / 1182;
}

.content-section {
  padding: 40px 0;
}

.content-section + .content-section {
  padding-top: 8px;
}

.content-section > .wrap > h2,
.section-head h2 {
  font-size: clamp(1.6rem, 5.5vw, 2.2rem);
  margin-bottom: 10px;
}

.section-head {
  max-width: 40rem;
  margin-bottom: 28px;
}

.section-head p {
  color: var(--text-muted);
}

.text {
  max-width: 40rem;
}

.text p,
.text ul,
.text ol {
  margin: 0 0 16px;
}

.text ul,
.text ol {
  padding-left: 1.3em;
}

.text li + li {
  margin-top: 6px;
}

.text h3 {
  font-size: 1.3rem;
  margin: 28px 0 8px;
}

/* A feature: a phone screenshot beside its explanation */
.feature {
  display: grid;
  gap: 24px;
  align-items: center;
  padding: 28px 0;
  scroll-margin-top: 16px;
}

.feature + .feature {
  border-top: var(--outline) dashed var(--divider);
}

.feature figure {
  margin: 0;
}

.feature figcaption,
.shot-pair figcaption {
  margin-top: 12px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.feature h3 {
  font-size: 1.55rem;
  margin-bottom: 10px;
}

.feature .text p:last-child {
  margin-bottom: 0;
}

.feature-list {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mini {
  padding: 18px 20px;
  background: var(--surface);
  border: var(--outline) solid var(--ink);
  border-radius: var(--radius-md);
  box-shadow: 0 3px 0 var(--ink);
  scroll-margin-top: 16px;
}

.mini h3 {
  font-size: 1.2rem;
  margin-bottom: 6px;
}

.group-title {
  display: inline-block;
  margin-bottom: 6px;
  padding: 4px 14px;
  border: var(--outline) solid var(--ink);
  border-radius: var(--radius-pill);
  background: var(--sun);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.shot-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 8px 0 24px;
  padding: 0;
  list-style: none;
}

.shot-pair figure {
  margin: 0;
}

.shot-pair .phone {
  width: 100%;
  border-radius: 28px;
  padding: 6px;
}

.shot-pair .phone-screen {
  border-radius: 22px;
}

/* The loop: task → start → adventure time → Pip explores → finds */
.loop {
  display: grid;
  gap: 10px;
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
  counter-reset: loop;
}

.loop li {
  position: relative;
  padding: 12px 16px 12px 56px;
  background: var(--surface);
  border: var(--outline) solid var(--ink);
  border-radius: var(--radius-md);
  counter-increment: loop;
}

.loop li::before {
  content: counter(loop);
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: var(--outline) solid var(--ink);
  border-radius: 50%;
  background: var(--brand);
  font-family: var(--font-display);
}

.compare {
  display: grid;
  gap: 16px;
}

.compare-col {
  padding: 20px 22px;
  background: var(--surface);
  border: var(--outline) solid var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: 0 var(--depth) 0 var(--ink);
}

.compare-col h3 {
  font-size: 1.35rem;
  margin-bottom: 4px;
}

.compare-col > p {
  color: var(--text-muted);
  margin-bottom: 10px;
}

.compare-col ul {
  margin: 0;
  padding-left: 1.2em;
}

.compare-col li + li {
  margin-top: 6px;
}

.compare-col--plus {
  background: var(--spotlight);
}

.note {
  max-width: 40rem;
  padding: 16px 18px;
  border: var(--outline) solid var(--ink);
  border-left-width: 8px;
  border-radius: var(--radius-md);
  background: #fff1c9;
}

.note p + p {
  margin-top: 8px;
}

/* Links to the other pages */
.related {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.related a {
  display: block;
  height: 100%;
  padding: 18px 20px;
  background: var(--surface);
  border: var(--outline) solid var(--ink);
  border-radius: var(--radius-md);
  box-shadow: 0 3px 0 var(--ink);
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.related a:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 0 var(--ink);
}

.related strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.related span {
  color: var(--text-muted);
}

.content-section .faq {
  margin: 0;
}

/* The beta card at the end of each page (partials/cta.html) */
.cta-card {
  max-width: 640px;
  margin: 0 auto;
  padding: 28px 22px;
  text-align: center;
  background: var(--spotlight);
  border: var(--outline) solid var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: 0 6px 0 var(--ink);
}

.cta-card h2 {
  font-size: clamp(1.6rem, 5.5vw, 2.1rem);
  margin-bottom: 8px;
}

.cta-card .hero-ctas {
  margin: 20px 0 12px;
}

.cta-card .fine {
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* Footer page links (partials/footer.html) */
.footer-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 20px;
  max-width: 820px;
  margin: 0 auto 32px;
  text-align: left;
}

.footer-nav h2 {
  margin-bottom: 8px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.footer-nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-nav li + li {
  margin-top: 6px;
}

.footer-nav a {
  color: var(--text-muted);
  font-weight: 800;
  text-decoration: none;
}

.footer-nav a:hover {
  color: var(--ink);
  text-decoration: underline;
}

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

  .compare {
    grid-template-columns: 1fr 1fr;
  }

  .feature-list {
    grid-template-columns: 1fr 1fr;
  }

  .shot-pair {
    max-width: 520px;
  }

  .cta-card {
    padding: 36px 40px;
  }
}

@media (min-width: 900px) {
  .site-header {
    padding: 20px 0 0;
  }

  .mega {
    left: auto;
    right: var(--gutter);
    width: min(940px, calc(100vw - 2 * var(--gutter)));
    padding: 28px;
  }

  .mega-groups {
    grid-template-columns: repeat(4, 1fr);
  }

  .page-hero {
    padding: 48px 0 56px;
  }

  .page-hero-grid {
    grid-template-columns: 1.3fr 0.7fr;
    column-gap: 56px;
  }

  .feature {
    grid-template-columns: 300px 1fr;
    column-gap: 56px;
    padding: 40px 0;
  }

  .feature--flip {
    grid-template-columns: 1fr 300px;
  }

  .feature--flip figure {
    order: 2;
  }

  .related {
    grid-template-columns: repeat(3, 1fr);
  }

  .content-section {
    padding: 56px 0;
  }
}

.after-compare {
  margin-top: 20px;
}

/* ─── Blog: the index and articles ────────────────────────────────────── */

.article {
  max-width: 44rem;
  margin: 0 auto;
  padding: 16px 0 24px;
}

.article-header h1 {
  margin: 12px 0 14px;
  font-size: clamp(2rem, 7.5vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.article-header .lede {
  font-size: 1.15rem;
}

.byline {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 14px;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.article h2 {
  margin: 44px 0 12px;
  font-size: clamp(1.5rem, 5vw, 1.95rem);
  scroll-margin-top: 16px;
}

.article h3 {
  margin: 28px 0 8px;
  font-size: 1.25rem;
}

.article p,
.article ul,
.article ol {
  margin: 0 0 16px;
}

.article ul,
.article ol {
  padding-left: 1.35em;
}

.article li + li {
  margin-top: 8px;
}

.article .answer {
  max-width: none;
  margin: 24px 0;
  font-size: 1.08rem;
}

.takeaways,
.toc {
  margin: 24px 0;
  padding: 18px 22px;
  background: var(--surface);
  border: var(--outline) solid var(--ink);
  border-radius: var(--radius-md);
  box-shadow: 0 3px 0 var(--ink);
}

.takeaways h2,
.toc h2 {
  margin: 0 0 10px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-deep);
}

.takeaways ul,
.toc ol {
  margin: 0;
}

.toc a {
  font-weight: 800;
}

.article figure {
  margin: 28px 0;
}

.article figure .phone {
  width: min(70%, 260px);
}

.article figure .phone-screen {
  aspect-ratio: 600 / 1182;
}

.article figcaption {
  margin-top: 12px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.table-wrap {
  margin: 20px 0 24px;
  overflow-x: auto;
  border: var(--outline) solid var(--ink);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.table-wrap table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 0.97rem;
}

.table-wrap caption {
  padding: 12px 16px 0;
  text-align: left;
  font-weight: 800;
}

.table-wrap th,
.table-wrap td {
  padding: 10px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--divider);
}

.table-wrap thead th {
  background: var(--spotlight);
  font-family: var(--font-display);
  font-weight: 600;
}

.table-wrap tr:last-child td {
  border-bottom: 0;
}

.tip-list > li {
  padding-left: 4px;
}

.tip-list > li > strong:first-child {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.12rem;
}

.sources {
  font-size: 0.92rem;
  color: var(--text-muted);
}

.sources li + li {
  margin-top: 6px;
}

.post-list {
  display: grid;
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.post-card a {
  display: block;
  padding: 22px 24px;
  background: var(--surface);
  border: var(--outline) solid var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: 0 var(--depth) 0 var(--ink);
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.post-card a:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--ink);
}

.post-card h2 {
  margin: 6px 0 8px;
  font-size: 1.5rem;
}

.post-card p {
  color: var(--text-muted);
}

.post-card time {
  color: var(--brand-deep);
  font-size: 0.88rem;
  font-weight: 800;
}

.article .breadcrumbs {
  margin: 4px 0 0;
  padding-left: 0;
}

.article .breadcrumbs li + li {
  margin-top: 0;
}

/* Comparison tables: on phones each row becomes a small card, so no column hides off-screen */
@media (max-width: 599px) {
  .table-wrap--stack table {
    min-width: 0;
  }

  .table-wrap--stack thead {
    display: none;
  }

  .table-wrap--stack tr,
  .table-wrap--stack th,
  .table-wrap--stack td {
    display: block;
  }

  .table-wrap--stack tbody tr {
    padding: 12px 16px;
    border-bottom: 1px solid var(--divider);
  }

  .table-wrap--stack tbody tr:last-child {
    border-bottom: 0;
  }

  .table-wrap--stack th[scope="row"],
  .table-wrap--stack td {
    padding: 2px 0;
    border: 0;
  }

  .table-wrap--stack th[scope="row"] {
    margin-bottom: 4px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.05rem;
  }

  .table-wrap--stack td::before {
    content: attr(data-label) ": ";
    font-weight: 800;
  }
}

.article h3[id],
.text h2[id],
.text h3[id],
.mini h3[id],
.section-head h2[id] {
  scroll-margin-top: 16px;
}

/* Features hub: one card per group, leading to its page */
.card-art--shot {
  overflow: hidden;
}

.card-art--shot picture {
  display: block;
  height: 100%;
}

.card-art--shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-art--shot img.crop-15 { object-position: 50% 15%; }
.card-art--shot img.crop-20 { object-position: 50% 20%; }
.card-art--shot img.crop-60 { object-position: 50% 60%; }

.cards--four .card {
  display: flex;
  flex-direction: column;
  scroll-margin-top: 16px;
}

.cards--four .card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.cards--four .group-title {
  align-self: flex-start;
  margin-bottom: 10px;
}

.card-points {
  margin: 4px 0 18px;
  padding-left: 1.2em;
}

.card-points li + li {
  margin-top: 6px;
}

.card-link {
  margin-top: auto;
  align-self: flex-start;
  padding: 8px 18px;
  border: var(--outline) solid var(--ink);
  border-radius: var(--radius-pill);
  background: var(--brand);
  box-shadow: 0 3px 0 var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.card-link::after {
  content: " →";
}

.card-link:hover {
  background: var(--spotlight);
}

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

/* Menu column headings open the group's page */
.mega-group h2 a {
  display: inline;
  padding: 0;
  color: var(--brand-deep);
  font-weight: 800;
  text-decoration: none;
}

.mega-group h2 a::after {
  content: "\00a0→";
}

/* Headings line up across columns, even when one wraps */
@media (min-width: 900px) {
  .mega-group h2 {
    min-height: 2.6em;
  }
}

.mega-group h2 a:hover {
  text-decoration: underline;
  text-decoration-color: var(--pop);
}

.cta-card .hero-switch {
  margin: 0 0 10px;
}
