/* ==========================================================================
   C0ND0R.NET — retro phosphor terminal theme
   --------------------------------------------------------------------------
   Two variants share this one stylesheet:
     body.variant-splash  the theme IS the page (full-bleed hero condor)
     body.variant-page    the theme frames the content (small header mark)
   ========================================================================== */

/* --------------------------------------------------------------- typeface */
/* Share Tech Mono draws a slashed zero natively, so C0ND0R.NET can never be
   misread as CONDOR.NET. Self-hosted (SIL OFL, see assets/fonts/OFL.txt). */
@font-face {
  font-family: 'Share Tech Mono';
  src: url('../fonts/ShareTechMono-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ------------------------------------------------------------- design tokens */
:root {
  --bg:          #050806;
  --bg-lift:     #081109;

  --green:       #3cf07a;   /* primary phosphor                */
  --green-soft:  #8ef0b0;   /* body copy                       */
  --green-dim:   #2a8f52;   /* secondary / meta                */
  --green-deep:  #123a22;   /* rules, borders                  */
  --amber:       #e8a33d;   /* Andean textile accent           */

  --glow:        0 0 6px rgba(60, 240, 122, 0.45);
  --glow-strong: 0 0 10px rgba(60, 240, 122, 0.55), 0 0 28px rgba(60, 240, 122, 0.22);

  --mono: 'Share Tech Mono', ui-monospace, 'DejaVu Sans Mono', Menlo, Consolas, monospace;

  --measure: 68ch;          /* comfortable reading width       */
  --pad:     clamp(1rem, 4vw, 2.5rem);
}

/* --------------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--green-soft);
  font-family: var(--mono);
  font-size: clamp(15px, 1.05vw + 12px, 18px);
  line-height: 1.6;
  text-shadow: var(--glow);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--green);
  text-decoration: none;
  border-bottom: 1px dotted var(--green-dim);
  transition: color 120ms linear, border-color 120ms linear, text-shadow 120ms linear;
}
a:hover,
a:focus-visible {
  color: #b9ffd2;
  border-bottom-color: var(--green);
  text-shadow: var(--glow-strong);
}
a:focus-visible { outline: 1px solid var(--green); outline-offset: 3px; }

::selection { background: var(--green); color: var(--bg); text-shadow: none; }

.dim    { color: var(--green-dim); }
.prompt { color: var(--amber); }

/* ------------------------------------------------------- matrix rain canvas */
.rain {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 1;
  /* Duration is echoed as RAIN_FADE_MS in theme.js, which stops the canvas's
     animation loop once this transition has finished. */
  transition: opacity 2.5s ease;
}
body[data-rain='off'] .rain { display: none; }

/* theme.js adds this after RAIN_LIFETIME (10s) to retire the rain; the
   reduced-motion override elsewhere collapses this transition to near-instant. */
.rain.is-fading { opacity: 0; }

/* Soft pool of darkness between the rain and the content, so the condor and
   the wordmark read clearly without cutting a hard edge into the background.
   This is a real element rather than a negative-z-index pseudo so there is no
   ambiguity about it sitting under the text. */
.scrim {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
.variant-splash .scrim {
  background: radial-gradient(
    ellipse 60% 50% at 50% 42%,
    rgba(5, 8, 6, 0.86) 0%,
    rgba(5, 8, 6, 0.58) 48%,
    rgba(5, 8, 6, 0)    80%
  );
}
.variant-page .scrim {
  background: linear-gradient(
    to right,
    rgba(5, 8, 6, 0.55) 0%,
    rgba(5, 8, 6, 0.88) 22%,
    rgba(5, 8, 6, 0.88) 78%,
    rgba(5, 8, 6, 0.55) 100%
  );
}

/* ------------------------------------------------------------- CRT overlay */
/* Scanlines + vignette + a slow phosphor flicker, all non-interactive. */
.crt {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0)    0px,
      rgba(0, 0, 0, 0)    2px,
      rgba(0, 0, 0, 0.22) 3px,
      rgba(0, 0, 0, 0.22) 4px
    ),
    radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0.75) 100%);
  animation: flicker 6s infinite steps(1);
}
@keyframes flicker {
  0%, 92%, 100% { opacity: 1; }
  93%           { opacity: 0.82; }
  94%           { opacity: 1; }
  97%           { opacity: 0.9; }
}

