/* ---------- Reset & tokens ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root{
  --space-indigo: #22223b;
  --dusty-grape: #4a4e69;
  --lilac-ash: #9a8c98;
  --almond-silk: #c9ada7;
  --parchment: #f2e9e4;

  --bg: var(--parchment);
  --ink: var(--space-indigo);
  --ink-dim: var(--dusty-grape);
  --ink-faint: var(--lilac-ash);
  --accent: #9a8c98; /* lilac-ash, from Carlos's palette */
  --line: #ddccc4;
  --card: #ffffffb3;

  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --max: 1140px;
  --ease: cubic-bezier(.16,1,.3,1);
}

html { scroll-behavior: smooth; }

body{
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  cursor: default;
}

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

.noise-overlay{
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: .035;
  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");
  mix-blend-mode: multiply;
}

/* ---------- Progress bar ---------- */
.progress-bar{
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--dusty-grape));
  z-index: 1001;
  transition: width .1s linear;
}

/* ---------- Cursor glow ---------- */
.cursor-glow{
  position: fixed;
  top: 0; left: 0;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(circle, rgba(154,140,152,.14) 0%, rgba(154,140,152,0) 70%);
  transform: translate(-50%, -50%);
  transition: opacity .3s;
  will-change: transform;
}

/* ---------- Blobs ---------- */
.blob{
  position: fixed;
  border-radius: 50%;
  filter: blur(70px);
  z-index: 0;
  pointer-events: none;
  opacity: .55;
  will-change: transform;
}
.blob--1{
  width: 460px; height: 460px;
  top: -120px; left: -100px;
  background: radial-gradient(circle at 30% 30%, var(--almond-silk), transparent 70%);
  animation: float1 22s ease-in-out infinite;
}
.blob--2{
  width: 380px; height: 380px;
  top: 40vh; right: -140px;
  background: radial-gradient(circle at 60% 40%, var(--lilac-ash), transparent 70%);
  animation: float2 26s ease-in-out infinite;
}
.blob--3{
  width: 340px; height: 340px;
  bottom: -100px; left: 30vw;
  background: radial-gradient(circle at 50% 50%, var(--dusty-grape), transparent 70%);
  opacity: .35;
  animation: float3 30s ease-in-out infinite;
}
@keyframes float1{
  0%,100%{ transform: translate(0,0) scale(1); }
  50%{ transform: translate(60px,80px) scale(1.15); }
}
@keyframes float2{
  0%,100%{ transform: translate(0,0) scale(1); }
  50%{ transform: translate(-70px,60px) scale(1.1); }
}
@keyframes float3{
  0%,100%{ transform: translate(0,0) scale(1); }
  50%{ transform: translate(50px,-60px) scale(1.2); }
}

.eyebrow{
  font-size: .75rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}

/* ---------- Reveal-on-scroll ---------- */
.reveal{
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
  transition-delay: calc(var(--d, 0) * 100ms);
}
.reveal.is-visible{
  opacity: 1;
  transform: translateY(0);
}

/* Hero title split-line animation */
.hero__title{
  overflow: hidden;
}
.hero__title .line{
  display: block;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(3rem, 8vw, 6.4rem);
  line-height: .98;
  letter-spacing: -.01em;
  transform: translateY(110%);
  animation: lineUp 1.1s var(--ease) forwards;
}
.hero__title .line:nth-child(1){ animation-delay: .15s; }
.hero__title .line:nth-child(2){ animation-delay: .32s; color: var(--accent); }
@keyframes lineUp{
  to{ transform: translateY(0); }
}

/* ---------- Nav ---------- */
.nav{
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 26px 6vw;
  backdrop-filter: blur(10px);
  background: linear-gradient(to bottom, rgba(242,233,228,.85), rgba(242,233,228,0));
}
.nav__logo{
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  transition: color .3s var(--ease), transform .3s var(--ease);
}
.nav__logo:hover{ color: var(--accent); transform: translateY(-1px); }
.nav__mark{
  display: block;
  flex-shrink: 0;
  border-radius: 50%;
  box-shadow: 0 8px 22px -10px rgba(34,34,59,.55);
  transition: transform .4s var(--ease), box-shadow .4s var(--ease);
}
.nav__logo:hover .nav__mark{
  transform: rotate(-5deg) scale(1.04);
  box-shadow: 0 12px 26px -10px rgba(34,34,59,.65);
}
.nav__logo-text{
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: .01em;
}
.nav__links{ display: flex; gap: 36px; }
.nav__links a{
  position: relative;
  font-size: .8rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink);
  overflow: hidden;
  display: inline-block;
}
.nav__links a span{ display: inline-block; transition: transform .35s var(--ease); }
.nav__links a::after{
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 100%; height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .35s var(--ease);
}
.nav__links a:hover::after{ transform: scaleX(1); }
.nav__links a:hover span{ transform: translateY(-2px); }

