/* ============================================================
   InVendt — CRT boot theme
   Palette: deep warm near-black + faint amber phosphor, like an
   old amber terminal. Retro is an accent here, not a costume:
   effects stay subtle so the content reads like a modern site.
   ============================================================ */

:root {
  --bg: #0c0804;
  --bg-raised: #140e06;
  --bg-card: #181108;
  --phosphor: #fc2c02;       /* red-orange phosphor */
  --phosphor-bright: #ff7350;
  --phosphor-dim: #a32d10;
  --text: #ecd8c8;           /* warm paper-white for body text */
  --text-dim: #b08068;
  --line: #3a1a0c;
  --glow: 0 0 8px rgba(252, 44, 2, 0.40);
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  overflow-x: hidden;
}

::selection { background: var(--phosphor); color: var(--bg); }

a { color: var(--phosphor); text-decoration: none; }
a:hover { color: var(--phosphor-bright); text-shadow: var(--glow); }

/* ============ CRT ambience (whole site, very low opacity) ============ */

.crt-scanlines {
  position: fixed; inset: 0; z-index: 50; pointer-events: none;
  overflow: hidden;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px, transparent 2px,
    rgba(0, 0, 0, 0.14) 3px, rgba(0, 0, 0, 0.14) 4px
  );
  mix-blend-mode: multiply;
}

/* slow rolling scan band, like a CRT filmed on camera — barely visible */
.crt-scanlines::after {
  content: ""; position: absolute; left: 0; right: 0; height: 140px;
  background: linear-gradient(to bottom,
    transparent, rgba(252, 44, 2, 0.035), transparent);
  mix-blend-mode: normal;
  animation: scan-roll 9s linear infinite;
}

@keyframes scan-roll {
  0%   { top: -20%; }
  100% { top: 120%; }
}

.crt-vignette {
  position: fixed; inset: 0; z-index: 51; pointer-events: none;
  background: radial-gradient(ellipse at center,
    transparent 55%, rgba(0, 0, 0, 0.38) 100%);
  animation: crt-hum 4s ease-in-out infinite;
}

/* faint brightness wobble — the "tube hum". Amplitude kept tiny on purpose. */
@keyframes crt-hum {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.92; }
}

/* ============ Boot overlay ============ */

#boot {
  position: fixed; inset: 0; z-index: 100;
  background: #000;
  display: flex; align-items: stretch; justify-content: center;
  font-family: var(--mono);
}

/* CRT power-on: a bright horizontal line that expands vertically */
#boot::before {
  content: "";
  position: absolute; inset: 0;
  background: #ffd2c2;
  transform: scaleY(0.002);
  animation: crt-on 0.45s ease-out forwards;
  z-index: 1;
}

@keyframes crt-on {
  0%   { transform: scaleY(0.002); opacity: 1; }
  60%  { transform: scaleY(1); opacity: 0.35; }
  100% { transform: scaleY(1); opacity: 0; }
}

#boot-screen {
  width: min(860px, 92vw);
  padding: 6vh 2vw;
  position: relative; z-index: 2;
}

#boot-text {
  color: var(--phosphor);
  text-shadow: var(--glow);
  font-size: clamp(12px, 1.7vw, 16px);
  line-height: 1.55;
  white-space: pre-wrap;
  font-family: var(--mono);
}

#boot-text .ok   { color: var(--phosphor-bright); }
#boot-text .dim  { color: var(--phosphor-dim); }

#boot-progress { margin-top: 4vh; }
#boot-progress.hidden { display: none; }

.boot-progress-label {
  color: var(--phosphor); text-shadow: var(--glow);
  font-size: 14px; letter-spacing: 0.25em; margin-bottom: 12px;
}

.boot-progress-track {
  width: min(420px, 80vw); height: 18px;
  border: 1px solid var(--phosphor-dim);
  padding: 3px;
}

