/* ══════════════════════════════════════════════════════════════
   lechu.ninja — CLOUD NINJA STYLESHEET
   Retro CRT × Neon AWS × Monospace Terminal
   ══════════════════════════════════════════════════════════════ */

/* ── TOKENS ──────────────────────────────────────────────────── */
:root {
  /* AWS brand */
  --aws-orange:  #ff9900;
  --aws-orange2: #ff6600;
  /* Neon accents */
  --neon-green:  #00ff88;
  --neon-cyan:   #00e5ff;
  --neon-pink:   #ff2d78;
  /* Backgrounds */
  --bg:          #040608;
  --bg-panel:    #080d12;
  --bg-card:     #0c1520;
  /* Borders */
  --border:      rgba(255, 153, 0, 0.25);
  --border-dim:  rgba(255, 153, 0, 0.10);
  /* Text */
  --text:        #d4e8f0;
  --text-dim:    #4a7a8a;
  --text-bright: #ffffff;
  /* Typography */
  --font-display: 'Orbitron', 'Courier New', monospace;
  --font-mono:    'Share Tech Mono', 'Courier New', monospace;
  /* Glows */
  --glow-orange: 0 0 8px #ff9900, 0 0 24px rgba(255,153,0,.4);
  --glow-green:  0 0 8px #00ff88, 0 0 24px rgba(0,255,136,.4);
  --glow-cyan:   0 0 8px #00e5ff, 0 0 24px rgba(0,229,255,.4);
  /* Sizing */
  --nav-h: 3.5rem;
  --max-w: 1100px;
}

[data-theme="light"] {
  --bg:          #f0ece0;
  --bg-panel:    #e8e2d0;
  --bg-card:     #e0d8c4;
  --border:      rgba(180, 100, 0, 0.35);
  --border-dim:  rgba(180, 100, 0, 0.15);
  --text:        #1a1208;
  --text-dim:    #6a5030;
  --text-bright: #000000;
  --aws-orange:  #cc6600;
  --neon-green:  #006633;
  --neon-cyan:   #005588;
  --glow-orange: 0 0 6px rgba(180,100,0,.5);
  --glow-green:  0 0 6px rgba(0,120,60,.5);
}

/* ── RESET ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 15px; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  line-height: 1.65;
  overflow-x: hidden;
}
a { color: var(--aws-orange); text-decoration: none; transition: all .25s; }
a:hover { color: var(--text-bright); text-shadow: var(--glow-orange); }
ul { list-style: none; }
img { display: block; max-width: 100%; }

/* ── CRT POWER-ON — same technique as lechu.dev ─────────────── */

/* Dot expands into a horizontal line, then the page clips open */
@keyframes crt-dot {
  0%   { width: 6px;   height: 6px;  border-radius: 50%; opacity: 1; }
  40%  { width: 6px;   height: 6px;  border-radius: 50%; opacity: 1; }
  75%  { width: 100vw; height: 4px;  border-radius: 0;   opacity: 1; }
  100% { width: 100vw; height: 4px;  border-radius: 0;   opacity: 1; }
}
@keyframes crt-overlay-fade {
  0%,75% { opacity: 1; }
  100%   { opacity: 0; pointer-events: none; }
}
@keyframes crt-reveal {
  0%   { clip-path: inset(50% 0 50% 0); filter: brightness(3); }
  60%  { clip-path: inset(1%  0 1%  0); filter: brightness(1.4); }
  100% { clip-path: inset(0%  0 0%  0); filter: brightness(1); }
}

#crt-overlay {
  position: fixed; inset: 0;
  background: #000;
  z-index: 99999;
  display: flex; align-items: center; justify-content: center;
  animation: crt-overlay-fade 2.5s ease forwards;
  pointer-events: none;
}
#crt-overlay::after {
  content: '';
  display: block;
  background: #fff;
  box-shadow: 0 0 20px 8px #fff, 0 0 60px 20px rgba(180,230,255,.9);
  animation: crt-dot 1.1s ease-out 0.15s both;
}

/* The whole page content reveals with clip-path */
body > .topnav,
body > .hero,
body > #main-content,
body > .site-footer {
  animation: crt-reveal 0.9s cubic-bezier(.22,.61,.36,1) 1.5s both;
}

