/* ================= THEME TOKENS ================= */
:root {
  --bg: #0e1117;
  --bg-alt: #151a23;
  --card: #1a202b;
  --border: #2a3242;
  --text: #e6e9ef;
  --muted: #9aa4b5;
  --accent: #5eead4;      /* change this to re-color the whole site */
  --accent-soft: rgba(94, 234, 212, 0.12);
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  --font-head: "Space Grotesk", sans-serif;
  --font-body: "Inter", sans-serif;
}

[data-theme="light"] {
  --bg: #f7f8fa;
  --bg-alt: #eef1f5;
  --card: #ffffff;
  --border: #dde2ea;
  --text: #1a1f2b;
  --muted: #5b6577;
  --accent: #0d9488;
  --accent-soft: rgba(13, 148, 136, 0.1);
  --shadow: 0 10px 30px rgba(20, 30, 50, 0.08);
}

/* ================= BASE ================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  transition: background 0.3s, color 0.3s;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

.container { width: min(1100px, 100% - 2rem); margin-inline: auto; }

/* ================= BUTTONS ================= */
.btn {
  display: inline-block;
  padding: 0.8rem 1.5rem;
  border-radius: 999px;
  font-weight: 600;
  border: 2px solid var(--accent);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
  transition: transform 0.2s, background 0.2s, color 0.2s;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--accent); color: var(--bg); }
.btn--ghost { background: transparent; color: var(--accent); }
.btn--ghost:hover { background: var(--accent-soft); }

.icon-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  width: 40px; height: 40px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1.1rem;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ================= NAV ================= */
.nav {
  position: fixed; inset: 0 0 auto 0;
  z-index: 100;
  padding: 1rem 0;
  transition: background 0.3s, box-shadow 0.3s, padding 0.3s;
}
.nav.scrolled {
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 var(--border);
  padding: 0.6rem 0;
}
.nav__inner { display: flex; align-items: center; justify-content: space-between; }
.nav__logo { font-family: var(--font-head); font-weight: 700; font-size: 1.5rem; }
.nav__logo span { color: var(--accent); }
.nav__links { display: flex; gap: 2rem; }
.nav__links a { color: var(--muted); font-weight: 500; position: relative; }
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: -4px;
  width: 0; height: 2px; background: var(--accent); transition: width 0.25s;
}
.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; gap: 0.5rem; }
.nav__burger { display: none; }

/* ================= HERO ================= */
.hero { min-height: 100vh; display: flex; align-items: center; padding: 7rem 0 4rem; }
.hero__inner { display: grid; grid-template-columns: 1.3fr 1fr; gap: 3rem; align-items: center; }
.eyebrow { color: var(--accent); font-weight: 600; letter-spacing: 0.05em; }
.hero__name {
  font-family: var(--font-head);
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  line-height: 1.1;
  margin: 0.3rem 0;
}
.hero__role { font-family: var(--font-head); font-size: clamp(1.3rem, 3vw, 1.9rem); color: var(--muted); font-weight: 500; }
.typed { color: var(--text); }
.cursor { color: var(--accent); animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero__intro { color: var(--muted); max-width: 520px; margin: 1.2rem 0 2rem; font-size: 1.05rem; }
.hero__cta { display: flex; gap: 1rem; flex-wrap: wrap; }
.socials { display: flex; gap: 1.5rem; margin-top: 2rem; }
.socials a { color: var(--muted); font-size: 0.9rem; font-weight: 500; }
.socials a:hover { color: var(--accent); }

.hero__photo { display: flex; justify-content: center; }
.photo-frame {
  width: min(320px, 80vw); aspect-ratio: 1;
  border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
  overflow: hidden;
  border: 3px solid var(--accent);
  box-shadow: 0 0 0 12px var(--accent-soft), var(--shadow);
  animation: morph 8s ease-in-out infinite;
}
.photo-frame img { width: 100%; height: 100%; object-fit: cover; }
.photo-fallback {
  display: none; place-items: center; width: 100%; height: 100%;
  background: var(--card); font-family: var(--font-head);
  font-size: 4rem; color: var(--accent);
}
@keyframes morph {
  50% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
}

/* ================= SECTIONS ================= */
.section { padding: 6rem 0; }
.section:nth-of-type(odd) { background: var(--bg-alt); }
.section__title {
  font-family: var(--font-head);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  margin-bottom: 2.5rem;
  display: flex; align-items: center; gap: 0.6rem;
}
.section__title span { color: var(--accent); font-size: 0.7em; }
.section__title::after {
  content: ""; flex: 1; max-width: 250px; height: 1px; background: var(--border); margin-left: 1rem;
}
.section__title--center { justify-content: center; }
.section__title--center::after { display: none; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.card:hover { transform: translateY(-5px); border-color: var(--accent); box-shadow: var(--shadow); }

/* ================= ABOUT ================= */
.about { display: grid; grid-template-columns: 1.5fr 1fr; gap: 3rem; }
.about__text p { color: var(--muted); margin-bottom: 1rem; }
.about__facts { display: grid; gap: 1rem; align-content: start; }
.about__facts li {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: 0.9rem 1.2rem;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
}
.about__facts strong { color: var(--accent); font-weight: 600; }
.about__facts span { color: var(--muted); text-align: right; }

/* ================= SKILLS ================= */
.skills { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.5rem; }
.skills h3 { font-family: var(--font-head); margin-bottom: 1rem; }
.tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tags li {
  background: var(--accent-soft); color: var(--accent);
  padding: 0.35rem 0.85rem; border-radius: 999px;
  font-size: 0.85rem; font-weight: 500;
}
.tags--small li { font-size: 0.75rem; padding: 0.25rem 0.7rem; }

/* ================= PROJECTS ================= */
.filters { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 2rem; }
.filter {
  background: transparent; border: 1px solid var(--border); color: var(--muted);
  padding: 0.5rem 1.1rem; border-radius: 999px; cursor: pointer;
  font-family: inherit; font-weight: 500; transition: all 0.2s;
}
.filter:hover { color: var(--text); border-color: var(--accent); }
.filter.active { background: var(--accent); border-color: var(--accent); color: var(--bg); }

.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; }
.project { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.project.hide { display: none; }
.project__thumb {
  aspect-ratio: 16 / 9;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent-soft), transparent), var(--bg-alt);
  color: var(--muted); font-size: 0.85rem;
}
.project__thumb img { width: 100%; height: 100%; object-fit: cover; }
.project__body { padding: 1.4rem; display: flex; flex-direction: column; gap: 0.8rem; flex: 1; }
.project__body h3 { font-family: var(--font-head); }
.project__body p { color: var(--muted); font-size: 0.95rem; flex: 1; }
.project__links { display: flex; gap: 1.2rem; }
.project__links a { color: var(--accent); font-weight: 600; font-size: 0.9rem; }
.project__links a:hover { text-decoration: underline; }

