/* Fall Back Sleep — quiet night look: indigo accent, soft moonlight wash */
:root {
  --ink: #1d2138;
  --muted: #5a6076;
  --accent: #3d4c9e;
  --accent-deep: #27336e;
  --accent-soft: #eceefb;
  --bg: #ffffff;
  --wash: #f4f5fc;
  --line: #dce0f2;
  --radius: 10px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
}
.wrap { max-width: 820px; margin: 0 auto; padding: 0 22px; }

/* ---- sticky header ---- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.97);
  border-bottom: 1px solid var(--line);
  padding: 13px 0;
}
.site-header .wrap {
  display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap;
}
.brand {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: 10px;
}
.brand img { width: 30px; height: 30px; border-radius: 7px; }
.tagline { color: var(--muted); margin: 0; font-size: .92rem; }

/* ---- hero ---- */
main { padding: 0 0 56px; }
.hero {
  position: relative;
  margin: 26px 0 8px;
  padding: 54px 46px;
  border-radius: 16px;
  color: #fff;
  overflow: hidden;
  background:
    radial-gradient(1100px 320px at 88% -10%, rgba(255,255,255,.16), transparent 60%),
    linear-gradient(135deg, var(--accent-deep) 0%, var(--accent) 68%, #5a6cc0 100%);
}
.hero img.hero-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: .26;
}
.hero .hero-copy { position: relative; z-index: 1; }
.eyebrow {
  display: inline-block;
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.38);
  padding: 6px 14px;
  border-radius: 999px;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.12;
  letter-spacing: -0.025em;
  margin: 16px 0 14px;
  max-width: 16em;
}
.hero p { color: rgba(255,255,255,.92); font-size: 1.06rem; max-width: 40em; margin: 0 0 20px; }
.cta {
  display: inline-block;
  background: #fff;
  color: var(--accent-deep);
  font-weight: 700;
  text-decoration: none;
  padding: 13px 26px;
  border-radius: 999px;
  transition: transform .18s ease, box-shadow .18s ease;
}
.cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0,0,0,.28);
}
.intro { margin: 24px 0 8px; }
.intro p { color: var(--muted); font-size: 1.05rem; }

