/* ============================================================
   My Restful Sleep — shared styles (blog)
   Mirrors the tokens used on the homepage.
   ============================================================ */
:root{
  --paper:#FAF6EF; --paper-2:#F3EBE0; --paper-3:#EFE4D6; --card:#FFFCF7;
  --ink:#241C26; --ink-2:#5A4E5C; --ink-3:#6F6272;
  --line:rgba(36,28,38,.11); --line-2:rgba(36,28,38,.06);
  --plum:#6B4A5E; --plum-deep:#533A49; --plum-tint:rgba(107,74,94,.08);
  --blush:#EFDDE1; --sage:#7E9481; --sage-tint:rgba(126,148,129,.14);
  --night:#221D2E; --night-ink:#F2EAE0; --night-ink-2:#BBAEC4; --night-line:rgba(242,234,224,.16);
  --display:"Instrument Serif","Iowan Old Style",Georgia,"Times New Roman",serif;
  --sans:"Figtree",-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif;
  --r-sm:10px; --r:14px; --r-lg:20px; --r-xl:28px;
  --maxw:clamp(1180px, 40.6vw + 660px, 1440px); --gut:clamp(20px,5vw,48px);
  --ease:cubic-bezier(.22,.72,.24,1);
  --shadow-sm:0 1px 3px rgba(36,28,38,.04), 0 10px 24px -18px rgba(36,28,38,.20);
  --shadow:0 2px 8px rgba(36,28,38,.05), 0 26px 56px -38px rgba(36,28,38,.30);
  --sec-y:clamp(56px,8vw,96px);
}
*,*::before,*::after{ box-sizing:border-box; }
html{ -webkit-text-size-adjust:100%; scroll-behavior:smooth; scroll-padding-top:96px; }
@media (prefers-reduced-motion:reduce){ html{ scroll-behavior:auto; } }
body{ margin:0; background:var(--paper); color:var(--ink); font-family:var(--sans);
  font-size:clamp(17px, 0.39vw + 12px, 19.5px); line-height:1.65; -webkit-font-smoothing:antialiased; overflow-x:hidden; }
