/* Dilo — shared styles for dilo.cloudytuesdays.com
   Tokens, base, shared chrome (header/footer), legal + support pages, homepage.
   No web fonts: the rounded display face is the system's (SF Pro Rounded on Apple devices). */

/* ---------- Tokens ---------- */
:root {
  --font-display: ui-rounded, "SF Pro Rounded", "Nunito", "Varela Round", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-text: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --bg: #f5f8f7;           /* sea glass */
  --bg-raised: #ffffff;
  --surface: #ffffff;
  --surface-2: #e8f0ee;
  --line: rgba(14, 28, 29, 0.10);
  --line-strong: rgba(14, 28, 29, 0.18);
  --text: #0e1c1d;         /* ink */
  --muted: #3f5557;
  --faint: #5b6f71;
  --accent: #0a7a74;       /* lagoon */
  --accent-ink: #ffffff;   /* text on accent */
  --accent-soft: rgba(10, 122, 116, 0.10);
  --mango: #ffae34;
  --mango-ink: #3a2400;    /* text on mango */
  --mango-soft: rgba(255, 174, 52, 0.18);
  --nav-bg: rgba(245, 248, 247, 0.82);
  --shadow: 0 24px 48px -28px rgba(10, 60, 58, 0.35);
  --radius: 24px;
  --gutter: 16px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1516;
    --bg-raised: #112022;
    --surface: #132527;
    --surface-2: #1a3133;
    --line: rgba(220, 240, 238, 0.10);
    --line-strong: rgba(220, 240, 238, 0.18);
    --text: #eaf3f2;
    --muted: #a9bfbd;
    --faint: #8ea5a3;
    --accent: #27b3a8;
    --accent-ink: #04201e;
    --accent-soft: rgba(39, 179, 168, 0.14);
    --mango-soft: rgba(255, 174, 52, 0.14);
    --nav-bg: rgba(11, 21, 22, 0.80);
    --shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.8);
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.6 var(--font-text);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; text-wrap: balance; }
a { color: var(--accent); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--accent); color: var(--accent-ink); }
.skip { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: 12px; font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.container { width: min(100% - 2 * var(--gutter), 1120px); margin-inline: auto; }
.wrap { width: min(100% - 2 * var(--gutter), 720px); margin-inline: auto; }
@media (min-width: 768px) { :root { --gutter: 40px; } }

/* ---------- Header ---------- */
header.site {
  position: sticky; top: 0; z-index: 50;
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  backdrop-filter: saturate(160%) blur(16px);
  border-bottom: 1px solid var(--line);
}
header.site .bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font: 800 21px/1 var(--font-display); letter-spacing: -0.01em; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
nav.site { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; justify-content: flex-end; }
nav.site a { color: var(--muted); text-decoration: none; font-size: 15px; font-weight: 600; padding: 8px 9px; border-radius: 10px; }
nav.site a:hover { color: var(--text); background: var(--surface-2); }
nav.site a[aria-current="page"] { color: var(--text); }
nav.site .lang { border: 1px solid var(--line-strong); padding: 6px 10px; margin-left: 4px; font-size: 13px; letter-spacing: 0.04em; }
@media (max-width: 479px) { nav.site .hide-sm { display: none; } }

/* ---------- Footer ---------- */
footer.site { border-top: 1px solid var(--line); padding: 36px 0 44px; color: var(--faint); font-size: 14px; }
footer.site .foot { display: grid; gap: 16px; }
footer.site .foot-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
footer.site .foot-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; }
footer.site a { color: var(--muted); text-decoration: none; }
footer.site a:hover { color: var(--text); text-decoration: underline; }
footer.site p { margin: 0; max-width: 72ch; }
footer.site .brand { font-size: 18px; }
footer.site .brand img { width: 26px; height: 26px; border-radius: 7px; }

/* ---------- Legal / support ---------- */
main.doc { padding: 48px 0 72px; }
h1.page { font-weight: 800; font-size: clamp(32px, 6vw, 48px); letter-spacing: -0.02em; margin: 0 0 8px; }
.meta { color: var(--muted); font-size: 15px; margin: 0 0 28px; }
main.doc h2 { font-weight: 750; font-size: 22px; margin: 40px 0 10px; }
main.doc h3 { font-size: 18px; margin: 24px 0 6px; }
main.doc ul { padding-left: 22px; }
main.doc li { margin: 6px 0; }
.callout { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--mango); border-radius: 16px; padding: 16px 18px; margin: 20px 0; }
.callout strong:first-child { display: block; margin-bottom: 4px; font-family: var(--font-display); }
.table-wrap { overflow-x: auto; margin: 16px 0; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: 15px; }
th, td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: 0; }
th { color: var(--muted); font-weight: 650; background: var(--surface-2); }
details { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 18px; margin: 10px 0; }
summary { cursor: pointer; font-weight: 650; list-style: none; display: flex; justify-content: space-between; gap: 16px; align-items: center; }
summary::-webkit-details-marker { display: none; }
summary::after { content: ""; flex: none; width: 9px; height: 9px; border-right: 2px solid var(--faint); border-bottom: 2px solid var(--faint); transform: rotate(45deg) translateY(-3px); }
details[open] > summary::after { transform: rotate(-135deg) translateX(-2px); }
details > :not(summary) { color: var(--muted); }
details p, details ul, details ol { margin: 12px 0 4px; }