/* ── CRT SCANLINES + FLICKER ─────────────────────────────────── */
.crt-scanlines {
  pointer-events: none;
  position: fixed; inset: 0; z-index: 9998;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px, transparent 2px,
    rgba(0,0,0,.14) 2px, rgba(0,0,0,.14) 4px
  );
}

.crt-vignette {
  pointer-events: none;
  position: fixed; inset: 0; z-index: 9997;
  background: radial-gradient(ellipse at center,
    transparent 55%,
    rgba(0,0,0,.55) 100%
  );
}

.crt-flicker {
  pointer-events: none;
  position: fixed; inset: 0; z-index: 9999;
  animation: flicker 8s infinite step-start;
  background: rgba(255,255,255,.015);
  opacity: 0;
}

@keyframes flicker {
  0%,100%  { opacity: 0; }
  92%      { opacity: 0; }
  92.5%    { opacity: 1; }
  93%      { opacity: 0; }
  96%      { opacity: 0; }
  96.2%    { opacity: 1; }
  96.4%    { opacity: 0; }
}

/* ── NAV ─────────────────────────────────────────────────────── */
.topnav {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-h);
  display: flex; align-items: center; gap: 1.5rem;
  padding: 0 1.5rem;
  background: rgba(4, 6, 8, .88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
}

.nav-logo {
  display: flex; align-items: center; gap: .6rem;
  color: var(--text-bright);
  flex-shrink: 0;
}
.nav-logo:hover { text-shadow: var(--glow-orange); color: var(--aws-orange); }
.nav-logo-img { height: 2rem; width: 2rem; object-fit: contain; filter: drop-shadow(var(--glow-orange)); }
.nav-logo-text {
  font-family: var(--font-display);
  font-size: .95rem; font-weight: 700;
  letter-spacing: .1em;
  color: var(--text-bright);
}
.logo-dot { color: var(--aws-orange); }

.nav-links {
  display: flex; gap: 1.5rem;
  margin-left: auto;
}
.nav-links a {
  font-family: var(--font-display);
  font-size: .65rem; font-weight: 700;
  letter-spacing: .12em;
  color: var(--text-dim);
  padding: .25rem 0;
  border-bottom: 1px solid transparent;
  transition: all .2s;
}
.nav-links a:hover {
  color: var(--aws-orange);
  border-bottom-color: var(--aws-orange);
  text-shadow: var(--glow-orange);
}

.nav-controls { display: flex; gap: .6rem; margin-left: 1rem; }

.ctrl-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: .7rem;
  padding: .3rem .7rem;
  cursor: pointer;
  border-radius: 2px;
  transition: all .2s;
  white-space: nowrap;
}
.ctrl-btn:hover {
  border-color: var(--aws-orange);
  color: var(--aws-orange);
  box-shadow: var(--glow-orange);
}

.nav-burger {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.2rem;
  padding: .3rem .6rem;
  cursor: pointer;
  margin-left: auto;
}

/* ── HERO ────────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(var(--nav-h) + 3rem) 1.5rem 4rem;
  overflow: hidden;
  text-align: center;
  gap: 1.5rem;
}

/* Animated background grid */
.hero-grid {
  position: absolute; inset: 0; z-index: 0;
  background-image:
    linear-gradient(rgba(255,153,0,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,153,0,.04) 1px, transparent 1px);
  background-size: 48px 48px;
  animation: grid-drift 20s linear infinite;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 40%, transparent 100%);
}
@keyframes grid-drift {
  from { background-position: 0 0; }
  to   { background-position: 48px 48px; }
}

/* Radial glow behind everything */
.hero::before {
  content: '';
  position: absolute; inset: 0; z-index: 0;
  background: radial-gradient(ellipse 70% 60% at 50% 50%,
    rgba(255,153,0,.07) 0%,
    rgba(0,255,136,.04) 40%,
    transparent 70%
  );
}

/* Corner brackets */
.corner {
  position: absolute; z-index: 1;
  width: 28px; height: 28px;
}
.corner-tl { top: 5.5rem; left: 1.5rem;  border-top: 2px solid var(--aws-orange);  border-left: 2px solid var(--aws-orange); }
.corner-tr { top: 5.5rem; right: 1.5rem; border-top: 2px solid var(--aws-orange);  border-right: 2px solid var(--aws-orange); }
.corner-bl { bottom: 5rem; left: 1.5rem; border-bottom: 2px solid var(--aws-orange); border-left: 2px solid var(--aws-orange); }
.corner-br { bottom: 5rem; right: 1.5rem; border-bottom: 2px solid var(--aws-orange); border-right: 2px solid var(--aws-orange); }

