/* =========================================================
   DAVIDE ZAMPIERI — PORTFOLIO
   Palette: ink / paper / acid / violet / pink / orange
   ========================================================= */
:root {
  --ink: #0A0A0C;
  --ink-2: #16161B;
  --paper: #F3F0E8;
  --acid: #D7FF3D;
  --violet: #6C4AFA; /* AA: paper text on violet = 4.61:1 */
  --pink: #FF3E8A;
  --orange: #FF6B1A;
  --line: rgba(243, 240, 232, .16);

  --f-display: "Unbounded", system-ui, sans-serif;
  --f-body: "Space Grotesk", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, monospace;

  --gutter: clamp(16px, 3vw, 48px);
  --ease: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--f-body);
  font-size: 1rem;
  line-height: 1.5;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
body.is-loading { overflow: hidden; }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol { list-style: none; }
em { font-style: normal; }
::selection { background: var(--acid); color: var(--ink); }

.mono {
  font-family: var(--f-mono);
  font-size: .75rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* ---------- Cursor ---------- */
@media (hover: hover) and (pointer: fine) {
  body, a, button { cursor: none; }
}
.cursor {
  position: fixed; top: 0; left: 0; z-index: 1000;
  width: 14px; height: 14px; margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: var(--paper);
  mix-blend-mode: difference;
  pointer-events: none;
  display: grid; place-items: center;
  transition: width .4s var(--ease), height .4s var(--ease), margin .4s var(--ease), background .3s;
}
.cursor__label {
  font-family: var(--f-mono); font-size: .7rem; font-weight: 700;
  text-transform: uppercase; color: var(--ink);
  opacity: 0; transition: opacity .2s;
}
.cursor.is-big {
  width: 96px; height: 96px; margin: -48px 0 0 -48px;
  background: var(--acid); mix-blend-mode: normal;
}
.cursor.is-big .cursor__label { opacity: 1; }
@media (hover: none), (pointer: coarse) { .cursor { display: none; } }

/* ---------- Grain ---------- */
.grain {
  position: fixed; inset: -50%; z-index: 999; pointer-events: none;
  opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1s steps(6) infinite;
}
@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-5%, 3%); }
  40% { transform: translate(4%, -6%); }
  60% { transform: translate(-3%, 5%); }
  80% { transform: translate(6%, 2%); }
}

