/* AppsolutelyFun site styles. Light by default; dark follows the visitor's system setting. */

:root {
  color-scheme: light dark;
  --bg: #fff;
  --text: #1d1d1f;
  --muted: #515154;
  --nav-link: #1d1d1f;
  --header-bg: rgba(255, 255, 255, 0.72);
  --line: rgba(0, 0, 0, 0.08);
  --card: rgba(0, 0, 0, 0.035);
  --card-line: rgba(0, 0, 0, 0.1);
  --placeholder: #a1a1a6;
  --alt: #f5f5f7;
  --alt-card: #fff;
  --green: #1a7f37;
  --red: #c62828;
  --link: #0066cc;
  --link-hover: #004c99;

  /* ArguMap map colors: identical in both modes, like the app */
  --map-bubble: #fcf3e0;
  --map-group: #fdf8ec;
  --map-border: #8b5a2b;
  --map-text: #1d1d1f;
  --map-support: #3d8b46;
  --map-challenge: #d64541;
  --map-note: #ffef5c;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000;
    --text: #f5f5f7;
    --muted: #a1a1a6;
    --nav-link: #d2d2d7;
    --header-bg: rgba(22, 22, 23, 0.72);
    --line: rgba(255, 255, 255, 0.1);
    --card: rgba(255, 255, 255, 0.06);
    --card-line: rgba(255, 255, 255, 0.14);
    --placeholder: #6e6e73;
    --alt: #161617;
    --alt-card: rgba(255, 255, 255, 0.06);
    --green: #3fb950;
    --red: #ff6b6b;
    --link: #4da3ff;
    --link-hover: #8cc4ff;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); line-height: 1.5; -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; }
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }
a:focus-visible { outline: 3px solid var(--link); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3, p { margin: 0; }

.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 8px; }
.skip-link:focus { left: 8px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.section { padding: 112px 0; }
.section--alt { background: var(--alt); }
.center { text-align: center; }
.muted { color: var(--muted); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 10; container-type: inline-size; container-name: navc; background: var(--header-bg); -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%); border-bottom: 1px solid var(--line); }
.site-nav { max-width: 1120px; margin: 0 auto; padding: 14px 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 28px; }
.site-nav a { font-size: 14px; color: var(--nav-link); }
.site-nav a[aria-current="page"] { color: var(--text); font-weight: 600; }
.site-nav .brand { font-size: 18px; font-weight: 700; color: var(--text); margin-right: auto; }
@container navc (max-width: 600px) { .site-nav .brand { flex-basis: 100%; margin-right: 0; } }

/* Type */
.eyebrow { font-size: 15px; font-weight: 600; color: var(--green); margin-bottom: 10px; }
.display { font-size: clamp(44px, 8vw, 104px); line-height: 1.02; letter-spacing: -0.035em; font-weight: 800; max-width: 960px; margin: 0 auto; }
.lede { font-size: 18px; line-height: 1.5; color: var(--muted); max-width: 660px; margin: 28px auto 0; }
.h2 { font-size: clamp(32px, 4.5vw, 56px); letter-spacing: -0.03em; line-height: 1.07; }
.h2--sm { font-size: clamp(28px, 3.5vw, 44px); }
.h3 { font-size: clamp(24px, 3vw, 34px); letter-spacing: -0.02em; line-height: 1.15; margin-bottom: 14px; }
.body-lg { font-size: 18px; line-height: 1.6; color: var(--muted); }

/* Hero */
.hero { padding: 104px 0 72px; text-align: center; }
.app-badge { display: inline-flex; align-items: center; gap: 12px; margin-bottom: 28px; font-size: 24px; font-weight: 600; }
.app-icon { width: 56px; height: 56px; border-radius: 13px; }
.app-icon--lg { width: 96px; height: 96px; border-radius: 22px; margin: 0 auto 24px; }
.actions { margin-top: 40px; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 16px 28px; }
.btn { display: inline-block; background: var(--text); color: var(--bg); padding: 16px 30px; border-radius: 999px; font-size: 17px; font-weight: 600; }
.btn:hover { color: var(--bg); text-decoration: none; opacity: 0.85; }
.text-link { font-size: 17px; font-weight: 500; }

/* Placeholders for screenshots, icons and videos not yet supplied */
.placeholder { border: 2px dashed var(--placeholder); background: var(--card); color: var(--muted); display: flex; align-items: center; justify-content: center; text-align: center; padding: 16px; font-size: 14px; }

