/* ---------- Design tokens ---------- */
:root{
  --bg: #fafafa;
  --ink: #111111;
  --muted: #6b6b6b;
  --line: #e7e7e7;
  --pill-bg: rgba(255,255,255,.6);
  --dark: #0a0a0a;
  --dark-muted: #8a8a8a;
  --green: #dfe97a;
  --radius-lg: 32px;
  --radius-md: 20px;
  --radius-sm: 999px;
  --maxw: 1240px;
  --font-head: "Switzer","Inter",-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  --font-body: "Inter",-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}

*{box-sizing:border-box;}
html{scroll-behavior:smooth;}
body{
  margin:0;
  background:var(--bg);
  color:var(--ink);
  font-family:var(--font-body);
  -webkit-font-smoothing:antialiased;
  overflow-x:hidden;
}
img{max-width:100%;display:block;}
a{color:inherit;text-decoration:none;}
.wrap{max-width:var(--maxw);margin:0 auto;padding:0 24px;}

/* ---------- Nav ---------- */
.nav-outer{
  position:sticky;
  top:20px;
  z-index:50;
  display:flex;
  justify-content:center;
  padding:0 24px;
}
.nav{
  width:100%;
  max-width:840px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  background:var(--pill-bg);
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
  border:1px solid rgba(0,0,0,.08);
  border-radius:var(--radius-sm);
  padding:10px 10px 10px 20px;
}
.nav .brand{
  font-weight:700;
  font-size:15px;
  white-space:nowrap;
}
.nav-links{
  display:flex;
  align-items:center;
  gap:28px;
  font-size:14px;
  font-weight:500;
}
.nav-links a{transition:color .3s cubic-bezier(.44,0,.56,1);}
.nav-links a:not(.contact-btn):hover{color:var(--muted);}
.nav-links a.contact-btn{
  background:#fff;
  border:1px solid rgba(0,0,0,.1);
  padding:10px 18px;
  border-radius:var(--radius-sm);
  font-weight:600;
  transition:transform .3s cubic-bezier(.44,0,.56,1),box-shadow .3s ease;
}
.nav-links a.contact-btn:hover{transform:translateY(-1px);box-shadow:0 6px 16px -6px rgba(0,0,0,.3);}
.nav-toggle{display:none;}

/* ---------- Hero ---------- */
.hero{
  padding:80px 0 60px;
}
.badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  background:#fff;
  border:1px solid var(--line);
  padding:8px 16px;
  border-radius:var(--radius-sm);
  font-size:13px;
  font-weight:600;
  color:#444;
  margin-bottom:28px;
}
.badge .dot{
  width:8px;height:8px;border-radius:50%;
  background:#8fdc7a;
  box-shadow:0 0 0 4px rgba(143,220,122,.25);
}
.hero-grid{
  display:grid;
  grid-template-columns:1.1fr 1fr;
  gap:40px;
  align-items:center;
}
.hero h1{
  font-family:var(--font-head);
  font-weight:500;
  font-size:clamp(38px,5vw,72px);
  line-height:1.05;
  letter-spacing:-0.02em;
  text-wrap:balance;
  margin:0 0 24px;
}
.hero p.lead{
  font-size:16px;
  line-height:1.6;
  color:#333;
  max-width:440px;
  margin:0 0 36px;
}
.book-call{
  display:inline-flex;
  align-items:center;
  gap:10px;
  background:#000;
  color:#fff;
  padding:10px 22px 10px 10px;
  border-radius:var(--radius-sm);
  font-size:14px;
  font-weight:600;
  transition:transform .3s cubic-bezier(.44,0,.56,1),box-shadow .3s ease;
}
.book-call:hover{transform:translateY(-2px);box-shadow:0 12px 28px -8px rgba(0,0,0,.45);}
.book-call img{
  width:32px;height:32px;border-radius:50%;object-fit:cover;
}
.hero-visual{
  position:relative;
}
.hero-visual img{
  border-radius:var(--radius-md);
  box-shadow:0 40px 80px -20px rgba(0,0,0,.35);
  transform:rotate(3deg);
}
/* Card-morph: the static hero image becomes an invisible sizing anchor while
   the real Selected Work cards fan into the hero and scrub into the grid. */
.morph-on .hero-visual > .hero-single{ opacity:0; }
.hero-stack-m{ display:none; }        /* mobile-only project stack (see Responsive) */
.morph-on #work .project-card{
  transform-origin:center center;
  transition:none;              /* JS drives the transform each frame */
}
.morph-on #work .project-card .project-thumb img{ transition:none; }

