/* ── Reset & Variables ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ink:        #1a1a2e;
  --green:      #16713e;
  --green-dim:  #0f5230;
  --green-lt:   #e6f4ec;
  --gray:       #6b6b80;
  --gray-lt:    #f6f6f8;
  --border:     #e2e2ea;
  --white:      #ffffff;
  --shadow-sm:  0 2px 8px rgba(0,0,0,.06);
  --shadow-md:  0 6px 24px rgba(0,0,0,.09);
  --radius:     12px;
  --nav-h:      62px;
  --max:        860px;
  --ease:       cubic-bezier(.4,0,.2,1);
}

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--white);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

/* ── Navigation ─────────────────────────────────────────────────────── */
#navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(1.5rem, 5vw, 3.5rem);
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, box-shadow .3s;
}
#navbar.scrolled {
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-sm);
}
.nav-logo {
  font-family: 'Fraunces', serif;
  font-size: 1.2rem; font-weight: 600;
  color: var(--ink); text-decoration: none;
  letter-spacing: -.02em;
}
.nav-logo span { color: var(--green); }

.nav-links {
  display: flex; align-items: center; gap: 2rem;
  list-style: none;
}
.nav-links a {
  text-decoration: none; color: var(--gray);
  font-size: .875rem; font-weight: 500;
  position: relative; padding-bottom: 2px;
  transition: color .2s;
}
.nav-links a::after {
  content: ''; position: absolute; bottom: 0; left: 0;
  width: 0; height: 2px;
  background: var(--green); border-radius: 2px;
  transition: width .25s var(--ease);
}
.nav-links a:hover, .nav-links a.active { color: var(--green); }
.nav-links a.active::after, .nav-links a:hover::after { width: 100%; }

.hamburger {
  display: none; flex-direction: column; gap: 5px;
  cursor: pointer; border: none; background: none; padding: 4px;
}
.hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--ink); border-radius: 2px;
  transition: transform .3s, opacity .3s;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu {
  display: none; position: fixed;
  top: var(--nav-h); left: 0; right: 0; z-index: 190;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  padding: 1.5rem clamp(1.5rem, 5vw, 3.5rem) 2rem;
  flex-direction: column; gap: 1.25rem;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  text-decoration: none; color: var(--ink);
  font-size: 1.05rem; font-weight: 500;
  transition: color .2s;
}
.mobile-menu a:hover { color: var(--green); }

/* ── Layout ─────────────────────────────────────────────────────────── */
.wrapper {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 5vw, 2.5rem);
}

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .65rem 1.4rem; border-radius: 9px;
  font-family: 'DM Sans', sans-serif;
  font-size: .9rem; font-weight: 500;
  text-decoration: none; cursor: pointer;
  border: none; transition: all .22s var(--ease);
  white-space: nowrap;
}
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover {
  background: var(--green-dim);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(22,113,62,.3);
}
.btn-outline {
  border: 1.5px solid var(--border);
  color: var(--ink); background: transparent;
}
.btn-outline:hover {
  border-color: var(--green); color: var(--green);
  transform: translateY(-1px);
}

/* ── Section shared ─────────────────────────────────────────────────── */
.section { padding: 5rem 0; }
.section + .section { border-top: 1px solid var(--border); }

.section-eyebrow {
  font-size: .72rem; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--green); margin-bottom: .55rem;
}
.section-title {
  font-family: 'Fraunces', serif;
  font-weight: 600; font-size: clamp(1.7rem, 3.5vw, 2.1rem);
  letter-spacing: -.025em; color: var(--ink);
  margin-bottom: 2.75rem; line-height: 1.2;
}

