@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&family=Fira+Code:wght@400;500&display=swap');

:root {
  /* PBR-inspired palette */
  --bg-color: #131314;
  --surface-color: rgba(30, 30, 35, 0.6);
  --surface-border: rgba(255, 255, 255, 0.08);
  --text-primary: #ededed;
  --text-secondary: #a0a0a5;
  --accent-color: #ff3366;
  /* Vibrant technical aesthetic */
  --accent-hover: #ff6688;

  /* Glassmorphism */
  --glass-bg: rgba(12, 12, 16, 0.7);
  --glass-blur: blur(12px);

  /* Typography */
  --font-main: 'Outfit', sans-serif;
  --font-mono: 'Fira Code', monospace;

  /* Animations */
  --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  background-color: var(--bg-color);
}

body {
  background-color: transparent;
  color: var(--text-primary);
  font-family: var(--font-main);
  overflow-x: hidden;
  scroll-behavior: smooth;
  line-height: 1.6;
}

/* Background — uniform dark charcoal #131314 via body/html */
#webgl-container {
  display: none;
}

/* Typography Hierarchy */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.5em;
  line-height: 1.1;
}

h1 {
  font-size: clamp(3rem, 6vw, 5rem);
  text-transform: uppercase;
  background: linear-gradient(90deg, #fff, #888);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  padding-right: 0.1em;
}

h2 {
  font-size: clamp(2rem, 4vw, 3.5rem);
}

.mono-subtitle {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--accent-color);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
  display: block;
}

/* Navigation */
nav {
  position: fixed;
  top: 0;
  width: 100%;
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  transition: var(--transition-smooth);
}

nav.scrolled {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--surface-border);
  padding: 1rem 2rem;
}

.logo {
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: 0.05em;
  cursor: pointer;
  z-index: 101;
  text-decoration: none;
  color: var(--text-primary);
}

/* Hamburger Menu */
.menu-btn {
  background: none;
  border: none;
  cursor: pointer;
  width: 30px;
  height: 20px;
  position: relative;
  z-index: 101;
}

.menu-btn span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--text-primary);
  position: absolute;
  transition: var(--transition-smooth);
}

.menu-btn span:nth-child(1) {
  top: 0;
}

.menu-btn span:nth-child(2) {
  top: 9px;
}

.menu-btn span:nth-child(3) {
  top: 18px;
}

.menu-btn.active span:nth-child(1) {
  top: 9px;
  transform: rotate(45deg);
}

.menu-btn.active span:nth-child(2) {
  opacity: 0;
}

.menu-btn.active span:nth-child(3) {
  top: 9px;
  transform: rotate(-45deg);
}

/* Dropdown Menu */
.nav-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(8, 8, 10, 0.95);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-smooth);
  z-index: 99;
}

.nav-menu.active {
  opacity: 1;
  pointer-events: all;
}

.nav-menu a {
  font-size: 3rem;
  font-weight: 800;
  color: var(--text-primary);
  text-decoration: none;
  margin: 1.5rem 0;
  text-transform: uppercase;
  position: relative;
  overflow: hidden;
  transition: color 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  /* Start hidden, JS animation will reveal each link */
  opacity: 0;
  transform: translateY(20px);
}

.nav-dash {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent-color);
  margin-top: 1rem;
  opacity: 0;
  transform: translateY(20px);
}

/* Wave in animation */
@keyframes navLinkWave {
  from {
    opacity: 0;
    transform: translateY(25px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.nav-menu a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--accent-color);
  transform: translateX(-101%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-menu a:hover::after {
  transform: translateX(0);
}

.nav-menu a:hover {
  color: var(--accent-color);
  transform: translateX(10px);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 1rem 2.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--surface-border);
  color: var(--text-primary);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-radius: 4px;
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  z-index: 1;
  /* Ensure button text stays above pseudo element */
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--accent-color);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: -1;
}

.btn:hover {
  border-color: var(--accent-color);
}

.btn:hover::before {
  transform: scaleY(1);
}

.btn-primary {
  background: var(--accent-color);
  color: #fff;
  border-color: var(--accent-color);
}

.btn-primary:hover::before {
  background: var(--accent-hover);
  transform: scaleY(1);
}

/* Containers */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 5%;
}

.section {
  padding: 8rem 0;
  position: relative;
}

/* Hero Section */
.hero {
  min-height: 80vh;
  /* max-height: 700px; Removed to prevent crushing the OSIRIS thumbnail */
  display: flex;
  align-items: stretch;
  /* both panels share the same height */
  justify-content: space-between;
  gap: 2rem;
  position: relative;
  padding-top: 5rem;
  /* Slightly reduced */
  padding-bottom: 2rem;
  padding-left: 5%;
  padding-right: 5%;
}

/* ─── Left canvas — Technical Artist (red accent) ─── */
.hero-content {
  flex: 0 0 40%;
  max-width: 45%;
  min-width: min-content;
  border: none;
  box-shadow: none;
  border-radius: 10px;
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  background: rgba(255, 255, 255, 0.015);
  backdrop-filter: blur(6px);
}