/* Classified stamp */
.classified-stamp {
  position: absolute; top: 6.2rem; right: 3.5rem; z-index: 2;
  font-family: var(--font-display);
  font-size: .55rem; font-weight: 900;
  letter-spacing: .3em;
  color: var(--neon-pink);
  border: 2px solid var(--neon-pink);
  padding: .2rem .5rem;
  border-radius: 2px;
  opacity: .45;
  transform: rotate(8deg);
  text-shadow: var(--glow-pink, 0 0 6px #ff2d78);
  pointer-events: none;
}

/* Ninja logo */
.hero-ninja {
  position: relative; z-index: 2;
  width: 9rem; height: 9rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  animation: ninja-float 4s ease-in-out infinite;
}

/* Glow halo that breathes — sized to match the actual image, not a circle */
.ninja-glow-ring {
  position: absolute; inset: 0;
  border-radius: 12px;           /* slight rounding, matches the square image */
  box-shadow:
    0 0 18px rgba(255,153,0,.45),
    0 0 40px rgba(255,153,0,.2),
    0 0 70px rgba(255,153,0,.08);
  animation: ring-pulse 3s ease-in-out infinite;
  pointer-events: none;
}
@keyframes ring-pulse {
  0%,100% { box-shadow: 0 0 18px rgba(255,153,0,.45), 0 0 40px rgba(255,153,0,.2),  0 0 70px rgba(255,153,0,.08); }
  50%     { box-shadow: 0 0 28px rgba(255,153,0,.75), 0 0 60px rgba(255,153,0,.35), 0 0 100px rgba(255,153,0,.15); }
}

.ninja-img {
  width: 8rem; height: 8rem;
  object-fit: contain;
  position: relative; z-index: 1;
  /* drop-shadow follows the actual PNG silhouette, not a bounding box */
  filter:
    drop-shadow(0 0 10px rgba(255,153,0,.8))
    drop-shadow(0 0 24px rgba(255,153,0,.4));
}

@keyframes ninja-float {
  0%,100% { transform: translateY(0);    }
  50%     { transform: translateY(-8px); }
}

/* Title block */
.hero-title-block { position: relative; z-index: 2; }

.hero-pre {
  font-size: .65rem;
  letter-spacing: .35em;
  color: var(--text-dim);
  margin-bottom: .5rem;
}

/* ── GLITCH ─────────────────────────────────────────────────── */
h1.glitch {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 8vw, 5rem);
  font-weight: 900;
  letter-spacing: .08em;
  color: var(--text-bright);
  text-shadow: var(--glow-orange);
  position: relative;
  line-height: 1.1;
}
h1.glitch::before,
h1.glitch::after {
  content: attr(data-text);
  position: absolute; top: 0; left: 0; right: 0;
  overflow: hidden;
  clip-path: inset(0 0 100% 0);
}
h1.glitch::before {
  color: var(--neon-cyan);
  text-shadow: -2px 0 var(--neon-cyan);
  animation: glitch-top 4s infinite linear;
}
h1.glitch::after {
  color: var(--aws-orange2);
  text-shadow: 2px 0 var(--aws-orange2);
  animation: glitch-bot 4s infinite linear;
  animation-delay: .1s;
}
h1.glitch.active::before { animation-duration: .3s; }
h1.glitch.active::after  { animation-duration: .3s; }

@keyframes glitch-top {
  0%,90%,100% { clip-path: inset(0 0 100% 0); transform: translate(0); }
  91%  { clip-path: inset(20% 0 60% 0); transform: translate(-3px, -2px); }
  92%  { clip-path: inset(50% 0 30% 0); transform: translate(3px,  1px);  }
  93%  { clip-path: inset(10% 0 80% 0); transform: translate(-2px, 0);    }
  94%  { clip-path: inset(0 0 100% 0);  transform: translate(0);          }
}
@keyframes glitch-bot {
  0%,90%,100% { clip-path: inset(100% 0 0 0); transform: translate(0); }
  91%  { clip-path: inset(60% 0 10% 0); transform: translate(3px, 2px);  }
  92%  { clip-path: inset(30% 0 50% 0); transform: translate(-3px, -1px); }
  93%  { clip-path: inset(80% 0 5% 0);  transform: translate(2px,  0);   }
  94%  { clip-path: inset(100% 0 0 0);  transform: translate(0);          }
}

