/* ==========================================================
   Content pages (services, work, guides, about).
   Loaded after style.css. Motion is pure CSS: load-in for the
   hero, scroll-driven reveals where the browser supports them.
   ========================================================== */
body.page { overflow-x: clip; }
.nav-links a[aria-current="page"]::after { transform: scaleX(1); }

/* ---------- Hero ---------- */
.p-hero { padding: calc(var(--nav-h) + clamp(48px, 8vw, 120px)) 0 clamp(40px, 6vw, 80px); }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font: 400 12.5px var(--f-mono); color: var(--muted); margin-bottom: clamp(28px, 4vw, 48px); }
.crumbs a { color: var(--ink-2); border-bottom: 1px solid var(--line); }
.crumbs a:hover { border-color: var(--ink); }
.crumbs i { font-style: normal; opacity: .5; }
.p-title { font: 800 clamp(40px, 7vw, 108px)/0.98 var(--f-display); letter-spacing: -0.045em; max-width: 15ch; text-wrap: balance; }
.p-lede { margin-top: clamp(20px, 2.6vw, 32px); max-width: 60ch; font-size: clamp(17px, 1.5vw, 21px); line-height: 1.6; color: var(--ink-2); }
.p-meta { margin-top: 18px; font: 400 13px/1.7 var(--f-mono); color: var(--muted); letter-spacing: .02em; }
.p-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

/* ---------- Sections ---------- */
.p-sec { padding: clamp(56px, 8vw, 120px) 0; border-top: 1px solid var(--line); }
.p-hero + .p-sec, .p-figure + .p-sec, .p-short + .p-sec { border-top: 0; }
.p-short { padding: 0 0 clamp(24px, 4vw, 48px); }
.p-h2 { font: 800 clamp(32px, 4.4vw, 64px)/1 var(--f-display); letter-spacing: -0.04em; text-wrap: balance; }
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.split-h { position: sticky; top: calc(var(--nav-h) + 24px); }
.p-text { font-size: clamp(17px, 1.4vw, 20px); line-height: 1.7; color: var(--ink-2); max-width: 62ch; }
.p-text + .p-text { margin-top: 18px; }

/* ---------- Cards ---------- */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.cards-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: clamp(20px, 2.2vw, 30px); transition: transform .5s var(--ease), border-color .3s; }
.card:hover { transform: translateY(-4px); border-color: rgba(18, 18, 18, .3); }
.card h3 { font: 700 clamp(18px, 1.5vw, 22px)/1.2 var(--f-display); letter-spacing: -0.02em; margin-bottom: 10px; }
.card p { font-size: 15.5px; line-height: 1.6; color: var(--ink-2); }

.tldr { background: var(--ink); color: var(--paper); border-radius: var(--r); padding: clamp(22px, 2.6vw, 34px); font-size: clamp(16px, 1.3vw, 19px); line-height: 1.65; max-width: 980px; }
.tldr strong, .prose .tldr strong { color: #ff7a5c; font-weight: 600; }
.prose .tldr { margin-bottom: 40px; }

/* ---------- Links grid ---------- */
.lgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.lcard { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 18px 18px 22px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; transition: transform .6s var(--ease), border-color .3s; }
.lcard:hover { transform: translateY(-6px); border-color: rgba(18, 18, 18, .35); }
.lcard img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: top; border-radius: 10px; margin-bottom: 6px; transition: transform .9s var(--ease); }
.lcard:hover img { transform: scale(1.03); }
.lcard strong { font: 700 clamp(20px, 1.7vw, 26px)/1.15 var(--f-display); letter-spacing: -0.025em; padding-right: 36px; }
.lcard-go { position: absolute; right: 18px; bottom: 20px; font-size: 20px; transition: transform .5s var(--ease); }
.lcard:hover .lcard-go { transform: translateX(5px); color: var(--red); }

