@import url('https://fonts.googleapis.com/css2?family=Archivo:ital,wght@0,400;0,500;0,600;0,700;0,800;0,900;1,400&family=Fraunces:ital,wght@0,400;0,500;1,400;1,500&display=swap');

:root {
  --color-bg: #f5f5f5;
  --color-bg-dark: #0c0c0c;
  --color-surface: #ffffff;
  --color-fg: #161616;
  --color-fg-inverse: #f5f5f5;
  --color-muted: #6b6b6b;
  --color-muted-2: #9a9a9a;
  --color-border: rgba(22, 22, 22, 0.1);
  --color-border-strong: rgba(22, 22, 22, 0.2);
  --color-accent: #4f46e5;
  --color-accent-light: #6d5cf0;
  --color-accent-dark: #382fc4;
  --font-display: 'Archivo', system-ui, sans-serif;
  --font-body: 'Archivo', system-ui, sans-serif;
  --font-serif: 'Fraunces', serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-fg);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; }
p { margin: 0; }
::selection { background: rgba(79, 70, 229, 0.2); color: var(--color-fg); }
.icon { width: 1em; height: 1em; }

.container { max-width: 1360px; margin: 0 auto; padding: 0 32px; }
section { padding: 130px 0; position: relative; }
@media (max-width: 768px) { section { padding: 80px 0; } .container { padding: 0 20px; } }

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 4px;
}

/* Grain overlay */
.grain {
  position: fixed; inset: 0; z-index: 5; pointer-events: none;
  opacity: 0.03; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Loader */
#loader {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--color-bg-dark); transition: clip-path 0.9s cubic-bezier(0.65, 0, 0.35, 1);
}
#loader.done { clip-path: inset(0 0 100% 0); pointer-events: none; }
.loader-name { font-family: var(--font-display); font-size: 13px; text-transform: uppercase; letter-spacing: 0.4em; color: rgba(255, 255, 255, 0.5); margin-bottom: 32px; }
.loader-track { position: relative; height: 1px; width: 220px; background: rgba(255, 255, 255, 0.15); overflow: hidden; margin-bottom: 32px; }
.loader-bar { position: absolute; inset: 0 auto 0 0; width: 0%; background: #fff; }
.loader-pct { font-family: var(--font-display); font-size: 48px; color: #fff; font-variant-numeric: tabular-nums; }

/* Custom cursor */
#cursor {
  position: fixed; top: 0; left: 0; width: 32px; height: 32px; border-radius: 50%;
  background: var(--color-fg); color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700; z-index: 90; pointer-events: none; transform: translate(-50%, -50%);
  transition: transform 0.15s ease, opacity 0.2s ease; opacity: 0;
}
#cursor.active { opacity: 1; }
#cursor.hover { transform: translate(-50%, -50%) scale(1.5); }
#cursor.hide-in-hero { opacity: 0; }
@media (pointer: coarse) { #cursor { display: none; } }

/* Navbar */
#navbar {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 80;
  display: flex; align-items: center; justify-content: space-between; gap: 32px;
  width: calc(100% - 48px); max-width: 1200px;
  padding: 14px 24px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--color-border);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
  color: var(--color-fg);
}
.nav-brand { position: relative; display: inline-block; font-family: var(--font-display); font-weight: 800; font-size: 16px; padding-bottom: 6px; letter-spacing: -0.01em; }
.nav-brand-text { position: relative; z-index: 1; }
.nav-brand-underline { position: absolute; left: -2px; right: -2px; bottom: -3px; width: calc(100% + 4px); height: 10px; overflow: visible; pointer-events: none; }
.nav-brand-underline path {
  fill: none;
  stroke: var(--color-accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke-dashoffset 0.65s cubic-bezier(0.65, 0, 0.35, 1);
}
.nav-brand:hover .nav-brand-underline path { stroke-dashoffset: 0 !important; }
.nav-links { display: flex; gap: 26px; list-style: none; margin: 0; padding: 0; }
.nav-links a { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--color-muted); font-weight: 600; }
.nav-links a:hover { color: var(--color-fg); }
.nav-meta { display: flex; align-items: center; gap: 14px; font-size: 12px; color: var(--color-muted); }
@media (max-width: 900px) { .nav-links, .nav-meta { display: none; } }