.hero-role {
  margin-top: .8rem;
  font-family: var(--font-display);
  font-size: clamp(.75rem, 2.5vw, 1rem);
  font-weight: 400;
  letter-spacing: .1em;
  color: var(--text);
}
.role-at  { color: var(--text-dim); margin: 0 .4em; }
.role-aws { color: var(--aws-orange); text-shadow: var(--glow-orange); font-weight: 700; }

.hero-tenure {
  margin-top: .5rem;
  font-size: .75rem;
  letter-spacing: .2em;
  color: var(--text-dim);
}

/* blink */
.blink-slow { animation: blink 2.2s step-start infinite; }
@keyframes blink {
  0%,100% { opacity: 1; }
  50%     { opacity: .3; }
}

/* ── STATS COUNTER — SPLIT FLAP ──────────────────────────────── */
.hero-stats {
  position: relative; z-index: 2;
  display: flex;
  align-items: center;
  gap: 1.4rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  padding: 1.2rem 2rem;
  border-radius: 3px;
  box-shadow: 0 0 30px rgba(255,153,0,.08);
}

.stat {
  display: flex; flex-direction: column; align-items: center;
  gap: .6rem;
}

/* Flap card casing */
.stat-flap {
  width: 3rem; height: 3.8rem;
  background: #111;
  border: 3px solid #2b2b2b;
  border-top-color: #444;
  border-left-color: #333;
  border-bottom-color: #111;
  border-right-color: #222;
  border-radius: 6px;
  box-shadow:
    0 6px 16px rgba(0,0,0,.7),
    inset 0 4px 8px rgba(0,0,0,.9);
  padding: 3%;
  display: flex;
}

/* The actual flap element inside the casing */
.flap {
  position: relative;
  width: 100%; height: 100%;
  background: #1c1c1c;
  font-family: 'Oswald', 'Orbitron', 'Courier New', monospace;
  font-weight: 700;
  perspective: 600px;
  border-radius: 3px;
  box-shadow: inset 0 0 8px rgba(0,0,0,.8);
}

.flap-half {
  position: absolute;
  left: 0; width: 100%; height: 50%;
  background: #1c1c1c;
  overflow: hidden;
  color: var(--aws-orange);
  backface-visibility: hidden;
}
.flap-half.top {
  top: 0;
  border-bottom: 2px solid #080808;
  border-radius: 3px 3px 0 0;
}
.flap-half.bottom {
  bottom: 0;
  border-radius: 0 0 3px 3px;
}

/* Character spans — full-height so digit is centred across both halves */
.flap-half span {
  position: absolute;
  left: 0; width: 100%; height: 200%;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 2.2rem;
  text-shadow: 0 0 10px rgba(255,153,0,.7), 2px 2px 4px rgba(0,0,0,.8);
}
.flap-half.top    span { top: 0; }
.flap-half.bottom span { bottom: 0; }

/* Animated flap overlays */
.flip-top {
  transform-origin: bottom;
  z-index: 2;
  animation: sfFlipTop 0.06s ease-in forwards;
}
.flip-bottom {
  transform-origin: top;
  z-index: 2;
  transform: rotateX(90deg);
  animation: sfFlipBottom 0.06s ease-out 0.06s forwards;
}

@keyframes sfFlipTop {
  0%   { transform: rotateX(0deg);   filter: brightness(1); }
  100% { transform: rotateX(-90deg); filter: brightness(0.4); }
}
@keyframes sfFlipBottom {
  0%   { transform: rotateX(90deg);  filter: brightness(0.4); }
  100% { transform: rotateX(0deg);   filter: brightness(1); }
}

.stat-label {
  font-size: .6rem;
  letter-spacing: .25em;
  color: var(--text-dim);
}

.stat-sep {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--border);
  user-select: none;
  align-self: center;
  margin-top: -.8rem;
}