/* ---- guide list ---- */
.posts h2 {
  font-size: 1.3rem;
  margin: 46px 0 18px;
  letter-spacing: -0.01em;
  display: flex; align-items: center; gap: 14px;
}
.posts h2::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.card {
  position: relative;
  display: flex;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 14px;
  background: #fff;
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(61,76,158,.14);
  border-color: #b9c1e6;
}
.card .thumb { flex: 0 0 180px; min-height: 132px; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .card-body { padding: 16px 20px; }
.badge {
  display: inline-block;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 4px 13px;
}
.card h3 { margin: 8px 0 6px; font-size: 1.15rem; letter-spacing: -0.01em; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card:hover h3 a { color: var(--accent); }
.card p { margin: 0; color: var(--muted); font-size: .95rem; }

/* ---- articles ---- */
.post { padding-top: 30px; }
.post h1 {
  font-size: clamp(1.7rem, 4vw, 2.3rem);
  line-height: 1.2;
  letter-spacing: -0.025em;
  margin: 18px 0 12px;
}
.meta {
  display: inline-block;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: .85rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 5px 15px;
  margin-bottom: 26px;
}
.post h2 {
  font-size: 1.35rem;
  margin: 40px 0 14px;
  letter-spacing: -0.01em;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--wash);
  position: relative;
}
.post h2::after {
  content: "";
  position: absolute; left: 0; bottom: -2px;
  width: 60px; height: 2px;
  background: var(--accent);
}
.post .post-img {
  width: 100%;
  border-radius: 12px;
  margin: 18px 0 6px;
  border: 1px solid var(--line);
}
.post-figure { margin: 1.75rem auto; max-width: 100%; }
.post-figure img { display: block; max-width: 100%; height: auto; border-radius: 8px; }
.post-figure figcaption { margin-top: 0.5rem; font-size: 0.85em; color: #666; }
.post table { border-collapse: collapse; width: 100%; margin: 18px 0; }
.post th, .post td { border: 1px solid var(--line); padding: 9px 13px; text-align: left; }
.post th { background: var(--wash); }
.post ul li, .post ol li { margin-bottom: 8px; }
.back {
  display: inline-block;
  margin-bottom: 22px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  font-size: .95rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 18px;
  transition: border-color .18s ease, background .18s ease;
}
.back:hover { border-color: var(--accent); background: var(--wash); text-decoration: none; }
.callout {
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 14px 18px;
  margin: 22px 0;
}
.callout p { margin: 0; }
.callout strong { color: var(--accent-deep); }
.safety {
  background: #fef2f2;
  border-left: 4px solid #b91c1c;
  border-radius: 0 8px 8px 0;
  padding: 14px 18px;
  margin: 22px 0;
}
.safety p { margin: 0; }
.safety strong { color: #991b1b; }
.prev-next { display: flex; justify-content: space-between; gap: 12px; margin-top: 36px; flex-wrap: wrap; }
.prev-next a { color: var(--accent); text-decoration: none; font-weight: 600; }
.prev-next a:hover { text-decoration: underline; }

/* ---- bedtime shift planner (tool) ---- */
.planner {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--wash);
  padding: 22px 24px;
  margin: 26px 0;
}
.planner h2 { margin-top: 0; border-bottom: none; padding-bottom: 0; }
.planner h2::after { display: none; }
.planner label { font-weight: 600; display: block; margin: 12px 0 4px; }
.planner input, .planner select {
  width: 100%;
  max-width: 320px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  color: var(--ink);
  background: #fff;
}
.planner input:focus, .planner select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(61,76,158,.15);
}
.planner button {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  border: none;
  border-radius: 999px;
  padding: 12px 28px;
  cursor: pointer;
  margin-top: 16px;
}
.planner button:hover { background: var(--accent-deep); }
.planner .result { margin-top: 18px; }
.planner .result table { background: #fff; }

/* ---- footer ---- */
.site-footer {
  background: var(--wash);
  border-top: 3px solid var(--accent);
  padding: 26px 0 36px;
  color: var(--muted);
  font-size: 0.9rem;
}
.site-footer .ai-disclosure { font-size: .85em; opacity: .85; }
.footer-nav a { color: var(--muted); text-decoration: none; font-weight: 600; }
.footer-nav a:hover { color: var(--accent); }

/* ---- site nav (sticky header) ---- */
.site-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: .92rem;
}
.site-nav a { color: var(--muted); text-decoration: none; font-weight: 600; }
.site-nav a:hover { color: var(--accent); }
.site-nav a.active { color: var(--accent); border-bottom: 2px solid var(--accent); padding-bottom: 1px; }

/* ---- contact form ---- */
#contact-form { max-width: 34rem; margin: 24px 0; }
#contact-form label { font-weight: 600; }
#contact-form input,
#contact-form textarea {
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  color: var(--ink);
  background: #fff;
}
#contact-form input:focus,
#contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(61,76,158,.15);
}
#contact-form button {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  border: none;
  border-radius: 999px;
  padding: 12px 28px;
  cursor: pointer;
}
#contact-form button:hover { background: var(--accent-deep); }
#cf-note { color: var(--accent); font-weight: 600; }

/* Ad slot placeholder — style only applies once real ad code is pasted */
.ad-slot {
  border: 1px dashed var(--line);
  color: var(--muted);
  text-align: center;
  padding: 12px;
  margin: 24px 0;
  font-size: 0.85rem;
  display: none;
}

/* ---- mobile ---- */
@media (max-width: 640px) {
  .wrap { padding: 0 18px; }
  .tagline { display: none; }
  .hero { margin: 16px 0 4px; padding: 38px 26px; border-radius: 12px; }
  .card { flex-direction: column; }
  .card .thumb { flex: none; min-height: 0; }
  .card .thumb img { height: 160px; }
}
