/* ==========================================================
   TIMAEUS — black / white / blue / grey
   ========================================================== */

:root {
  --bg: #000000;
  --ink: #f2f4f8;
  --ink-dim: #9aa3b2;
  --ink-faint: #565e6b;
  --blue: #2f7bff;
  --blue-soft: #5ea2ff;
  --line: rgba(255, 255, 255, 0.08);
  --sans: "Space Grotesk", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "SF Mono", "Menlo", "Consolas", monospace;
  --container: 1080px;
}

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

html { scroll-behavior: smooth; }

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

/* faint grain */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  opacity: 0.3;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.03 0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 28px;
}

.section { padding: 40px 0 48px; position: relative; }

/* ---------- nav ---------- */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  transition: background 0.35s ease, border-color 0.35s ease, backdrop-filter 0.35s ease;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}

.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 18px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.26em;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 11px;
}
.brand-mark { width: 26px; height: 26px; }

.nav-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

/* socials slide into the banner once you scroll down */
.nav-socials {
  display: flex;
  gap: 8px;
  margin-right: 6px;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.nav.scrolled .nav-socials {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.nav-social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--ink-dim);
  transition: color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}
.nav-social svg { width: 14px; height: 14px; }
.nav-social:hover {
  color: var(--ink);
  border-color: rgba(255, 255, 255, 0.45);
  transform: translateY(-1px);
}

.nav-contact {
  color: var(--ink-dim);
  text-decoration: none;
  font-size: 0.88rem;
  white-space: nowrap;
  transition: color 0.2s ease;
}
.nav-contact:hover { color: var(--ink); }

/* ---------- hero ---------- */

/* the 3D scene is a fixed backdrop; every section scrolls over it */
#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

/* darkens the backdrop as you scroll so content stays readable */
.scene-dim {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.88) 65%);
}

main { position: relative; z-index: 1; }

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.hero-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 65% 50% at 50% 44%, transparent 35%, rgba(0, 0, 0, 0.7) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.5) 0%, transparent 25%);
}

.hero-inner {
  position: relative;
  z-index: 2;
  /* leave the upper half of the viewport to the 3D solid */
  padding: 46vh 28px 70px;
  max-width: 760px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-mark {
  width: 108px;
  height: 108px;
  margin-bottom: 34px;
  filter: drop-shadow(0 0 26px rgba(47, 123, 255, 0.55))
          drop-shadow(0 0 70px rgba(47, 123, 255, 0.25));
}
.hero-mark[hidden] { display: none; }

h1 {
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(2.2rem, 6vw, 4rem);
  line-height: 1.05;
  letter-spacing: 0.12em;
  text-indent: 0.12em; /* optically recenters the tracked-out caps */
}

/* ---------- hacker glitch on the wordmark ---------- */

.glitch { position: relative; }

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  opacity: 0;
  pointer-events: none;
}

.glitch::before {
  color: var(--blue-soft);
  animation: glitchA 7s infinite steps(1);
}

.glitch::after {
  color: #ffffff;
  animation: glitchB 7s infinite steps(1);
}

@keyframes glitchA {
  0%     { opacity: 0; transform: none; clip-path: inset(0 0 100% 0); }
  91.5%  { opacity: 0.85; transform: translate(-0.06em, 0.02em); clip-path: inset(8% 0 58% 0); }
  92.5%  { opacity: 0.85; transform: translate(0.05em, -0.01em); clip-path: inset(62% 0 6% 0); }
  93.5%  { opacity: 0; transform: none; clip-path: inset(0 0 100% 0); }
  100%   { opacity: 0; transform: none; clip-path: inset(0 0 100% 0); }
}

@keyframes glitchB {
  0%     { opacity: 0; transform: none; clip-path: inset(0 0 100% 0); }
  92%    { opacity: 0.7; transform: translate(0.06em, -0.02em); clip-path: inset(38% 0 34% 0); }
  93%    { opacity: 0.7; transform: translate(-0.04em, 0.015em); clip-path: inset(76% 0 2% 0); }
  94%    { opacity: 0; transform: none; clip-path: inset(0 0 100% 0); }
  100%   { opacity: 0; transform: none; clip-path: inset(0 0 100% 0); }
}

.cursor {
  display: inline-block;
  margin-left: 0.08em;
  color: var(--blue-soft);
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

.hero-tagline {
  margin-top: 18px;
  font-size: clamp(1.1rem, 2.4vw, 1.45rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.hero-sub {
  margin-top: 16px;
  max-width: 520px;
  color: var(--ink-dim);
  font-size: 1.02rem;
}

/* ---------- statement ---------- */

.statement {
  padding: 0 0 90px;
  text-align: center;
}

.statement-text {
  font-size: clamp(1.5rem, 3.6vw, 2.5rem);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.statement-text span {
  color: var(--blue-soft);
  text-shadow: 0 0 26px rgba(47, 123, 255, 0.45);
}

/* ---------- profile card ---------- */

.profile-card {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 48px;
  padding: 56px 60px;
  border-radius: 24px;
  overflow: hidden;
  background: linear-gradient(105deg, #000 0%, #000 32%, #050f28 55%, #0b2a6e 78%, #1a56e8 105%);
  border: 1px solid rgba(94, 162, 255, 0.18);
  box-shadow:
    0 40px 120px rgba(0, 0, 0, 0.6),
    0 0 80px rgba(26, 86, 232, 0.12);
}

/* faint grid crossing the card, like the profile backdrop */
.card-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(180deg, transparent 0%, #000 35%, #000 100%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 35%, #000 100%);
}

.card-left, .card-right { position: relative; }

.card-mark {
  width: 88px;
  height: 88px;
  filter: drop-shadow(0 0 22px rgba(47, 123, 255, 0.5));
}

.card-left h2 {
  margin-top: 22px;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 1.55rem;
  letter-spacing: 0.14em;
}

.card-left p {
  margin-top: 14px;
  color: var(--ink-dim);
  font-size: 0.95rem;
  max-width: 34ch;
}

.card-right {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.card-tagline {
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: -0.015em;
}

.card-copy {
  margin-top: 14px;
  color: #b7c4dd;
  font-size: 0.95rem;
  max-width: 44ch;
}

/* ---------- footer ---------- */

.footer {
  position: relative;
  z-index: 1;
  padding: 24px 0 70px;
}

.footer-legal {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--ink-faint);
  font-size: 0.88rem;
  line-height: 1.7;
}

.footer-usa {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}
.footer-usa svg {
  width: 24px;
  height: 13px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* ---------- reveal on scroll ---------- */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1), transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.visible { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: 0.12s; }
.reveal.d2 { transition-delay: 0.24s; }
.reveal.d3 { transition-delay: 0.36s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .glitch::before, .glitch::after { animation: none; opacity: 0; }
  .cursor { animation: none; }
}

/* ---------- responsive ---------- */

@media (max-width: 860px) {
  .section { padding: 20px 0 40px; }
  .profile-card {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 44px 34px;
  }
  .card-left p { max-width: none; }
}

@media (max-width: 640px) {
  .nav-contact { display: none; }
}

@media (max-width: 480px) {
  .hero-mark { width: 84px; height: 84px; }
}