/* Reveal animation */
.reveal { opacity: 0; transform: translateY(28px); filter: blur(6px); transition: opacity 0.7s cubic-bezier(0.16,1,0.3,1), transform 0.7s cubic-bezier(0.16,1,0.3,1), filter 0.7s cubic-bezier(0.16,1,0.3,1); }
.reveal.in { opacity: 1; transform: none; filter: none; }

/* Section heading */
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-display); font-size: 12px; text-transform: uppercase; letter-spacing: 0.25em; color: var(--color-muted); margin-bottom: 18px; font-weight: 700; }
.eyebrow::before { content: ''; width: 20px; height: 1px; background: var(--color-fg); }
.section-title { font-size: clamp(28px, 4vw, 44px); font-weight: 700; line-height: 1.1; margin-bottom: 14px; letter-spacing: -0.02em; }
.section-desc { color: var(--color-muted); max-width: 480px; font-size: 15px; line-height: 1.6; }
.section-heading.center { text-align: center; }
.section-heading.center .eyebrow::before { display: none; }
.section-heading.center .section-desc { margin: 0 auto; }

/* ===== Hero (cursor spotlight) ===== */
#hero {
  position: relative; min-height: 100vh; padding: 0; overflow: hidden;
  background: var(--color-bg-dark); display: flex; align-items: center;
}
.hero-photo-wrap { position: absolute; inset: 0; }
.hero-photo-wrap img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.08) brightness(0.9); opacity: 0.6; }
.hero-photo-wrap::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(12,12,12,0.55), rgba(12,12,12,0.75)); }

/* ===== Hero 3D robot (Spline) ===== */
#hero.has-robot .hero-photo-wrap img { opacity: 0.22; }
.hero-robot {
  position: absolute; top: 0; bottom: 0; right: 0; left: 42%; z-index: 1;
  pointer-events: auto;
}
.hero-robot spline-viewer { width: 100%; height: 100%; display: block; transform: scale(0.82); transform-origin: center 45%; }
/* Left-edge fade so the robot melts into the dark hero background */
.hero-robot-fade {
  position: absolute; top: 0; bottom: 0; right: 0; left: 42%; z-index: 1;
  pointer-events: none;
  background: linear-gradient(90deg, var(--color-bg-dark) 0%, rgba(12,12,12,0) 28%, rgba(12,12,12,0) 70%, rgba(12,12,12,0.65) 100%);
}
@media (max-width: 900px) {
  .hero-robot, .hero-robot-fade { left: 0; }
  /* decorative only on small screens so touch-scroll is never captured by the canvas */
  .hero-robot { opacity: 0.45; pointer-events: none; }
  .hero-robot-fade { background: linear-gradient(180deg, rgba(12,12,12,0.2), rgba(12,12,12,0.85)); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-robot { display: none; }
}

.hero-spotlight {
  position: absolute; inset: 0; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  padding: 0 10vw; text-align: center;
  color: #fff; font-family: var(--font-display); font-weight: 500;
  font-size: clamp(20px, 2.4vw, 32px); line-height: 1.4; letter-spacing: -0.01em;
  -webkit-mask-image: radial-gradient(circle 170px at var(--mx, 50%) var(--my, 40%), #000 0, #000 60%, transparent 100%);
  mask-image: radial-gradient(circle 170px at var(--mx, 50%) var(--my, 40%), #000 0, #000 60%, transparent 100%);
  pointer-events: none;
}

/* With the robot on the right, pin the spotlight copy to the left column */
@media (min-width: 901px) {
  #hero.has-robot .hero-spotlight {
    justify-content: flex-start; text-align: left;
    padding: 0 0 0 max(40px, 6vw);
    /* robot owns the right half — drop the flashlight mask, show the copy plainly */
    -webkit-mask-image: none; mask-image: none;
    color: rgba(255,255,255,0.86);
  }
  #hero.has-robot .hero-spotlight p {
    max-width: 40%; position: relative; padding-top: 26px;
  }
  #hero.has-robot .hero-spotlight p::before {
    content: ''; position: absolute; top: 0; left: 0;
    width: 40px; height: 2px; background: var(--color-accent-light);
  }
  /* the Spline attribution badge sits in the bottom-right corner — drop our own Scroll cue there */
  #hero.has-robot .hero-scroll-hint { display: none; }
}