/* Cards */
.panel { background: var(--card); border: 1px solid var(--card-line); border-radius: 32px; padding: clamp(16px, 4vw, 32px); }
.cards { display: flex; flex-wrap: wrap; gap: 16px; }
.card { flex: 1 1 230px; display: block; padding: 28px; border-radius: 22px; background: var(--card); border: 1px solid var(--card-line); color: var(--text); }
.section--alt .card { background: var(--alt-card); }
a.card:hover { text-decoration: none; color: var(--text); border-color: var(--link); }
.card strong { display: block; font-size: 20px; margin-bottom: 8px; }
.card span { font-size: 15px; color: var(--muted); }

/* Feature rows (home) */
.feature-row { display: flex; flex-wrap: wrap; align-items: center; gap: 40px; padding: 48px 0; border-top: 1px solid var(--line); }
.feature-row--flip { flex-wrap: wrap-reverse; }
.feature-row > * { flex: 1 1 360px; }
.feature-visual { aspect-ratio: 16 / 10; border-radius: 24px; background: var(--card); border: 1px solid var(--card-line); display: flex; align-items: center; justify-content: center; }
.feature-visual.placeholder { border: 2px dashed var(--placeholder); }

/* Feature cards with video (ArguMap page) */
.video-cards { display: flex; flex-wrap: wrap; gap: 24px; }
.video-card { flex: 1 1 440px; border-radius: 24px; background: var(--card); border: 1px solid var(--card-line); overflow: hidden; }
.video-card .placeholder { aspect-ratio: 16 / 9; border-width: 0 0 2px; background: transparent; }
.video-card-body { padding: 24px 28px 28px; }
.video-card h3 { font-size: 22px; margin-bottom: 8px; }
.video-card p { font-size: 16px; line-height: 1.55; color: var(--muted); }
.video-card .text-link { display: inline-block; margin-top: 12px; font-size: 16px; }

/* Small feature grid (ArguMap page) */
.mini-grid { display: flex; flex-wrap: wrap; gap: 32px 40px; }
.mini-grid > div { flex: 1 1 280px; }
.mini-grid svg { color: var(--green); }
.mini-grid h3 { margin: 12px 0 6px; font-size: 19px; }
.mini-grid p { font-size: 16px; line-height: 1.55; color: var(--muted); }

/* Devices row (ArguMap page) */
.devices { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: center; gap: 28px; }
.device-phone { flex: 0 1 190px; aspect-ratio: 9 / 19.5; border-radius: 4px; }
.device-tablet { flex: 1 1 420px; max-width: 540px; aspect-ratio: 4 / 3; border-radius: 4px; }
.device-mac { flex: 1 1 300px; max-width: 380px; aspect-ratio: 16 / 10; border-radius: 4px; }

