/* Long-form project stories, using the portfolio's original palette and fonts. */
.story-page { max-width: 1160px; }
.story-hero { padding: 3.5rem 0 2.5rem; max-width: 920px; }
.story-hero h1 { font-size: clamp(2.3rem, 5vw, 3.75rem); line-height: 1.12; margin: 1rem 0 0.5rem; }
.story-subtitle { color: var(--primary); font-size: 1rem; margin-bottom: 2rem; }
.story-lead { font-family: 'Playfair Display', serif; font-size: clamp(1.5rem, 3vw, 2rem); line-height: 1.4; max-width: 750px; margin-bottom: 1rem; }
.story-intro { max-width: 740px; font-size: 1rem; color: #bdcbe0; font-weight: 400; line-height: 1.85; }
.story-context { display: grid; grid-template-columns: 1fr 1.4fr; gap: 2rem; margin-top: 2rem; padding-top: 1.4rem; border-top: 1px solid var(--border-light); }
.story-context dt { font-size: 0.7rem; color: var(--text-muted); margin-bottom: 0.4rem; }
.story-context dd { font-size: 0.85rem; color: #d0dbee; font-weight: 400; }
.story-figure { margin: 0 0 3.5rem; }
.story-figure a { display: block; border-radius: 10px; overflow: hidden; }
.story-figure img { display: block; width: 100%; height: auto; border: 1px solid var(--border-light); border-radius: 10px; }
.story-figure figcaption { display: grid; grid-template-columns: 1.4fr 1fr; gap: 2rem; padding-top: 1rem; line-height: 1.7; }
.story-figure figcaption p { font-size: 0.85rem; font-weight: 400; color: #bdcbe0; }
.story-figure figcaption span { color: var(--text-muted); font-size: 0.7rem; }
.story-layout { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 4rem; }
.story-toc { position: sticky; top: 2rem; align-self: start; display: flex; flex-direction: column; padding-top: 0.25rem; }
.story-toc p { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 0.75rem; }
.story-toc a { font-size: 0.78rem; font-weight: 400; padding: 0.55rem 0; color: #bdcbe0; transition: color .2s; }
.story-toc a:hover { color: var(--primary); }
.story-chapter { scroll-margin-top: 2rem; margin-bottom: 3.5rem; }
.story-chapter h2 { font-size: clamp(1.6rem, 3vw, 2rem); line-height: 1.3; margin: 0.8rem 0 1.4rem; }
.story-chapter > p:not(.eyebrow) { color: #bdcbe0; font-size: 0.96rem; font-weight: 400; line-height: 1.9; margin-bottom: 1.1rem; }
.story-technical { border-top: 1px solid var(--border-light); border-bottom: 1px solid var(--border-light); padding: 1.2rem 0; margin-bottom: 3rem; }
.story-technical summary { cursor: pointer; color: var(--primary); font-size: 0.85rem; padding: 0.25rem; }
.story-technical summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 5px; }
.story-technical p { color: #bdcbe0; font-size: 0.85rem; font-weight: 400; line-height: 1.85; margin-top: 1rem; }
.story-contact { padding: 2.5rem 0 3rem; border-top: 1px solid var(--border-light); max-width: 820px; }
.story-contact h2 { font-size: 2rem; margin: 1rem 0; }
.story-contact > p:not(.eyebrow) { color: #bdcbe0; font-size: 0.95rem; line-height: 1.8; font-weight: 400; max-width: 640px; }
.story-contact-link { display: inline-flex; gap: 1.5rem; margin-top: 1.2rem; padding: 0.6rem 0; font-size: 0.9rem; border-bottom: 1px solid var(--primary); }
.story-contact-link span { transition: transform .2s; }
.story-contact-link:hover span { transform: translate(2px, -2px); }
.story-next { display: flex; justify-content: space-between; gap: 2rem; border-top: 1px solid var(--border); padding: 1.5rem 0 2rem; font-size: 0.8rem; }
@media (max-width: 800px) {
  .story-layout { grid-template-columns: 1fr; gap: 2rem; }
  .story-toc { position: static; flex-direction: row; flex-wrap: wrap; gap: 0 1.2rem; border-bottom: 1px solid var(--border); padding-bottom: 1rem; }
  .story-toc p { width: 100%; margin-bottom: 0.2rem; }
}
@media (max-width: 540px) {
  .story-hero { padding-top: 2rem; }
  .story-context { grid-template-columns: 1fr; gap: 1rem; }
  .story-figure figcaption { grid-template-columns: 1fr; gap: 0.5rem; }
  .story-figure { margin-bottom: 2rem; }
  .story-chapter { margin-bottom: 2.5rem; }
  .story-next { flex-direction: column; gap: 1rem; }
  .story-contact h2 { font-size: 1.65rem; }
}
@media (prefers-reduced-motion: no-preference) {
  .story-hero { animation: story-arrive .45s ease-out; }
  @keyframes story-arrive { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
}

.story-live-link { margin-top: 1.25rem; font-size: 0.85rem; }
.story-live-link span { display: block; color: var(--text-muted); font-size: 0.7rem; margin-top: 0.4rem; }

.story-gallery { padding: 1rem 0 2rem; }
.story-gallery > h2 { font-size: 1.8rem; margin-bottom: 1.5rem; }
.story-gallery-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem; }
.story-gallery .story-figure { margin-bottom: 1.5rem; }
.story-gallery img { aspect-ratio: 16 / 10; object-fit: contain; background: var(--bg-secondary); }
.story-gallery figcaption { display: block; }
.story-gallery h3 { font-size: 1.1rem; margin-bottom: 0.7rem; }
.story-gallery figcaption span { display: block; margin-top: 0.8rem; }
@media (max-width: 700px) { .story-gallery-grid { grid-template-columns: 1fr; } }

.story-portal { padding: 2rem 0; border-top: 1px solid var(--border-light); scroll-margin-top: 2rem; }
.story-portal > h2 { font-size: clamp(1.6rem, 3vw, 2rem); margin: 1rem 0; }
.portal-intro { max-width: 760px; color: #bdcbe0; font-size: 0.96rem; font-weight: 400; line-height: 1.9; margin-bottom: 2rem; }
.story-portal .story-gallery-grid figcaption { display: block; }
.story-portal .story-gallery-grid figcaption span { display: block; margin-top: 0.8rem; }