/* ---------- Loader ---------- */
.loader {
  position: fixed; inset: 0; z-index: 900;
  background: var(--acid); color: var(--ink);
  display: grid; grid-template-rows: auto 1fr auto;
  padding: var(--gutter);
  clip-path: inset(0 0 0 0);
}
.loader__top { display: flex; justify-content: space-between; gap: 1rem; }
.loader__word {
  align-self: center; justify-self: center;
  font-family: var(--f-display); font-weight: 900;
  font-size: clamp(3rem, 16vw, 14rem); line-height: 1;
  letter-spacing: -.04em;
}
.loader__count {
  justify-self: end;
  font-family: var(--f-display); font-weight: 200;
  font-size: clamp(4rem, 12vw, 10rem); line-height: .85;
  font-variant-numeric: tabular-nums;
}

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 14px var(--gutter);
  color: var(--paper);
  pointer-events: none; /* only the pills are clickable */
}
.nav > * { pointer-events: auto; }
/* Solid ink pills: paper on ink = 17:1 on every background (AA/AAA) */
.nav__logo {
  font-family: var(--f-display); font-weight: 900; font-size: 1.25rem; display: inline-block;
  background: var(--ink); padding: .4rem .7rem; border-radius: 14px;
}
.nav__logo sup { font-size: .55em; }
.nav__links { display: flex; gap: clamp(1rem, 2.4vw, 2rem); background: var(--ink); padding: .7rem 1.4rem; border-radius: 99px; }
.nav__links a { position: relative; }
.nav__links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: right;
  transition: transform .5s var(--ease);
}
.nav__links a:hover::after { transform: scaleX(1); transform-origin: left; }
.nav__cta {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .7rem 1.1rem; border-radius: 99px; background: var(--ink);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .2; } }
@media (max-width: 760px) { .nav__links { display: none; } }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100svh;
  display: grid; grid-template-rows: auto 1fr auto;
  padding: 88px var(--gutter) var(--gutter);
  overflow: hidden; isolation: isolate;
  background: radial-gradient(circle at 70% 30%, #3a1d9e 0%, var(--ink) 55%);
}
.hero__gl { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.hero__meta { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.hero__title {
  align-self: center;
  font-family: var(--f-display); font-weight: 800;
  font-size: clamp(3.2rem, 13.2vw, 16rem);
  line-height: .86; letter-spacing: -.045em;
  margin: 4vh 0;
}
.hero__line { display: block; overflow: hidden; padding-bottom: .04em; }
.hero__line--2 { text-align: right; }
.hero__word { display: inline-block; white-space: nowrap; }
.char { display: inline-block; will-change: transform; }
.hero .char { transition: color .3s; }
.hero .char.is-hot { color: var(--acid); }

.hero__bottom {
  display: grid; grid-template-columns: 1fr auto auto; align-items: end; gap: 2rem;
}
.hero__sub {
  font-family: var(--f-display); font-weight: 300;
  font-size: clamp(1.2rem, 2.4vw, 2.1rem); line-height: 1.15; letter-spacing: -.02em;
}
.rotator {
  display: inline-block; vertical-align: bottom; overflow: hidden;
  height: 1.2em; line-height: 1.2em;
}
.rotator__word {
  display: inline-block; font-weight: 800; color: var(--ink);
  background: var(--acid); padding: 0 .3em; border-radius: .2em;
}
.hero__roles { display: grid; gap: .3rem; text-align: right; }
.badge { position: relative; width: 120px; height: 120px; display: grid; place-items: center; }
.badge__ring {
  position: absolute; inset: 0; width: 100%; height: 100%;
  animation: spin 14s linear infinite;
  fill: var(--paper); font-family: var(--f-mono); font-size: 15.5px; font-weight: 700; letter-spacing: 2px;
}
.badge__arrow {
  width: 54px; height: 54px; border-radius: 50%; background: var(--pink); color: var(--ink);
  display: grid; place-items: center; font-size: 1.5rem; font-weight: 700;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 860px) {
  .hero__bottom { grid-template-columns: 1fr auto; }
  .hero__roles { display: none; }
  .badge { width: 92px; height: 92px; }
}

/* ---------- Marquee ---------- */
.marquees { position: relative; padding: 6vw 0; background: var(--paper); overflow: hidden; }
.marquee {
  width: 110%; margin-left: -5%;
  overflow: hidden; white-space: nowrap;
  font-family: var(--f-display); font-weight: 900;
  font-size: clamp(2rem, 6vw, 5.5rem); line-height: 1; letter-spacing: -.03em;
  padding: .3em 0;
}
.marquee--acid { background: var(--acid); color: var(--ink); transform: rotate(-3deg); position: relative; z-index: 2; }
.marquee--violet { background: var(--violet); color: var(--paper); transform: rotate(2deg); margin-top: -1.2vw; }
.marquee__inner { display: inline-flex; will-change: transform; }
.marquee__inner span { padding-right: .2em; }

/* ---------- Section head ---------- */
.section-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 4vw; flex-wrap: wrap; }
.section-title {
  font-family: var(--f-display); font-weight: 800;
  font-size: clamp(2.4rem, 7vw, 7rem); line-height: .92; letter-spacing: -.04em;
}
.section-title em { font-weight: 200; }

/* ---------- Manifesto ---------- */
.manifesto { background: var(--paper); color: var(--ink); padding: 10vw var(--gutter) 8vw; }
.manifesto__label { margin-bottom: 2rem; }
.manifesto__text {
  font-family: var(--f-display); font-weight: 500;
  font-size: clamp(1.6rem, 4.2vw, 4.2rem); line-height: 1.08; letter-spacing: -.035em;
  max-width: 30ch;
}
.manifesto__text .w { opacity: .12; display: inline-block; }
.manifesto__stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem;
  margin-top: 8vw; border-top: 2px solid var(--ink); padding-top: 2rem;
}
.manifesto__stats strong {
  display: block; font-family: var(--f-display); font-weight: 900;
  font-size: clamp(3rem, 7vw, 6.5rem); line-height: 1; letter-spacing: -.05em;
}
@media (max-width: 760px) { .manifesto__stats { grid-template-columns: 1fr 1fr; } }

