:root {
  --bg: #050505;
  --surface: rgba(255, 255, 255, 0.03);
  --surface-hover: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(88, 166, 255, 0.4);
  --accent: #58a6ff;
  --accent-glow: rgba(88, 166, 255, 0.2);
  --text-main: #f0f6fc;
  --text-muted: #8b949e;
  --text-sub: #c9d1d9;
  --font-mono: 'DM Mono', monospace;
  --font-sans: 'Inter', sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

/* Three.js Background Canvas */
#scene {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -2;
  pointer-events: none;
}

/* Subtle Film Grain Overlay */
.grain {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  opacity: 0.03;
  pointer-events: none;
  background-image: radial-gradient(#fff 1px, transparent 1px);
  background-size: 3px 3px;
}

/* Navigation */
.nav {
  position: fixed;
  top: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 3rem;
  background: rgba(5, 5, 5, 0.75);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

.brand {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text-main);
  text-decoration: none;
  letter-spacing: -1px;
}

.brand span {
  color: var(--accent);
}

.nav nav a {
  color: var(--text-muted);
  text-decoration: none;
  margin: 0 1.2rem;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.nav nav a:hover {
  color: var(--text-main);
}

.nav-cta {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  text-decoration: none;
  border: 1px solid var(--border);
  padding: 0.4rem 0.9rem;
  border-radius: 4px;
  background: var(--surface);
  transition: all 0.2s ease;
}

.nav-cta:hover {
  border-color: var(--accent);
  background: var(--accent-glow);
}

/* Main Layout */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  padding-top: 6rem;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 1.5px;
  color: var(--accent);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.eyebrow i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  box-shadow: 0 0 8px var(--accent);
}

.hero h1 {
  font-size: clamp(2.8rem, 6vw, 4.8rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -1.5px;
  margin-bottom: 1.5rem;
}

.hero h1 em {
  font-style: italic;
  font-weight: 400;
  color: var(--text-muted);
}

.hero-role {
  display: flex;
  gap: 0.8rem;
  margin-bottom: 1.5rem;
}

.hero-role span {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.25rem 0.65rem;
  border-radius: 3px;
  color: var(--text-sub);
}

.hero-copy {
  font-size: 1.15rem;
  max-width: 620px;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.hero-copy strong {
  color: var(--text-main);
}

.hero-actions {
  display: flex;
  gap: 1rem;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  padding: 0.75rem 1.4rem;
  border-radius: 6px;
  transition: all 0.25s ease;
}

.button.primary {
  background: var(--text-main);
  color: var(--bg);
}

.button.primary:hover {
  background: #e2e8f0;
  transform: translateY(-2px);
}

.button.ghost {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-main);
}

.button.ghost:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

/* Gyroscopic Orb Widget */
.orb-wrap {
  position: absolute;
  right: 5%;
  top: 45%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}

.orb {
  width: 140px;
  height: 140px;
  position: relative;
  perspective: 800px;
}

.orb-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px dashed rgba(88, 166, 255, 0.4);
}

.orb-ring.r1 { animation: rotateRing1 14s linear infinite; }
.orb-ring.r2 { animation: rotateRing2 18s linear infinite; }
.orb-ring.r3 { animation: rotateRing3 22s linear infinite; }

.orb-core {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 24px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent), transparent 70%);
  box-shadow: 0 0 20px var(--accent);
}

.orb-label {
  margin-top: 1rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-align: center;
  color: var(--text-muted);
}

.orb-label span {
  letter-spacing: 1px;
}

@keyframes rotateRing1 {
  0% { transform: rotateX(45deg) rotateY(0deg); }
  100% { transform: rotateX(45deg) rotateY(360deg); }
}

@keyframes rotateRing2 {
  0% { transform: rotateX(70deg) rotateZ(0deg); }
  100% { transform: rotateX(70deg) rotateZ(360deg); }
}

@keyframes rotateRing3 {
  0% { transform: rotateY(60deg) rotateX(0deg); }
  100% { transform: rotateY(60deg) rotateX(360deg); }
}

.scroll-cue {
  position: absolute;
  bottom: 2rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 1.5px;
  color: var(--text-muted);
}

/* Sections */
.section {
  padding: 7rem 0;
  border-top: 1px solid var(--border);
}

.statement {
  padding: 6rem 0;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 2rem;
}