/* ── CTA BUTTONS ─────────────────────────────────────────────── */
.hero-cta {
  position: relative; z-index: 2;
  display: flex; gap: 1rem;
  flex-wrap: wrap; justify-content: center;
}
.cta-btn {
  font-family: var(--font-display);
  font-size: .7rem; font-weight: 700;
  letter-spacing: .15em;
  padding: .75rem 1.8rem;
  border: 1px solid;
  border-radius: 2px;
  cursor: pointer;
  transition: all .2s;
  display: inline-block;
}
.cta-primary {
  background: var(--aws-orange);
  border-color: var(--aws-orange);
  color: #000;
  box-shadow: var(--glow-orange);
}
.cta-primary:hover {
  background: transparent;
  color: var(--aws-orange);
  text-shadow: var(--glow-orange);
  box-shadow: var(--glow-orange), inset 0 0 20px rgba(255,153,0,.1);
}
.cta-secondary {
  background: transparent;
  border-color: var(--neon-green);
  color: var(--neon-green);
  box-shadow: var(--glow-green);
}
.cta-secondary:hover {
  background: var(--neon-green);
  color: #000;
  box-shadow: var(--glow-green), 0 0 40px rgba(0,255,136,.3);
}
.cta-btn:hover { text-decoration: none; transform: translateY(-1px); }

/* ── SCROLL HINT ─────────────────────────────────────────────── */
.scroll-hint {
  position: relative; z-index: 2;
  display: flex; align-items: center; gap: .75rem;
  opacity: .4; margin-top: .5rem;
}
.scroll-hint-line {
  display: block; height: 1px; width: 40px;
  background: var(--aws-orange);
}
.scroll-hint-text {
  font-size: .55rem; letter-spacing: .35em;
  color: var(--text-dim);
}

/* ── HIGHLIGHT utility ───────────────────────────────────────── */
.hl { color: var(--aws-orange); text-shadow: var(--glow-orange); }

/* ── PLACEHOLDER SECTIONS ────────────────────────────────────── */
.section { padding: 4rem 1.5rem; max-width: var(--max-w); margin: 0 auto; }
.section--placeholder {
  min-height: 8rem;
  display: flex; align-items: center; justify-content: center;
  border: 1px dashed var(--border-dim);
  border-radius: 3px;
  margin-bottom: 2rem;
}
.prompt-placeholder {
  font-size: .8rem; letter-spacing: .15em;
  color: var(--text-dim);
}

/* ── FOOTER ──────────────────────────────────────────────────── */
.site-footer {
  padding: 2.5rem 1.5rem;
  border-top: 1px solid var(--border-dim);
  text-align: center;
  display: flex; flex-direction: column; gap: .4rem;
}
.site-footer p { font-size: .8rem; color: var(--text-dim); }
.site-footer .hl { color: var(--aws-orange); }
.footer-sub { font-size: .7rem; opacity: .6; }
.footer-copy { font-size: .65rem; opacity: .4; }

/* ── MOBILE ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-links, .nav-controls { display: none; }
  .nav-links.open, .nav-controls.open { display: flex; }
  .nav-burger { display: block; }

  .topnav.menu-open {
    flex-wrap: wrap;
    height: auto;
    padding-bottom: 1rem;
  }
  .topnav.menu-open .nav-links {
    display: flex; flex-direction: column;
    width: 100%; gap: .75rem; padding: .5rem 0;
    border-top: 1px solid var(--border-dim);
  }
  .topnav.menu-open .nav-controls {
    display: flex; width: 100%;
    justify-content: flex-end;
  }

  .hero-stats {
    gap: .75rem;
    padding: .75rem 1rem;
    flex-wrap: wrap;
    justify-content: center;
  }
  .stat-sep { display: none; }

  .corner { width: 18px; height: 18px; }
  .classified-stamp { display: none; }

  .hero-cta { flex-direction: column; align-items: center; }
  .cta-btn { width: 100%; max-width: 280px; text-align: center; }
}

@media (max-width: 480px) {
  h1.glitch { font-size: 2rem; }
  .hero-role { font-size: .7rem; }
  .stat-num  { font-size: 1.5rem; }
  .ninja-img { width: 6rem; height: 6rem; }
  .hero-ninja { width: 7rem; height: 7rem; }
}