.boot-progress-bar {
  height: 100%; width: 0%;
  background: repeating-linear-gradient(
    to right,
    var(--phosphor) 0px, var(--phosphor) 8px,
    transparent 8px, transparent 11px
  );
  box-shadow: var(--glow);
  transition: width 0.18s steps(4);
}

#boot-skip {
  position: absolute; bottom: 4vh; right: 5vw; z-index: 2;
  color: var(--phosphor-dim);
  font-size: 12px; letter-spacing: 0.2em;
  animation: blink-slow 1.6s step-end infinite;
}

/* boot fade-out with a quick flicker — the "handover" to the site */
#boot.boot-done {
  animation: boot-out 0.6s ease forwards;
}

@keyframes boot-out {
  0%   { opacity: 1; }
  20%  { opacity: 0.4; }
  30%  { opacity: 0.9; }
  100% { opacity: 0; visibility: hidden; }
}

#boot.boot-hidden { display: none; }

/* ============ Header ============ */

.site-header {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px clamp(20px, 5vw, 64px);
  background: rgba(5, 11, 7, 0.85);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}

.logo {
  font-family: var(--mono); font-weight: 600;
  font-size: 20px; letter-spacing: 0.18em;
  color: var(--phosphor); text-shadow: var(--glow);
}

.site-nav { display: flex; gap: clamp(16px, 3vw, 36px); }

.site-nav a {
  font-family: var(--mono); font-size: 14px;
  color: var(--text-dim); letter-spacing: 0.08em;
}
.site-nav a:hover { color: var(--phosphor-bright); }

/* hamburger — hidden on desktop, takes over on small screens */
.nav-toggle {
  display: none;
  flex-direction: column; justify-content: center; gap: 5px;
  width: 42px; height: 38px; padding: 8px 9px;
  background: none; border: 1px solid var(--line); border-radius: 6px;
  cursor: pointer;
}

.nav-toggle span {
  display: block; height: 2px; width: 100%;
  background: var(--phosphor);
  box-shadow: var(--glow);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* burger -> X when open */
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 720px) {
  .nav-toggle { display: flex; }

  .site-nav {
    /* terminal-style dropdown under the sticky header */
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--bg-raised);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.55);
  }

  .site-nav.open { display: flex; }

  .site-nav a {
    padding: 16px clamp(20px, 5vw, 64px);
    font-size: 15px;
    border-top: 1px solid var(--line);
  }

  /* terminal prompt marker on each item */
  .site-nav a::before { content: "> "; color: var(--phosphor); }

  .site-nav a:hover { background: rgba(252, 44, 2, 0.06); }
}

.cursor { animation: blink 1.1s step-end infinite; }

@keyframes blink { 50% { opacity: 0; } }
@keyframes blink-slow { 50% { opacity: 0.25; } }

/* ============ Hero ============ */

.hero {
  position: relative;
  min-height: 78vh;
  display: flex; align-items: center;
  padding: clamp(40px, 8vh, 90px) clamp(20px, 6vw, 80px);
  overflow: hidden;
}

#matrix-rain {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  opacity: 0.07;            /* barely there — texture, not spectacle */
  pointer-events: none;
}

.hero-inner { position: relative; max-width: 760px; }

.hero-kicker {
  font-family: var(--mono); font-size: 14px;
  color: var(--phosphor-dim); letter-spacing: 0.3em;
  margin-bottom: 18px;
}

.hero h1 {
  font-size: clamp(34px, 6vw, 64px);
  font-weight: 700; line-height: 1.12;
  color: #fff4df;
  margin-bottom: 32px;
}

.hero .accent { color: var(--phosphor); text-shadow: var(--glow); }

.hero-actions { display: flex; gap: 16px; margin-top: 32px; flex-wrap: wrap; }

.btn {
  font-family: var(--mono); font-size: 15px;
  padding: 12px 26px; letter-spacing: 0.06em;
  border: 1px solid var(--phosphor);
  transition: all 0.15s ease;
}