.hero-bottom-bar {
  position: absolute; left: 0; right: 0; bottom: 40px; z-index: 3;
  display: flex; justify-content: space-between; align-items: flex-end;
  padding: 0 40px; color: #fff;
}
.hero-name { font-family: var(--font-display); font-weight: 800; font-size: clamp(22px, 3vw, 34px); letter-spacing: -0.01em; text-transform: uppercase; }
.hero-role-tag { font-size: 12px; text-transform: uppercase; letter-spacing: 0.15em; color: rgba(255,255,255,0.6); margin-top: 6px; }
.hero-scroll-hint { font-size: 11px; text-transform: uppercase; letter-spacing: 0.2em; color: rgba(255,255,255,0.5); display: flex; align-items: center; gap: 8px; }
.hero-scroll-hint::after { content: ''; width: 1px; height: 32px; background: rgba(255,255,255,0.35); animation: scrollLine 1.8s ease-in-out infinite; }
@keyframes scrollLine { 0%, 100% { transform: scaleY(0.3); opacity: 0.4; } 50% { transform: scaleY(1); opacity: 1; } }

@media (max-width: 700px) {
  .hero-spotlight { font-size: 17px; padding: 0 8vw; -webkit-mask-image: radial-gradient(circle 120px at var(--mx,50%) var(--my,40%), #000 0, #000 60%, transparent 100%); mask-image: radial-gradient(circle 120px at var(--mx,50%) var(--my,40%), #000 0, #000 60%, transparent 100%); }
  .hero-bottom-bar { flex-direction: column; align-items: flex-start; gap: 14px; padding: 0 24px; }
}

/* ===== About: giant stack + floating cards + blur paragraph ===== */
#about { background: var(--color-bg); padding-top: 100px; }
.giant-stack { text-align: left; }
.giant-heading {
  font-size: clamp(48px, 11vw, 200px); font-weight: 800; line-height: 0.86;
  letter-spacing: -0.03em; text-transform: uppercase; margin: 0;
}
.giant-heading.outline { -webkit-text-stroke: 1.5px var(--color-fg); color: transparent; }

.floating-cards { position: relative; height: 0; }
.blur-card {
  position: absolute; width: 210px; padding: 18px; border-radius: 18px;
  background: rgba(255,255,255,0.6); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--color-border-strong); box-shadow: 0 20px 40px rgba(0,0,0,0.06);
  font-size: 12px; color: var(--color-muted);
}
.blur-card .big { font-family: var(--font-display); font-size: 26px; font-weight: 800; color: var(--color-fg); display: block; margin-bottom: 4px; }
.blur-card._01 { top: -40px; right: 6%; transform: rotate(-6deg); }
.blur-card._02 { top: 90px; right: 22%; transform: rotate(4deg); }
@media (max-width: 900px) { .blur-card { position: static; transform: none !important; margin-top: 16px; width: auto; display: inline-block; margin-right: 12px; } .floating-cards { height: auto; display: flex; flex-wrap: wrap; margin-top: 24px; } }

.scroll-blur-text { max-width: 900px; margin: 90px 0 0; }
.blur-line {
  font-family: var(--font-display); font-weight: 600; font-size: clamp(22px, 3.4vw, 40px);
  line-height: 1.3; letter-spacing: -0.01em; color: var(--color-fg);
  opacity: 0.15; filter: blur(4px); transition: opacity 0.4s ease, filter 0.4s ease;
}
.blur-line.active { opacity: 1; filter: blur(0); }

.about-meta-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-top: 90px; padding-top: 40px; border-top: 1px solid var(--color-border); }
@media (max-width: 700px) { .about-meta-row { grid-template-columns: repeat(2, 1fr); } }
.about-meta-row .stat-value { font-family: var(--font-display); font-size: 40px; font-weight: 800; letter-spacing: -0.02em; }
.about-meta-row .stat-label { font-size: 12px; color: var(--color-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 6px; }

.skills-list { margin-top: 60px; max-width: 640px; }
.skill-row { display: grid; grid-template-columns: 180px 1fr 50px; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--color-border); }
.skill-row .skill-name { font-size: 14px; font-weight: 600; }
.skill-track { height: 3px; background: var(--color-border); overflow: hidden; }
.skill-fill { height: 100%; background: var(--color-fg); width: 0; transition: width 1.1s cubic-bezier(0.16,1,0.3,1); }
.skill-row .skill-pct { font-size: 13px; color: var(--color-muted); text-align: right; }