/* ── Hero ────────────────────────────────────────────────────────────── */
#hero {
  min-height: 100vh;
  display: flex; align-items: center;
  padding-top: var(--nav-h);
  background:
    radial-gradient(ellipse 70% 60% at 10% 20%, var(--green-lt) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 90% 80%, #e8f0fe 0%, transparent 55%);
}
.hero-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 4rem clamp(1.5rem, 5vw, 2.5rem);
}
.hero-badge {
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .35rem 1rem;
  font-size: .8rem; font-weight: 500; color: var(--gray);
  margin-bottom: 1.8rem;
  box-shadow: var(--shadow-sm);
  animation: fadeDown .6s var(--ease) both;
}
.dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green);
  animation: pulse 2s ease infinite;
}
@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(22,113,62,.4); }
  50%      { box-shadow: 0 0 0 5px rgba(22,113,62,0); }
}
#hero h1 {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: clamp(2.8rem, 7vw, 4.2rem);
  letter-spacing: -.04em; line-height: 1.08;
  color: var(--ink); margin-bottom: 1.3rem;
  animation: fadeUp .7s .1s var(--ease) both;
}
#hero h1 em { font-style: italic; font-weight: 300; color: var(--green); }
.hero-sub {
  max-width: 540px;
  font-size: 1.05rem; color: var(--gray);
  margin-bottom: 2.2rem; line-height: 1.7;
  animation: fadeUp .7s .2s var(--ease) both;
}
.hero-cta {
  display: flex; flex-wrap: wrap; gap: .75rem;
  animation: fadeUp .7s .3s var(--ease) both;
}
.hero-stats {
  display: flex; gap: 2.5rem; margin-top: 3.5rem; flex-wrap: wrap;
  animation: fadeUp .7s .4s var(--ease) both;
}

.hero-stat .num {
  font-family: 'Fraunces', serif;
  font-size: 1.9rem; font-weight: 600;
  color: var(--ink); line-height: 1;
}
.hero-stat .label { font-size: .8rem; color: var(--gray); margin-top: .2rem; }

/* ── Skills ─────────────────────────────────────────────────────────── */
#skills { background: var(--gray-lt); }

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}
.skill-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.skill-card:hover {
  border-color: var(--green);
  box-shadow: 0 4px 20px rgba(22,113,62,.1);
  transform: translateY(-2px);
}
.skill-icon {
  width: 38px; height: 38px; border-radius: 9px;
  background: var(--green-lt);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: .9rem; font-size: 1.1rem;
}
.skill-card h3 { font-size: .9rem; font-weight: 600; color: var(--ink); margin-bottom: .4rem; }
.skill-card p  { font-size: .82rem; color: var(--gray); line-height: 1.6; }

/* ── Projects ────────────────────────────────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}
.project-card {
  border: 1px solid var(--border);
  border-radius: 14px; padding: 2rem;
  display: flex; flex-direction: column;
  transition: border-color .2s, box-shadow .2s, transform .22s;
  position: relative; overflow: hidden;
}
.project-card::before {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--green), #34d399);
  transform: scaleX(0); transform-origin: left;
  transition: transform .3s var(--ease);
}
.project-card:hover {
  border-color: var(--green);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}
.project-card:hover::before { transform: scaleX(1); }

.project-tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.tag {
  background: var(--green-lt); color: var(--green);
  font-size: .72rem; font-weight: 600;
  padding: .2rem .65rem; border-radius: 999px;
}
.project-card h3 {
  font-family: 'Fraunces', serif;
  font-size: 1.15rem; font-weight: 600;
  color: var(--ink); margin-bottom: .6rem; line-height: 1.3;
}
.project-card p {
  font-size: .88rem; color: var(--gray);
  line-height: 1.65; flex: 1; margin-bottom: 1.5rem;
}
.project-link {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .84rem; font-weight: 500; color: var(--green);
  text-decoration: none; transition: gap .2s;
}
.project-link:hover { gap: .55rem; }

/* ── Education ───────────────────────────────────────────────────────── */
#education { background: var(--gray-lt); }

