@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Geist:wght@300;400;500&display=swap');

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

:root {
  --bg: #f5f4f0;
  --bg2: #eceae3;
  --border: #dedad1;
  --text: #151410;
  --muted: #837f75;
  --green: #2a5c42;
  --green-bg: #e6f0eb;
  --card: #faf9f6;
  --max: 1200px;
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Geist', sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ─── CURTAIN REVEAL ─── */
.curtain {
  position: fixed; inset: 0; z-index: 10000;
  background: var(--text);
  transform: translateY(0);
  transition: transform 0.8s cubic-bezier(0.76, 0, 0.24, 1);
}
.curtain.lifted {
  transform: translateY(-100%);
}

/* ─── SCROLL PROGRESS BAR ─── */
.progress-bar {
  position: fixed; top: 0; left: 0; z-index: 200;
  width: 0%; height: 2px;
  background: var(--text);
  transition: width 0.05s linear;
}

/* ─── CURSOR ─── */
* { cursor: none !important; }
.cur { position: fixed; top: 0; left: 0; width: 8px; height: 8px; background: var(--text); border-radius: 50%; pointer-events: none; z-index: 9999; will-change: transform; }
.cur-ring { position: fixed; top: 0; left: 0; width: 32px; height: 32px; border: 1px solid var(--text); border-radius: 50%; pointer-events: none; z-index: 9998; opacity: 0.3; will-change: transform; transition: width 0.3s, height 0.3s, opacity 0.3s; }
.cur-ring.big { width: 50px; height: 50px; opacity: 0.15; }
@media (max-width: 768px) { * { cursor: auto !important; } .cur, .cur-ring { display: none; } }

/* ─── NAV ─── */
nav {
  position: fixed; top: 2px; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.75rem 4rem;
  background: rgba(245,244,240,0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: padding 0.3s ease;
}
.nav-logo { font-family: 'Instrument Serif', serif; font-size: 1.1rem; font-style: italic; color: var(--text); text-decoration: none; }
.nav-links { display: flex; gap: 2.5rem; list-style: none; align-items: center; }
.nav-links a {
  position: relative;
  font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); text-decoration: none;
  transition: color 0.3s ease;
}
.nav-links a::after {
  content: '';
  position: absolute; bottom: -4px; left: 0; width: 100%; height: 1px;
  background: var(--text);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--text); }
.nav-links a.active::after {
  transform: scaleX(1);
  transform-origin: left;
}
.nav-links a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}
.nav-hire { background: var(--text) !important; color: var(--bg) !important; padding: 0.55rem 1.25rem; border-radius: 4px; text-transform: none !important; letter-spacing: 0 !important; transition: opacity 0.3s ease, transform 0.2s ease !important; }
.nav-hire:hover { opacity: 0.9; transform: translateY(-1px); }
.nav-hire::after { display: none !important; }

/* ─── HAMBURGER ─── */
.hamburger {
  display: none;
  flex-direction: column; gap: 5px;
  background: none; border: none; padding: 6px;
  z-index: 110;
}
.hamburger span {
  display: block; width: 24px; height: 2px;
  background: var(--text);
  transition: all 0.3s ease;
}

/* ─── MOBILE MENU ─── */
.mobile-menu {
  position: fixed; inset: 0; z-index: 150;
  background: var(--text);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.4s ease;
}
.mobile-menu.open {
  opacity: 1; pointer-events: all;
}
.mobile-close {
  position: absolute; top: 2rem; right: 2rem;
  background: none; border: none;
  color: var(--bg); font-size: 2.5rem;
  font-family: 'Geist', sans-serif; font-weight: 300;
  line-height: 1;
  transition: transform 0.3s ease;
}
.mobile-close:hover { transform: rotate(90deg); }
.mobile-nav {
  list-style: none; text-align: center;
  display: flex; flex-direction: column; gap: 2.5rem;
}
.mobile-nav a {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-style: italic;
  color: var(--bg);
  text-decoration: none;
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease, color 0.2s ease;
}
.mobile-menu.open .mobile-nav a {
  opacity: 1; transform: translateY(0);
}
.mobile-nav li:nth-child(1) a { transition-delay: 0.1s; }
.mobile-nav li:nth-child(2) a { transition-delay: 0.15s; }
.mobile-nav li:nth-child(3) a { transition-delay: 0.2s; }
.mobile-nav li:nth-child(4) a { transition-delay: 0.25s; }
.mobile-nav li:nth-child(5) a { transition-delay: 0.3s; }
.mobile-nav a:hover { color: var(--muted); }

