/* Miriam Rivero — split stage. Night of the Rhine, amber of its bridge lights, granite of Madrid. */

:root {
  /* Colour roles */
  --night: #11151c;
  --night-ink: #e8e8e5;
  --night-muted: #b5b4b0;
  --stone: #bdbab3;
  --stone-2: #cdcac3;
  --paper: #e3e3e0;
  --ink: #0e0e0e;
  --muted: #3a3a3c;
  --amber: #d0832f;
  --amber-press: #b9722a;
  --amber-hover: #dc9244;
  --amber-ink: #0e0e0e;

  /* Type: five steps */
  --step-small: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);
  --step-body: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  --step-head: clamp(2rem, 1.2rem + 2.6vw, 3.5rem);
  --step-display: clamp(3rem, 8.2vw, 9rem);

  --display: 'Young Serif', Georgia, 'Times New Roman', serif;
  --text: 'Source Serif 4', Georgia, 'Times New Roman', serif;

  /* Space */
  --margin: clamp(20px, 2.2vw, 32px);
  --col-pad: clamp(24px, 5vw, 88px);
  --section: clamp(96px, 11vw, 176px);

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.76, 0, 0.24, 1);
}

/* Reset and base */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--night);
  color: var(--night-ink);
  font-family: var(--text);
  font-size: var(--step-body);
  line-height: 1.55;
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a, button { touch-action: manipulation; }
button, .button, .channels a { user-select: none; -webkit-user-select: none; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
::selection { background: var(--amber); color: var(--amber-ink); }

.skip {
  position: absolute; left: var(--margin); top: -100px; z-index: 10;
  background: var(--amber); color: var(--amber-ink); padding: 10px 16px; text-decoration: none;
}
.skip:focus { top: var(--margin); }

/* Buttons: square, one fill */
.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 24px;
  background: var(--amber); color: var(--amber-ink);
  font-family: var(--text); font-size: var(--step-body); font-weight: 600; line-height: 1;
  text-decoration: none;
  transition: transform 140ms var(--ease-out), background-color 160ms ease;
}
.button--small { min-height: 40px; padding: 0 18px; font-size: var(--step-small); }
.button:active { transform: scale(0.97); background: var(--amber-press); }

/* ———————————————————— Split: stage + reading column ———————————————————— */

.split {
  display: grid;
  grid-template-columns: 47fr 53fr;
  position: relative;
}

.stage {
  position: sticky; top: 0;
  height: 100svh;
  padding: 20px 0 20px 20px;
}
.stage__frame { position: relative; height: 100%; overflow: hidden; background: #1c2230; }
.stage__img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 900ms var(--ease-out);
  animation: drift 28s var(--ease-in-out) infinite alternate;
}
.stage__img[data-stage="koln"] { object-position: 40% 50%; }
.stage__img.is-on { opacity: 1; }
@keyframes drift {
  from { transform: scale(1); }
  to { transform: scale(1.06) translate3d(-1%, -1%, 0); }
}
.stage__caption {
  position: absolute; left: 20px; right: 0; bottom: 20px;
  padding: 72px 20px 18px;
  background: linear-gradient(to top, rgb(0 0 0 / 0.55), rgb(0 0 0 / 0)); /* taste-skill-ignore: neutral scrim under the caption */
  font-size: var(--step-small);
  color: #fff;
}
.stage__caption span { display: none; }
.stage__caption span.is-on { display: block; }

.column { position: relative; min-width: 0; }

/* Hero */
.hero {
  position: relative;
  min-height: 100svh;
  padding: var(--margin) var(--margin) 0 var(--col-pad);
}
.bar {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  font-size: var(--step-small);
}
.channels { display: flex; gap: 4px; }
.channels a {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; min-height: 40px; padding: 0 8px;
  text-decoration: none; color: var(--night-muted);
  transition: color 160ms ease, background-color 160ms ease;
}
.channels a[aria-current="true"] { color: var(--night); background: var(--night-ink); }
.bar__links { display: flex; gap: 28px; margin-left: auto; }
.bar__links a { text-decoration: none; }

