/* fling.md's header and footer, the same as flinger.ai's (Altitude, Dusk). One file for every page that has them:
   the site's own pages (with style.css) and Flinglet's pages (/ideas, /wishes, an idea's page, with flinglet-dusk.css).
   Its own --fl-* names, so it cannot collide with either stylesheet's tokens. The script for the header (floating
   pill, reading line, menu) is /site.js; without it the bar stays put and the links stay in the bar. */

:root {
  --fl-night: #080E0A; --fl-forest: #152316; --fl-mint: #D4EDCC; --fl-moss: #86A681; --fl-leaf: #8AC969;
  --fl-acid: #B8FF53; --fl-lime: #CEFF3F; --fl-cream: #F4F0E5; --fl-ink: #1C2119; --fl-line: #26452A; --fl-line-soft: #1B2E1D;
  --fl-sans: "Arimo", Arial, Helvetica, sans-serif; --fl-mono: "Inconsolata", ui-monospace, Menlo, monospace;
  --fl-bar-h: 64px; --fl-frame: 1320px;
  --fl-ease: cubic-bezier(.16, 1, .3, 1); --fl-fast: .25s; --fl-base: .5s;
}

/* Day (the sun): the bar sits on a cream sky, so its words and logo are ink and the floating pill is paper.
   The footer stays a night planet surface in every theme. */
