/* ════════════════════════════════════════════════
   animations.css — keyframes, page transitions, hero
   ════════════════════════════════════════════════ */

/* ─── HERO ─── */
.hero-section {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: flex-start;
  position: relative;
  overflow-x: hidden;
  border-bottom: 1px solid var(--rule);
}

.hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--rule) 1px, transparent 1px),
    linear-gradient(90deg, var(--rule) 1px, transparent 1px);
  background-size: 56px 56px;
  opacity: 0.22;
  pointer-events: none;
}

.hero-margin {
  position: absolute; top: 0; bottom: 0;
  left: clamp(80px, 12vw, 220px);
  width: 1px;
  background: rgba(184,50,40,0.18);
  pointer-events: none;
}

.hero-inner {
  position: relative; z-index: 2;
  padding: 100px var(--sp-20) 80px;
  max-width: 1280px; margin: 0 auto; width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--sp-12);
  align-items: center;
}

.hero-classify {
  display: flex; align-items: center; gap: var(--sp-5);
  margin-bottom: var(--sp-8);
  animation: fade-up 0.6s ease both;
}
.hero-case-ref {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--muted-2); letter-spacing: 2px; text-transform: uppercase;
}

.hero-name {
  font-family: var(--font-serif);
  font-size: clamp(42px, 7vw, 100px);
  font-weight: 700; line-height: 0.92;
  letter-spacing: -2px; color: var(--ink);
  margin-bottom: var(--sp-5);
  animation: fade-up 0.6s 0.08s ease both;
}
.hero-name .accent { color: var(--accent); }

.redact-wrap { position: relative; display: inline-block; }
.redact-bar {
  position: absolute; left: -2px; right: -2px; top: 6%; bottom: 6%;
  background: var(--ink); transform-origin: right;
  animation: unredact 0.8s 0.9s cubic-bezier(0.76,0,0.24,1) forwards;
}
@keyframes unredact { to { transform: scaleX(0); } }

.hero-divider {
  display: flex; align-items: center; gap: var(--sp-4);
  margin: var(--sp-4) 0;
  animation: fade-up 0.6s 0.15s ease both;
}

.hero-role {
  font-family: var(--font-mono);
  font-size: clamp(11px, 1.4vw, 14px);
  color: var(--muted); letter-spacing: 2.5px;
  text-transform: uppercase; margin-bottom: var(--sp-6);
  min-height: 20px;
  animation: fade-up 0.6s 0.2s ease both;
}

.hero-bio {
  font-size: clamp(14px, 1.6vw, 17px);
  color: var(--ink-2); line-height: 1.75;
  max-width: 520px; font-weight: 300;
  margin-bottom: var(--sp-8);
  animation: fade-up 0.6s 0.25s ease both;
}

.hero-actions {
  display: flex; align-items: center;
  gap: var(--sp-3); flex-wrap: wrap;
  animation: fade-up 0.6s 0.3s ease both;
}

.hero-stats-col {
  display: flex; flex-direction: column;
  gap: var(--sp-4); flex-shrink: 0;
  animation: fade-right 0.6s 0.35s ease both;
}
.hero-stat {
  background: var(--paper-2); border: 1px solid var(--rule);
  padding: 16px 22px; text-align: right;
  min-width: 148px; position: relative; overflow: hidden;
}
.hero-stat::before {
  content: ''; position: absolute;
  top: 0; left: 0; bottom: 0; width: 2px;
  background: var(--accent);
}
.hero-stat-num {
  font-family: var(--font-serif); font-size: 32px;
  font-weight: 700; color: var(--ink); line-height: 1; margin-bottom: 3px;
}
.hero-stat-label {
  font-family: var(--font-mono); font-size: 9px;
  color: var(--muted); letter-spacing: 2px; text-transform: uppercase;
}

.hero-footnote {
  position: absolute; bottom: 24px; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--sp-20); z-index: 2;
  animation: fade-up 0.6s 0.4s ease both;
}
.footnote-text {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--muted-2); letter-spacing: 1.5px;
}
.scroll-hint {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 10px;
  color: var(--muted-2); letter-spacing: 1px;
  background: none; border: none; cursor: pointer;
  transition: color var(--t-base);
}
.scroll-hint:hover { color: var(--accent); }
.scroll-arrow {
  width: 22px; height: 22px;
  border: 1px solid var(--rule-dark); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; animation: bounce 2.5s ease-in-out infinite;
}
@keyframes bounce { 0%,100%{transform:translateY(0)} 50%{transform:translateY(4px)} }

/* ─── PAGE TRANSITIONS ─── */
.page-section { display: none; opacity: 0; transition: opacity 0.3s ease; }
.page-section.is-active { display: block; }
.page-section.is-entering { opacity: 1; }

/* ─── KEYFRAMES ─── */
@keyframes fade-up   { from{opacity:0;transform:translateY(18px)} to{opacity:1;transform:translateY(0)} }
@keyframes fade-right{ from{opacity:0;transform:translateX(18px)} to{opacity:1;transform:translateX(0)} }
@keyframes fade-in   { from{opacity:0} to{opacity:1} }