/* ---------- Hero ---------- */
.hero{
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.3fr .7fr;
  align-items: center;
  gap: 40px;
  padding: 0 6vw;
  max-width: 1300px;
  margin: 0 auto;
}
.hero__eyebrow{
  font-size: .8rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 22px;
}
.hero__sub{
  margin-top: 30px;
  max-width: 480px;
  font-size: 1.1rem;
  color: var(--ink-dim);
  line-height: 1.65;
}
.hero__cta{
  margin-top: 40px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* Hero portrait */
.hero__portrait{
  position: relative;
  justify-self: center;
  width: min(340px, 80%);
  aspect-ratio: 1;
}
.portrait-ring{
  position: absolute;
  inset: -18px;
  border-radius: 50%;
  border: 1.5px dashed var(--accent);
  animation: spin 40s linear infinite;
}
@keyframes spin{ to{ transform: rotate(360deg); } }
.portrait-img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: 0 30px 60px -20px rgba(34,34,59,.35);
  position: relative;
  z-index: 2;
  will-change: transform;
}

.hero__scroll{
  position: absolute;
  bottom: 42px;
  left: 6vw;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.hero__scroll-line{
  width: 1px;
  height: 42px;
  background: var(--ink-faint);
  position: relative;
  overflow: hidden;
}
.hero__scroll-line::after{
  content: "";
  position: absolute;
  top: -100%; left: 0;
  width: 100%; height: 100%;
  background: var(--accent);
  animation: scrollLine 1.8s ease-in-out infinite;
}
@keyframes scrollLine{
  0%{ top: -100%; }
  60%{ top: 100%; }
  100%{ top: 100%; }
}

.btn{
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 15px 28px;
  border-radius: 999px;
  font-size: .88rem;
  font-weight: 600;
  letter-spacing: .01em;
  overflow: hidden;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.btn span{ position: relative; z-index: 2; }
.btn--primary{
  background: var(--space-indigo);
  color: var(--parchment);
}
.btn--primary::before{
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: translateY(101%);
  transition: transform .4s var(--ease);
  z-index: 1;
}
.btn--primary:hover::before{ transform: translateY(0); }
.btn--primary:hover{ transform: translateY(-3px); box-shadow: 0 14px 30px -12px rgba(34,34,59,.4); }

.btn--ghost{
  border: 1px solid var(--ink);
  color: var(--ink);
}
.btn--ghost:hover{
  transform: translateY(-3px);
  background: var(--ink);
  color: var(--parchment);
}

/* ---------- Marquee ---------- */
.marquee{
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  padding: 22px 0;
  background: var(--space-indigo);
  position: relative;
  z-index: 2;
}
.marquee__track{
  display: flex;
  gap: 26px;
  white-space: nowrap;
  width: max-content;
  animation: marquee 32s linear infinite;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.3rem;
  color: var(--parchment);
  opacity: .9;
}
.marquee__track span:nth-child(2n){ color: var(--accent); font-style: normal; font-family: var(--sans); font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; align-self: center;}
@keyframes marquee{
  from{ transform: translateX(0); }
  to{ transform: translateX(-50%); }
}

/* ---------- About ---------- */
.about{
  position: relative;
  z-index: 2;
  padding: 160px 6vw;
  max-width: var(--max);
  margin: 0 auto;
}
.about__grid{
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 60px;
}
.about__lead{
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 28px;
  color: var(--ink);
}
.about__content p{
  color: var(--ink-dim);
  font-size: 1.02rem;
  line-height: 1.75;
  max-width: 640px;
  margin-bottom: 20px;
}
.about__facts{
  margin-top: 48px;
  display: grid;
  gap: 20px;
  max-width: 520px;
}
.fact{
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  font-size: .92rem;
  transition: padding-left .3s var(--ease), background .3s;
}
.fact:hover{
  padding-left: 12px;
  background: var(--card);
}
.fact__label{ color: var(--ink-faint); }
.fact__value{ color: var(--ink); font-weight: 500; text-align: right; }

/* ---------- Work ---------- */
.work{
  position: relative;
  z-index: 2;
  padding: 60px 6vw 40px;
  max-width: var(--max);
  margin: 0 auto;
}
.work__head{ margin-bottom: 64px; max-width: 640px; }
.work__head h2{
  font-family: var(--serif);
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  font-weight: 500;
  margin-top: 14px;
  line-height: 1.25;
}

.projects{ display: flex; flex-direction: column; gap: 140px; }

.project{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}
.project:nth-child(even){ direction: rtl; }
.project:nth-child(even) > *{ direction: ltr; }

.project__media{
  position: relative;
  min-height: 560px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  transition: transform .1s ease-out;
}

.project__media-num,
.project__media-label{
  font-family: var(--serif);
  text-align: center;
}
.project__media-num{
  font-size: .78rem;
  letter-spacing: .18em;
  color: var(--ink-faint);
}
.project__media-label{
  font-style: italic;
  font-size: 1.25rem;
  color: var(--ink);
}

.project__media-shine{
  position: absolute;
  top: -60%; left: -60%;
  width: 60%; height: 220%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,.35), transparent);
  transform: rotate(20deg);
  transition: left 1s var(--ease);
  z-index: 5;
  pointer-events: none;
}
.tilt-card:hover .project__media-shine{ left: 130%; }