:root[data-theme="light"] .top { --fl-mint: #1C2119; --fl-lime: #1C2119; --fl-acid: #CEFF3F; }
:root[data-theme="light"] .top.float .bar { background: rgba(255, 251, 238, .94); border-color: rgba(28, 33, 25, .22); }
:root[data-theme="light"] .top .nav a[aria-current="page"] { background: #1C2119; color: #F4F0E5; }
:root[data-theme="light"] .top .nav a:hover { color: #A33D19; }
:root[data-theme="light"] .top .start { background: #1C2119; color: #F4F0E5; }
:root[data-theme="light"] .top .start:hover { background: #FF6B35; color: #1C2119; }
:root[data-theme="light"] .top .progress { background: #FF6B35; }
:root[data-theme="light"] .top .md { border-color: #1C2119; background: #CEFF3F; }
:root[data-theme="light"] .top :focus-visible { outline-color: #1C2119; }
@media (max-width: 999px) { :root[data-theme="light"] .has-menu.open .nav { background: #F4F0E5; border-bottom-color: #CFCCBF; } :root[data-theme="light"] .has-menu.open .nav a { border-bottom-color: #E6E3D6; } :root[data-theme="light"] .has-menu.open .nav a[aria-current="page"] { color: #A33D19; background: none; } }
/* Terminal (the star): phosphor green on deep green, header and footer alike */
:root[data-theme="terminal"] { --fl-night: #05130C; --fl-mint: #C9F7D8; --fl-moss: #5D9C77; --fl-leaf: #00FF88; --fl-acid: #00FF88; --fl-lime: #00FF88; --fl-line: #10301F; --fl-line-soft: #0B2614; --fl-sans: var(--fl-mono); }
:root[data-theme="terminal"] .top.float .bar { background: rgba(5, 19, 12, .94); border-color: rgba(0, 255, 136, .25); }
:root[data-theme="terminal"] .top .md { background: #00FF88; border-color: #05130C; color: #04180D; }
:root[data-theme="terminal"] .top .start { background: #00FF88; color: #04180D; }

/* the frame both the bar and the footer sit in: flinger.ai's .wrap */
.top-in, .foot-in { width: 100%; max-width: var(--fl-frame); margin-inline: auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
@media (min-width: 768px) { .top-in, .foot-in { padding-left: max(40px, env(safe-area-inset-left, 0px)); padding-right: max(40px, env(safe-area-inset-right, 0px)); } }

/* ── header: clear over the opening sky; once you scroll it floats as a pill with a lime line for how far you've read */
/* header.top, not .top: Flinglet's own stylesheets (make.css, edition.css) give a .top of theirs padding and a width */
header.top { position: fixed; left: 0; right: 0; top: 0; z-index: 30; display: block; max-width: none; margin: 0; padding: env(safe-area-inset-top, 0px) 0 0; gap: 0; pointer-events: none; font-family: var(--fl-sans); }
.top .bar { position: relative; pointer-events: auto; margin: 0 auto; max-width: 100%; background: transparent; border: 1px solid transparent; border-top: 0; }
.top.float .bar { margin-top: 10px; max-width: min(1280px, calc(100% - 24px)); border-radius: 16px; border: 1px solid rgba(212, 237, 204, .16); background: rgba(8, 14, 10, .92); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
@media (min-width: 1000px) { .top.float .bar { border-radius: 999px; } }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: var(--fl-bar-h); }
.top.float .top-in { min-height: 58px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(10px, env(safe-area-inset-right, 0px)); }
@media (min-width: 768px) { .top.float .top-in { padding-left: 24px; padding-right: 10px; } }
.top .progress { position: absolute; left: 16px; right: 16px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--fl-acid); transform: scaleX(var(--read-p, 0)); transform-origin: 0 50%; opacity: 0; }
.top.float .progress { opacity: 1; left: 24px; right: 24px; }
.top :focus-visible, .site-foot :focus-visible { outline: 3px solid var(--fl-acid); outline-offset: 3px; }

/* the logo: the design team's wordmark by mask, lime, with the .md badge over the "er" */
.top .home { position: relative; display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; color: var(--fl-lime); text-decoration: none; }
.top .logo-mark {
  display: block; height: 28px; aspect-ratio: 616 / 134; background: var(--fl-lime);
  -webkit-mask: url("/logo.svg") center / contain no-repeat; mask: url("/logo.svg") center / contain no-repeat;
}
.top .md {
  /* sits on the "er" only: in the 616-wide wordmark the g ends at 483 (101px at this height) and the e starts at 494,
     so the badge starts on the e and the whole g, tail included, stays in view */
  position: relative; z-index: 1; margin: .6rem 0 0 -1.4rem; padding: .24rem .34rem;
  font: 700 .72rem/1 var(--fl-mono); letter-spacing: .02em;
  border: 1px solid var(--fl-night); border-radius: 3px; background: var(--fl-cream); color: var(--fl-ink);
  transform: rotate(-12deg); transform-origin: 30% 70%;
}

.top .nav { display: flex; flex-wrap: wrap; gap: 4px; font: 700 15px var(--fl-mono); }
.top .nav a { position: relative; display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px; color: var(--fl-mint); text-decoration: none; white-space: nowrap; }
.top .nav a:hover { color: var(--fl-acid); }
.top .nav a[aria-current="page"] { background: var(--fl-acid); color: var(--fl-night); }
.top-acts { display: flex; align-items: center; gap: 10px; }
.top .start {
  display: inline-flex; align-items: center; min-height: 44px; padding: 10px 18px; border-radius: 3px; border: 0;
  font: 700 15px var(--fl-sans); text-decoration: none; background: var(--fl-mint); color: var(--fl-night);
}
.top .start:hover { background: var(--fl-cream); }

/* phones and small tablets: a menu button opens the links as a sheet (without script the links stay in the bar) */
.menu-btn { display: none; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid currentColor; border-radius: 7px; background: transparent; color: var(--fl-mint); cursor: pointer; }
.menu-btn span, .menu-btn span::before, .menu-btn span::after { display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; }
.menu-btn span { position: relative; }
.menu-btn span::before, .menu-btn span::after { content: ""; position: absolute; left: 0; }
.menu-btn span::before { top: -6px; } .menu-btn span::after { top: 6px; }
.menu-btn[aria-expanded="true"] span { background: transparent; }
.menu-btn[aria-expanded="true"] span::before { top: 0; transform: rotate(45deg); }
.menu-btn[aria-expanded="true"] span::after { top: 0; transform: rotate(-45deg); }
@media (max-width: 999px) {
  .has-menu .menu-btn { display: grid; }
  .has-menu .nav { display: none; }
  .has-menu.open .nav {
    position: fixed; left: 0; right: 0; top: calc(var(--fl-bar-h) + env(safe-area-inset-top, 0px)); z-index: 49;
    display: grid; gap: 0; padding: 8px max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px));
    background: var(--fl-night); border-bottom: 1px solid var(--fl-line);
  }
  .has-menu.open.float .nav { top: calc(58px + 10px + env(safe-area-inset-top, 0px)); }
  .has-menu.open .nav a { min-height: 56px; padding: 0; border-radius: 0; border-bottom: 1px solid var(--fl-line-soft); font: 700 clamp(22px, 6vw, 28px) var(--fl-mono); text-transform: uppercase; background: none; color: var(--fl-mint); }
  .has-menu.open .nav a[aria-current="page"] { color: var(--fl-acid); }
  .top:not(.has-menu) .top-in { flex-wrap: wrap; padding-block: 8px; }
}
@media (max-width: 480px) { .top .start { display: none; } }

/* ── footer: a planet surface rising on a curved horizon, a giant outlined wordmark, the links ─────────────────────── */
.site-foot { position: relative; margin-top: clamp(36px, 6.5vw, 90px); padding-top: 8px; background: var(--fl-night); color: var(--fl-mint); font-family: var(--fl-sans); }
.site-foot::before { content: ""; position: absolute; left: 0; right: 0; top: calc(1px - clamp(36px, 6.5vw, 90px)); height: clamp(36px, 6.5vw, 90px); background: var(--fl-night); border-top: 2px solid var(--fl-leaf); border-radius: 50% 50% 0 0 / 100% 100% 0 0; pointer-events: none; }
.giant { display: flex; justify-content: center; margin: 0 0 .24em; font: 700 clamp(64px, 17vw, 250px)/.9 var(--fl-sans); letter-spacing: -.06em; color: transparent; -webkit-text-stroke: 2px rgba(138, 201, 105, .7); user-select: none; }
.giant span { display: inline-block; cursor: default; }
.giant span:hover { color: var(--fl-acid); -webkit-text-stroke-color: var(--fl-acid); }
.giant .dot { color: rgba(184, 255, 83, .2); }
.foot-row { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 8px 16px; flex-wrap: wrap; padding-block: 20px 8px; border-top: 1px solid var(--fl-line-soft); font: 400 14px var(--fl-mono); }
.foot-row nav { display: flex; flex-wrap: wrap; gap: 0 20px; }
.foot-row a, .foot-row span { display: inline-flex; align-items: center; min-height: 44px; color: var(--fl-mint); }
.foot-row a { text-decoration: underline; text-decoration-color: var(--fl-leaf); text-underline-offset: .2em; }
.foot-row a:hover { color: var(--fl-acid); }
.site-foot .foot-note { margin: .5rem 0 0; padding-bottom: 2rem; font: 400 13px var(--fl-mono); color: var(--fl-moss); }

@media (prefers-reduced-motion: no-preference) {
  .top .bar { transition: margin var(--fl-base) var(--fl-ease), max-width var(--fl-base) var(--fl-ease), border-radius var(--fl-base), border-color var(--fl-base), background-color var(--fl-base); }
  .top .top-in { transition: min-height var(--fl-base); }
  .top .progress { transition: opacity var(--fl-base); }
  .top .nav a, .top .start, .foot-row a { transition: color var(--fl-fast), background-color var(--fl-fast); }
  .top .md { transition: transform .25s cubic-bezier(.3, 1.6, .5, 1); }
  .top .home:hover .md { transform: rotate(-3deg) translateY(-1px); }
  .giant span { transition: color var(--fl-fast), -webkit-text-stroke-color var(--fl-fast), transform var(--fl-base) var(--fl-ease); }
  .giant span:hover { transform: translateY(-.06em); }
}
