/* ============================================================
   PORTFOLIO — styles.css
   ------------------------------------------------------------
   Ink on near-white with a pale sunset sky. The opening plate has
   identity + about (left) and a big project MOSAIC (right). Clicking
   a tile opens a PROJECT DETAIL DIALOG (media + text + live link).
   Contact closes the page with the 940×534 watercolor animation
   anchored beneath “something.” Uneven thumbnails add organic rhythm.

   TABLE OF CONTENTS
    1. Tokens
    2. Base / paper
    3. Ambient (progress + grain)
    4. Mini nav (fades in on scroll)
    5. Plate layout + identity + about
    6. Work mosaic (right column)
    7. Contact / footer
    8. Project detail dialog (modal)
    9. Reveal + motion preferences
   10. Responsive
   11. Accessibility + launch polish
   ============================================================ */


/* ---------- 1. TOKENS ---------------------------------------- */
:root {
  --paper: #FCFCFB;
  --ink:   #1A1A18;
  --soft:  #56524C;
  --muted: #6E6960;   /* darkened to clear WCAG AA on small labels */
  --line:  #E8E5DF;
  --screen: #14130F;   /* the dark "screen" behind modal media */

  --serif: 'Playfair Display', Georgia, serif;
  --sans:  'Hanken Grotesk', system-ui, sans-serif;

  --pad: clamp(1.5rem, 5vw, 4.5rem);
}


/* ---------- 2. BASE / PAPER ---------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  overflow-x: clip; 
  min-height: 100%; 
  scroll-behavior: smooth;
  scrollbar-gutter: stable;   /* opening the modal no longer shifts the layout */
}

body {
  margin: 0;
  font-family: var(--sans);
  font-weight: 400;
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  /* the SKY — one gradient over the whole document, so it evolves
     seamlessly as you scroll: pale blue up top, paper through the
     work, a warm sunset glow around the footer (so it integrates),
     then pure white at the very end. The two radials paint the
     low-left sunset + the pale-blue wash on the first screen; they
     use viewport units so they always sit in the hero. */
  background-color: #FFFFFF;
  background-repeat: no-repeat;
  background-image:
    radial-gradient(70vw 55vh at 8vw 80vh, rgba(250, 222, 196, 0.5) 0%, rgba(250, 222, 196, 0) 70%),
    radial-gradient(80vw 60vh at 94vw 56vh, rgba(212, 231, 242, 0.55) 0%, rgba(212, 231, 242, 0) 70%),
    linear-gradient(180deg,
      #ffffff 0%,
      #fdfbf9 15%,
      #f0e6f3 35%,
      #e9f0ee 68%,
      #f4f0e9 75%,
      #ededed 100%);
  background-size: 100% 100%;
}
body.no-scroll {
  position: fixed;
  inset-inline: 0;
  width: 100%;
  overflow: hidden;
} /* reliable modal scroll lock, including mobile Safari */

img { max-width: 100%; display: block; }
a   { color: inherit; text-decoration: none; }
h1, h2 { margin: 0; }
p, dl { margin: 0; }
[hidden] { display: none !important; }

/* JavaScript removes .no-js immediately. If it never runs, content
   that normally reveals on scroll remains visible. */
.no-js .reveal { opacity: 1; transform: none; }

/* Anchor targets should clear the fixed mini-nav. */
#work, #about, #contact { scroll-margin-top: 5rem; }

footer {
  position: relative;
  /* No z-index here on purpose: a z-index creates an isolated
     stacking context, and the watercolor's mix-blend-mode: multiply
     would then blend against nothing — leaving its white background
     visible. Without it, the video blends into the page sky. */
  padding: clamp(4.5rem, 11dvh, 8rem) var(--pad);
  scroll-margin-top: 70px;
}

.kicker {
  font-size: 0.72rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}

/* Accessible text that remains available to assistive technology. */
.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;
}
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  letter-spacing: 0.5px;
}

.lang-option {
  color: #999;
  text-decoration: none;
  transition: color 0.2s ease;
}