/* ---------- Case pages ---------- */
.p-figure { padding-bottom: clamp(40px, 6vw, 80px); }
.frame { border-radius: 20px; overflow: hidden; box-shadow: 0 40px 90px -40px rgba(18, 18, 18, .45); }
.frame img { width: 100%; height: auto; }
.pfacts { display: grid; gap: 0; border-top: 1px solid var(--ink); }
.pfacts div { display: grid; grid-template-columns: 9.5em 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.pfacts dt { font: 500 12px/1.9 var(--f-mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.pfacts dd { font-size: 15.5px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 18px; }
.g-item img { width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--line); }
.g-item figcaption { margin-top: 10px; font-size: 14px; color: var(--muted); }
.live li { border-bottom: 1px solid var(--line); }
.live li:first-child { border-top: 1px solid var(--ink); }
.live a { display: flex; justify-content: space-between; align-items: center; padding: 20px 4px; font: 700 clamp(20px, 2vw, 28px)/1.2 var(--f-display); letter-spacing: -0.02em; transition: color .3s, padding .5s var(--ease); }
.live a:hover { color: var(--red); padding-left: 14px; }
.live i { font-style: normal; }

/* ---------- Prose (guides, case text) ---------- */
.prose { max-width: 70ch; font-size: clamp(16.5px, 1.25vw, 18.5px); line-height: 1.75; color: var(--ink-2); }
.prose h2 { font: 700 clamp(24px, 2.2vw, 32px)/1.15 var(--f-display); letter-spacing: -0.03em; color: var(--ink); margin: 48px 0 14px; scroll-margin-top: calc(var(--nav-h) + 20px); }
.prose h2:first-child { margin-top: 0; }
.prose p + p { margin-top: 16px; }
.prose ul, .prose ol { margin: 14px 0 0; padding-left: 1.3em; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { margin: 8px 0; padding-left: 4px; }
.prose li::marker { color: var(--red); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose a:not(.link) { color: var(--ink); border-bottom: 1.5px solid var(--red); }
.prose em { color: var(--red); }
.tpl { white-space: pre-wrap; font: 400 14px/1.75 var(--f-mono); background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px; margin-top: 14px; color: var(--ink); overflow-x: auto; }

/* ---------- GEO Answer Capsules & Data Tables ---------- */
.answer-capsule { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--red); border-radius: var(--r); padding: clamp(20px, 2.4vw, 30px); margin: 24px 0; max-width: 980px; }
.answer-capsule p { font-size: clamp(16px, 1.25vw, 18.5px); line-height: 1.7; color: var(--ink-2); }
.capsule-label { font: 600 12px var(--f-mono); text-transform: uppercase; letter-spacing: .12em; color: var(--red); margin-bottom: 10px; }
.data-table-wrap { width: 100%; overflow-x: auto; margin: 28px 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 15px; line-height: 1.55; }
.data-table th { padding: 14px 18px; font: 600 12.5px var(--f-mono); text-transform: uppercase; letter-spacing: .08em; background: rgba(18, 18, 18, 0.04); border-bottom: 1px solid var(--line); color: var(--ink); white-space: nowrap; }
.data-table td { padding: 14px 18px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--ink-2); }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tr:hover td { background: rgba(18, 18, 18, 0.02); }
.data-table td strong { color: var(--ink); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin: 26px 0; }
.stat-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; display: flex; flex-direction: column; gap: 6px; }
.stat-num { font: 800 clamp(28px, 3vw, 42px)/1 var(--f-display); letter-spacing: -0.03em; color: var(--red); }
.stat-label { font: 600 14px/1.4 var(--f-body); color: var(--ink); }
.stat-source { font: 400 12px var(--f-mono); color: var(--muted); margin-top: 4px; }
.quote-box { margin: 28px 0; padding: 22px 26px; border-left: 3px solid var(--ink); background: var(--card); border-radius: 0 var(--r) var(--r) 0; font-size: 16px; line-height: 1.65; color: var(--ink-2); }
.quote-box cite { display: block; margin-top: 10px; font: 500 12.5px var(--f-mono); color: var(--muted); font-style: normal; }

.related { margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--line); }
.toc ol { list-style: decimal; padding-left: 1.2em; font-size: 15px; line-height: 1.5; }
.toc li { margin: 10px 0; }
.toc li::marker { font: 500 12px var(--f-mono); color: var(--muted); }
.toc a { color: var(--ink-2); transition: color .3s; }
.toc a:hover { color: var(--red); }

