/* Box Fan Sleep — shared styles for every page */
:root {
  --bg: #0b1020;
  --bg-2: #0f1630;
  --surface: #141c38;
  --surface-2: #1a2446;
  --line: rgba(255, 255, 255, 0.09);
  --text: #eef1f8;
  --muted: #a3adc8;
  --faint: #7a84a3;
  --accent: #34d058;
  --accent-ink: #062b12;
  --link: #8cc8ff;
  --warn: #ffcf66;
  --radius: 16px;
  --max: 1080px;
  --prose: 720px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, ui-serif, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { color: #b8dcff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.prose { max-width: var(--prose); margin: 0 auto; padding: 0 20px; }

/* ── Header ── */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(11, 16, 32, 0.86);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; letter-spacing: -0.01em; }
.brand svg { width: 30px; height: 30px; }
.nav { display: flex; align-items: center; gap: 22px; }
.nav a { color: var(--muted); text-decoration: none; font-size: 15px; }
.nav a:hover { color: var(--text); }
.nav a.btn, .nav a.btn:hover { color: var(--accent-ink); }
.nav .nav-guides { display: inline; }
@media (max-width: 720px) { .nav .hide-sm { display: none; } }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 700; font-size: 15px; text-decoration: none;
  padding: 10px 16px; border-radius: 999px;
  transition: transform .12s ease, filter .12s ease;
}
.btn:hover { color: var(--accent-ink); filter: brightness(1.06); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn-ghost:hover { color: var(--text); border-color: rgba(255,255,255,.25); }
.badge-link { display: inline-block; }
.badge-link img { height: 54px; width: auto; }

/* ── Hero ── */
.hero { padding: 72px 0 40px; text-align: center; }
.eyebrow { display: inline-block; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); font-weight: 700; margin-bottom: 14px; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.015em; }
.hero h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(36px, 6vw, 60px); margin: 0 auto 18px; max-width: 16ch; }
.hero p.lede { color: var(--muted); font-size: clamp(17px, 2.2vw, 20px); max-width: 40em; margin: 0 auto 28px; }
.hero-cta { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 6px; }
.chip { font-size: 13px; color: var(--muted); border: 1px solid var(--line); padding: 5px 12px; border-radius: 999px; background: rgba(255,255,255,.02); }

.fan-hero { width: 220px; height: 220px; margin: 0 auto 32px; }
.fan-hero .blades { transform-origin: 50% 50%; animation: spin 2.4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .fan-hero .blades { animation: none; } html { scroll-behavior: auto; } }

/* ── Sections ── */
section { padding: 56px 0; }
.section-head { text-align: center; max-width: 42em; margin: 0 auto 36px; }
.section-head h2 { font-family: var(--serif); font-weight: 600; font-size: clamp(28px, 4vw, 40px); margin: 0 0 12px; }
.section-head p { color: var(--muted); margin: 0; }
.kicker { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); font-weight: 700; margin-bottom: 8px; display: block; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 16px; text-align: center; }
.stat b { display: block; font-size: 32px; line-height: 1.1; font-family: var(--serif); }
.stat span { color: var(--muted); font-size: 14px; }
@media (max-width: 720px) { .stats { grid-template-columns: repeat(2, 1fr); } }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid.two { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 860px) { .grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .grid, .grid.two { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.card h3 { margin: 0 0 8px; font-size: 19px; }
.card p { margin: 0; color: var(--muted); font-size: 16px; }
.card .tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; margin-bottom: 10px; background: rgba(52,208,88,.12); color: var(--accent); }
.card .tag.pro { background: rgba(255,207,102,.12); color: var(--warn); }
a.card { text-decoration: none; color: inherit; transition: border-color .15s ease, transform .15s ease; }
a.card:hover { border-color: rgba(255,255,255,.25); transform: translateY(-2px); color: inherit; }
a.card .more { color: var(--link); font-size: 15px; margin-top: 12px; display: inline-block; }

/* ── Tables ── */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 520px; }
th, td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { color: var(--muted); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }
td.yes { color: var(--accent); }
td.hl, th.hl { background: rgba(52,208,88,.06); }

/* ── Facts list (for people and AI search) ── */
.facts { display: grid; grid-template-columns: 200px 1fr; gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 0; }
.facts dt, .facts dd { padding: 12px 16px; border-bottom: 1px solid var(--line); margin: 0; }
.facts dt { color: var(--muted); font-size: 15px; }
.facts dd { font-size: 15px; }
.facts dt:last-of-type, .facts dd:last-of-type { border-bottom: 0; }
@media (max-width: 600px) { .facts { grid-template-columns: 1fr; } .facts dt { border-bottom: 0; padding-bottom: 2px; } }