.lang-option.active {
  color: #222;
  font-weight: 600;
}

.lang-option:hover {
  color: #444;
}

.lang-divider {
  color: #ccc;
}

.availability-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(0, 0, 0, 0.08);
  font-size: 13px;
  color: #444;
  letter-spacing: 0.3px;
  backdrop-filter: blur(4px);
}

.pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4caf6d;      /* calm green, not neon */
  box-shadow: 0 0 0 0 rgba(76, 175, 109, 0.5);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(76, 175, 109, 0.5);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(76, 175, 109, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(76, 175, 109, 0);
  }
}

/* ---------- 3. AMBIENT (progress + grain) -------------------- */
.progress {
  position: fixed; top: 0; left: 0;
  height: 1px; width: 100%;
  background: var(--ink);
  transform: scaleX(0); transform-origin: left;
  z-index: 60; pointer-events: none;
}
.grain {
  position: fixed; inset: 0;
  z-index: 4; pointer-events: none;
  opacity: 0.404;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}


/* ---------- 4. MINI NAV (fades in on scroll) ----------------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.9rem var(--pad);
  background: rgba(252, 252, 251, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: inset 0 -1px 0 var(--line);
  opacity: 0; transform: translateY(-100%);
  visibility: hidden;   /* hidden links cannot receive keyboard focus */
  transition: opacity .4s ease, transform .4s ease, visibility .4s ease;
  pointer-events: none;
}
.nav.is-visible {
  opacity: 1;
  transform: none;
  visibility: visible;
  pointer-events: auto;
}
.nav-name { font-family: var(--serif); font-weight: 500; font-size: 1.05rem; }
.nav-links { display: flex; gap: 1.8rem; }
.nav-links a {
  font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase;
  font-weight: 500; color: var(--soft);
  position: relative; transition: color .2s ease;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -4px;
  height: 1px; background: var(--ink);
  transform: scaleX(0); transform-origin: left;
  transition: transform .3s ease;
}
.nav-links a:hover::after { transform: scaleX(1); }


/* ---------- 5. PLATE LAYOUT + IDENTITY + ABOUT --------------- */
.plate {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: clamp(2rem, 5vh, 3.5rem) var(--pad) 0;
  overflow: hidden;
  /* transparent — the scrolling sky lives on <body> so it can evolve
     down the page and wrap the footer in warm light */
}

.plate-grid {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: minmax(280px, 0.82fr) 1.18fr;
  align-items: stretch;
  column-gap: clamp(2rem, 4vw, 4rem);
  padding-bottom: clamp(1.5rem, 3vh, 2.5rem);
}

.hero-id {
  position: relative;
  z-index: 1;
  max-width: 560px;
  display: flex;
  flex-direction: column;
}
.hero-name {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.4rem, 6vw, 4.6rem);
  line-height: 0.98;
  letter-spacing: -0.01em;
}
.hero-nav {
  display: flex;
  gap: clamp(1.4rem, 3vw, 2.8rem);
  margin-top: 1.3rem;
}
.hero-nav a {
  font-size: 0.74rem; letter-spacing: 0.16em; text-transform: uppercase;
  font-weight: 500; position: relative; padding-bottom: 2px;
}
.hero-nav a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -2px;
  height: 1px; background: var(--ink);
  transform: scaleX(0); transform-origin: left;
  transition: transform .3s ease;
}
.hero-nav a:hover::after { transform: scaleX(1); }

.hero-statement { margin-top: clamp(2rem, 5vh, 3.5rem); }
.hero-line {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.6rem, 3.2vw, 2.6rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
}
.hero-sub {
  margin-top: 1.1rem;
  max-width: 36ch;
  color: var(--soft);
  font-size: 0.96rem;
}
.view-work {
  display: inline-flex; align-items: center; gap: 0.7rem;
  margin-top: 1.6rem; padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--ink);
  font-size: 0.74rem; letter-spacing: 0.16em; text-transform: uppercase;
  font-weight: 500;
  transition: border-color .3s ease;
}
.view-work .vw-arr { transition: transform .3s ease; }
.view-work:hover { border-color: var(--soft); }
.view-work:hover .vw-arr { transform: translateX(5px); }

