/* Afterlight story layer. Lab chrome stays in lab.css. */

.al-hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  align-items: end;
  overflow: hidden;
  color: #fff;
}
.al-hero .still {
  position: absolute;
  inset: 0;
  height: auto;
  max-height: none;
  margin: 0;
}
.al-hero .still img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 46%;
  transform: scale(1.06);
  animation: al-ken 28s ease-in-out infinite alternate;
}
.al-hero .shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,.12) 38%, rgba(0,0,0,.82) 100%);
}
.al-hero .copy {
  position: relative;
  padding: 0 0 calc(72px + env(safe-area-inset-bottom));
  max-width: 44rem;
}
.al-hero h1 {
  font-size: clamp(42px, 10vw, 84px);
  letter-spacing: -0.04em;
  margin: 0 0 8px;
}
.al-hero .subtitle {
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: clamp(20px, 3vw, 32px);
  margin: 0 0 16px;
  color: #ececec;
}
.al-hero .lede {
  max-width: 34rem;
  color: #e8e8e8;
}
@keyframes al-ken {
  from { transform: scale(1.06) translate3d(0, 0, 0); }
  to { transform: scale(1.14) translate3d(-1.6%, -1.2%, 0); }
}

.al-split {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 28px;
  align-items: start;
  margin-top: 28px;
}
.al-split p { margin: 0 0 14px; color: #d4d4d4; }

.al-chapters {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 32px;
}
a.al-chapter {
  display: block;
  text-decoration: none;
  background: #0c0c0c;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  color: inherit;
  transition: border-color .2s ease, transform .2s ease;
}
a.al-chapter:hover {
  border-color: rgba(255,255,255,.36);
  transform: translateY(-2px);
}
.al-chapter img {
  width: 100%;
  height: 148px;
  object-fit: cover;
  margin: 0;
}
.al-chapter .pad { padding: 14px 16px 16px; }
.al-chapter .n {
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.al-chapter h3 {
  font-size: 18px;
  letter-spacing: -0.03em;
  text-transform: none;
  margin: 6px 0 6px;
  color: #fff;
}
.al-chapter p { margin: 0; color: #bdbdbd; font-size: 14px; }
.al-chapter.read { border-color: rgba(167, 206, 181, .45); }

.al-people {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 28px;
}
.al-person {
  background: #0c0c0c;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}
.al-person img {
  width: 100%;
  height: 340px;
  object-fit: cover;
  object-position: center 18%;
  margin: 0;
}
.al-person .pad { padding: 16px 18px 20px; }
.al-person h3 {
  font-size: 20px;
  letter-spacing: -0.03em;
  text-transform: none;
  margin: 0 0 8px;
}
.al-person p { margin: 0; color: #cfcfcf; }

.al-route {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}
.al-route span {
  border: 1px solid var(--line);
  padding: 8px 12px;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.al-route span.here { color: #fff; border-color: #fff; }

.al-objects {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 24px;
}
.al-objects figure { margin: 0; }
.al-objects img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border: 1px solid var(--line);
}
.al-objects figcaption {
  font-size: 12px;
  color: var(--dim);
  margin-top: 8px;
}

.al-radio {
  margin-top: 28px;
  padding: 22px 22px 16px;
  background: #0c0c0c;
  border: 1px solid var(--line);
  border-radius: 4px;
  max-width: 44rem;
}
.al-radio-now .n {
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 4px;
}
.al-radio-now h3 {
  font-size: 22px;
  letter-spacing: -0.03em;
  text-transform: none;
  margin: 0 0 8px;
  color: #fff;
}
.al-radio-time { margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.al-radio-now input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}
.al-radio-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 16px 0 18px;
}
.al-radio-controls button {
  font: inherit;
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  padding: 8px 14px;
  cursor: pointer;
}
.al-radio-controls button[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--accent);
}
.al-radio-volwrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
}
.al-radio-knob {
  --deg: 81deg;
  width: 56px;
  height: 56px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background:
    conic-gradient(from -135deg, var(--accent) 0 var(--deg), rgba(243,236,224,.12) var(--deg) 270deg, transparent 270deg),
    #161412;
  position: relative;
  cursor: grab;
  touch-action: none;
}
.al-radio-knob::after {
  content: "";
  position: absolute;
  width: 3px;
  height: 16px;
  background: #fff;
  left: 50%;
  top: 8px;
  transform: translateX(-50%) rotate(var(--deg));
  transform-origin: 50% 20px;
  border-radius: 1px;
  pointer-events: none;
}
.al-radio-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.al-radio-list li { border-bottom: 1px solid var(--line); }
.al-radio-list button {
  width: 100%;
  text-align: left;
  font: inherit;
  font-size: 15px;
  color: #d4d4d4;
  background: transparent;
  border: 0;
  padding: 12px 4px;
  cursor: pointer;
}
.al-radio-list button[aria-current="true"] { color: #fff; }
.al-radio-list button:hover { color: #fff; }

body.isa-page {
  background:
    radial-gradient(1200px 600px at 70% -10%, #fff6e8 0%, transparent 55%),
    linear-gradient(180deg, #1a2238 0 72px, #f6eee4 72px);
  color: #3a2a22;
}
body.isa-page header.nav,
body.isa-page header.nav.scrolled,
body.isa-page header.nav.open {
  background: rgba(13, 14, 11, .94);
  border-bottom-color: rgba(234, 228, 211, .14);
}
body.isa-page header.nav a,
body.isa-page header.nav .menu-btn { color: #eae4d3; }
body.isa-page header.nav .nav-cta {
  color: #0d0e0b;
  background: #cfe35a;
  border-color: #cfe35a;
}
.isa-letter {
  position: relative;
  min-height: 100vh;
  padding: 108px 0 72px;
}
.isa-sky {
  position: absolute;
  inset: 0 0 auto 0;
  height: 220px;
  background:
    radial-gradient(circle at 82% 38%, #f7e7b0 0 7px, transparent 8px),
    radial-gradient(circle at 18% 42%, rgba(255,255,255,.7) 0 2px, transparent 3px),
    radial-gradient(circle at 28% 28%, rgba(255,255,255,.5) 0 1px, transparent 2px),
    radial-gradient(circle at 62% 22%, rgba(255,255,255,.55) 0 1.5px, transparent 2.5px),
    linear-gradient(180deg, #1a2238 0%, #3d4a6a 42%, #c9a07a 78%, #f6eee4 100%);
  pointer-events: none;
}
.isa-inner { position: relative; max-width: 42rem; }
.isa-from {
  font-size: 12px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: #8a5a3a;
  margin: 0 0 10px;
}
.isa-letter h1 {
  font-family: "Source Serif 4", "Source Serif Fallback", Georgia, serif;
  font-size: clamp(48px, 10vw, 84px);
  font-weight: 500;
  letter-spacing: -0.04em;
  color: #2b1c16;
  text-transform: none;
  margin: 0 0 6px;
  line-height: .95;
}
.isa-vow {
  font-family: "Source Serif 4", "Source Serif Fallback", Georgia, serif;
  font-style: italic;
  font-size: 22px;
  color: #c47a4a;
  margin: 0 0 22px;
}
.isa-letter-body {
  max-width: 36rem;
  font-size: 18px;
  line-height: 1.65;
  color: #4a372e;
  margin: 0 0 28px;
}
.isa-sign {
  font-family: "Source Serif 4", "Source Serif Fallback", Georgia, serif;
  font-style: italic;
  font-size: 20px;
  color: #2b1c16;
  margin: 28px 0 0;
}
.isa-radio.al-radio {
  background: #fffdf8;
  border: 1px solid #ead7c4;
  max-width: 40rem;
  border-radius: 18px;
  padding: 26px 24px 18px;
  box-shadow: 0 24px 50px rgba(90, 50, 30, .1);
}
.isa-radio .al-radio-now .n { color: #8a5a3a; }
.isa-radio .al-radio-now h3 {
  font-family: "Source Serif 4", "Source Serif Fallback", Georgia, serif;
  font-size: 28px;
  color: #2b1c16;
}
.isa-radio .al-radio-note {
  margin: 0 0 10px;
  color: #8a5a3a;
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.isa-radio .al-radio-time { color: #7a6558; }
.isa-radio .al-radio-now input[type="range"] { accent-color: #c47a4a; }
.isa-radio .al-radio-controls button {
  color: #3a2a22;
  border-color: #ead7c4;
  border-radius: 999px;
}
.isa-radio .al-radio-controls button[aria-pressed="true"] {
  border-color: #c47a4a;
  color: #c47a4a;
  background: #fff4ea;
}
.isa-radio .al-radio-knob {
  border-color: #c47a4a;
  background:
    conic-gradient(from -135deg, #c47a4a 0 var(--deg), rgba(196,122,74,.18) var(--deg) 270deg, transparent 270deg),
    #f6eadc;
}
.isa-radio .al-radio-knob::after { background: #2b1c16; }
.isa-tracks {
  display: grid;
  gap: 8px;
  border-top: 0;
  margin-top: 8px;
}
.isa-tracks li { border: 0; }
.isa-radio .al-radio-list button {
  color: #5a4338;
  border: 1px solid #ead7c4;
  border-radius: 12px;
  padding: 14px 16px;
  background: #fff8f0;
}
.isa-radio .al-radio-list button[aria-current="true"] {
  color: #2b1c16;
  border-color: #c47a4a;
  background: #fff1e4;
}
.isa-radio .al-radio-list button:hover { color: #2b1c16; }

.al-notes[hidden] { display: none; }
.al-lock {
  border: 1px dashed var(--line);
  padding: 18px;
  color: var(--muted);
  font-size: 14px;
  margin-top: 16px;
}

body.al-paper {
  background: #f4efe4;
  color: #1f2623;
  font-family: Georgia, "Times New Roman", serif;
}
body.al-paper[data-theme="dark"] {
  background: #121a17;
  color: #efece3;
}
body.al-paper header.nav,
body.al-paper header.nav.scrolled,
body.al-paper header.nav.open {
  background: rgba(13, 14, 11, .94);
  border-bottom-color: rgba(234, 228, 211, .14);
}
body.al-paper header.nav a,
body.al-paper header.nav .menu-btn { color: #eae4d3; }
body.al-paper header.nav .nav-cta {
  color: #0d0e0b;
  background: #cfe35a;
  border-color: #cfe35a;
}
#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 3px;
  background: #315b4c;
  z-index: 40;
}
.al-reader {
  width: min(100% - 3rem, 760px);
  margin: 0 auto;
  padding: 120px 0 48px;
}
.al-reader .eyebrow {
  font-family: Inter, Helvetica, Arial, sans-serif;
  letter-spacing: .16em;
  text-transform: uppercase;
  font-size: 12px;
  color: #5a665e;
}
body.al-paper[data-theme="dark"] .al-reader .eyebrow { color: #bcc6bb; }
.al-reader h1 {
  font-size: clamp(2.4rem, 8vw, 4.4rem);
  letter-spacing: -.035em;
  line-height: 1.05;
  margin: .5rem 0 .6rem;
  color: inherit;
}
.al-reader .subtitle {
  font-style: italic;
  font-size: 1.4rem;
  margin: 0 0 12px;
}
.al-reader .meta,
.al-reader .controls,
.al-reader summary,
.al-reader nav {
  font-family: Inter, Helvetica, Arial, sans-serif;
}
.al-reader .meta { font-size: 13px; color: #5a665e; }
.al-reader .controls {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin: 1.4rem 0;
}
.al-reader .controls button {
  font-size: 13px;
  background: transparent;
  border: 1px solid #c7ccbf;
  border-radius: 4px;
  color: inherit;
  padding: .5rem .8rem;
  cursor: pointer;
  min-height: 44px;
}
body.al-paper[data-theme="dark"] .al-reader .controls button { border-color: #3b4a41; }
.al-reader details {
  border-top: 1px solid #c7ccbf;
  border-bottom: 1px solid #c7ccbf;
  padding: .8rem 0;
}
.al-reader summary { cursor: pointer; font-size: 14px; }
.al-reader nav ol { padding-left: 1.4rem; }
.al-reader nav li { margin: .35rem 0; font-size: 14px; }
.al-reader a { color: #315b4c; }
body.al-paper[data-theme="dark"] .al-reader a { color: #a7ceb5; }
.al-cut {
  margin: 2.4rem -1.2rem 1.4rem;
}
.al-cut img {
  width: 100%;
  height: min(52vh, 420px);
  object-fit: cover;
  animation: al-ken 36s ease-in-out infinite alternate;
}
.al-cut figcaption {
  font-family: Inter, Helvetica, Arial, sans-serif;
  font-size: 12px;
  color: #5a665e;
  margin-top: 8px;
}
.al-cut .cut-label {
  letter-spacing: .14em;
  text-transform: uppercase;
  margin-right: .6rem;
}
.al-insight {
  font-family: Inter, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  border-left: 2px solid #315b4c;
  padding: .2rem 0 .2rem 1rem;
  margin: 0 0 1.4rem;
  color: #3d4a44;
}
body.al-paper[data-theme="dark"] .al-insight { color: #c9d4cc; border-color: #a7ceb5; }
.al-insight .kicker { margin: 0 0 6px; }
.al-reader article > h2 {
  font-size: 1.65rem;
  line-height: 1.3;
  margin: 2.2rem 0 1.1rem;
  scroll-margin-top: 5rem;
}
.al-reader article > h2:after {
  content: "";
  display: block;
  width: 2rem;
  border-bottom: 2px solid #315b4c;
  margin-top: .8rem;
}
.al-reader article h3 { font-size: 1.1rem; margin: 2rem 0 .6rem; }
.al-reader article p { margin: 0 0 1.1rem; line-height: 1.8; orphans: 3; widows: 3; }
.al-endnote {
  font-family: Inter, Helvetica, Arial, sans-serif;
  font-size: 13px;
  color: #5a665e;
  padding: 3rem 0 5rem;
}
.al-endnote p { margin: .5rem 0; }

@media (max-width: 900px) {
  .al-chapters,
  .al-people,
  .al-objects,
  .al-split { grid-template-columns: 1fr; }
  .al-chapter img { height: 180px; }
  .al-person img { height: 280px; }
  .al-hero .copy { padding-bottom: calc(40px + env(safe-area-inset-bottom)); }
  .al-hero h1 { font-size: clamp(36px, 14vw, 64px); }
  .al-radio-controls { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  .al-hero .still img,
  .al-cut img { animation: none; transform: none; }
}
@media print {
  header.nav, .al-reader .controls, .al-reader details, #reading-progress { display: none !important; }
  body.al-paper { background: #fff; color: #000; }
  .al-reader { width: 100%; padding-top: 0; }
  .al-cut img { animation: none; height: 220px; }
}
