/* Hedgehog Bits — colours match the app's Theme.swift. System fonts only: no external requests. */
:root {
  --bg: #F3F5F6;
  --surface: #FFFFFF;
  --surface-alt: #E7ECEE;
  --border: #D3DBDE;
  --text: #1B2428;
  --muted: #55646A;
  --primary: #0B6E77;
  --on-primary: #FFFFFF;
  --sand: #9C8C6E;
  --radius: 16px;
  --radius-lg: 24px;
  --wrap: 1080px;
  --prose: 700px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F1416;
    --surface: #182024;
    --surface-alt: #212B30;
    --border: #2E3B40;
    --text: #EAF0F1;
    --muted: #A0AEB3;
    --primary: #4CCBD0;
    --on-primary: #052226;
    --sand: #C9BB9E;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.015em; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 4.5vw, 2.9rem); font-weight: 700; }
h2 { font-size: clamp(1.45rem, 3vw, 1.9rem); font-weight: 650; }
h3 { font-size: 1.15rem; font-weight: 600; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
@media (max-width: 560px) { .wrap { padding: 0 16px; } }

.skip-link { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip-link:focus { left: 8px; }

/* Header */
.site-header { border-bottom: 1px solid var(--border); background: var(--bg); position: sticky; top: 0; z-index: 5; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 600; }
.brand img { border-radius: 8px; border: 1px solid var(--border); }
.nav { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.nav a { display: block; padding: 6px 12px; border-radius: 10px; color: var(--muted); text-decoration: none; font-size: .95rem; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); background: var(--surface-alt); }
@media (max-width: 560px) {
  .header-inner { padding-top: 8px; padding-bottom: 8px; }
  .nav a { padding: 4px 8px; }
  .site-header { position: static; }
}

/* Buttons */
.button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px;
  border-radius: var(--radius); background: var(--primary); color: var(--on-primary);
  font-weight: 600; text-decoration: none; border: 1px solid transparent;
}
.button:hover { opacity: .9; }
.button-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.button-disabled { background: var(--surface-alt); color: var(--muted); border-color: var(--border); cursor: default; }
.button-disabled:hover { opacity: 1; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* Hero */
.hero { padding: 72px 0 56px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.eyebrow { color: var(--primary); font-weight: 600; font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 12px; }
.eyebrow a { text-decoration: none; }
.lead { font-size: 1.2rem; color: var(--muted); max-width: 40em; }
@media (max-width: 820px) {
  .hero { padding: 40px 0 32px; }
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
}

/* Phone illustration of the opening screen */
.phone {
  width: min(300px, 100%); margin: 0 auto; aspect-ratio: 9 / 19; background: var(--bg);
  border: 1px solid var(--border); border-radius: 44px; padding: 56px 22px 24px;
  box-shadow: 0 0 0 10px var(--surface), 0 0 0 11px var(--border);
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.phone .hedgehog-art { width: 72%; margin: 18% 0 10%; }
.phone-title { font-weight: 700; font-size: 1.15rem; margin-bottom: 4px; }
.phone-sub { color: var(--muted); font-size: .8rem; margin-bottom: 18px; }
.phone-field {
  width: 100%; text-align: left; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--primary);
  background: var(--surface); color: var(--muted); font-size: .85rem; margin-bottom: 10px;
}
.phone-button { width: 100%; padding: 11px; border-radius: 14px; background: var(--primary); color: var(--on-primary); font-weight: 600; font-size: .85rem; }

/* Sections */
.section { padding: 56px 0; border-top: 1px solid var(--border); }
.section-head { max-width: 680px; margin-bottom: 32px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px;
}
.card h3 { margin-bottom: .4em; }
.card p:last-child { margin-bottom: 0; }
.card .muted { font-size: .95rem; }
.card-icon { width: 36px; height: 36px; color: var(--primary); margin-bottom: 14px; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
@media (max-width: 820px) { .two-col { grid-template-columns: 1fr; gap: 24px; } }

.steps { list-style: none; counter-reset: step; padding: 0; margin: 0; display: grid; gap: 16px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 40px 1fr; gap: 14px; align-items: start; }
.steps li::before {
  content: counter(step); width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface); display: grid; place-items: center; font-weight: 600; color: var(--primary); font-size: .9rem;
}
.steps p { margin: 0; }

.spec { width: 100%; border-collapse: collapse; font-size: .95rem; }
.spec th, .spec td { text-align: left; padding: 12px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.spec th { width: 38%; font-weight: 600; padding-right: 16px; }
.spec td { color: var(--muted); }

.not-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.not-list li { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 6px 14px; font-size: .9rem; color: var(--muted); }

.callout { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--sand); border-radius: var(--radius); padding: 18px 20px; margin: 1.5em 0; }
.callout p:last-child { margin-bottom: 0; }

/* Prose pages and posts */
.page, .post { padding-top: 56px; padding-bottom: 72px; }
.prose > * { max-width: var(--prose); }
.prose > .wide { max-width: none; }
.page-header { margin-bottom: 36px; }
.prose h2 { margin-top: 2em; }
.prose h3 { margin-top: 1.6em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .35em; }
.prose table { border-collapse: collapse; width: 100%; font-size: .95rem; margin: 1.5em 0; }
.prose th, .prose td { border-bottom: 1px solid var(--border); padding: 10px 12px 10px 0; text-align: left; vertical-align: top; }
.prose blockquote { margin: 1.5em 0; padding: 4px 20px; border-left: 3px solid var(--border); color: var(--muted); }
code { font-family: var(--mono); font-size: .88em; background: var(--surface-alt); padding: 2px 6px; border-radius: 6px; }
pre { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; overflow-x: auto; }
pre code { background: none; padding: 0; }
.post-meta { font-size: .95rem; }
.post-footer { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border); }
.post-nav { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tag { font-size: .8rem; border: 1px solid var(--border); border-radius: 999px; padding: 2px 10px; color: var(--muted); }

/* FAQ */
.faq details { border-bottom: 1px solid var(--border); padding: 16px 0; }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--primary); font-weight: 400; font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "\2212"; }
.faq details > div { padding-top: 10px; color: var(--muted); }
.faq details > div p:last-child { margin-bottom: 0; }

/* Blog list */
.post-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.post-list a.card { display: block; color: inherit; text-decoration: none; }
.post-list a.card:hover { border-color: var(--primary); }
.post-list h2, .post-list h3 { margin-bottom: .3em; font-size: 1.25rem; }
.post-list time { font-size: .875rem; color: var(--muted); }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 40px 0 32px; margin-top: 0; }
.footer-inner { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 16px; }
.footer-brand { font-weight: 600; margin-bottom: 4px; }
.footer-links { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 20px; }
.footer-links a { color: var(--muted); text-decoration: none; font-size: .95rem; }
.footer-links a:hover { color: var(--text); }

/* Code highlighting (rouge), kept subtle */
.highlight .c, .highlight .c1, .highlight .cm { color: var(--muted); }
.highlight .k, .highlight .kd, .highlight .nb { color: var(--primary); }
.highlight .s, .highlight .s1, .highlight .s2 { color: var(--sand); }

/* Let grid children shrink below their content width on narrow screens. */
.hero-grid > *, .two-col > *, .grid > * { min-width: 0; }
.prose table { display: block; overflow-x: auto; }

.hero-note { margin-top: 16px; }
.list-note { margin-top: 24px; }
.not-found { text-align: center; }
.not-found h1 { margin-top: 24px; }
.not-found .actions { justify-content: center; }
.not-found .hedgehog-art img { width: 220px; margin: 0 auto; }

/* Small screens: larger tap targets, full-width calls to action, a shorter phone mock-up. */
@media (max-width: 560px) {
  .header-inner { gap: 4px 16px; }
  .nav { justify-content: space-between; margin: 0 -8px; width: calc(100% + 16px); }
  .nav a { min-height: 44px; display: flex; align-items: center; padding: 0 8px; }
  .actions { flex-direction: column; align-items: stretch; }
  .actions .button { width: 100%; }
  .phone { width: min(240px, 100%); aspect-ratio: 9 / 15; border-radius: 36px; padding: 32px 18px 20px; }
  .phone .hedgehog-art { margin: 10% 0 8%; }
  .footer-links { gap: 0 20px; }
  .footer-links a { display: inline-flex; align-items: center; min-height: 44px; }
  .post-nav a { display: inline-block; padding: 10px 0; }
  .lead { font-size: 1.1rem; }
}

/* App demo video inside the phone frame */
.hero-demo { margin: 0; text-align: center; }
.hero-demo figcaption { margin-top: 22px; }
.phone-video { aspect-ratio: auto; padding: 8px; border-radius: 46px; display: block; }
.demo-video, .demo-still img { display: block; width: 100%; height: auto; border-radius: 38px; background: var(--bg); }
.demo-still { display: none; }
@media (prefers-reduced-motion: reduce) {
  .demo-autoplay { display: none; }
  .demo-still { display: block; }
}
@media (max-width: 560px) {
  .phone-video { width: min(260px, 100%); aspect-ratio: auto; padding: 7px; border-radius: 40px; }
  .demo-video, .demo-still img { border-radius: 33px; }
}

/* Demo page */
.demo-player { max-width: 320px; margin: 0 0 12px; }
.prose .demo-steps { list-style: none; padding: 0; margin: 32px 0 0; display: grid; gap: 28px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); max-width: none; counter-reset: demo; }
.demo-steps li { counter-increment: demo; margin: 0; min-width: 0; }
.demo-steps figure { margin: 0; }
.demo-steps img { width: 100%; height: auto; border-radius: 22px; border: 1px solid var(--border); background: var(--surface); }
.demo-steps figcaption { margin-top: 12px; font-size: .95rem; }
.demo-steps figcaption strong { display: block; color: var(--text); margin-bottom: 2px; }
.demo-steps figcaption strong::before { content: counter(demo) ". "; color: var(--primary); }
.demo-steps figcaption span { color: var(--muted); }
.demo-intro { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 48px; align-items: start; }
.demo-intro .demo-player { margin: 0; width: 100%; }
.demo-intro h2 { margin-top: 0; }
.prose .chapters { list-style: none; padding: 0; margin: 0 0 20px; }
.chapters li { display: flex; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--border); margin: 0; }
.chapter-time { font-family: var(--mono); font-size: .9rem; color: var(--primary); min-width: 3.2em; padding-top: 2px; }
@media (max-width: 720px) {
  .demo-intro { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .demo-intro .demo-player { width: min(280px, 100%); margin: 0 auto; }
}
.only-dark { display: none; }
@media (prefers-color-scheme: dark) {
  .only-dark { display: block; }
  .only-light { display: none; }
}

/* Features page screenshots */
.prose .feature-shots { list-style: none; padding: 0; margin: 28px 0 8px; display: grid; gap: 24px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); max-width: none; }
.feature-shots li { margin: 0; min-width: 0; }
.feature-shots figure { margin: 0; }
.feature-shots img { width: 100%; height: auto; border-radius: 22px; border: 1px solid var(--border); background: var(--surface); }
.feature-shots figcaption { margin-top: 12px; font-size: .95rem; }
.feature-shots figcaption strong { display: block; color: var(--text); margin-bottom: 2px; }
.feature-shots figcaption span { color: var(--muted); }

/* Free and Plus cards */
.plans { margin: 24px 0; align-items: stretch; }
.plan h3 { margin-top: 0; }
.plan-plus { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.plan-price { color: var(--muted); margin-top: -.2em; }
.prose .plan-list { list-style: none; padding: 0; margin: 16px 0 0; }
.plan-list li { position: relative; padding-left: 28px; margin: 0 0 10px; }
.plan-list li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--primary); font-weight: 700; }
