:root {
  --bg: #f7f6f2;
  --paper: rgba(255,255,255,.72);
  --paper-strong: #fffef9;
  --ink: #1d2227;
  --muted: #687078;
  --line: rgba(29,34,39,.11);
  --teal: #4f9d94;
  --teal-dark: #2f6f69;
  --violet: #7a6bc7;
  --amber: #f4b94f;
  --red: #c76262;
  --shadow: 0 18px 48px rgba(28,33,39,.08);
  --radius: 22px;
  --shell: min(1120px, calc(100% - 32px));
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 14% 5%, rgba(79,157,148,.12), transparent 28rem),
    radial-gradient(circle at 92% 14%, rgba(122,107,199,.10), transparent 24rem),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
}
a { color: inherit; }
img { max-width: 100%; height: auto; border-radius: 16px; }
.shell { width: var(--shell); margin-inline: auto; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 0 12px;
}
.brand {
  text-decoration: none;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-weight: 700;
  letter-spacing: -.03em;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
}
.brand span { color: var(--muted); font-weight: 500; }
.site-nav { display: flex; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }
.glass-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 8px 15px;
  border-radius: 14px;
  border: 1px solid rgba(29,34,39,.08);
  background: rgba(255,255,255,.5);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.85);
  text-decoration: none;
  font: 600 .86rem/1 "Space Grotesk", sans-serif;
  transition: transform .2s ease, box-shadow .25s ease, background .25s ease;
  overflow: hidden;
}
.glass-link:hover { transform: translateY(-2px); background: rgba(255,255,255,.9); }
.glass-link.is-active {
  color: #17312e;
  background: linear-gradient(145deg, rgba(118,218,204,.76), rgba(79,157,148,.36));
  border-color: rgba(47,111,105,.24);
  box-shadow:
    0 0 0 1px rgba(255,255,255,.6) inset,
    0 0 18px rgba(79,157,148,.24),
    0 10px 28px rgba(79,157,148,.14);
}



