:root {
  --bg: #2b2c28;
  --surface: #3C3D37;
  --surface-2: #46473f;
  --text: #ecebe6;
  --muted: #b5b4ab;
  --accent: #86C232;
  --accent-dark: #6aa122;
  --radius: 16px;
  --max: 1080px;
  --mono: "JetBrains Mono", monospace;
  --sans: "Lato", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 5rem; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.7;
  font-size: 1.05rem;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--accent); color: #111; padding: .6rem 1rem; z-index: 200;
}
.skip-link:focus { left: 0; }

/* ---------- Header / nav ---------- */
.site-header {
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%);
}

.nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  max-width: var(--max); margin: 0 auto; padding: .8rem 1.5rem;
  font-family: var(--mono);
  background: rgba(60, 61, 55, .85);
  backdrop-filter: blur(8px);
  border-radius: 0 0 var(--radius) var(--radius);
}

.brand { display: flex; align-items: center; gap: .6rem; font-weight: 600; }
.brand img { width: 40px; height: 40px; }

.nav-links { display: flex; gap: 2rem; }
.nav-links a { padding: .3rem 0; border-bottom: 2px solid transparent; transition: color .2s, border-color .2s; }
.nav-links a:hover, .nav-links a.active { color: var(--accent); border-color: var(--accent); }

.menu-btn {
  display: none; background: none; border: 0; cursor: pointer; padding: .5rem;
  flex-direction: column; gap: 5px;
}
.menu-btn span { display: block; width: 26px; height: 3px; background: var(--text); border-radius: 2px; transition: transform .25s, opacity .25s; }
.menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero { text-align: center; padding: 6rem 1.5rem 7rem; max-width: 780px; margin: 0 auto; }
.eyebrow { font-family: var(--mono); color: var(--accent); margin: 0 0 1rem; font-size: .95rem; }
.hero h1 { font-family: "Gamja Flower", cursive; font-size: clamp(3rem, 9vw, 5.5rem); line-height: 1.05; margin: 0 0 1rem; font-weight: 400; }
.accent { color: var(--accent); }
.lead { font-size: 1.25rem; color: var(--muted); margin: 0 auto 2rem; max-width: 36rem; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; padding: .75rem 1.8rem; border-radius: 999px;
  font-weight: 700; border: 2px solid var(--accent);
  transition: transform .2s, background .2s, color .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--accent); color: #17180f; box-shadow: 0 4px 14px rgba(134, 194, 50, .25); }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-ghost { background: transparent; color: var(--accent); }
.btn-ghost:hover { background: rgba(134, 194, 50, .12); }
.btn-sm { padding: .55rem 1.3rem; font-size: .95rem; }
.btn.disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn.disabled:hover { transform: none; background: var(--accent); }

.socials { display: flex; gap: 1rem; justify-content: center; margin-top: 2.2rem; }
.socials a { display: inline-flex; }
.socials img { width: 2rem; height: 2rem; }
@keyframes shake {
  0% { transform: rotate(0); }
  25% { transform: rotate(-20deg); }
  50% { transform: rotate(10deg); }
  75% { transform: rotate(-20deg); }
  100% { transform: rotate(0); }
}
.socials a:hover img { animation: shake 0.8s ease infinite; }

/* ---------- Sections ---------- */
.section { max-width: var(--max); margin: 0 auto; padding: 5rem 1.5rem; }
.section-title {
  font-family: var(--mono); font-size: clamp(1.6rem, 4vw, 2.2rem); margin: 0 0 3rem; text-align: center;
}
.section-title::after {
  content: ""; display: block; width: 70px; height: 4px; background: var(--accent);
  border-radius: 2px; margin: .8rem auto 0;
}

/* About */
.about-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 3rem; align-items: start; }
.about-text p { margin: 0 0 1.1rem; }
.facts { display: grid; gap: 1rem; }
.facts li {
  background: var(--surface); border-left: 4px solid var(--accent);
  padding: 1rem 1.2rem; border-radius: 0 var(--radius) var(--radius) 0;
}
.fact-label { display: block; font-family: var(--mono); font-size: .8rem; color: var(--accent); text-transform: uppercase; letter-spacing: .06em; }