.edu-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px; padding: 2rem 2.2rem;
  display: flex; gap: 1.5rem;
}
.edu-stripe {
  width: 4px;
  background: linear-gradient(180deg, var(--green), #34d399);
  border-radius: 4px; flex-shrink: 0;
}
.edu-body h3 {
  font-family: 'Fraunces', serif;
  font-size: 1.2rem; font-weight: 600;
  color: var(--ink); margin-bottom: .25rem;
}
.edu-body .degree { font-size: .95rem; color: var(--gray); margin-bottom: .9rem; }
.edu-courses { display: flex; flex-wrap: wrap; gap: .45rem; }
.course-tag {
  background: var(--gray-lt); border: 1px solid var(--border);
  color: var(--ink); font-size: .78rem; font-weight: 500;
  padding: .25rem .75rem; border-radius: 7px;
}

/* ── Contact ─────────────────────────────────────────────────────────── */
#contact { background: var(--ink); color: #fff; }
#contact .section-eyebrow { color: #34d399; }
#contact .section-title   { color: #fff; }

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem; align-items: start;
}
.contact-text p {
  color: rgba(255,255,255,.65);
  font-size: .95rem; line-height: 1.7; margin-bottom: 1.5rem;
}
.contact-links { display: flex; flex-direction: column; gap: .75rem; }
.contact-link {
  display: flex; align-items: center; gap: .85rem;
  text-decoration: none; color: rgba(255,255,255,.8);
  font-size: .9rem; transition: color .2s;
}
.contact-link:hover { color: #fff; }
.contact-link .icon {
  width: 36px; height: 36px; border-radius: 9px;
  background: rgba(255,255,255,.08);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: background .2s;
}
.contact-link:hover .icon { background: rgba(52,211,153,.15); }

/* Contact form */
.contact-form {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px; padding: 1.75rem;
}
.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block; font-size: .8rem; font-weight: 500;
  color: rgba(255,255,255,.6); margin-bottom: .4rem;
}
.form-group input,
.form-group textarea {
  width: 100%; padding: .7rem 1rem;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px; color: #fff;
  font-family: 'DM Sans', sans-serif; font-size: .9rem;
  transition: border-color .2s, background .2s;
  outline: none; resize: none;
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: rgba(255,255,255,.3); }
.form-group input:focus,
.form-group textarea:focus {
  border-color: #34d399;
  background: rgba(255,255,255,.1);
}
.form-group textarea { height: 110px; }
.form-submit {
  width: 100%; padding: .75rem;
  background: var(--green); color: #fff;
  border: none; border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: .95rem; font-weight: 600;
  cursor: pointer; transition: background .2s, transform .2s;
}
.form-submit:hover { background: var(--green-dim); transform: translateY(-1px); }
.form-msg {
  display: none; margin-top: .75rem; padding: .65rem 1rem;
  border-radius: 8px; font-size: .85rem; text-align: center;
}
.form-msg.success { background: rgba(52,211,153,.15); color: #34d399; display: block; }
.form-msg.error   { background: rgba(239,68,68,.15);  color: #f87171;  display: block; }

/* ── Footer ──────────────────────────────────────────────────────────── */
footer {
  background: var(--ink); color: rgba(255,255,255,.4);
  border-top: 1px solid rgba(255,255,255,.08);
  text-align: center; padding: 1.5rem; font-size: .8rem;
}
footer a { color: rgba(255,255,255,.5); text-decoration: none; }
footer a:hover { color: #34d399; }

/* ── Back to top ─────────────────────────────────────────────────────── */
#back-top {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 150;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--green); color: #fff;
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(22,113,62,.35);
  opacity: 0; pointer-events: none;
  transition: opacity .3s, transform .3s;
}
#back-top.visible { opacity: 1; pointer-events: all; }
#back-top:hover { transform: translateY(-3px); }

/* ── Reveal ──────────────────────────────────────────────────────────── */
[data-reveal] {
  opacity: 0; transform: translateY(24px);
  transition: opacity .6s var(--ease), transform .6s var(--ease);
}
[data-reveal].visible { opacity: 1; transform: translateY(0); }

@keyframes fadeDown { from { opacity:0; transform:translateY(-12px); } to { opacity:1; transform:translateY(0); } }
@keyframes fadeUp   { from { opacity:0; transform:translateY(16px);  } to { opacity:1; transform:translateY(0); } }

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .contact-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 1.75rem; }
  .projects-grid { grid-template-columns: 1fr; }
  .edu-card { flex-direction: column; gap: .75rem; }
  .edu-stripe { width: 100%; height: 4px; }
}
/* ── About ───────────────────────────────────────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}
.about-text p {
  font-size: .97rem;
  color: var(--gray);
  line-height: 1.8;
  margin-bottom: 1.1rem;
}
.about-text p:last-child { margin-bottom: 0; }
.about-text strong { color: var(--ink); font-weight: 600; }

.about-traits {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .85rem;
}
.trait-card {
  background: var(--gray-lt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.3rem;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.trait-card:hover {
  border-color: var(--green);
  box-shadow: 0 4px 16px rgba(22,113,62,.08);
  transform: translateY(-2px);
}
.trait-icon {
  font-size: 1.3rem;
  margin-bottom: .6rem;
}
.trait-card h4 {
  font-size: .88rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: .35rem;
}
.trait-card p {
  font-size: .8rem;
  color: var(--gray);
  line-height: 1.6;
}

@media (max-width: 700px) {
  .about-grid { grid-template-columns: 1fr; gap: 2rem; }
  .about-traits { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .about-traits { grid-template-columns: 1fr; }
}
