/* —— Variables —— */
:root {
  --bg: #0a120e;
  --bg-elevated: #111c16;
  --bg-card: #1a2b22;
  --text: #eef3eb;
  --text-muted: #9fb5a6;
  --accent: #7dce9a;
  --accent-bright: #b8e986;
  --accent-blue: #5ba3e8;
  --accent-dim: rgba(125, 206, 154, 0.14);
  --accent-glow: rgba(125, 206, 154, 0.42);
  --warm: #d8ccb4;
  --border: rgba(184, 233, 134, 0.12);
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "DM Sans", system-ui, sans-serif;
  --radius: 16px;
  --radius-lg: 28px;
  --header-h: 72px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; }

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s, opacity 0.2s;
}

a:hover { color: var(--accent-bright); }

/* Ambient blobs */
.ambient {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.45;
}

.ambient-1 {
  width: 420px;
  height: 420px;
  top: -80px;
  right: -100px;
  background: radial-gradient(circle, rgba(125, 206, 154, 0.35), transparent 70%);
  animation: drift 18s ease-in-out infinite;
}

.ambient-2 {
  width: 360px;
  height: 360px;
  bottom: 10%;
  left: -120px;
  background: radial-gradient(circle, rgba(91, 163, 232, 0.2), transparent 70%);
  animation: drift 22s ease-in-out infinite reverse;
}

@keyframes drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, -20px) scale(1.08); }
}

.container {
  width: min(1120px, calc(100% - 2.5rem));
  margin-inline: auto;
}

/* Grain overlay */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.04;
  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.9' 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;
}

/* —— Header —— */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: clamp(1rem, 4vw, 2.5rem);
  background: rgba(10, 18, 14, 0.78);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, background 0.3s;
}

.header.scrolled {
  border-bottom-color: var(--border);
}

.logo {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

.logo-dot { color: var(--accent); }

.nav {
  display: flex;
  gap: 1.75rem;
  align-items: center;
}

.nav a {
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 500;
}

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

.nav-cta {
  color: var(--bg) !important;
  background: var(--accent);
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  font-weight: 600 !important;
}

.nav-cta:hover {
  background: var(--accent-bright);
  color: var(--bg) !important;
}

.menu-btn {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
}

.menu-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: transform 0.3s var(--ease), opacity 0.3s;
}

.menu-btn[aria-expanded="true"] span:first-child {
  transform: translateY(4px) rotate(45deg);
}

.menu-btn[aria-expanded="true"] span:last-child {
  transform: translateY(-4px) rotate(-45deg);
}

/* —— Hero —— */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--header-h);
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 85% 15%, rgba(125, 206, 154, 0.18), transparent 55%),
    radial-gradient(ellipse 45% 40% at 15% 75%, rgba(91, 163, 232, 0.1), transparent 50%),
    radial-gradient(ellipse 60% 50% at 50% 100%, rgba(26, 43, 34, 0.9), transparent 60%);
  pointer-events: none;
}

.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, var(--bg) 100%);
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 0.85fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  padding-block: 3rem 5rem;
}

.hero-content {
  z-index: 1;
}

.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
  z-index: 1;
}

.portrait-wrap {
  position: relative;
  width: min(100%, 340px);
  transition: transform 0.15s ease-out;
}

.portrait-glow {
  position: absolute;
  inset: -12% -8%;
  background: radial-gradient(ellipse at 40% 30%, rgba(125, 206, 154, 0.55), rgba(91, 163, 232, 0.15) 50%, transparent 72%);
  filter: blur(28px);
  animation: pulse-glow 5s ease-in-out infinite;
}

.portrait-ring {
  position: absolute;
  inset: -6px;
  border-radius: 38% 62% 58% 42% / 48% 42% 58% 52%;
  border: 2px solid rgba(184, 233, 134, 0.35);
  animation: morph-ring 10s ease-in-out infinite;
}

.portrait {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  border-radius: 38% 62% 55% 45% / 45% 40% 60% 55%;
  object-fit: cover;
  aspect-ratio: 2 / 3;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(184, 233, 134, 0.15);
  animation: portrait-float 6s ease-in-out infinite;
}

.portrait-badge {
  position: absolute;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--text);
  background: rgba(17, 28, 22, 0.82);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.portrait-badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-bright);
  box-shadow: 0 0 10px var(--accent-glow);
  animation: blink 2.5s ease-in-out infinite;
}

@keyframes portrait-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.75; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.04); }
}

@keyframes morph-ring {
  0%, 100% { border-radius: 38% 62% 58% 42% / 48% 42% 58% 52%; }
  50% { border-radius: 58% 42% 48% 52% / 42% 58% 42% 58%; }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.hero-inner {
  position: relative;
  padding-block: 4rem 6rem;
}

.eyebrow {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1.25rem;
}

.hero-title {
  font-family: var(--sans);
  font-size: clamp(2.2rem, 5.5vw, 3.8rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0 0 1.5rem;
  max-width: 16ch;
}

.hero-title em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}

.hero-lead {
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  color: var(--text-muted);
  max-width: 52ch;
  margin: 0 0 2rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 3.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.6rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s, background 0.2s;
}

.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-bright) 100%);
  color: #0a120e;
  box-shadow: 0 4px 28px var(--accent-glow);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-bright) 0%, #d4f5a8 100%);
  box-shadow: 0 8px 40px var(--accent-glow);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

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

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.btn-outline:hover {
  background: var(--accent-dim);
}

.btn-full { width: 100%; }

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: clamp(2rem, 5vw, 4rem);
  margin: 0;
  padding: 0;
}

.hero-stats div { margin: 0; }

.hero-stats dt {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  margin: 0;
}

.hero-stats dd {
  margin: 0.25rem 0 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(6px); }
}

