/* Extras page. Builds on home.css (dark, warm theme). */

.x-top { position: absolute; top: 0; left: 0; right: 0; z-index: 5; padding: var(--gutter); }

/* Reveal on scroll (inner.js adds .js and .active) */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s cubic-bezier(.16, 1, .3, 1), transform .9s cubic-bezier(.16, 1, .3, 1); }
.js .reveal.active { opacity: 1; transform: none; }

/* Intro */
.x-intro { padding-top: clamp(9rem, 20vw, 17rem); padding-bottom: clamp(4rem, 9vw, 8rem); }
.x-eyebrow { color: var(--accent); font-size: .8rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 1.5rem; }

/* Chapters */
.x-chap { padding-block: clamp(3rem, 7vw, 6rem) clamp(4rem, 9vw, 8rem); border-top: 1px solid var(--line); }
.x-head { display: flex; align-items: flex-end; gap: clamp(.9rem, 2vw, 1.75rem); }
.x-num { color: var(--accent); font-size: .9rem; font-weight: 800; letter-spacing: .14em; padding-bottom: 1.1em; }
.x-title { font-size: clamp(3.5rem, 13vw, 13rem); font-weight: 800; line-height: .88; letter-spacing: -.05em; text-transform: uppercase; }
#football .x-head { margin-bottom: clamp(2.5rem, 6vw, 5rem); }

/* Text blocks */
.x-lead { font-size: clamp(1.4rem, 2.6vw, 2.3rem); font-weight: 600; line-height: 1.18; letter-spacing: -.03em; margin-bottom: 1.5rem; max-width: 18em; }
.x-copy { color: var(--sand-dim); max-width: 46ch; margin-bottom: 1.25rem; }
.x-link { color: var(--sand); border-bottom: 1px solid var(--line); transition: border-color .2s; }
.x-link:hover { border-color: var(--accent); }
.fb-text .meta-list, .fs-text .meta-list { margin-top: 2rem; max-width: 34rem; }

/* Photos */
.x-fig { overflow: hidden; border-radius: 1rem; background: var(--ink-2); position: relative; }
.x-fig img { width: 100%; height: 100%; object-fit: cover; will-change: transform; }

/* Football collage: portrait left, text + square staggered on the right, wide frame below */
.x-collage { display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(.75rem, 2vw, 1.5rem); align-items: start; }
.fb-a { grid-column: 1 / span 5; grid-row: 1 / span 2; align-self: stretch; min-height: 32rem; }
.fb-text { grid-column: 7 / span 6; grid-row: 1; padding-top: clamp(0rem, 3vw, 3rem); }
.fb-a img { object-position: 100% 50%; transform-origin: 100% 50%; }
.fb-b { grid-column: 8 / span 4; grid-row: 2; aspect-ratio: 1; margin-top: clamp(1rem, 4vw, 4rem); }
.fb-c { grid-column: 1 / -1; grid-row: 3; aspect-ratio: 21 / 9; margin-top: clamp(.5rem, 3vw, 2.5rem); }
.x-pull { margin-top: clamp(2.5rem, 6vw, 5rem); margin-left: auto; max-width: 14em; font-size: clamp(1.85rem, 4.7vw, 4.4rem); font-weight: 600; line-height: 1.13; letter-spacing: -.035em; text-align: right; }

/* Formula Student: full-bleed opener with the title laid over the car */
.x-fs { position: relative; min-height: 100vh; min-height: 100svh; display: flex; align-items: flex-end; overflow: hidden; border-top: 1px solid var(--line); }
.x-fs > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 55%; filter: brightness(.72) saturate(.95); will-change: transform; }
.x-fs::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, var(--ink) 0%, rgba(17,16,13,.5) 28%, rgba(17,16,13,0) 60%); pointer-events: none; }
.x-fs-head { position: relative; z-index: 1; width: 100%; padding-bottom: clamp(1.5rem, 4vw, 3rem); }

.x-chap-fs { border-top: 0; padding-top: clamp(2.5rem, 6vw, 5rem); }
.x-fs-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(1.5rem, 4vw, 4rem); align-items: center; }
.fs-text { grid-column: 1 / span 5; }
.fs-img { grid-column: 6 / span 7; aspect-ratio: 3 / 2; }