/* ---------- Guides list ---------- */
.glist { display: grid; gap: 0; border-top: 1px solid var(--ink); }
.gitem { display: grid; grid-template-columns: 7em minmax(0, 1.1fr) minmax(0, 1fr); gap: 24px; align-items: baseline; padding: clamp(22px, 3vw, 36px) 0; border-bottom: 1px solid var(--line); transition: padding .6s var(--ease), background .3s; }
.gitem strong { font: 700 clamp(22px, 2.3vw, 34px)/1.12 var(--f-display); letter-spacing: -0.03em; }
.gitem > span:last-child { color: var(--muted); font-size: 15.5px; }
.gitem:hover { padding-left: 16px; background: var(--card); }
.gitem:hover strong { color: var(--red); }

/* ---------- FAQ ---------- */
.faq { border-top: 1px solid var(--ink); }
.qa { border-bottom: 1px solid var(--line); }
.qa summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 20px; align-items: center; padding: 22px 0; font: 600 clamp(17px, 1.4vw, 20px)/1.35 var(--f-body); }
.qa summary::-webkit-details-marker { display: none; }
.qa summary span { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; box-shadow: inset 0 0 0 1px var(--line); transition: transform .5s var(--ease), background .3s, color .3s; }
.qa[open] summary span { transform: rotate(45deg); background: var(--ink); color: var(--paper); }
.qa-a { padding: 0 0 24px; color: var(--ink-2); max-width: 64ch; line-height: 1.7; }
.qa-a a { border-bottom: 1.5px solid var(--red); }

/* ---------- CTA band ---------- */
.p-cta { background: var(--ink); color: var(--paper); padding: clamp(70px, 10vw, 140px) 0; }
.p-cta-in { max-width: 980px; }
.p-cta p { margin-top: 20px; max-width: 56ch; font-size: clamp(16px, 1.4vw, 19px); color: #c9c7c0; }
.btn-line-light { box-shadow: inset 0 0 0 1.5px var(--paper); color: var(--paper); }
.btn-line-light::before { background: var(--paper); }
.btn-line-light:hover { color: var(--ink); }

/* ---------- Motion ---------- */
@keyframes p-rise { from { opacity: 0; transform: translateY(36px); } to { opacity: 1; transform: none; } }
@keyframes p-in { from { opacity: 0; transform: translateY(56px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes p-open { from { clip-path: inset(10% 8% 10% 8% round 24px); } to { clip-path: inset(0 0 0 0 round 20px); } }
@media (prefers-reduced-motion: no-preference) {
  .rise { animation: p-rise 1.1s var(--ease) both; }
  .rise.d1 { animation-delay: .08s; }
  .rise.d2 { animation-delay: .2s; }
  .rise.d3 { animation-delay: .32s; }
  .footer-mono span { animation: p-rise 1.2s var(--ease) both; animation-timeline: view(); animation-range: entry 10% cover 30%; }
  @supports (animation-timeline: view()) {
    [data-reveal] { animation: p-in linear both; animation-timeline: view(); animation-range: entry 0% entry 70%; }
    .frame { animation: p-open linear both; animation-timeline: view(); animation-range: entry 0% cover 45%; }
    .frame img { animation: p-zoom linear both; animation-timeline: view(); animation-range: cover 0% cover 100%; }
    .p-h2 { animation: p-rise linear both; animation-timeline: view(); animation-range: entry 0% entry 80%; }
  }
}
@keyframes p-zoom { from { transform: scale(1.08); } to { transform: scale(1); } }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .split { grid-template-columns: 1fr; }
  .split-h { position: static; }
  .gitem { grid-template-columns: 1fr; gap: 8px; }
}
@media (max-width: 760px) {
  .cards, .cards-4 { grid-template-columns: 1fr; }
  .pfacts div { grid-template-columns: 1fr; gap: 2px; }
  .p-actions .btn { flex: 1 1 auto; justify-content: center; }
  .toc { display: none; }
}

/* ---------- 404 ---------- */
.p-404 { padding-bottom: clamp(32px, 5vw, 64px); }
.e404-num { font: 800 clamp(120px, 26vw, 360px)/0.8 var(--f-display); letter-spacing: -0.06em; color: var(--ink); margin-bottom: clamp(24px, 3vw, 40px); user-select: none; }
.e404-num em { display: inline-block; color: var(--red); animation: e404-spin 9s var(--ease, ease) infinite; }
@keyframes e404-spin { 0%, 70% { transform: rotate(0); } 85%, 100% { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .e404-num em { animation: none; } }