/* ----------------------------------------------------------------- layout */
.shell {
  position: relative;
  z-index: 2;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  padding: 0 var(--pad);
}

.main { flex: 1 0 auto; width: 100%; }

.variant-splash .main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 88vh;
  text-align: center;
}


.variant-page .main {
  max-width: var(--measure);
  margin: 0 auto;
  padding: clamp(1.5rem, 5vw, 3rem) 0;
}

/* ------------------------------------------------------------ condor art */
.condor {
  margin: 0;
  font-family: var(--mono);
  /* Critical: the art centres itself with its own leading spaces, so each
     line must stay left-aligned. Centring the text would shift every line
     independently and pull the head and tail off the wings. */
  text-align: left;
  width: fit-content;
  margin-inline: auto;
  /* --art-fs is set by theme.js so the art always fits its container.
     The clamp() is the no-JS fallback. */
  font-size: var(--art-fs, clamp(4px, 1.55vw, 15px));
  line-height: 1.05;
  letter-spacing: 0;
  white-space: pre;
  text-shadow: none;
  /* Green wings with an amber textile band through the middle. */
  background-image: linear-gradient(
    180deg,
    var(--green)     0%,
    var(--green)    28%,
    var(--amber)    46%,
    var(--amber)    56%,
    var(--green)    74%,
    var(--green-dim) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 7px rgba(60, 240, 122, 0.35))
          drop-shadow(0 0 18px rgba(232, 163, 61, 0.14));
}

.variant-splash .condor--large {
  max-width: 1040px;
  animation: soar 9s ease-in-out infinite;
}
@keyframes soar {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-0.6vh); }
}

/* While the art is condensing out of the rain it burns a little hotter, then
   settles back to the normal phosphor glow. */
.condor.is-materialising {
  background-image: none;
  -webkit-text-fill-color: var(--green);
  color: var(--green);
  filter: drop-shadow(0 0 9px rgba(60, 240, 122, 0.55));
  animation: none;
}

/* ------------------------------------------------------------- wordmark */
.wordmark {
  display: inline-block;
  font-family: var(--mono);
  color: var(--green);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-shadow: var(--glow-strong);
  /* Belt and braces: ask the font for a slashed zero as well. */
  font-variant-numeric: slashed-zero;
  font-feature-settings: 'zero' 1;
}

.variant-splash .wordmark--hero {
  margin: clamp(0.75rem, 3vw, 1.75rem) 0 0;
  font-size: clamp(1.9rem, 8.5vw, 5.5rem);
  line-height: 1;
}

.wordmark--small { font-size: 1.05rem; letter-spacing: 0.2em; }
.wordmark--tiny  { font-size: 0.85rem; letter-spacing: 0.18em; }

/* Fallback only: if the web font did not load, paint the slash ourselves so
   the zeros still can't be confused with the letter O. theme.js adds
   .no-slashed-zero to <html> when the font is unavailable. */
.no-slashed-zero .wm-zero { position: relative; }
.no-slashed-zero .wm-zero::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0.86em;
  height: 0.08em;
  background: currentColor;
  transform: translate(-50%, -50%) rotate(-58deg);
  pointer-events: none;
}

/* ------------------------------------------------- splash build-in sequence */
/* Guarded behind .js so that with JavaScript disabled nothing is ever hidden.
   Each piece rises in after the condor has finished materialising, which is
   when theme.js puts .is-loaded on the body. */
.js .variant-splash .wordmark--hero,
.js .variant-splash .tagline,
.js .variant-splash .splash-nav {
  opacity: 0;
}

.js .variant-splash.is-loaded .wordmark--hero { animation: rise 0.55s ease-out 0.00s forwards; }
.js .variant-splash.is-loaded .tagline        { animation: rise 0.55s ease-out 0.18s forwards; }
.js .variant-splash.is-loaded .splash-nav     { animation: rise 0.55s ease-out 0.34s forwards; }