/* ---------- Hats ---------- */
.hats { position: relative; padding: 10vw var(--gutter); background: var(--ink); }
.hats__list { border-top: 1px solid var(--line); }
.hat {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 4rem 1fr minmax(0, 28ch); grid-template-rows: auto auto;
  column-gap: 2rem; align-items: center;
  padding: clamp(1.4rem, 3vw, 2.6rem) 0;
  border-bottom: 1px solid var(--line);
  isolation: isolate;
}
.hat::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--hat-color, var(--acid));
  transform: scaleY(0); transform-origin: bottom;
  transition: transform .6s var(--ease);
}
.hat:hover::before { transform: scaleY(1); }
.hat:hover { color: var(--ink); }
.hat[data-color="#6E4BFF"]:hover { color: var(--paper); }
.hat__num { grid-row: 1 / 3; align-self: start; padding-top: .8rem; }
.hat__title {
  font-family: var(--f-display); font-weight: 800;
  font-size: clamp(2rem, 6.4vw, 6.4rem); line-height: 1; letter-spacing: -.045em;
  transition: transform .6s var(--ease), font-weight .4s;
}
.hat:hover .hat__title { transform: translateX(2vw); }
.hat__desc { grid-row: 1 / 3; grid-column: 3; font-size: .98rem; }
.hat__tags { grid-column: 2; margin-top: .8rem; color: #B9B6AE; transition: transform .6s var(--ease); } /* 10:1 on ink */
.hat:hover .hat__tags { transform: translateX(2vw); color: inherit; }
@media (max-width: 860px) {
  .hat { grid-template-columns: 2.6rem 1fr; }
  .hat__desc { grid-row: auto; grid-column: 2; margin-top: .8rem; }
}
.hat-preview {
  position: fixed; top: 0; left: 0; z-index: 50; pointer-events: none;
  width: 240px; height: 300px; margin: -150px 0 0 -120px;
  border-radius: 20px; border: 3px solid var(--ink);
  display: grid; place-items: center;
  background: var(--acid); color: var(--ink);
  box-shadow: 12px 12px 0 var(--ink);
  transform: scale(0) rotate(-10deg);
  opacity: 0;
}
.hat-preview__glyph { font-family: var(--f-display); font-weight: 900; font-size: 7rem; line-height: 1; }
@media (hover: none) { .hat-preview { display: none; } }

/* ---------- Work ---------- */
.work { background: var(--violet); color: var(--paper); overflow: hidden; }
.work__pin { min-height: 100vh; display: flex; align-items: center; padding: 100px 0 60px; }
.work__rail { display: flex; align-items: center; gap: 4vw; padding-left: var(--gutter); will-change: transform; }
.work__head { flex: 0 0 auto; width: min(30vw, 420px); display: grid; gap: 1.5rem; }
.work__hint { }
.work__head .section-title { font-size: clamp(2.4rem, 5.2vw, 5.6rem); }
.work__track { display: flex; gap: 2.5vw; padding-right: var(--gutter); }
.card {
  flex: 0 0 auto; width: clamp(280px, 34vw, 520px);
  display: grid; gap: 1rem;
  transform-style: preserve-3d; perspective: 900px;
}
.card__cover {
  position: relative; aspect-ratio: 4 / 5; border-radius: 18px; overflow: hidden;
  border: 3px solid var(--ink);
  transition: transform .5s var(--ease), box-shadow .5s var(--ease);
  box-shadow: 0 0 0 var(--ink);
  display: grid; place-items: center;
}
.card:hover .card__cover { box-shadow: 14px 14px 0 var(--ink); }
.card__info { display: grid; gap: .2rem; }
.card__info h3 { font-family: var(--f-display); font-weight: 700; font-size: clamp(1.1rem, 1.8vw, 1.6rem); letter-spacing: -.02em; }
.card__tags { }

/* Real project covers */
.card__cover img { display: block; pointer-events: none; }
.card__cover--contain img { width: 100%; height: auto; max-height: 70%; object-fit: contain; transition: transform .6s var(--ease); }
.card__cover--cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.card:hover .card__cover img { transform: scale(1.06); }
/* Text wordmark for projects without a logo (logo: "") */
.card__wordmark {
  font-family: var(--f-display); font-weight: 900; text-align: center;
  font-size: clamp(2rem, 4.2vw, 4rem); line-height: .9; letter-spacing: -.05em;
  padding: 0 8%; transition: transform .6s var(--ease);
}
.card:hover .card__wordmark { transform: scale(1.06); }

/* CSS-art covers (unused fallbacks) */
.cover--1 { background: linear-gradient(140deg, var(--acid), #9cf06b 60%, #47d1a8); }
.phone {
  width: 44%; aspect-ratio: 9 / 19; border-radius: 28px; background: var(--ink);
  border: 6px solid var(--ink); display: grid; gap: 8px; padding: 22% 10% 10%;
  align-content: start; transform: rotate(-8deg);
  box-shadow: 20px 30px 0 rgba(10, 10, 12, .25);
}
.phone span { display: block; height: 18%; min-height: 34px; border-radius: 10px; background: var(--violet); }
.phone span:nth-child(2) { background: var(--pink); height: 30%; min-height: 60px; }
.phone span:nth-child(3) { background: var(--paper); }
.cover--2 { background: var(--ink); }
.dots {
  position: absolute; inset: 0;
  background: radial-gradient(circle, var(--pink) 22%, transparent 24%) 0 0 / 46px 46px;
  animation: drift 8s linear infinite;
}
@keyframes drift { to { background-position: 46px 46px; } }
.cover__type {
  position: relative; font-family: var(--f-display); font-weight: 900; font-size: clamp(2.4rem, 5vw, 4.5rem);
  color: var(--paper); background: var(--ink); padding: .1em .3em; letter-spacing: -.04em;
}
.cover--3 { background: var(--orange); }
.poster {
  font-family: var(--f-display); font-weight: 900; color: var(--ink);
  font-size: clamp(3.4rem, 8vw, 7.5rem); line-height: .82; letter-spacing: -.07em; text-align: left;
  transform: rotate(-6deg);
}
.cover--4 { background: repeating-linear-gradient(-45deg, var(--pink) 0 24px, var(--ink) 24px 48px); }
.cover__type--big { font-size: clamp(2.2rem, 4.6vw, 4.2rem); line-height: .9; background: var(--acid); color: var(--ink); }
.cover--5 { background: var(--paper); }
.bars { display: flex; align-items: flex-end; gap: 8%; width: 70%; height: 60%; }
.bars i { flex: 1; background: var(--violet); border-radius: 8px 8px 0 0; border: 3px solid var(--ink); animation: bar 2.4s var(--ease) infinite alternate; }
.bars i:nth-child(1) { height: 30%; } .bars i:nth-child(2) { height: 60%; animation-delay: .2s; background: var(--pink); }
.bars i:nth-child(3) { height: 45%; animation-delay: .4s; } .bars i:nth-child(4) { height: 90%; animation-delay: .6s; background: var(--acid); }
.bars i:nth-child(5) { height: 70%; animation-delay: .8s; } .bars i:nth-child(6) { height: 100%; animation-delay: 1s; background: var(--orange); }
@keyframes bar { to { transform: scaleY(.6); transform-origin: bottom; } }

.card--cta {
  aspect-ratio: 4 / 5; align-self: start; border-radius: 18px; background: var(--ink);
  padding: 2rem; display: flex; flex-direction: column; justify-content: space-between;
  font-family: var(--f-display); font-weight: 800; font-size: clamp(1.8rem, 3.4vw, 3.2rem);
  line-height: .95; letter-spacing: -.04em;
}
.card--cta em { color: var(--acid); }
.card--cta__arrow { font-size: 4rem; align-self: flex-end; transition: transform .5s var(--ease); }
.card--cta:hover .card--cta__arrow { transform: translateX(12px) rotate(-45deg); }

@media (max-width: 860px) {
  .work__pin { padding: 14vw 0; min-height: 0; }
  .work__rail { flex-direction: column; align-items: stretch; width: 100%; gap: 8vw; }
  .work__head { width: auto; padding-right: var(--gutter); }
  .work__track {
    overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 1rem;
    padding-left: 0; scrollbar-width: none;
  }
  .work__track::-webkit-scrollbar { display: none; }
  .card { width: 78vw; scroll-snap-align: start; }
  .card:hover .card__cover { box-shadow: none; }
}

/* ---------- Podcast ---------- */
.podcast { background: var(--acid); color: var(--ink); padding: 10vw var(--gutter); }
.onair {
  display: inline-flex; align-items: center; gap: .6rem;
  background: var(--ink); color: var(--acid); padding: .6rem 1.1rem; border-radius: 99px;
  font-weight: 700; font-size: .9rem;
}
.onair__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 0 0 var(--pink); animation: pulse 1.6s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 12px rgba(255, 62, 138, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 62, 138, 0); } }
.podcast__title {
  font-family: var(--f-display); font-weight: 900;
  font-size: clamp(2.8rem, 10vw, 10rem); line-height: .88; letter-spacing: -.055em;
}
.podcast__title em { font-weight: 200; }
.player {
  display: grid; grid-template-columns: auto 1fr; gap: clamp(1rem, 3vw, 2.5rem); align-items: center;
  margin: 6vw 0 4vw; padding: clamp(1rem, 2.5vw, 2rem);
  background: var(--ink); color: var(--paper); border-radius: 24px;
  box-shadow: 14px 14px 0 var(--violet);
}
.player__btn {
  width: clamp(72px, 9vw, 120px); aspect-ratio: 1; border-radius: 50%;
  background: var(--pink); color: var(--ink); display: grid; place-items: center;
  transition: background .3s;
}
.player__btn svg { width: 38%; fill: currentColor; }
.player__btn .i-pause, .player.is-playing .i-play { display: none; }
.player.is-playing .i-pause { display: block; }
.player.is-playing .player__btn { background: var(--acid); }
.player__body { min-width: 0; }
.player__meta { display: flex; justify-content: space-between; gap: 1rem; opacity: .7; }
.player__wave { display: block; width: 100%; height: clamp(60px, 9vw, 120px); margin: .8rem 0; }
.player__ep { font-family: var(--f-display); font-weight: 600; font-size: clamp(1rem, 1.8vw, 1.5rem); letter-spacing: -.02em; line-height: 1.2; }
.episodes { border-top: 2px solid var(--ink); }
.episodes li {
  display: grid; grid-template-columns: 6rem 1fr auto; gap: 1rem; align-items: center;
  padding: 1.2rem 0; border-bottom: 2px solid var(--ink);
  font-family: var(--f-display); font-weight: 600; font-size: clamp(1rem, 2vw, 1.6rem); letter-spacing: -.02em;
  transition: padding .4s var(--ease), background .3s;
}
.episodes li:hover { padding-left: 1rem; padding-right: 1rem; background: var(--ink); color: var(--acid); }
.podcast__links { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 3rem; }
.pill {
  display: inline-block; padding: .9rem 1.5rem; border-radius: 99px; border: 2px solid var(--ink);
  font-family: var(--f-mono); font-weight: 700; text-transform: uppercase; font-size: .85rem;
  transition: background .3s, color .3s;
}
.pill:hover { background: var(--ink); color: var(--acid); }
@media (max-width: 600px) {
  .player { grid-template-columns: 1fr; }
  .episodes li { grid-template-columns: 1fr auto; }
  .episodes li span:first-child { grid-column: 1 / -1; }
}

/* ---------- Photo ---------- */
.photo {
  position: relative; min-height: 110vh; overflow: hidden;
  background: var(--ink); padding: 10vw var(--gutter);
  display: grid; align-items: center;
}
.photo__trail { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.photo__trail img {
  position: absolute; top: 0; left: 0;
  width: clamp(140px, 18vw, 280px); aspect-ratio: 3 / 4; object-fit: cover;
  border: 6px solid var(--paper); border-bottom-width: 26px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .5);
  opacity: 0; will-change: transform, opacity;
}
.photo__content { position: relative; z-index: 2; text-align: center; mix-blend-mode: difference; pointer-events: none; }
.photo__title {
  font-family: var(--f-display); font-weight: 900; margin: 1.5rem 0;
  font-size: clamp(2.6rem, 9vw, 9rem); line-height: .88; letter-spacing: -.055em;
}
.photo__title em { font-weight: 200; }
.photo__hint, .photo__counter { opacity: .75; }
.photo__counter { margin-top: .6rem; }

/* ---------- Contact ---------- */
.contact { background: var(--pink); color: var(--ink); padding: 10vw var(--gutter) 6vw; overflow: hidden; }
.contact__title {
  display: grid; margin: 2rem 0 5vw;
  font-family: var(--f-display); font-weight: 900;
  font-size: clamp(2.4rem, 10.4vw, 11.5rem); line-height: .88; letter-spacing: -.06em;
}
.contact__title > span { display: block; overflow: hidden; white-space: nowrap; }
.contact__title > span:nth-child(2) { -webkit-text-stroke: .025em var(--ink); color: transparent; padding-left: 8vw; }
.contact__title > span:nth-child(3) { text-align: right; padding-right: .06em; }
.contact__row { display: flex; align-items: center; gap: clamp(1.5rem, 5vw, 5rem); flex-wrap: wrap; }
.contact__btn {
  width: clamp(150px, 18vw, 240px); aspect-ratio: 1; border-radius: 50%;
  background: var(--ink); color: var(--acid); display: grid; place-items: center;
  font-family: var(--f-display); font-weight: 800; font-size: clamp(1.1rem, 1.8vw, 1.6rem);
  transition: background .3s, color .3s;
}
.contact__btn:hover { background: var(--acid); color: var(--ink); }
.contact__info { display: grid; gap: 1rem; min-width: 0; }
.contact__mail {
  font-family: var(--f-display); font-weight: 700; font-size: clamp(1.1rem, 3.4vw, 3rem);
  letter-spacing: -.03em; word-break: break-all;
  background: linear-gradient(var(--ink), var(--ink)) 0 100% / 0 3px no-repeat;
  transition: background-size .6s var(--ease);
}
.contact__mail:hover { background-size: 100% 3px; }
.contact__socials { display: flex; flex-wrap: wrap; gap: 1.5rem; }
.contact__socials a:hover { text-decoration: underline; }

/* ---------- Footer ---------- */
.footer {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 1.5rem var(--gutter); background: var(--ink);
}
.footer a { display: inline-block; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .manifesto__text .w { opacity: 1; }
}

/* =========================================================
   PAGE TRANSITION CURTAIN (home + case studies)
   ========================================================= */
.curtain {
  position: fixed; inset: 0; z-index: 950; pointer-events: none;
  background: var(--ink);
  transform: translateY(100%);
}
.curtain.is-covering { transform: translateY(0); }

/* =========================================================
   CASE STUDY PAGE
   ========================================================= */
/* defaults on :root, so the per-project values set on <html> by project.js win */
:root { --accent: var(--acid); --accent-ink: var(--ink); --accent-on-dark: var(--acid); --next: var(--violet); --next-ink: var(--paper); }

/* Hero */
.p-hero {
  min-height: 100svh; display: grid; grid-template-rows: auto 1fr auto; grid-template-columns: minmax(0, 1fr); gap: 2rem;
  padding: 96px var(--gutter) var(--gutter);
  background: var(--accent); color: var(--accent-ink);
}
.p-hero__top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.p-back {
  display: inline-block; padding: .55rem 1rem; border: 1px solid currentColor; border-radius: 99px;
  transition: background .3s, color .3s;
}
.p-back:hover { background: var(--accent-ink); color: var(--accent); }
.p-title {
  align-self: center;
  font-family: var(--f-display); font-weight: 900;
  line-height: .86; letter-spacing: -.055em;
  font-size: 12vw;
}
.p-title__line { display: block; overflow: hidden; padding-bottom: .05em; }
.p-title__inner { display: inline-block; white-space: nowrap; }
.p-hero__bottom {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(1.5rem, 5vw, 5rem); align-items: end;
}
.p-headline {
  font-family: var(--f-display); font-weight: 400;
  font-size: clamp(1.3rem, 2.6vw, 2.4rem); line-height: 1.1; letter-spacing: -.03em;
}
.p-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem 2rem; }
.p-facts div { border-top: 1.5px solid currentColor; padding-top: .6rem; min-width: 0; }
.p-facts dt { font-family: var(--f-mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.p-facts dd { font-weight: 500; margin-top: .2rem; overflow-wrap: anywhere; }
.p-facts a { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 860px) {
  .p-hero__bottom { grid-template-columns: 1fr; }
}
@media (max-width: 480px) { .p-facts { grid-template-columns: 1fr; } }

/* Cover */
.p-cover {
  position: relative; overflow: hidden; height: 100vh; max-height: 1100px;
  background: var(--ink);
  display: grid; place-items: center;
}
.p-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.p-cover--logo img { width: min(70%, 640px); height: auto; object-fit: contain; }
@media (max-width: 760px) { .p-cover { height: 70vh; } }

/* Metrics */
.p-metrics {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  background: var(--ink); color: var(--paper);
  border-bottom: 1px solid var(--line);
}
.p-metric { padding: clamp(2rem, 5vw, 4.5rem) var(--gutter); border-right: 1px solid var(--line); }
.p-metric strong {
  display: block; font-family: var(--f-display); font-weight: 900; color: var(--accent);
  font-size: clamp(4rem, 11vw, 10rem); line-height: .9; letter-spacing: -.06em;
}
.page-project .p-metric strong { color: var(--accent-on-dark); }
.p-metric span { display: block; margin-top: 1rem; max-width: 26ch; }

/* Intro */
.p-intro { background: var(--paper); color: var(--ink); padding: 10vw var(--gutter) 6vw; }
.p-label { margin-bottom: 2rem; }
.p-intro__text {
  font-family: var(--f-display); font-weight: 500;
  font-size: clamp(1.5rem, 3.6vw, 3.6rem); line-height: 1.1; letter-spacing: -.035em; max-width: 32ch;
}
.p-intro__text em { font-weight: 200; }
.p-intro__text .w { display: inline-block; }

/* Sections */
.p-sections { background: var(--paper); color: var(--ink); padding: 0 var(--gutter) 8vw; }
.p-sec {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: clamp(1.5rem, 5vw, 6rem);
  padding: clamp(2.5rem, 6vw, 6rem) 0; border-top: 2px solid var(--ink);
}
.p-sec__head { align-self: start; position: sticky; top: 100px; }
.p-sec__head h2 {
  font-family: var(--f-display); font-weight: 800; margin-top: .8rem;
  font-size: clamp(2rem, 4.4vw, 4.4rem); line-height: .95; letter-spacing: -.045em;
}
.p-sec__body > p { font-size: clamp(1.05rem, 1.35vw, 1.3rem); line-height: 1.55; max-width: 62ch; }
.p-sec__body > p + p { margin-top: 1.2rem; }
.p-list { margin-top: 2rem; border-top: 1px solid rgba(10,10,12,.2); }
.p-sec__body > .p-list:first-child { margin-top: 0; }
.p-list li {
  position: relative; isolation: isolate;
  display: grid; grid-template-columns: 3rem 1fr; gap: 1rem;
  padding: 1.3rem .2rem; border-bottom: 1px solid rgba(10,10,12,.2);
  transition: padding .45s var(--ease), color .3s;
}
.p-list li::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--accent);
  transform: scaleX(0); transform-origin: left; transition: transform .55s var(--ease);
}
.p-list li:hover { padding-left: 1.2rem; color: var(--accent-ink); }
.p-list li:hover::before { transform: scaleX(1); }
.p-list li > .mono { padding-top: .35rem; }
.p-list strong {
  display: block; font-family: var(--f-display); font-weight: 700;
  font-size: clamp(1.05rem, 1.6vw, 1.45rem); line-height: 1.2; letter-spacing: -.02em;
}
.p-list span { display: block; margin-top: .45rem; line-height: 1.55; max-width: 62ch; }
@media (max-width: 860px) {
  .p-sec { grid-template-columns: 1fr; }
  .p-sec__head { position: static; }
}

