/* The Reading Room — the blog's one stylesheet.
   It carries the site palette from index.html (--bg/--fg/--gold/--ember/--stone)
   so a post reads as the same house as the front page, with none of the
   front page's scroll machinery: these are documents, and they load flat.
   No build step. Edit this file, commit, push. */

:root{
  --bg:#0E0B08;
  --panel:#15100B;
  --fg:#F3EAD8;
  --gold:#E7B864;
  --ember:#DA8E48;
  --stone:#AA9D89;
  --rule:color-mix(in srgb,var(--fg) 15%,transparent);
  --measure:34rem;
}

*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;scroll-behavior:smooth}
@media (prefers-reduced-motion:reduce){html{scroll-behavior:auto}
  *{animation-duration:.01ms!important;transition-duration:.01ms!important}}

body{
  margin:0;
  background:var(--bg);
  color:var(--fg);
  font-family:'Archivo',system-ui,-apple-system,'Segoe UI',sans-serif;
  font-size:clamp(1.02rem,.38vw + .94rem,1.14rem);
  line-height:1.72;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}
img{display:block;max-width:100%;height:auto}
a{color:var(--gold);text-decoration:none}
a:hover{color:var(--ember)}
::selection{background:rgba(231,184,100,.28)}

:focus-visible{outline:2px solid var(--gold);outline-offset:3px;border-radius:2px}

.skip{position:absolute;left:-9999px;top:0;background:var(--gold);color:#17130F;
  padding:10px 16px;font-weight:600;z-index:99}
.skip:focus{left:12px;top:12px}

