/* Ethereal — less glass, more substance */

:root {
  --void: #050505;
  --card: #0c0c0e;
  --text: #f5f5f7;
  --muted: rgba(245, 245, 247, 0.55);
  --hairline: rgba(255, 255, 255, 0.07);
  --accent: #a78bfa;
  --emerald: #34d399;
  --ease-fluid: cubic-bezier(0.32, 0.72, 0, 1);
  --radius-outer: 1.5rem;
  --radius-inner: calc(1.5rem - 0.375rem);
  --font: 'Plus Jakarta Sans', system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--void);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  opacity: 0;
  animation: page-enter 0.5s ease-out 0.05s forwards;
}

@keyframes page-enter {
  to { opacity: 1; }
}

/* Mesh atmosphere — toned down */
.mesh-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 50% 40% at 12% 8%, rgba(167, 139, 250, 0.09), transparent 55%),
    radial-gradient(ellipse 45% 35% at 85% 70%, rgba(52, 211, 153, 0.06), transparent 50%);
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

a {
  color: inherit;
  text-decoration: none;
}

/* Focus-visible */
:focus-visible {
  outline: 2px solid rgba(167, 139, 250, 0.6);
  outline-offset: 3px;
  border-radius: 6px;
}

/* —— Nav —— */
.nav-island {
  position: fixed;
  top: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.35rem 0.5rem 0.35rem 0.75rem;
  border-radius: 9999px;
  background: rgba(12, 12, 14, 0.78);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--hairline);
  transition: background 0.35s, box-shadow 0.35s;
}

.nav-island.scrolled {
  background: rgba(8, 8, 10, 0.94);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.nav-island a {
  font-size: 0.8125rem;
  padding: 0.5rem 0.85rem;
  border-radius: 9999px;
  color: var(--muted);
  transition: color 0.4s var(--ease-fluid), background 0.4s var(--ease-fluid);
}

.nav-island a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.nav-island .nav-cta {
  color: var(--void);
  background: var(--text);
  font-weight: 600;
}

.nav-island .nav-cta:hover {
  background: #e4e4e7;
  color: var(--void);
}

.nav-desktop {
  display: none;
}

@media (min-width: 900px) {
  .nav-desktop {
    display: flex;
    align-items: center;
    gap: 0.15rem;
  }
  .nav-toggle {
    display: none;
  }
}

.nav-toggle {
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.hamburger {
  width: 1.125rem;
  height: 0.75rem;
  position: relative;
}

.hamburger span {
  position: absolute;
  left: 0;
  right: 0;
  height: 1.5px;
  background: var(--text);
  border-radius: 1px;
  transition: transform 0.55s var(--ease-fluid), top 0.55s var(--ease-fluid), opacity 0.35s var(--ease-fluid);
}

.hamburger span:nth-child(1) { top: 0; }
.hamburger span:nth-child(2) { top: 50%; transform: translateY(-50%); }
.hamburger span:nth-child(3) { bottom: 0; top: auto; }

.nav-toggle[aria-expanded='true'] .hamburger span:nth-child(1) {
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
}
.nav-toggle[aria-expanded='true'] .hamburger span:nth-child(2) {
  opacity: 0;
  transform: translateY(-50%) scaleX(0);
}
.nav-toggle[aria-expanded='true'] .hamburger span:nth-child(3) {
  top: 50%;
  bottom: auto;
  transform: translateY(-50%) rotate(-45deg);
}

.menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(5, 5, 5, 0.94);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.25rem;
  padding: 6.5rem 1.5rem 2rem;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s var(--ease-fluid), visibility 0.6s;
}

.menu-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.menu-overlay a {
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  padding: 0.35rem 1rem;
  opacity: 0;
  transform: translateY(3rem);
  transition: opacity 0.7s var(--ease-fluid), transform 0.7s var(--ease-fluid), color 0.4s;
}

.menu-overlay.is-open a {
  opacity: 1;
  transform: translateY(0);
}

.menu-overlay.is-open a:nth-child(1) { transition-delay: 0.08s; }
.menu-overlay.is-open a:nth-child(2) { transition-delay: 0.14s; }
.menu-overlay.is-open a:nth-child(3) { transition-delay: 0.2s; }
.menu-overlay.is-open a:nth-child(4) { transition-delay: 0.26s; }
.menu-overlay.is-open a:nth-child(5) { transition-delay: 0.32s; }
.menu-overlay.is-open a:nth-child(6) { transition-delay: 0.38s; }
.menu-overlay.is-open a:nth-child(7) { transition-delay: 0.44s; }

.menu-overlay a:hover {
  color: var(--accent);
}

/* —— Layout —— */
.section {
  padding: 6rem 1rem;
}

@media (min-width: 768px) {
  .section {
    padding: 8rem 1.5rem;
  }
}

.container {
  max-width: 72rem;
  margin: 0 auto;
  padding-inline: 1rem;
}

@media (min-width: 768px) {
  .container {
    padding-inline: 1.5rem;
  }
}

.eyebrow {
  display: inline-block;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  margin-bottom: 1.25rem;
}

.section-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin: 0 0 1rem;
}