/* ---------- Phone mockup ---------- */
/* Bezel thickness and corner radii are % of the phone's own box, so the
   frame stays proportionally correct ("looks like a real phone") whether
   it's rendered large (standalone) or small (overlapped on the laptop). */
.phone{
  position: relative;
  z-index: 2;
  width: 218px;
  aspect-ratio: 9/19.5;
  background: linear-gradient(155deg, #2b2b34, #0c0c12 60%);
  border-radius: 15% / 7%;
  padding: 7px; /* fixed: CSS % padding resolves against the PARENT's width, not the phone's own — must be px */
  box-shadow:
    0 40px 70px -24px rgba(0,0,0,.55),
    0 0 0 1px rgba(242,233,228,.08),
    inset 0 0 0 1.5px rgba(255,255,255,.08);
  transition: transform .1s ease-out;
}
/* side buttons, sized/positioned as % of phone height so they scale too */
.phone::before,
.phone::after{
  content: "";
  position: absolute;
  right: -1.5px;
  width: 2px;
  background: #1a1a20;
  border-radius: 1px 0 0 1px;
}
.phone::before{ top: 22%; height: 9%; }
.phone::after{ top: 33%; height: 14%; }
.phone__notch{
  position: absolute;
  top: 3.4%; left: 50%;
  transform: translateX(-50%);
  width: 34%; height: 3.6%;
  background: #05050a;
  border-radius: 999px;
  z-index: 3;
}
.phone__notch::after{
  content: "";
  position: absolute;
  right: 14%; top: 50%;
  transform: translateY(-50%);
  width: 14%; aspect-ratio: 1;
  border-radius: 50%;
  background: #12121c;
  box-shadow: inset 0 0 0 1px rgba(120,150,220,.25);
}
.phone__screen{
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 11% / 5%;
  overflow: hidden;
  background: var(--space-indigo);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.4);
}
.phone__slide{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  opacity: 0;
  transition: opacity 1s var(--ease);
}
.phone__slide.is-active{ opacity: 1; }
.phone__screen-glare{
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background: linear-gradient(115deg, rgba(255,255,255,.10) 0%, transparent 30%);
}
.phone__dots{
  position: absolute;
  bottom: 2.2%; left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
  z-index: 5;
}
.phone__dots span{
  width: 5px; height: 5px;
  border-radius: 50%;
  background: rgba(242,233,228,.35);
  transition: background .3s, transform .3s;
}
.phone__dots span.is-active{
  background: var(--almond-silk);
  transform: scale(1.3);
}