/* Gallery */
.p-gallery { background: var(--ink); padding: 10vw var(--gutter); }
.p-gallery__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 5vw; }
.p-gallery__head .section-title em { color: var(--accent-on-dark); }
.p-gallery__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1rem, 2.5vw, 2.5rem); }
.p-shot { cursor: zoom-in; }
.p-shot--wide { grid-column: 1 / -1; }
.p-shot__img { overflow: hidden; border-radius: 18px; background: var(--ink-2); }
.p-shot__img img { display: block; width: 100%; height: auto; transition: filter .4s; }
.p-shot:hover .p-shot__img img { filter: brightness(1.08); }
.p-shot figcaption { display: flex; gap: 1rem; margin-top: .9rem; color: #C9C6BE; } /* 12:1 on ink */
.p-shot figcaption span { color: var(--accent-on-dark); }
@media (max-width: 700px) { .p-gallery__grid { grid-template-columns: 1fr; } }

/* Embed */
.p-embed { background: var(--ink); padding: 0 var(--gutter) 10vw; }
.p-embed__frame { aspect-ratio: 16 / 10; border-radius: 18px; overflow: hidden; border: 1px solid var(--line); }
.p-embed__frame iframe { width: 100%; height: 100%; border: 0; display: block; }
@media (max-width: 700px) { .p-embed__frame { aspect-ratio: 3 / 4; } }

/* Next project */
.p-next {
  position: relative; display: grid; gap: 1.2rem; overflow: hidden;
  padding: 12vw var(--gutter); min-height: 80vh; align-content: center;
  background: var(--next); color: var(--next-ink);
}
.p-next__title {
  font-family: var(--f-display); font-weight: 900; display: block;
  font-size: clamp(3rem, 13vw, 14rem); line-height: .86; letter-spacing: -.06em;
  transition: letter-spacing .6s var(--ease);
  position: relative; z-index: 1; mix-blend-mode: normal;
}
.p-next:hover .p-next__title { letter-spacing: -.02em; }
.p-next__img {
  position: absolute; top: 0; left: 0; z-index: 2; pointer-events: none;
  width: clamp(220px, 26vw, 400px); aspect-ratio: 4 / 3; object-fit: cover;
  margin: -150px 0 0 -200px; border-radius: 16px; border: 3px solid var(--ink);
  box-shadow: 14px 14px 0 var(--ink);
  opacity: 0; transform: scale(.3);
}
.p-next__img.is-logo { object-fit: contain; padding: 8%; }
@media (hover: none) { .p-next__img { display: none; } }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 980;
  background: rgba(10, 10, 12, .94); backdrop-filter: blur(6px);
  display: grid; place-items: center; padding: 64px var(--gutter);
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 160px); border-radius: 12px; object-fit: contain; }
.lightbox__close {
  position: absolute; top: 18px; right: var(--gutter);
  padding: .55rem 1rem; border: 1px solid var(--paper); border-radius: 99px;
}
.lightbox__cap { position: absolute; bottom: 20px; left: 0; right: 0; text-align: center; }

