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

:root {
  --bg: #f0eeeb;
  --card: #ffffff;
  --text: #111111;
  --muted: #666666;
  --border: #e0ddd8;
  --accent: #2563eb;
  --max: 800px;
}

html { 
  scroll-behavior: smooth; 
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 1.5rem; }

/* ── NAV ── */
nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(240,238,235,0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
nav .container { display: flex; align-items: center; justify-content: space-between; height: 54px; }
.nav-name { font-size: 0.95rem; font-weight: 600; color: var(--text); }
.nav-links { display: flex; gap: 1.75rem; list-style: none; }
.nav-links a { font-size: 0.85rem; font-weight: 500; color: var(--muted); transition: color 0.15s; }
.nav-links a:hover { color: var(--text); text-decoration: none; }

/* ── HERO ── */
#hero { padding: 3.5rem 0 3rem; }
.hero-grid { display: grid; grid-template-columns: 260px 1fr; gap: 2.5rem; align-items: start; }

.hero-photo {
  width: 100%; aspect-ratio: 3/4; border-radius: 10px;
  background: #d8d4ce; overflow: hidden;
  display: flex; align-items: center; justify-content: center;position: relative;
}
.hero-photo img { 
  position: absolute; /* 2. Takes the image out of the flex layout */
  top: 0;
  left: 0;
  width: 100%; 
  height: 100%; 
  object-fit: cover; 
  display: block; 
  z-index: 10; /* 3. Puts the image visually on top of the placeholder */
}
.photo-placeholder {
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
  color: #999; font-size: 0.78rem; text-align: center; padding: 1.5rem;
}

.hero-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 1.2rem; }
.hero-heading { font-size: clamp(1.9rem, 4vw, 2.35rem); font-weight: 700; letter-spacing: -0.025em; line-height: 1.1; }

.hero-socials { display: flex; gap: 0.5rem; padding-top: 0.3rem; }
.social-icon {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 7px; color: var(--text);
  transition: background 0.15s;
}
.social-icon:hover { background: var(--border); text-decoration: none; }

.hero-bio { color: var(--text); margin-bottom: 1.4rem; font-size: 0.93rem; }
.hero-bio p + p { margin-top: 0.8rem; }
.hero-bio em { font-style: italic; font-weight: 500; }

.hero-tags { display: flex; flex-wrap: wrap; gap: 0.45rem; align-items: center; }
.tags-group { display: flex; gap: 0.45rem; align-items: center; }
.tag {
  display: inline-flex;
  align-items: center;
  background: #1a1a1a; color: #fff;
  font-size: 0.78rem; font-weight: 500;
  padding: 0.35rem 0.85rem; border-radius: 6px;
}

/* ── DIVIDER ── */
.divider { border: none; border-top: 1px solid var(--border); }

/* ── SECTIONS ── */
section { padding: 3rem 0; }
.section-title { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 1.75rem; }
.subsection-label { font-size: 0.78rem; font-weight: 600; color: var(--muted); margin-bottom: 0.8rem; letter-spacing: 0.02em; }

/* ── SKILLS ── */
.skills-group { margin-bottom: 1.6rem; }
.skill-grid { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.skill-card {
  display: flex; align-items: center; gap: 0.5rem;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 8px; padding: 0.45rem 0.95rem;
  font-size: 0.86rem; font-weight: 500;
}
.skill-card .si { width: 18px; height: 18px; flex-shrink: 0; }

/* ── PROJECTS ── */
.project-list { display: flex; flex-direction: column; gap: 1rem; }
.project-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 1.2rem 1.4rem;
  transition: box-shadow 0.2s;
}
.project-card:hover { box-shadow: 0 3px 14px rgba(0,0,0,0.07); }
.project-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; }
.project-name { font-weight: 600; font-size: 0.95rem; }
.project-link { font-size: 0.78rem; color: var(--accent); }
.project-stack { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.75rem; }
.stack-tag {
  background: var(--bg); border: 1px solid var(--border);
  font-size: 0.71rem; font-weight: 500;
  padding: 0.18rem 0.55rem; border-radius: 5px; color: var(--text);
}
.project-bullets { list-style: none; display: flex; flex-direction: column; gap: 0.28rem; }
.project-bullets li { font-size: 0.865rem; color: var(--text); padding-left: 1.1rem; position: relative; }
.project-bullets li::before { content: '+'; position: absolute; left: 0; color: var(--muted); font-weight: 700; }

/* ── EDUCATION ── */
.edu-list { display: flex; flex-direction: column; gap: 1.4rem; }
.edu-school { font-weight: 600; font-size: 0.95rem; }
.edu-detail { font-size: 0.86rem; color: var(--muted); margin-top: 0.1rem; }

