/* ===== RESET & TOKENS ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #c3d2e6;
  --ink: #131c29;
  --muted: #4c5b6e;
  --line: #9fb1c9;
  --line-soft: #b7c6dc;
  --surface: rgba(255, 255, 255, 0.55);
  --surface-strong: rgba(255, 255, 255, 0.78);
  --accent: #b5502e;
  --accent-2: #2f5d50;
  --maxw: 1120px;
}

html { scroll-behavior: smooth; }

body {
  font-family: "Inter", system-ui, sans-serif;
  background: linear-gradient(165deg, #dbe5f2 0%, #c1d1e7 32%, #a9bfda 62%, #c7d6ea 100%);
  background-attachment: fixed;
  color: var(--ink);
  line-height: 1.6;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ===== SCROLL PROGRESS ===== */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0%;
  background: var(--accent); z-index: 200;
}

/* ===== NAV ===== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 26px clamp(20px, 5vw, 60px);
  transition: background 0.3s, padding 0.3s, border-color 0.3s;
  border-bottom: 1px solid transparent;
}
.nav--scrolled {
  background: rgba(219, 229, 242, 0.88);
  backdrop-filter: blur(8px);
  padding: 16px clamp(20px, 5vw, 60px);
  border-bottom: 1px solid var(--line-soft);
}
.nav__logo { font-family: "Fraunces", serif; font-weight: 600; font-size: 1.4rem; letter-spacing: 0.5px; }
.nav__links { display: flex; align-items: center; gap: 32px; }
.nav__links a { color: var(--muted); font-size: 0.92rem; font-weight: 500; transition: color 0.25s; }
.nav__links a:hover { color: var(--ink); }
.nav__cta { color: var(--accent) !important; font-weight: 600; }
.nav__burger { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; }
.nav__burger span { width: 24px; height: 2px; background: var(--ink); transition: 0.3s; border-radius: 2px; }

/* ===== LINK ARROW ===== */
.link-arrow {
  position: relative; font-weight: 600; font-size: 0.98rem; padding-bottom: 4px;
  border-bottom: 1px solid var(--ink);
}
.link-arrow::after { content: " →"; }
.link-arrow--muted { color: var(--muted); border-bottom-color: var(--line); }
.link-arrow--back::after { content: ""; }
.link-arrow:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ===== HERO ===== */
.hero { max-width: var(--maxw); margin: 0 auto; padding: 150px clamp(20px, 5vw, 60px) 70px; }
.hero__row { display: flex; justify-content: space-between; align-items: baseline; font-size: 0.95rem; color: var(--muted); margin-bottom: 18px; }
.wave { display: inline-block; animation: wave 2.5s infinite; transform-origin: 70% 70%; }
@keyframes wave { 0%,60%,100% { transform: rotate(0); } 10% { transform: rotate(14deg); } 20% { transform: rotate(-8deg); } 30% { transform: rotate(14deg); } 40% { transform: rotate(-4deg); } 50% { transform: rotate(10deg); } }
.hero__loc { font-family: "JetBrains Mono", monospace; font-size: 0.82rem; }

.hero__name { font-family: "Fraunces", serif; font-weight: 600; font-size: clamp(3.6rem, 13vw, 8.4rem); line-height: 0.92; letter-spacing: -2px; }
.hero__name-line { display: block; }
.hero__name-line--accent { color: var(--accent); font-style: italic; }
.hero__dot { color: var(--ink); }

.hero__foot { display: grid; grid-template-columns: 1fr 1.6fr; gap: 40px; margin-top: 46px; padding-top: 28px; border-top: 1px solid var(--line-soft); align-items: start; }
.hero__role { font-family: "JetBrains Mono", monospace; font-size: 1.05rem; color: var(--accent); font-weight: 500; }
.caret { animation: blink 1s steps(1) infinite; color: var(--accent-2); }
@keyframes blink { 50% { opacity: 0; } }
.hero__tag { color: var(--muted); font-size: 1.05rem; max-width: 480px; }
.hero__actions { display: flex; gap: 26px; flex-wrap: wrap; margin-top: 20px; }