/* ---------- Section headings ---------- */
.section{padding:70px 0;}
.section h2{
  font-family:var(--font-head);
  font-weight:500;
  font-size:clamp(30px,4vw,48px);
  text-wrap:balance;
  line-height:1.1;
  letter-spacing:-0.01em;
  margin:0 0 44px;
}
.rotate-word{
  display:inline-block;
  cursor:pointer;
  will-change:transform,opacity;
}
/* Swipe-up cycle: old word slides up & out, new word rises in from below. */
.rotate-word.up-out{
  transform:translateY(-0.9em);
  opacity:0;
  transition:transform .26s cubic-bezier(.5,0,.75,0), opacity .26s ease;
}
.rotate-word.up-in-start{
  transform:translateY(0.9em);
  opacity:0;
  transition:none;
}
.rotate-word.up-in{
  transform:translateY(0);
  opacity:1;
  transition:transform .38s cubic-bezier(.16,1,.3,1), opacity .38s ease;
}
@media (prefers-reduced-motion: reduce){
  .rotate-word{ will-change:auto; }
  .rotate-word.up-out,.rotate-word.up-in-start,.rotate-word.up-in{ transform:none; transition:none; }
}

/* ---------- Interactive cursor ---------- */
.cursor-ring{
  position:fixed; left:0; top:0;
  width:30px; height:30px;
  border:1.5px solid rgba(0,0,0,.35);
  border-radius:50%;
  pointer-events:none;
  z-index:9999;
  opacity:0;
  transition:width .25s cubic-bezier(.16,1,.3,1),
             height .25s cubic-bezier(.16,1,.3,1),
             background-color .25s ease,
             border-color .25s ease,
             opacity .3s ease;
  will-change:transform;
}
.cursor-ring.on{ opacity:1; }
.cursor-ring.hover{
  width:54px; height:54px;
  background:rgba(0,0,0,.05);
  border-color:rgba(0,0,0,.55);
}
.cursor-ring.down{ background:rgba(0,0,0,.12); }
@media (pointer:coarse){ .cursor-ring{ display:none; } }

/* Home already has the hero "Email me" CTA — hide the floating duplicate there. */
body.home .float-chat{ display:none; }

/* ---------- Work grid ---------- */
.work-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:28px;
}
.project-card{display:block;}
.project-thumb{
  border-radius:var(--radius-md);
  overflow:hidden;
  aspect-ratio:16/11;
  background:#eee;
  margin-bottom:18px;
}
.project-thumb img{
  width:100%;height:100%;object-fit:cover;
  transition:transform .6s cubic-bezier(.16,1,.3,1);
}
.project-card:hover .project-thumb img{transform:scale(1.045);}
.project-card:hover h3{opacity:.7;}
.project-card h3{transition:opacity .3s ease;}
.project-card .view-link{transition:transform .3s cubic-bezier(.44,0,.56,1),color .3s ease;}
.project-card:hover .view-link{transform:translateX(3px);color:#111;}
.project-meta{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:16px;
}
.project-meta h3{
  font-size:20px;
  font-weight:700;
  margin:0 0 4px;
}
.project-meta p{
  margin:0;
  font-size:14px;
  color:var(--muted);
}
.view-link{
  display:inline-flex;
  align-items:center;
  gap:6px;
  font-size:13px;
  font-weight:600;
  color:#444;
  white-space:nowrap;
}
.view-all{
  display:block;
  text-align:center;
  margin-top:48px;
  font-size:15px;
  font-weight:600;
}
.view-all span{margin-left:6px;}

/* ---------- Core stack / Skills ---------- */
.services-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:40px;
  align-items:start;
}
.services-grid h2{margin-bottom:56px;}
.stack-label{
  font-size:14px;
  font-weight:600;
  color:#333;
  margin-bottom:20px;
}
.stack-icons{
  display:flex;
  flex-wrap:nowrap;          /* keep the core stack on a single line */
  gap:10px;
}
.stack-icons img{
  width:26px;height:26px;
  object-fit:contain;
}
.stack-icons span{
  flex:0 0 auto;
  width:52px;height:52px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:#fff;
  border:1px solid var(--line);
  border-radius:14px;
}
.skills-list{
  display:flex;
  flex-direction:column;
}
.skill-row{
  display:flex;
  align-items:center;
  gap:20px;
  padding:26px 0;
  border-bottom:1px solid var(--line);
}
.skill-row:first-child{padding-top:0;}
.skill-row .skill-icon{
  width:44px;height:44px;
  min-width:44px;
  border-radius:50%;
  background:#111;
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
}
.skill-row .skill-icon svg{width:18px;height:18px;}
.skill-row span.skill-label{
  font-size:20px;
  font-weight:600;
}