.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(250px, .65fr);
  gap: clamp(36px, 7vw, 90px);
  align-items: center;
  min-height: 66vh;
  padding: 70px 0 74px;
}
.eyebrow {
  margin: 0 0 12px;
  color: var(--teal-dark);
  font: 700 .76rem/1.2 "Space Grotesk", sans-serif;
  letter-spacing: .15em;
  text-transform: uppercase;
}
h1,h2,h3 {
  margin-top: 0;
  font-family: "Space Grotesk", Inter, sans-serif;
  line-height: 1.06;
  letter-spacing: -.045em;
}
.hero h1, .mooc-hero h1, .article h1 {
  margin-bottom: 24px;
  font-size: clamp(3rem, 8vw, 6.2rem);
  font-weight: 600;
}
.mooc-hero h1 { font-size: clamp(4rem, 10vw, 8rem); }
.article h1 { font-size: clamp(2.7rem, 7vw, 5.8rem); max-width: 980px; }
.lede {
  max-width: 720px;
  margin: 0;
  color: #485057;
  font-size: clamp(1.08rem, 2vw, 1.35rem);
  line-height: 1.7;
}
.hero-actions, .form-actions { display:flex; gap:10px; flex-wrap:wrap; margin-top:30px; }
.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  font: 600 .9rem/1 "Space Grotesk", sans-serif;
  text-decoration: none;
  cursor: pointer;
}
.btn.primary { background: var(--ink); color: white; border-color: var(--ink); }
.btn.ghost { background: rgba(255,255,255,.55); }
.btn.danger { background: #fff2f2; color: #8d3131; border-color: #eccaca; }
.btn.small { min-height: 36px; padding: 8px 11px; font-size:.8rem; }

.guide-stage {
  position: relative;
  min-height: 360px;
  display: grid;
  place-items: center;
  border-radius: 34px;
  background: linear-gradient(160deg, rgba(255,255,255,.62), rgba(255,255,255,.22));
  border: 1px solid rgba(255,255,255,.8);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.guide-stage::before {
  content:"";
  position:absolute;
  inset:18px;
  border-radius: 27px;
  border:1px dashed rgba(29,34,39,.1);
}





.flashlight-beam { position:absolute; }

.section { padding: 90px 0; }
.section-head { display:flex; justify-content:space-between; gap:25px; align-items:end; margin-bottom:34px; }
.section-head h2 { margin:0; font-size:clamp(2.1rem,5vw,4rem); }
.post-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px; }
.post-card, .empty-card {
  padding: 26px;
  border-radius: var(--radius);
  background: rgba(255,255,255,.62);
  border:1px solid rgba(255,255,255,.9);
  box-shadow: var(--shadow);
}
.post-card h3 { font-size:1.5rem; margin:7px 0 13px; }
.post-card h3 a { text-decoration:none; }
.post-date, .article-date { color:var(--muted); font-size:.78rem; letter-spacing:.05em; text-transform:uppercase; }
.post-perex, .article-perex {
  font-family: "Space Grotesk", Inter, sans-serif;
  color:#485057;
  font-size:1.03rem;
  line-height:1.7;
  font-weight:400;
}
.read-more { display:inline-block; margin-top:8px; color:var(--teal-dark); font-weight:600; text-decoration:none; }
.about { border-top:1px solid var(--line); }
.about-copy { max-width:780px; font-size:1.15rem; }
.site-footer {
  display:flex;
  justify-content:space-between;
  gap:16px;
  padding:34px 0 44px;
  color:var(--muted);
  font-size:.82rem;
  border-top:1px solid var(--line);
}
.site-footer a { color:inherit; }

.mooc-hero {
  min-height: 48vh;
  display:flex;
  align-items:end;
  justify-content:space-between;
  gap:40px;
  padding:80px 0 58px;
  border-bottom:1px solid var(--line);
}

@media (min-width:861px) {
  .mooc-hero {
    min-height:34vh;
    padding-top:38px;
    padding-bottom:52px;
  }
}

.journal-list { padding: 30px 0 100px; }

.article-shell { padding:80px 0 110px; }
.article { max-width:900px; margin:0 auto; }
.article-perex {
  font-size:clamp(1.2rem,2.5vw,1.55rem);
  margin:0 0 50px;
  padding-left:22px;
  border-left:3px solid rgba(79,157,148,.55);
}
.article-body { font-size:1.06rem; line-height:1.82; }
.article-perex, .article-body p {
  text-align:justify;
  text-justify:inter-word;
}
.article-body h2 { font-size:2.15rem; margin-top:2.2em; }
.article-body h3 { font-size:1.55rem; margin-top:1.8em; }
.article-body blockquote { margin:1.8em 0; padding:1px 0 1px 20px; border-left:3px solid var(--violet); color:#53565d; }
.article-body pre { overflow:auto; padding:18px; border-radius:16px; background:#1c2227; color:#f2f5f4; }
.article-body code { font-family: ui-monospace,SFMono-Regular,Consolas,monospace; }
.article-back { margin-top:55px; padding-top:25px; border-top:1px solid var(--line); }

.admin-page { background:#f4f5f2; }
.admin-header {
  width:min(1180px,calc(100% - 32px));
  margin:20px auto 0;
  padding:16px 20px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:20px;
  background:white;
  border:1px solid var(--line);
  border-radius:18px;
}
.admin-header nav { display:flex; gap:14px; flex-wrap:wrap; }
.admin-header nav a { text-decoration:none; font-size:.85rem; font-weight:600; }
.admin-shell { width:min(1180px,calc(100% - 32px)); margin:35px auto 90px; }
.admin-title-row { display:flex; align-items:end; justify-content:space-between; gap:20px; margin-bottom:28px; }
.admin-title-row h1 { margin:0; font-size:clamp(2rem,5vw,3.4rem); }
.admin-post-list { display:grid; gap:10px; }
.admin-post-row {
  display:flex;
  justify-content:space-between;
  gap:20px;
  align-items:center;
  padding:18px 20px;
  background:white;
  border:1px solid var(--line);
  border-radius:18px;
}
.admin-post-row h2 { margin:5px 0 2px; font-size:1.2rem; letter-spacing:-.02em; }
.admin-post-row p { margin:0; color:var(--muted); font-size:.82rem; }
.admin-actions { display:flex; align-items:center; gap:7px; flex-wrap:wrap; justify-content:flex-end; }
.admin-actions form { margin:0; }
.status-pill { display:inline-block; padding:4px 8px; border-radius:999px; font:700 .68rem/1 "Space Grotesk",sans-serif; text-transform:uppercase; }
.status-pill.published { background:#e1f4ef; color:#286e63; }
.status-pill.draft { background:#eeedf6; color:#645b96; }
.admin-form { display:grid; gap:20px; }
.admin-form label { display:grid; gap:7px; font:600 .86rem/1.4 "Space Grotesk",sans-serif; }
.admin-form label span, .admin-form small { color:var(--muted); font-weight:400; }
.admin-form input, .admin-form textarea, .admin-form select {
  width:100%;
  padding:13px 14px;
  border-radius:14px;
  border:1px solid rgba(29,34,39,.16);
  background:white;
  color:var(--ink);
  font:400 .95rem/1.6 Inter,sans-serif;
  outline:none;
}
.admin-form input:focus, .admin-form textarea:focus, .admin-form select:focus { border-color:rgba(79,157,148,.75); box-shadow:0 0 0 3px rgba(79,157,148,.12); }
.editor-form { max-width:960px; }
.form-grid.two { display:grid; grid-template-columns:1.4fr .6fr; gap:18px; }
.form-error { margin:0 0 20px; padding:12px 14px; border-radius:14px; background:#fff0f0; color:#8a3030; border:1px solid #f0cccc; }
.login-page { min-height:100vh; display:grid; place-items:center; padding:24px; }
.login-card { width:min(460px,100%); padding:34px; border-radius:24px; background:white; box-shadow:var(--shadow); border:1px solid var(--line); }
.login-card h1 { font-size:2.5rem; margin-bottom:24px; }
.login-card .brand { display:inline-block; margin-bottom:36px; }

@media (max-width: 860px) {
  .site-header { align-items:flex-start; flex-direction:column; }
  .site-nav { justify-content:flex-start; }
  .hero { grid-template-columns:1fr; min-height:auto; padding-top:45px; }
  .guide-stage { min-height:230px; }
  
  
  .flashlight-beam { width:140px; top:45px; }
  .post-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .mooc-hero { align-items:flex-end; }
  .form-grid.two { grid-template-columns:1fr; }
  .admin-post-row { align-items:flex-start; flex-direction:column; }
  .admin-actions { justify-content:flex-start; }
}

@media (max-width: 560px) {
  :root { --shell:min(100% - 22px,1120px); }
  .site-header { padding-top:16px; }
  .site-nav { width:100%; display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:6px; }
  .glass-link { justify-content:center; padding-inline:8px; font-size:.76rem; }
  .hero { gap:30px; padding:34px 0 55px; }
  .hero h1 { font-size:clamp(2.8rem,15vw,4.3rem); }
  .guide-stage { min-height:185px; border-radius:26px; }
  
  .section { padding:62px 0; }
  .mooc-hero { min-height:38vh; padding:55px 0 40px; }
  .mooc-hero h1 { font-size:clamp(3.5rem,21vw,5.7rem); }
  
  .article-shell { padding-top:50px; }
  .article h1 { font-size:clamp(2.5rem,13vw,4rem); }
  .site-footer { flex-direction:column; }
  .admin-header { align-items:flex-start; flex-direction:column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior:auto; }
  *, *::before, *::after { animation:none !important; transition:none !important; }
  
  .flashlight-beam { display:none; }
}

/* MOOC course context and progress */
.mooc-hero-copy { max-width: 790px; }
.course-strip { padding: 30px 0 8px; }
.course-card {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(280px, 1.1fr);
  gap: clamp(28px, 6vw, 72px);
  align-items: center;
  padding: clamp(24px, 4vw, 38px);
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 26px;
  background: rgba(255,255,255,.56);
  box-shadow: 0 14px 42px rgba(28,33,39,.055);
}
.course-label { margin:0 0 9px; color:var(--teal-dark); font:700 .7rem/1.2 "Space Grotesk",sans-serif; letter-spacing:.16em; }
.course-card h2 { margin:0 0 8px; font-size:clamp(1.8rem,4vw,3rem); }
.course-note { margin:0 0 12px; color:var(--muted); font-size:.9rem; }
.course-link { color:var(--teal-dark); font-weight:600; text-decoration:none; }
.course-progress-wrap { min-width:0; }
.course-progress-head { display:flex; justify-content:space-between; align-items:baseline; gap:20px; margin-bottom:10px; font-family:"Space Grotesk",sans-serif; }
.course-progress-head span { color:var(--muted); font-size:.82rem; }
.course-progress-head strong { font-size:1.2rem; }
.course-progress { height:10px; overflow:hidden; border-radius:999px; background:rgba(29,34,39,.08); box-shadow:inset 0 1px 2px rgba(29,34,39,.08); }
.course-progress > span { display:block; height:100%; border-radius:inherit; background:linear-gradient(90deg,var(--teal),#73cabb); box-shadow:0 0 18px rgba(79,157,148,.32); transition:width .45s ease; }
.course-progress-meta { display:flex; justify-content:space-between; gap:14px; margin-top:11px; color:var(--muted); font-size:.75rem; }
.course-progress-meta span:last-child { text-align:right; }
.journal-heading { padding: 46px 0 8px; }
.journal-heading h2 { margin:0; font-size:clamp(2.1rem,5vw,4rem); }
.form-success { margin:0 0 20px; padding:12px 14px; border-radius:14px; background:#edf8f3; color:#276858; border:1px solid #cce8dd; }
.progress-inputs { display:grid; grid-template-columns:1fr auto 1fr; gap:9px; align-items:center; }
.progress-inputs span { color:var(--muted); font-weight:700; }
.admin-note { max-width:960px; margin-top:32px; padding:20px 22px; border-radius:18px; background:rgba(255,255,255,.72); border:1px solid var(--line); color:var(--muted); }
.admin-note strong { color:var(--ink); }
.admin-note p { margin:.55em 0 0; }
@media (max-width: 760px) {
  .course-card { grid-template-columns:1fr; }
  .course-progress-meta { flex-direction:column; gap:4px; }
  .course-progress-meta span:last-child { text-align:left; }
}

/* Signature guide: every sprite retains the 324 × 324 source canvas. */
.hero.hero-split { grid-template-columns:minmax(240px,360px) minmax(0,1fr); gap:clamp(24px,4vw,56px); isolation:isolate; --light:0; }
.guide-stage-home { border:0; background:none; box-shadow:none; border-radius:0; overflow:visible; min-height:324px; }
.guide-stage-home::before { content:none; }
.sprite-scene { position:relative; width:100%; height:324px; display:grid; place-items:end center; }
.sheet-sprite { width:var(--sprite-size,324px); aspect-ratio:1; background:url('/assets/character/frame-15.webp') center / 100% 100% no-repeat; image-rendering:pixelated; position:relative; z-index:2; }
.home-sheet-sprite { --sprite-size:clamp(240px,27vw,324px); transform:translateX(0); }


.hero-copy-lit-target { position:relative; z-index:1; }
.hero-copy-lit-target::before { content:''; position:absolute; inset:0 -1% 26% -12%; z-index:-1; pointer-events:none; background:radial-gradient(ellipse at 32% 48%,rgba(255,226,139,.36),rgba(255,236,178,.17) 45%,transparent 72%); filter:blur(16px); opacity:var(--light); }
.hero-beam { display:block; top:var(--lens-y,106px); left:var(--lens-x,270px); width:var(--beam-length,420px); height:160px; transform:translateY(-50%) rotate(var(--beam-angle,-8deg)); transform-origin:left center; clip-path:none; background:none; filter:none; opacity:var(--light); transition:none; pointer-events:none; z-index:0; }
.hero-beam::before { content:''; position:absolute; inset:0; background:linear-gradient(90deg,rgba(255,231,155,.34),rgba(255,232,161,.16) 50%,transparent); clip-path:polygon(0 47%,100% 0,100% 100%,0 53%); filter:blur(9px); }
.hero-beam { filter:blur(5px); }
.mooc-mascot { flex:0 0 230px; min-height:230px; display:grid; place-items:end center; }
.mooc-sheet-sprite { --sprite-size:230px; background-image:url('/assets/character/frame-10.webp'); }
@media(min-width:761px) and (max-width:1100px) { .hero h1 { font-size:clamp(3.1rem,6.3vw,5rem); } .hero.hero-split { grid-template-columns:280px minmax(0,1fr); } .hero { padding:50px 0; } .home-sheet-sprite { --travel:-65px; } }
@media(max-width:760px) { .hero.hero-split { grid-template-columns:1fr; gap:12px; min-height:0; padding:34px 0 42px; } .hero-copy-lit-target { grid-row:1; } .hero h1 { font-size:clamp(2.8rem,12vw,4.3rem); }     .hero-copy-lit-target::before { inset:0 0 25%; } .mooc-hero { gap:20px; } .mooc-mascot { flex-basis:auto; min-height:164px; } .mooc-sheet-sprite { --sprite-size:164px; } }
@media(prefers-reduced-motion:reduce) { .home-sheet-sprite { transform:none; } }

@media(max-width:760px) { .mooc-hero { flex-direction:column; align-items:flex-start; } .mooc-mascot { align-self:flex-end; } }

/* Weighted entrance steps; idle breathing moves only the upper body. */
.sheet-sprite { transform-origin:50% 95%; }
.hero.is-walking .home-sheet-sprite { animation:signature-walk-v2 2.1s cubic-bezier(.22,.28,.55,1) both, signature-weight 640ms ease-in-out 3; }
@keyframes signature-walk-v2 { from { translate:var(--travel,-110px) 0; } to { translate:0 0; } }
@keyframes signature-weight {
  0%,100% { transform:translateY(0) rotate(0deg) scaleY(1); }
  25% { transform:translateY(-1.4px) rotate(.35deg) scaleY(1.003); }
  55% { transform:translateY(.5px) rotate(-.2deg) scaleY(.997); }
  78% { transform:translateY(-.6px) rotate(.15deg) scaleY(1.001); }
}
/* Retro idle breathing, refined:
   only the central upper torso/head moves. Arms, flashlight, legs and beam stay fixed. */
.sheet-sprite > .sprite-breath-part {
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  display:block;
  object-fit:contain;
  pointer-events:none;
  user-select:none;
  opacity:0;
  image-rendering:pixelated;
  transition:none;
}

/* Overlapping clips deliberately hide the seams around shoulders/waist.
   Static pieces sit above the moving chest/head slice, keeping both arms planted. */
.sheet-sprite > .sprite-breath-upper {
  clip-path:inset(0 42% 47% 27%);
  z-index:2;
}
.sheet-sprite > .sprite-breath-lower {
  clip-path:inset(47% 0 0 0);
  z-index:3;
}
.sheet-sprite > .sprite-breath-left {
  clip-path:inset(0 70% 42% 0);
  z-index:3;
}
.sheet-sprite > .sprite-breath-right {
  clip-path:inset(0 0 42% 55%);
  z-index:3;
}

/* Use the split construction only on the natural resting pose.
   Other animation frames continue to use the normal flicker-free full-frame buffer. */
.is-alive .home-sheet-sprite[data-frame="b15"]:not(.is-flashlight-shaking) > .sprite-frame-buffer.is-current,
.is-alive .mooc-sheet-sprite[data-frame="10"] > .sprite-frame-buffer.is-current {
  opacity:0;
}
.is-alive .home-sheet-sprite[data-frame="b15"]:not(.is-flashlight-shaking) > .sprite-breath-part,
.is-alive .mooc-sheet-sprite[data-frame="10"] > .sprite-breath-part {
  opacity:1;
}

/* A restrained, stepped 16-bit breathing cycle.
   No whole-sprite translation = flashlight lens and CSS beam remain perfectly aligned. */
.is-alive .home-sheet-sprite[data-frame="b15"]:not(.is-flashlight-shaking) > .sprite-breath-upper,
.is-alive .mooc-sheet-sprite[data-frame="10"] > .sprite-breath-upper {
  transform-origin:50% 48%;
  animation:signature-upper-breathe 4.15s steps(1,end) infinite;
}
@keyframes signature-upper-breathe {
  0%,100% { transform:translateY(0) scaleY(1); }
  22%     { transform:translateY(-.5px) scaleY(1.002); }
  42%     { transform:translateY(-1px) scaleY(1.005); }
  60%     { transform:translateY(-1px) scaleY(1.004); }
  78%     { transform:translateY(-.5px) scaleY(1.002); }
  90%     { transform:translateY(0) scaleY(.999); }
}
/* Mirror only MOOC's existing artwork: its three-quarter poses now look left. */
.mooc-sheet-sprite { transform:scaleX(-1); }
@media(max-width:760px) {
  .hero.hero-split { grid-template-columns:140px minmax(0,1fr); gap:10px 16px; align-items:center; }
  .hero-copy-lit-target { display:contents; }
  .hero-copy-lit-target::before { display:none; }
  .hero-copy-lit-target > .eyebrow { grid-column:2; grid-row:1; margin:0; font-size:.62rem; letter-spacing:.12em; }
  .hero-copy-lit-target > h1 { grid-column:2; grid-row:2; font-size:clamp(1.9rem,8vw,2.5rem); margin:0; position:relative; }
  .hero-copy-lit-target > h1::before { content:''; position:absolute; inset:-12%; z-index:-1; pointer-events:none; background:radial-gradient(ellipse,rgba(255,226,139,.3),transparent 72%); opacity:var(--light); }
  .hero-copy-lit-target > .lede { grid-column:1/-1; grid-row:3; margin-top:36px; }
  .hero-copy-lit-target > .hero-actions { grid-column:1/-1; grid-row:4; margin-top:10px; }
  .guide-stage-home { grid-column:1; grid-row:1/3; min-height:170px; align-self:center; }
  .sprite-scene { height:170px; padding:0; place-items:center; }
  .home-sheet-sprite { --sprite-size:152px; --travel:-16px; }
  
}
@media(prefers-reduced-motion:reduce) {
  .sheet-sprite,.hero-beam { animation:none!important; translate:0 0!important; }
  .sheet-sprite > .sprite-breath-part { display:none!important; opacity:0!important; animation:none!important; }
  .sheet-sprite > .sprite-frame-buffer.is-current { opacity:1!important; }
}
@media(max-width:760px) { .hero-copy-lit-target > h1::before { inset:-12% 0; } }

/* Homepage and MOOC retain their respective approved sprite families. */
.home-sheet-sprite { background-image:url('/assets/character/a-15.webp'); }


/* Off-screen entrance: prevent the settled sprite flashing before the intro starts. */
.guide-stage-home .home-sheet-sprite {
  visibility: hidden;
}
.guide-stage-home.intro-ready .home-sheet-sprite.buffers-ready {
  visibility: visible;
}

/* Homepage flashlight interaction; the existing layout and MOOC stay untouched. */
.home-sheet-sprite[role="button"] { cursor:pointer; touch-action:manipulation; }
.home-sheet-sprite[role="button"]:focus-visible { outline:2px solid #ffe39a; outline-offset:3px; border-radius:8px; }
.mooc-sheet-sprite[role="button"] { cursor:pointer; touch-action:manipulation; }
.mooc-sheet-sprite[role="button"]:focus-visible { outline:2px solid var(--ink); outline-offset:4px; border-radius:8px; }
.home-sheet-sprite.is-flashlight-shaking { animation:flashlight-shake 140ms ease-in-out 3; transform-origin:60% 55%; }
@keyframes flashlight-shake {
  0%,100% { transform:translateX(0) rotate(0deg); }
  25% { transform:translateX(-2px) rotate(-.7deg); }
  75% { transform:translateX(2px) rotate(.7deg); }
}


/* Flicker-free sprite frame double buffer.
   The old frame remains painted until the next decoded frame is ready. */
.sheet-sprite > .sprite-frame-buffer {
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  display:block;
  object-fit:contain;
  pointer-events:none;
  user-select:none;
  opacity:0;
  image-rendering:pixelated;
  transition:none;
}
.sheet-sprite > .sprite-frame-buffer.is-current {
  opacity:1;
}


/* Stable MOOC markup: one actor, no post-paint DOM relocation. */
@media (min-width:761px) {
  .mooc-hero { display:grid; grid-template-columns:minmax(0,790px) 230px; column-gap:40px; row-gap:0; align-content:end; }
  .mooc-hero-copy { display:contents; }
  .mooc-heading { max-width:720px; grid-column:1; grid-row:1; }
  .mooc-hero-copy > .lede { grid-column:1; grid-row:2; }
  .mooc-mascot { grid-column:2; grid-row:1/3; align-self:end; }
}
@media (max-width:760px) {
  .mooc-hero { display:block; align-items:initial; }
  .mooc-hero-copy { max-width:none; }
  .mooc-mascot { float:right; width:164px; min-height:164px; margin:2px 0 10px 14px; display:grid; place-items:end center; }
  .mooc-hero-copy::after { content:""; display:block; clear:both; }
  .home-scene { top:var(--mobile-shift,clamp(12px,3vw,20px)); }
  .hero.hero-split { overflow:clip; }
  .hero-beam { display:block; height:clamp(56px,20vw,92px); filter:blur(2px); opacity:calc(var(--light) * .72); }
  .hero-beam::before { filter:blur(4px); }
}
/* A frame is exposed only after its decoded buffers and position are ready. */
.guide-stage-home:not(.intro-ready) .hero-beam,
.guide-stage-home:not(:has(.buffers-ready)) .hero-beam { opacity:0; }

/* One card component across the homepage and both blog archives. */
.post-card { min-width:0; overflow-wrap:anywhere; }
.post-card-meta { display:flex; justify-content:space-between; align-items:baseline; gap:12px; }
.post-source { flex-shrink:0; color:var(--teal-dark); font:700 .7rem/1.2 "Space Grotesk",sans-serif; letter-spacing:.1em; }
.journal-heading { margin-bottom:26px; }
@media(max-width:560px) { .post-grid { grid-template-columns:1fr; } }
