/* ==========================================================================
   Sub-pages: articles and case studies (loaded after main.css)
   Generated pages come from tools/build_pages.py
   ========================================================================== */
body.page { cursor: auto; }
body.page a, body.page button { cursor: pointer; }
body.page .header { transform: none; }
.header__nav a[aria-current="page"]::after { transform: scaleX(1); }

.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 1rem; top: 1rem; z-index: 1000; padding: 0.6rem 1rem; border-radius: 8px; background: var(--white); color: var(--bg-dark); }
.page-progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 900; pointer-events: none; }
.page-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--violet), var(--violet-2)); transform-origin: left; transform: scaleX(0); }

main#content { padding: 9rem var(--gutter) 7rem; }
.crumbs { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 2rem; color: var(--muted); font-size: 0.7rem; }
.crumbs i { font-style: normal; opacity: 0.5; }
.crumbs a { padding: 0.2rem 0; transition: color 0.3s ease; }
.crumbs a:hover { color: var(--white); }
.crumbs span { color: var(--violet-2); }

/* ---------- article ---------- */
.post, .alist, .cs, .more { max-width: 1180px; margin-left: auto; margin-right: auto; }
.post__head { max-width: 900px; }
.post__meta { display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; margin-bottom: 1.4rem; color: var(--muted); }
.post__cat { color: var(--violet-2); }
.post__title { font-family: var(--font-display); font-weight: 400; font-size: clamp(2.4rem, 5.6vw, 4.8rem); line-height: 1.02; letter-spacing: -0.01em; }
.post__lead { max-width: 44em; margin-top: 1.6rem; font-size: clamp(1.1rem, 1.6vw, 1.32rem); line-height: 1.55; color: rgba(246,242,255,0.82); }
.post__cover { margin: 3rem 0 0; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; }
.post__cover img { width: 100%; height: auto; }
.post__wrap, .post__end { display: grid; grid-template-columns: 220px minmax(0, 720px); gap: 4rem; justify-content: center; }
.post__wrap { margin-top: 4rem; }
.post__end { margin-top: 4rem; }
.post__end .author { grid-column: 2; }
.post__toc { position: sticky; top: 7rem; align-self: start; }
.post__toc p { margin-bottom: 1rem; color: var(--violet-2); }
.post__toc ol { counter-reset: toc; display: flex; flex-direction: column; gap: 0.7rem; }
.post__toc li { counter-increment: toc; display: flex; gap: 0.6rem; font-size: 0.9rem; line-height: 1.35; color: var(--muted); }
.post__toc li::before { content: counter(toc, decimal-leading-zero); font-family: var(--font-mono); font-size: 0.66rem; color: var(--violet-2); padding-top: 0.2rem; }
.post__toc a { transition: color 0.3s ease; }
.post__toc a:hover, .post__toc a.is-active { color: var(--white); }
@media (max-width: 960px) {
  .post__wrap, .post__end { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
  .post__end .author { grid-column: 1; }
  .post__toc { position: static; padding: 1.2rem 1.3rem; border: 1px solid var(--line); border-radius: 12px; }
}

/* long-form text */
.prose { font-size: 1.08rem; line-height: 1.75; color: rgba(246,242,255,0.86); }
.prose > * + * { margin-top: 1.2rem; }
.prose h2 { margin-top: 3.2rem; font-family: var(--font-display); font-weight: 400; font-size: clamp(1.8rem, 3vw, 2.4rem); line-height: 1.1; color: var(--white); scroll-margin-top: 7rem; }
.prose h3 { margin-top: 2rem; font-size: 1.2rem; font-weight: 500; color: var(--white); }
.prose ul li { position: relative; padding-left: 1.4rem; }
.prose ul li::before { content: ""; position: absolute; left: 0; top: 0.72em; width: 7px; height: 7px; border-radius: 50%; background: var(--violet-2); }
.prose ol { list-style: decimal; padding-left: 1.4rem; }
.prose ol li { padding-left: 0.3rem; }
.prose ol li::marker { color: var(--violet-2); font-family: var(--font-mono); font-size: 0.85em; }
.prose li + li { margin-top: 0.55rem; }
.prose strong { color: var(--white); font-weight: 500; }
.prose a { color: var(--violet-2); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose a:hover { color: var(--white); }
.prose blockquote { margin: 2.4rem 0; padding: 1.4rem 1.6rem; border-left: 2px solid var(--violet-2); border-radius: 0 12px 12px 0; background: rgba(139,92,246,0.09); }
.prose blockquote p { font-family: var(--font-display); font-size: 1.6rem; line-height: 1.3; color: var(--white); }
.prose code { padding: 0.1em 0.35em; border-radius: 4px; background: rgba(255,255,255,0.07); font-family: var(--font-mono); font-size: 0.88em; }

/* author box */
.author { display: flex; gap: 1.4rem; padding: 1.6rem; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,0.02); }
.author img { flex: none; width: 96px; height: 120px; object-fit: cover; border-radius: 10px; }
.author__tag { color: var(--violet-2); }
.author__name { margin-top: 0.3rem; font-family: var(--font-display); font-size: 1.6rem; line-height: 1.1; }
.author__name span { font-size: 1rem; color: var(--muted); }
.author__bio { margin-top: 0.5rem; line-height: 1.6; color: rgba(246,242,255,0.75); }
.author__links { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; margin-top: 0.9rem; }
.author__links a { padding: 0.4rem 0; color: var(--white); transition: color 0.3s ease; }
.author__links a:hover { color: var(--violet-2); }
@media (max-width: 560px) { .author { flex-direction: column; } }

/* related + index */
.more { margin-top: 7rem; padding-top: 4rem; border-top: 1px solid var(--line); }
.more__title { margin-top: 0.8rem; font-family: var(--font-display); font-weight: 400; font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1; }
.more__title em { color: var(--violet-2); }
.more__all { margin-top: 2.4rem; }
.alist__title { margin-top: 1rem; font-family: var(--font-display); font-weight: 400; font-size: clamp(3rem, 8vw, 6.6rem); line-height: 0.95; letter-spacing: -0.01em; }
.alist__title em { color: var(--violet-2); }
.alist__lead { max-width: 40em; margin-top: 1.6rem; font-size: 1.15rem; line-height: 1.6; color: rgba(246,242,255,0.8); }
.alist__cats { margin-top: 1.4rem; color: var(--violet-2); }
.alist .cards { margin-top: 4rem; }

/* ---------- case study ---------- */
.cs__head { max-width: 920px; }
.cs__title { margin-top: 1rem; font-family: var(--font-black); font-weight: 400; font-size: clamp(3rem, 9vw, 8rem); line-height: 0.9; letter-spacing: -0.03em; text-transform: uppercase; overflow-wrap: anywhere; }
.cs__kind { margin-top: 0.8rem; font-family: var(--font-display); font-style: italic; font-size: clamp(1.5rem, 3vw, 2.4rem); line-height: 1.1; color: var(--violet-2); }
.cs__lead { max-width: 44em; margin-top: 1.6rem; font-size: clamp(1.1rem, 1.6vw, 1.32rem); line-height: 1.55; color: rgba(246,242,255,0.82); }
.cs__facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin: 2.4rem 0 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--line); }
.cs__facts div { padding: 1rem 1.1rem; background: var(--bg-dark); }
.cs__facts dt { color: var(--muted); }
.cs__facts dd { margin: 0.35rem 0 0; color: var(--white); line-height: 1.35; }
@media (max-width: 760px) { .cs__facts { grid-template-columns: 1fr 1fr; } }
.cs__live { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.4rem; margin-top: 2rem; }
.cs__live .mono { color: var(--muted); overflow-wrap: anywhere; }
.cs__shot { margin-top: 4rem; }
.cs__frame { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: #1a1330; box-shadow: 0 40px 100px rgba(0,0,0,0.4); }
.cs__bar { display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; background: #221a3a; border-bottom: 1px solid rgba(255,255,255,0.06); }
.cs__bar i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,0.22); flex: none; }
.cs__bar span { margin-left: 10px; font-size: 0.66rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs__scroll { height: min(78vh, 760px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--violet) transparent; outline: none; }
.cs__scroll:focus-visible { box-shadow: inset 0 0 0 2px var(--violet-2); }
.cs__scroll img { display: block; width: 100%; height: auto; }
.cs__hint { margin-top: 0.9rem; text-align: center; color: var(--muted); }
.cs__body { max-width: 760px; margin: 4.5rem auto 0; }
.cs__gallery { margin-top: 5rem; }
.cs__figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.2rem; align-items: start; margin-top: 1.6rem; }
.cs__fig { margin: 0; }
.cs__fig img { width: 100%; height: auto; border: 1px solid var(--line); border-radius: 12px; }
.cs__fig figcaption { margin-top: 0.6rem; color: var(--muted); }
.cs__next { margin-top: 6rem; padding-top: 3rem; border-top: 1px solid var(--line); }
.cs__next p { color: var(--violet-2); }
.cs__next a { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem 1.6rem; margin-top: 0.8rem; }
.cs__next-title { font-family: var(--font-black); font-size: clamp(2.4rem, 7vw, 6rem); line-height: 0.95; text-transform: uppercase; transition: color 0.4s ease; overflow-wrap: anywhere; }
.cs__next a:hover .cs__next-title { color: var(--violet-2); }
.cs__next-kind { font-family: var(--font-display); font-style: italic; font-size: 1.4rem; color: var(--muted); }