@keyframes rise {
  from { opacity: 0; transform: translateY(0.6rem); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .js .variant-splash .wordmark--hero,
  .js .variant-splash .tagline,
  .js .variant-splash .splash-nav {
    opacity: 1;
    animation: none;
  }
}

/* --------------------------------------------------------------- splash */
.tagline {
  margin: clamp(0.6rem, 2vw, 1.1rem) 0 0;
  color: var(--green-dim);
  font-size: clamp(0.8rem, 2.4vw, 1.05rem);
  letter-spacing: 0.42em;
  text-transform: uppercase;
  text-indent: 0.42em; /* balance the trailing letter-space */
}

.cursor {
  display: inline-block;
  width: 0.6em;
  height: 1em;
  margin-left: 0.15em;
  background: var(--green);
  vertical-align: -0.12em;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

.splash-nav {
  margin-top: clamp(1.5rem, 5vw, 2.75rem);
  display: flex;
  gap: clamp(1rem, 4vw, 2rem);
  flex-wrap: wrap;
  justify-content: center;
  font-size: 0.95rem;
  letter-spacing: 0.18em;
}
.splash-nav a { border-bottom: none; }
.splash-nav a::before { content: '[ '; color: var(--green-deep); }
.splash-nav a::after  { content: ' ]'; color: var(--green-deep); }
.splash-nav a:hover::before,
.splash-nav a:hover::after { color: var(--amber); }

/* ---------------------------------------------------------- page header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  max-width: var(--measure);
  width: 100%;
  margin: 0 auto;
  padding: 1.25rem 0 1rem;
  border-bottom: 1px solid var(--green-deep);
}

.site-header .mark {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  border-bottom: none;
}
.site-header .mark:hover .condor { filter: drop-shadow(0 0 9px rgba(60, 240, 122, 0.6)); }

.condor--small {
  flex: none;
  font-size: 8px;
  animation: none;
}

.site-nav {
  display: flex;
  gap: 1.25rem;
  font-size: 0.85rem;
  letter-spacing: 0.18em;
}
.site-nav a { border-bottom: none; color: var(--green-dim); }
.site-nav a:hover,
.site-nav a[aria-current='page'] { color: var(--green); }
.site-nav a[aria-current='page']::before { content: '> '; color: var(--amber); }

/* -------------------------------------------------------------- content */
.page-title {
  margin: 0 0 1.5rem;
  font-size: clamp(1.4rem, 4.5vw, 2.1rem);
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--green);
  text-transform: uppercase;
  text-shadow: var(--glow-strong);
}

.main h2 {
  margin: 2.5rem 0 0.75rem;
  font-size: 1.15rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green);
}
.main h2::before { content: '// '; color: var(--green-deep); }

.main p { margin: 0 0 1.1rem; }

.main ul { margin: 0 0 1.25rem; padding: 0; list-style: none; }
.main ul li { padding-left: 1.6ch; text-indent: -1.6ch; }
.main ul li::before { content: '> '; color: var(--amber); }

.main code {
  padding: 0.1em 0.4em;
  background: var(--bg-lift);
  border: 1px solid var(--green-deep);
  color: var(--green);
  font-size: 0.92em;
}

.main hr,
.rule {
  display: block;
  height: 1px;
  margin: 2rem 0;
  border: 0;
  background: repeating-linear-gradient(
    to right,
    var(--green-deep) 0 8px,
    transparent      8px 14px
  );
}

blockquote {
  margin: 0 0 1.25rem;
  padding-left: 1.25rem;
  border-left: 2px solid var(--green-deep);
  color: var(--green-dim);
}

/* --------------------------------------------------------------- footer */
.site-footer {
  flex: none;
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 1.5rem 0 2rem;
  font-size: 0.8rem;
  color: var(--green-dim);
  text-align: center;
}
.site-footer p { margin: 0; display: flex; gap: 0.6rem; justify-content: center; flex-wrap: wrap; align-items: baseline; }
.variant-splash .site-footer .rule { display: none; }

/* ------------------------------------------------------------- a11y etc. */
@media (prefers-reduced-motion: reduce) {
  .crt              { animation: none; }
  .condor--large    { animation: none; }
  .cursor           { animation: none; }
  *, *::before, *::after { transition-duration: 1ms !important; }
}

@media print {
  .rain, .crt { display: none; }
  body { background: #fff; color: #000; text-shadow: none; }
  .condor { background: none; -webkit-text-fill-color: #000; color: #000; filter: none; }
}