.hero__line {
  position: absolute; top: 44%; left: var(--col-pad);
  max-width: 24ch;
  font-size: var(--step-lead);
  line-height: 1.35;
}

.wordmark {
  position: absolute; right: var(--margin); bottom: 40px;
  z-index: 2;
  font-family: var(--display); font-weight: 400;
  font-size: var(--step-display);
  line-height: 0.95; letter-spacing: -0.04em;
  white-space: nowrap;
  color: var(--night-ink);
}
.wordmark span { display: block; transform-origin: 100% 100%; }

/* Intro: narrow column, empty field */
.intro { padding: 64px var(--margin) var(--section) var(--col-pad); }
.intro__text { max-width: 34ch; display: grid; gap: 1.1em; }
.intro__text p { color: var(--night-muted); }
.intro__text .intro__lead { color: var(--night-ink); font-weight: 600; }
.textlink { color: var(--night-ink); }

/* Pairs: the large figure of the reading column */
.pairs { padding: 0 var(--margin) var(--section) var(--col-pad); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.pairs__arrow { display: inline-block; width: 0.72em; height: 0.44em; margin: 0 0.06em; vertical-align: 0.12em; }
.plate { display: none; }
.pairs__list { display: grid; gap: 0.18em; }
.pairs__list li {
  font-family: var(--display); font-size: var(--step-head);
  line-height: 1.05; letter-spacing: -0.02em;
}
.pairs__note { margin-top: 32px; max-width: 36ch; color: var(--night-muted); }

/* ———————————————————— Services: pinned heading, passing rows ———————————————————— */

.services {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px;
  padding: var(--section) var(--margin);
  background: var(--amber); color: var(--amber-ink);
}
.services__title {
  grid-column: 1 / span 6; align-self: start;
  position: sticky; top: 32px;
  font-family: var(--display); font-weight: 400;
  font-size: var(--step-display); line-height: 0.95; letter-spacing: -0.03em;
}
.services__blocks { grid-column: 7 / span 6; display: grid; gap: 120px; }
.svc__title {
  font-family: var(--display); font-weight: 400;
  font-size: var(--step-lead); line-height: 1.15; letter-spacing: -0.01em;
  margin-bottom: 28px;
}
.svc__row { display: flex; gap: 32px; align-items: flex-start; }
.svc--flip .svc__row { flex-direction: row-reverse; }
.svc__img { width: clamp(160px, 15vw, 220px); aspect-ratio: 3 / 4; object-fit: cover; flex: none; }
.svc__list { flex: 1; display: grid; gap: 14px; padding-top: 2px; }
.svc__list li { font-size: var(--step-body); line-height: 1.35; }

/* ———————————————————— Work: big names, fixed preview ———————————————————— */

.work {
  padding: var(--section) var(--margin);
  background: var(--stone); color: var(--ink);
}
.work__title { font-family: var(--display); font-weight: 400; font-size: var(--step-display); line-height: 0.95; letter-spacing: -0.03em; margin-bottom: 64px; }
.work__grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; align-items: start; }
.work__list { grid-column: 1 / span 8; }
.work__item { display: grid; justify-items: start; padding-bottom: 18px; }
.work__thumb { display: none; }
.work__name {
  padding: 10px 0;
  font-family: var(--display); font-size: var(--step-head);
  line-height: 1; letter-spacing: -0.02em; text-align: left;
  color: var(--muted);
  transition: color 200ms ease;
}
.work__item.is-active .work__name { color: var(--ink); }
.work__meta { font-size: var(--step-small); color: var(--muted); }
.work__item.is-active .work__meta { color: var(--ink); }
.work__frame {
  grid-column: 9 / span 4;
  position: sticky; top: 15vh;
  aspect-ratio: 4 / 5;
  overflow: hidden;
}
.work__frame img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transform: scale(1.03);
  transition: opacity 200ms ease, transform 600ms var(--ease-out);
}
.work__frame img.is-on { opacity: 1; transform: scale(1); }