/* ── FAQ ── */
.faq { max-width: 780px; margin: 0 auto; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 10px; }
.faq summary { cursor: pointer; padding: 16px 20px; 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(--muted); font-weight: 400; font-size: 22px; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq .answer { padding: 0 20px 18px; color: var(--muted); }
.faq .answer p { margin: 0 0 10px; }

/* ── Article pages ── */
.article-head { padding-top: 56px; padding-bottom: 8px; }
.crumbs { font-size: 14px; color: var(--faint); margin-bottom: 18px; }
.crumbs a { color: var(--faint); }
.article-head h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(32px, 5vw, 46px); margin: 0 0 14px; }
.byline { color: var(--faint); font-size: 14px; }
.tldr { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 12px; padding: 18px 20px; margin: 28px 0; }
.tldr strong { display: block; margin-bottom: 6px; }
.tldr ul { margin: 0; padding-left: 20px; }
.article h2 { font-family: var(--serif); font-weight: 600; font-size: 28px; margin: 44px 0 12px; }
.article h3 { font-size: 20px; margin: 28px 0 8px; }
.article p, .article li { color: #d6dbea; }
.article ul, .article ol { padding-left: 22px; }
.article li { margin-bottom: 6px; }
.article .table-scroll { margin: 20px 0; }
.note { background: rgba(255,207,102,.07); border: 1px solid rgba(255,207,102,.25); border-radius: 12px; padding: 14px 18px; color: #f3e3bd; font-size: 16px; margin: 22px 0; }
.sources { font-size: 15px; color: var(--muted); }
.sources li { color: var(--muted); }

/* ── CTA block ── */
.cta { text-align: center; background: linear-gradient(180deg, var(--surface), var(--bg-2)); border: 1px solid var(--line); border-radius: 22px; padding: 44px 24px; margin: 48px auto; max-width: var(--max); }
.cta h2 { font-family: var(--serif); font-weight: 600; font-size: clamp(26px, 4vw, 36px); margin: 0 0 10px; }
.cta p { color: var(--muted); margin: 0 auto 22px; max-width: 36em; }

/* ── Footer ── */
.site-footer { border-top: 1px solid var(--line); padding: 40px 0 56px; color: var(--faint); font-size: 14px; margin-top: 40px; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 24px; }
.foot-grid h4 { color: var(--text); font-size: 14px; margin: 0 0 10px; }
.foot-grid ul { list-style: none; padding: 0; margin: 0; }
.foot-grid li { margin-bottom: 6px; }
.foot-grid a { color: var(--muted); text-decoration: none; }
.foot-grid a:hover { color: var(--text); }
.foot-legal { margin-top: 28px; }
@media (max-width: 700px) { .foot-grid { grid-template-columns: 1fr; } }

/* ── Consent bar ── */
.consent { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 50; max-width: 560px; margin: 0 auto; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; box-shadow: 0 10px 40px rgba(0,0,0,.45); font-size: 15px; color: var(--muted); display: none; }
.consent.show { display: block; }
.consent .row { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.consent button { font: inherit; font-size: 14px; font-weight: 700; border-radius: 999px; padding: 8px 16px; cursor: pointer; border: 1px solid var(--line); background: transparent; color: var(--text); }
.consent button.accept { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.mt0 { margin-top: 0; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── Study cards (research page) ── */
.studies { display: grid; gap: 12px; margin: 20px 0; }
.study { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; }
.study-year { display: inline-block; font-size: 13px; font-weight: 700; color: var(--accent); background: rgba(52,208,88,.12); border-radius: 999px; padding: 2px 10px; margin-bottom: 8px; }
.study h3 { font-size: 17px; margin: 0 0 8px; }
.study p { font-size: 16px; margin: 0 0 6px; }
.study p:last-child { margin-bottom: 0; }

/* ── Real logo + hero app shot ── */
.brand img.logo { width: 30px; height: 30px; border-radius: 7px; }
.hero .app-icon { width: 72px; height: 72px; border-radius: 16px; margin: 0 auto 18px; box-shadow: 0 8px 30px rgba(0,0,0,.45); }
.hero-shot { display: block; max-width: 980px; margin: 36px auto 0; }
.hero-shot img { width: 100%; height: auto; }

/* ── Animated app icon (hero) ── */
.fan-icon { position: relative; width: 112px; height: 112px; margin: 0 auto 22px; border-radius: 25px; overflow: hidden; box-shadow: 0 12px 40px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.06); }
.fan-icon img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.fan-icon .blades { transform-origin: var(--hub-x, 51.1%) var(--hub-y, 51.3%); animation: fan-spin-up 2s cubic-bezier(.33,0,.67,.33) 1, fan-spin .5s linear 2s infinite; }
@keyframes fan-spin-up { from { transform: rotate(0deg); } to { transform: rotate(720deg); } }
@keyframes fan-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .fan-icon .blades { animation: none; } }
.fan-icon-sm { width: 30px; height: 30px; margin: 0; border-radius: 7px; box-shadow: none; flex: none; }
.fan-icon-sm .blades { animation: fan-spin 3s linear infinite; }
.brand:hover .fan-icon-sm .blades { animation-duration: .6s; }