.section-lead {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 36rem;
  margin: 0 0 3rem;
}

/* —— Double bezel — less shiny —— */
.bezel {
  padding: 1px;
  border-radius: var(--radius-outer);
  background: var(--hairline);
  box-shadow: none;
}

.bezel-inner {
  border-radius: var(--radius-inner);
  background: var(--card);
  height: 100%;
}

/* —— Hero —— */
.hero {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  padding: 8rem 1rem 6rem;
}

.hero-inner {
  max-width: 72rem;
  margin: 0 auto;
  width: 100%;
}

.hero h1 {
  font-size: clamp(2.75rem, 8vw, 5.5rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 0.95;
  margin: 0 0 1.5rem;
  max-width: 14ch;
}

.hero-tagline {
  font-size: clamp(1.05rem, 2.5vw, 1.3rem);
  color: var(--muted);
  max-width: 34rem;
  margin: 0 0 2.5rem;
  line-height: 1.6;
}

.hero-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  font-size: 0.8125rem;
  color: var(--muted);
  margin-bottom: 2.5rem;
}

.hero-contact a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 0.4s var(--ease-fluid);
}

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

.hero-contact i {
  font-size: 1rem;
  opacity: 0.7;
}

/* CTA buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 0.85rem 0.85rem 1.5rem;
  border-radius: 9999px;
  background: var(--text);
  color: var(--void);
  font-weight: 600;
  font-size: 0.9375rem;
  border: none;
  cursor: pointer;
  transition: transform 0.4s var(--ease-fluid), background 0.4s var(--ease-fluid);
}

.btn-primary:hover {
  background: #e4e4e7;
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-primary .btn-icon-wrap {
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  background: rgba(5, 5, 5, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.5s var(--ease-fluid);
}

.btn-primary:hover .btn-icon-wrap {
  transform: translate(2px, -1px) scale(1.05);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  border-radius: 9999px;
  border: 1px solid var(--hairline);
  color: var(--text);
  font-weight: 500;
  font-size: 0.9375rem;
  margin-left: 0.75rem;
  transition: background 0.4s var(--ease-fluid), transform 0.4s var(--ease-fluid);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.06);
}

.btn-ghost:active {
  transform: scale(0.98);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

@media (max-width: 480px) {
  .btn-ghost {
    margin-left: 0;
  }
}

/* —— Bento grid —— */
.bento {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 768px) {
  .bento {
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: minmax(140px, auto);
    gap: 1.25rem;
  }
}

.bento-item {
  min-height: 0;
}

@media (min-width: 768px) {
  .bento-span-8-2 { grid-column: span 8; grid-row: span 2; }
  .bento-span-4 { grid-column: span 4; }
  .bento-span-6 { grid-column: span 6; }
  .bento-span-12 { grid-column: span 12; }
}