/* ---------- masthead ---------- */
.masthead{
  display:flex;align-items:center;justify-content:space-between;gap:20px;
  padding:18px clamp(20px,5vw,56px);
  border-bottom:1px solid var(--rule);
  position:sticky;top:0;z-index:40;
  background:color-mix(in srgb,var(--bg) 92%,transparent);
  backdrop-filter:blur(8px);
}
.masthead .wordmark{display:flex;align-items:center;gap:11px;color:var(--fg)}
.masthead .wordmark img{width:34px;height:34px;object-fit:contain}
.masthead .wordmark span{
  font-family:'Fraunces',Georgia,serif;
  font-variation-settings:'opsz' 40,'wght' 500,'WONK' 1;
  font-size:1.06rem;letter-spacing:.01em;
}
.masthead .to-app{
  font-size:14px;letter-spacing:.04em;color:#17130F;background:var(--gold);
  padding:9px 17px;border-radius:2px;font-weight:600;white-space:nowrap;
  transition:background .3s,transform .4s cubic-bezier(.16,.7,.3,1);
}
.masthead .to-app:hover{background:var(--ember);color:#17130F;transform:translateY(-1px)}

/* ---------- shared layout ---------- */
.wrap{max-width:1180px;margin:0 auto;padding:0 clamp(20px,5vw,56px)}
.kicker{
  margin:0 0 14px;font-size:12px;letter-spacing:.26em;text-transform:uppercase;
  color:var(--gold);font-weight:700;
}
.rule{border:0;border-top:1px solid var(--rule);margin:clamp(44px,7vh,78px) 0}

h1,h2,h3{font-family:'Fraunces',Georgia,serif;font-weight:400;color:var(--fg)}
h1{
  font-variation-settings:'opsz' 120,'wght' 380,'WONK' 1;
  font-size:clamp(2.1rem,5.4vw,3.6rem);line-height:1.08;letter-spacing:-.01em;
  margin:0 0 20px;text-wrap:balance;
}
h2{
  font-variation-settings:'opsz' 70,'wght' 420,'WONK' 1;
  font-size:clamp(1.5rem,2.9vw,2.1rem);line-height:1.2;
  margin:clamp(40px,5.5vh,64px) 0 16px;text-wrap:balance;
}
h3{
  font-variation-settings:'opsz' 40,'wght' 500;
  font-size:clamp(1.18rem,1.9vw,1.38rem);line-height:1.3;
  margin:34px 0 10px;
}

/* ---------- index ---------- */
.room-head{padding:clamp(56px,10vh,110px) 0 clamp(34px,5vh,58px);max-width:46rem}
.room-head p.lede{
  font-family:'Fraunces',Georgia,serif;
  font-variation-settings:'opsz' 60,'wght' 340,'ital' 1;
  font-style:italic;
  font-size:clamp(1.18rem,2.2vw,1.55rem);line-height:1.46;
  color:color-mix(in srgb,var(--fg) 88%,transparent);margin:0;
}
.cards{
  display:grid;gap:clamp(20px,2.6vw,34px);
  grid-template-columns:repeat(auto-fill,minmax(290px,1fr));
  padding-bottom:clamp(56px,9vh,100px);list-style:none;margin:0;
}
.card{
  display:flex;flex-direction:column;background:var(--panel);
  border:1px solid var(--rule);border-radius:3px;overflow:hidden;
  transition:transform .5s cubic-bezier(.16,.7,.3,1),border-color .4s;
}
.card:hover{transform:translateY(-3px);border-color:color-mix(in srgb,var(--gold) 45%,transparent)}
.card a.card-link{display:block;color:inherit}
.card img{aspect-ratio:3/2;object-fit:cover;width:100%}
.card-body{padding:22px clamp(20px,2vw,26px) 26px;display:flex;flex-direction:column;flex:1}
.card-body h2{margin:0 0 10px;font-size:1.32rem;font-variation-settings:'opsz' 40,'wght' 480,'WONK' 1}
.card-body h2 a{color:var(--fg)}
.card-body h2 a:hover{color:var(--gold)}
.card-body p{margin:0 0 16px;font-size:.97rem;line-height:1.62;
  color:color-mix(in srgb,var(--fg) 76%,transparent)}
.card-body .tag{margin-top:auto;font-size:11.5px;letter-spacing:.2em;
  text-transform:uppercase;color:var(--stone)}

/* ---------- article ---------- */
.post-head{padding:clamp(48px,8vh,96px) 0 0}
.post-head .inner{max-width:48rem}
.standfirst{
  font-family:'Fraunces',Georgia,serif;
  font-variation-settings:'opsz' 60,'wght' 330,'ital' 1;
  font-style:italic;
  font-size:clamp(1.14rem,2vw,1.42rem);line-height:1.5;
  color:color-mix(in srgb,var(--fg) 86%,transparent);
  margin:0 0 26px;max-width:40rem;
}
.byline{
  margin:0;font-size:13px;letter-spacing:.07em;text-transform:uppercase;
  color:var(--stone);
}
.byline a{color:var(--stone);text-decoration:underline;text-underline-offset:3px}
.byline a:hover{color:var(--gold)}
figure.hero{margin:clamp(32px,5vh,52px) 0 0}
figure.hero img{width:100%;border-radius:3px}
figure.hero figcaption,figure.inline figcaption{
  margin-top:10px;font-size:13px;color:var(--stone);line-height:1.5;
}

.prose{max-width:var(--measure);margin:clamp(34px,5vh,54px) 0 0}
.prose p{margin:0 0 1.35em}
.prose p.first::first-letter{
  float:left;font-family:'Fraunces',Georgia,serif;
  font-variation-settings:'opsz' 144,'wght' 400,'WONK' 1;
  font-size:3.6em;line-height:.82;padding:.06em .1em 0 0;color:var(--gold);
}
.prose ul,.prose ol{margin:0 0 1.35em;padding-left:1.25em}
.prose li{margin:0 0 .6em}
.prose li::marker{color:var(--gold)}
.prose strong{font-weight:600;color:var(--fg)}
.prose em{font-style:italic}
.prose a{text-decoration:underline;text-underline-offset:3px;
  text-decoration-color:color-mix(in srgb,var(--gold) 45%,transparent)}
.prose a:hover{text-decoration-color:var(--ember)}

blockquote{
  margin:clamp(30px,4vh,44px) 0;padding:2px 0 2px 24px;
  border-left:2px solid color-mix(in srgb,var(--gold) 60%,transparent);
  font-family:'Fraunces',Georgia,serif;
  font-variation-settings:'opsz' 60,'wght' 340,'ital' 1;
  font-style:italic;font-size:clamp(1.1rem,1.8vw,1.3rem);line-height:1.48;
  color:color-mix(in srgb,var(--fg) 90%,transparent);
}
blockquote p{margin:0}

/* the room list inside a course post */
.rooms{list-style:none;padding:0;margin:0 0 1.6em}
.rooms li{
  display:grid;grid-template-columns:2.4rem 1fr;gap:14px;
  padding:15px 0;border-top:1px solid var(--rule);margin:0;
}
.rooms li:last-child{border-bottom:1px solid var(--rule)}
.rooms .n{
  font-family:'Fraunces',Georgia,serif;font-variation-settings:'opsz' 40,'wght' 400;
  color:var(--gold);font-size:1.05rem;line-height:1.5;
}
.rooms .t{margin:0;font-weight:600;line-height:1.45}
.rooms .d{margin:3px 0 0;font-size:.95rem;line-height:1.55;
  color:color-mix(in srgb,var(--fg) 72%,transparent)}

/* ---------- call to action ---------- */
.cta{
  max-width:var(--measure);margin:clamp(40px,6vh,68px) 0;
  padding:clamp(26px,3.4vw,36px);background:var(--panel);
  border:1px solid color-mix(in srgb,var(--gold) 30%,transparent);
  border-radius:3px;
}
.cta p.kicker{margin-bottom:10px}
.cta h2{margin:0 0 12px;font-size:clamp(1.3rem,2.3vw,1.72rem)}
.cta p{margin:0 0 20px;color:color-mix(in srgb,var(--fg) 82%,transparent);font-size:1rem}
.cta .price{color:var(--gold);font-weight:600}
.btn{
  display:inline-flex;align-items:center;gap:10px;background:var(--gold);
  color:#17130F;font-weight:600;letter-spacing:.01em;font-size:1rem;
  padding:13px 24px;border-radius:2px;
  transition:transform .5s cubic-bezier(.16,.7,.3,1),background .3s;
}
.btn:hover{background:var(--ember);color:#17130F;transform:translateY(-2px)}
.btn svg{flex:0 0 auto}
.cta .fineprint{margin:14px 0 0;font-size:.86rem;color:var(--stone)}

/* ---------- faq ---------- */
.faq{max-width:var(--measure)}
.faq details{border-top:1px solid var(--rule);padding:4px 0}
.faq details:last-of-type{border-bottom:1px solid var(--rule)}
.faq summary{
  cursor:pointer;list-style:none;padding:16px 28px 16px 0;position:relative;
  font-weight:600;line-height:1.5;
}
.faq summary::-webkit-details-marker{display:none}
.faq summary::after{
  content:"+";position:absolute;right:2px;top:50%;transform:translateY(-50%);
  color:var(--gold);font-size:1.3rem;line-height:1;
}
.faq details[open] summary::after{content:"–"}
.faq details p{margin:0 0 18px;color:color-mix(in srgb,var(--fg) 80%,transparent);
  font-size:.99rem}

/* ---------- related ---------- */
.related{max-width:var(--measure)}
.related ul{list-style:none;padding:0;margin:0}
.related li{border-top:1px solid var(--rule);padding:15px 0}
.related li:last-child{border-bottom:1px solid var(--rule)}
.related a{font-weight:600}
.related span{display:block;font-size:.93rem;color:var(--stone);margin-top:3px}

/* ---------- footer ---------- */
.foot{
  border-top:1px solid var(--rule);margin-top:clamp(56px,9vh,110px);
  padding:clamp(40px,6vh,66px) 0 clamp(44px,6vh,70px);
}
.foot .line{
  font-family:'Fraunces',Georgia,serif;
  font-variation-settings:'opsz' 90,'wght' 380,'WONK' 1;
  font-size:clamp(1.3rem,2.6vw,1.9rem);line-height:1.2;color:var(--gold);margin:0;
}
.foot nav{display:flex;flex-wrap:wrap;gap:20px;margin:18px 0 0}
.foot nav a{font-size:14px;color:var(--fg);opacity:.72}
.foot nav a:hover{opacity:1;color:var(--gold)}
.foot .small{margin:20px 0 0;font-size:13px;color:var(--stone)}

/* ---------- narrow screens ----------
   The masthead is sticky, so it stays cheap: the wordmark holds one line and
   the button loses its padding before the two of them start wrapping. */
@media (max-width:560px){
  .masthead{padding:13px 16px;gap:12px}
  .masthead .wordmark{gap:9px;min-width:0}
  .masthead .wordmark img{width:28px;height:28px}
  .masthead .wordmark span{font-size:.92rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .masthead .to-app{font-size:13px;padding:8px 13px}
  .wrap{padding:0 16px}
  .rooms li{grid-template-columns:1.9rem 1fr;gap:10px}
  .prose p.first::first-letter{font-size:3.1em}
  blockquote{padding-left:18px}
}

/* ---------- the doorway ----------
   The same door that stands in the app's chamber, carried over so a reader
   crosses one threshold rather than clicking a button that looks like every
   other button. The arch, the stone ring, the two leaves and the light are
   the app's (public/styles.css); the leaf art is the same file. On hover the
   leaves part a little; on click door.js swings them open and the light comes
   through before the browser follows the link. */
.cta-door{display:grid;grid-template-columns:1fr auto;gap:clamp(24px,4vw,46px);align-items:center}
.cta-door .cta-words{min-width:0}
.cta-door .cta-words > *:last-child{margin-bottom:0}

.doorway{
  display:flex;flex-direction:column;align-items:center;text-align:center;
  color:var(--fg);text-decoration:none;width:clamp(150px,22vw,180px);
  -webkit-tap-highlight-color:transparent;
}
.doorway:hover{color:var(--fg)}
.doorway:focus-visible{outline:none}
.doorway .door-glyph{
  font-family:'Fraunces',Georgia,serif;font-size:1.4rem;line-height:1;
  color:var(--gold);text-shadow:0 0 14px rgba(231,184,100,.6);margin-bottom:10px;
}
.doorway .door-wrap{display:block;width:100%;filter:drop-shadow(0 22px 26px rgba(0,0,0,.75))}
.doorway .door-arch{
  position:relative;display:block;width:100%;aspect-ratio:.64;background:#120c07;
  perspective:600px;
  border-radius:50% 50% 4px 4px / 30% 30% 4px 4px;
  clip-path:inset(0 round 50% 50% 4px 4px / 30% 30% 4px 4px);
}
/* The stone ring, drawn over the leaves. */
.doorway .door-arch::after{
  content:"";position:absolute;inset:0;z-index:2;border-radius:inherit;pointer-events:none;
  box-shadow:inset 0 0 0 4px #4d3c2b, inset 0 0 0 5px rgba(231,184,100,.35),
             inset 0 0 0 7px rgba(0,0,0,.55), inset 0 14px 24px rgba(0,0,0,.55);
  transition:box-shadow .3s;
}
.doorway .door-art{
  position:absolute;inset:0;width:100%;height:100%;object-fit:cover;
  transform:scale(1.15);filter:brightness(.5) saturate(.85);
  transition:transform 1.3s cubic-bezier(.2,.7,.2,1),filter 1s ease;
}
.doorway .door-light{
  position:absolute;inset:0;opacity:0;mix-blend-mode:screen;
  background:radial-gradient(60% 50% at 50% 62%,rgba(255,192,104,.6),transparent 72%);
  transition:opacity .9s ease;
}
.doorway .door-leaf{
  position:absolute;top:0;bottom:0;width:50%;background-size:100% 100%;
  backface-visibility:hidden;transition:transform .95s cubic-bezier(.55,.05,.25,1);
}
.doorway .door-leaf.l{left:0;background-image:url(/img/chamber/leaf-left.webp);transform-origin:left center}
.doorway .door-leaf.r{right:0;background-image:url(/img/chamber/leaf-right.webp);transform-origin:right center}
@media (hover:hover){
  .doorway:hover .door-leaf.l{transform:rotateY(-16deg)}
  .doorway:hover .door-leaf.r{transform:rotateY(16deg)}
  .doorway:hover .door-light{opacity:.55}
}
.doorway:focus-visible .door-arch::after{
  box-shadow:inset 0 0 0 4px #4d3c2b, inset 0 0 0 6px var(--gold), inset 0 14px 24px rgba(0,0,0,.55);
}
.doorway.opening .door-leaf.l{transform:rotateY(-106deg)}
.doorway.opening .door-leaf.r{transform:rotateY(106deg)}
.doorway.opening .door-art{transform:scale(1);filter:brightness(1.05) saturate(1)}
.doorway.opening .door-light{opacity:1}
.doorway .door-name{
  font-family:'Fraunces',Georgia,serif;font-size:1.04rem;line-height:1.2;
  margin-top:14px;text-shadow:0 1px 10px #000;
}
.doorway .door-state{
  font-size:10.5px;letter-spacing:.16em;text-transform:uppercase;color:var(--gold);
  margin-top:5px;text-shadow:0 1px 8px #000;
}
@media (prefers-reduced-motion:reduce){
  .doorway .door-leaf,.doorway .door-art,.doorway .door-light{transition:none}
}
@media (max-width:680px){
  .cta-door{grid-template-columns:1fr;justify-items:center;text-align:center}
  .cta-door .cta-words{text-align:left}
  .doorway{width:min(190px,62vw)}
}
