/* ===== Atelier Digitale Côte Bleu — Klein blue art-print edition ===== */

:root {
  --cream: #f2ece1;
  --cream-soft: #eae2d2;
  --klein: #1f3fd8;
  --klein-deep: #0034d3;
  --navy: #003087;
  --ink: #101a3c;
  --vista: #afc8f7;
  --crab: #ff69b4;
  --butter: #e9a23b;
  --serif: 'Gloock', serif;
  --hand: 'Mansalva', cursive;
  --sans: 'Space Grotesk', sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  font-weight: 400;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--klein); color: var(--cream); }

.hand {
  font-family: var(--hand);
  font-style: normal;
  font-weight: 400;
  color: var(--klein);
}

/* paper grain */
.noise {
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
  opacity: 0.6;
  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='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.06'/%3E%3C/svg%3E");
}

/* scroll progress */
.progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 100%;
  z-index: 90;
  background: var(--klein);
  transform-origin: 0 50%;
  transform: scaleX(0);
}

/* ===== nav ===== */
.nav {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.1rem 4vw;
  border-bottom: 1px solid rgba(0, 48, 135, 0.25);
}

.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--ink);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text span {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.brand-text em {
  font-family: var(--hand);
  font-style: normal;
  font-size: 1.65rem;
  color: var(--klein);
}

.nav-links { display: flex; gap: 1.9rem; }
.nav-links a {
  position: relative;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0; bottom: -5px;
  width: 100%; height: 3px;
  background: var(--klein);
  border-radius: 3px;
  transform: scaleX(0) rotate(-1.2deg);
  transform-origin: 100% 50%;
  transition: transform 0.4s var(--ease-out);
}
.nav-links a:hover::after { transform: scaleX(1) rotate(-1.2deg); transform-origin: 0 50%; }

.nav-right { display: flex; align-items: center; gap: 1.1rem; }

.lang-switch {
  display: flex;
  border: 2px solid var(--ink);
  border-radius: 999px;
  overflow: hidden;
}
.lang-switch button {
  font-family: var(--sans);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  background: transparent;
  border: none;
  color: var(--ink);
  cursor: pointer;
  padding: 0.32rem 0.7rem;
  transition: background 0.25s ease, color 0.25s ease;
}
.lang-switch button.active { background: var(--klein); color: var(--cream); }
.lang-switch button:not(.active):hover { background: rgba(31, 63, 216, 0.12); }

.nav-cta {
  font-family: var(--hand);
  font-size: 1.05rem;
  color: var(--cream);
  text-decoration: none;
  background: var(--klein);
  border: 2px solid var(--navy);
  border-radius: 999px;
  padding: 0.3rem 1.1rem;
  box-shadow: 3px 3px 0 var(--navy);
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out);
}
.nav-cta:hover { transform: translate(-2px, -2px) rotate(-1.5deg); box-shadow: 5px 5px 0 var(--navy); }

/* ===== hero ===== */
.hero {
  position: relative;
  min-height: calc(100svh - 96px);
  display: flex;
  align-items: center;
  padding: 8rem 6vw 3.5rem;
  overflow: hidden;
}
.hero-inner { position: relative; max-width: 62rem; z-index: 2; }
.hero-stack { position: relative; }
.hero-stack .hero { position: relative; z-index: 1; }
.hero-stack .marquee { position: relative; z-index: 1; }
.hero-halftone {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;                 /* behind the hero text and behind the blue wave */
  pointer-events: none;
}
@media (max-width: 860px) { .hero-halftone { display: none; } }

/* the big drawn meander */

.eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--klein-deep);
  margin-bottom: 1.6rem;
}
.eyebrow-light { color: var(--vista); }

.hero h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(3rem, 8.6vw, 7rem);
  line-height: 0.98;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}
.h1-hand {
  display: inline-block;
  font-family: var(--hand);
  font-size: clamp(2rem, 5vw, 3.9rem);
  text-transform: none;
  color: var(--klein);
  transform: rotate(-2.5deg);
  margin-top: 0.6rem;
}