/* ===== Services ===== */
#services { background: var(--color-bg); }
.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 50px; background: var(--color-border); border: 1px solid var(--color-border); }
@media (max-width: 900px) { .services-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .services-grid { grid-template-columns: 1fr; } }
.service-card { background: var(--color-bg); padding: 36px 28px; position: relative; transition: background 0.3s ease; }
.service-card:hover { background: var(--color-surface); }
.service-index { font-family: var(--font-display); font-size: 12px; color: var(--color-muted-2); margin-bottom: 24px; display: block; }
.service-icon { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; margin-bottom: 24px; transition: transform 0.3s ease; }
.service-card:hover .service-icon { transform: translateX(4px); }
.service-icon svg { width: 26px; height: 26px; color: var(--color-fg); }
.service-card h3 { font-size: 19px; font-weight: 700; margin-bottom: 10px; letter-spacing: -0.01em; }
.service-card p { font-size: 14px; color: var(--color-muted); line-height: 1.6; }

/* ===== Portfolio (masonry columns) ===== */
#portfolio { background: var(--color-bg); }
.portfolio-head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 20px; }
.portfolio-grid { column-count: 2; column-gap: 60px; margin-top: 60px; }
@media (max-width: 800px) { .portfolio-grid { column-count: 1; } }
.project-card { display: block; break-inside: avoid; margin-bottom: 60px; }
.project-image-wrap { position: relative; overflow: hidden; border-radius: 4px; }
.project-card img { width: 100%; height: auto; display: block; filter: grayscale(1); transition: transform 0.6s cubic-bezier(0.16,1,0.3,1), filter 0.6s ease; }
.project-card:hover img { filter: grayscale(0); transform: scale(1.04); }
.project-caption { display: flex; justify-content: space-between; align-items: baseline; margin-top: 16px; }
.project-caption h3 { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.project-caption .cat { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--color-muted); }

/* ===== Why work with me ===== */
#why { background: var(--color-bg); }
.why-grid { display: grid; grid-template-columns: 4fr 8fr; gap: 48px; }
@media (max-width: 900px) { .why-grid { grid-template-columns: 1fr; } }
.why-sticky { position: sticky; top: 120px; align-self: start; }
.why-row { display: flex; gap: 20px; padding: 28px 0; border-top: 1px solid var(--color-border); position: relative; }
.why-row:last-child { border-bottom: 1px solid var(--color-border); }
.why-index { font-family: var(--font-display); color: var(--color-muted-2); font-size: 13px; width: 24px; flex-shrink: 0; }
.why-icon { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: transform 0.3s ease; }
.why-row:hover .why-icon { transform: translateX(4px); }
.why-icon svg { width: 22px; height: 22px; color: var(--color-fg); }
.why-row h3 { font-size: 17px; margin-bottom: 4px; font-weight: 700; }
.why-row p { font-size: 14px; color: var(--color-muted); }

/* ===== Testimonials ===== */
#testimonials { background: var(--color-bg); }
.testimonials-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; margin-top: 50px; background: var(--color-border); border: 1px solid var(--color-border); }
@media (max-width: 800px) { .testimonials-grid { grid-template-columns: 1fr; } }
.testimonial-card { background: var(--color-bg); padding: 36px; transition: background 0.3s ease; }
.testimonial-card:hover { background: var(--color-surface); }
.testimonial-card .quote-icon { color: var(--color-muted-2); width: 24px; height: 24px; margin-bottom: 20px; }
.testimonial-card p.quote { font-size: 16px; line-height: 1.6; margin-bottom: 24px; font-weight: 500; }
.testimonial-divider { height: 1px; background: var(--color-border); margin-bottom: 20px; }
.testimonial-person { display: flex; align-items: center; gap: 12px; }
.testimonial-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--color-fg); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.testimonial-person .name { font-weight: 700; font-size: 14px; }
.testimonial-person .role { font-size: 12px; color: var(--color-muted); }