.hero__facts { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 46px; padding-top: 22px; border-top: 1px solid var(--line-soft); font-family: "JetBrains Mono", monospace; font-size: 0.82rem; color: var(--muted); }
.hero__facts span:not(:last-child)::after { content: "/"; margin-left: 22px; color: var(--line); }

/* ===== SECTIONS ===== */
.section { max-width: var(--maxw); margin: 0 auto; padding: clamp(60px, 10vw, 100px) clamp(20px, 5vw, 60px); }
.section__head { margin-bottom: 46px; padding-bottom: 20px; border-bottom: 1px solid var(--line-soft); }
.section__title { font-family: "Fraunces", serif; font-size: clamp(1.7rem, 4vw, 2.4rem); font-weight: 600; letter-spacing: -0.5px; }
.section__sub { color: var(--muted); margin-top: 10px; }

/* ===== ABOUT ===== */
.about__lead { font-family: "Fraunces", serif; font-style: italic; font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 500; color: var(--accent); max-width: 800px; line-height: 1.35; margin-bottom: 44px; }
.about__cols { display: grid; grid-template-columns: 1.5fr 1fr; gap: 50px; }
.about__body p { color: var(--muted); margin-bottom: 16px; }
.about__body strong { color: var(--ink); }
.about__facts { display: flex; flex-direction: column; }
.about__facts li { padding: 16px 0; border-top: 1px solid var(--line-soft); font-size: 0.95rem; }
.about__facts li:last-child { border-bottom: 1px solid var(--line-soft); }

/* ===== PROJECTS ===== */
.projects { display: grid; gap: 18px; }
.proj {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: 16px;
  padding: 28px 30px; transition: background 0.25s, border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}
.proj:hover {
  background: var(--surface-strong); border-color: var(--accent);
  transform: translateY(-3px); box-shadow: 0 16px 34px -20px rgba(19, 28, 41, 0.35);
}
.proj__main { max-width: 720px; }
.proj__title { font-family: "Fraunces", serif; font-size: 1.35rem; font-weight: 600; margin-bottom: 10px; display: flex; align-items: center; gap: 10px; }
.proj__emoji { font-size: 1.1rem; }
.proj__desc { color: var(--muted); font-size: 0.96rem; margin-bottom: 16px; }
.proj__tags { display: flex; flex-wrap: wrap; gap: 8px; }
.proj__tag { font-family: "JetBrains Mono", monospace; font-size: 0.72rem; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line-soft); color: var(--muted); background: rgba(255,255,255,0.4); }
.proj__go { font-weight: 600; font-size: 0.88rem; color: var(--ink); white-space: nowrap; transition: color 0.25s; }
.proj:hover .proj__go { color: var(--accent); }

/* ===== PROJECT DETAIL PAGE ===== */
.proj-detail-section { max-width: 780px; }
.proj-detail__back { display: inline-block; margin-bottom: 40px; }
.proj-detail__emoji { font-size: 2.4rem; display: block; margin-bottom: 14px; }
.proj-detail__title { font-family: "Fraunces", serif; font-size: clamp(1.9rem, 5vw, 2.8rem); font-weight: 600; letter-spacing: -0.5px; margin-bottom: 18px; }
.proj-detail__tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.proj-detail__desc { color: var(--muted); font-size: 1.05rem; max-width: 640px; margin-bottom: 30px; }
.proj-detail__gallery { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 30px; }
.proj-detail__thumb { width: 160px; height: 160px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line-soft); cursor: zoom-in; transition: border-color 0.25s; }
.proj-detail__thumb:hover { border-color: var(--accent); }
.proj-detail__missing { font-size: 1.1rem; margin-bottom: 20px; }