.hero-sub {
  max-width: 30rem;
  margin-top: 1.9rem;
  font-size: 1.05rem;
  color: var(--ink);
  opacity: 0.85;
}

.hero-actions {
  display: flex;
  gap: 1.1rem;
  flex-wrap: wrap;
  margin-top: 2.5rem;
}
.fade-up {
  opacity: 0;
  animation: fade-up 0.9s var(--ease-out) 0.62s forwards;
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(26px); }
  to { opacity: 1; transform: translateY(0); }
}

.btn {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-decoration: none;
  padding: 0.9rem 1.9rem;
  border-radius: 999px;
  border: 2px solid var(--navy);
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out), background 0.25s ease, color 0.25s ease;
}
.btn-solid {
  background: var(--klein);
  color: var(--cream);
  box-shadow: 5px 5px 0 var(--navy);
}
.btn-line {
  background: transparent;
  color: var(--navy);
  box-shadow: 5px 5px 0 rgba(0, 48, 135, 0.25);
}
.btn:hover { transform: translate(-3px, -3px) rotate(-1deg); box-shadow: 8px 8px 0 var(--navy); }
.btn-line:hover { background: var(--vista); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--navy); }
.btn-big {
  font-size: clamp(1rem, 2.4vw, 1.45rem);
  padding: 1.1rem 2.4rem;
  margin-top: 2.6rem;
}

/* staggered entrance */
.line-reveal { display: block; overflow: hidden; }
.line-reveal > span,
.line-reveal > * {
  display: inline-block;
  transform: translateY(115%);
  animation: line-up 1s var(--ease-out) forwards;
}
.hero h1 .line-reveal:nth-child(1) > * { animation-delay: 0.12s; }
.hero h1 .line-reveal:nth-child(2) > * { animation-delay: 0.24s; }
.eyebrow.line-reveal > * { animation-delay: 0.04s; }
.hero-sub.line-reveal > * { animation-delay: 0.5s; }
@keyframes line-up { to { transform: translateY(0); } }

.pop-in {
  opacity: 0;
  animation: pop 0.7s var(--ease-out) 0.55s forwards;
}
@keyframes pop {
  0% { opacity: 0; transform: rotate(-2.5deg) scale(0.6); }
  70% { transform: rotate(-2.5deg) scale(1.06); }
  100% { opacity: 1; transform: rotate(-2.5deg) scale(1); }
}

/* ===== marquee : wavy blue ribbon ===== */
.marquee {
  overflow: hidden;
  line-height: 0;
  background: transparent;
}
.marquee-wave {
  display: block;
  width: 100%;
  height: auto;
}
.marquee-fill { fill: var(--klein-deep); }
.marquee-wave text {
  font-family: var(--hand);
  font-size: 44px;
  fill: var(--cream);
  letter-spacing: 0.01em;
  dominant-baseline: middle;
}

/* ===== sections ===== */
.section {
  position: relative;
  padding: 8rem 6vw;
}
.section-head { max-width: 48rem; margin-bottom: 3.2rem; }
.section-head .eyebrow { margin-bottom: 1rem; }
.section-head h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  line-height: 1.04;
  text-transform: uppercase;
}
.section-head h2 .hand {
  display: inline-block;
  font-size: 0.82em;
  text-transform: none;
  transform: rotate(-2deg);
}

/* scroll reveals — slight tilt settle */
.reveal {
  opacity: 0;
  transform: translateY(34px) rotate(0.8deg);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}
.reveal.in { opacity: 1; transform: translateY(0) rotate(0deg); }