.bento-card {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.bento-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.bento-card p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.55;
}

.bento-stat {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1;
  margin: 0 0 0.25rem;
  color: var(--accent);
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.skill-tag {
  font-size: 0.7rem;
  padding: 0.35rem 0.65rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  letter-spacing: 0.02em;
}

/* —— Experience —— */
.exp-header {
  margin-bottom: 1rem;
}

.exp-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.exp-card .bezel-inner {
  padding: 2rem;
}

@media (min-width: 768px) {
  .exp-card .bezel-inner {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 2.5rem;
    padding: 2.5rem;
  }
}

.exp-meta h3 {
  margin: 0 0 0.35rem;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.exp-meta .role {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 1rem;
}

.exp-meta .dates {
  font-size: 0.78rem;
  color: rgba(245, 245, 247, 0.38);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.exp-bullets {
  margin: 0;
  padding: 0;
  list-style: none;
}

.exp-bullets li {
  position: relative;
  padding-left: 1.25rem;
  margin-bottom: 0.85rem;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.exp-bullets li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.7;
}

.exp-bullets strong {
  color: var(--text);
  font-weight: 600;
}

/* —— Projects —— */
.project-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 768px) {
  .project-grid {
    grid-template-columns: 1fr 1fr;
  }
  .project-featured {
    grid-column: 1 / -1;
  }
}

.project-card .bezel-inner {
  padding: 2rem;
}

.project-card header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.project-card h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  max-width: 22ch;
}

.project-card .date {
  font-size: 0.72rem;
  color: rgba(245, 245, 247, 0.35);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.project-card ul {
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
}

.project-card li {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
  padding-left: 1rem;
  position: relative;
  line-height: 1.55;
}

.project-card li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: rgba(167, 139, 250, 0.4);
  font-size: 0.7rem;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent);
  transition: gap 0.4s var(--ease-fluid);
}

.project-link:hover {
  gap: 0.55rem;
}

/* —— Education & achievements —— */
.edu-grid,
.achieve-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  .edu-grid,
  .achieve-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .achieve-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .achieve-wide {
    grid-column: span 2;
  }
}

.stat-card .bezel-inner {
  padding: 1.75rem;
}

.stat-card .label {
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(245, 245, 247, 0.35);
  margin: 0 0 0.75rem;
}

.stat-card .value {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 0.35rem;
}

.stat-card .desc {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.55;
}

/* —— Contact —— */
.contact-section {
  text-align: center;
  padding-bottom: 10rem;
}

.contact-section .section-title {
  max-width: 16ch;
  margin-inline: auto;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem 1.5rem;
  margin-top: 2.5rem;
}

.contact-links a {
  font-size: 0.875rem;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 0.4s var(--ease-fluid);
}

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

.site-footer {
  text-align: center;
  padding: 2rem 1rem 3rem;
  font-size: 0.75rem;
  color: rgba(245, 245, 247, 0.3);
  border-top: 1px solid var(--hairline);
}

/* —— Scroll reveal —— */
.reveal {
  opacity: 0;
  transform: translateY(3rem);
  transition:
    opacity 0.8s var(--ease-fluid),
    transform 0.8s var(--ease-fluid);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.06s; }
.reveal-delay-2 { transition-delay: 0.12s; }
.reveal-delay-3 { transition-delay: 0.18s; }

/* —— Scroll to top —— */
.scroll-top-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--hairline);
  color: var(--text);
  backdrop-filter: blur(12px);
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.35s, transform 0.35s, background 0.25s;
  z-index: 90;
}

.scroll-top-btn--visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.scroll-top-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* —— Reduced motion —— */
@media (prefers-reduced-motion: reduce) {
  body {
    opacity: 1;
    animation: none;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .scroll-top-btn {
    transition: none;
  }

  html {
    scroll-behavior: auto;
  }
}