.plate-about { margin-top: clamp(2rem, 5vh, 3.5rem); }
.plate-about .kicker { margin-bottom: 0.7rem; }
.about-lead {
  font-family: var(--serif);
  font-style:normal;
  font-weight: 400;
  font-size: clamp(1.05rem, 1.7vw, 1.35rem);
  line-height: 1.32;
  max-width: 30ch;
  
}
.disc-mini { margin-top: 1.3rem; display: grid; gap: 0.7rem; }
.disc-mini > div {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 0.8rem; align-items: baseline;
}
.disc-mini dt {
  font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); font-weight: 500;
}
.disc-mini dd { color: var(--soft); font-size: 0.86rem; }

.hero-work { position: relative; z-index: 1; display: flex; }


/* ---------- 6. WORK MOSAIC (right column) -------------------- */
.work-mosaic {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: clamp(12px, 1vw, 18px);
  min-height: clamp(560px, 70vh, 840px);
  align-items: stretch;
}

/* five-tile tessellation:
     [ feature feature square ]
     [ feature feature square ]
     [ square  wide    wide   ] */
.work-mosaic .tile:nth-of-type(1) { grid-column: span 2; grid-row: span 2; }
.work-mosaic .tile:nth-of-type(2) { grid-column: span 1; grid-row: span 1; }
.work-mosaic .tile:nth-of-type(3) { grid-column: span 1; grid-row: span 1; }
.work-mosaic .tile:nth-of-type(4) { grid-column: span 1; grid-row: span 1; }
.work-mosaic .tile:nth-of-type(5) { grid-column: span 2; grid-row: span 1; }

/* organic, hand-placed "stone" shapes — varied per tile so the
   mosaic never reads as a sheet of boxes. The bottom-LEFT corner
   stays small on every tile so the title (which starts there) stays
   legible; the other three corners carry the variation. A slight
   tilt at rest, and a hover that straightens + shifts the corners,
   make each stone "settle" under the cursor. */
.work-mosaic .tile {
  border-radius: 26px;
  transform: none;
  transition: transform .4s cubic-bezier(.2,.7,.2,1),
              box-shadow .35s ease,
              border-radius .45s ease;
}

/* Subtle shape variation for visual interest */
.work-mosaic .tile:nth-of-type(1) { border-radius: 30px 24px 34px 22px; }
.work-mosaic .tile:nth-of-type(2) { border-radius: 22px 30px 24px 28px; }
.work-mosaic .tile:nth-of-type(3) { border-radius: 28px 22px 32px 20px; }
.work-mosaic .tile:nth-of-type(4) { border-radius: 24px 28px 22px 32px; }
.work-mosaic .tile:nth-of-type(5) { border-radius: 22px 34px 34px 22px; }
/* Gentle, elegant hover */
.work-mosaic .tile:hover,
.work-mosaic .tile:focus-within {
  transform: translateY(-5px);
  border-radius: 20px;
  box-shadow: 0 22px 44px -20px rgba(0, 0, 0, 0.32);
  z-index: 2;
}

.work-mosaic .tile:nth-of-type(5) .tile-cap {
  padding-right: clamp(1.9rem, 3.4vw, 2.9rem);
}

/* Each tile is a semantic <article>; an invisible, full-size button
   (.tile-trigger) handles the click without wrapping headings and
   paragraphs in invalid button markup. */
.tile {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 22px 8px 22px 8px;   /* fallback organic shape */
  background: var(--line);
  /* transform (tilt/straighten/lift) is set per tile below */
  transition: transform .55s cubic-bezier(.2,.7,.2,1),
              box-shadow .4s ease,
              border-radius .7s cubic-bezier(.2,.7,.2,1);
}
/* hover/focus lift + shadow (the per-tile rules handle the tilt) */
.tile:hover, .tile:focus-within {
  box-shadow: 0 24px 46px -26px rgba(0, 0, 0, 0.5);
  z-index: 2;
}
/* a focus ring that FOLLOWS the organic shape (box-shadow does,
   outline wouldn't) */
