/* ==========================================================================
   ROMY'S — stylesheet
   White, minimal, grid-led. Index rows after playgroundlove.paris;
   catalogue numbering, hairlines and restraint after Peter Saville.
   ========================================================================== */

:root {
  --bg: #ffffff;
  --bg-soft: #f6f6f4;
  --ink: #111111;
  --ink-2: #6b6b6b;
  --ink-3: #b8b8b8;
  --line: #e2e2e0;
  --line-strong: #111111;

  --sans: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", "SF Mono", Menlo, Consolas, monospace;

  --gutter: clamp(16px, 4vw, 56px);
  --header-h: 56px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4, p, figure { margin: 0; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

.mono {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--header-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 var(--gutter);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .06em;
}

.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand__logo { width: auto; height: 32px; display: block; }
.brand:hover { text-decoration: none; }
.brand__name { font-family: var(--sans); font-weight: 600; font-size: 14px; letter-spacing: .12em; }
.brand__cat { color: var(--ink-2); }

.nav { display: flex; gap: 28px; justify-self: center; }
.nav a { position: relative; padding: 4px 0; color: var(--ink-2); transition: color .2s; white-space: nowrap; }
.nav a:hover, .nav a.is-active { color: var(--ink); text-decoration: none; }
.nav a.is-active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px; background: var(--ink);
}
.nav__ext { margin-left: 12px; }
.nav .nav__lang {
  margin-left: 8px;
  padding: 5px 9px 4px;
  line-height: 1;
  border: 1px solid var(--line);
  border-radius: 2px;
  letter-spacing: .1em;
  transition: color .2s, border-color .2s;
}
.nav .nav__lang:hover { border-color: var(--ink); }

.header-meta { justify-self: end; color: var(--ink-2); font-variant-numeric: tabular-nums; }

.nav-toggle { display: none; justify-self: end; letter-spacing: .1em; }

/* ---------- Hero ---------- */
.hero {
  min-height: calc(100svh - var(--header-h));
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 24px var(--gutter) 28px;
  border-bottom: 1px solid var(--line-strong);
}

.hero__index { display: flex; justify-content: space-between; align-items: start; color: var(--ink-2); }

.hero__title {
  align-self: center;
  font-weight: 500;
  font-size: clamp(28px, 7.2vw, 108px);
  line-height: .98;
  letter-spacing: -.03em;
  text-transform: uppercase;
}
.hero__title .line { display: block; white-space: nowrap; }

.hero__foot { display: flex; justify-content: space-between; align-items: center; color: var(--ink-2); }

/* Colour code strip (after Saville's Factory colour alphabet) */
.hero__code, .footer__code { display: inline-flex; gap: 3px; }
.hero__code i, .footer__code i { display: block; width: 14px; height: 14px; background: var(--c); }

/* ---------- Sections ---------- */
.section { padding: 36px var(--gutter) 72px; scroll-margin-top: var(--header-h); }

.section__head {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  align-items: baseline;
  gap: 16px;
  padding-bottom: 12px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--line-strong);
}
.section__num { color: var(--ink-2); white-space: nowrap; }
.section__head h2 { font: inherit; letter-spacing: inherit; }
.section__aside { color: var(--ink-2); }

/* ---------- About: main statement left, secondary lines right ---------- */
.about {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  align-items: center;
}
.about__main {
  grid-column: 2;
  display: grid;
  gap: .7em;
  font-size: clamp(22px, 2.6vw, 34px);
  font-weight: 500;
  letter-spacing: -.02em;
  line-height: 1.12;
}
.about__side {
  grid-column: 3;
  justify-self: center;
  max-width: 62ch;
  font-family: var(--mono);
  font-size: clamp(13px, 1.3vw, 15px);
  line-height: 1.7;
  letter-spacing: .02em;
}

/* ---------- Services: four square tiles + one shared detail panel ---------- */
.services {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line-strong);
  border-left: 1px solid var(--line);
}
.service { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.service__tile {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 18px;
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: 18px;
  text-align: left;
  background: var(--bg);
  transition: background .35s var(--ease), color .35s var(--ease);
}
.service__tile:hover { background: var(--bg-soft); }
.service__tile:focus-visible { outline: 1px solid var(--ink); outline-offset: -1px; }
.service__top { display: flex; justify-content: space-between; color: var(--ink-2); }
.service__toggle { display: inline-block; transition: transform .35s var(--ease); }
.service__tile h3 {
  align-self: end;
  font-size: clamp(18px, 2.1vw, 30px);
  font-weight: 500;
  letter-spacing: -.02em;
  line-height: 1.04;
}
.service__sub { color: var(--ink-2); }
.service.is-active .service__tile { background: var(--ink); color: var(--bg); }
.service.is-active .service__top, .service.is-active .service__sub { color: var(--ink-3); }
.service.is-active .service__toggle { transform: rotate(45deg); }

.service-panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .55s var(--ease); }
.service-panel.is-open { grid-template-rows: 1fr; }
.service-panel__inner { overflow: hidden; }