/* ─── SECTIONS ─── */
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 4rem; }

/* ─── HERO ─── */
#hero {
  min-height: 100vh;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding-top: 8rem;
  padding-bottom: 5rem;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.hero-inner { max-width: var(--max); margin: 0 auto; padding: 0 4rem; width: 100%; position: relative; z-index: 1; }
.badge {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: var(--green-bg); color: var(--green);
  font-size: 0.72rem; font-weight: 500; letter-spacing: 0.04em;
  padding: 0.28rem 0.75rem; border-radius: 99px; margin-bottom: 2.5rem;
}
.badge-dot { width: 6px; height: 6px; background: var(--green); border-radius: 50%; animation: blink 2s infinite; }
@keyframes blink { 0%,100%{opacity:1;} 50%{opacity:0.3;} }
.hero-label { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 1.5rem; }
.hero-h1 {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(4rem, 9vw, 8.5rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 3rem;
  font-weight: 400;
}
.hero-h1 em { font-style: italic; color: var(--muted); }
.hero-bottom { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.hero-bio { font-size: 1rem; color: var(--muted); max-width: 420px; line-height: 1.75; font-weight: 300; }
.hero-actions { display: flex; gap: 0.75rem; flex-shrink: 0; }
.btn { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.8rem 1.6rem; border-radius: 5px; font-size: 0.875rem; font-weight: 400; text-decoration: none; transition: all 0.2s; }
.btn-dark { background: var(--text); color: var(--bg); }
.btn-dark:hover { opacity: 0.8; transform: translateY(-1px); }
.btn-outline { border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg2); transform: translateY(-1px); }

/* HERO BIG BG */
.hero-bg {
  position: absolute; top: 50%; right: -3rem; transform: translateY(-52%);
  font-family: 'Instrument Serif', serif;
  font-size: clamp(18rem, 35vw, 32rem);
  font-style: italic; font-weight: 400;
  color: transparent;
  -webkit-text-stroke: 1px var(--border);
  pointer-events: none; user-select: none;
  line-height: 1; letter-spacing: -0.05em;
  z-index: 0;
}

/* ─── MARQUEE ─── */
.marquee {
  background: var(--text);
  overflow: hidden;
  white-space: nowrap;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.marquee-track {
  display: inline-flex;
  animation: marqueeScroll 30s linear infinite;
}
.marquee:hover .marquee-track {
  animation-play-state: paused;
}
.marquee-content {
  font-family: 'Geist', sans-serif;
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(245,244,240,0.5);
  padding-right: 0;
}
@keyframes marqueeScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ─── STATS BAR ─── */
.stats-bar {
  display: flex;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.stat {
  flex: 1; padding: 2rem 4rem;
  border-right: 1px solid var(--border);
}
.stat:last-child { border-right: none; }
.stat-n {
  font-family: 'Instrument Serif', serif;
  font-size: 3rem; line-height: 1;
  letter-spacing: -0.04em; color: var(--text);
  margin-bottom: 0.4rem;
}
.stat-l { font-size: 0.78rem; color: var(--muted); letter-spacing: 0.04em; }

/* ─── SECTION LABEL ─── */
.s-label {
  font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 3.5rem;
  display: flex; align-items: center; gap: 1rem;
}
.s-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ─── ABOUT ─── */
#about { padding: 7rem 0; border-bottom: 1px solid var(--border); }
.about-layout { display: grid; grid-template-columns: 1.2fr 1fr; gap: 6rem; align-items: start; }
.about-h2 {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(2rem, 3.5vw, 3rem);
  font-weight: 400; letter-spacing: -0.025em; line-height: 1.15;
  margin-bottom: 1.5rem;
}
.about-h2 em { font-style: italic; color: var(--muted); }
.about-p { font-size: 0.9375rem; color: var(--muted); line-height: 1.85; font-weight: 300; }
.about-cards { display: flex; flex-direction: column; gap: 0.75rem; }
.about-card {
  padding: 1rem 1.25rem; background: var(--card);
  border: 1px solid var(--border); border-radius: 8px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.about-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.04);
}
.about-card-l { font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.2rem; }
.about-card-v { font-size: 0.875rem; color: var(--text); }

/* ─── SKILLS ─── */
#skills { padding: 7rem 0; border-bottom: 1px solid var(--border); }
.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
}
.skill-g {
  background: var(--card);
  padding: 2.25rem 2rem;
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.01);
}
.skill-g:hover {
  background: var(--bg2);
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.04);
}
.skill-g-t { font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text); font-weight: 500; margin-bottom: 1rem; }
.tags { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.t {
  background: var(--bg2);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 450;
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}
.skill-g:hover .t {
  background: var(--bg);
}

/* Shimmer animation for skill tags */
.t::before {
  content: '';
  position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
  transition: none;
}
.t.shimmer::before {
  animation: shimmerSweep 0.6s ease forwards;
}
@keyframes shimmerSweep {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* ─── TECH TRUST BAR ─── */
#techbar { padding: 5rem 0; border-bottom: 1px solid var(--border); }
.trust-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 3.5rem;
  flex-wrap: wrap;
}
.trust-icon {
  display: flex; flex-direction: column; align-items: center; gap: 0.6rem;
  color: var(--text);
  opacity: 0.65;
  transition: opacity 0.3s ease, transform 0.2s ease;
}
.trust-icon:hover {
  opacity: 1;
  transform: translateY(-3px);
}
.trust-icon svg {
  width: 28px; height: 28px;
}
.trust-icon span {
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ─── PROJECTS ─── */
#projects { padding: 7rem 0; border-bottom: 1px solid var(--border); }
.proj-list { display: flex; flex-direction: column; gap: 1.5rem; }
.proj {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2.25rem 2.5rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem;
  align-items: start;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}
.proj::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 2px; background: var(--text);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.proj:hover {
  border-color: var(--text);
  background: var(--bg2);
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.05);
}
.proj:hover::after { transform: scaleX(1); }
.proj-num { font-family: 'Instrument Serif', serif; font-size: 0.85rem; font-style: italic; color: var(--muted); margin-bottom: 0.4rem; }
.proj-name { font-family: 'Instrument Serif', serif; font-size: 1.5rem; letter-spacing: -0.02em; font-weight: 400; margin-bottom: 0.6rem; }
.proj-desc { font-size: 0.875rem; color: var(--muted); line-height: 1.7; font-weight: 300; max-width: 520px; margin-bottom: 1rem; }
.proj-tags-wrap { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.proj-right { display: flex; flex-direction: column; align-items: flex-end; gap: 0.75rem; flex-shrink: 0; }
.proj-link {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.78rem; color: var(--bg); background: var(--text);
  text-decoration: none; border: 1px solid var(--text);
  padding: 0.55rem 1.2rem; border-radius: 5px; white-space: nowrap;
  transition: all 0.3s ease; flex-shrink: 0;
}
.proj-link:hover { opacity: 0.9; transform: translateY(-1px); }
.proj-link .arrow {
  display: inline-block;
  transition: transform 0.3s ease;
}
.proj-link:hover .arrow {
  transform: translate(2px, -2px);
}

/* Project image preview — flows inside proj-right, below Live button */
.proj-preview {
  width: 220px; height: 0;
  border-radius: 8px;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.4s ease, height 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  background: var(--bg2);
  box-shadow: 0 8px 30px rgba(0,0,0,0.1);
  border: 1px solid var(--border);
}
.proj:hover .proj-preview {
  opacity: 1;
  height: 140px;
}
.proj-preview img {
  width: 100%; height: 100%;
  object-fit: cover;
}

/* ─── PROCESS ─── */
#process { padding: 7rem 0; border-bottom: 1px solid var(--border); }
.proc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.proc-item { background: var(--card); padding: 2rem 1.75rem; transition: background 0.2s; }
.proc-item:hover { background: var(--bg2); }
.proc-n { font-family: 'Instrument Serif', serif; font-size: 2rem; font-style: italic; color: var(--muted); margin-bottom: 1rem; line-height: 1; opacity: 0.6; transition: color 0.3s ease, opacity 0.3s ease; }
.proc-item:hover .proc-n { color: var(--text); opacity: 0.9; }
.proc-t { font-size: 0.9rem; font-weight: 500; margin-bottom: 0.5rem; letter-spacing: -0.01em; }
.proc-d { font-size: 0.825rem; color: var(--muted); line-height: 1.7; font-weight: 300; }

/* ─── CONTACT ─── */
#contact { padding: 7rem 0; }
.contact-box {
  background: var(--text); border-radius: 16px;
  padding: 5rem; position: relative; overflow: hidden;
}
.contact-box::before {
  content: 'hello';
  position: absolute; bottom: -3rem; right: 2rem;
  font-family: 'Instrument Serif', serif;
  font-size: 14rem; font-style: italic; font-weight: 400;
  color: rgba(255,255,255,0.05);
  pointer-events: none; line-height: 1; letter-spacing: -0.04em;
}
.contact-box h2 {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(2.5rem, 5vw, 4rem);
  letter-spacing: -0.03em; color: #f5f4f0;
  font-weight: 400; line-height: 1.05; margin-bottom: 1rem;
}
.contact-box h2 em { font-style: italic; opacity: 0.45; }
.contact-box p { font-size: 0.9375rem; opacity: 0.45; margin-bottom: 2.5rem; max-width: 380px; font-weight: 300; line-height: 1.75; color: #f5f4f0; }
.c-links { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; }
.c-link {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: rgba(255,255,255,0.07); color: #f5f4f0;
  text-decoration: none; padding: 0.75rem 1.4rem;
  border-radius: 6px; font-size: 0.875rem; font-weight: 300;
  border: 1px solid rgba(255,255,255,0.1);
  transition: background 0.2s, transform 0.15s;
  font-family: 'Geist', sans-serif;
}
.c-link:hover { background: rgba(255,255,255,0.14); transform: translateY(-2px); }

/* Copy button */
.copy-btn {
  cursor: none !important;
  font-size: 0.875rem;
}
.copy-icon {
  display: inline-block;
  transition: transform 0.3s ease;
}
.copy-btn:hover .copy-icon {
  transform: scale(1.2);
}
.copy-btn.copied {
  background: rgba(42, 92, 66, 0.3);
  border-color: rgba(42, 92, 66, 0.4);
}

/* ─── TOAST ─── */
.toast {
  position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--text); color: var(--bg);
  padding: 0.85rem 1.8rem; border-radius: 8px;
  font-size: 0.85rem; font-weight: 400;
  letter-spacing: 0.02em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
  z-index: 9000;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ─── FOOTER ─── */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  display: flex; justify-content: space-between; align-items: center;
}
.f-logo { font-family: 'Instrument Serif', serif; font-style: italic; color: var(--muted); text-decoration: none; font-size: 0.95rem; }
.f-right { font-size: 0.775rem; color: var(--muted); }

/* ─── BACK TO TOP ─── */
.back-to-top {
  position: fixed; bottom: 2rem; right: 2rem;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--text); color: var(--bg);
  border: none;
  font-size: 1.1rem; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.35s ease, transform 0.3s ease, background 0.2s ease;
  z-index: 90;
  cursor: none !important;
}
.back-to-top.visible {
  opacity: 1; pointer-events: all;
}
.back-to-top:hover {
  background: #2a2824;
  transform: rotate(-15deg) scale(1.08);
}

/* ─── REVEAL ─── */
.rev { opacity: 0; transform: translateY(20px); transition: opacity 0.65s cubic-bezier(.22,.61,.36,1), transform 0.65s cubic-bezier(.22,.61,.36,1); }
.rev.in { opacity: 1; transform: none; }
.d1 { transition-delay: 0.1s; } .d2 { transition-delay: 0.18s; } .d3 { transition-delay: 0.26s; } .d4 { transition-delay: 0.34s; }

/* ─── RESPONSIVE ─── */
@media (max-width: 1024px) {
  .skills-grid { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
  .proc-grid { grid-template-columns: repeat(2, 1fr); }
  .proj { grid-template-columns: 1fr auto; }
  .proj-desc { display: none; }
  .proj-preview { width: 200px; height: 120px; }
}
@media (max-width: 768px) {
  nav { padding: 1.25rem 1.5rem; }
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .wrap, .hero-inner { padding: 0 1.5rem; }
  .hero-h1 { font-size: clamp(3rem, 12vw, 5rem); }
  .about-layout { grid-template-columns: 1fr; gap: 2.5rem; }
  .skills-grid { grid-template-columns: 1fr; gap: 1.25rem; }
  .proc-grid { grid-template-columns: 1fr 1fr; }
  .stat { padding: 1.5rem 2rem; }
  .proj { grid-template-columns: 1fr auto; }
  .proj-num { display: none; }
  .proj-preview { display: none; }
  .contact-box { padding: 2.5rem 2rem; }
  .marquee { padding: 0.75rem 0; }
  footer { flex-direction: column; gap: 0.5rem; text-align: center; }
  .trust-row { gap: 2rem; }
  .trust-icon svg { width: 22px; height: 22px; }
  .stats-bar { flex-wrap: wrap; }
  .stat { flex: 1 1 50%; }
  .marquee-content { font-size: 0.75rem; }
}
@media (max-width: 480px) {
  .stats-bar { flex-direction: column; }
  .stat { border-right: none; border-bottom: 1px solid var(--border); }
  .stat:last-child { border-bottom: none; }
  .proc-grid { grid-template-columns: 1fr; }
}