﻿/* uwu.kim â€” terminal landing page
   No external requests anywhere in this file (no @import, no web fonts, no
   remote images). That's what lets the CSP in _headers stay locked down. */

:root {
  --bg:        #0a0a0f;
  --bg-soft:   #12121c;
  --fg:        #e8e0f0;
  --dim:       #6b6b85;
  --pink:      #ff6ac1;
  --cyan:      #5ef1e8;
  --green:     #6ee787;
  --amber:     #ffcc66;
  --line:      #22223a;

  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
          "Liberation Mono", "Courier New", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

body { overflow-x: hidden; }

/* No-JS fallback: never show the boot screen, go straight to content. */
.no-js #boot { display: none !important; }
.no-js #site { display: block !important; }
.no-js #site[hidden] { display: block !important; }
.no-js .replay { display: none; }
/* A console that can't open is just a dead box. */
.no-js .foot__console { display: none; }

/* The comets + stars used to live here. They moved to sky.css so /home and
   the admin pages can share them. index.html links sky.css AFTER this file,
   which matters for the reduced-motion override. */
/* ============================ CRT OVERLAY ============================ */
/* Scanlines + vignette. Pure CSS, pointer-events off so it never eats taps. */
.crt {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(255,255,255,0.022) 0px,
      rgba(255,255,255,0.022) 1px,
      transparent 1px,
      transparent 3px
    ),
    radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,0.55) 100%);
}

/* ============================= BOOT SCREEN =========================== */
.boot {
  position: relative;
  z-index: 1;                 /* above .sky (z-index 0) */
  min-height: 100svh;
  min-height: 100vh;
  padding: clamp(14px, 3.5vw, 34px);
  /* Enough to clear the fixed skip button (44px tall, 16px from the bottom)
     without adding dead space that forces a scrollbar. */
  padding-bottom: 74px;
  display: flex;
  align-items: flex-start;
}
.boot[hidden] { display: none; }

.boot__inner {
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
}

.bootlog {
  margin: 0;
  font-family: var(--mono);
  font-size: clamp(11px, 2.7vw, 14px);
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--dim);
  text-shadow: 0 0 8px rgba(94, 241, 232, 0.10);
}

.bootlog .l-head { color: var(--cyan); }
.bootlog .l-ok   { color: var(--green); }
.bootlog .l-warn { color: var(--amber); }
.bootlog .l-hit  { color: var(--pink); }
.bootlog .l-txt  { color: var(--fg); }

/* One block per log line. The status tags ([  OK  ]) are inline spans inside
   these, so DON'T give descendant spans display:block or the tags break onto
   their own line. No entry animation either â€” the characters typing in IS the
   animation, and a per-line fade on top of it just looks muddy. */
.bootlog .bootline { display: block; }

/* ------------------------------- GATE ------------------------------- */
.gate { margin-top: 26px; }
.gate[hidden] { display: none; }

.gate__q {
  margin: 0 0 20px;
  font-size: clamp(13px, 3.4vw, 17px);
  color: var(--fg);
}
.gate__caret { color: var(--pink); }

.cursor {
  display: inline-block;
  width: 0.62em;
  height: 1.05em;
  margin-left: 2px;
  vertical-align: text-bottom;
  background: var(--pink);
  box-shadow: 0 0 10px var(--pink);
  animation: blink 1.06s steps(1) infinite;
}
@keyframes blink { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }

/* The caret that trails the text while the log prints. Solid, not blinking â€”
   a blinking caret during active typing reads as "stalled" rather than "busy". */
.cursor--boot {
  width: 0.55em;
  height: 0.95em;
  margin-left: 1px;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
  animation: none;
  opacity: 1;
}

.gate__btns { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  font-family: var(--mono);
  font-size: clamp(14px, 3.6vw, 16px);
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 13px 26px;
  min-height: 48px;           /* comfortable touch target */
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease,
              color 140ms ease, box-shadow 140ms ease;
}
.btn--yes:hover, .btn--yes:focus-visible {
  color: var(--bg);
  background: var(--green);
  border-color: var(--green);
  box-shadow: 0 0 18px rgba(110, 231, 135, 0.35);
}
.btn--no:hover, .btn--no:focus-visible {
  color: var(--bg);
  background: var(--pink);
  border-color: var(--pink);
  box-shadow: 0 0 18px rgba(255, 106, 193, 0.35);
}

