:root {
  --bg: #0b0a09;
  --ink: #ece6dc;
  --muted: #8f887d;
  --line: rgba(236, 230, 220, 0.16);
  --warm: 201, 168, 118;
  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  /* The logo is set in a neo-grotesk; the system Helvetica / Arial matches it with no download. */
  --sans: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --gutter: clamp(20px, 5vw, 64px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
::selection { background: rgba(var(--warm), 0.35); color: var(--ink); }
a { color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
a:focus-visible { outline: 1px solid rgba(var(--warm), 0.9); outline-offset: 6px; }

/* ── Header (appears once the hero is left behind) ──────── */
.top {
  position: fixed; inset: 0 0 auto; z-index: 5; display: flex; justify-content: space-between; align-items: center;
  padding: 20px var(--gutter); pointer-events: none;
}
.top::before { content: ''; position: absolute; inset: 0 0 -24px; z-index: -1; background: linear-gradient(var(--bg) 35%, rgba(11, 10, 9, 0)); }
.js .top { opacity: 0; visibility: hidden; }
.js.is-past .top { opacity: 1; visibility: visible; }
.top a { pointer-events: auto; text-decoration: none; }
.top-mark { display: block; width: 52px; padding: 4px 0; }
.top-mark svg { display: block; width: 100%; height: auto; fill: var(--ink); }
.top-link { font-size: 0.9375rem; letter-spacing: 0.02em; color: var(--muted); transition: color 0.4s; }
.top-link:hover, .top-link:focus-visible { color: var(--ink); }

/* ── Atmosphere ─────────────────────────────────────────── */
.progress { position: fixed; right: 18px; top: 50%; z-index: 4; width: 1px; height: 96px; margin-top: -48px; background: var(--line); }
.progress span { display: block; width: 100%; height: 100%; background: var(--ink); transform-origin: top; transform: scaleY(var(--p, 0)); }

main, .foot { position: relative; z-index: 1; }

/* ── Hero: the logo lockup, in the logo's own proportions ─ */
.hero {
  position: relative; min-height: 100svh; display: grid; place-content: center; justify-items: center;
  padding: 96px var(--gutter); text-align: center;
}
.hero-in { display: grid; justify-items: center; }
.brand {
  /* --W is the width of the mark; every part of the lockup is sized from it, as in the logo file. */
  --W: clamp(112px, 13vw, 176px);
  margin: 0; display: grid; justify-items: center; font-weight: 400;
}
.mark { width: var(--W); height: auto; overflow: visible; fill: var(--ink); translate: calc(var(--W) * -0.083) 0; }
.mark .pen { fill: none; stroke: #fff; stroke-width: 8; }
.dash, .blade { transform-box: fill-box; }
.word, .city { display: block; font-family: var(--sans); text-transform: uppercase; white-space: nowrap; }
.word { margin-top: calc(var(--W) * 0.15); font-size: calc(var(--W) * 0.142); letter-spacing: 0.86em; margin-right: -0.86em; line-height: 1; }
.city { margin-top: calc(var(--W) * 0.118); font-size: calc(var(--W) * 0.128); letter-spacing: 0.92em; margin-right: -0.92em; line-height: 1; }
.word .ch, .city .ch { display: inline-block; white-space: pre; }
.tagline {
  margin: clamp(56px, 9vh, 96px) 0 0; font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: clamp(1.25rem, 0.9rem + 1.4vw, 2rem); line-height: 1.3; max-width: 22ch; color: var(--ink);
}
.cue { position: absolute; left: 50%; bottom: 28px; width: 44px; height: 64px; margin-left: -22px; display: grid; place-items: center; }
.cue span { display: block; width: 1px; height: 56px; background: linear-gradient(var(--ink), transparent); transform-origin: top; }

/* ── Chapters ───────────────────────────────────────────── */
.chapter {
  min-height: 92svh; display: grid; align-content: center; justify-items: center; gap: clamp(28px, 4vw, 44px);
  padding: clamp(96px, 14vh, 160px) var(--gutter); text-align: center; position: relative;
}
.chapter::before {
  content: ''; position: absolute; top: 0; left: 50%; width: 1px; height: clamp(56px, 10vh, 110px);
  background: linear-gradient(transparent, var(--line));
}
/* Chapter I follows the hero's scroll line, so it doesn't get a second one. */
#house::before { content: none; }
.index { font-family: var(--serif); font-size: 1.25rem; letter-spacing: 0.08em; color: rgb(var(--warm)); }
.statement {
  margin: 0; max-width: 24ch; font-family: var(--serif); font-weight: 400;
  font-size: clamp(1.85rem, 1rem + 3.4vw, 4.1rem); line-height: 1.12; letter-spacing: -0.01em; text-wrap: balance;
}
.statement + .statement { color: var(--muted); font-size: clamp(1.35rem, 0.9rem + 1.9vw, 2.5rem); max-width: 28ch; }
.statement em { font-style: normal; color: rgb(var(--warm)); }
.w { display: inline-block; white-space: nowrap; }

.note { margin: 0; max-width: 32ch; font-size: clamp(1rem, 0.92rem + 0.35vw, 1.15rem); line-height: 1.7; letter-spacing: 0.02em; color: var(--muted); }
.nos { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 32px; }
.nos li { position: relative; font-size: 1rem; letter-spacing: 0.02em; }
/* A drawn strike rather than text-decoration, so it can be pulled across the words. */
.nos li::after {
  content: ''; position: absolute; left: -4px; right: -4px; top: 52%; height: 1px; background: rgba(var(--warm), 0.85);
}
.private {
  margin: clamp(20px, 4vw, 40px) 0 0; max-width: 16ch; font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: clamp(2.2rem, 1rem + 5vw, 5.6rem); line-height: 1.04; letter-spacing: -0.015em; text-wrap: balance;
}
.private .ch { display: inline-block; white-space: pre; }

/* ── Contact ────────────────────────────────────────────── */
.contact {
  /* A chapter like the others; it shares the last screen with the footer row, so it is a little shorter. */
  min-height: calc(100svh - 120px); padding-bottom: 32px;
}
.contact .label { margin-top: -8px; }
.label { margin: 0; font-weight: 400; font-size: 1rem; letter-spacing: 0.02em; color: var(--muted); }
.mail {
  position: relative; text-decoration: none; font-family: var(--serif); font-weight: 400;
  font-size: clamp(1.3rem, 0.6rem + 3.6vw, 3.6rem); letter-spacing: -0.01em; padding-bottom: 8px;
  overflow-wrap: anywhere;
}
.mail::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: rgb(var(--warm));
  transform: scaleX(0); transform-origin: right; transition: transform 0.9s var(--ease);
}
.mail:hover::after, .mail:focus-visible::after { transform: scaleX(1); transform-origin: left; }
.place { margin: 8px 0 0; font-size: 0.9375rem; letter-spacing: 0.02em; color: var(--muted); }

/* Footer: one quiet row closing the contact block, the logo mark small in the middle. */
.foot { padding: 32px var(--gutter) 28px; }
.foot-brand { display: block; line-height: 0; text-decoration: none; transition: opacity 0.4s; }
.foot-brand:hover, .foot-brand:focus-visible { opacity: 0.7; }
.foot-brand .mark { width: 44px; }
.foot-row {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px 24px;
  font-size: 0.875rem; letter-spacing: 0.01em; color: var(--muted);
}
.foot-row > :first-child { justify-self: start; }
.foot-row > :last-child { justify-self: end; }
.foot-row a { text-decoration: none; transition: color 0.4s; }
.foot-row a:hover, .foot-row a:focus-visible { color: var(--ink); }

/* ── Motion (only when JS runs and motion is allowed) ──── */
@media (prefers-reduced-motion: no-preference) {
  /* Header: hidden over the hero, where the full logo already is. */
  .js .top { transform: translateY(-8px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease), visibility 0s 0.6s; }
  .js.is-past .top { transform: none; transition: opacity 0.8s var(--ease), transform 0.8s var(--ease), visibility 0s; }

  /* Logo intro, about 3.4 s in all:
     0.15 s  first ring drawn by the pen from its open end, second ring 0.3 s behind it, both written anticlockwise like a pen O
     1.25 s  the three blades of the E slide out, top to bottom
     1.55 s  the hyphen opens from its centre, where the rings cross
     1.65 s  the name opens out from the centre into its wide tracking, then Marrakech
     2.5 s   tagline, 3.1 s scroll cue */
  /* The pen strokes live inside SVG masks, where CSS transitions don't run: main.js drives them with SMIL. */

  .js .blade { transform: scaleX(0); transform-origin: 0 50%; }
  .js .is-drawn .blade { transform: none; transition: transform 1.1s var(--ease) 1.25s; }
  .js .is-drawn .blade + .blade { transition-delay: 1.37s; }
  .js .is-drawn .blade + .blade + .blade { transition-delay: 1.49s; }

  .js .dash { transform: scaleX(0); transform-origin: 50% 50%; }
  .js .is-drawn .dash { transform: none; transition: transform 0.9s var(--ease) 1.55s; }

  /* Letters start gathered towards the centre and open out to the logo's tracking. */
  .js .word .ch, .js .city .ch { opacity: 0; transform: translateX(calc(var(--d, 0) * -2.6em)); }
  .js.is-ready .word .ch, .js.is-ready .city .ch {
    opacity: 1; transform: none;
    transition: transform 1.8s var(--ease), opacity 1.2s var(--ease);
    transition-delay: calc(1.65s + var(--a, 0) * 0.22s);
  }
  .js.is-ready .city .ch { transition-delay: calc(1.95s + var(--a, 0) * 0.22s); }

  .js .tagline { opacity: 0; transform: translateY(14px); }
  .js.is-ready .tagline { opacity: 1; transform: none; transition: opacity 1.4s var(--ease) 2.5s, transform 1.4s var(--ease) 2.5s; }
  .js .cue span { transform: scaleY(0); }
  .js.is-ready .cue span { transform: none; transition: transform 1.4s var(--ease) 3.1s; }

  /* Hero recedes as you scroll away from it (--h: 0 → 1). */
  .js .hero-in { transform: translateY(calc(var(--h, 0) * -56px)) scale(calc(1 - var(--h, 0) * 0.04)); opacity: calc(1 - var(--h, 0) * 1.1); }
  .js .cue { opacity: calc(1 - var(--h, 0) * 3); }

  .js [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity 1.3s var(--ease), transform 1.3s var(--ease); }
  .js [data-reveal].in { opacity: 1; transform: none; }
  .js .contact .mail[data-reveal] { transition-delay: 0.12s; }
  .js .contact .place[data-reveal] { transition-delay: 0.24s; }

  .js .statement .w { opacity: 0.08; transform: translateY(0.35em); transition: opacity 1s var(--ease), transform 1.1s var(--ease); transition-delay: calc(var(--i) * 0.04s); }
  .js .statement.in .w { opacity: 1; transform: none; }

  .js .nos li::after { transform: scaleX(0); transform-origin: 0 50%; transition: transform 0.9s var(--ease) 0.7s; }
  .js .nos li:nth-child(2)::after { transition-delay: 0.95s; }
  .js .nos.in li::after { transform: none; }

  /* "Best kept private": the line comes into focus as it reaches the middle of the screen. */
  .js .private .ch { filter: blur(calc(var(--b, 1) * 5px)); opacity: calc(1 - var(--b, 1) * 0.82); }

  .js .chapter::before { transform: scaleY(0); transform-origin: top; transition: transform 1.4s var(--ease); }
  .js .chapter.in::before { transform: scaleY(1); }

}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
@media (max-width: 640px) {
  .progress { display: none; }
  .top { padding: 16px var(--gutter); }
  .top-mark { width: 44px; }
  .foot-row { grid-template-columns: 1fr; justify-items: center; }
  .foot-row > :first-child, .foot-row > :last-child { justify-self: center; }
  .foot-brand { order: -1; margin-bottom: 8px; }
}