/* ---------- About ---------- */
.about-grid{
  display:grid;
  grid-template-columns:340px 1fr;
  gap:48px;
}
.about-photo{
  border-radius:var(--radius-md);
  overflow:hidden;
}
.about-photo img{width:100%;object-fit:cover;}
.about-name{margin-top:18px;font-weight:700;font-size:16px;}
.about-role{color:var(--muted);font-size:14px;}
.about-body p.bio{
  font-size:16px;
  line-height:1.7;
  color:#333;
  max-width:640px;
}
.timeline{
  margin:28px 0 32px;
  display:flex;
  flex-direction:column;
  gap:18px;
}
.timeline-item{
  display:flex;
  justify-content:space-between;
  gap:12px;
  border-bottom:1px solid var(--line);
  padding-bottom:14px;
  font-size:14px;
}
.timeline-item .t-org{font-weight:700;}
.timeline-item .t-role{color:var(--muted);}
.timeline-item .t-date{color:var(--muted);white-space:nowrap;text-align:right;}
.speak-widget{
  display:inline-flex;
  align-items:center;
  gap:16px;
  background:#fff;
  border:1px solid var(--line);
  border-radius:var(--radius-sm);
  padding:10px 10px 10px 20px;
  margin-top:24px;
}
.speak-widget .label{font-weight:700;font-size:14px;}
.speak-widget .sub{font-size:12px;color:var(--muted);}
.speak-widget .icon-btn{
  width:48px;height:48px;border-radius:50%;
  background:#000;color:#fff;
  display:flex;align-items:center;justify-content:center;
  font-size:22px;line-height:1;
}
.speak-widget .icon-btn.alt{background:#fff;border:1px solid var(--line);color:#000;}

/* ---------- Footer / contact ---------- */
.footer{
  background:var(--dark);
  color:#fff;
  padding:90px 0 0;
  margin-top:40px;
  overflow:hidden;
}
.footer h2{
  font-family:var(--font-head);
  font-weight:500;
  font-size:clamp(36px,6vw,64px);
  line-height:1.08;
  margin:0 0 50px;
}
.footer h2 .muted{color:#6e6e6e;}
.footer-cols{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:24px;
  padding-bottom:40px;
}
.footer-cols .label{
  color:var(--dark-muted);
  font-size:13px;
  margin-bottom:10px;
}
.footer-cols .value{
  font-size:17px;
  font-weight:600;
}
.social-icons{display:flex;gap:10px;}
.social-icons a{
  width:38px;height:38px;border-radius:50%;
  background:#fff;color:#000;
  display:flex;align-items:center;justify-content:center;
}
.footer-bottom{
  display:flex;
  justify-content:space-between;
  border-top:1px solid #2a2a2a;
  padding:22px 0;
  font-size:13px;
  color:var(--dark-muted);
}
.wordmark{
  font-family:var(--font-head);
  font-weight:700;
  font-size:min(28vw,340px);
  line-height:1;
  color:#fff;
  text-align:center;
  letter-spacing:-0.03em;
  mask-image:linear-gradient(to bottom, rgba(255,255,255,.9), rgba(255,255,255,0));
  -webkit-mask-image:linear-gradient(to bottom, rgba(255,255,255,.9), rgba(255,255,255,0));
  user-select:none;
  margin-top:10px;
}

/* ---------- floating chat bubble ---------- */
.float-chat{
  position:fixed;
  left:24px;
  bottom:24px;
  z-index:60;
  display:flex;
  align-items:center;
  gap:10px;
  background:#000;
  color:#fff;
  padding:10px 20px 10px 10px;
  border-radius:var(--radius-sm);
  font-size:13px;
  font-weight:600;
  box-shadow:0 20px 40px -12px rgba(0,0,0,.4);
}
.float-chat img{width:30px;height:30px;border-radius:50%;object-fit:cover;}
.float-chat{transition:transform .3s cubic-bezier(.44,0,.56,1),box-shadow .3s ease;}
.float-chat:hover{transform:translateY(-3px);box-shadow:0 26px 50px -12px rgba(0,0,0,.5);}
.stack-icons span{transition:transform .3s cubic-bezier(.16,1,.3,1),border-color .3s ease;}
.stack-icons span:hover{transform:translateY(-4px);border-color:#cfcfcf;}
.view-all span{margin-left:6px;display:inline-block;transition:transform .3s cubic-bezier(.44,0,.56,1);}
.view-all:hover span{transform:translate(3px,-3px);}

/* ---------- Project detail page ---------- */
.project-hero{
  padding:120px 0 40px;
  text-align:center;
}
.project-hero h1{
  font-family:var(--font-head);
  font-weight:500;
  font-size:clamp(32px,5vw,56px);
  margin:0 0 24px;
  text-wrap:balance;
}
.project-hero .tag{
  color:var(--muted);
  font-size:14px;
  font-weight:600;
  margin-bottom:18px;
}
.project-hero-img{
  border-radius:var(--radius-md);
  overflow:hidden;
  margin:32px 0 10px;
  box-shadow:0 40px 80px -30px rgba(0,0,0,.35);
}
.project-hero-img img{width:100%;display:block;}
.project-meta-row{
  display:flex;
  gap:60px;
  padding:40px 0 30px;
  border-top:1px solid var(--line);
  margin-top:20px;
}
.meta-block .label{color:var(--muted);font-size:13px;margin-bottom:6px;}
.meta-block .val{font-weight:700;font-size:16px;}
.project-desc{
  font-size:17px;
  line-height:1.75;
  color:#222;
  max-width:820px;
  margin:0 0 40px;
  text-wrap:pretty;
}
.scope-label{color:var(--muted);font-size:13px;margin-bottom:14px;}
.scope-tags{display:flex;flex-wrap:wrap;gap:10px;margin-bottom:40px;}
.scope-tags span{
  background:#fff;border:1px solid var(--line);
  padding:9px 18px;border-radius:var(--radius-sm);
  font-size:13px;font-weight:700;
}
.live-link{
  display:inline-flex;align-items:center;gap:8px;
  font-weight:700;font-size:15px;
  padding-bottom:60px;
}
.more-projects h2{margin-bottom:36px;}

/* ---------- Reveal animation (Framer-style: fade + slide + subtle scale, staggered) ---------- */
[data-reveal]{
  opacity:0;
  transform:translateY(44px) scale(.965);
  transition:
    opacity .9s cubic-bezier(.16,1,.3,1),
    transform .9s cubic-bezier(.16,1,.3,1);
  transition-delay:var(--reveal-delay,0ms);
  will-change:opacity,transform;
}
[data-reveal].is-visible{
  opacity:1;
  transform:translateY(0) scale(1);
}
/* Springier pop for the stack icons (each cascades via --reveal-delay). */
[data-reveal].pop{
  transform:translateY(18px) scale(.6);
  transition:
    opacity .55s cubic-bezier(.16,1,.3,1),
    transform .55s cubic-bezier(.34,1.56,.64,1);
}
[data-reveal].pop.is-visible{ transform:translateY(0) scale(1); }
@media (prefers-reduced-motion:reduce){
  [data-reveal]{transition:opacity .3s ease;transform:none;}
  [data-reveal].is-visible{transform:none;}
}

/* ---------- Responsive ---------- */
@media (max-width:900px){
  .hero-grid{grid-template-columns:1fr;}
  .hero-visual{order:-1;}
  .work-grid{grid-template-columns:1fr;}
  .services-grid{grid-template-columns:1fr;}
  .about-grid{grid-template-columns:1fr;}
  .footer-cols{grid-template-columns:1fr;gap:28px;}
  .nav{max-width:100%;}
  .nav-links{gap:16px;font-size:13px;}

  /* Mobile hero: swap the single image for a static fanned project stack. */
  .hero-visual > .hero-single{ display:none; }
  .hero-visual > .hero-single + .hero-stack-m{ display:block; }
  .hero-stack-m{
    position:relative;
    width:min(78vw,340px);
    margin:8px auto 24px;
    aspect-ratio:4/3;
  }
  .hero-stack-m img{
    position:absolute; inset:0;
    width:100%; height:100%;
    object-fit:cover;
    border-radius:16px;
    box-shadow:0 22px 44px -18px rgba(0,0,0,.35);
    transform-origin:center;
  }
  .hero-stack-m img:nth-child(1){ transform:translate(-9%,7%) rotate(-7deg) scale(.9); }
  .hero-stack-m img:nth-child(2){ transform:translate(8%,9%) rotate(6deg) scale(.9); }
  .hero-stack-m img:nth-child(3){ transform:translate(6%,-4%) rotate(4deg) scale(.94); }
  .hero-stack-m img:nth-child(4){ transform:translate(0,0) rotate(0deg) scale(1); }

  /* Core stack: allow wrapping so it never overflows narrow screens. */
  .stack-icons{ flex-wrap:wrap; }
}
@media (max-width:600px){
  .nav .brand{font-size:13px;}
  .nav-links a:not(.contact-btn){display:none;}
  .float-chat span{display:none;}
}