.btn-primary { background: var(--phosphor); color: #1b1003; font-weight: 600; }
.btn-primary:hover {
  background: var(--phosphor-bright); color: #1b1003;
  box-shadow: 0 0 18px rgba(252, 44, 2, 0.5); text-shadow: none;
}

.btn-ghost { color: var(--phosphor); }
.btn-ghost:hover { background: rgba(252, 44, 2, 0.08); }

/* ============ Terminal cards ============ */

.terminal {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  max-width: 640px;
}

.terminal-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 10px 14px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--line);
}

.terminal-dot {
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--line);
}
.terminal-bar .terminal-dot:first-child { background: var(--phosphor-dim); }

.terminal-title {
  margin-left: auto; margin-right: auto;
  font-family: var(--mono); font-size: 12px; color: var(--text-dim);
}

.terminal-body {
  padding: 18px 20px;
  font-family: var(--mono); font-size: 15px;
  color: var(--text);
}

.terminal-body .prompt { color: var(--phosphor); }
.terminal-body .indent { padding-left: 2ch; color: var(--text-dim); }
.terminal-body p { margin: 2px 0; }

#typed-tagline { color: var(--phosphor-bright); }

/* ============ Sections ============ */

.section {
  max-width: 880px;
  margin: 0 auto;
  padding: clamp(56px, 10vh, 110px) clamp(20px, 6vw, 40px);
  border-top: 1px solid var(--line);
}

.section h2 {
  font-family: var(--mono);
  font-size: clamp(22px, 3vw, 30px);
  color: #fff4df;
  letter-spacing: 0.06em;
  margin-bottom: 28px;
}

.section-num {
  color: var(--phosphor-dim);
  margin-right: 12px;
}

.lead { font-size: 20px; color: #f3e4c6; margin-bottom: 16px; }

.section p { max-width: 64ch; }

/* ============ Cards ============ */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
  margin-top: 8px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px 22px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.card:hover {
  border-color: var(--phosphor-dim);
  transform: translateY(-3px);
}

.card h3 {
  font-family: var(--mono); font-size: 16px;
  color: var(--phosphor); margin-bottom: 10px;
}

.card p { font-size: 15px; color: var(--text-dim); }

.contact-terminal { max-width: 520px; }

/* ============ Contact form ============ */

.contact-form { max-width: 520px; margin-top: 22px; }

.contact-form label {
  display: block;
  font-family: var(--mono); font-size: 12px;
  color: var(--phosphor-dim); letter-spacing: 0.2em;
  margin: 14px 0 6px;
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 10px 12px;
  font-family: var(--mono); font-size: 15px;
  color: var(--text);
  caret-color: var(--phosphor);
  resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--phosphor-dim);
  box-shadow: 0 0 0 1px var(--phosphor-dim), var(--glow);
}

.contact-form .btn { margin-top: 18px; border-radius: 4px; }

.cf-turnstile { margin-top: 18px; min-height: 65px; }

/* honeypot lives far off-screen, not display:none (some bots check) */
.hp { position: absolute; left: -9999px; top: -9999px; }

#cf-status {
  font-family: var(--mono); font-size: 14px;
  margin-top: 14px; min-height: 1.4em;
  color: var(--text-dim);
}
#cf-status.ok { color: var(--phosphor-bright); }
#cf-status.err { color: var(--phosphor); }

/* ============ Footer ============ */

.site-footer {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 10px;
  padding: 26px clamp(20px, 5vw, 64px);
  border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 13px; color: var(--text-dim);
}

.status { display: flex; align-items: center; gap: 8px; letter-spacing: 0.12em; }

.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--phosphor);
  box-shadow: var(--glow);
  animation: blink-slow 2.4s step-end infinite;
}

/* ============ Reduced motion: no boot, no blink, no rain ============ */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  #boot { display: none !important; }
  .cursor, .status-dot, #boot-skip, .crt-vignette { animation: none; }
  .crt-scanlines::after { display: none; }
  #matrix-rain { display: none; }
  .card:hover { transform: none; }
}
