/* OpenHead website (GitHub Pages from docs/). Colours from the cartoon theme. */
:root {
  --cream: #f6e6cc;
  --cream-2: #fbf3e6;
  --ink: #1d1b22;
  --ink-2: #4a4652;
  --navy: #1f3a5f;
  --navy-2: #16294a;
  --coral: #e76f51;
  --teal: #2a9d8f;
  --gold: #ffc857;
  --red: #b8323f;
  --line: rgba(29, 27, 34, 0.12);
  --radius: 18px;
  --max: 1120px;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--cream-2);
  color: var(--ink);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--navy); text-underline-offset: 3px; }
a:hover { color: var(--coral); }

.wrap { width: min(var(--max), 100% - 32px); margin: 0 auto; }

/* header */
.top {
  position: sticky; top: 0; z-index: 10;
  background: rgba(251, 243, 230, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.top .wrap { display: flex; align-items: center; gap: 24px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); text-decoration: none; }
.brand img { width: 34px; height: 34px; border-radius: 9px; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.top nav { margin-left: auto; display: flex; gap: 22px; flex-wrap: wrap; }
.top nav a { color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: 15px; }
.top nav a:hover { color: var(--coral); }

/* hero */
.hero { background: var(--cream); padding: 72px 0 64px; border-bottom: 1px solid var(--line); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 48px; align-items: center; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: 13px; font-weight: 700; color: var(--teal); margin: 0 0 12px; }
h1 { font-size: clamp(38px, 5.4vw, 62px); line-height: 1.05; margin: 0 0 18px; letter-spacing: -0.02em; }
.lead { font-size: 20px; color: var(--ink-2); margin: 0 0 28px; }
.buttons { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 999px;
  font-weight: 600; text-decoration: none; border: 2px solid var(--ink);
}
.btn.primary { background: var(--ink); color: var(--cream-2); }
.btn.primary:hover { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.ghost { color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--cream-2); }
.note { font-size: 14px; color: var(--ink-2); margin-top: 14px; }

.phone {
  background: #111; border-radius: 34px; padding: 14px; box-shadow: 0 24px 60px rgba(31, 58, 95, .28);
}
.phone img, .phone video { border-radius: 22px; width: 100%; aspect-ratio: 844 / 390; object-fit: cover; background: #000; }

/* sections */
section { padding: 80px 0; }
section.alt { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
section.dark { background: var(--navy-2); color: #e9eef6; }
section.dark a { color: var(--gold); }
h2 { font-size: clamp(30px, 3.6vw, 42px); line-height: 1.12; margin: 0 0 14px; letter-spacing: -0.015em; }
h3 { font-size: 20px; margin: 0 0 6px; }
.sub { font-size: 19px; color: var(--ink-2); max-width: 720px; margin: 0 0 40px; }
section.dark .sub { color: #b9c4d6; }
section.film video { width: 100%; aspect-ratio: 16 / 9; border-radius: var(--radius); background: var(--cream);
  box-shadow: 0 24px 60px -28px rgba(29, 27, 34, .45); }

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px;
}
section.alt .card { background: var(--cream-2); }
.card p { margin: 0; color: var(--ink-2); font-size: 16px; }
.card .icon {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  font-size: 22px; margin-bottom: 14px; background: var(--cream);
}

.themes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.themes figure { margin: 0; }
.themes img { border-radius: 14px; border: 1px solid var(--line); aspect-ratio: 844 / 390; object-fit: cover; }
.themes figcaption { margin-top: 10px; font-weight: 600; }
.themes figcaption span { display: block; font-weight: 400; color: var(--ink-2); font-size: 15px; }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.split.reverse > :first-child { order: 2; }
.list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.list li { padding-left: 30px; position: relative; }
.list li::before {
  content: ""; position: absolute; left: 4px; top: 9px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--coral);
}
section.dark .list li::before { background: var(--gold); }

.shot { border-radius: 14px; border: 1px solid var(--line); background: #000; }

.steps { counter-reset: step; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.steps li { list-style: none; counter-increment: step; }
.steps li::before {
  content: counter(step); display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--gold); color: var(--ink); font-weight: 800; margin-bottom: 12px;
}
.steps { padding: 0; margin: 0; }

pre {
  background: #0e1726; color: #dfe7f3; border-radius: 14px; padding: 20px 22px; overflow-x: auto;
  font: 14px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; margin: 0;
}
pre .c { color: #7f8ea8; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
:not(pre) > code { background: rgba(31, 58, 95, .08); padding: 1px 6px; border-radius: 6px; overflow-wrap: anywhere; }
section.dark :not(pre) > code { background: rgba(255, 255, 255, .1); }

.settings { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.settings img { border-radius: 12px; border: 1px solid var(--line); }

details { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px 20px; }
details + details { margin-top: 12px; }
summary { cursor: pointer; font-weight: 600; }
details p { color: var(--ink-2); margin: 10px 0 0; }

table.data { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 15px; line-height: 1.5;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  box-shadow: 0 1px 2px rgba(29, 27, 34, .04); }
table.data th, table.data td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { background: var(--cream); font-weight: 700; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:nth-child(even) td { background: #fdfaf4; }
table.data td:first-child { font-weight: 600; }
table.data.streams td:nth-child(1), table.data.streams td:nth-child(2) { white-space: nowrap; }
section.dark .themes img { border-color: rgba(255, 255, 255, .15); }

/* text pages (privacy, support) */
.page { padding: 56px 0 80px; }
.page .wrap { max-width: 780px; }
.page h1 { font-size: clamp(34px, 4.4vw, 48px); }
.page h2 { font-size: 24px; margin: 40px 0 10px; }
.page p, .page li { color: var(--ink-2); }
.page .updated { color: var(--ink-2); font-size: 15px; }
.box { background: var(--cream); border-radius: var(--radius); padding: 20px 24px; margin: 24px 0; }
.box p { margin: 0; color: var(--ink); }

/* footer */
footer { background: var(--ink); color: #c9c4cf; padding: 40px 0; font-size: 15px; }
footer .wrap { display: flex; gap: 24px; flex-wrap: wrap; align-items: center; }
footer a { color: #fff; text-decoration: none; }
footer a:hover { color: var(--gold); }
footer nav { display: flex; gap: 20px; flex-wrap: wrap; margin-left: auto; }

@media (max-width: 900px) {
  .hero .wrap, .split { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .split.reverse > :first-child { order: 0; }
  .grid, .themes { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }
  section { padding: 60px 0; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .top nav { display: none; }
  .grid, .themes, .steps, .settings { grid-template-columns: 1fr; }
  .hero { padding: 48px 0; }
  .lead { font-size: 18px; }
}

/* Language switch: stays visible when the main nav is hidden on phones */
.top .lang { margin-left: 22px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px;
  color: var(--ink-2); text-decoration: none; font-size: 14px; font-weight: 600; white-space: nowrap; }
.top .lang:hover { color: var(--coral); border-color: var(--coral); }
@media (max-width: 600px) { .top .lang { margin-left: auto; } }

/* App Store button and its QR code (a popover; without popover support the button does nothing) */
button.btn { font: inherit; font-weight: 600; background: none; cursor: pointer; }
.qr { border: 0; border-radius: var(--radius); padding: 28px; text-align: center; max-width: 340px;
  box-shadow: 0 20px 60px rgba(0,0,0,.35); background: #fff; color: var(--ink); }
.qr::backdrop { background: rgba(22, 41, 74, .55); }
.qr img { display: block; margin: 0 auto; width: 264px; height: 264px; }
.qr p { font-size: 15px; color: var(--ink-2); margin: 14px 0 18px; }

/* Apple's App Store badge (unchanged artwork, at least 40 px high) and the GitHub mark */
.store { display: inline-flex; align-items: center; }
.store img { display: block; height: 50px; width: auto; }
.gh { flex: none; }
.ghlink { display: inline-flex; align-items: center; gap: 6px; }
table.data code { white-space: nowrap; }

/* AI agent setup: one folding box per agent */
details.agent { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 4px 18px; margin: 10px 0; }
details.agent summary { font-weight: 700; padding: 12px 0; cursor: pointer; }
details.agent p { margin: 0 0 10px; font-size: 15px; color: var(--ink-2); }
details.agent pre { margin: 0 0 16px; white-space: pre-wrap; word-break: break-word; font-size: 13px; }