/* ================= TIMELINE ================= */
.timeline { position: relative; padding-left: 2rem; border-left: 2px solid var(--border); max-width: 780px; }
.timeline__item { position: relative; margin-bottom: 2.5rem; }
.timeline__item:last-child { margin-bottom: 0; }
.timeline__item::before {
  content: ""; position: absolute; left: calc(-2rem - 8px); top: 6px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--accent);
}
.timeline__item--edu::before { border-radius: 3px; }
.timeline__date { color: var(--accent); font-size: 0.85rem; font-weight: 600; }
.timeline__item h3 { font-family: var(--font-head); margin: 0.2rem 0 0.4rem; }
.timeline__item em { color: var(--muted); font-style: normal; font-weight: 500; }
.timeline__item p { color: var(--muted); }

/* ================= CONTACT ================= */
.contact { max-width: 680px; text-align: center; }
.contact__lead { color: var(--muted); margin-bottom: 2rem; }
.form { display: grid; gap: 1rem; text-align: left; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form input, .form textarea {
  width: 100%; padding: 0.9rem 1.1rem;
  background: var(--card); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  font-family: inherit; font-size: 0.95rem; resize: vertical;
  transition: border-color 0.2s;
}
.form input:focus, .form textarea:focus { outline: none; border-color: var(--accent); }
.form .invalid { border-color: #f87171; }
.form__status { min-height: 1.4em; font-size: 0.9rem; }
.form__status.error { color: #f87171; }
.form__status.success { color: var(--accent); }
.form .btn { justify-self: center; }

/* ================= FOOTER & TO-TOP ================= */
.footer { padding: 2rem 0; text-align: center; color: var(--muted); font-size: 0.9rem; border-top: 1px solid var(--border); }
.to-top {
  position: fixed; right: 1.5rem; bottom: 1.5rem;
  width: 46px; height: 46px; border-radius: 50%;
  border: none; background: var(--accent); color: var(--bg);
  font-size: 1.2rem; cursor: pointer; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transform: translateY(10px);
  transition: all 0.3s;
}
.to-top.show { opacity: 1; pointer-events: auto; transform: none; }

/* ================= SCROLL REVEAL ================= */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity 0.8s ease, transform 0.8s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ================= RESPONSIVE ================= */
@media (max-width: 860px) {
  .hero__inner, .about { grid-template-columns: 1fr; }
  .hero__photo { order: -1; }
  .hero { text-align: center; }
  .hero__intro { margin-inline: auto; }
  .hero__cta, .socials { justify-content: center; }

  .nav__burger { display: inline-block; }
  .nav__links {
    position: fixed; top: 0; right: 0;
    height: 100vh; width: min(280px, 75vw);
    flex-direction: column; justify-content: center; align-items: center; gap: 2rem;
    background: var(--bg-alt); border-left: 1px solid var(--border);
    transform: translateX(100%); transition: transform 0.3s ease;
  }
  .nav__links.open { transform: none; }
  .nav__actions { position: relative; z-index: 1; }
}

@media (max-width: 560px) {
  .section { padding: 4.5rem 0; }
  .form__row { grid-template-columns: 1fr; }
  .projects { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