.service-detail {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px 24px;
  padding: 40px 0 48px;
  border-bottom: 1px solid var(--line);
}
.service-detail[hidden] { display: none; }
.service-detail.is-current { animation: detail-in .5s var(--ease) both; }
@keyframes detail-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.service-detail__idx { grid-column: 1; color: var(--ink-2); }
.service-detail__head { grid-column: 2; display: grid; gap: 8px; align-content: start; }
.service-detail__head h4 {
  font-size: clamp(22px, 2.6vw, 36px);
  font-weight: 500;
  letter-spacing: -.02em;
  line-height: 1.05;
}
.service-detail__sub { color: var(--ink-2); }
.service-detail__body {
  grid-column: 3;
  display: grid;
  gap: 1.1em;
  align-content: start;
  max-width: 62ch;
  font-family: var(--mono);
  font-size: clamp(13px, 1.3vw, 15px);
  line-height: 1.55;
  letter-spacing: .02em;
}
.service__key {
  margin-top: .4em;
  font-family: var(--sans);
  font-size: clamp(16px, 1.6vw, 20px);
  font-weight: 500;
  letter-spacing: -.01em;
  line-height: 1.3;
}

.closing {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  padding-top: 64px;
}
.closing__title {
  grid-column: 2;
  font-size: clamp(26px, 3.4vw, 48px);
  font-weight: 500;
  letter-spacing: -.025em;
  line-height: 1.02;
}
.closing__body {
  grid-column: 3;
  display: grid;
  gap: 28px;
  max-width: 62ch;
  font-family: var(--mono);
  font-size: clamp(13px, 1.3vw, 15px);
  line-height: 1.55;
  letter-spacing: .02em;
}
.closing__list { list-style: none; columns: 2; column-gap: 24px; color: var(--ink-2); font-size: inherit; line-height: inherit; text-transform: none; letter-spacing: .02em; }
.closing__text { font-weight: 600; }

/* ---------- Index rows ---------- */
.index { border-top: 1px solid var(--line); }

.row {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 24px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
  transition: padding .25s var(--ease);
}
.row:hover { padding-left: 8px; }
.row__name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row__meta { color: var(--ink-2); text-align: right; white-space: nowrap; }

/* Rows that are links (projects, original music) */
a.row:hover { text-decoration: none; }
a.row:hover .row__name { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.index--projects .row__meta { white-space: normal; max-width: 56ch; }

/* ---------- Clients: a plain typographic list ---------- */
.clients {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px 24px;
  margin-left: 72px;
  font-family: var(--mono);
  font-size: clamp(12px, 1.2vw, 14px);
  line-height: 1.4;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.clients__more { color: var(--ink-2); }

/* ---------- Contact ---------- */
.section--contact { padding-bottom: 96px; }
.contact {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.contact .label { color: var(--ink-2); margin-bottom: 10px; }
.contact__big {
  display: block;
  font-size: clamp(16px, 2vw, 26px);
  font-weight: 500;
  letter-spacing: -.01em;
  text-transform: uppercase;
  word-break: break-word;
}

/* ---------- Project page ---------- */
.project { padding: 36px var(--gutter) 96px; }
.project__back {
  display: inline-flex;
  align-items: center;
  margin-bottom: 28px;
  padding: 6px 10px 5px 8px;
  line-height: 1;
  color: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 2px;
  transition: color .2s, border-color .2s, transform .25s var(--ease);
}
.project__back:hover { color: var(--ink); border-color: var(--ink); text-decoration: none; transform: translateX(-3px); }
.project__back:focus-visible { outline: 1px solid var(--ink); outline-offset: 2px; }
.project__visual {
  position: relative;
  display: grid;
  margin: 0 0 32px;
  overflow: hidden;
}
.project__visual img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 82vh;
  justify-self: start;
}
.project__placeholder {
  position: absolute; inset: 0;
  display: none; align-items: center; justify-content: center;
  color: var(--ink-3);
}
.project__visual.is-empty { aspect-ratio: 3 / 2; max-height: 72vh; background: var(--bg-soft); }
.project__visual.is-empty img { display: none; }
.project__visual.is-empty .project__placeholder { display: flex; }
.project__body {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
}
.project__title {
  grid-column: 2;
  font-size: clamp(28px, 4vw, 56px);
  font-weight: 500;
  letter-spacing: -.03em;
  line-height: 1;
  text-transform: uppercase;
}
.project__text {
  grid-column: 3;
  display: grid;
  gap: 18px;
  align-content: end;
  max-width: 62ch;
  font-family: var(--mono);
  font-size: clamp(13px, 1.4vw, 16px);
  line-height: 1.55;
  letter-spacing: .02em;
}
.project__ig { color: var(--ink-2); }
.project__gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 48px;
}
.project__gallery img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; background: var(--bg-soft); }
.project__nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 64px;
  padding-top: 14px;
  border-top: 1px solid var(--line-strong);
  color: var(--ink-2);
}