.tile:focus-within {
  box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--ink);
}
.tile-trigger {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%; height: 100%;
  appearance: none; -webkit-appearance: none;
  border: 0;
  border-radius: inherit;
  background: transparent;
  cursor: pointer;
}
/* The ring is drawn on the parent so it follows the organic curve. */
.tile .tile-trigger:focus-visible { outline: none; }
.tile img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: grayscale(0.15) brightness(1.02);
  transition: transform .9s cubic-bezier(.2,.7,.2,1), filter .6s ease;
}
.tile:hover img, .tile:focus-within img { transform: scale(1.05); filter: none; }
/* If a thumbnail path is wrong, keep the tile intentional rather
   than showing the browser's broken-image icon. */
.tile.has-media-error {
  background:
    radial-gradient(circle at 78% 24%, rgba(212, 231, 242, 0.9), transparent 48%),
    linear-gradient(145deg, #F8E6D5, var(--paper));
}

/* caption top row: plate number + category (kept inside the scrim
   so the tile's top corners stay free to be organic) */
.tile-top {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.25rem;
}
.tile-no {
  font-size: 0.68rem; letter-spacing: 0.08em;
  color: var(--paper);
  font-variant-numeric: tabular-nums;
  opacity: 0.82;
}
.tile-cap {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 2.4rem 1.1rem 1rem;
  color: var(--paper);
  
  /* 1. Make the default black tint slightly darker */
  background: linear-gradient(0deg,
              rgba(18,16,12,0.85) 0%, rgba(18,16,12,0.4) 70%, transparent 100%);
              
  /* 2. Add the frosted glass blur effect */
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  
  transition: background .4s ease, backdrop-filter .4s ease;
}

/* 3. Update the hover state so it gets even darker/blurrier when a user interacts */
.tile:hover .tile-cap, .tile:focus-within .tile-cap {
  background: linear-gradient(0deg,
              rgba(18,16,12,0.95) 0%, rgba(18,16,12,0.6) 75%, transparent 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.tile-cat {
  font-size: 0.64rem; letter-spacing: 0.16em; text-transform: uppercase;
  opacity: 0.85;
}
.tile-name {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1rem, 1.5vw, 1.35rem);
  line-height: 1.1; margin-top: 0.25rem;
}
.tile--feature .tile-name { font-size: clamp(1.4rem, 2.4vw, 2.1rem); }
.tile-desc {
  max-height: 0; opacity: 0; margin-top: 0; overflow: hidden;
  font-size: 0.82rem; font-weight: 300;
  color: rgba(252,252,251,0.85);
  max-width: 36ch;
  transition: max-height .45s ease, opacity .35s ease, margin-top .35s ease;
}
.tile:hover .tile-desc, .tile:focus-within .tile-desc {
  max-height: 5em; opacity: 1; margin-top: 0.4rem;
}


/* ---------- 7. CONTACT / FOOTER ------------------------------ */
.contact { max-width: 1080px; margin: 0 auto; }
.contact-title {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(2rem, 5vw, 3.4rem);
  letter-spacing: -0.01em; margin-top: 0.6rem;
}

/* The watercolor behind the phrase ----------------------------
   “something” is the positioning anchor; the 940×534 animation is
   centred on it, starting a little below the word's top edge, and
   paints at z-index -1 — so the whole phrase renders ON TOP of it.
   Multiply removes the video's white background against the sky.
   A modest padding keeps room for the art's lower half. */
.contact-title {
  padding-bottom: clamp(3.5rem, 9vw, 6.5rem);
}
.something-word {
  position: relative;
  display: inline-block;
  white-space: nowrap;
}
.contact-phrase {
  display: inline-block;
  white-space: nowrap;
}
.something-video {
  position: absolute;
  z-index: -1;                    /* behind the heading text */
  top: 0.3em;                     /* a little under the word's top edge */
  left: 50%;
  width: clamp(300px, 42vw, 540px);
  height: auto;
  aspect-ratio: 940 / 534;
  transform: translateX(-80%) translateY(20%);    /* centred on “something” */
  display: block;
  object-fit: contain;
  mix-blend-mode: multiply;       /* white background → invisible on the sky */
  opacity: 0.001;
  will-change: opacity;
  pointer-events: none;
  transition: opacity .5s ease;
}
.something-video.is-ready { opacity: 1; }
.calm-text { white-space: nowrap; }
.contact-email {
  display: inline-block; margin-top: 2rem;
  font-family: var(--serif); font-style: italic;
  font-size: clamp(1.4rem, 3.4vw, 2rem);
  border-bottom: 1px solid var(--ink);
  padding-bottom: 2px;
  transition: opacity .2s ease;
}
.contact-email:hover { opacity: 0.6; }
.contact-socials { display: flex; gap: 1.8rem; margin-top: 1.8rem; }
.contact-socials a[href="#"] { display: none; } /* no dead links without JS */
.contact-socials a {
  font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase;
  font-weight: 500; color: var(--soft); position: relative;
}
.contact-socials a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -3px;
  height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: left;
  transition: transform .3s ease;
}
.contact-socials a:hover { color: var(--ink); }
.contact-socials a:hover::after { transform: scaleX(1); }
.egg {
  margin-top: 4rem; padding-top: 1.4rem;
  border-top: 1px solid var(--line);
  max-width: 48ch;
  font-family: var(--serif); font-style: italic;
  font-size: 0.98rem; color: var(--muted); line-height: 1.5;
}
.colophon {
  margin-top: 1.2rem;
  font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted);
}
/* ------ steps process ----- */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  padding: 80px 90px;
  align-items: start;
}

