/* Focus Immersion — shared alphabet/script page styles. Relies on /styles.css tokens. */
.script-page { max-width: 1040px; margin: 0 auto; padding: clamp(2.5rem, 5vw, 4rem) clamp(1rem, 4vw, 3rem) 5rem; }
.script-hero { padding: clamp(2.4rem, 7vw, 4.6rem) 0 clamp(1.2rem, 3vw, 2rem); }
.script-hero .study-title { margin: 0.3rem 0 1rem; }
.script-lede { max-width: 46rem; color: var(--cream); opacity: 0.86; font-size: 1.05rem; line-height: 1.62; }
.script-lede strong { color: var(--gold); font-weight: 500; }
.script-note { margin-top: 0.85rem; max-width: 46rem; font-size: 0.83rem; color: var(--cream); opacity: 0.5; line-height: 1.55; }

.sx-block { margin-bottom: 2.4rem; }
.sx-block h2 { font-family: var(--ff-disp, "Fraunces", Georgia, serif); font-weight: 400; font-size: 1.5rem; color: var(--cream); margin: 0 0 0.2rem; }
.sx-block h2 .sx-sub { font-family: var(--ff-mono, "DM Mono", monospace); font-size: 0.78rem; color: var(--cream); opacity: 0.5; margin-left: 0.5rem; }
.sx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(4.2rem, 1fr)); gap: 0.4rem; margin-top: 0.9rem; }
.sx-grid-wide { grid-template-columns: repeat(auto-fill, minmax(5.4rem, 1fr)); }
.sx-cell { aspect-ratio: 1 / 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.15rem;
  background: rgba(236,227,211,0.03); border: 1px solid rgba(236,227,211,0.1); border-radius: 4px; cursor: pointer;
  transition: transform 0.12s ease, border-color 0.15s, background 0.15s; }
.sx-cell:hover, .sx-cell:focus-visible { transform: translateY(-2px); border-color: var(--gold); background: rgba(196,163,92,0.07); outline: none; }
.sx-cell.is-hit { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.sx-glyph { font-size: clamp(1.6rem, 4vw, 2.1rem); line-height: 1; color: var(--cream); }
.sx-csub { font-family: var(--ff-mono, monospace); font-size: 0.66rem; color: var(--gold); opacity: 0.85; }
.sx-cell.dim { opacity: 0.15; }

/* ---- detail drawer ---- */
.sx-drawer { position: fixed; top: 0; right: 0; z-index: 60; width: min(380px, 92vw); height: 100%;
  background: var(--surface, rgba(16,14,12,0.97)); backdrop-filter: blur(8px); border-left: 1px solid rgba(236,227,211,0.14);
  box-shadow: -24px 0 60px rgba(0,0,0,0.5); transform: translateX(100%); transition: transform 0.32s cubic-bezier(0.22,1,0.36,1);
  overflow-y: auto; padding: 1.6rem; }
.sx-drawer.is-open { transform: translateX(0); }
.sx-close { position: absolute; top: 1rem; right: 1.1rem; background: none; border: none; color: var(--cream); opacity: 0.55; font-size: 1.35rem; cursor: pointer; }
.sx-close:hover { opacity: 1; }
.sx-d-glyph { font-size: 5rem; line-height: 1; color: var(--cream); margin: 0.2rem 0 0.3rem; }
.sx-d-name { font-family: var(--ff-disp, serif); font-size: 1.3rem; color: var(--gold); margin-bottom: 1rem; }
.sx-audio { min-height: 0; margin-bottom: 0.6rem; }
.sx-audio-btn { background: rgba(196,163,92,0.12); border: 1px solid rgba(196,163,92,0.45); color: var(--cream);
  font-family: var(--ff-mono, monospace); font-size: 0.74rem; letter-spacing: 0.03em; padding: 0.42rem 0.85rem; border-radius: 4px; cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.sx-audio-btn:hover { border-color: var(--gold); background: rgba(196,163,92,0.2); }
.sx-rows { display: grid; gap: 0.05rem; }
.sx-row { display: grid; grid-template-columns: 6rem 1fr; gap: 0.6rem; padding: 0.55rem 0; border-top: 1px solid rgba(236,227,211,0.08); }
.sx-row:first-child { border-top: none; }
.sx-k { font-family: var(--ff-mono, monospace); font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--cream); opacity: 0.45; padding-top: 0.12rem; }
.sx-v { color: var(--cream); font-size: 0.96rem; line-height: 1.5; }

/* ---- stroke-order numbered guide ---- */
.sx-stroke { margin-top: 1.2rem; }
.sx-stroke-canvas { width: 120px; height: 120px; border: 1px solid rgba(236,227,211,0.14); border-radius: 4px; background: rgba(236,227,211,0.03); }
.sx-stroke-canvas svg { width: 100%; height: 100%; }
.sx-stroke-canvas path { fill: none; stroke: var(--cream); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.sx-stroke-canvas path.draw { stroke-dasharray: var(--len) var(--len); stroke-dashoffset: var(--len); animation: sx-draw var(--dur,0.5s) linear forwards var(--delay,0s); }
.sx-stroke-canvas text { fill: var(--gold); font-size: 9px; font-family: var(--ff-mono, monospace); }
@keyframes sx-draw { to { stroke-dashoffset: 0; } }
.sx-stroke-btn { margin-top: 0.5rem; background: rgba(196,163,92,0.1); border: 1px solid rgba(196,163,92,0.4); color: var(--cream);
  font-family: var(--ff-mono, monospace); font-size: 0.7rem; padding: 0.32rem 0.65rem; border-radius: 3px; cursor: pointer; }
.sx-stroke-btn:hover { border-color: var(--gold); }
@media (prefers-reduced-motion: reduce){ .sx-stroke-canvas path.draw { animation: none; stroke-dashoffset: 0; } }

.sx-backdrop { position: fixed; inset: 0; z-index: 55; background: rgba(5,4,3,0.45); opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.sx-backdrop.is-open { opacity: 1; pointer-events: auto; }
@media (max-width: 600px) {
  .sx-drawer { width: 100%; height: auto; max-height: 84vh; top: auto; bottom: 0; right: 0; border-left: none;
    border-top: 1px solid rgba(236,227,211,0.14); transform: translateY(100%); border-radius: 10px 10px 0 0; }
  .sx-drawer.is-open { transform: translateY(0); }
}