.gate__hint {
  margin: 14px 0 0;
  font-size: 12px;
  color: var(--dim);
}
kbd {
  font-family: var(--mono);
  font-size: 11px;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--fg);
}
/* The hint is meaningless without a physical keyboard. */
@media (hover: none) and (pointer: coarse) {
  .gate__hint { display: none; }
}

.skip {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 12;
  font-family: var(--mono);
  font-size: 12px;
  padding: 10px 16px;
  min-height: 44px;
  color: var(--dim);
  background: rgba(18, 18, 28, 0.85);
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
  transition: color 140ms ease, border-color 140ms ease;
}
.skip:hover, .skip:focus-visible { color: var(--fg); border-color: var(--pink); }
.skip[hidden] { display: none; }

/* ---------------------------- TRANSITION ---------------------------- */
.boot--out { animation: bootOut 460ms ease-in forwards; }
@keyframes bootOut {
  0%   { opacity: 1; filter: none; transform: none; }
  35%  { opacity: 1; filter: contrast(2.4) brightness(1.5) saturate(1.6); transform: translateX(-2px) skewX(-0.5deg); }
  55%  { opacity: 1; filter: contrast(2.4) brightness(1.5); transform: translateX(3px) skewX(0.6deg); }
  100% { opacity: 0; filter: brightness(2.6); transform: scaleY(0.006); }
}

/* Rises gently under the dissolving loader. Slower than the fade-out and on an
   ease-out curve so it settles rather than snapping into place. */
