/* Emberwing Labs site. Builds on tokens.css. All motion is gated by prefers-reduced-motion. */
@font-face { font-family: "Inter"; src: url(/assets/fonts/inter-var-latin.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; font-size: var(--ew-fs-md); overflow-x: hidden; }
img { max-width: 100%; height: auto; }
a { text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--ew-ember); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 10; background: var(--ew-gold); color: #000; padding: 10px 16px; border-radius: var(--ew-radius-sm); font-weight: 600; }
.skip:focus { top: 12px; color: #000; }

/* Background: faint gold sparkles drifting across the black */
.sky { position: fixed; inset: -20% 0 0 0; z-index: -1; pointer-events: none; opacity: .55;
  
  background-size: 640px 640px; }
.sky::after { content: ""; position: absolute; inset: 0; background: var(--ew-glow); }

/* Header */
.top { display: flex; align-items: center; justify-content: flex-start; gap: 16px; flex-wrap: wrap; max-width: var(--ew-content); margin: 0 auto; padding: 20px 24px; }
.brand { display: inline-flex; padding: 4px; }
.brand img { height: 40px; width: auto; display: block; }
nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 0; padding: 0; }
nav a { color: var(--ew-text); text-decoration: none; font-size: var(--ew-fs-sm); padding: 6px 2px; border-bottom: 1px solid transparent; }
nav a:hover { color: var(--ew-gold-bright); border-bottom-color: var(--ew-line); }
nav a[aria-current="page"] { color: var(--ew-gold); border-bottom-color: var(--ew-gold); }

main { max-width: var(--ew-content); margin: 0 auto; padding: 0 24px 32px; }
h1, h2, h3 { line-height: var(--ew-lh-tight); font-weight: var(--ew-fw-semibold); margin: 0; }
h1 { font-size: var(--ew-fs-2xl); letter-spacing: -.01em; background: linear-gradient(90deg, #F2C27E, #FFD9A0 45%, #F2C27E); -webkit-background-clip: text; background-clip: text; color: var(--ew-gold); -webkit-text-fill-color: transparent; }
h2 { font-size: var(--ew-fs-xl); color: var(--ew-gold); }
h3 { font-size: var(--ew-fs-lg); color: var(--ew-gold); }

/* Hero / intro opener */
.hero { position: relative; text-align: center; padding: 48px 0 24px; }
.hero-glow { position: absolute; inset: 0;  pointer-events: none; }
.hero-logo { position: relative; width: 320px; display: block; margin: 0 auto; }
.intro-line { position: relative; margin: 8px 0 28px; color: var(--ew-gold); text-transform: uppercase; letter-spacing: var(--ew-tracking-kicker); font-size: var(--ew-fs-sm); font-weight: var(--ew-fw-light); }
.hero h1 { position: relative; }
.sub { position: relative; color: var(--ew-text); font-size: var(--ew-fs-lg); font-weight: var(--ew-fw-light); max-width: 34ch; margin: 16px auto 0; }
.hs { position: absolute; width: 14px; color: var(--ew-gold-bright); }
.hs .ew-accent { width: 100%; }
.h1s { left: 18%; top: 14%; } .h2s { right: 20%; top: 24%; width: 10px; opacity: .7; } .h3s { left: 26%; top: 46%; width: 8px; opacity: .6; } .h4s { right: 16%; top: 52%; width: 18px; opacity: .8; }

.divider { display: block; max-width: 480px; margin: 56px auto; color: var(--ew-gold); }
.prose { max-width: 68ch; margin: 0 auto 48px; }
.prose p { margin: 0 0 16px; }
.page-head { max-width: 68ch; margin: 32px auto 32px; }
.lead { font-size: var(--ew-fs-lg); font-weight: var(--ew-fw-light); margin: 16px 0 0; }
.about-logo { display: block; width: 240px; margin: 0 auto 24px; }
.links, .contact { list-style: none; padding: 0; margin: 16px 0; }
.links li, .contact li { margin: 8px 0; }
.privacy { color: var(--ew-muted); }
.privacy strong { color: var(--ew-text); font-weight: 600; }

/* Section heading with its dragonfly */
.sec-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.df-wrap { width: 40px; flex: none; color: var(--ew-gold-bright); }
.df-wrap svg { transform: rotate(90deg); overflow: visible; }
.ew-dragonfly [data-p="wa"] { transform-origin: 31px 23px; } .ew-dragonfly [data-p="wb"] { transform-origin: 33px 23px; }
.ew-dragonfly [data-p="wc"] { transform-origin: 31px 28px; } .ew-dragonfly [data-p="wd"] { transform-origin: 33px 28px; }

/* App cards */
.apps { margin-bottom: 48px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 24px; }
.grid.one { grid-template-columns: minmax(0, 760px); justify-content: center; }
.app-card { position: relative; background: var(--ew-surface); border: 1px solid var(--ew-line); border-radius: var(--ew-radius-lg); overflow: visible; transition: box-shadow var(--ew-slow) var(--ew-ease), border-color var(--ew-slow) var(--ew-ease), transform var(--ew-slow) var(--ew-ease); }
.app-art { display: block; width: 100%; border-radius: var(--ew-radius-lg) var(--ew-radius-lg) 0 0; }
.app-body { padding: 20px 24px 24px; }
.app-body p { margin: 10px 0; }
.kw { color: var(--ew-gold); font-size: var(--ew-fs-sm); letter-spacing: .02em; }
.saucy { font-style: italic; color: var(--ew-gold); }
.app-card:hover, .app-card:focus-within, .app-card.glow { border-color: rgba(242,194,126,.7);  }
.spark { position: absolute; top: -4px; right: -4px; width: 12px; height: 12px; background: var(--ew-gold-bright); opacity: 0; pointer-events: none;
  -webkit-mask: url(/assets/accents/sparkle.svg) center/contain no-repeat; mask: url(/assets/accents/sparkle.svg) center/contain no-repeat; }
.spark.s2 { width: 8px; height: 8px; } .spark.s3 { width: 6px; height: 6px; }

/* Buttons */
.btns { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.btn { position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 10px 20px; border-radius: var(--ew-radius-pill); background: var(--ew-gold); color: #000; font-weight: 600; text-decoration: none; overflow: hidden; border: 1px solid var(--ew-gold); }
.btn:hover { color: #000; background: var(--ew-gold-bright); }
.btn-ghost { background: transparent; color: var(--ew-gold); }
.btn-ghost:hover { background: rgba(242,194,126,.1); color: var(--ew-gold-bright); }
.btn span { position: relative; z-index: 1; }
.btn::after { content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.55), transparent); transform: skewX(-20deg); opacity: 0; }

/* Footer */
.foot { text-align: center; padding: 0 24px 40px; color: var(--ew-muted); font-size: var(--ew-fs-sm); }
.foot .divider { margin-top: 24px; }
.foot-logo { display: block; width: 160px; margin: 0 auto 12px; }
.foot nav ul { justify-content: center; }

/* ===== Motion (only when the visitor allows it) ===== */
@media (prefers-reduced-motion: no-preference) {
  .sky { animation: ew-drift 120s linear infinite; }
  .sky::before { content: ""; position: absolute; inset: 0;  background-size: 520px 520px; animation: ew-drift 90s linear infinite reverse, ew-twinkle-bg 6s ease-in-out infinite; }
  /* hero opener echoes the intro: logo glows in, line rises under it */
  .hero-logo { animation: ew-logo-in 1.4s var(--ew-ease) both; }
  .intro-line { animation: ew-rise 1s var(--ew-ease) .7s both; }
  .hero h1 { animation: ew-rise 1s var(--ew-ease) 1s both; }
  .sub { animation: ew-rise 1s var(--ew-ease) 1.2s both; }
  .hs .ew-accent { animation: ew-twinkle 2.4s ease-in-out infinite; }
  .h2s .ew-accent { animation-delay: .6s; } .h3s .ew-accent { animation-delay: 1.2s; } .h4s .ew-accent { animation-delay: 1.8s; }
  /* dragonfly glides in and lands by its heading */
  .fx .reveal .df-wrap { opacity: 0; transform: translate(-90px, -50px) rotate(-25deg) scale(.8); }
  .fx .reveal.in-view .df-wrap { animation: ew-glide 1.8s var(--ew-ease) forwards; }
  /* cards: hover glow + sparks drifting off the top-right corner */
  .app-card:hover .spark, .app-card:focus-within .spark, .app-card.glow .spark { animation: ew-spark 1.4s ease-out infinite; }
  .app-card .s2 { animation-delay: .35s !important; } .app-card .s3 { animation-delay: .7s !important; }
  .app-card:hover { transform: translateY(-2px); }
  /* buttons: wing-flutter shimmer on hover, focus or tap */
  .btn:hover::after, .btn:focus-visible::after, .btn:active::after { animation: ew-shimmer .9s var(--ew-ease); }
  .btn:hover, .btn:focus-visible, .btn:active { animation: ew-wingbeat .5s var(--ew-ease); }
}
/* Touch devices: no hover, so the glow plays once when the card scrolls into view */
@media (hover: none) and (prefers-reduced-motion: no-preference) {
  .fx .app-card.in-view { animation: ew-glow-once 2.4s var(--ew-ease) 1; }
  .fx .app-card.in-view .spark { animation: ew-spark 1.4s ease-out 2; }
}
@keyframes ew-drift { from { background-position: 0 0; } to { background-position: 640px -640px; } }
@keyframes ew-twinkle-bg { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }
@keyframes ew-logo-in { from { opacity: 0; transform: scale(.94);  } 60% {  } to { opacity: 1; transform: none;  } }
@keyframes ew-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes ew-glide { 0% { opacity: 0; transform: translate(-90px, -50px) rotate(-25deg) scale(.8); } 20% { opacity: 1; } 70% { transform: translate(6px, 4px) rotate(6deg) scale(1); } 100% { opacity: 1; transform: none; } }
@keyframes ew-spark { 0% { opacity: 0; transform: translate(0, 0) scale(.4) rotate(0); } 25% { opacity: 1; } 100% { opacity: 0; transform: translate(18px, -22px) scale(1) rotate(90deg); } }
@keyframes ew-shimmer { from { left: -60%; opacity: 1; } to { left: 130%; opacity: 0; } }
@keyframes ew-wingbeat { 0%, 100% { transform: none; } 30% { transform: scaleY(.94) skewX(-2deg); } 60% { transform: scaleY(1.03) skewX(1deg); } }
@keyframes ew-glow-once { 0%, 100% {  } 40% {  border-color: rgba(242,194,126,.7); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
@media (max-width: 560px) { .top { justify-content: center; } .hero-logo { width: 240px; } .divider { margin: 40px auto; } }
.app-body { padding: 24px; }
.app-title { display: flex; align-items: center; gap: 16px; }
.app-icon { width: 64px; height: 64px; border-radius: 16px; flex: none; }
.grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); }
.app-card::before { content: ""; position: absolute; inset: 0; border-radius: inherit;  pointer-events: none; }
.top nav { margin-left: auto; } @media (max-width: 560px) { .top nav { margin-left: 0; } }
/* fixes: one sentence per line; centred app grid that still grows to 2+ cards */
h1, h2 { text-wrap: balance; }
.tagline span { display: block; }
.grid, .grid.one { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 520px)); justify-content: center; }
/* hero text/logo never start fully hidden */
@keyframes ew-rise { from { opacity: .85; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes ew-logo-in { from { opacity: .85; transform: scale(.97);  } 60% {  } to { opacity: 1; transform: none;  } }
.intro-line { text-wrap: balance; }
@media (max-width: 560px) { .intro-line { font-size: var(--ew-fs-xs); letter-spacing: .12em; } }

/* ===== Wing Circuit (home hero + light echoes on other pages) ===== */
.hero.circuit { min-height: min(86svh, 760px); display: grid; place-items: center; padding: 72px 16px 40px; overflow: hidden; isolation: isolate; }
.veins { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; opacity: .5; }
.veins path { stroke-width: 1.3; vector-effect: non-scaling-stroke; }
.veins .bodyv { stroke-width: 2.5; }
.veins .pad { fill: #ffe9a8; stroke: none; }
.hero-core { position: relative; padding: 24px;  }
.term { position: absolute; left: max(16px, 4%); top: 16px; margin: 0; z-index: 1; font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; color: #c9a548; opacity: .7; text-align: left; white-space: pre-wrap; max-width: 92vw; min-height: 7.8em; }
.hero.booted .hero-logo, .hero-core:hover .hero-logo, .hero-core:active .hero-logo {  }
.hero.static .term { opacity: .45; }
.embers { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.embers i { position: absolute; width: var(--sz); height: var(--sz); border-radius: 50%; background: #f2c27e; opacity: 0;  }
.kicker { font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; color: #c9a548; opacity: .8; margin: 0 0 10px; }
.kicker .prompt { color: var(--ew-ember); }
.caret { display: inline-block; width: .55em; height: 1em; margin-left: 4px; vertical-align: -2px; background: #c9a548; opacity: .7; }
.trace { display: block; width: min(100%, 480px); height: 24px; margin: -6px 0 8px; color: var(--ew-gold); opacity: .55; }
.page-head h1 {  }
@media (prefers-reduced-motion: no-preference) {
  .veins path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: ew-draw 1.6s var(--ew-ease) forwards; }
  .veins .pad { opacity: 0; animation: ew-pad .4s ease-out forwards; }
  .veins .d0 { animation-delay: .0s; } .veins .d1, .veins .d8 { animation-delay: .1s; } .veins .d2, .veins .d7 { animation-delay: .2s; } .veins .d3, .veins .d6 { animation-delay: .3s; } .veins .d4, .veins .d5 { animation-delay: .4s; }
  .veins .pad { animation-delay: 1.6s !important; }
  .hero.static .veins path, .hero.static .veins .pad { animation: none; stroke-dashoffset: 0; opacity: 1; }
  .hero.circuit .hero-logo { animation: none; transition: filter .9s var(--ew-ease); }
  .hero.circuit .intro-line, .hero.circuit h1, .hero.circuit .sub { animation-delay: .2s; }
  .hero.booted .hero-logo { animation: ew-glow-in 1.2s var(--ew-ease) both; }
  .hero.static .hero-logo { animation: none; }
  .veins .pulse { stroke: #fff3c4; stroke-width: 2.4; stroke-dasharray: .07 .93; stroke-dashoffset: 1; animation: ew-pulse 2.2s ease-in-out forwards;  }
  .embers i { animation: ew-ember 30s linear infinite; }
  .hero.paused .embers i, .hero.paused .pulse { animation-play-state: paused; }
  .caret { animation: ew-caret 1.1s steps(1) infinite; }
  .fx .reveal .trace path { stroke-dasharray: 1; stroke-dashoffset: 1; }
  .fx .reveal.in-view .trace path { animation: ew-draw 1.4s var(--ew-ease) .2s forwards; }
}
@keyframes ew-draw { to { stroke-dashoffset: 0; } }
@keyframes ew-pad { to { opacity: 1; } }
@keyframes ew-pulse { 0% { stroke-dashoffset: 1; opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { stroke-dashoffset: -.02; opacity: 0; } }
@keyframes ew-ember { 0% { opacity: 0; transform: translate(0, 0); } 20% { opacity: .35; } 80% { opacity: .25; } 100% { opacity: 0; transform: translate(30px, -120px); } }
@keyframes ew-caret { 50% { opacity: 0; } }
@keyframes ew-glow-in { from {  } 50% {  } to {  } }
@media (max-width: 560px) { .term { font-size: 9.5px; min-height: 7.8em; } .hero.circuit { padding-top: 112px; } .veins { opacity: .38; } .kicker { font-size: 12px; } }
@media (prefers-reduced-motion: reduce) { .embers, .veins .pulses { display: none; } }
/* Legibility: traces stay behind everything; they fade softly under the text block */
.veins {   }
.hero-core { background: none; isolation: isolate; }
.hero-core::before { content: ""; position: absolute; inset: -12% -18%; z-index: -1; pointer-events: none;  }
@media (max-width: 560px) { .veins {   } .hero-core::before { inset: -8% -10%; } }
/* Fade tune: traces keep ~60% under the text; pulses unmasked; tight halo + text-shadow */
.veins {   }
@media (max-width: 560px) { .veins {   } }
.veins.pulse-layer { -webkit-mask-image: none; mask-image: none; opacity: 1; }
.hero-core::before { display: none; }
.hero.circuit .intro-line, .hero.circuit h1 span, .hero.circuit .sub { position: relative; }
.hero.circuit .intro-line, .hero.circuit h1, .hero.circuit .sub {  }
.hero.circuit h1 span, .hero.circuit .intro-line, .hero.circuit .sub { width: fit-content; margin-inline: auto;  padding-inline: .4em; }

.hero.circuit h1 {   }
.hero.circuit h1 span { background: none; padding-inline: 0; width: auto; }
.hero.circuit h1::before { content: ""; position: absolute; inset: -6% -6%; z-index: -1; pointer-events: none;  }
/* Brighter gold title: lighter gradient, soft tight dark lift + warm glow (no outline) */
.hero.circuit h1 { background-image: linear-gradient(90deg, #FFD27A, #FFF0C2 45%, #FFD27A);  }
.hero.circuit h1::before {  }
.hero.circuit h1::before { display: none; }
/* Dots fix: non-scaling-stroke broke pathLength dashes, so the outer ends of traces never drew and their end pads looked orphaned */
.veins path { vector-effect: none; stroke-width: 1.4; }
.veins .bodyv { stroke-width: 2.6; }
.veins .pulse { stroke-width: 2.6; }
/* Soft sparkling embers: blurred warm glow + slow twinkle, still drifting */
.embers i {   width: calc(var(--sz) * 2); height: calc(var(--sz) * 2); }
.embers i::after { content: ""; position: absolute; inset: -60%; border-radius: 50%;  opacity: .4; }
@media (prefers-reduced-motion: no-preference) {
  .embers i::after { animation: ew-twinkle-soft 3.2s ease-in-out infinite; }
  .embers i:nth-child(3n)::after { animation-duration: 4.4s; animation-delay: -1.3s; }
  .embers i:nth-child(3n+1)::after { animation-duration: 2.7s; animation-delay: -2.1s; }
  .hero.paused .embers i::after { animation-play-state: paused; }
}
@keyframes ew-twinkle-soft { 0%, 100% { opacity: .2; transform: scale(.85); } 50% { opacity: .9; transform: scale(1.15); } }
@keyframes ew-ember { 0% { opacity: 0; transform: translate(0, 0); } 20% { opacity: .55; } 80% { opacity: .4; } 100% { opacity: 0; transform: translate(30px, -120px); } }
/* Crisp title on desktop: small dark lift + very subtle tight warm glow (no large blur) */
.hero.circuit h1 {  }
.hero.circuit .intro-line, .hero.circuit .sub {  }
/* Remove large soft glows that can band into a rainbow oval on some GPUs; keep only small, warm, tight glows */
.hero-glow { display: none; }
.sky::after { background: none; }
.hero.circuit .intro-line, .hero.circuit .sub { background: none; }
.hero.booted .hero-logo, .hero-core:hover .hero-logo, .hero-core:active .hero-logo {  }
@keyframes ew-glow-in { from {  } 50% {  } to {  } }
/* Hover effects: warm gold only, small and tight (big low-alpha blurs can band into rainbow ovals on some GPUs) */
.app-card:hover, .app-card:focus-within, .app-card.glow { border-color: rgba(242,194,126,.7);  }
@keyframes ew-glow-once { 0%, 100% {  } 40% {  border-color: rgba(242,194,126,.7); } }
.app-card::before { background: none; }
.btn::after { background: linear-gradient(100deg, rgba(255,233,168,0), rgba(255,233,168,.45), rgba(255,233,168,0)); }
.btn:hover, .btn:focus-visible {  }
.page-head h1 {  }

.embers i { filter: none;    }
.embers i::after {  }

/* ===== Flat pass: no soft gradients, glows, masks or blurs anywhere (they band into rainbows on some displays) ===== */
html, body { background-color: #000; }
.hero-core { background: none; }
.sky, .hero-glow { display: none; }
.veins { opacity: .6; }
.veins.pulse-layer { opacity: 1; }
.hero.circuit .intro-line, .hero.circuit .sub { text-shadow: 0 1px 0 #000; }
.hero.circuit h1 { text-shadow: none; }
.hero.circuit h1 { filter: none; }
.hero-logo, .hero.booted .hero-logo, .hero-core:hover .hero-logo, .hero-core:active .hero-logo { filter: none; }
.hero.booted .hero-logo { animation: none; }
/* embers: small solid gold dots, opacity twinkle only */
.embers i { width: var(--sz); height: var(--sz); background: #F2C27E; filter: none; }
.embers i::after { content: none; }
.veins .pulse { filter: none; }
/* hover: solid gold border/outline only */
.app-card:hover, .app-card:focus-within, .app-card.glow { border-color: #F2C27E; }
@keyframes ew-glow-once { 0%, 100% { border-color: var(--ew-line); } 40% { border-color: #F2C27E; } }
.btn:hover, .btn:focus-visible { outline: 1px solid #FFB347; outline-offset: 2px; }