/* ---------- footer ---------- */
.pfoot { overflow: hidden; padding: 6rem var(--gutter) 0; border-top: 1px solid var(--line); background: radial-gradient(80% 50% at 50% 110%, rgba(139,92,246,0.3), transparent 60%), var(--bg-dark); }
.pfoot__line { margin-top: 1rem; font-family: var(--font-display); font-size: clamp(2.4rem, 6vw, 5rem); line-height: 1; }
.pfoot__line em { color: var(--violet-2); }
.pfoot__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.6rem; margin-top: 2rem; }
.pfoot__mail { padding: 0.6rem 0; color: var(--white); transition: color 0.3s ease; }
.pfoot__mail:hover { color: var(--violet-2); }
.pfoot__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem; margin-top: 4rem; padding: 1.4rem 0; border-top: 1px solid var(--line); color: var(--muted); }
.pfoot__bottom nav { display: flex; flex-wrap: wrap; gap: 0.2rem 1.4rem; }
.pfoot__bottom a { padding: 0.5rem 0; transition: color 0.3s ease; }
.pfoot__bottom a:hover { color: var(--white); }
.pfoot__wordmark { margin-top: 2rem; margin-bottom: -0.1em; font-family: var(--font-black); font-size: 18.6vw; line-height: 0.78; letter-spacing: -0.04em; text-align: center; color: transparent; -webkit-text-stroke: 1px rgba(246,242,255,0.18); user-select: none; }

/* scroll reveal */
.rv { opacity: 0; translate: 0 30px; transition: opacity 0.9s ease, translate 1s var(--ease-out); }
.rv.is-in { opacity: 1; translate: 0 0; }
@media (prefers-reduced-motion: reduce) { .rv { opacity: 1; translate: none; transition: none; } }