/* ---------- Buttons / App Store badge ---------- */
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
/* Placeholder for Apple's official "Download on the App Store" badge (black, per Apple's marketing guidelines). */
.appstore {
  display: inline-flex; align-items: center; gap: 10px;
  height: 54px; padding: 0 20px 0 16px;
  background: #000; color: #fff; text-decoration: none;
  border: 1px solid #a6a6a6; border-radius: 12px;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}
.appstore:hover { box-shadow: 0 10px 28px -12px rgba(0, 0, 0, 0.6); }
.appstore svg { width: 24px; height: 24px; fill: #fff; flex: none; margin-top: -3px; }
.appstore .t { display: flex; flex-direction: column; line-height: 1; }
.appstore .t small { font-size: 11px; font-weight: 500; margin-bottom: 3px; }
.appstore .t span { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.note { font-size: 14px; color: var(--faint); }

/* =========================================================
   Homepage
   ========================================================= */
.eyebrow { display: inline-block; font: 700 13px/1 var(--font-text); letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin: 0 0 14px; }
.hero { padding: clamp(48px, 9vw, 112px) 0 clamp(40px, 7vw, 88px); position: relative; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(600px 340px at 85% 10%, var(--mango-soft), transparent 70%),
    radial-gradient(700px 420px at 10% 0%, var(--accent-soft), transparent 70%);
}
.hero-grid { display: grid; gap: 40px; align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.15fr 0.85fr; gap: 56px; } }
.h-display { font-weight: 800; font-size: clamp(38px, 7vw, 68px); line-height: 1.04; letter-spacing: -0.025em; margin: 0 0 18px; }
.h-display em { font-style: normal; color: var(--accent); }
.lead { font-size: clamp(18px, 2vw, 21px); line-height: 1.55; color: var(--muted); margin: 0 0 28px; max-width: 34em; text-wrap: pretty; }

/* Hero chat card (illustrative role-play) */
.chat { background: var(--surface); border: 1px solid var(--line); border-radius: 28px; padding: 18px; box-shadow: var(--shadow); display: grid; gap: 10px; max-width: 420px; justify-self: center; width: 100%; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 2px 4px 8px; border-bottom: 1px solid var(--line); }
.chat-head .av { width: 36px; height: 36px; border-radius: 50%; background: var(--mango); color: var(--mango-ink); display: grid; place-items: center; font: 800 16px/1 var(--font-display); }
.chat-head b { font-family: var(--font-display); display: block; line-height: 1.2; }
.chat-head small { color: var(--faint); font-size: 13px; }
.bubble { max-width: 86%; padding: 10px 14px; border-radius: 20px; font-size: 16px; line-height: 1.4; }
.bubble small { display: block; font-size: 13px; opacity: 0.8; margin-top: 3px; }
.bubble.them { background: var(--surface-2); border-bottom-left-radius: 6px; }
.bubble.me { background: var(--accent); color: var(--accent-ink); justify-self: end; border-bottom-right-radius: 6px; }
.tip { font-size: 14px; background: var(--mango-soft); border-radius: 14px; padding: 10px 12px; color: var(--text); }
.tip b { font-family: var(--font-display); }

.section { padding: clamp(56px, 9vw, 112px) 0; }
.section.alt { background: var(--surface-2); }
.h-section { font-weight: 800; font-size: clamp(28px, 4.6vw, 44px); letter-spacing: -0.02em; margin: 0 0 12px; }
.section .lead { margin-bottom: 36px; }

/* The trip */
.trip { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; counter-reset: stop; }
@media (min-width: 720px) { .trip { grid-template-columns: repeat(5, 1fr); gap: 12px; } }
.trip li { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 18px 64px; }
@media (min-width: 720px) { .trip li { padding: 64px 16px 18px; } }
.trip li::before {
  counter-increment: stop; content: counter(stop);
  position: absolute; left: 16px; top: 18px;
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink);
  font: 800 16px/1 var(--font-display);
}
.trip li:last-child::before { background: var(--mango); color: var(--mango-ink); }
.trip h3 { margin: 0 0 4px; font-size: 19px; }
.trip .lvl { display: block; font-size: 13px; font-weight: 700; color: var(--accent); letter-spacing: 0.02em; margin-bottom: 6px; }
.trip p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.5; }

/* Steps */
.steps { display: grid; gap: 16px; }
@media (min-width: 820px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.step .num { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 44px; padding: 0 12px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); font: 800 15px/1 var(--font-display); margin-bottom: 14px; }
.step:nth-child(3) .num { background: var(--mango-soft); color: var(--text); }
.step h3 { margin: 0 0 8px; font-size: 22px; }
.step p { margin: 0; color: var(--muted); }

/* Why */
.why { display: grid; gap: 16px; }
@media (min-width: 720px) { .why { grid-template-columns: repeat(2, 1fr); } }
.why div { border-top: 3px solid var(--accent); padding-top: 14px; }
.why h3 { margin: 0 0 6px; font-size: 20px; }
.why p { margin: 0; color: var(--muted); }

/* Pricing */
.plans { display: grid; gap: 16px; }
@media (min-width: 720px) { .plans { grid-template-columns: repeat(2, 1fr); } }
.plan { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.plan.premium { border: 2px solid var(--accent); }
.plan h3 { margin: 0 0 10px; font-size: 22px; }
.plan ul { margin: 0; padding-left: 20px; color: var(--muted); }
.plan li { margin: 6px 0; }

.final { text-align: center; }
.final .lead { margin-inline: auto; }
.final .cta-row { justify-content: center; }

/* 404 */
.notfound { min-height: 60vh; display: grid; align-content: center; justify-items: start; gap: 8px; }
.btn { display: inline-flex; align-items: center; height: 48px; padding: 0 20px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-weight: 700; text-decoration: none; }
.btn:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; color: var(--accent); border: 2px solid var(--accent); }