.site--in { animation: siteIn 760ms cubic-bezier(0.22, 0.61, 0.36, 1) both; }
@keyframes siteIn {
  from { opacity: 0; transform: translateY(16px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}

/* Reduced motion still gets the crossfade â€” a plain opacity dissolve isn't a
   vestibular trigger, and without it the screen would hard-cut. What it loses
   is the movement: no rise, no scale, no blur. */
@keyframes siteFadeOnly { from { opacity: 0; } to { opacity: 1; } }
@keyframes loadFadeOnly { from { opacity: 1; } to { opacity: 0; } }

/* =============================== LOADER ============================== */
.load {
  position: relative;
  z-index: 1;                 /* above .sky; .load--out raises this to 20 */
  min-height: 100svh;
  min-height: 100vh;
  padding: clamp(16px, 5vw, 48px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.load[hidden] { display: none; }

.load__inner {
  width: 100%;
  max-width: 560px;
  text-align: center;
}

.load__status {
  margin: 0 0 18px;
  min-height: 1.6em;              /* reserve the line so text swaps don't jump */
  font-size: clamp(12px, 3.2vw, 15px);
  color: var(--dim);
  text-align: left;
}


.load__bar {
  margin: 0;
  font-family: var(--mono);
  /* The bar is a fixed character count, so size it off viewport width to keep
     it on one line. JS shortens the bar itself on narrow screens too. */
  font-size: clamp(11px, 3.5vw, 18px);
  line-height: 1.5;
  color: var(--pink);
  text-shadow: 0 0 12px rgba(255, 106, 193, 0.4);
  white-space: pre;
  overflow: hidden;
  text-align: left;
}

/* The bar is a fixed run of characters much narrower than the 560px box, so
   left-aligning parks it well off-centre on wide screens. Centre it once
   there's room; on phones the box is barely wider than the bar, so left is
   fine and stops the status line jumping around as its text changes.
   MUST stay below the .load__status and .load__bar rules above â€” a media
   query adds no specificity, so if it sits earlier in the file those
   text-align: left declarations simply win. */
@media (min-width: 600px) {
  .load__status,
  .load__bar { text-align: center; }
}

.load__hello {
  margin: 30px 0 0;
  font-size: clamp(20px, 6.5vw, 34px);
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 24px rgba(255, 255, 255, 0.55);
  animation: helloIn 340ms ease-out both;
}
.load__hello[hidden] { display: none; }

@keyframes helloIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* Crossfade out. Goes position:fixed so it floats ON TOP of the landing page,
   which is revealed underneath at the same moment â€” that overlap is what makes
   it a dissolve rather than a cut to black and back. inset:0 keeps it exactly
   where it already was, so nothing jumps when the position changes. */
.load--out {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  animation: loadFade 620ms ease-in-out both;
}

@keyframes loadFade {
  from { opacity: 1; filter: blur(0); }
  to   { opacity: 0; filter: blur(3px); }
}

/* ============================== LANDING ============================== */
/* Vertical spacing is kept tight on purpose. The content is short, so the only
   thing that can push this past one screen is padding â€” and once it does, a
   scrollbar appears on a page that has nothing to scroll to. Measured to fit
   a 1280x620 window with room spare; don't inflate these without rechecking a
   short viewport. */
.site {
  position: relative;
  z-index: 1;                 /* above .sky (z-index 0) */
  min-height: 100svh;
  min-height: 100vh;
  padding: clamp(14px, 3vw, 32px) clamp(16px, 5vw, 48px) clamp(16px, 2.5vw, 26px);
  display: flex;
}
.site[hidden] { display: none; }
.site:focus { outline: none; }

/* margin:auto inside a flex parent centres on both axes AND still lets the
   content scroll properly if it ever outgrows the viewport. justify-content /
   align-items: center would clip the top instead â€” don't swap them. */
.site__inner {
  width: 100%;
  max-width: 700px;
  margin: auto;
}

/* -------------------------------- HERO ------------------------------- */
.hero { margin-bottom: 40px; }

/* Wordmark + face on one row. Both are sized off viewport width so the pair
   always fits the 640px column: at full size the logo is ~450px and the face
   ~130px, leaving room for the gap. If you enlarge one, shrink the other. */
.hero__top {
  display: flex;
  align-items: center;
  gap: clamp(8px, 2vw, 20px);
  /* Roomier than it looks like it needs to be: .ttg is shifted down with a
     transform, which adds nothing to layout, so the tear trail would otherwise
     hang over the tagline. */
  margin-bottom: clamp(16px, 3vw, 26px);
}

/* The logo is the full "uwu.kim" wordmark, 44 characters wide, so it scales
   off viewport width to stay on one line. overflow-x is the safety net on
   very narrow screens. */
.logo {
  flex: 0 1 auto;
  min-width: 0;
  margin: 0;
  font-family: var(--mono);
  /* Ceiling is set by geometry, not taste: 44 chars at ~0.6em each, plus the
     face (~1.33x its height) and the gap, must fit .site__inner's 700px. */
  font-size: clamp(6px, 2.3vw, 19px);
  line-height: 1.15;
  color: var(--pink);
  text-shadow: 0 0 14px rgba(255, 106, 193, 0.45);
  overflow-x: auto;
}

/* Visually hidden, still read by screen readers and indexed by search. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hero__tag {
  margin: 6px 0 0;
  font-size: clamp(14px, 3.6vw, 18px);
  color: var(--dim);
}

/* ------------------------ TTG "littlegreyman" ------------------------ */
/* Sized by HEIGHT so it sits level with the four-line wordmark; width follows
   from the viewBox aspect (1182:891, so ~1.33x the height).

   The nudge: only the top third of the viewBox is the face (y 0-334, centred
   at 166.9) â€” the rest is empty space the tears fall through. Flex centres the
   whole BOX, which leaves the visible face sitting high. Shifting down by
   (445.94 - 166.9) / 891.88 = 31% puts the face itself level with the
   wordmark, and the tears drip below it where they belong.
   transform doesn't affect layout, so .hero__top carries extra margin-bottom
   to stop the trail landing on the tagline. */
.ttg {
  flex: 0 0 auto;
  display: block;
  height: clamp(52px, 13vw, 110px);
  width: auto;
  transform: translateY(31%);
  fill: #fff;
  filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.45));
}

/* Each tear row lights up slightly after the one above it, so the bright band
   travels downward and reads as a drip.
   The stagger MUST live here rather than in a style="" attribute on each
   <use> â€” the CSP forbids inline styles, so an inline delay is silently
   dropped and all five rows blink in unison. */
.ttg__tear {
  opacity: 0;
  animation: ttgDrip 1.8s linear infinite;
}
.ttg__tear:nth-of-type(1) { animation-delay: 0s;    }
.ttg__tear:nth-of-type(2) { animation-delay: 0.12s; }
.ttg__tear:nth-of-type(3) { animation-delay: 0.24s; }
.ttg__tear:nth-of-type(4) { animation-delay: 0.36s; }
.ttg__tear:nth-of-type(5) { animation-delay: 0.48s; }

@keyframes ttgDrip {
  0%        { opacity: 0; }
  10%       { opacity: 1; }
  45%       { opacity: 1; }
  62%, 100% { opacity: 0; }
}

/* -------------------------------- CARDS ------------------------------ */
.card {
  margin-bottom: 22px;
  padding: 16px 18px 6px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.card__h {
  margin: 0 0 14px;
  font-size: clamp(13px, 3.2vw, 16px);
  font-weight: 400;
  color: var(--dim);
  word-break: break-word;
}
.prompt { color: var(--green); }
.path   { color: var(--cyan); }

/* --------------------------- WHOAMI META ----------------------------- */
.meta { margin: 0 0 14px; }
.meta__row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding: 4px 0;
  border-bottom: 1px dashed rgba(34, 34, 58, 0.7);
}
.meta__row:last-child { border-bottom: 0; }
.meta dt {
  min-width: 104px;
  color: var(--dim);
  font-size: 15px;
}
.meta dd {
  margin: 0;
  color: var(--fg);
  font-size: 15px;
}
.dim  { color: var(--dim); }
.warn { color: var(--amber); }

/* -------------------------------- LINKS ------------------------------ */
.links, .credits { list-style: none; margin: 0 0 14px; padding: 0; }

.link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  margin-bottom: 8px;
  min-height: 48px;
  color: var(--fg);
  text-decoration: none;
  background: rgba(10, 10, 15, 0.6);
  border: 1px solid var(--line);
  border-radius: 5px;
  transition: border-color 150ms ease, transform 150ms ease,
              box-shadow 150ms ease, background 150ms ease;
}
.link:hover, .link:focus-visible {
  border-color: var(--pink);
  background: rgba(255, 106, 193, 0.07);
  transform: translateX(3px);
  box-shadow: 0 0 20px rgba(255, 106, 193, 0.14);
}
.link__k {
  min-width: 92px;
  color: var(--cyan);
  font-size: 13px;
}
.link__v { flex: 1; font-size: 13px; }
.link__arrow { color: var(--pink); font-size: 13px; }

.credits li {
  display: flex;
  gap: 12px;
  padding: 5px 0;
  font-size: 13px;
}

/* -------------------------------- FOOTER ----------------------------- */
.foot {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

/* Replay on the left, login on the right. margin-left:auto rather than
   justify-content:space-between, because .replay is display:none without
   JS â€” space-between would then pull login over to the left on its own. */
.foot__row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.foot__login {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  min-height: 44px;
  font-size: 12px;
  color: var(--dim);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 4px;
  transition: color 140ms ease, border-color 140ms ease;
}
.foot__login:hover,
.foot__login:focus-visible { color: var(--pink); border-color: var(--pink); }
.replay {
  font-family: var(--mono);
  font-size: 12px;
  padding: 10px 14px;
  min-height: 44px;
  color: var(--dim);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
  transition: color 140ms ease, border-color 140ms ease;
}
.replay:hover, .replay:focus-visible { color: var(--cyan); border-color: var(--cyan); }

/* Console sits between the other two. Both this and .foot__login carry
   margin-left:auto, so the free space splits evenly either side of it and this
   lands in the centre — without needing space-between, which would misplace
   things the moment .replay is hidden. */
.foot__console {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 12px;
  padding: 10px 14px;
  min-height: 44px;
  color: var(--dim);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
  transition: color 140ms ease, border-color 140ms ease;
}
.foot__console:hover,
.foot__console:focus-visible { color: var(--cyan); border-color: var(--cyan); }

.foot__c {
  margin: 14px 0 0;
  font-size: 11px;
  color: var(--dim);
}

/* ========================== FOCUS VISIBILITY ========================= */
:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

/* ======================== REDUCED MOTION ============================ */
/* Vestibular safety: kill the glitch, the scanline shimmer and the blink. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .cursor { animation: none; opacity: 1; }
  .link:hover, .link:focus-visible { transform: none; }
  /* Deliberate exception, at Kim's request: the tears keep dripping even under
     reduced motion. It's the centrepiece of the page, and a large share of
     visitors run with OS animation effects off (gamers disable them for
     performance), which would otherwise hide it from them entirely.
     Needs !important to beat the blanket * rule above.
     Everything genuinely vestibular â€” the screen-shear glitch, the page-entry
     slide â€” stays suppressed. Only this small, localised loop is exempt. */
  .ttg__tear {
    animation-duration: 1.8s !important;
    animation-iteration-count: infinite !important;
  }

  /* Comet + star reduced-motion handling lives in sky.css, next to the
     rules it overrides. Don't re-add it here - two copies would fight over
     source order. */

  /* Keep the loader -> landing crossfade, minus the movement. !important is
     needed to beat the blanket * rule above. */
  .load--out {
    animation: loadFadeOnly 520ms ease both !important;
    filter: none !important;
  }
  .site--in {
    animation: siteFadeOnly 520ms ease both !important;
  }
  .crt { background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,0.55) 100%); }
}