.hero-title-group {
  margin-bottom: 2rem;
}

.hero p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  max-width: 100%;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ─── Right canvas — Last Work (white) ─── */
.hero-latest-work {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 28px rgba(255, 255, 255, 0.04), inset 0 0 50px rgba(255, 255, 255, 0.02);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.015);
  backdrop-filter: blur(6px);
}

.hero-latest-work>.mono-subtitle {
  padding: 1.2rem 1.5rem 0;
}

.hero-latest-work .featured-project {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  border: none;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
  overflow: visible;
  margin-top: 0;
}

/* 16:9 locked image thumb */
.hero-latest-work .project-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  /* Required to override global project-thumb height */
  flex-shrink: 0;
}

.hero-latest-work .project-info {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 1.2rem 1.5rem;
  /* Slightly reduced top/bottom padding */
}

.hero-latest-work .project-info p {
  margin-bottom: 1rem !important;
  /* Tightened margin to keep button in view */
}

.hero-latest-work .btn {
  padding: 0.8rem 2rem;
  /* Slightly more compact button for hero panel */
  align-self: flex-start;
}

/* Bio Section */
.bio-section {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 4rem;
  align-items: center;
}

.profile-container {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  /* Add shader frame effect via JS or CSS border */
  border: 2px solid var(--surface-border);
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

#profile-canvas,
#profile-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #111;
}

#profile-img {
  filter: grayscale(100%);
  transform: scale(1);
  /* Transition both filter and scale together */
  transition: filter 0.6s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.profile-container {
  /* Smooth border glow transition */
  transition: border-color 0.6s ease, box-shadow 0.6s ease;
}

.profile-container:hover {
  border-color: rgba(255, 51, 102, 0.4);
  box-shadow: 0 0 40px rgba(255, 51, 102, 0.15);
}

.profile-container:hover #profile-img {
  filter: grayscale(0%);
  transform: scale(1.06);
}

.bio-content h3 {
  color: var(--accent-color);
  margin-bottom: 1rem;
}

.bio-content p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

.tech-list {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.tech-tag {
  background: var(--surface-color);
  border: 1px solid var(--surface-border);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-primary);
  backdrop-filter: blur(4px);
}

/* Featured Project */
.featured-project {
  background: var(--surface-color);
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  overflow: hidden;
  backdrop-filter: blur(10px);
  position: relative;
  transition: var(--transition-smooth);
}

.featured-project:hover {
  transform: translateY(-5px);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.project-thumb {
  width: 100%;
  height: 400px;
  background: #111;
  position: relative;
  overflow: hidden;
}

.project-thumb video,
.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.8;
  transition: var(--transition-smooth);
}

.featured-project:hover .project-thumb video {
  opacity: 1;
  transform: scale(1.05);
  /* basic zoom, replace with shader later */
}

.project-info {
  padding: 2rem;
}

.project-tags {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.project-tags span {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-color);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Grid layout for Projects Page */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

/* Contact Form */
.contact-container {
  max-width: 600px;
  margin: 0 auto;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.input-group label {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.input-group input,
.input-group textarea {
  background: var(--surface-color);
  border: 1px solid var(--surface-border);
  padding: 1rem;
  color: var(--text-primary);
  font-family: var(--font-main);
  border-radius: 4px;
  transition: var(--transition-smooth);
}

.input-group input:focus,
.input-group textarea:focus {
  outline: none;
  border-color: var(--accent-color);
  background: rgba(30, 30, 35, 0.8);
}

.input-group textarea {
  resize: vertical;
  min-height: 150px;
}

/* Footer */
footer {
  text-align: center;
  padding: 3rem 0;
  border-top: 1px solid var(--surface-border);
  margin-top: 5rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Utility classes */
.blur-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backdrop-filter: blur(5px);
  pointer-events: none;
  z-index: 50;
  opacity: 0;
  transition: var(--transition-smooth);
}

.mt-2 {
  margin-top: 2rem;
}

.mb-2 {
  margin-bottom: 2rem;
}

.text-center {
  text-align: center;
}

@media (max-width: 768px) {
  h1 {
    font-size: 2.5rem;
  }

  h2 {
    font-size: 2rem;
  }

  .hero {
    flex-direction: column;
    align-items: stretch;
    padding-top: 8rem;
    padding-bottom: 3rem;
    padding-left: 5%;
    padding-right: 5%;
    gap: 1.5rem;
    min-height: auto;
  }

  .hero-content {
    flex: unset;
    max-width: 100%;
    width: 100%;
    border-radius: 10px;
    padding: 2rem;
  }

  .hero-latest-work {
    flex: unset;
    max-width: 100%;
    width: 100%;
  }

  .bio-section {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    flex-direction: column;
  }

  .btn {
    text-align: center;
  }
}