/* ===== FAQ ===== */
#faq { background: var(--color-bg); }
.faq-list { max-width: 820px; margin: 50px auto 0; border-top: 1px solid var(--color-border); }
.faq-item { border-bottom: 1px solid var(--color-border); }
.faq-question { width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 26px 4px; background: none; border: none; font-family: var(--font-body); font-weight: 600; font-size: 18px; text-align: left; cursor: pointer; color: var(--color-fg); }
.faq-toggle { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--color-border-strong); display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: transform 0.3s ease; }
.faq-item.open .faq-toggle { transform: rotate(45deg); background: var(--color-fg); color: #fff; }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.4s cubic-bezier(0.16,1,0.3,1); }
.faq-item.open .faq-answer { max-height: 300px; }
.faq-answer p { padding: 0 4px 26px; color: var(--color-muted); font-size: 15px; line-height: 1.6; max-width: 640px; }

/* ===== Contact (giant CTA) ===== */
#contact { background: var(--color-bg-dark); color: #fff; }
.contact-cta-title { font-size: clamp(36px, 6vw, 76px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.05; max-width: 820px; }
.contact-cta-sub { color: rgba(255,255,255,0.55); font-size: 16px; margin-top: 20px; max-width: 480px; }
.contact-grid { display: grid; grid-template-columns: 5fr 7fr; gap: 60px; margin-top: 60px; }
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-info-row { display: flex; align-items: center; gap: 16px; padding: 20px 0; border-bottom: 1px solid rgba(255,255,255,0.12); }
.contact-info-icon { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.contact-info-icon svg { width: 18px; height: 18px; color: #fff; }
.contact-info-row .label { font-size: 12px; color: rgba(255,255,255,0.5); text-transform: uppercase; letter-spacing: 0.08em; }
.contact-info-row .value { font-weight: 600; font-size: 15px; color: #fff; }
.contact-socials { display: flex; gap: 10px; margin-top: 24px; }
.contact-socials a { width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.2); display: flex; align-items: center; justify-content: center; color: #fff; }
.contact-socials a:hover { border-color: #fff; }

.contact-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 500px) { .contact-form-row { grid-template-columns: 1fr; } }
.form-field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 26px; }
.form-field label { font-size: 12px; color: rgba(255,255,255,0.5); text-transform: uppercase; letter-spacing: 0.08em; }
.form-field input, .form-field textarea {
  font-family: var(--font-body); font-size: 16px; padding: 10px 2px;
  border: none; border-bottom: 1px solid rgba(255,255,255,0.25); border-radius: 0;
  background: transparent; color: #fff;
}
.form-field input::placeholder, .form-field textarea::placeholder { color: rgba(255,255,255,0.3); }
.form-field input:focus, .form-field textarea:focus { outline: none; border-color: #fff; }
.contact-submit { display: inline-flex; align-items: center; gap: 10px; padding: 16px 30px; border-radius: 999px; background: #fff; color: var(--color-bg-dark); border: none; font-size: 14px; font-weight: 700; cursor: pointer; font-family: var(--font-body); text-transform: uppercase; letter-spacing: 0.05em; }
.contact-submit:disabled { opacity: 0.7; cursor: default; }
.contact-status { margin-top: 14px; font-size: 13px; }
.contact-status.error { color: #ff8a8a; }
.contact-status.success { color: #8affb0; }
.spin { animation: spin 0.8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 14px 26px; border-radius: 999px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; position: relative; overflow: hidden; }
.btn-primary { background: var(--color-fg); color: #fff; }
.btn-primary:hover { background: var(--color-accent); }
.btn-ghost { border: 1px solid var(--color-border-strong); }
.btn-ghost:hover { border-color: var(--color-fg); }

/* Footer */
footer { background: var(--color-bg-dark); padding: 40px 0 48px; text-align: center; color: rgba(255,255,255,0.4); font-size: 13px; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