/* ─── LOADER — fast: 800ms total ─── */
.loader {
  position: fixed; inset: 0; background: var(--ink);
  z-index: 10000; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: var(--sp-5);
  transition: opacity 0.4s var(--ease), visibility 0.4s;
}
.loader.is-done { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-name {
  font-family: var(--font-serif);
  font-size: clamp(24px, 5vw, 44px);
  font-weight: 700; color: rgba(255,255,255,0.9); letter-spacing: -1px;
}
.loader-name span { color: var(--accent); }
.loader-bar-wrap {
  width: 180px; height: 1px;
  background: rgba(255,255,255,0.1);
  position: relative; overflow: hidden;
}
.loader-bar {
  position: absolute; top: 0; left: 0; height: 100%;
  background: var(--accent);
  animation: load-progress 0.7s var(--ease) forwards;
}
@keyframes load-progress { from{width:0} to{width:100%} }
.loader-text {
  font-family: var(--font-mono); font-size: 11px;
  color: rgba(255,255,255,0.28); letter-spacing: 2px; text-transform: uppercase;
}

/* ─── COUNT UP ─── */
.count-up { display: inline-block; transition: none; }

/* ════════════════════════════════════════════════
   MOBILE RESPONSIVE — hero & terminal
   ════════════════════════════════════════════════ */

/* Tablet */
@media (max-width: 1100px) {
  /* Move terminal below hero content */
  #terminal-panel {
    position: static !important;
    width: 100% !important;
    max-width: 480px;
    margin: 32px auto 0;
  }
  .hero-inner {
    grid-template-columns: 1fr;
    padding: 90px var(--sp-10) 120px;
  }
  .hero-stats-col {
    flex-direction: row; flex-wrap: wrap; gap: var(--sp-3);
    justify-content: flex-start;
  }
  .hero-stat { min-width: 110px; flex: 1; }
  .hero-footnote { padding: 0 var(--sp-10); }
}

/* Phone */
@media (max-width: 640px) {
  .hero-inner { padding: 80px var(--sp-5) 100px; gap: var(--sp-6); }
  .hero-name  { font-size: clamp(38px, 11vw, 56px); letter-spacing: -1px; }
  .hero-bio   { font-size: 14px; }
  .hero-actions { gap: var(--sp-2); }
  .hero-actions .btn { font-size: 12px; padding: 10px 18px; }
  .hero-stats-col { gap: var(--sp-2); }
  .hero-stat  { padding: 12px 16px; min-width: 90px; }
  .hero-stat-num { font-size: 26px; }
  .hero-footnote { display: none; }
  #terminal-panel { margin: 24px 0 0; }
  .hero-classify { flex-wrap: wrap; gap: var(--sp-2); }
  .hero-case-ref { font-size: 9px; }
}

/* ─── HERO RIGHT COLUMN ─── */
.hero-right-col {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  flex-shrink: 0;
  width: 380px;
  min-width: 0;
}

.hero-stats-col {
  display: flex;
  flex-direction: row;
  gap: var(--sp-2);
  width: 100%;
}
.hero-stat {
  flex: 1;
  min-width: 0;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  padding: 14px 10px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero-stat::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent);
}
.hero-stat-num {
  font-family: var(--font-serif);
  font-size: 28px; font-weight: 700;
  color: var(--ink); line-height: 1; margin-bottom: 3px;
}
.hero-stat-label {
  font-family: var(--font-mono); font-size: 7.5px;
  color: var(--muted); letter-spacing: 1.2px; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

#terminal-panel { width: 100%; }

/* ─── DESKTOP hero grid ─── */
.hero-inner {
  grid-template-columns: 1fr 380px;
  align-items: start;
  padding-top: 80px;
}

/* ─── TABLET (900px–1100px) ─── */
@media (max-width: 1100px) {
  .hero-inner {
    grid-template-columns: 1fr;
    padding: 90px var(--sp-8) 60px;
    gap: var(--sp-8);
  }
  .hero-right-col {
    width: 100%;
    max-width: 560px;
  }
  #terminal-panel { max-width: 100%; }
}

/* ─── PHONE (≤640px) ─── */
@media (max-width: 640px) {
  /* Hero wrapper */
  .hero-section { min-height: auto; padding-bottom: 40px; }
  .hero-inner {
    grid-template-columns: 1fr;
    padding: 80px var(--sp-4) 40px;
    gap: var(--sp-6);
  }

  /* Name — scale to fit single line */
  .hero-name {
    font-size: clamp(28px, 8.5vw, 44px);
    letter-spacing: -1px;
    line-height: 0.95;
    word-break: break-word;
  }

  /* Typewriter — prevent clip */
  .hero-role {
    font-size: 10px;
    letter-spacing: 1.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  /* Bio */
  .hero-bio {
    font-size: 14px;
    line-height: 1.65;
    max-width: 100%;
  }

  /* Classify stamp row */
  .hero-classify {
    flex-wrap: wrap;
    gap: var(--sp-2);
    margin-bottom: var(--sp-5);
  }
  .hero-case-ref { font-size: 9px; }
  .stamp { font-size: 8px; padding: 4px 9px; letter-spacing: 1.5px; }

  /* Divider */
  .hero-divider { gap: var(--sp-3); }
  .divider-line { flex: 0 0 40px; }
  .divider-text { font-size: 9px; letter-spacing: 1.5px; }

  /* Action buttons — stack on very small screens */
  .hero-actions {
    flex-wrap: wrap;
    gap: var(--sp-2);
  }
  .hero-actions .btn {
    font-size: 12px;
    padding: 10px 16px;
  }

  /* Right column — full width */
  .hero-right-col {
    width: 100%;
    gap: var(--sp-3);
  }

  /* Stats row */
  .hero-stats-col { gap: var(--sp-2); }
  .hero-stat { padding: 10px 8px; }
  .hero-stat-num { font-size: 22px; }
  .hero-stat-label { font-size: 7px; letter-spacing: 1px; }

  /* Terminal — compact on mobile */
  .terminal-body { min-height: 140px; max-height: 200px; font-size: 11px; }

  /* Hide footnote — no room */
  .hero-footnote { display: none; }
  .hero-margin   { display: none; }
}