/* Returning visit: no loader, the curtain reveals the page instead */
.is-return .loader { display: none; }
.is-return .page-home .curtain, .is-return body:not(.page-project) .curtain { transform: translateY(0); }

/* =========================================================
   WRITE-TO-ME DIALOG (Say hi)
   Contrast: paper on ink 17:1 · ink on acid 17:1 · #C9C6BE on ink-2 10:1
   ========================================================= */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.mailer {
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px);
  margin: auto; padding: clamp(1.4rem, 4vw, 2.2rem);
  background: var(--ink); color: var(--paper);
  border: 3px solid var(--acid); border-radius: 24px;
  box-shadow: 12px 12px 0 var(--pink);
}
.mailer::backdrop { background: rgba(10, 10, 12, .78); backdrop-filter: blur(4px); }
.mailer[open] { animation: mailer-in .45s var(--ease); }
@keyframes mailer-in { from { opacity: 0; transform: translateY(24px) scale(.96); } }
.mailer__head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.mailer__title {
  font-family: var(--f-display); font-weight: 900;
  font-size: clamp(2rem, 6vw, 3rem); line-height: 1; letter-spacing: -.04em;
}
.mailer__title em { font-style: normal; }
.mailer__close { padding: .55rem 1rem; border: 1px solid var(--paper); border-radius: 99px; color: var(--paper); }
.mailer__close:hover, .mailer__close:focus-visible { background: var(--paper); color: var(--ink); }
.mailer__text { margin: 1rem 0 1.4rem; }
.mailer__options { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.mailer__opt {
  display: grid; gap: .3rem; text-align: left; width: 100%;
  padding: 1rem 1.1rem; border-radius: 16px;
  background: var(--ink-2); color: var(--paper); border: 1px solid var(--line);
  font-family: var(--f-display); font-weight: 700; font-size: 1.1rem; letter-spacing: -.02em;
  transition: background .25s, color .25s, transform .4s var(--ease);
}
.mailer__opt .mono { font-weight: 400; color: #C9C6BE; letter-spacing: .02em; }
.mailer__opt:hover, .mailer__opt:focus-visible { background: var(--acid); color: var(--ink); transform: translateY(-3px); }
.mailer__opt:hover .mono, .mailer__opt:focus-visible .mono { color: var(--ink); }
.mailer__status { min-height: 1.2em; margin-top: 1rem; color: var(--acid); }
.mailer :focus-visible { outline: 3px solid var(--acid); outline-offset: 3px; }
@media (max-width: 480px) { .mailer__options { grid-template-columns: 1fr; } }
@media (hover: hover) and (pointer: fine) { .mailer, .mailer * { cursor: auto; } .mailer a, .mailer button { cursor: pointer; } }