.step {
  position: relative;
  text-align: left;
}

.step-img {
  width: 100%;
  max-width: 220px;
  height: auto;
  mix-blend-mode: multiply;   /* key part: lets transparent/white bg blend into page bg */
  margin-bottom: 24px;
}

.step-number {
  display: block;
  font-size: 13px;
  letter-spacing: 1px;
  color: #999;
  margin-bottom: 8px;
}

.step h3 {
  font-size: 22px;
  margin: 0 0 8px;
}

.step p {
  font-size: 15px;
  color: #555;
  line-height: 1.5;
}


/* ---------- 8. PROJECT DETAIL DIALOG (modal) ----------------- */
.modal {
  position: fixed; inset: 0;
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: clamp(1rem, 4vh, 3rem) clamp(1rem, 4vw, 3rem);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .35s ease, visibility .35s ease;
}
.modal.is-open { opacity: 1; visibility: visible; pointer-events: auto; }

/* a warm→cool paper blur, not a flat grey scrim */
.modal-backdrop {
  position: absolute; inset: 0;
  background: linear-gradient(160deg, rgba(251, 242, 232, 0.86), rgba(238, 244, 249, 0.86));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-panel {
  position: relative; z-index: 1;
  width: 100%; max-width: 1040px; max-height: 100%;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 44px 100px -44px rgba(0, 0, 0, 0.5);
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  overflow: hidden;
  min-width: 0;
  transform: translateY(16px) scale(0.98);
  opacity: 0;
  transition: transform .45s cubic-bezier(.2,.7,.2,1), opacity .4s ease;
}
.modal.is-open .modal-panel { transform: none; opacity: 1; }
/* a sunset-gradient hairline along the top, tying it to the sky */
.modal-panel::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 2px; z-index: 5;
  background: linear-gradient(90deg, #F3C9A6, #D7E7F2);
}

.modal-close {
  position: absolute; top: 0.9rem; right: 0.9rem; z-index: 6;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font-size: 1.2rem; line-height: 1;
  display: grid; place-items: center;
  cursor: pointer;
  box-shadow: 0 6px 16px -10px rgba(0,0,0,0.4);
  transition: transform .3s ease, border-color .3s ease;
}
.modal-close:hover { transform: rotate(90deg); border-color: var(--soft); }
.modal-close:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* the media pane = a dark "screen": images fill it, videos sit
   contained with cinematic bars */
.modal-media {
  position: relative;
  background: var(--screen);
  min-height: 240px;
  display: grid; place-items: center;
  overflow: hidden;
  min-width: 0;
}
.modal-media img, .modal-media video, .modal-media iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  transition: opacity .3s ease;
}
.modal-media img  { object-fit: cover; }
.modal-media video { object-fit: contain; background: var(--screen); }
.modal-media iframe { border: 0; background: var(--screen); }  /* YouTube embed */
.modal-media.has-media-error::after {
  content: 'Preview unavailable';
  color: rgba(252, 252, 251, 0.72);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.modal-media.is-swapping img,
.modal-media.is-swapping video,
.modal-media.is-swapping iframe { opacity: 0; }   /* soft cross-fade on nav */

.modal-body {
  padding: clamp(1.6rem, 3vw, 2.6rem);
  display: flex; flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;     /* don't scroll the page behind */
  min-width: 0;
  min-height: 0;
}
.modal-top {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
}
.modal-count {
  font-size: 0.7rem; letter-spacing: 0.12em;
  color: var(--muted); font-variant-numeric: tabular-nums;
}
.modal-cat {
  font-size: 0.66rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted); font-weight: 500;
}
.modal-title {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  letter-spacing: -0.01em; margin-top: 0.8rem; line-height: 1.1;
}
.modal-desc {
  margin-top: 0.9rem; color: var(--soft);
  font-size: 0.96rem; max-width: 46ch;
}
.modal-meta {
  margin-top: 1.4rem;
  display: grid; grid-template-columns: auto 1fr; gap: 0.5rem 1.2rem;
}
.modal-meta dt {
  font-size: 0.64rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); font-weight: 500; align-self: baseline;
}
.modal-meta dd { color: var(--ink); font-size: 0.86rem; }

