:root {
  color-scheme: light;
  --bg: #fffaf6;
  --bg-soft: #f7fff9;
  --text: #3b3a4f;
  --muted: #7d7a92;
  --primary: #f2b8c6;
  --secondary: #9fdccf;
  --card: rgba(255, 255, 255, 0.76);
  --border: rgba(176, 165, 196, 0.24);
  --shadow: 0 18px 40px rgba(198, 176, 202, 0.22);
  --energy: 0.35;
  --pulse-speed: 9s;
}

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

html {
  scroll-behavior: smooth;
  color-scheme: light;
  background-color: #fffaf6 !important;
}

body {
  color-scheme: light;
  background-color: #fffaf6 !important;
  background: radial-gradient(1100px 680px at 85% -20%, #ffe4ea 0%, transparent 65%),
    radial-gradient(900px 600px at -8% 42%, #e3f7ef 0%, transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

@media (prefers-color-scheme: dark) {
  :root,
  html,
  body {
    color-scheme: light;
  }
}

#icosahedronBg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.noise-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.08;
  background-image: radial-gradient(#fff 0.5px, transparent 0.5px);
  background-size: 4px 4px;
  mix-blend-mode: soft-light;
  z-index: 1;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-direction: column;
  padding: 14px clamp(18px, 4vw, 60px);
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.58);
  border-bottom: 1px solid var(--border);
}

.logo {
  font-family: "JetBrains Mono", monospace;
  color: var(--secondary);
  font-weight: 700;
  text-decoration: none;
}

nav {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

nav a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  position: relative;
}

nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transform: scaleX(0);
  transform-origin: left;
  transition: 0.25s ease;
}

nav a:hover::after {
  transform: scaleX(1);
}

main {
  position: relative;
  z-index: 2;
  width: min(1160px, 92vw);
  margin: 0 auto;
}

.hero {
  padding: clamp(72px, 9vw, 120px) 0 48px;
  animation: heroPulse var(--pulse-speed) ease-in-out infinite;
}

.hero-tag {
  color: var(--secondary);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.84rem;
}

h1 {
  font-size: clamp(2rem, 6vw, 4.1rem);
  line-height: 1.12;
  margin-top: 14px;
}

.highlight {
  background: linear-gradient(92deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  margin-top: 18px;
  font-size: clamp(1.05rem, 2.5vw, 1.5rem);
  color: var(--muted);
  min-height: 42px;
}

.typing-caret {
  animation: blink 0.9s steps(2, start) infinite;
}

@keyframes blink {
  to {
    opacity: 0;
  }
}

.hero-desc {
  margin-top: 14px;
  max-width: 780px;
  color: var(--muted);
}

.hero-actions {
  margin-top: 28px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.primary-btn,
.ghost-btn {
  border: 1px solid transparent;
  padding: 10px 16px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s;
}

.primary-btn {
  background: linear-gradient(95deg, var(--primary), var(--secondary));
  color: #2d2740;
  box-shadow: var(--shadow);
}

.ghost-btn {
  background: var(--card);
  color: var(--text);
  border-color: var(--border);
}

.primary-btn:hover,
.ghost-btn:hover {
  transform: translateY(-3px);
}

.stats {
  margin-top: 34px;
  display: grid;
  grid-template-columns: repeat(3, minmax(170px, 1fr));
  gap: 14px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  backdrop-filter: blur(10px);
}

.stat-card h3 {
  font-size: 2rem;
  line-height: 1;
}

.section {
  padding: 60px 0;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 20px;
}

.section-kicker {
  font-family: "JetBrains Mono", monospace;
  color: var(--secondary);
  font-weight: 700;
}

.section h2 {
  font-size: clamp(1.4rem, 3.2vw, 2.2rem);
}

.about-grid,
.skills-grid,
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.glass-card,
.skill-box,
.project-card,
.contact-card,
.timeline-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
}

.timeline {
  display: grid;
  gap: 14px;
}

.timeline-year {
  font-family: "JetBrains Mono", monospace;
  color: var(--secondary);
  font-weight: 700;
  font-size: 0.9rem;
}

.skill-progress {
  margin-top: 12px;
  width: 100%;
  height: 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.skill-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: inherit;
  transition: width 1.4s ease;
}

.project-type {
  color: var(--secondary);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.82rem;
}

.project-card a,
.contact-links a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px dashed var(--secondary);
  font-weight: 600;
}

.project-card {
  transform-style: preserve-3d;
  will-change: transform;
  animation: floatCard 6.5s ease-in-out infinite;
}

.project-card:nth-child(2) {
  animation-delay: 0.5s;
}

.project-card:nth-child(3) {
  animation-delay: 1s;
}

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

@keyframes heroPulse {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(calc(var(--energy) * -5px)) scale(calc(1 + var(--energy) * 0.01));
  }
}

.contact-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 12px;
}

footer {
  position: relative;
  z-index: 2;
  margin-top: 20px;
  padding: 20px;
  text-align: center;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

.footer-link,
.footer-link:visited,
.footer-link:hover,
.footer-link:active {
  color: inherit;
  font: inherit;
  text-decoration: none;
  cursor: text;
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 900px) {
  .topbar {
    flex-direction: column;
    align-items: center;
  }

  .stats {
    grid-template-columns: 1fr;
  }
}
