/* ============ RESET ============ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
ul { list-style: none; }

/* ============ THEME TOKENS ============ */
:root {
  --bg: #081613;
  --bg-soft: #0e211c;
  --surface: rgba(232,223,201,0.05);
  --surface-strong: rgba(232,223,201,0.09);
  --border: rgba(232,223,201,0.12);
  --text: #ffffff;
  --text-muted: #a8b6ae;
  --accent: #2f9e7c;
  --accent-2: #d9c48c;
  --accent-3: #7fd9c4;
  --grad: linear-gradient(135deg, var(--accent), var(--accent-2));
  --shadow: 0 20px 60px -20px rgba(0,0,0,0.6);
  --radius: 20px;
  --radius-sm: 12px;
  --ff-display: 'Space Grotesk', sans-serif;
  --ff-body: 'Inter', sans-serif;
}

:root[data-theme="light"] {
  --bg: rgb(245, 239, 232);
  --bg-soft: rgb(245, 239, 232);
  --surface: rgba(18,32,27,0.045);
  --surface-strong: rgba(18,32,27,0.08);
  --border: rgba(18,32,27,0.1);
  --text: #12201b;
  --text-muted: #56635b;
  --accent: #0f7a4f;
  --shadow: 0 20px 60px -25px rgba(20,40,30,0.22);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: rgb(245, 239, 232);
    --bg-soft: rgb(245, 239, 232);
    --surface: rgba(18,32,27,0.045);
    --surface-strong: rgba(18,32,27,0.08);
    --border: rgba(18,32,27,0.1);
    --text: #12201b;
    --text-muted: #56635b;
    --accent: #0f7a4f;
    --shadow: 0 20px 60px -25px rgba(20,40,30,0.22);
  }
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--ff-body);
  line-height: 1.5;
  overflow-x: hidden;
  transition: background 0.4s ease, color 0.4s ease;
}

.container {
  width: min(1160px, 90%);
  margin: 0 auto;
}

/* ============ NOISE / AURORA ============ */
.noise-svg {
  position: fixed; inset: 0; width: 100%; height: 100%;
  opacity: 0.035; pointer-events: none; z-index: 2; mix-blend-mode: overlay;
}
:root[data-theme="light"] .noise-svg { opacity: 0.02; }

.aurora { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.blob {
  position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.45;
  animation: float 22s ease-in-out infinite;
}
.blob-1 { width: 46vw; height: 46vw; background: var(--accent); top: -10%; left: -10%; }
.blob-2 { width: 38vw; height: 38vw; background: var(--accent-2); bottom: -15%; right: -5%; animation-duration: 26s; animation-delay: -6s; }
.blob-3 { width: 30vw; height: 30vw; background: var(--accent-3); top: 40%; left: 55%; animation-duration: 30s; animation-delay: -12s; opacity: 0.25; }

:root[data-theme="light"] .blob { opacity: 0; }

@keyframes float {
  0%, 100% { transform: translate(0,0) scale(1); }
  33% { transform: translate(6%, 8%) scale(1.08); }
  66% { transform: translate(-6%, -4%) scale(0.95); }
}

@media (prefers-reduced-motion: reduce) {
  .blob { animation: none; }
}

/* ============ LOADER ============ */
.loader {
  position: fixed; inset: 0; z-index: 1000; background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  transition: opacity .6s ease, visibility .6s ease;
}
.loader-mark {
  font-family: var(--ff-display); font-size: 2.5rem; font-weight: 700;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: pulseScale 1.1s ease-in-out infinite;
}
@keyframes pulseScale { 0%,100% { transform: scale(1); opacity: .7; } 50% { transform: scale(1.15); opacity: 1; } }
.loader.done { opacity: 0; visibility: hidden; }

/* ============ SCROLL PROGRESS ============ */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: var(--grad); z-index: 998; transition: width .1s linear;
}