/* ===== services : fanned cards ===== */
.chips {
  list-style: none;
  display: flex;
  gap: 1.6rem;
  align-items: stretch;
  width: 100%;
  max-width: 86rem;
  margin: 0 auto;
  padding: 3.5rem 0 1.5rem;
}
.chip {
  position: relative;
  overflow: hidden;
  flex: 1 1 0;
  min-width: 0;
  min-height: 480px;
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  padding: 2.4rem 1.7rem 2.4rem;
  border: 2px solid var(--ink);
  box-shadow: 6px 8px 0 rgba(16, 26, 60, 0.85);
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
  cursor: default;
}
/* cream halftone dissolving out of a corner — echoes the studio shore */
.chip::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  background: radial-gradient(circle, var(--cream) 27%, transparent 29%) 0 0 / 9px 9px;
  -webkit-mask: radial-gradient(135% 100% at 100% 100%, #000 4%, transparent 46%);
          mask: radial-gradient(135% 100% at 100% 100%, #000 4%, transparent 46%);
  opacity: 0.5;
  pointer-events: none;
}
.chips .chip:nth-child(2)::after {
  -webkit-mask: radial-gradient(135% 100% at 0% 0%, #000 4%, transparent 46%);
          mask: radial-gradient(135% 100% at 0% 0%, #000 4%, transparent 46%);
}
.chip > * { position: relative; z-index: 1; }   /* keep text above the dot layer */
.chip:hover {
  transform: translateY(-7px);
  box-shadow: 8px 12px 0 rgba(16, 26, 60, 0.85);
}
.chip.reveal { opacity: 0; }
.chip.reveal.in { opacity: 1; }

.chip h3 {
  font-family: var(--hand);
  font-weight: 400;
  font-size: clamp(1.4rem, 1.9vw, 1.95rem);
  line-height: 1.05;
  margin-bottom: 1.5rem;
  color: inherit;
}
.chip-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.chip-list li {
  position: relative;
  padding-left: 1.2rem;
  font-size: 0.98rem;
  font-weight: 500;
  line-height: 1.35;
  color: inherit;
}
.chip-list li::before {
  content: '✳';
  position: absolute;
  left: 0;
  top: 0.05em;
  font-size: 0.72em;
  opacity: 0.85;
}

/* one blue family — alternating deep / bright / deep for gentle rhythm */
.chip-deep   { background: var(--klein-deep); color: var(--cream); }
.chip-crab   { background: var(--klein);      color: var(--cream); }
.chip-butter { background: var(--klein-deep); color: var(--cream); }
.chip-vista  { background: var(--vista);      color: var(--navy); }

/* hand-made watercolour stickers, slapped in a corner */
.chip-sticker {
  position: absolute;
  z-index: 2;
  width: clamp(150px, 38%, 210px);
  height: auto;
  right: 4%;
  bottom: 4%;
  filter: drop-shadow(3px 5px 5px rgba(16, 26, 60, 0.35));
  pointer-events: none;
}
.chips .chip:nth-child(1) .chip-sticker { transform: rotate(6deg); }
.chips .chip:nth-child(2) .chip-sticker { transform: rotate(-7deg); }
.chips .chip:nth-child(3) .chip-sticker { transform: rotate(5deg); }

/* "learn more" pill button on each card */
.chip-cta {
  position: relative;
  z-index: 1;
  margin-top: auto;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: var(--cream);
  color: var(--klein-deep);
  border: none;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.7rem 1.4rem;
  box-shadow: 3px 4px 0 rgba(8, 14, 44, 0.45);
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out);
}
.chip-cta:hover { transform: translateY(-2px); box-shadow: 4px 7px 0 rgba(8, 14, 44, 0.5); }
.chip-cta:active { transform: translateY(0); box-shadow: 2px 3px 0 rgba(8, 14, 44, 0.5); }

/* service detail modal (smaller than the case-study panels) */
.modal-panel.modal-svc { width: min(92vw, 560px); height: auto; max-height: 86vh; }
.modal-svc .modal-pad { padding: 2.6rem 2.6rem 2.8rem; }
.svc-detail {
  list-style: none;
  margin: 1.7rem 0 2.2rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.svc-detail li {
  position: relative;
  padding-left: 1.5rem;
}
.svc-detail li::before {
  content: '✳';
  position: absolute;
  left: 0;
  top: 0.15em;
  color: var(--klein);
  font-size: 0.8em;
}
.svc-detail li strong { display: block; font-weight: 700; font-size: 1.02rem; color: var(--ink); }
.svc-detail li span { display: block; margin-top: 0.12rem; font-size: 0.92rem; line-height: 1.45; color: var(--ink); opacity: 0.62; }

/* ===== work : case-study feature ===== */
.work-feature {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  border: 2px solid var(--ink);
  border-radius: 24px;
  box-shadow: 6px 8px 0 rgba(16, 26, 60, 0.85);
  overflow: hidden;
  background: var(--cream);
}
.work-feature-media {
  display: block;
  width: 100%;
  min-height: 460px;
  background: #1a1a18;
  border: none;
  border-right: 2px solid var(--ink);
  padding: 0;
  cursor: pointer;
  overflow: hidden;
}
.work-feature-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s var(--ease-out);
}
.work-feature-media:hover img { transform: scale(1.04); }
.work-feature-info {
  padding: 2.8rem 2.6rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
}
.work-feature-cat {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--klein);
}
.work-title-hand {
  font-family: var(--hand);
  font-weight: 400;
  line-height: 1;
  color: inherit;
}
.work-feature .work-title-hand {
  font-size: clamp(2.4rem, 4vw, 3.4rem);
  color: var(--klein);
}
.work-feature-desc {
  font-size: 1.02rem;
  line-height: 1.6;
  color: var(--ink);
  max-width: 34rem;
}
.tags {
  list-style: none;
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-top: 0.4rem;
}
.tags li {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--navy);
  border: 2px solid var(--navy);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
}
.work-feature .btn { align-self: flex-start; margin-top: 1.2rem; }
@media (max-width: 760px) {
  .work-feature { grid-template-columns: 1fr; }
  .work-feature-media { min-height: 240px; border-right: none; border-bottom: 2px solid var(--ink); }
  .work-feature-info { padding: 2rem 1.6rem; }
  /* keep image on top when stacked */
  .work-feature-rev .work-feature-media { order: 1; border-left: none; border-bottom: 2px solid var(--ink); }
  .work-feature-rev .work-feature-info { order: 2; }
}

