/* fx.css: motion and interaction layer. Every effect is progressive: browsers without
   support simply show the normal page, and prefers-reduced-motion turns movement off. */

/* 1. Page-to-page glide (cross-document View Transitions; Chrome, Edge, Safari 18+) */
@view-transition{navigation:auto}
.topbar{view-transition-name:topbar}
::view-transition-old(root){animation:fx-out .18s ease both}
::view-transition-new(root){animation:fx-in .32s cubic-bezier(.2,.7,.2,1) both}
@keyframes fx-out{to{opacity:0;transform:translateY(-6px)}}
@keyframes fx-in{from{opacity:0;transform:translateY(10px)}}

/* 2. Home hero head-up display (SVG added by site.js) */
.fx-hud{position:absolute;inset:0;z-index:-1;pointer-events:none;color:var(--gold);opacity:.5;mix-blend-mode:screen}
.fx-hud svg{position:absolute;right:6%;top:50%;width:min(46vw,560px);height:auto;transform:translateY(-50%) rotate(var(--roll,0deg));transition:transform .9s cubic-bezier(.2,.7,.2,1)}
.fx-hud .tape{animation:fx-tape 26s linear infinite}
.fx-hud .fpm{animation:fx-float 6s ease-in-out infinite}
@keyframes fx-tape{to{transform:translateX(-120px)}}
@keyframes fx-float{50%{transform:translate(3px,-4px)}}
@media(max-width:850px){.fx-hud{opacity:.3}.fx-hud svg{right:-14%;width:78vw;top:24%}}

/* 3. Scroll-driven touches (only where animation-timeline is supported) */
@supports (animation-timeline:view()){
  .hero-photo img,.page-hero.has-photo::after{animation:fx-push linear both;animation-timeline:scroll(root);animation-range:0 90vh}
  @keyframes fx-push{to{transform:scale(1.08) translateY(3%)}}
  .doc-photo picture{animation:fx-shutter linear both;animation-timeline:view();animation-range:entry 0% entry 60%}
  @keyframes fx-shutter{from{clip-path:inset(0 50% 0 50%)}to{clip-path:inset(0 0 0 0)}}
  .article-main h2::before,.history-prose h2::before,.sf h2::before,.tool-extra h2::before{transform-origin:left;animation:fx-draw linear both;animation-timeline:view();animation-range:entry 10% entry 70%}
  @keyframes fx-draw{from{transform:scaleX(0)}}
}

/* 4. Cockpit-glass glare that follows the pointer (position set by site.js) */
@media(hover:hover){
  .operator-card,.record-card,.hist-card,.card,.pn-card,.variant-card{background-image:radial-gradient(420px circle at var(--mx,50%) var(--my,-40%),rgba(216,163,64,.13),transparent 45%)}
}

/* 5. Buttons: gold sheen on hover, a small press on click or tap */
.button{position:relative;overflow:hidden;transition:transform .12s ease,background-color .2s,color .2s}
.button::after{content:"";position:absolute;inset:0;background:linear-gradient(105deg,transparent 35%,rgba(255,236,190,.45) 50%,transparent 65%);transform:translateX(-120%);pointer-events:none}
.button:hover::after,.button:focus-visible::after{transition:transform .7s ease;transform:translateX(120%)}
.button:active,.quiz-options button:active,.xp-dot:active,.ft-node:active{transform:scale(.97)}

/* 6. Tables: the hovered row lights up with a gold edge */
.compare tbody tr,.spec-table tbody tr,table tbody tr{transition:background-color .2s}
.compare tbody tr:hover,.spec-table tbody tr:hover,.article-main table tbody tr:hover{background:linear-gradient(90deg,rgba(216,163,64,.16),rgba(216,163,64,.04) 40%,transparent);box-shadow:inset 3px 0 0 var(--gold)}