/* Projects */
.projects { display: grid; gap: 2.5rem; }
.project {
  display: grid; grid-template-columns: 1fr 1.1fr; gap: 0;
  background: var(--surface); border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
  transition: transform .25s, box-shadow .25s;
}
.project:hover { transform: translateY(-4px); box-shadow: 0 16px 40px rgba(0, 0, 0, .35); }
.project:nth-child(even) .project-img { order: 2; }
.project-img { width: 100%; height: 100%; min-height: 260px; object-fit: cover; object-position: top; background: #fff; }
.project-img.contain { object-fit: contain; padding: 1.2rem; background: var(--surface-2); }
.project-body { padding: 2rem; display: flex; flex-direction: column; align-items: flex-start; gap: 1rem; }
.project-body h3 { margin: 0; font-size: 1.5rem; color: var(--accent); }
.project-body p { margin: 0; color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: .5rem; }
.tags li { font-family: var(--mono); font-size: .78rem; padding: .25rem .7rem; border-radius: 999px; background: rgba(134, 194, 50, .14); color: var(--accent); }
.project-body .btn { margin-top: auto; }

/* Skills */
.skills { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 1.2rem; }
.skills li {
  display: flex; flex-direction: column; align-items: center; gap: .8rem;
  background: var(--surface); padding: 1.5rem 1rem; border-radius: var(--radius);
  font-weight: 700; transition: transform .2s, box-shadow .2s;
}
.skills li:hover { transform: translateY(-5px); box-shadow: 0 0 18px rgba(134, 194, 50, .45); }
.skills img { width: 64px; height: 64px; object-fit: contain; }

/* Footer */
.footer { background: var(--surface); text-align: center; padding: 5rem 1.5rem 3rem; font-family: var(--mono); margin-top: 3rem; }
.footer h2 { margin: 0 0 .5rem; }
.footer p { margin: 0 0 1rem; color: var(--muted); }
.email { display: inline-block; color: var(--accent); font-size: clamp(1.1rem, 4vw, 1.6rem); font-weight: 600; word-break: break-all; border-bottom: 2px dotted var(--accent); }
.email:hover { color: #fff; }
.small { font-size: .85rem; }
.copy { margin-top: 2.5rem; opacity: .7; }

/* Back to top */
.to-top {
  position: fixed; right: 1.2rem; bottom: 1.2rem; width: 46px; height: 46px; border-radius: 50%;
  border: 0; background: var(--accent); color: #17180f; font-size: 1.3rem; font-weight: 700; cursor: pointer;
  opacity: 0; pointer-events: none; transform: translateY(10px); transition: opacity .25s, transform .25s;
}
.to-top.show { opacity: 1; pointer-events: auto; transform: none; }

/* Scroll reveal */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .menu-btn { display: flex; }
  .nav { flex-wrap: wrap; }
  .nav-links {
    display: none; flex-direction: column; gap: 0; width: 100%; padding-top: .8rem; text-align: center;
  }
  .nav-links.open { display: flex; }
  .nav-links a { display: block; padding: .9rem 0; border-bottom: 1px solid rgba(255, 255, 255, .08); }
  .about-grid { grid-template-columns: 1fr; }
  .project { grid-template-columns: 1fr; }
  .project:nth-child(even) .project-img { order: 0; }
  .project-img { min-height: 0; max-height: 300px; }
  .hero { padding: 4rem 1.5rem 5rem; }
  .section { padding: 3.5rem 1.2rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* Freelance pill */
.pill { display: inline-flex; align-items: center; gap: .5rem; margin: 0 0 1.2rem; padding: .35rem 1rem; border-radius: 999px; background: rgba(134, 194, 50, .14); color: var(--accent); font-family: var(--mono); font-size: .85rem; }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

/* Project without screenshot */
.project.no-img { grid-template-columns: 1fr; border: 2px solid var(--accent); }
.badge { font-family: var(--mono); font-size: .78rem; color: #17180f; background: var(--accent); padding: .25rem .8rem; border-radius: 999px; font-weight: 600; }

/* Skill groups */
.skill-group { font-family: var(--mono); color: var(--accent); font-size: 1.05rem; margin: 2.2rem 0 1rem; }
.skills { margin-bottom: .5rem; }
.mono-tile { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 14px; background: rgba(134, 194, 50, .14); color: var(--accent); font-family: var(--mono); font-weight: 600; font-size: 1.4rem; }
.skill-svg { width: 64px; height: 64px; }

/* Skill chips */
.chips { display: flex; flex-wrap: wrap; gap: .7rem; }
.chips li { padding: .5rem 1.1rem; border-radius: 999px; background: var(--surface); border: 1px solid rgba(134, 194, 50, .45); font-weight: 700; font-size: .95rem; }
.chips .soon { border-style: dashed; color: var(--muted); }