/* ===== studio : Klein blue block ===== */
.studio { position: relative; margin-top: -2px; background: var(--klein-deep); color: var(--cream); }
/* services follows the dissolve directly — trim its top padding so the cream gap stays tight */
#services { padding-top: 3.5rem; padding-bottom: 4rem; }
/* tighten the cream gap between the services cards and the work section */
#work { padding-top: 4rem; }

/* halftone size-gradient dissolve along the bottom: solid blue -> shrinking dots -> wavy shore.
   Rendered on a canvas (.studio-dissolve) because CSS can't vary dot size smoothly. */
.studio-dissolve {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -8px;             /* overlap into the cream so the solid end merges seamlessly */
  width: 100%;
  height: 320px;            /* long, gradual gradient — first faint dots high, solid cream low */
  z-index: 1;               /* above the blue, below the studio content */
  pointer-events: none;
}

.studio-inner { position: relative; z-index: 2; padding-top: 6rem; padding-bottom: 16rem; }
.studio-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 5rem;
  align-items: start;       /* content sits high, clear of the halftone at the bottom */
}
.studio .section-head { margin-bottom: 0; }
.studio .section-head h2 { color: var(--cream); }
.studio .section-head h2 .hand { color: var(--vista); display: block; margin-top: 0.1rem; }
.studio-text { margin-top: 0.9rem; max-width: 36rem; line-height: 1.6; opacity: 0.92; }
.studio-text + .studio-text { margin-top: 0.7rem; }
.studio-tags {
  margin-top: 1.8rem;
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--vista);
}

/* studio photo — framed, sea-glass look */
.studio-photo-frame {
  position: relative;
  margin: 0;
  align-self: center;
  justify-self: center;
  width: 100%;
  max-width: 600px;
  aspect-ratio: 3 / 4;          /* taller frame — room for big, non-overlapping stickers */
}
.studio-photo {
  position: absolute;
  display: block;
  width: 74%;
  border-radius: 14px;
  border: 7px solid var(--cream);
  box-shadow: 8px 10px 0 rgba(16, 26, 60, 0.5);
}
.studio-photo-back  { top: 0;    left: 0;  transform: rotate(-5deg);  z-index: 1; }
.studio-photo-front { bottom: 0; right: 0; transform: rotate(4.5deg); z-index: 2; }