/* 7. Afterburner tip on the reading-progress bar, and the take-off back-to-top jet */
.reading-progress span{position:relative}
.reading-progress span::after{content:"";position:absolute;right:-2px;top:-3px;width:9px;height:9px;border-radius:50%;background:#ffd98a;box-shadow:0 0 10px 3px rgba(255,190,90,.8)}
.back-top svg{width:22px;height:22px;display:block;margin:auto;transition:transform .25s ease}
.back-top:hover svg{transform:translateY(-3px)}

/* Stats strip: lift on hover */
.hero-stats a{transition:transform .2s ease,background-color .2s}
.hero-stats a:hover{transform:translateY(-3px)}

@media(prefers-reduced-motion:reduce){
  @view-transition{navigation:none}
  .fx-hud .tape,.fx-hud .fpm,.hero-photo img,.page-hero.has-photo::after,.doc-photo picture,.article-main h2::before,.history-prose h2::before,.sf h2::before,.tool-extra h2::before{animation:none!important}
  .fx-hud svg,.button,.button::after,.hero-stats a,.back-top svg{transition:none!important}
}
@media print{.fx-hud,.reading-progress{display:none}}

/* ===== Premium finish: depth, light, texture, refined type ===== */
:root{
 --sh-1:0 1px 1px rgba(17,29,40,.05),0 2px 4px rgba(17,29,40,.05);
 --sh-2:0 1px 2px rgba(17,29,40,.06),0 4px 8px rgba(17,29,40,.06),0 12px 24px -6px rgba(17,29,40,.10);
 --sh-3:0 2px 4px rgba(17,29,40,.06),0 10px 20px rgba(17,29,40,.08),0 28px 56px -12px rgba(17,29,40,.22);
 --grain:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
[data-theme=dark]{--sh-1:0 1px 2px #0006;--sh-2:0 2px 6px #0007,0 12px 24px -6px #0009;--sh-3:0 4px 10px #0008,0 28px 56px -12px #000c}

/* Type: balanced headings, no orphan words, tabular numbers, gold selection */
h1,h2,h3,.tl-h{text-wrap:balance}
h1,h2{letter-spacing:-.015em}
p,li,dd,figcaption{text-wrap:pretty}
table,.hero-stats strong,.record-cell strong,.rp-serial,.sf-note,.tl-year{font-variant-numeric:tabular-nums lining-nums}
::selection{background:rgba(216,163,64,.35);color:inherit}
html{scrollbar-color:var(--gold) transparent;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}

/* Depth: layered shadows and a fine top highlight on raised surfaces */
.operator-card,.record-card,.hist-card,.card,.pn-card,.tl-card,.quiz-card,.xp-panel,.paint-controls,.variant-card{box-shadow:var(--sh-2),inset 0 1px 0 rgba(255,255,255,.6)}
[data-theme=dark] .operator-card,[data-theme=dark] .record-card,[data-theme=dark] .hist-card,[data-theme=dark] .card,[data-theme=dark] .tl-card,[data-theme=dark] .quiz-card{box-shadow:var(--sh-2),inset 0 1px 0 rgba(255,255,255,.06)}
/* cut-corner cards clip their own shadow, so the grid casts it (follows the cut exactly) */
.operator-grid,.airframe-cards,.hist-grid,.variant-grid,.tl-item,.quiz-options{filter:drop-shadow(0 1px 1px rgba(17,29,40,.06)) drop-shadow(0 8px 14px rgba(17,29,40,.10))}
[data-theme=dark] .operator-grid,[data-theme=dark] .airframe-cards,[data-theme=dark] .hist-grid,[data-theme=dark] .variant-grid,[data-theme=dark] .tl-item,[data-theme=dark] .quiz-options{filter:drop-shadow(0 8px 14px rgba(0,0,0,.45))}
.doc-photo picture,.doc-photo>img{box-shadow:var(--sh-3)}
.compare,.spec-table,.article-main table{box-shadow:var(--sh-1)}
.answer-panel,.evidence-note,.note{box-shadow:var(--sh-3),inset 0 1px 0 rgba(255,255,255,.08)}

/* Light and texture: film grain on the dark surfaces, a soft glow under the header */
.hero,.page-hero,.footer,.answer-panel,.evidence-note,.note,.topbar{background-image:var(--grain)}
.hero{background-color:#0a131c}
.topbar{box-shadow:0 1px 0 rgba(216,163,64,.18),0 10px 30px -18px rgba(216,163,64,.35)}
.footer{box-shadow:inset 0 30px 60px -40px rgba(216,163,64,.18)}
.page-hero h1,.hero h1{text-shadow:0 2px 24px rgba(0,0,0,.45)}

/* Photo captions and labels: refined, like a museum placard */
.doc-photo figcaption{padding:10px 2px 0;border-top:1px solid var(--line);margin-top:12px;line-height:1.55}
.doc-tag{box-shadow:var(--sh-1)}
.photo-label,.hero-label{backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);background:rgba(17,29,40,.62)!important;border:1px solid rgba(255,255,255,.12)}

/* Links in running text: a gold underline that grows on hover */
.article-main p a,.history-prose p a,.tool-extra p a{text-decoration:none;background:linear-gradient(currentColor,currentColor) 0 100%/100% 1px no-repeat,linear-gradient(var(--gold),var(--gold)) 0 100%/0 2px no-repeat;transition:background-size .3s ease}
.article-main p a:hover,.history-prose p a:hover,.tool-extra p a:hover{background-size:100% 1px,100% 2px}

/* Inputs and focus: a premium gold ring */
:focus-visible{outline:2px solid var(--gold);outline-offset:3px;border-radius:2px}
input[type=search],input[type=text],select,textarea{box-shadow:inset 0 1px 2px rgba(17,29,40,.08)}
input:focus,select:focus,textarea:focus{border-color:var(--gold);box-shadow:0 0 0 4px rgba(216,163,64,.2)}

@media(prefers-reduced-motion:reduce){.article-main p a,.history-prose p a,.tool-extra p a{transition:none}}
@media print{.hero,.page-hero,.footer,.topbar{background-image:none}}