/* the live-project call to action */
.modal-live {
  display: inline-flex; align-items: center; gap: 0.6rem;
  margin-top: 1.6rem; align-self: flex-start;
  padding: 0.7rem 1.2rem;
  border-radius: 999px;
  background: var(--ink); color: var(--paper);
  font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase;
  font-weight: 500;
  transition: transform .25s ease, background .25s ease;
}
.modal-live:hover { transform: translateY(-2px); background: #000; }
.modal-live:focus-visible { outline: 2px solid var(--paper); outline-offset: 3px; }
.modal-live .ml-arr { transition: transform .3s ease; }
.modal-live:hover .ml-arr { transform: translateX(4px); }

/* prev / next within the dialog */
.modal-nav {
  margin-top: auto; padding-top: 1.4rem;
  display: flex; align-items: center; gap: 1rem;
}
.modal-nav button {
  appearance: none; border: 0; background: none; padding: 0;
  font: inherit; cursor: pointer;
  font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); font-weight: 500;
  transition: color .2s ease;
}
.modal-nav button:hover { color: var(--ink); }
.modal-nav button:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.mn-sep { flex: 1; }


/* ---------- 9. REVEAL + motion preferences ------------------- */
.reveal {
  opacity: 0; transform: translateY(18px);
  transition: opacity .9s ease, transform .9s cubic-bezier(.2,.7,.2,1);
  transition-delay: var(--d, 0ms);
}
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .something-video, .tile, .modal-panel, .modal,
  .modal-media img, .modal-media video { transition: none; }
  .work-mosaic .tile:nth-of-type(n),
  .work-mosaic .tile:nth-of-type(n):hover,
  .work-mosaic .tile:nth-of-type(n):focus-within,
  .tile:hover img,
  .tile:focus-within img { transform: none; }
  .modal-close:hover, .modal-live:hover { transform: none; }
  .view-work:hover .vw-arr,
  .modal-live:hover .ml-arr { transform: none; }
  html { scroll-behavior: auto; }
}