/* Research */
.two-col { display: flex; flex-wrap: wrap; gap: 48px; align-items: flex-start; }
.two-col > * { flex: 1 1 420px; }
.research { padding: 32px; border-radius: 24px; background: var(--alt-card); border: 1px solid var(--card-line); }
.research ol { margin: 16px 0 0; padding-left: 20px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.research li + li { margin-top: 8px; }

/* Also from */
.also { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; }
.also > div:nth-child(2) { flex: 1 1 360px; }
.also h2 { font-size: 22px; margin-bottom: 4px; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 40px 0 56px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 16px 32px; font-size: 13px; color: var(--muted); }
.site-footer .legal { flex-basis: 100%; line-height: 1.5; }

/* ---------- Argument map (The Missing Cookie) ---------- */
.map-label { text-align: center; font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 20px; }
.map-caption { margin: 20px auto 0; max-width: 720px; text-align: center; font-size: 15px; line-height: 1.5; color: var(--muted); }
.map-wrap { container-type: inline-size; container-name: mapwrap; }
.bubble { background: var(--map-bubble); border: 3px solid var(--map-border); color: var(--map-text); line-height: 1.4; }
.note-tab { position: absolute; background: var(--map-note); border: 2.5px solid #4a4a4a; border-radius: 5px; }

/* Wide layout: positioned like the app; everything scales with the map's width */
.map-wide { position: relative; container-type: inline-size; max-width: 940px; aspect-ratio: 1000 / 620; margin: 0 auto; }
.map-wide > svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.map-wide .bubble { position: absolute; border-radius: 1.9cqw; padding: 1.28cqw 1.49cqw; font-size: 1.6cqw; }
.map-wide .conclusion { left: 17%; top: 1.6%; width: 33%; padding: 1.28cqw 1.91cqw; font-size: 1.81cqw; font-weight: 600; }
.map-wide .obj1 { left: 56%; top: 11.3%; width: 42%; padding: 1.28cqw 1.91cqw; }
.map-wide .group { position: absolute; left: 2%; top: 36.3%; width: 52%; display: flex; align-items: flex-start; gap: 3cqw; padding: 2cqw 1.7cqw; background: var(--map-group); border: 3px solid var(--map-border); border-radius: 2.3cqw; }
.map-wide .group .bubble { position: static; }
.map-wide .claim-a { flex: 0 0 22cqw; }
.map-wide .claim-b { flex: 0 0 23cqw; }
.map-wide .support { left: 60%; top: 80.6%; width: 34%; padding: 1.28cqw 1.7cqw; }
.map-wide .obj2 { left: 4%; top: 75.8%; width: 24%; }
/* Comment tabs sit on the curve of the bubble's top-right corner */
.map-wide .group .bubble { position: relative; }
.map-wide .note-tab { top: -0.6cqw; right: -0.6cqw; width: 2.34cqw; height: 2.34cqw; border-radius: 0.5cqw; }

/* Narrow layout: the same argument, stacked top to bottom */
.map-narrow { display: none; flex-direction: column; max-width: 480px; margin: 0 auto; color: var(--map-text); }
.map-narrow .bubble { position: relative; border-radius: 16px; padding: 12px 14px; font-size: 15px; }
.map-narrow .conclusion { font-size: 17px; font-weight: 600; }
.map-narrow .group { display: flex; flex-direction: column; gap: 14px; padding: 16px 14px; background: var(--map-group); border: 3px solid var(--map-border); border-radius: 20px; }
.map-narrow .note-tab { top: -6px; right: -6px; width: 22px; height: 22px; }
.link-row { display: flex; align-items: stretch; min-height: 120px; }
.link-row .stem { position: relative; flex: 0 0 44px; }
.link-row .stem::before { content: ""; position: absolute; left: 20px; top: 4px; bottom: 0; border-left: 5px solid var(--map-support); }
.link-row .stem svg { position: absolute; left: 10.5px; top: 0; }
.link-row .challenge { flex: 1 1 auto; display: flex; align-items: center; padding: 16px 0; min-width: 0; }
.link-row .dash { position: relative; flex: 0 0 30px; height: 14px; margin-left: -18px; }
.link-row .dash svg { position: absolute; left: 0; top: 0; }
.link-row .dash::after { content: ""; position: absolute; left: 3px; right: 0; top: 5px; border-top: 4px dashed var(--map-challenge); }
.link-row .bubble { flex: 1 1 auto; min-width: 0; }

@container mapwrap (max-width: 820px) {
  .map-wide { display: none; }
  .map-narrow { display: flex; }
}

/* Visually hidden text for screen readers */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Shared pieces for inner pages ---------- */
.app-icon img, img.app-icon { border-radius: inherit; }
img.app-icon { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); }
.page-hero { padding: 88px 0 56px; }
.page-hero .display { font-size: clamp(40px, 6vw, 76px); margin: 0; max-width: none; }
.page-hero .lede { margin: 20px 0 0; }
.page-hero.center .lede { margin: 20px auto 0; }
.breadcrumb { font-size: 14px; margin-bottom: 18px; color: var(--muted); }

.shot { border-radius: 18px; border: 1px solid var(--card-line); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12); background: #000; width: 100%; height: auto; }
.shot--plain { background: transparent; }
.shot--phone { border-radius: 28px; }
.devices img { height: auto; min-width: 0; }
.devices .device-phone, .devices .device-tablet, .devices .device-mac { border: 1px solid var(--card-line); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.14); object-fit: cover; background: #000; }
.feature-visual img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.feature-visual:has(img) { overflow: hidden; border: 1px solid var(--card-line); }

video { display: block; max-width: 100%; height: auto; background: #000; }
.video-card video { width: 100%; aspect-ratio: 1380 / 1028; object-fit: contain; }
.video-frame { border-radius: 22px; overflow: hidden; border: 1px solid var(--card-line); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.14); background: #000; }
.video-frame video, .video-frame iframe { width: 100%; display: block; border: 0; }
.video-frame iframe { aspect-ratio: 16 / 9; height: auto; }

/* Long-form text */
.prose { max-width: 720px; }
.prose h2 { font-size: clamp(26px, 3vw, 34px); letter-spacing: -0.02em; line-height: 1.15; margin: 64px 0 14px; }
.prose h3 { font-size: 21px; line-height: 1.3; margin: 32px 0 8px; }
.prose p, .prose li { font-size: 18px; line-height: 1.65; color: var(--text); }
.prose p + p { margin-top: 16px; }
.prose ul, .prose ol { padding-left: 22px; margin: 12px 0 0; }
.prose li + li { margin-top: 8px; }
.prose figure { margin: 28px 0; }
.prose figure img { width: 100%; height: auto; border-radius: 16px; border: 1px solid var(--card-line); background: #fff; }
.prose figcaption { font-size: 14px; color: var(--muted); margin-top: 10px; line-height: 1.5; }
.prose .aside { margin-top: 16px; padding: 16px 20px; border-radius: 14px; background: var(--card); border: 1px solid var(--card-line); font-size: 16px; line-height: 1.55; color: var(--muted); }
.prose a { text-decoration: underline; text-underline-offset: 2px; }

/* Galleries */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 28px; }
.gallery--tall { grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.gallery--wide { grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.tile { display: flex; flex-direction: column; gap: 12px; color: var(--text); }
.tile:hover { text-decoration: none; color: var(--text); }
.tile .frame { aspect-ratio: 4 / 3; border-radius: 16px; overflow: hidden; background: #fff; border: 1px solid var(--card-line); display: flex; align-items: center; justify-content: center; }
.tile .frame img { width: 100%; height: 100%; object-fit: contain; }
.gallery--tall .tile .frame { aspect-ratio: 828 / 1792; border-radius: 22px; background: #000; }
.gallery--tall .tile .frame img { object-fit: cover; }
a.tile:hover .frame { border-color: var(--link); }
.tile h3 { font-size: 18px; line-height: 1.3; }
.tile p { font-size: 15px; line-height: 1.5; color: var(--muted); }
.tile .open { font-size: 15px; font-weight: 500; color: var(--link); }

/* User guide */
.toc { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
.toc a { padding: 8px 16px; border-radius: 999px; background: var(--card); border: 1px solid var(--card-line); font-size: 15px; color: var(--text); }
.toc a:hover { text-decoration: none; border-color: var(--link); }
.guide-section { padding: 72px 0 8px; border-top: 1px solid var(--line); scroll-margin-top: 80px; }
.guide-section:first-of-type { border-top: 0; }
.tips { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 20px; margin-top: 32px; }
.tip { display: flex; gap: 20px; align-items: center; padding: 20px; border-radius: 20px; background: var(--card); border: 1px solid var(--card-line); }
.tip .clip { flex: 0 0 auto; width: 160px; display: flex; justify-content: center; }
.tip video { border-radius: 10px; max-width: 160px; }
.tip p { font-size: 16px; line-height: 1.5; }
@media (max-width: 420px) { .tip { flex-direction: column; align-items: flex-start; } }

/* Press kit facts */
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 16px; }
.fact { padding: 22px 24px; border-radius: 18px; background: var(--card); border: 1px solid var(--card-line); }
.fact dt { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.fact dd { margin: 6px 0 0; font-size: 17px; line-height: 1.45; }
.store-links { display: flex; flex-wrap: wrap; gap: 12px 24px; margin-top: 12px; font-size: 16px; }
video[data-inview] { cursor: pointer; }
video[data-inview]:focus-visible { outline: 3px solid var(--link); outline-offset: 3px; }

/* A full screenshot inside a rounded box, shown whole rather than cropped */
.feature-visual--shot { aspect-ratio: auto; padding: clamp(14px, 3vw, 28px); }
.feature-visual--shot img { height: auto; object-fit: contain; border-radius: 6px; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18); }

/* App icon linked to the App Store */
.app-icon-link { display: inline-block; border-radius: 22%; line-height: 0; }
.app-icon-link--lg { display: block; width: fit-content; margin: 0 auto 24px; }
.app-icon-link--lg .app-icon--lg { margin: 0; }
.app-icon-link:hover .app-icon { opacity: 0.85; }