/* watercolour sticker collage (replaces the photos) — scattered trio */
.studio-stickers .studio-sticker {
  position: absolute;
  height: auto;
  filter: drop-shadow(5px 7px 7px rgba(8, 14, 44, 0.32));
}
/* loose triangle, evenly spread — apex top-right, wide base below; no edge-crowd, no diagonal line */
/* mockup layout: oyster top-right, big heron standing in the centre, dill bottom-right */
.s-oyster { width: 80%; left: 10%;  top: -15%; transform: rotate(28deg); z-index: 2; }
.s-heron  { width: 88%; left: -50%; top: 24%;  transform: rotate(14deg); z-index: 3; }
.s-dill   { width: 76%; left: 21%;  top: 49%;  transform: rotate(34deg); z-index: 1; }

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.2rem 2rem;
  padding-top: 0.6rem;
}
.stat {
  border-top: 2px solid rgba(242, 236, 225, 0.35);
  padding-top: 1.2rem;
}
.stat dt {
  font-family: var(--hand);
  font-size: clamp(2.8rem, 4.8vw, 4.2rem);
  color: var(--cream);
  line-height: 1;
}
.stat dd {
  margin-top: 0.4rem;
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--vista);
}

/* ===== contact ===== */
.contact { text-align: center; padding-top: 10rem; padding-bottom: 14rem; }
.contact-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(3.2rem, 11vw, 8.5rem);
  line-height: 0.95;
  text-transform: uppercase;
}
.contact-title .hand {
  display: block;
  font-size: 0.78em;
  text-transform: none;
  transform: rotate(-2.5deg);
  margin-top: 0.5rem;
}
.contact-note { margin-top: 1.6rem; font-size: 0.92rem; opacity: 0.75; }

/* ===== footer ===== */
.footer {
  position: relative;
  background: var(--klein-deep);
  color: var(--cream);
  padding: 3.2rem 6vw 1.8rem;
}
/* halftone wave dissolving the cream contact section into the blue footer */
.footer-dissolve {
  position: absolute;
  left: 0; right: 0;
  top: -200px;              /* extends up into the cream; solid end merges with the footer */
  width: 100%;
  height: 208px;
  z-index: 0;
  pointer-events: none;
}
.footer-grid, .footer-bottom { position: relative; z-index: 1; }
.footer-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.footer-brand {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.footer-brand em { font-size: 1.5rem; letter-spacing: 0; text-transform: none; color: var(--vista); margin-left: 0.3rem; }
.footer-links { list-style: none; display: flex; gap: 1.8rem; }
.footer-links a {
  color: var(--cream);
  text-decoration: none;
  font-size: 0.88rem;
  border-bottom: 2px solid transparent;
  transition: border-color 0.3s ease, color 0.3s ease;
}
.footer-links a:hover { color: var(--vista); border-bottom-color: var(--vista); }
.footer-loc { font-size: 0.88rem; opacity: 0.8; }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2.6rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(242, 236, 225, 0.25);
  font-size: 0.8rem;
  opacity: 0.85;
}
.back-top { color: var(--cream); text-decoration: none; }
.back-top:hover { color: var(--vista); }