/* ============ NAV ============ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 500;
  padding: 14px 0;
}
.nav-inner {
  width: min(1160px, 90%); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 10px 12px 10px 22px;
  transition: background .3s, box-shadow .3s;
}
.nav.scrolled .nav-inner { box-shadow: var(--shadow); }

.logo { font-family: var(--ff-display); font-weight: 700; font-size: 1.15rem; letter-spacing: -0.02em; }
.logo .dot { color: var(--accent-2); }

.nav-links { display: flex; gap: 28px; }
.nav-links a { font-size: 0.92rem; color: var(--text-muted); position: relative; padding: 4px 0; transition: color .2s; }
.nav-links a::after {
  content: ''; position: absolute; left: 0; bottom: -2px; width: 0; height: 2px; background: var(--grad);
  transition: width .25s ease;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }

.nav-actions { display: flex; align-items: center; gap: 10px; }

.theme-toggle {
  width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); color: var(--text);
}
.theme-toggle svg { width: 18px; height: 18px; }
.icon-moon { display: none; }
:root[data-theme="light"] .icon-sun { display: none; }
:root[data-theme="light"] .icon-moon { display: block; }

.lang-toggle {
  height: 38px; padding: 0 12px; border-radius: 999px; display: flex; align-items: center; gap: 5px;
  border: 1px solid var(--border); font-family: var(--ff-display); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.02em;
}
.lang-toggle .lang-option { color: var(--text-muted); transition: color .2s ease; }
.lang-toggle .lang-option.active { color: var(--accent); }
.lang-toggle .lang-sep { color: var(--border); }

.burger { display: none; width: 38px; height: 38px; flex-direction: column; align-items: center; justify-content: center; gap: 5px; }
.burger span { width: 20px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .3s, opacity .3s; }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: 0; z-index: 400; background: var(--bg-soft);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  transform: translateY(-100%); transition: transform .4s cubic-bezier(.65,0,.35,1);
}
.mobile-menu.open { transform: translateY(0); }
.mobile-menu nav { display: flex; flex-direction: column; gap: 1.6rem; text-align: center; }
.mobile-menu nav a { font-family: var(--ff-display); font-size: 2rem; font-weight: 600; }

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  padding: 13px 26px; border-radius: 999px; font-weight: 600; font-size: 0.94rem;
  transition: transform .25s ease, box-shadow .25s ease, background .25s ease, color .25s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--grad); color: #0a1613; box-shadow: 0 10px 30px -10px rgba(47,158,124,0.6); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 36px -10px rgba(47,158,124,0.75); }
.btn-ghost { border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--surface-strong); transform: translateY(-2px); }
.btn-outline { border: 1.5px solid var(--border); background: var(--surface); }
.btn-outline:hover { border-color: var(--accent); transform: translateY(-2px); }
.btn-sm { padding: 9px 18px; font-size: 0.85rem; }
.btn-lg { padding: 16px 30px; font-size: 1rem; }
.nav-cta { display: inline-flex; }

/* ============ REVEAL ANIMATION ============ */
.reveal, .reveal-lines { opacity: 0; transform: translateY(28px); transition: opacity .8s cubic-bezier(.22,1,.36,1), transform .8s cubic-bezier(.22,1,.36,1); }
.reveal.in-view, .reveal-lines.in-view { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) { .reveal, .reveal-lines { opacity: 1; transform: none; transition: none; } }

/* ============ HERO ============ */
.hero { position: relative; min-height: 100vh; display: flex; align-items: center; padding: 140px 0 80px; z-index: 1; }
.hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 3rem; align-items: center; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.85rem; color: var(--text-muted); margin-bottom: 1.4rem;
  border: 1px solid var(--border); padding: 7px 16px; border-radius: 999px; background: var(--surface);
}
.pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-3); box-shadow: 0 0 0 0 rgba(127,217,196,0.6); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(127,217,196,0.5); } 70% { box-shadow: 0 0 0 8px rgba(127,217,196,0); } 100% { box-shadow: 0 0 0 0 rgba(127,217,196,0); } }

.hero-title {
  font-family: var(--ff-display); font-weight: 700; letter-spacing: -0.03em;
  font-size: clamp(2.4rem, 5.6vw, 4.4rem); line-height: 1.06; margin-bottom: 1.4rem;
}
.hero-title .line { display: block; }
.hero-title em { font-style: normal; color: var(--text-muted); }
.reveal-lines:nth-child(2) { transition-delay: .08s; }
.reveal-lines:nth-child(3) { transition-delay: .16s; }

