/* Habloro site — direction C "a paper story and a yellow marker" (design/DESIGN.md §1–§3, §10.1).
   Slate = outside the book. Paper = the story. Yellow = only the reader's kept words. */

@font-face { font-family: "Chivo"; src: url("fonts/Chivo.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Bitter"; src: url("fonts/Bitter.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Bitter"; src: url("fonts/Bitter-Italic.woff2") format("woff2"); font-weight: 100 900; font-style: italic; font-display: swap; }

:root {
  --slate: #4B6172;
  --slate-deep: #3F5363;
  --paper: #FCF5E7;
  --paper-2: #F6EBD6;
  --ink: #1E2A33;
  --muted: #5E6B75;
  --ink-soft: #4A5357;
  --on-slate: #FCF5E7;
  --on-slate-muted: #D5D9DA;
  --marker: #EFB95A;
  --rule: rgba(30, 42, 51, 0.14);
  --tint: rgba(30, 42, 51, 0.06);
  --card: #FFFBF2;
  --display: "Chivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --story: "Bitter", Georgia, "Times New Roman", serif;
  --ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --wrap: 1080px;
  --gutter: 24px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --slate: #1C252D;
    --slate-deep: #141B21;
    --paper: #182027;
    --paper-2: #1E2830;
    --ink: #EDE4D3;
    --muted: #9AA3A9;
    --ink-soft: #C9C2B4;
    --on-slate: #EDE4D3;
    --on-slate-muted: #A9B1B6;
    --marker: #D9A54D;
    --rule: rgba(237, 228, 211, 0.16);
    --tint: rgba(237, 228, 211, 0.07);
    --card: #1E2830;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --slate: #1C252D; --slate-deep: #141B21; --paper: #182027; --paper-2: #1E2830; --ink: #EDE4D3;
  --muted: #9AA3A9; --ink-soft: #C9C2B4; --on-slate: #EDE4D3; --on-slate-muted: #A9B1B6; --marker: #D9A54D;
  --rule: rgba(237, 228, 211, 0.16); --tint: rgba(237, 228, 211, 0.07); --card: #1E2830; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.6 var(--ui);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2.5px; }
:focus-visible { outline: 3px solid currentColor; outline-offset: 3px; border-radius: 4px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--paper); color: var(--ink); padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }

/* ---------- header / footer (slate) ---------- */
.site-header { background: var(--slate); color: var(--on-slate); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font: 700 22px/1 var(--display); letter-spacing: -0.01em; }
.brand img { width: 40px; height: 40px; border-radius: 10px; }
.nav { display: flex; gap: 4px 20px; flex-wrap: wrap; font-size: 15px; }
.nav a { text-decoration: none; color: var(--on-slate-muted); padding: 10px 0; min-height: 44px; display: inline-flex; align-items: center; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--on-slate); text-decoration: underline; }

.site-footer { background: var(--slate); color: var(--on-slate-muted); font-size: 15px; padding: 40px 0 48px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 20px 40px; justify-content: space-between; align-items: flex-start; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 4px 24px; }
.site-footer a { color: var(--on-slate); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.site-footer a:hover { text-decoration: underline; }
.site-footer p { margin: 0; }

/* ---------- hero (slate) ---------- */
.hero { background: var(--slate); color: var(--on-slate); padding: 40px 0 72px; }
.hero .wrap { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center; }
.hero h1 { font: 700 clamp(40px, 6vw, 64px)/1.04 var(--display); letter-spacing: -0.02em; margin: 0 0 20px; }
.hero .lede { font-size: clamp(18px, 2.2vw, 21px); line-height: 1.5; color: var(--on-slate-muted); margin: 0 0 28px; max-width: 34em; }
.hero .lede strong { color: var(--on-slate); font-weight: 600; }
.level { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; color: var(--on-slate-muted); margin-bottom: 18px; }
.tag { font-size: 12px; line-height: 1; padding: 4px 6px; border: 1px solid currentColor; border-radius: 5px; opacity: .9; letter-spacing: .02em; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 56px; padding: 0 26px; border-radius: 14px; font: 600 17px/1 var(--ui); text-decoration: none; }
.btn-paper { background: var(--on-slate); color: #1E2A33; }
.btn-outline { border: 1.5px solid currentColor; }
.soon { font-size: 15px; color: var(--on-slate-muted); }
.hero-pic { position: relative; border-radius: 22px; overflow: hidden; box-shadow: 0 30px 60px -30px rgba(0,0,0,.55); aspect-ratio: 3 / 4; max-width: 440px; justify-self: end; width: 100%; }
.hero-pic img { width: 100%; height: 100%; object-fit: cover; }
.hero-pic figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 64px 22px 20px; color: #FCF5E7; background: linear-gradient(to top, rgba(30,42,51,.82), rgba(30,42,51,0)); }
.hero-pic .t { font: 700 24px/1.1 var(--display); display: block; }
.hero-pic .m { font-size: 14px; opacity: .9; display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.dots i.off { opacity: .35; }

/* ---------- paper sections ---------- */
.section { padding: 80px 0; }
.section.alt { background: var(--paper-2); padding-top: 80px; }
.eyebrow { font: 600 13px/1 var(--ui); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 14px; }
h2 { font: 700 clamp(30px, 4vw, 42px)/1.1 var(--display); letter-spacing: -0.015em; margin: 0 0 18px; }
h3 { font: 700 21px/1.25 var(--display); margin: 0 0 8px; }
.intro { font-size: 19px; color: var(--ink-soft); max-width: 40em; margin: 0 0 40px; }
.muted { color: var(--muted); }

/* the marker: only for the reader's kept words */
.mk { background: linear-gradient(transparent 38%, var(--marker) 38%, var(--marker) 92%, transparent 92%); color: var(--ink); border-radius: 3px; padding: 0 2px; margin: 0 -2px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }

/* stories grid */
.stories { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.story-card { margin: 0; }
.story-card img { border-radius: 10px; aspect-ratio: 2 / 1; object-fit: cover; width: 100%; }
.story-card figcaption { padding: 10px 2px 0; }
.story-card .es { font: 600 18px/1.25 var(--display); display: block; }
.story-card .en { font-size: 15px; color: var(--muted); }

/* the loop */
.loop { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; display: grid; gap: 30px; }
.steps li { position: relative; padding-left: 58px; counter-increment: s; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: -2px; width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--ink); display: grid; place-items: center; font: 700 18px/1 var(--display); }
.steps p { margin: 0; color: var(--ink-soft); }

/* phone-like demo of the story page (HTML, not a screenshot) */
.demo { background: var(--card); border: 1px solid var(--rule); border-radius: 22px; padding: 28px 26px 22px; box-shadow: 0 24px 50px -36px rgba(30,42,51,.45); }
.demo + .demo { margin-top: 20px; }
.demo-label { font: 600 12px/1 var(--ui); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 16px; }
.es-text { font: 400 21px/1.55 var(--story); margin: 0; color: var(--muted); }
.es-text .now { color: var(--ink); font-weight: 500; }
.es-text .open { background: var(--tint); border-radius: 6px; padding: 1px 3px; margin: 0 -3px; color: var(--ink); font-weight: 500; }
.keep { text-decoration: underline dotted 2px; text-decoration-color: var(--marker); text-underline-offset: 5px; }
.en-text { font: 16px/1.45 var(--ui); color: var(--muted); margin: 14px 0 0; }
.en-text b { color: var(--ink); font-weight: 400; }
.demo-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--rule); margin-top: 20px; padding-top: 14px; font-size: 14px; color: var(--muted); }
.count { background: var(--marker); color: #1E2A33; border-radius: 5px; padding: 0 6px; font-weight: 600; }
.gap { display: inline-block; min-width: 4.6em; height: 1.05em; vertical-align: -0.12em; background: var(--marker); border-radius: 4px; }
.sched { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; font-size: 14px; color: var(--muted); align-items: center; }
.sched span { border: 1px solid var(--rule); border-radius: 999px; padding: 4px 11px; }

/* why it works */
.why { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.why article { background: var(--card); border: 1px solid var(--rule); border-radius: 14px; padding: 24px 24px 22px; }
.why p { margin: 0; color: var(--ink-soft); }
.more { margin-top: 32px; font-weight: 600; }

/* closing band (slate) */
.band { background: var(--slate); color: var(--on-slate); padding: 72px 0; text-align: center; }
.band h2 { margin-bottom: 12px; }
.band p { color: var(--on-slate-muted); margin: 0 auto 28px; max-width: 34em; font-size: 19px; }
.band .cta-row { justify-content: center; }

/* ---------- long-form pages (science, legal, support) ---------- */
.page-head { background: var(--slate); color: var(--on-slate); padding: 48px 0 56px; }
.page-head h1 { font: 700 clamp(34px, 5vw, 52px)/1.06 var(--display); letter-spacing: -0.02em; margin: 0 0 14px; }
.page-head p { color: var(--on-slate-muted); font-size: 19px; margin: 0; max-width: 38em; }
.prose { max-width: 720px; margin: 0 auto; padding: 56px var(--gutter) 88px; }
.prose h2 { font-size: clamp(26px, 3.4vw, 32px); margin: 48px 0 14px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin: 32px 0 8px; }
.prose p, .prose li { color: var(--ink-soft); }
.prose strong { color: var(--ink); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: 6px 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15.5px; margin: 18px 0 8px; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--rule); }
.prose th { font-weight: 600; color: var(--ink); }
.callout { background: var(--card); border: 1px solid var(--rule); border-left: 4px solid var(--ink); border-radius: 10px; padding: 18px 20px; margin: 24px 0; }
.callout p { margin: 0; }
.claim { border-top: 1px solid var(--rule); padding-top: 28px; margin-top: 36px; }
.claim .what { font: 600 13px/1 var(--ui); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.claim h2 { margin-top: 0; }
.strength { display: inline-block; font-size: 13px; border: 1px solid var(--rule); border-radius: 999px; padding: 3px 10px; margin: 0 0 12px; color: var(--muted); }
.refs { font-size: 15px; }
.refs li { margin: 10px 0; }
.updated { font-size: 15px; color: var(--muted); }
.ph { background: var(--tint); border: 1px dashed var(--muted); border-radius: 4px; padding: 0 4px; color: var(--ink); }

/* ---------- responsive ---------- */
@media (max-width: 880px) {
  .hero .wrap, .loop { grid-template-columns: 1fr; gap: 36px; }
  .hero-pic { justify-self: start; max-width: 400px; }
  .stories { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  :root { --gutter: 16px; }
  body { font-size: 16.5px; }
  .site-header .wrap { min-height: 0; }
  .nav { gap: 0 16px; font-size: 14.5px; width: 100%; }
  .hero { padding: 24px 0 56px; }
  .section, .section.alt { padding: 56px 0; }
  .stories { grid-template-columns: 1fr 1fr; gap: 14px; }
  .story-card .es { font-size: 15.5px; }
  .story-card .en { font-size: 13.5px; }
  .why { grid-template-columns: 1fr; }
  .demo { padding: 22px 18px 18px; }
  .es-text { font-size: 19px; }
  .btn { width: 100%; }
  .prose { padding-top: 40px; }
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

/* ---------- "Try a story" (assets/try-story.js) ---------- */
.try { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr); gap: 40px; align-items: start; }
.reader { background: var(--card); border: 1px solid var(--rule); border-radius: 22px; overflow: hidden; box-shadow: 0 24px 50px -36px rgba(30,42,51,.45); }
.reader-pic { aspect-ratio: 2 / 1; width: 100%; object-fit: cover; }
.reader-body { padding: 22px 26px 8px; }
.reader-title { font: 700 26px/1.1 var(--display); margin: 0 0 4px; }
.reader-sub { font-size: 14px; color: var(--muted); margin: 0 0 18px; }
.reader [data-text] .es-text { margin: 0 0 14px; }
.reader [data-text] .en-text { margin: -6px 0 16px; }
.sent { cursor: pointer; border-radius: 6px; transition: color .2s; }
.sent:hover { color: var(--ink); }
.sent.now { color: var(--ink); font-weight: 500; }
.sent.open { background: var(--tint); color: var(--ink); font-weight: 500; padding: 1px 3px; margin: 0 -3px; }
.w.keep { cursor: pointer; text-decoration: underline dotted 2px; text-decoration-color: var(--marker); text-underline-offset: 5px; }
mark.mk { color: var(--ink); }
.again { font-size: 13px; line-height: 1; border: 1px solid var(--rule); background: var(--paper); color: var(--ink); border-radius: 999px; width: 30px; height: 30px; vertical-align: 2px; cursor: pointer; padding: 0; }
.player { position: sticky; bottom: 0; background: var(--card); border-top: 1px solid var(--rule); padding: 12px 18px 14px; display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; justify-content: space-between; }
.player-btns { display: flex; gap: 10px; }
.btn-ink, .btn-line { min-height: 48px; padding: 0 22px; border-radius: 14px; font: 600 16px/1 var(--ui); cursor: pointer; }
.btn-ink { background: var(--ink); color: var(--paper); border: 0; min-width: 104px; }
.btn-line { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
.link-btn { background: none; border: 0; color: var(--ink); font: 600 16px/1 var(--ui); text-decoration: underline; text-underline-offset: 3px; min-height: 48px; padding: 0 8px; cursor: pointer; }
.player-meta { font-size: 14px; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; }
.try-side h3 { margin-top: 0; }
.try-side ol { padding-left: 1.2em; margin: 0 0 18px; color: var(--ink-soft); }
.try-side li { margin: 8px 0; }
.hint-line { font-weight: 600; color: var(--ink); min-height: 1.6em; }
.practice { margin-top: 22px; background: var(--card); border: 1px solid var(--rule); border-radius: 22px; padding: 22px 22px 18px; }
.practice h3 { margin: 0 0 6px; }
.practice > p { margin: 0 0 14px; color: var(--ink-soft); }
.q-count { font-size: 13px; color: var(--muted); margin: 16px 0 8px; }
.q-es { color: var(--ink); }
.gap-in { font: 500 21px/1.3 var(--story); color: var(--ink); background: var(--marker); border: 0; border-radius: 5px; padding: 1px 6px; margin: 0 2px; min-width: 3em; max-width: 100%; }
.gap-in:focus { outline: 2px solid var(--ink); outline-offset: 2px; }
.gap-in.right { background: transparent; text-decoration: underline 3px; text-decoration-color: var(--marker); text-underline-offset: 5px; }
.q-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.q-msg { min-height: 1.5em; margin: 10px 0 0; font-weight: 600; }
.done-line { margin: 16px 0 0; }
.noscript { color: var(--muted); }
@media (max-width: 880px) { .try { grid-template-columns: 1fr; } }
@media (max-width: 600px) {
  .reader-body { padding: 18px 18px 4px; }
  .player { padding: 10px 14px 12px; }
  .player-btns { width: 100%; }
  .player-btns .btn-ink { flex: 1; }
  .gap-in { font-size: 19px; }
}
.pain { font: italic 400 19px/1.45 var(--story); color: var(--ink); margin: 0 0 14px; }
.pains h3 { margin-bottom: 6px; }