/* ===== project case-study modal ===== */
.modal { position: fixed; inset: 0; z-index: 200; display: none; }
.modal.open { display: block; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(16, 26, 60, 0.6); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.modal-panel {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(92vw, 1040px);
  height: min(90vh, 920px);
  background: var(--cream);
  border: 2px solid var(--ink);
  border-radius: 22px;
  box-shadow: 8px 12px 0 rgba(16, 26, 60, 0.85);
  overflow: hidden;
  animation: modal-in 0.35s var(--ease-out);
}
@keyframes modal-in { from { opacity: 0; transform: translate(-50%, -46%); } }
.modal-close {
  position: absolute; top: 1rem; right: 1rem; z-index: 3;
  width: 42px; height: 42px; border-radius: 999px;
  border: 2px solid var(--ink); background: var(--cream); color: var(--ink);
  font-size: 0.95rem; cursor: pointer; display: grid; place-items: center;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
.modal-close:hover { background: var(--klein); color: var(--cream); border-color: var(--klein); }
.modal-scroll { height: 100%; overflow-y: auto; }
.modal-cover { height: 300px; background: #1a1a18; }
.modal-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.modal-pad { padding: 2.4rem 2.6rem 2.8rem; }
.modal-cat { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--klein); }
.modal-title { font-family: var(--hand); font-weight: 400; font-size: clamp(2.4rem, 5vw, 3.4rem); color: var(--klein); line-height: 1; margin: 0.3rem 0 1rem; }
.modal-lead { font-size: 1.1rem; line-height: 1.6; max-width: 46rem; color: var(--ink); }
/* ---- modal content blocks ---- */
.modal-block { margin-top: 3rem; padding-top: 2.4rem; border-top: 1.5px solid rgba(16, 26, 60, 0.14); }
.modal-kicker { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--klein); }
.modal-h { font-family: var(--hand); font-weight: 400; font-size: clamp(1.5rem, 3vw, 2rem); color: var(--ink); line-height: 1.05; margin: 0.45rem 0 0.9rem; }
.modal-block-intro { font-size: 1rem; line-height: 1.6; max-width: 44rem; color: var(--ink); opacity: 0.86; }

/* palette */
.modal-palette { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.7rem; margin-top: 1.6rem; }
.modal-palette .pal { border-radius: 14px; background: var(--c); color: var(--t, #faf9f7); border: 1.5px solid rgba(16, 26, 60, 0.18); min-height: 132px; padding: 0.9rem 0.9rem 1rem; display: flex; flex-direction: column; justify-content: flex-end; }
.modal-palette .pal-lg { min-height: 170px; }
.modal-palette .pal b { font-size: 0.92rem; font-weight: 600; }
.modal-palette .pal i { font-style: normal; font-size: 0.7rem; letter-spacing: 0.04em; opacity: 0.75; }

/* type specimen */
.modal-typespec { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.6rem; }
.modal-typespec .spec { display: flex; align-items: center; gap: 1.2rem; border: 1.5px solid rgba(16, 26, 60, 0.16); border-radius: 16px; padding: 1.3rem 1.4rem; background: #faf9f7; }
.modal-typespec .spec-aa { font-size: 3.4rem; line-height: 0.9; color: var(--ink); }
.modal-typespec .spec-serif .spec-aa { font-family: 'DM Serif Display', serif; }
.modal-typespec .spec-sans .spec-aa { font-family: 'DM Sans', sans-serif; font-weight: 700; }
.modal-typespec .spec-meta { display: flex; flex-direction: column; gap: 0.18rem; }
.modal-typespec .spec-name { font-size: 1.02rem; font-weight: 600; color: var(--ink); }
.modal-typespec .spec-serif .spec-name { font-family: 'DM Serif Display', serif; font-weight: 400; }
.modal-typespec .spec-sans .spec-name { font-family: 'DM Sans', sans-serif; }
.modal-typespec .spec-role { font-size: 0.82rem; color: var(--ink); opacity: 0.6; }
.modal-typespec .spec-glyphs { font-size: 0.82rem; color: var(--ink); opacity: 0.5; margin-top: 0.3rem; letter-spacing: 0.02em; }
.modal-typespec .spec-serif .spec-glyphs { font-family: 'DM Serif Display', serif; }
.modal-typespec .spec-sans .spec-glyphs { font-family: 'DM Sans', sans-serif; }

/* gallery */
.modal-gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-top: 1.6rem; }
.modal-gallery figure { margin: 0; }
.modal-gallery img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; border: 2px solid var(--ink); display: block; aspect-ratio: 3 / 4; }
.modal-gallery .g-wide { grid-column: span 2; }
.modal-gallery .g-wide img { aspect-ratio: 16 / 11; }
.modal-gallery .g-tall { grid-column: span 1; }
.modal-gallery figcaption { font-size: 0.78rem; line-height: 1.4; color: var(--ink); opacity: 0.62; margin-top: 0.5rem; }
/* stacked variant — one image per row, full image shown (no crop) */
.modal-gallery.stack { display: flex; flex-direction: column; gap: 1.6rem; }
.modal-gallery.stack figure { width: 100%; }
.modal-gallery.stack img { width: 100%; height: auto; aspect-ratio: auto; object-fit: contain; }
.modal-gallery.stack figcaption { font-size: 0.85rem; margin-top: 0.6rem; }

/* lists */
.modal-list { list-style: none; display: flex; flex-direction: column; gap: 0.6rem; margin-top: 1.2rem; }
.modal-list li { font-size: 0.95rem; }
.modal-list strong { color: var(--klein); margin-right: 0.4rem; }
.modal-list span { color: var(--ink); opacity: 0.8; }
.modal-pad .btn { display: inline-block; margin-top: 2.4rem; }
.modal-note { margin-top: 2.4rem; font-size: 0.86rem; font-style: italic; color: var(--ink); opacity: 0.6; }

/* even spacing between every consecutive case-study card */
.work-feature + .work-feature { margin-top: 2rem; }
/* reversed work feature (image on the right) */
.work-feature-rev .work-feature-media { order: 2; border-right: none; border-left: 2px solid var(--ink); }
.work-feature-rev .work-feature-info { order: 1; }
.work-feature-media-light { background: #e9e5ec; }

/* palette / type spec variants */
.modal-palette.is-six { grid-template-columns: repeat(6, 1fr); }
.modal-typespec.is-three { grid-template-columns: repeat(3, 1fr); }
.modal-typespec .spec-cinzeld .spec-aa,
.modal-typespec .spec-cinzeld .spec-name,
.modal-typespec .spec-cinzeld .spec-glyphs { font-family: 'Cinzel Decorative', serif; }
.modal-typespec .spec-cinzel .spec-aa,
.modal-typespec .spec-cinzel .spec-name,
.modal-typespec .spec-cinzel .spec-glyphs { font-family: 'Cinzel', serif; }
.modal-typespec .spec-cormorant .spec-aa,
.modal-typespec .spec-cormorant .spec-name,
.modal-typespec .spec-cormorant .spec-glyphs { font-family: 'Cormorant', serif; font-style: italic; }
.modal-typespec .spec-bricolage .spec-aa,
.modal-typespec .spec-bricolage .spec-name,
.modal-typespec .spec-bricolage .spec-glyphs { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800; }
.modal-typespec .spec-inter .spec-aa { font-family: 'Inter', sans-serif; font-weight: 600; }
.modal-typespec .spec-inter .spec-name,
.modal-typespec .spec-inter .spec-glyphs { font-family: 'Inter', sans-serif; }

/* ---- watercolour light modal (Midnight Duel) — matches the game's luminous look ---- */
.modal-md { background: #f2ede3; color: var(--ink); border-color: rgba(55, 48, 78, 0.55); }
.modal-md .modal-close { background: #f7f2e8; color: #37304e; border-color: rgba(55, 48, 78, 0.45); }
.modal-md .modal-close:hover { background: #cfa96b; color: #2a2440; border-color: #cfa96b; }
.modal-cover-light { background: #e9e5ec; height: 360px; }
.modal-md .modal-cat { color: #9c7a2e; }
.modal-md .modal-title { font-family: 'Cinzel Decorative', serif; font-size: clamp(2rem, 4.4vw, 3rem); letter-spacing: 0.04em; color: #37304e; }
.modal-md .modal-lead { color: rgba(55, 48, 78, 0.9); }
.modal-md .modal-block { border-top-color: rgba(55, 48, 78, 0.16); }
.modal-md .modal-kicker { color: #9c7a2e; }
.modal-md .modal-h { font-family: 'Cormorant', serif; font-style: italic; font-weight: 500; font-size: clamp(1.8rem, 3.6vw, 2.4rem); color: #37304e; }
.modal-md .modal-block-intro { color: rgba(55, 48, 78, 0.82); }
.modal-md .modal-list strong { color: #9c7a2e; }
.modal-md .modal-list span { color: rgba(55, 48, 78, 0.78); }
.modal-md .modal-palette .pal { border-color: rgba(55, 48, 78, 0.22); color: var(--t, #f1e8d6); }
.modal-md .modal-typespec .spec { background: #faf6ee; border-color: rgba(55, 48, 78, 0.18); }
.modal-md .modal-typespec .spec-aa,
.modal-md .modal-typespec .spec-name { color: #37304e; }
.modal-md .modal-typespec .spec-role,
.modal-md .modal-typespec .spec-glyphs { color: rgba(55, 48, 78, 0.6); }
.modal-md .modal-gallery img { border-color: rgba(55, 48, 78, 0.55); }
.modal-md .modal-gallery figcaption { color: rgba(55, 48, 78, 0.6); }
.modal-md .modal-note { color: rgba(55, 48, 78, 0.6); }

@media (max-width: 720px) {
  .modal-palette { grid-template-columns: repeat(2, 1fr); }
  .modal-palette.is-six { grid-template-columns: repeat(3, 1fr); }
  .modal-typespec, .modal-typespec.is-three { grid-template-columns: 1fr; }
  .modal-gallery { grid-template-columns: repeat(2, 1fr); gap: 0.7rem; }
  .modal-gallery .g-wide { grid-column: span 2; }
  .modal-gallery .g-tall { grid-column: span 1; }
  .modal-cover, .modal-cover-light { height: 200px; }
  .modal-pad { padding: 1.8rem 1.4rem 2.2rem; }
}

/* ===== responsive ===== */
@media (max-width: 900px) {
  .nav-links { display: none; }
}
/* On narrower screens the desktop sticker collage (which extends left into the blue)
   would cross into the text — so stack the studio and use a self-contained collage
   that stays inside its own frame. */
/* Below desktop width the collage loses the empty blue to its left, so pull the
   stickers fully inside the right column — they stay BESIDE the text (not below it). */
@media (max-width: 1500px) {
  .s-oyster { width: 60%; left: 38%; top: 2%;   transform: rotate(12deg); }
  .s-heron  { width: 64%; left: -2%; top: 30%;  transform: rotate(8deg); }
  .s-dill   { width: 54%; left: 42%; top: 56%;  transform: rotate(-12deg); }
}
/* Only on genuinely small screens: stack, with a compact collage right under the text. */
@media (max-width: 1000px) {
  .studio-grid { grid-template-columns: 1fr; gap: 1.8rem; align-items: start; }
  .studio-inner { padding-bottom: 9rem; }
  .studio-photo-frame { aspect-ratio: 4 / 3; max-width: 460px; justify-self: center; }
  .s-oyster { width: 46%; left: 50%; top: 2%;  transform: rotate(12deg); }
  .s-heron  { width: 50%; left: 2%;  top: 20%; transform: rotate(8deg); }
  .s-dill   { width: 42%; left: 52%; top: 52%; transform: rotate(-12deg); }
}
/* stack the fanned cards into a column on narrow screens */
@media (max-width: 940px) {
  .chips { flex-direction: column; align-items: stretch; max-width: 32rem; gap: 1.1rem; padding: 1.5rem 0; }
  .chips .chip,
  .chips .chip:nth-child(1), .chips .chip:nth-child(2), .chips .chip:nth-child(3), .chips .chip:nth-child(4) {
    flex: none;
    width: auto;
    min-height: 0;
    justify-content: flex-start;
    transform: none;
    margin-left: 0;
  }
  .chip h3 { font-size: clamp(1.6rem, 6vw, 2rem); margin-bottom: 0.9rem; }
  .chip-list li { font-size: 0.95rem; }
  .chip:hover { transform: translateY(-4px) scale(1.01); }
}
@media (max-width: 600px) {
  .nav-cta { display: none; }
  .section { padding: 5.5rem 6vw; }
  .stats { gap: 1.8rem 1.2rem; }
}

/* ===== reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }
  .line-reveal > *, .reveal, .pop-in, .fade-up { transform: none; opacity: 1; }
}