.section-number {
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.kicker {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 1.5px;
  color: var(--accent);
  margin-bottom: 0.8rem;
}

.statement h2 {
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1.5rem;
}

.statement h2 span {
  color: var(--text-muted);
}

.large-copy {
  font-size: 1.25rem;
  color: var(--text-sub);
  max-width: 780px;
  margin-bottom: 2rem;
}

.identity-line {
  display: flex;
  gap: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Projects Section */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 3rem;
}

.section-head h2 {
  font-size: 2.2rem;
  font-weight: 700;
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.projects {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.project {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  backdrop-filter: blur(8px);
  transform-style: preserve-3d;
  will-change: transform;
}

.project:hover {
  border-color: var(--border-hover);
}

.project-visual {
  background: rgba(0, 0, 0, 0.4);
  border-right: 1px solid var(--border);
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  min-height: 220px;
}

.visual-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent);
  letter-spacing: 1px;
}

/* Mock Dashboard Window */
.mock-window {
  background: #0d1117;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.8rem;
  margin-top: 1rem;
}

.mock-top {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.8rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
}

.mock-top span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
}

.mock-top b {
  margin-left: 0.4rem;
  font-weight: 400;
}

.mock-chart {
  display: flex;
  align-items: flex-end;
  height: 60px;
  gap: 6px;
}

.mock-chart .bar {
  flex: 1;
  background: var(--accent);
  opacity: 0.85;
  border-radius: 2px 2px 0 0;
}

/* Visual Signals */
.signal {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  margin-top: 2rem;
}

.signal-line {
  height: 2px;
  flex: 1;
  background: linear-gradient(90deg, transparent, var(--accent));
}

.signal-dot {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent);
}

.cloud-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin-top: 1.5rem;
}

.cloud-grid span {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.4rem;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
}

/* Project Info */
.project-info {
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.project-info .index {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  margin-right: 0.5rem;
}

.project-info .type {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.project-info h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0.5rem 0 0.8rem;
}

.project-info p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.2rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
}

.tags span {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
}

.text-link {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-main);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.text-link:hover {
  color: var(--accent);
}

/* Stack Section */
.stack {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 2rem;
}

.stack-content h2 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 2.5rem;
}

.stack-content h2 span {
  color: var(--text-muted);
}

.stack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.stack-grid > div {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1.8rem;
  border-radius: 8px;
  transform-style: preserve-3d;
  will-change: transform;
}

.stack-grid > div:hover {
  border-color: var(--border-hover);
}

.stack-grid b {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  display: block;
  margin-bottom: 0.8rem;
}

.stack-grid h4 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.stack-grid p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Timeline */
.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.timeline-item {
  display: flex;
  gap: 2rem;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.timeline-item span {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--accent);
}

.timeline-item b {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
}

.timeline-item p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* About Grid */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 3rem;
}

.about-lead {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
}

.about-lead em {
  font-style: italic;
  font-weight: 400;
  color: var(--text-muted);
}

.about-body p {
  color: var(--text-sub);
  font-size: 1rem;
  margin-bottom: 1.2rem;
}

.facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
  margin-top: 2rem;
}

.facts span {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  border-left: 2px solid var(--accent);
  padding-left: 0.6rem;
}

.facts span b {
  color: var(--accent);
  margin-right: 0.4rem;
}

/* Principles */
.principles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  padding: 5rem 0;
  border-top: 1px solid var(--border);
}

.principle {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 2rem;
  border-radius: 8px;
}

.principle span {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  display: block;
  margin-bottom: 0.8rem;
}

.principle h3 {
  font-size: 1.2rem;
  margin-bottom: 0.4rem;
}

.principle p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Contact */
.contact {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.contact h2 {
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  margin: 1rem 0 2rem;
}

.contact h2 em {
  font-style: italic;
  font-weight: 400;
  color: var(--text-muted);
}

.contact-email {
  font-family: var(--font-mono);
  font-size: clamp(1rem, 3vw, 1.6rem);
  color: var(--accent);
  text-decoration: none;
  padding: 0.8rem 1.8rem;
  border: 1px solid var(--border);
  border-radius: 50px;
  background: var(--surface);
  transition: all 0.3s ease;
  margin-bottom: 2rem;
}

.contact-email:hover {
  background: var(--accent-glow);
  border-color: var(--accent);
  transform: translateY(-3px);
}

.contact-links {
  display: flex;
  gap: 2rem;
}

.contact-links a {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.contact-links a:hover {
  color: var(--text-main);
}

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 3rem;
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .orb-wrap { display: none; }
  .project { grid-template-columns: 1fr; }
  .project-visual { border-right: none; border-bottom: 1px solid var(--border); }
  .about-grid { grid-template-columns: 1fr; }
  .principles { grid-template-columns: 1fr; }
  .nav { padding: 1.2rem 1.5rem; }
  .nav nav { display: none; }
  .statement, .stack { grid-template-columns: 1fr; }
  .section-number { display: none; }
}