/* ---------- 10. RESPONSIVE ----------------------------------- */
@media (max-width: 900px) {
  .plate-grid {
    grid-template-columns: 1fr;
    row-gap: clamp(2rem, 6vh, 3.5rem);
  }
      .steps{
      gap: 32px;
      padding: 60px 40px;
    }
  .hero-id { max-width: none; }
  .work-mosaic {
    min-height: 520px;
    aspect-ratio: auto;
    grid-template-rows: repeat(3, 1fr);
    grid-auto-rows: unset;
  }
  .work-mosaic .tile:nth-of-type(1) { grid-column: span 2; grid-row: span 2; }
  .work-mosaic .tile:nth-of-type(2),
  .work-mosaic .tile:nth-of-type(3),
  .work-mosaic .tile:nth-of-type(4) { grid-column: span 1; grid-row: span 1; }
  .work-mosaic .tile:nth-of-type(5) { grid-column: span 2; grid-row: span 1; }

  /* modal stacks: media on top, text scrolling below */
  .modal-panel { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .modal-media {
    aspect-ratio: 16 / 10;
    min-height: 0;
    max-height: min(42vh, 360px);
  }
    .steps {
    grid-template-columns: 1fr;
    gap: 48px;
    padding: 48px 24px;
  }
  .step {
    display: flex;
    flex-direction: column;
    text-align: center;
    align-items: center;
  }

  .step-img {
    max-width: 160px;
    margin: 0 audo 20px;
  }
}

@media (max-width: 600px) {
  .work-mosaic { grid-template-columns: 1fr; }
  .work-mosaic .tile:nth-of-type(n) { grid-column: auto; grid-row: auto; }
  .disc-mini > div { grid-template-columns: 1fr; gap: 0.2rem; }
  .nav-links { gap: 1.2rem; }
  .contact-title { padding-bottom: clamp(4rem, 18vw, 6rem); }
  .something-video { width: min(84vw, 400px);  transform: translateX(-20%);}
  .steps {
    grid-template-columns: 1fr;
    gap: 48px;
    padding: 48px 24px;
  }
  .step {
    display: flex;
    flex-direction: column;
    text-align: center;
    align-items: center;
  }

  .step-img {
    max-width: 160px;
    margin: 0 audo 20px;
  }
}


/* ---------- 11. ACCESSIBILITY + LAUNCH POLISH ---------------- */
/* one consistent keyboard focus ring across all interactive bits */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}
main:focus { outline: none; }   /* skip target shouldn't flash a box */

/* skip link — invisible until focused */
.skip {
  position: fixed; top: 0.6rem; left: 50%;
  transform: translate(-50%, -180%);
  z-index: 200;
  background: var(--ink); color: var(--paper);
  padding: 0.6rem 1.1rem; border-radius: 999px;
  font-size: 0.78rem; letter-spacing: 0.06em;
  transition: transform .25s ease;
}
.skip:focus { transform: translate(-50%, 0); }

/* no-JavaScript fallback message */
.noscript {
  max-width: 42ch;
  margin: auto;
  padding: 0 var(--pad);
  text-align: center;
  color: var(--soft);
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.1rem;
}
.noscript a { border-bottom: 1px solid var(--ink); }
.work-mosaic > noscript {
  grid-column: 1 / -1;
  grid-row: 1 / -1;
  align-self: center;
}



/* a tidy printed / "save as PDF" version */
@media print {
  .nav, .progress, .grain, .modal, .skip, .something-video { display: none !important; }
  body { background: #fff; }
  .plate { min-height: auto; overflow: visible; }
  .work-mosaic { min-height: auto; grid-template-rows: repeat(3, 130px); }
  .tile { break-inside: avoid; box-shadow: none; }
  .work-mosaic .tile:nth-of-type(n) { transform: none; border-radius: 4px; }
  .tile-trigger { display: none; }
  .tile-desc { max-height: none; opacity: 1; }   /* reveal descriptions on paper */
  .modal-live { background: #fff; color: #000; border: 1px solid #000; }
}
