/* Fonts */
@font-face {
  font-family: 'Iosevka Mayukai Monolite';
  src: url('/fonts/Iosevka Mayukai Monolite Medium Nerd Font Complete.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
}

@font-face {
  font-family: 'Iosevka Mayukai Monolite';
  src: url('/fonts/Iosevka Mayukai Monolite Bold Nerd Font Complete.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
}

@font-face {
  font-family: BitLight;
  src: url('/fonts/bitlight.1fe0875b.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: "04b25";
  src: url('/fonts/04b25.95438b7a.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

/* ── Palette ─────────────────────────────────────────────────────────────────
   Hue-based: every color is an H S% L% channel token. Consume as
   hsl(var(--X-hsl)) solid, or hsl(var(--X-hsl) / α) for opacity variants.
   α snaps to the scale 0 / 0.06 / 0.12 / 0.25 / 0.45 / 0.6 / 0.8 / 1 —
   no freehand alphas at use sites, and each token uses at most 4
   non-zero steps from it.
   ────────────────────────────────────────────────────────────────────────── */
:root {
  /* ── Cools ───────────────────────────────────────────────────────────── */
  --green-hsl:           135 100% 50%;  /* [Ono-Sendai] Phosphor green—the interface's mother tongue. Body text, accents, the system's own murmur in the chat. */
  --cyan-hsl:            188 100% 50%;  /* [Hack] Cold cathode blue. The exec's signature, and every link that jacks you elsewhere. */

  /* ── Warms ───────────────────────────────────────────────────────────── */
  --orange-hsl:          33 100% 68%;   /* [Marigold] Sodium glare. The now-clock, the dive, overdue warnings, mentions, the tarot card come up reversed. */
  --orange-glow-hsl:     24 100% 50%;   /* [Ember] Heat off the clock, and the red under everything—overdue dates, drop zones, the exile switch, every error. */
  --pink-hsl:            340 71% 58%;   /* [Lizzie's] Neon at 3 a.m. The exec bubble's skin, the vain empress, the admin door. */

  /* ── Neutrals ────────────────────────────────────────────────────────── */
  --bg-hsl:              0 0% 0%;       /* [Smoked Glass] always solid. The ground it all stands on—pages, columns, input slabs, the buried past. */
  --surface-hsl:         0 0% 0%;       /* [Smoked Glass] Where dialogs and popups surface from nothing. */
  --scrim-hsl:           0 0% 0%;       /* [Smoked Glass] Frosted dark you read the room through—behind the nav, behind the modals. */
  --gray-hsl:            0 0% 78%;      /* [Silver] Thin chrome. The hours ticking down the timeline. */

  /* ── Category cards (base H S% L% channels per category — same units as
        the palette tokens; size variants = calc offsets from the base,
        computed once here, fetched by card-style.js) ──────────────────────── */
  --cat-self-h:         188;  --cat-self-s:         100%;  --cat-self-l:         50%;  /* [Hack] = --cyan-hsl */
  --cat-social-h:       125;  --cat-social-s:       55%;  --cat-social-l:       68%;  /* [Chatsubo] */
  --cat-interfacing-h:  33;  --cat-interfacing-s:  100%;  --cat-interfacing-l:  68%;  /* [Marigold] = --orange-hsl */
  --cat-hobby-h:        8;  --cat-hobby-s:        85%;  --cat-hobby-l:        68%;  /* [Coral] */
  --card-self-text:                  hsl(var(--cat-self-h) var(--cat-self-s) var(--cat-self-l));
  --card-self-wisp:                 color-mix(in srgb, hsl(var(--cat-self-h) var(--cat-self-s) var(--cat-self-l)) 15%, hsl(var(--bg-hsl)));
  --card-self-idea:                  color-mix(in srgb, hsl(var(--cat-self-h) var(--cat-self-s) var(--cat-self-l)) 25%, hsl(var(--bg-hsl)));
  --card-self-plan:               color-mix(in srgb, hsl(var(--cat-self-h) var(--cat-self-s) var(--cat-self-l)) 80%, hsl(var(--bg-hsl)));
  --card-self-commitment:                 hsl(var(--cat-self-h) var(--cat-self-s) var(--cat-self-l) / 1);
  --card-self-border:                hsl(var(--cat-self-h) calc(var(--cat-self-s) - 10%) calc(var(--cat-self-l) - 8%));
  --card-self-border-bright:         hsl(var(--cat-self-h) calc(var(--cat-self-s) + 15%) calc(var(--cat-self-l) + 10%));
  --card-self-wisp-solid:           color-mix(in srgb, hsl(var(--cat-self-h) var(--cat-self-s) var(--cat-self-l)) 15%, #0a0a0a);
  --card-self-idea-solid:            color-mix(in srgb, hsl(var(--cat-self-h) var(--cat-self-s) var(--cat-self-l)) 25%, #0a0a0a);
  --card-social-text:                hsl(var(--cat-social-h) var(--cat-social-s) var(--cat-social-l));
  --card-social-wisp:               color-mix(in srgb, hsl(var(--cat-social-h) var(--cat-social-s) var(--cat-social-l)) 15%, hsl(var(--bg-hsl)));
  --card-social-idea:                color-mix(in srgb, hsl(var(--cat-social-h) var(--cat-social-s) var(--cat-social-l)) 25%, hsl(var(--bg-hsl)));
  --card-social-plan:             hsl(var(--cat-social-h) calc(var(--cat-social-s) - 25%) calc(var(--cat-social-l) - 14%));
  --card-social-commitment:               hsl(var(--cat-social-h) calc(var(--cat-social-s) - 20%) calc(var(--cat-social-l) + 4%));
  --card-social-border:              hsl(var(--cat-social-h) calc(var(--cat-social-s) - 10%) calc(var(--cat-social-l) - 8%));
  --card-social-border-bright:       hsl(var(--cat-social-h) calc(var(--cat-social-s) + 15%) calc(var(--cat-social-l) + 10%));
  --card-social-wisp-solid:         color-mix(in srgb, hsl(var(--cat-social-h) var(--cat-social-s) var(--cat-social-l)) 15%, #0a0a0a);
  --card-social-idea-solid:          color-mix(in srgb, hsl(var(--cat-social-h) var(--cat-social-s) var(--cat-social-l)) 25%, #0a0a0a);
  --card-interfacing-text:           hsl(var(--cat-interfacing-h) var(--cat-interfacing-s) var(--cat-interfacing-l));
  --card-interfacing-wisp:          color-mix(in srgb, hsl(var(--cat-interfacing-h) var(--cat-interfacing-s) var(--cat-interfacing-l)) 15%, hsl(var(--bg-hsl)));
  --card-interfacing-idea:           color-mix(in srgb, hsl(var(--cat-interfacing-h) var(--cat-interfacing-s) var(--cat-interfacing-l)) 25%, hsl(var(--bg-hsl)));
  --card-interfacing-plan:        hsl(var(--cat-interfacing-h) calc(var(--cat-interfacing-s) - 25%) calc(var(--cat-interfacing-l) - 14%));
  --card-interfacing-commitment:          hsl(var(--cat-interfacing-h) var(--cat-interfacing-s) var(--cat-interfacing-l) / 1);
  --card-interfacing-border:         hsl(var(--cat-interfacing-h) calc(var(--cat-interfacing-s) - 10%) calc(var(--cat-interfacing-l) - 8%));
  --card-interfacing-border-bright:  hsl(var(--cat-interfacing-h) calc(var(--cat-interfacing-s) + 15%) calc(var(--cat-interfacing-l) + 10%));
  --card-interfacing-wisp-solid:    color-mix(in srgb, hsl(var(--cat-interfacing-h) var(--cat-interfacing-s) var(--cat-interfacing-l)) 15%, #0a0a0a);
  --card-interfacing-idea-solid:     color-mix(in srgb, hsl(var(--cat-interfacing-h) var(--cat-interfacing-s) var(--cat-interfacing-l)) 25%, #0a0a0a);
  --card-hobby-text:                 hsl(var(--cat-hobby-h) var(--cat-hobby-s) var(--cat-hobby-l));
  --card-hobby-wisp:                color-mix(in srgb, hsl(var(--cat-hobby-h) var(--cat-hobby-s) var(--cat-hobby-l)) 15%, hsl(var(--bg-hsl)));
  --card-hobby-idea:                 color-mix(in srgb, hsl(var(--cat-hobby-h) var(--cat-hobby-s) var(--cat-hobby-l)) 25%, hsl(var(--bg-hsl)));
  --card-hobby-plan:              hsl(var(--cat-hobby-h) calc(var(--cat-hobby-s) - 25%) calc(var(--cat-hobby-l) - 14%));
  --card-hobby-commitment:                hsl(var(--cat-hobby-h) calc(var(--cat-hobby-s) - 20%) calc(var(--cat-hobby-l) - 6%));
  --card-hobby-border:               hsl(var(--cat-hobby-h) calc(var(--cat-hobby-s) - 10%) calc(var(--cat-hobby-l) - 8%));
  --card-hobby-border-bright:        hsl(var(--cat-hobby-h) calc(var(--cat-hobby-s) + 15%) calc(var(--cat-hobby-l) + 10%));
  --card-hobby-wisp-solid:          color-mix(in srgb, hsl(var(--cat-hobby-h) var(--cat-hobby-s) var(--cat-hobby-l)) 15%, #0a0a0a);
  --card-hobby-idea-solid:           color-mix(in srgb, hsl(var(--cat-hobby-h) var(--cat-hobby-s) var(--cat-hobby-l)) 25%, #0a0a0a);
}

/* Ambient cyberpunk background — injected on every page via _render_page
   (nightfall is composed separately and never gets the markup). */
.cyber-bg {
  position: fixed; inset: 0; z-index: 9990; pointer-events: none;
  mix-blend-mode: screen;
  background:
    repeating-linear-gradient(0deg, hsl(var(--green-hsl) / 0.12) 0,
      hsl(var(--green-hsl) / 0.12) 1px, transparent 1px, transparent 3px),
    radial-gradient(circle at 50% 45%, hsl(var(--green-hsl) / 0.12), transparent 70%);
  animation: cyber-flicker 5s steps(60) infinite, cyber-drift 0.5s linear infinite;
}

@keyframes cyber-flicker {
  0%,100%{opacity:1} 48%{opacity:0.96} 50%{opacity:0.8}
  51%{opacity:0.96} 70%{opacity:1} 72%{opacity:0.85} 73%{opacity:1}
}

@keyframes cyber-drift { from{background-position:0 0,0 0} to{background-position:0 3px,0 0} }

.cyber-scan {
  position: fixed; left: 0; right: 0; top: 0; height: 160px; z-index: 9990; pointer-events: none;
  mix-blend-mode: screen;
  background: linear-gradient(hsl(var(--green-hsl) / 0) 0%,
    hsl(var(--green-hsl) / 0.12) 50%, hsl(var(--green-hsl) / 0) 100%);
  animation: cyber-sweep 7s linear infinite;
}

@keyframes cyber-sweep { 0%{transform:translateY(-160px)} 100%{transform:translateY(100vh)} }

@media (prefers-reduced-motion: reduce) { .cyber-bg, .cyber-scan { animation: none !important; } }

/* Base */
html { background: hsl(var(--bg-hsl)); }

body {
  font-family: 'Iosevka Mayukai Monolite', monospace;
  font-weight: 500;
  font-style: normal;
  display: block;
  height: auto;
  min-height: 100vh;
  overflow-y: auto;
  background: hsl(var(--bg-hsl));
}

/* Scrollbars */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: hsl(var(--green-hsl) / 0.45); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: hsl(var(--green-hsl) / 0.8); }
* { scrollbar-width: thin; scrollbar-color: hsl(var(--green-hsl) / 0.45) transparent; }

/* Nav */
.exec-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 20;
  padding: 10px 0;
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  background: hsl(var(--scrim-hsl) / 0.45);
  backdrop-filter: blur(14px);
  border-top: 1px solid hsl(var(--green-hsl) / 0.12);
}

/* keyboard up (input focused) — let the soft keyboard cover the nav */
html.kb-open .exec-nav { visibility: hidden; }

.exec-nav a {
  color: hsl(var(--green-hsl) / 0.45);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: color 0.2s;
  flex: 1;
  max-width: 72px;
}

.exec-nav a:hover { color: hsl(var(--green-hsl)); }
.exec-nav a.active { color: hsl(var(--green-hsl)); }

.exec-nav a img { border-radius: 5px; }

.exec-nav .nav-label {
  font-family: "04b25", monospace;
  font-size: 0.45rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Content pages */
#content {
  position: relative;
  z-index: 2;
  width: min(720px, 90vw);
  margin: 64px auto 80px;
  font-family: 'Iosevka Mayukai Monolite', monospace;
  font-weight: 500;
  color: hsl(var(--green-hsl));
}

#content h2 {
  font-family: "04b25", monospace;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  opacity: 0.65;
  margin: 28px 0 8px;
  border-bottom: 1px solid hsl(var(--green-hsl) / 0.12);
  padding-bottom: 4px;
}

#content .item {
  font-size: 0.85rem;
  padding: 5px 0;
  border-bottom: 1px solid hsl(var(--green-hsl) / 0.12);
}

#content button {
  background: none;
  border: 1px solid hsl(var(--green-hsl) / 0.45);
  color: hsl(var(--green-hsl) / 0.8);
  font-family: 'Iosevka Mayukai Monolite', monospace;
  font-weight: 500;
  font-size: 0.8rem;
  padding: 4px 12px;
  cursor: pointer;
  transition: all 0.2s;
}

#content button:hover { border-color: hsl(var(--green-hsl)); color: hsl(var(--green-hsl)); }
#content button:disabled { opacity: 0.35; cursor: default; }
#content .ts { font-size: 0.7rem; opacity: 0.5; margin-top: 16px; }