/* ---------- Device stack (laptop + phone, used for Iglú) ---------- */
.device-stack{
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 100%;
  padding: 0 8% 6%;
}
.laptop{
  position: relative;
  z-index: 1;
  width: min(380px, 92%);
}
.laptop__screen{
  position: relative;
  background: linear-gradient(155deg, #2b2b34, #0c0c12 60%);
  border-radius: 10px 10px 2px 2px;
  padding: 9px 9px 11px; /* fixed: % padding here would resolve against .device-stack's width, not the laptop's own — must be px */
  box-shadow:
    0 30px 60px -20px rgba(0,0,0,.5),
    0 0 0 1px rgba(242,233,228,.06);
}
.laptop__notch{
  position: absolute;
  top: 1.4%; left: 50%;
  transform: translateX(-50%);
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #05050a;
  box-shadow: inset 0 0 0 1px rgba(120,150,220,.2);
  z-index: 3;
}
.laptop__display{
  position: relative;
  width: 100%;
  aspect-ratio: 16/10;
  border-radius: 2px;
  overflow: hidden;
  background: var(--space-indigo);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.4);
}
.laptop__slide{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  opacity: 0;
  transition: opacity 1s var(--ease);
}
.laptop__slide.is-active{ opacity: 1; }
.laptop__base{
  position: relative;
  width: 112%;
  left: -6%;
  height: 12px;
  background: linear-gradient(to bottom, #d8d8d8, #b7b7b7);
  border-radius: 0 0 8px 8px;
  box-shadow: 0 10px 18px -6px rgba(0,0,0,.35);
}
.laptop__base::before{
  content: "";
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 14%; height: 5px;
  background: #a3a3a3;
  border-radius: 0 0 6px 6px;
}

.device-stack .phone{
  position: absolute;
  z-index: 2;
  right: 4%;
  bottom: -6%;
  width: 30%;
  min-width: 92px;
  max-width: 150px;
  padding: 4px; /* thinner bezel — this phone renders much smaller than the base .phone, 7px would look chunky */
}

.project__tag{
  font-size: .74rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}
.project__body h3{
  font-family: var(--serif);
  font-size: clamp(1.6rem, 2.4vw, 2.1rem);
  font-weight: 500;
  margin: 14px 0 18px;
  line-height: 1.2;
  color: var(--ink);
}
.project__summary{
  color: var(--ink-dim);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 22px;
}
.project__points{ display: grid; gap: 12px; margin-bottom: 26px; }
.project__points li{
  position: relative;
  padding-left: 22px;
  font-size: .92rem;
  color: var(--ink-dim);
  line-height: 1.55;
}
.project__points li::before{
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.project__tools{
  font-size: .8rem;
  color: var(--ink-faint);
  letter-spacing: .02em;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

/* ---------- Contact ---------- */
.contact{
  position: relative;
  z-index: 2;
  padding: 180px 6vw;
  text-align: center;
}
.contact__inner{ max-width: 640px; margin: 0 auto; }
.contact h2{
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.9rem, 4vw, 3rem);
  margin: 16px 0 40px;
  line-height: 1.2;
  color: var(--ink);
}
.contact__email{
  display: inline-block;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.3rem, 3vw, 1.9rem);
  color: var(--accent);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, transform .25s var(--ease);
  will-change: transform;
}
.contact__email:hover{ border-color: var(--accent); }
.contact__links{ margin-top: 28px; }
.contact__links a{
  font-size: .88rem;
  color: var(--ink-dim);
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
}
.contact__links a:hover{ color: var(--ink); }

/* ---------- Footer ---------- */
.footer{
  position: relative;
  z-index: 2;
  padding: 32px 6vw 48px;
  text-align: center;
  font-size: .78rem;
  color: var(--ink-faint);
}

/* ---------- Responsive ---------- */
@media (max-width: 860px){
  .hero{ grid-template-columns: 1fr; padding-top: 140px; }
  .hero__portrait{ order: -1; width: 220px; margin: 0 auto; }
  .about__grid{ grid-template-columns: 1fr; gap: 24px; }
  .project{ grid-template-columns: 1fr; }
  .project:nth-child(even){ direction: ltr; }
  .fact{ flex-direction: column; gap: 4px; }
  .fact__value{ text-align: left; }
  .cursor-glow{ display: none; }
  .nav__logo-text{ display: none; }
  .project__media{ min-height: 460px; }
  .phone{ width: 172px; }
  .laptop{ width: min(280px, 86%); }
}

@media (prefers-reduced-motion: reduce){
  *{ animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