.grad-text {
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  background-size: 200% auto; animation: gradShift 6s ease infinite;
}
@keyframes gradShift { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

.hero-sub { max-width: 46ch; color: var(--text-muted); font-size: 1.08rem; margin-bottom: 2.1rem; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 2.2rem; }

.hero-social { display: flex; gap: 14px; }
.hero-social a { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; transition: all .25s; }
.hero-social a svg { width: 18px; height: 18px; }
.hero-social a:hover { background: var(--grad); color: #0a1613; transform: translateY(-3px); border-color: transparent; }

.hero-visual { position: relative; display: flex; justify-content: center; }
.portrait-frame { position: relative; width: min(480px, 88vw); }
.portrait-glow {
  position: absolute; inset: -30px; background: var(--grad); filter: blur(60px); opacity: 0.4; z-index: -1;
  border-radius: 63% 37% 54% 46% / 43% 51% 49% 57%;
  animation: float 14s ease-in-out infinite, blobMorph 11s ease-in-out infinite;
}
.portrait-img {
  width: 100%; aspect-ratio: 1/1.05; object-fit: cover; object-position: top center;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: var(--surface-strong);
  border-radius: 63% 37% 54% 46% / 43% 51% 49% 57%;
  animation: blobMorph 11s ease-in-out infinite;
}
@keyframes blobMorph {
  0%, 100% { border-radius: 63% 37% 54% 46% / 43% 51% 49% 57%; }
  33%      { border-radius: 42% 58% 63% 37% / 51% 46% 54% 49%; }
  66%      { border-radius: 50% 50% 33% 67% / 60% 40% 60% 40%; }
}
@media (prefers-reduced-motion: reduce) {
  .portrait-img, .portrait-glow { animation: none; border-radius: 32px; }
}
.chip {
  position: absolute; padding: 10px 16px; border-radius: 999px;
  background: var(--bg-soft); border: 1px solid var(--border); box-shadow: var(--shadow);
  font-size: 0.8rem; font-weight: 600; backdrop-filter: blur(10px);
  animation: floatChip 5s ease-in-out infinite;
}
.chip-1 { top: 10%; left: -14%; animation-delay: -1s; }
.chip-2 { bottom: 8%; right: -12%; }
@keyframes floatChip { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* ============ MARQUEE ============ */
.marquee-wrap { position: relative; z-index: 1; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface); overflow: hidden; padding: 22px 0; }
.marquee-track {
  display: flex; gap: 40px; width: max-content; white-space: nowrap;
  font-family: var(--ff-display); font-size: 1.3rem; font-weight: 500; color: var(--text-muted);
  animation: scrollLeft 32s linear infinite;
}
.marquee-track span:nth-child(4n+1) { color: var(--accent); }
@keyframes scrollLeft { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ============ SECTION GENERIC ============ */
.section { position: relative; z-index: 1; padding: 120px 0; }
.section-tag {
  display: inline-block; text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.78rem;
  color: var(--accent); font-weight: 600; margin-bottom: 1rem;
}
.section-title {
  font-family: var(--ff-display); font-weight: 600; letter-spacing: -0.02em;
  font-size: clamp(1.8rem, 3.6vw, 2.7rem); line-height: 1.18; margin-bottom: 1.4rem; max-width: 18ch;
}
.section-text { color: var(--text-muted); max-width: 56ch; margin-bottom: 1.1rem; font-size: 1.02rem; }

/* ============ ABOUT ============ */
.about-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 3.5rem; align-items: center; }
.stats-bento { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.6rem; display: flex; flex-direction: column; gap: 6px;
  transition: transform .3s, border-color .3s;
}
.stat-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.stat-card.big { grid-column: span 2; }
.stat-num { font-family: var(--ff-display); font-size: 2.6rem; font-weight: 700; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat-text { font-family: var(--ff-display); font-size: 1.5rem; font-weight: 600; line-height: 1.25; }
.stat-label { color: var(--text-muted); font-size: 0.88rem; }
.stat-card.location { justify-content: center; gap: 8px; font-size: 0.92rem; grid-column: span 2; }
.stat-card.location span:first-child { font-weight: 600; }
.stat-card.location span:last-child { color: var(--text-muted); font-size: 0.82rem; }

/* ============ STATEMENT ============ */
.statement { position: relative; z-index: 1; padding: 80px 0; text-align: center; }
.statement p {
  font-family: var(--ff-display); font-weight: 600; letter-spacing: -0.02em;
  font-size: clamp(1.6rem, 4.6vw, 3rem); line-height: 1.25; max-width: 18ch; margin: 0 auto;
}

/* ============ BENTO / SERVICES ============ */
.bento-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.bento-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.8rem; grid-column: span 2;
  transition: transform .3s, border-color .3s, box-shadow .3s;
  will-change: transform;
}
.bento-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.bento-card.span-2 { grid-column: span 4; }
.bento-icon {
  width: 46px; height: 46px; border-radius: 12px; background: var(--surface-strong);
  display: flex; align-items: center; justify-content: center; margin-bottom: 1rem; color: var(--accent);
}
.bento-icon svg { width: 22px; height: 22px; }
.bento-card h3 { font-family: var(--ff-display); font-size: 1.15rem; margin-bottom: 0.5rem; font-weight: 600; }
.bento-card p { color: var(--text-muted); font-size: 0.94rem; }

/* ============ SKILLS ============ */
.skills-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.6rem 3rem; }
.skill-head { display: flex; justify-content: space-between; font-size: 0.92rem; margin-bottom: 8px; }
.skill-head span:last-child { color: var(--text-muted); }
.bar { height: 8px; border-radius: 999px; background: var(--surface-strong); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: var(--grad); width: 0%; transition: width 1.4s cubic-bezier(.22,1,.36,1); }

/* ============ PROJECTS ============ */
.projects-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.project-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: transform .35s, border-color .35s, box-shadow .35s;
}
.project-card:hover { transform: translateY(-6px); border-color: var(--accent); box-shadow: var(--shadow); }
.project-media { aspect-ratio: 16/10; overflow: hidden; background: var(--bg-soft); }
.project-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.project-card:hover .project-media img { transform: scale(1.06); }
.project-body { padding: 1.7rem; display: flex; flex-direction: column; gap: 0.6rem; }
.project-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.project-tags span { font-size: 0.72rem; padding: 4px 10px; border-radius: 999px; background: var(--surface-strong); color: var(--text-muted); }
.project-body h3 { font-family: var(--ff-display); font-size: 1.3rem; font-weight: 600; }
.project-body p { color: var(--text-muted); font-size: 0.92rem; }
.project-link { color: var(--accent); font-weight: 600; font-size: 0.92rem; margin-top: 0.4rem; display: inline-flex; gap: 6px; align-items: center; width: fit-content; }
.project-link span { transition: transform .2s; }
.project-link:hover span { transform: translate(3px,-3px); }