body::before{ content:""; position:fixed; inset:0; z-index:0; pointer-events:none; opacity:.4;
  mix-blend-mode:multiply;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.16'/%3E%3C/svg%3E"); }
img{ max-width:100%; height:auto; display:block; }
figure,blockquote{ margin:0; }
a{ color:inherit; }
:focus-visible{ outline:3px solid var(--plum); outline-offset:3px; border-radius:4px; }
h1,h2,h3,h4{ margin:0; font-weight:400; letter-spacing:-.015em; }
h1,h2,h3{ font-family:var(--display); line-height:1.06; }
h1{ font-size:clamp(2.2rem,4.8vw,3.6rem); letter-spacing:-.026em; }
h2{ font-size:clamp(1.7rem,3.4vw,2.4rem); letter-spacing:-.02em; }
h3{ font-size:clamp(1.25rem,2.2vw,1.55rem); }
p{ margin:0 0 1.1em; } p:last-child{ margin-bottom:0; }
.lede{ font-size:clamp(1.05rem, 1.6vw, 1.32rem); line-height:1.62; color:var(--ink-2); max-width:60ch; }
.eyebrow{ font-size:.74rem; font-weight:600; letter-spacing:.16em; text-transform:uppercase;
  color:var(--plum); display:flex; align-items:center; gap:.65rem; margin:0 0 1rem; }
.eyebrow::before{ content:""; width:24px; height:1px; background:currentColor; opacity:.5; flex:none; }
.wrap{ width:100%; max-width:var(--maxw); margin-inline:auto; padding-inline:var(--gut); position:relative; z-index:1; }
.sec{ padding-block:var(--sec-y); }
.skip{ position:absolute; left:16px; top:-70px; z-index:200; background:var(--plum); color:#FFF9F2;
  padding:.8rem 1.2rem; border-radius:6px; text-decoration:none; font-weight:600; transition:top .2s var(--ease); }
.skip:focus{ top:16px; }

/* buttons */
.btn{ --bg:var(--plum); --fg:#FFF9F2; --bd:var(--plum);
  display:inline-flex; align-items:center; justify-content:center; gap:.55rem; min-height:52px;
  padding:.85rem 1.6rem; background:var(--bg); color:var(--fg); border:1px solid var(--bd);
  border-radius:6px; text-decoration:none; font-family:var(--sans); font-size:1rem; font-weight:600;
  cursor:pointer; touch-action:manipulation;
  transition:background .22s var(--ease), border-color .22s var(--ease), transform .18s var(--ease); }
.btn:hover{ background:var(--plum-deep); border-color:var(--plum-deep); }
.btn:active{ transform:translateY(1px); }
.btn .ico{ width:18px; height:18px; flex:none; }
.btn.ghost{ --bg:transparent; --fg:var(--ink); --bd:rgba(36,28,38,.22); }
.btn.ghost:hover{ background:var(--plum-tint); border-color:var(--plum); color:var(--plum-deep); }
.btn.light{ --bg:#FFF9F2; --fg:var(--night); --bd:#FFF9F2; }
.textlink{ display:inline-flex; align-items:center; gap:.4rem; min-height:44px; color:var(--plum);
  font-weight:600; text-decoration:none; border-bottom:1px solid rgba(107,74,94,.3); padding-bottom:2px;
  transition:border-color .2s var(--ease), color .2s var(--ease); }
.textlink:hover{ color:var(--plum-deep); border-bottom-color:var(--plum-deep); }
.textlink .ico{ width:15px; height:15px; transition:transform .22s var(--ease); }
.textlink:hover .ico{ transform:translateX(3px); }

/* header — same menu as the rest of the site */
.hdr{ position:sticky; top:0; z-index:100; background:rgba(250,246,239,.9);
  backdrop-filter:blur(14px) saturate(1.1); -webkit-backdrop-filter:blur(14px) saturate(1.1);
  border-bottom:1px solid transparent; transition:border-color .3s var(--ease), background .3s var(--ease); }
.hdr.stuck{ border-bottom-color:var(--line); background:rgba(250,246,239,.96); }
.hdr-in{ display:flex; align-items:center; gap:1.25rem; min-height:78px; padding-block:.7rem; }
.brand{ display:flex; align-items:center; text-decoration:none; margin-right:auto; flex:none; min-height:44px; }
.brand img{ width:184px; height:auto; }
@media (max-width:420px){ .brand img{ width:156px; } }
.nav{ display:flex; align-items:center; gap:.1rem; }
.nav a{ padding:.63rem .68rem; border-radius:6px; white-space:nowrap; min-height:44px;
  display:inline-flex; align-items:center; text-decoration:none; font-size:.89rem; font-weight:500;
  color:var(--ink-2); transition:color .2s var(--ease), background .2s var(--ease); }
.nav a:hover{ color:var(--ink); background:var(--plum-tint); }
.nav a.active{ background:var(--plum); color:#FFF9F2; font-weight:600; }
@media (min-width:941px) and (max-width:1080px){ .nav a{ font-size:.84rem; padding-inline:.52rem; } .brand img{ width:160px; } }
.burger{ display:none; width:46px; height:46px; flex:none; align-items:center; justify-content:center;
  gap:5px; flex-direction:column; background:transparent; border:1px solid var(--line);
  border-radius:8px; cursor:pointer; }
.burger span{ display:block; width:19px; height:1.6px; background:var(--ink); border-radius:2px;
  transition:transform .28s var(--ease), opacity .2s var(--ease); }
.burger[aria-expanded="true"] span:nth-child(1){ transform:translateY(6.6px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2){ opacity:0; }
.burger[aria-expanded="true"] span:nth-child(3){ transform:translateY(-6.6px) rotate(-45deg); }
@media (max-width:940px){
  .burger{ display:flex; }
  .nav{ position:absolute; left:0; right:0; top:100%; flex-direction:column; align-items:stretch;
    gap:0; background:var(--paper); border-bottom:1px solid var(--line);
    padding:.5rem var(--gut) 1.2rem; box-shadow:var(--shadow-sm); display:none; }
  .nav.open{ display:flex; }
  .nav a{ padding:.9rem .55rem; font-size:1.02rem; }
}

/* blog hero */
.bloghero{ position:relative; overflow:hidden; background:var(--night); color:var(--night-ink); }
.bloghero img{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; opacity:.42; }
.bloghero .wrap{ position:relative; z-index:2; padding-block:clamp(64px,9vw,120px); }
.bloghero h1{ color:var(--night-ink); max-width:18ch; }
.bloghero .lede{ color:var(--night-ink-2); margin-top:1.2rem; }
.bloghero .eyebrow{ color:#D9B8C6; }

/* filters */
.filters{ display:flex; flex-wrap:wrap; gap:.5rem; margin-bottom:2.4rem; }
.filters button{ min-height:44px; padding:.6rem 1rem; background:var(--card);
  border:1px solid var(--line); border-radius:6px; font-family:var(--sans); font-size:.9rem;
  font-weight:500; color:var(--ink-2); cursor:pointer; touch-action:manipulation;
  transition:background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease); }
.filters button:hover{ border-color:rgba(107,74,94,.4); color:var(--ink); }
.filters button[aria-pressed="true"]{ background:var(--plum); border-color:var(--plum); color:#FFF9F2; font-weight:600; }

/* cards */
.grid{ display:grid; gap:clamp(18px,2.4vw,26px); }
@media (min-width:640px){ .grid{ grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (min-width:1000px){ .grid{ grid-template-columns:repeat(3,minmax(0,1fr)); } }
.post-card{ display:flex; flex-direction:column; background:var(--card); border:1px solid var(--line);
  border-radius:var(--r-lg); overflow:hidden; text-decoration:none;
  transition:transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease); }
.post-card:hover{ transform:translateY(-4px); box-shadow:var(--shadow); border-color:rgba(107,74,94,.3); }
.post-card .thumb{ position:relative; aspect-ratio:3/2; overflow:hidden; background:var(--paper-2); }
.post-card .thumb img{ width:100%; height:100%; object-fit:cover; transition:transform .5s var(--ease); }
.post-card:hover .thumb img{ transform:scale(1.04); }
.post-card .body{ padding:1.3rem 1.35rem 1.5rem; display:flex; flex-direction:column; flex:1; }
.tag{ align-self:flex-start; font-size:.7rem; font-weight:700; letter-spacing:.12em;
  text-transform:uppercase; color:var(--plum); background:var(--plum-tint);
  padding:.3rem .6rem; border-radius:4px; margin-bottom:.85rem; }
.post-card h2{ font-size:clamp(1.22rem,1.9vw,1.45rem); line-height:1.18; margin-bottom:.55rem; }
.post-card p{ font-size:.93rem; color:var(--ink-2); line-height:1.55; }
.meta{ margin-top:auto; padding-top:1.1rem; font-size:.82rem; color:var(--ink-3);
  display:flex; align-items:center; gap:.5rem; }
.meta .dot{ width:3px; height:3px; border-radius:50%; background:currentColor; opacity:.6; }
.empty{ padding:3rem 0; color:var(--ink-3); }

/* article */
.article-hero img{ width:100%; aspect-ratio:16/7; object-fit:cover; border-radius:var(--r-lg); }
.crumb{ font-size:.86rem; color:var(--ink-3); margin-bottom:1.4rem; }
.crumb a{ display:inline-flex; align-items:center; min-height:44px; text-decoration:none; color:var(--plum); font-weight:600; }
.crumb a:hover{ text-decoration:underline; }
.article-head{ max-width:60rem; margin-inline:auto; text-align:left; }
.article-head h1{ margin-bottom:1rem; }
.prose{ max-width:68ch; margin-inline:auto; font-size:1.06rem; line-height:1.75; color:var(--ink-2); }
.prose h2{ font-size:clamp(1.5rem,2.6vw,1.95rem); color:var(--ink); margin:2.6rem 0 .9rem; }
.prose h3{ font-size:clamp(1.2rem,2vw,1.4rem); color:var(--ink); margin:2rem 0 .7rem; }
.prose p{ margin-bottom:1.25em; }
.prose strong{ color:var(--ink); }
.prose ul{ margin:0 0 1.5em; padding-left:1.15rem; display:grid; gap:.6rem; }
.prose li{ line-height:1.65; }
.prose li::marker{ color:var(--plum); }
.prose > *:first-child{ margin-top:0; }
.article-cta{ max-width:68ch; margin:3rem auto 0; background:var(--paper-2);
  border:1px solid var(--line); border-radius:var(--r-lg); padding:clamp(24px,3.4vw,36px); }
.article-cta h2{ margin-bottom:.6rem; }
.article-cta p{ color:var(--ink-2); font-size:.98rem; margin-bottom:1.4rem; }
.related{ border-top:1px solid var(--line); }

/* footer */
.site-foot{ background:var(--night); color:var(--night-ink-2); padding-block:clamp(44px,5vw,68px) 30px; }
.foot-grid{ display:grid; gap:clamp(26px,4vw,48px); grid-template-columns:minmax(0,1.4fr) repeat(2,minmax(0,1fr)); }
@media (max-width:760px){ .foot-grid{ grid-template-columns:minmax(0,1fr) minmax(0,1fr); } .foot-brand{ grid-column:1/-1; } }
@media (max-width:520px){ .foot-grid{ grid-template-columns:minmax(0,1fr); gap:30px; } }
.foot-brand img{ width:196px; filter:brightness(0) invert(1); opacity:.92; }
.foot-brand p{ margin-top:1rem; font-size:.9rem; max-width:38ch; line-height:1.6; }
.site-foot h4{ color:var(--night-ink); font-size:.76rem; letter-spacing:.14em; text-transform:uppercase;
  margin-bottom:.9rem; font-weight:600; font-family:var(--sans); }
.foot-links{ list-style:none; margin:0; padding:0; display:grid; gap:.1rem; }
.foot-links a{ display:inline-block; padding-block:.6rem; min-height:44px; text-decoration:none;
  font-size:.91rem; overflow-wrap:anywhere; transition:color .2s var(--ease); }
.foot-links a:hover{ color:var(--night-ink); }
.socials{ display:flex; gap:.55rem; margin-top:1.2rem; }
.socials a{ width:44px; height:44px; display:grid; place-items:center; border:1px solid var(--night-line);
  border-radius:8px; transition:background .2s var(--ease), border-color .2s var(--ease); }
.socials a:hover{ background:rgba(242,234,224,.1); border-color:rgba(242,234,224,.4); }
.socials .ico{ width:18px; height:18px; }
.foot-base{ margin-top:clamp(30px,4vw,48px); padding-top:22px; border-top:1px solid var(--night-line);
  display:flex; flex-wrap:wrap; gap:.7rem 1.6rem; justify-content:space-between; font-size:.82rem; }

.rv{ opacity:0; transform:translateY(16px); transition:opacity .6s var(--ease), transform .6s var(--ease); }
.rv.in{ opacity:1; transform:none; }
@media (prefers-reduced-motion:reduce){
  .rv{ opacity:1; transform:none; transition:none; }
  *,*::before,*::after{ animation-duration:.001ms !important; transition-duration:.001ms !important; }
}

/* ---------- sleep guides / shop ---------- */
.guides{ display:grid; gap:clamp(20px,3vw,32px); margin-top:2.8rem; }
@media (min-width:820px){ .guides{ grid-template-columns:repeat(2,minmax(0,1fr)); } }
.guide{
  display:flex; flex-direction:column; background:var(--card);
  border:1px solid var(--line); border-radius:var(--r-lg); overflow:hidden;
  transition:border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.guide:hover{ border-color:rgba(107,74,94,.3); box-shadow:var(--shadow-sm); }
.guide .cover{ position:relative; aspect-ratio:16/10; overflow:hidden; background:var(--paper-2); }
.guide .cover img{ width:100%; height:100%; object-fit:cover; }
.guide .cover .badge{
  position:absolute; left:14px; top:14px;
  background:rgba(34,29,46,.82); color:#FFF9F2; backdrop-filter:blur(6px);
  font-size:.7rem; font-weight:700; letter-spacing:.12em; text-transform:uppercase;
  padding:.35rem .7rem; border-radius:4px;
}
.guide .body{ padding:clamp(22px,2.8vw,30px); display:flex; flex-direction:column; flex:1; }
.guide h2{ font-size:clamp(1.35rem,2.2vw,1.7rem); line-height:1.16; margin-bottom:.5rem; }
.guide .sub{ font-size:.88rem; color:var(--ink-3); margin-bottom:1.1rem; }
.guide ul{ list-style:none; margin:0 0 1.5rem; padding:0; display:grid; gap:.6rem; }
.guide li{ display:flex; gap:.6rem; align-items:flex-start; font-size:.94rem; line-height:1.5; color:var(--ink-2); }
.guide li .ico{ width:16px; height:16px; flex:none; margin-top:4px; color:var(--sage); }
.guide .buy{
  margin-top:auto; padding-top:1.4rem; border-top:1px solid var(--line-2);
  display:flex; align-items:center; gap:1rem; flex-wrap:wrap;
}
.guide .cost{ font-family:var(--display); font-size:clamp(1.9rem,3.4vw,2.4rem);
  line-height:1; letter-spacing:-.03em; font-variant-numeric:tabular-nums; }
.guide .buy .btn{ margin-left:auto; }
@media (max-width:420px){ .guide .buy .btn{ margin-left:0; width:100%; } }

.guide-notes{ display:grid; gap:clamp(14px,2vw,20px); margin-top:clamp(30px,4vw,44px); }
@media (min-width:720px){ .guide-notes{ grid-template-columns:repeat(3,minmax(0,1fr)); } }
.guide-note{ display:flex; gap:.8rem; align-items:flex-start; }
.guide-note .ico{ width:20px; height:20px; color:var(--plum); flex:none; margin-top:2px; }
.guide-note b{ display:block; font-size:.95rem; font-weight:600; }
.guide-note span{ display:block; font-size:.85rem; color:var(--ink-3); line-height:1.5; margin-top:.15rem; }

/* ---------- free downloads ---------- */
.dls{ display:grid; gap:clamp(18px,2.6vw,28px); margin-top:2.8rem; }
@media (min-width:720px){ .dls{ grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (min-width:1040px){ .dls{ grid-template-columns:repeat(3,minmax(0,1fr)); } }
.dl{ display:flex; flex-direction:column; background:var(--card); border:1px solid var(--line);
  border-radius:var(--r-lg); overflow:hidden; transition:border-color .3s var(--ease), box-shadow .3s var(--ease); }
.dl:hover{ border-color:rgba(107,74,94,.3); box-shadow:var(--shadow-sm); }
.dl .cover{ position:relative; background:var(--paper-2); padding:clamp(18px,2.4vw,26px) clamp(18px,2.4vw,26px) 0; }
.dl .cover img{ width:100%; height:auto; border-radius:6px 6px 0 0;
  box-shadow:0 -1px 0 rgba(36,28,38,.06), 0 -12px 26px -14px rgba(36,28,38,.35);
  aspect-ratio:1000/700; object-fit:cover; object-position:50% 0; }
.dl .body{ padding:clamp(20px,2.6vw,26px); display:flex; flex-direction:column; flex:1; }
.dl h2{ font-size:clamp(1.2rem,1.9vw,1.4rem); line-height:1.2; margin-bottom:.5rem; }
.dl p{ font-size:.92rem; color:var(--ink-2); line-height:1.55; }
.dl .pages{ font-size:.76rem; font-weight:600; letter-spacing:.1em; text-transform:uppercase;
  color:var(--plum); background:var(--plum-tint); padding:.28rem .6rem; border-radius:4px;
  align-self:flex-start; margin-bottom:.8rem; }
.dl form{ margin-top:auto; padding-top:1.2rem; display:grid; gap:.5rem; }
.dl input[type=email]{ width:100%; min-height:48px; padding:.75rem .95rem; background:var(--paper);
  border:1px solid var(--line); border-radius:var(--r-sm); font-family:var(--sans); font-size:16px; color:var(--ink); }
.dl input[type=email]:focus{ border-color:var(--plum); box-shadow:0 0 0 3px var(--plum-tint); outline:none; }
.dl button{ min-height:48px; }
.dl .consent{ font-size:.76rem; color:var(--ink-3); line-height:1.45; margin-top:.1rem; }
.dl .ok{ font-size:.88rem; color:#4F6553; font-weight:600; display:none; }
.dl.sent .ok{ display:block; }
.dl.sent form > *:not(.ok){ display:none; }
.vh{ position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