/* ---------- Footer ---------- */
.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px var(--gutter);
  border-top: 1px solid var(--line-strong);
  color: var(--ink-2);
}

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(10px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .service-panel, .service__tile, .service__toggle { transition: none; }
  .service-detail.is-current { animation: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .site-header { grid-template-columns: 1fr auto; }
  .header-meta { display: none; }
  .nav-toggle { display: block; }
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: calc(100dvh - var(--header-h));
    overflow-y: auto;
    justify-self: stretch;
    flex-direction: column;
    gap: 0;
    padding: 8px var(--gutter);
    background: var(--bg);
    font-size: 15px;
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 14px 0; border-bottom: 1px solid var(--line); color: var(--ink); }
  .nav a.is-active::after { display: none; }
  .nav__ext { margin-left: 0; }
  .nav .nav__lang { margin-left: 0; padding: 14px 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; line-height: inherit; }

  .section__head { grid-template-columns: 48px 1fr; row-gap: 14px; }
  .project .section__head { grid-template-columns: auto 1fr; }
  .section__aside { display: none; }

  .about, .closing, .project__body { grid-template-columns: 1fr; gap: 16px; }
  .about__main, .about__side, .closing__title, .closing__body, .project__title, .project__text { grid-column: 1; }
  .about__side { margin-top: 12px; justify-self: start; }

  .services { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .service__tile { padding: 14px; gap: 12px; }
  .service-detail { grid-template-columns: 1fr; gap: 10px; padding: 28px 0 36px; }
  .service-detail__idx, .service-detail__head, .service-detail__body { grid-column: 1; }
  .service-detail__body { margin-top: 12px; }
  .closing { padding-top: 48px; }

  .row { grid-template-columns: 1fr; row-gap: 2px; }
  .row__name { white-space: normal; }
  .row__meta { text-align: left; }
  .index--projects .row__meta { max-width: none; }

  .clients { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-left: 0; }
  .contact { grid-template-columns: 1fr; gap: 28px; }
  .project__nav { flex-wrap: wrap; }
  .project__gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 32px; }
  .project__visual img { max-height: none; width: 100%; }
}

@media (max-width: 560px) {
  .closing__list { columns: 1; }
}

/* ---------- Intro: logo first ----------
   The intro is sticky at the top. The site sits underneath it, pulled up by
   (--intro-dist - viewport), and is revealed as the intro fades out. JS drives
   --t (0 at page top, 1 when resolved); everything below derives from it.
   --intro-dist is the scroll distance the whole transition takes: shorter
   means the hero arrives sooner. */
:root { --intro-dist: 300px; --t: 0; }

.intro {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  overflow: hidden;
}
.intro__logo { display: block; width: min(640px, calc(100vw - 64px)); height: auto; will-change: transform, width; }
.intro__foot {
  position: absolute;
  left: var(--gutter); right: var(--gutter); bottom: 28px;
  display: flex; justify-content: space-between; gap: 16px;
  color: var(--ink-2);
}
.intro.is-done { pointer-events: none; }

.site {
  position: relative;
  z-index: 1;
  background: var(--bg);
  margin-top: calc(var(--intro-dist) - 100svh);
}
.site-header .brand__logo { opacity: 0; transition: opacity .3s; }
.site.is-landed .site-header .brand__logo { opacity: 1; }

/* Pages without the intro (project pages) */
.site--page { margin-top: 0; }
.site--page .site-header .brand__logo { opacity: 1; }

@media (max-width: 820px) {
  .intro__foot { flex-direction: column; align-items: center; text-align: center; gap: 6px }
}

@media (prefers-reduced-motion: reduce) {
  .intro { position: relative; }
  .intro__logo { transform: none !important; width: min(640px, calc(100vw - 64px)) !important; }
  .intro__foot { opacity: 1 !important; }
  .site { margin-top: 0; opacity: 1 !important; }
  .site-header .brand__logo { opacity: 1; }
}