/* ============ CONTACT ============ */
.contact-section { padding-bottom: 140px; }
.contact-card {
  text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: 28px;
  padding: clamp(2.5rem, 6vw, 5rem) clamp(1.5rem, 6vw, 3rem);
  position: relative; overflow: hidden;
}
.contact-card::before {
  content: ''; position: absolute; inset: -2px; border-radius: 28px; padding: 2px;
  background: var(--grad); opacity: 0.5;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
}
.contact-card .section-tag, .contact-card .section-title, .contact-card .section-text { position: relative; }
.contact-card .section-title, .contact-card .section-text { margin-left: auto; margin-right: auto; }
.contact-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 1.8rem; position: relative; }

/* ============ FOOTER ============ */
.footer { position: relative; z-index: 1; padding: 30px 0; border-top: 1px solid var(--border); }
.footer-inner { position: relative; display: flex; align-items: center; justify-content: center; gap: 1rem; }
.footer-inner p { color: var(--text-muted); font-size: 0.85rem; text-align: center; }
.footer-inner .to-top { position: absolute; right: 0; }
.to-top { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border); transition: transform .25s, background .25s; }
.to-top:hover { background: var(--grad); color: #0a1613; transform: translateY(-3px); }

/* ============ LIGHTBOX ============ */
.lightbox {
  position: fixed; inset: 0; background: var(--bg); backdrop-filter: blur(6px);
  z-index: 900; display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility .3s ease; padding: 4vh 4vw;
}
.lightbox.open { opacity: 1; visibility: visible; }
.lightbox img { max-width: 100%; max-height: 92vh; border-radius: 14px; box-shadow: var(--shadow); }
.lightbox-close { position: absolute; top: 24px; right: 30px; font-size: 1.5rem; color: var(--text); width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border); }
.lightbox-close:hover { background: var(--surface-strong); }

/* ============ RESPONSIVE ============ */
@media (max-width: 980px) {
  .hero-grid, .about-grid { grid-template-columns: 1fr; }
  .hero-visual { order: -1; margin-bottom: 1rem; }
  .portrait-frame { width: min(340px, 72vw); }
  .bento-grid { grid-template-columns: repeat(2, 1fr); }
  .bento-card { grid-column: span 1 !important; }
  .skills-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .burger { display: flex; }
  .nav-cta { display: none; }
  .nav-actions { margin-left: auto; }
}

@media (max-width: 560px) {
  .hero { padding-top: 120px; }
  .chip { font-size: 0.68rem; padding: 7px 12px; }
  .chip-1 { left: -6%; top: 4%; }
  .chip-2 { right: -6%; }
  .stats-bento { grid-template-columns: 1fr 1fr; }
  .contact-actions { flex-direction: column; align-items: stretch; }
}

@media (max-width: 380px) {
  .bento-grid { grid-template-columns: 1fr; }
  .bento-card { grid-column: span 1 !important; }
}