/* —— Sections —— */
.section {
  padding-block: clamp(4rem, 10vw, 7rem);
}

.section-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: clamp(1.9rem, 4vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0 0 1rem;
}

.section-title em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}

.section-sub {
  color: var(--text-muted);
  margin: 0;
  max-width: 40ch;
}

.section-head {
  margin-bottom: 3rem;
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 2.5rem;
  align-items: start;
}

.about-side {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.about-mini-portrait {
  width: 120px;
  height: 120px;
  border-radius: 42% 58% 52% 48% / 48% 44% 56% 52%;
  overflow: hidden;
  border: 2px solid rgba(184, 233, 134, 0.25);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.about-mini-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.about-content p {
  color: var(--text-muted);
  max-width: 58ch;
}

.about-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
}

.about-tags li {
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 500;
  background: rgba(125, 206, 154, 0.08);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--accent-bright);
}

/* Skills */
.skills {
  background: var(--bg-elevated);
  border-block: 1px solid var(--border);
}

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

.skill-card {
  padding: 1.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color 0.3s, transform 0.3s var(--ease);
}

.skill-card:hover {
  border-color: rgba(125, 206, 154, 0.35);
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
}

.skill-icon {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 1rem;
}

.skill-card h3 {
  margin: 0 0 0.6rem;
  font-size: 1.15rem;
}

.skill-card p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-muted);
}

/* Projects */
.projects-group {
  margin-bottom: 3rem;
}

.projects-group:last-of-type {
  margin-bottom: 0;
}

.projects-group-title {
  margin: 0 0 1.25rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.projects-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.project-card {
  padding: 1.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s var(--ease);
}

.project-card:hover {
  border-color: rgba(125, 206, 154, 0.3);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
  transform: translateY(-3px);
}

.project-card.featured {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(125, 206, 154, 0.1) 100%);
  border-color: rgba(125, 206, 154, 0.2);
}

.project-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.project-tag {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.project-link {
  font-size: 0.85rem;
  font-weight: 600;
}

.project-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
}

.project-card p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.projects-more {
  margin-top: 2rem;
  text-align: center;
}

.projects-more a {
  font-weight: 600;
}

/* Resume */
.resume-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 4rem;
  align-items: start;
  margin-bottom: 3rem;
}

.resume-intro p {
  color: var(--text-muted);
  max-width: 36ch;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--border);
}

.project-link-static {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
}

.timeline-item-featured::before {
  width: 11px;
  height: 11px;
  left: -6px;
  background: var(--accent-bright);
  box-shadow: 0 0 16px var(--accent-glow);
}

.timeline-item-featured {
  padding-bottom: 2.75rem;
}

.timeline-item-featured h3 {
  color: var(--accent-bright);
}

.timeline-item {
  position: relative;
  padding: 0 0 2.5rem 2rem;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-item::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 0.35rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

.timeline-item time {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 0.35rem;
}

.timeline-item h3 {
  margin: 0 0 0.4rem;
  font-size: 1.1rem;
}

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

.offer-card {
  padding: 2rem 2.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.offer-card h3 {
  margin: 0 0 1.25rem;
  font-size: 1.2rem;
}

.offer-card ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.offer-card li {
  padding: 0.75rem 0;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.95rem;
}

.offer-card li:first-child { border-top: none; padding-top: 0; }

.offer-card strong { color: var(--text); }

/* Contact */
.contact {
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
}

.contact-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.contact-text p {
  color: var(--text-muted);
  max-width: 36ch;
}

.contact-direct {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-direct li {
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.25s, transform 0.25s var(--ease);
}

.contact-direct li:hover {
  border-color: rgba(125, 206, 154, 0.35);
  transform: translateX(4px);
}

.contact-direct-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.contact-direct a {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent-bright);
  word-break: break-all;
}

.contact-direct a:hover {
  color: var(--accent-blue);
}

.contact-card {
  padding: 1.75rem;
  background: linear-gradient(135deg, rgba(125, 206, 154, 0.08), rgba(91, 163, 232, 0.06));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.contact-card h3 {
  margin: 0 0 0.75rem;
  font-size: 1.2rem;
}

.contact-card p {
  margin: 0;
  color: var(--text-muted);
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 1.5rem;
}

.form-note {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
}

/* Footer */
.footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1.25rem;
}

.footer-inner > p {
  margin: 0;
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.footer-links a {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-muted);
}

.footer-links a:hover { color: var(--accent); }

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

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

/* —— Responsive —— */
@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-content {
    order: 2;
  }

  .hero-visual {
    order: 1;
  }

  .hero-title,
  .hero-lead {
    max-width: none;
    margin-inline: auto;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-stats {
    justify-content: center;
  }

  .portrait-wrap {
    margin-inline: auto;
    width: min(280px, 75vw);
  }

  .about-grid,
  .resume-grid,
  .contact-inner {
    grid-template-columns: 1fr;
  }

  .about-grid .section-label { margin-bottom: 0; }

  .about-side {
    flex-direction: row;
    align-items: center;
    gap: 1.25rem;
  }

  .about-mini-portrait {
    flex-shrink: 0;
  }

  .projects-list { grid-template-columns: 1fr; }

  .project-card.featured { grid-column: auto; }

  .hero-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }
}

@media (max-width: 720px) {
  .nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    padding: 1.5rem;
    gap: 1rem;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    transform: translateY(-120%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.35s var(--ease), opacity 0.35s;
  }

  .nav.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .menu-btn { display: flex; }

  .hero-title { max-width: none; }

  .scroll-hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { transition: none; opacity: 1; transform: none; }
  .scroll-hint,
  .portrait,
  .portrait-glow,
  .portrait-ring,
  .ambient,
  .portrait-badge-dot { animation: none; }
}