/* Simulator video */
.fs-video { margin-top: clamp(2rem, 5vw, 4rem); aspect-ratio: 16 / 9; }
.fs-video video { width: 100%; height: 100%; object-fit: cover; display: block; }
.x-caption { margin-top: .9rem; color: var(--sand-dim); font-size: .85rem; }

/* 03 PC building: the vertical build video stays pinned while the rest scrolls past */
.x-pc, .x-car { padding-block: clamp(3rem, 7vw, 6rem) clamp(4rem, 9vw, 8rem); border-top: 1px solid var(--line); }
.x-pc .x-head, .x-car .x-head { margin-bottom: clamp(2.5rem, 6vw, 5rem); }
.pc-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(1.5rem, 4vw, 4rem); align-items: start; }
.pc-main { --pc-h: min(calc(100svh - 11rem), 56rem); grid-column: 1 / span 5; position: sticky; top: calc(50svh - var(--pc-h) / 2); height: var(--pc-h); aspect-ratio: 9 / 16; max-width: 100%; justify-self: start; }
.pc-main video, .pc-wide video, .pc-tall video { width: 100%; height: 100%; object-fit: cover; display: block; }
.pc-flow { grid-column: 7 / span 6; display: flex; flex-direction: column; gap: clamp(1rem, 2.5vw, 2rem); }
.pc-flow .x-caption { margin-top: -.5rem; }
.pc-text { padding-bottom: clamp(1rem, 3vw, 2.5rem); }
.pc-wide { aspect-ratio: 4 / 3; }
.pc-duo { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(.75rem, 2vw, 1.5rem); align-items: start; }
.pc-tall { aspect-ratio: 3 / 4; }
.pc-drop { margin-top: clamp(1.5rem, 5vw, 4rem); }
.pc-desk { width: 62%; align-self: flex-end; aspect-ratio: 828 / 614; }
.pc-desk img { height: 100%; }

/* 04 Car photography: tall opener, then a masonry wall */
.x-title-long { font-size: clamp(3rem, 10.5vw, 11rem); }
.car-hero { display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(1.5rem, 4vw, 4rem); align-items: start; }
.car-main { grid-column: 1 / span 6; grid-row: 1 / span 2; align-self: stretch; min-height: 36rem; }
.car-text { grid-column: 8 / span 5; grid-row: 1; padding-top: clamp(0rem, 3vw, 3rem); }
.car-link { margin-top: 2rem; }
.car-side { grid-column: 8 / span 5; grid-row: 2; align-self: end; aspect-ratio: 3 / 2; }
.car-mason { column-count: 3; column-gap: clamp(.75rem, 2vw, 1.5rem); margin-top: clamp(3rem, 7vw, 6rem); }
.car-mason .x-fig { break-inside: avoid; margin-bottom: clamp(.75rem, 2vw, 1.5rem); }
.car-mason .x-fig img { height: auto; transition: transform .9s cubic-bezier(.16, 1, .3, 1); will-change: auto; }
.car-mason .x-fig:hover img { transform: scale(1.05); }

/* Closing */
.contact-title { max-width: 11em; }

@media (max-width: 900px) {
  .x-collage, .x-fs-grid { display: flex; flex-direction: column; gap: 1.25rem; }
  .fb-a { aspect-ratio: 4 / 5; min-height: 0; align-self: auto; }
  .fb-b { aspect-ratio: 1; margin-top: 0; width: 78%; align-self: flex-end; }
  .fb-c { aspect-ratio: 16 / 10; margin-top: 0; }
  .fb-text { padding-top: 1.5rem; }
  .fs-img { aspect-ratio: 3 / 2; }
  .pc-grid, .car-hero { display: flex; flex-direction: column; gap: 1.25rem; }
  .pc-main { position: relative; top: 0; height: min(78svh, 40rem); align-self: center; }
  .pc-flow { gap: 1rem; }
  .pc-desk { width: 100%; }
  .car-main { aspect-ratio: 2 / 3; min-height: 0; align-self: auto; }
  .car-side { width: 100%; }
  .car-text { padding-top: 1rem; }
  .car-mason { column-count: 2; }
  .x-pull { text-align: left; margin-left: 0; }
  .x-fs { min-height: 78svh; }
}

@media (max-width: 640px) {
  .x-title-long { font-size: 9.2vw; }
}

@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .x-fig img, .x-fs > img { transform: none !important; }
  .car-mason .x-fig:hover img { transform: none !important; }
}