/* ── CONTACT ── */
.contact-sub { color: var(--muted); margin-bottom: 1.75rem; font-size: 0.9rem; max-width: 480px; }
.contact-form { display: flex; flex-direction: column; gap: 0.9rem; max-width: 520px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; }
.form-group { display: flex; flex-direction: column; gap: 0.35rem; }
label { font-size: 0.77rem; font-weight: 600; color: var(--muted); }
input, textarea {
  font-family: 'Inter', sans-serif; font-size: 0.875rem;
  padding: 0.6rem 0.85rem; border: 1px solid var(--border);
  border-radius: 7px; background: var(--card); color: var(--text);
  outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
textarea { resize: vertical; min-height: 110px; }
.contact-form form { display: flex; flex-direction: column; gap: 0.9rem; }
.submit-btn {
  align-self: flex-start; background: #1a1a1a; color: #fff;
  font-family: 'Inter', sans-serif; font-size: 0.875rem; font-weight: 600;
  padding: 0.6rem 1.4rem; border: none; border-radius: 7px; cursor: pointer;
  transition: background 0.15s;
}
.submit-btn:hover { background: #333; }

.success-msg {
  display: none; background: #ecfdf5; border: 1px solid #bbf7d0;
  color: #166534; font-size: 0.875rem; font-weight: 500;
  padding: 0.75rem 1rem; border-radius: 8px; max-width: 520px;
}

/* ── FOOTER ── */
footer { border-top: 1px solid var(--border); padding: 1.75rem 0; }
footer .container { display: flex; align-items: center; justify-content: space-between; }
.footer-text { font-size: 0.8rem; color: var(--muted); }

/* ── RESPONSIVE ── */
@media (max-width: 620px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-photo { max-width: 180px; aspect-ratio: 1/1; }
  .form-row { grid-template-columns: 1fr; }
  .nav-links { gap: 1rem; }
}

/* ── NAV RIGHT ── */
.nav-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ── DARK TOGGLE ── */
.dark-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 7px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
  transition: background 0.15s;
}
.dark-toggle:hover { background: var(--border); }

/* ── HAMBURGER ── */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 7px;
  width: 34px;
  height: 34px;
  padding: 7px;
  cursor: pointer;
}
.hamburger span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}
.hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 620px) {
  .hamburger { display: flex; }
  .nav-links.open { display: flex; }
  .nav-links a { font-size: 1rem; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-photo { max-width: 180px; aspect-ratio: 1/1; }
  .form-row { grid-template-columns: 1fr; }
}

/* ── DARK MODE ── */
body.dark {
  --bg: #0f1117;
  --card: #1a1d27;
  --text: #e8e8e8;
  --muted: #d1d1d1;
  --border: #2a2d3a;
  --accent: #5b8dee;
}
body.dark nav {
  background: rgba(15,17,23,0.92);
}
body.dark .tag {
  background: #e8e8e8;
  color: #111;
}
body.dark input,
body.dark textarea {
  background: var(--card);
  color: var(--text);
}
body.dark .submit-btn {
  background: #2a2d3a; 
  color: #e8e8e8;    
}
body.dark .submit-btn:hover {
  background: #3a3f58; 
}
body.dark ::placeholder {
  color: var(--muted);
  opacity: 1; 
}
/* ── CV TAG ── */
.tag-cv {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  transition: opacity 0.15s;
}
.tag-cv:hover { opacity: 0.8; text-decoration: none; }

/* ── NAV SLIDE ANIMATION ── */
@media (max-width: 620px) {
  .nav-links {
    position: absolute;
    top: 54px;
    left: 0; right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    gap: 1rem;
    z-index: 99;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    padding: 0 1.5rem;
    transition: max-height 0.35s ease, padding 0.35s ease, opacity 0.3s ease;
  }
  .nav-links.open {
    max-height: 300px;
    opacity: 1;
    padding: 1rem 1.5rem;
  }
}
.currently-learning {
  margin-top: 0.8rem;
  font-size: 0.88rem;
  color: var(--text);
}
.currently-learning strong { color: var(--text); font-weight: 600; }

/* ── COPY EMAIL ── */
.copy-email-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: 'Inter', sans-serif;
  padding: 0;
  transition: color 0.15s;
}
.copy-email-btn:hover { color: var(--text); }
.copy-tooltip {
  font-size: 0.75rem;
  background: var(--text);
  color: var(--bg);
  padding: 0.2rem 0.6rem;
  border-radius: 5px;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  margin-left: 0.25rem;
}
.copy-tooltip.show { opacity: 1; }

/* ── BACK TO TOP ── */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--text);
  color: var(--bg);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  z-index: 200;
}
.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}
.back-to-top:hover { opacity: 0.85; }

/* ── ACTIVE NAV LINK ── */
.nav-links a.active { color: var(--text); font-weight: 600; }

/* ── SCROLL FADE-IN ── */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── DARK MODE extras ── */
body.dark .back-to-top { background: var(--text); color: var(--bg); }
body.dark .copy-email-btn { color: var(--muted); }
body.dark .copy-email-btn:hover { color: var(--text); }