/* ===== LIGHTBOX ===== */
.lightbox { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; padding: 30px; background: rgba(20, 19, 16, 0.85); backdrop-filter: blur(4px); opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.lightbox.open { opacity: 1; pointer-events: auto; }
.lightbox__img { max-width: 90vw; max-height: 88vh; border-radius: 10px; box-shadow: 0 30px 80px -20px rgba(0,0,0,0.5); }
.lightbox__close { position: absolute; top: 22px; right: 30px; font-size: 2.2rem; line-height: 1; color: #fff; cursor: pointer; opacity: 0.85; transition: opacity 0.2s; }
.lightbox__close:hover { opacity: 1; }

/* ===== SKILLS ===== */
.skills { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 40px; }
.tag {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px; border: 1px solid var(--line-soft); border-radius: 999px;
  font-size: 0.92rem; font-weight: 500; transition: border-color 0.25s, color 0.25s;
}
.tag:hover { border-color: var(--accent); color: var(--accent); }

.skill-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.skill-cat {
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: 16px;
  padding: 26px 28px; transition: background 0.25s, border-color 0.25s;
}
.skill-cat:hover { background: var(--surface-strong); border-color: var(--accent); }
.skill-cat__title { font-family: "Fraunces", serif; font-size: 1.1rem; font-weight: 600; margin-bottom: 10px; }
.skill-cat__desc { color: var(--muted); font-size: 0.92rem; line-height: 1.65; }

/* ===== EDUCATION ===== */
.timeline { border-top: 1px solid var(--line-soft); }
.edu { display: grid; grid-template-columns: 220px 1fr; gap: 30px; padding: 30px 0; border-bottom: 1px solid var(--line-soft); }
.edu__date { font-family: "JetBrains Mono", monospace; font-size: 0.85rem; color: var(--accent); }
.edu__title { font-family: "Fraunces", serif; font-size: 1.2rem; font-weight: 600; }
.edu__org { color: var(--muted); font-size: 0.95rem; margin: 4px 0 10px; }
.edu__desc { color: var(--muted); font-size: 0.93rem; max-width: 620px; }

/* ===== CONTACT ===== */
.section--contact { text-align: center; }
.contact { max-width: 680px; margin: 0 auto; }
.contact__title { font-family: "Fraunces", serif; font-size: clamp(2rem, 6vw, 3.2rem); font-weight: 600; line-height: 1.15; margin-bottom: 20px; letter-spacing: -0.5px; }
.contact__sub { color: var(--muted); font-size: 1.05rem; margin-bottom: 40px; }
.contact__email { font-family: "Fraunces", serif; font-size: clamp(1.3rem, 4vw, 1.9rem); font-weight: 500; border-bottom: 1px solid var(--ink); padding-bottom: 6px; transition: color 0.25s, border-color 0.25s; }
.contact__email:hover { color: var(--accent); border-color: var(--accent); }
.contact__row { display: flex; gap: 24px; justify-content: center; margin-top: 34px; flex-wrap: wrap; }
.contact__row a { color: var(--muted); font-size: 0.92rem; font-weight: 500; transition: color 0.25s; }
.contact__row a:hover { color: var(--ink); }

/* ===== FOOTER ===== */
.footer { text-align: center; padding: 40px 20px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 0.86rem; }
.footer__note { font-family: "JetBrains Mono", monospace; margin-top: 6px; font-size: 0.76rem; }

/* ===== REVEAL ANIMATION ===== */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.6s cubic-bezier(0.16,1,0.3,1), transform 0.6s cubic-bezier(0.16,1,0.3,1); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ===== RESPONSIVE ===== */
@media (max-width: 820px) {
  .hero__foot { grid-template-columns: 1fr; gap: 18px; }
  .about__cols { grid-template-columns: 1fr; gap: 30px; }
  .proj { flex-direction: column; align-items: flex-start; }
  .edu { grid-template-columns: 1fr; gap: 8px; }
  .nav__links {
    position: fixed; inset: 0 0 0 auto; width: 78%; max-width: 320px; flex-direction: column;
    justify-content: center; align-items: flex-start; gap: 30px; padding: 0 40px;
    background: var(--bg); transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.16,1,0.3,1); border-left: 1px solid var(--line-soft);
  }
  .nav__links.open { transform: translateX(0); }
  .nav__links a { font-size: 1.15rem; }
  .nav__burger { display: flex; z-index: 101; }
  .nav__burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav__burger.open span:nth-child(2) { opacity: 0; }
  .nav__burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}