/* ———————————————————— About: the letter ———————————————————— */

.about {
  padding: var(--section) 24px;
  background: var(--stone-2); color: var(--ink);
}
.letter { max-width: 520px; margin: 0 auto; display: grid; gap: 1.1em; }
.letter__portrait {
  width: 44px; height: 44px; object-fit: cover; object-position: 50% 30%;
  margin-bottom: 12px;
}
.letter__sign {
  margin-top: 0.6em;
  font-style: italic; font-size: var(--step-lead); line-height: 1.3;
}
.letter__sign span {
  display: block; margin-top: 4px;
  font-style: normal; font-size: var(--step-small); color: var(--muted);
}

/* ———————————————————— Contact: visit card on a photograph ———————————————————— */

.contact { position: relative; min-height: 100svh; background: #6d7f8f; }
.contact__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 60% 50%; }
.card {
  position: absolute; top: 60px; right: 60px;
  width: 420px; padding: 32px 32px 0;
  background: var(--paper); color: var(--ink);
}
.card__title { font-family: var(--display); font-weight: 400; font-size: var(--step-lead); line-height: 1.15; margin-bottom: 16px; }
.card__where { margin-bottom: 24px; }
.card__rows { display: grid; gap: 10px; margin-bottom: 28px; }
.card__rows div { display: flex; justify-content: space-between; gap: 16px; }
.card__rows dt { color: var(--muted); }
.card__rows dd { text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.card__button { display: flex; width: calc(100% + 64px); margin: 0 -32px; min-height: 52px; }

/* ———————————————————— Footer: photograph half, menu half ———————————————————— */

.footer {
  display: grid; grid-template-columns: 1fr 1fr;
  min-height: 100svh;
  background: var(--night); color: var(--night-ink);
}
.footer__img { width: 100%; height: 100%; object-fit: cover; object-position: 30% 50%; }
.footer__side {
  display: flex; flex-direction: column;
  padding: 80px var(--margin) 32px clamp(32px, 8vw, 128px);
}
.footer__mark { font-family: var(--display); font-size: var(--step-head); line-height: 1; letter-spacing: -0.03em; margin-bottom: 40px; }
.footer__menu { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.footer__menu a {
  display: inline-block;
  font-size: var(--step-body);
  text-decoration: none;
  transition: color 200ms ease;
}
.footer__blocks { display: flex; flex-wrap: wrap; gap: 12px 48px; margin-top: 40px; font-size: var(--step-body); }
.footer__legal { margin-top: auto; padding-top: 64px; display: grid; gap: 8px; font-size: var(--step-small); color: var(--night-muted); }
.footer__legal a { color: var(--night-ink); }

/* ———————————————————— Hover, only where hover exists ———————————————————— */

@media (hover: hover) and (pointer: fine) {
  .button:hover { background: var(--amber-hover); }
  .channels a:hover { color: var(--night-ink); }
  .channels a[aria-current="true"]:hover { color: var(--night); }
  .bar__links a:hover, .textlink:hover { text-decoration: underline; }
  .bar__links a { text-decoration: none; }
  .footer__menu:hover a { color: var(--night-muted); }
  .footer__menu a:hover { color: var(--night-ink); text-decoration: underline; }
  .work__name:hover { color: var(--ink); }
}

/* ———————————————————— Reveals (only when script runs) ———————————————————— */

.js [data-reveal],
.js [data-reveal-group] > * {
  opacity: 0;
  transform: translate3d(0, 24px, 0);
  transition: opacity 700ms var(--ease-out), transform 800ms var(--ease-out);
  transition-delay: calc(var(--i, 0) * 75ms);
}
.js .svc[data-reveal-group] .svc__img { transform: scale(1.04); }
.js [data-reveal].is-in,
.js [data-reveal-group].is-in > *,
.js .svc[data-reveal-group].is-in .svc__img { opacity: 1; transform: none; }

/* Signature: the wordmark settles as the first screen leaves */
@supports (animation-timeline: view()) {
  .wordmark span {
    animation: settle linear both;
    animation-timeline: view();
    animation-range: exit 0% exit 100%;
  }
  @keyframes settle {
    from { transform: scale(1); }
    to { transform: scale(0.93); }
  }
}

/* ———————————————————— Tablet ———————————————————— */

@media (max-width: 1100px) {
  .bar__links { display: none; }
  .services__title { grid-column: 1 / -1; position: static; margin-bottom: 72px; }
  .services__blocks { grid-column: 1 / -1; max-width: 640px; }
  .card { right: 32px; top: 32px; }
}

/* ———————————————————— Phone: its own composition ———————————————————— */

@media (max-width: 820px) {
  .split { display: block; }
  .stage { position: relative; height: 58svh; padding: 12px 12px 0; z-index: 0; }
  .stage__caption { display: none; }
  .column { z-index: 1; background: var(--night); }

  :root { --step-display: 12.4vw; }
  .hero { min-height: 0; padding: 0 20px 72px; display: flex; flex-direction: column; }
  .wordmark { order: -1; }
  .bar {
    position: absolute; left: 0; right: 0; top: calc(-58svh + 12px);
    padding: 12px 12px 0;
  }
  .channels a { background: rgb(17 21 28 / 0.72); color: var(--night-ink); }
  .channels a[aria-current="true"] { background: var(--night-ink); color: var(--night); }

  .wordmark {
    position: relative; right: auto; bottom: auto;
    margin: -0.42em 0 0;
    letter-spacing: -0.045em;
  }
  .hero__line { position: static; margin-top: 24px; max-width: none; }
  .plate { display: block; margin: 0 0 72px; }
  .plate img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

  .intro { padding: 0 20px 96px; }
  .intro__text { max-width: 78%; min-width: 280px; }
  .pairs { padding: 0 20px 96px; }

  .services { display: block; padding: 0 20px 96px; }
  .services__title {
    position: sticky; top: 0; z-index: 1;
    margin: 0 -20px 40px; padding: 16px 20px 12px;
    background: var(--amber);
  }
  .services__blocks { gap: 72px; }
  .svc__row, .svc--flip .svc__row { flex-direction: row; gap: 16px; }
  .svc__img { width: 96px; }

  .work { padding: 96px 20px; }
  .work__grid { display: block; }
  .work__list { display: grid; gap: 40px; }
  .work__item { display: block; padding: 0; }
  .work__thumb { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; margin-bottom: 14px; }
  .work__name { color: var(--ink); padding: 0; }
  .work__meta { display: block; margin-top: 6px; color: var(--ink); }
  .work__frame { display: none; }

  .about { padding: 96px 24px; }
  .letter__portrait { width: 40px; height: 40px; }

  .contact { min-height: 0; background: var(--stone-2); padding-bottom: 16px; }
  .contact__img { position: static; height: 70svh; }
  .card {
    position: relative; top: auto; right: auto;
    width: auto; margin: -80px 16px 0;
    padding: 24px 24px 0;
  }
  .card__button { width: calc(100% + 48px); margin: 0 -24px; min-height: 56px; }

  .footer { display: block; min-height: 0; }
  .footer__img { height: 50svh; }
  .footer__side { padding: 48px 20px calc(32px + env(safe-area-inset-bottom, 0px)); }
  .footer__mark { margin-bottom: 28px; }
  .footer__menu { gap: 10px 24px; }
  .footer__blocks { flex-direction: column; gap: 12px; margin-top: 32px; }
}

/* ———————————————————— Reduced motion: keep the content, drop the travel ———————————————————— */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .stage__img { animation: none; }
  .wordmark span { animation: none !important; }
  .js [data-reveal],
  .js [data-reveal-group] > *,
  .js .svc[data-reveal-group] .svc__img { transform: none; transition: opacity 300ms ease; }
  .work__frame img { transform: none; }
}
