:root {
  /* brand and paper are also set from js/palette.js so the world and the page match */
  --paper: #ECEBE7;
  --brand: #3341F0;
  --ink: #1C1E23;
  --ink-2: #50545D;
  --plaster: #F9F8F5;
  --line: rgba(28, 30, 35, 0.14);
  --font: "Readex Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(20px, 5vw, 72px);
  --t-small: 0.875rem;
  --t-body: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  --t-h2: clamp(2.1rem, 1.5rem + 2.4vw, 3.7rem);
  --t-h1: clamp(2.5rem, 1.6rem + 3.4vw, 4.9rem);
}

* { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); font-family: var(--font); -webkit-font-smoothing: antialiased; }
body { margin: 0; overflow-x: hidden; }
h1, h2 { font-weight: 500; letter-spacing: -0.03em; margin: 0; text-wrap: balance; }
p { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 4px; }

.skip { position: absolute; left: 12px; top: -48px; z-index: 30; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 8px; text-decoration: none; }
.skip:focus { top: 12px; }

/* ------------------------------------------------------------------ top bar */
/* The same header on every page (markup in index.html; menu behaviour in js/nav.js).
   Pages other than home add class="bar-solid" to <html> for a solid backing from the start. */
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 20; height: 72px;
  display: flex; align-items: center; gap: clamp(16px, 2.6vw, 34px);
  padding: 0 var(--gutter);
  pointer-events: none;
  transition: background-color 200ms ease, box-shadow 200ms ease;
}
.bar > * { pointer-events: auto; }
.bar-solid .bar, .past-story .bar, .bar.open {
  pointer-events: auto; background: color-mix(in srgb, var(--paper) 94%, transparent); box-shadow: 0 1px 0 var(--line);
}
.mark { display: inline-flex; align-items: center; gap: 10px; margin-right: auto; text-decoration: none; font-weight: 600; font-size: 1.15rem; letter-spacing: -0.02em; }
.bar-nav { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 30px); font-size: 0.95rem; }
.bar-nav a:not(.btn) { text-decoration: none; color: var(--ink-2); padding: 8px 0; }
.bar-nav a:not(.btn):hover, .bar-nav a[aria-current="page"] { color: var(--ink); }
.bar-nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--brand); }
.bar-nav .nav-book { display: none; } /* the phone menu's copy of the booking button */
.bar-actions { display: flex; align-items: center; gap: 10px; }
.signin {
  display: inline-flex; align-items: center; gap: 7px; min-height: 42px; padding: 0 16px;
  border-radius: 999px; text-decoration: none; color: var(--ink); font-size: 0.95rem; font-weight: 500;
  background: color-mix(in srgb, var(--plaster) 80%, transparent); box-shadow: inset 0 0 0 1px var(--line);
  transition: box-shadow 160ms ease;
}
.signin:hover { box-shadow: inset 0 0 0 1px var(--ink); }
.menu-btn { display: none; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand); color: #fff; text-decoration: none; border: 0; cursor: pointer;
  font: 500 0.95rem/1 var(--font); padding: 12px 18px; border-radius: 999px;
  transition: transform 160ms ease, background-color 160ms ease;
}
.bar .btn { white-space: nowrap; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

/* ------------------------------------------------------------------ the scroll story */
.story { position: relative; height: calc(var(--steps, 8) * 105svh); }
.story-stage { position: sticky; top: 0; height: 100svh; overflow: hidden; }
#world { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.scrim {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--paper) 85%, transparent) 0, transparent 96px),
    linear-gradient(0deg, color-mix(in srgb, var(--paper) 92%, transparent) 0, transparent 120px),
    linear-gradient(90deg, color-mix(in srgb, var(--paper) 94%, transparent) 0%,
      color-mix(in srgb, var(--paper) 78%, transparent) 26%, transparent 50%);
}

.steps article {
  position: absolute; left: var(--gutter); bottom: clamp(110px, 17vh, 180px);
  width: min(31rem, calc(100vw - 2 * var(--gutter)));
  opacity: 0; pointer-events: none; will-change: opacity, transform;
}
.steps .num { font-size: var(--t-small); color: var(--brand); font-weight: 500; margin-bottom: 14px; font-variant-numeric: tabular-nums; }
.steps h2 { font-size: var(--t-h2); line-height: 1.02; margin-bottom: 18px; }
.steps p:not(.num):not(.hint) { font-size: var(--t-body); line-height: 1.6; color: var(--ink-2); max-width: 36ch; }
.steps .intro { width: min(40rem, calc(100vw - 2 * var(--gutter))); bottom: clamp(120px, 22vh, 240px); }
.steps .intro h1 { font-size: var(--t-h1); line-height: 0.98; margin-bottom: 22px; }
.hint { display: flex; align-items: center; gap: 12px; margin-top: 30px; font-size: var(--t-small); color: var(--ink-2); }
.hint span { width: 1px; height: 34px; background: var(--ink); transform-origin: top; animation: drip 2.2s ease-in-out infinite; }
@keyframes drip { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

/* step rail */
.rail {
  position: absolute; left: var(--gutter); right: var(--gutter); bottom: 28px;
  display: flex; gap: 0; margin: 0; padding: 0; list-style: none;
  border-top: 1px solid var(--line);
}
.rail li { flex: 1; }
.rail button {
  all: unset; box-sizing: border-box; cursor: pointer; width: 100%;
  display: flex; gap: 8px; align-items: baseline; padding: 12px 8px 4px 0;
  font-size: var(--t-small); color: var(--ink-2); position: relative;
}
.rail button::before { content: ""; position: absolute; left: 0; right: 10px; top: -1px; height: 2px; background: transparent; transition: background-color 200ms ease; }
.rail button:hover { color: var(--ink); }
.rail button[aria-current="step"] { color: var(--ink); }
.rail button[aria-current="step"]::before { background: var(--brand); }
.rail-n { font-variant-numeric: tabular-nums; color: var(--brand); font-weight: 500; }
.rail button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* labels pinned into the 3D town */
.tags { position: absolute; inset: 0; pointer-events: none; }
.tag {
  position: absolute; left: 0; top: 0; white-space: nowrap; visibility: hidden;
  font: 500 0.8rem/1 var(--font); letter-spacing: -0.005em; color: var(--ink);
}
.tag-quiet { color: var(--ink-2); font-size: 0.75rem; }
.tag-lane { font-size: 0.8rem; font-weight: 600; color: var(--ink); }
.tag-tip {
  display: grid; gap: 2px; padding: 8px 11px; border-radius: 10px;
  background: var(--ink); color: #fff; font-weight: 400; font-size: 0.8rem;
}
.tag-tip b { font-weight: 500; font-size: 0.7rem; color: color-mix(in srgb, #fff 65%, transparent); }
.tag-live { background: var(--brand); color: #fff; padding: 6px 10px; border-radius: 999px; }
.tag-mark {
  pointer-events: auto; cursor: pointer; border: 0;
  background: var(--plaster); color: var(--ink); padding: 8px 12px; border-radius: 999px;
  box-shadow: 0 1px 0 var(--line), 0 6px 18px -10px rgba(28, 30, 35, 0.5);
  transition: background-color 160ms ease, color 160ms ease;
}
.tag-mark:hover { background: var(--brand); color: #fff; }

/* loading */
.loading {
  position: absolute; inset: 0; display: grid; place-content: center; gap: 14px; justify-items: center;
  background: var(--paper); transition: opacity 500ms ease, visibility 500ms;
  font-size: var(--t-small); color: var(--ink-2);
}
.loading-bar { width: 160px; height: 2px; background: var(--line); overflow: hidden; }
.loading-bar span { display: block; height: 100%; background: var(--brand); transform-origin: left; transform: scaleX(var(--loaded, 0.08)); transition: transform 200ms ease; }
.loading.done { opacity: 0; visibility: hidden; }

/* ------------------------------------------------------------------ services teaser (home) */
.teaser { padding: clamp(80px, 14vh, 150px) var(--gutter) clamp(60px, 10vh, 110px); }
.teaser h2 { font-size: var(--t-h2); line-height: 1.02; margin-bottom: 18px; }
.teaser-lead { font-size: clamp(1.15rem, 1rem + 0.6vw, 1.5rem); line-height: 1.4; letter-spacing: -0.01em; max-width: 34ch; margin-bottom: 10px; }
.teaser-who { font-size: var(--t-small); color: var(--ink-2); margin-bottom: 32px; }
.teaser-areas { list-style: none; margin: 0 0 36px; padding: 0; display: grid; column-gap: 32px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.teaser-areas a {
  display: block; padding: 20px 0; border-top: 1px solid var(--line);
  font-size: clamp(1.1rem, 1rem + 0.5vw, 1.4rem); font-weight: 500; letter-spacing: -0.02em; text-decoration: none;
  transition: color 160ms ease;
}
.teaser-areas a:hover { color: var(--brand); }

/* ------------------------------------------------------------------ partners */
.partners { position: relative; height: 210svh; }
.partners-stage { position: sticky; top: 0; height: 100svh; overflow: hidden; }
#globe { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: pan-y; }
#globe:active { cursor: grabbing; }
.partners-copy { position: absolute; left: var(--gutter); top: 50%; transform: translateY(-50%); width: min(26rem, calc(100vw - 2 * var(--gutter))); pointer-events: none; }
.partners-copy h2 { font-size: var(--t-h2); line-height: 1.02; margin-bottom: 18px; }
.partners-copy p { font-size: var(--t-body); line-height: 1.6; color: var(--ink-2); max-width: 34ch; }
.partners-copy .aside { margin-top: 18px; font-size: var(--t-small); }
.pin-card {
  position: absolute; left: 0; top: 0; visibility: hidden;
  display: grid; gap: 4px; padding: 12px 14px; border-radius: 12px;
  background: var(--plaster); box-shadow: 0 1px 0 var(--line), 0 14px 30px -18px rgba(28, 30, 35, 0.55);
  font-size: var(--t-small); color: var(--ink-2); white-space: nowrap; pointer-events: none;
}
.pin-card strong { color: var(--ink); font-weight: 600; font-size: 0.95rem; }

/* ------------------------------------------------------------------ contact */
.contact { padding: clamp(80px, 14vh, 160px) var(--gutter) clamp(60px, 10vh, 120px); max-width: 60rem; }
.contact h2 { font-size: var(--t-h1); line-height: 0.98; margin-bottom: 22px; }
.contact p { font-size: var(--t-body); line-height: 1.6; color: var(--ink-2); max-width: 40ch; margin-bottom: 30px; }
.btn-big { font-size: 1.05rem; padding: 16px 24px; }
.book-note { margin-top: 16px; font-size: var(--t-small); }
.foot { padding: 28px var(--gutter); border-top: 1px solid var(--line); font-size: var(--t-small); color: var(--ink-2); }

/* ------------------------------------------------------------------ phones */
@media (max-width: 760px) {
  .bar { height: 64px; }
  /* phones: the links fold into a menu under the bar; Sign in stays visible */
  .bar-nav {
    display: none; position: fixed; top: 64px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 4px var(--gutter) 20px; background: var(--paper);
    box-shadow: 0 1px 0 var(--line), 0 24px 30px -26px rgba(28, 30, 35, 0.45);
  }
  .bar.open .bar-nav { display: flex; }
  .bar-nav a:not(.btn) { padding: 15px 0; font-size: 1.05rem; color: var(--ink); border-bottom: 1px solid var(--line); }
  .bar-nav a[aria-current="page"] { box-shadow: none; color: var(--brand); }
  .bar-nav .nav-book { display: inline-flex; margin-top: 18px; }
  .bar-actions .bar-book { display: none; }
  .signin { min-height: 44px; padding: 0 14px; }
  .menu-btn {
    display: inline-grid; place-items: center; width: 44px; height: 44px; margin-right: -8px;
    border: 0; border-radius: 12px; background: transparent; color: var(--ink); cursor: pointer;
  }
  .btn { padding: 10px 14px; font-size: 0.875rem; }
  .scrim {
    background:
      linear-gradient(180deg, color-mix(in srgb, var(--paper) 85%, transparent) 0, transparent 80px),
      linear-gradient(0deg, color-mix(in srgb, var(--paper) 96%, transparent) 0%, color-mix(in srgb, var(--paper) 88%, transparent) 30%, transparent 47%);
  }
  .steps article, .steps .intro { bottom: 92px; }
  .steps .num { margin-bottom: 8px; }
  .steps h2 { margin-bottom: 10px; }
  .hint { margin-top: 18px; }
  .rail { bottom: 12px; }
  .rail-l { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } /* named for screen readers */
  .rail button { justify-content: center; align-items: center; padding: 0; min-height: 44px; }
  .bar .btn { min-height: 44px; }
  .rail button::before { right: 4px; left: 4px; }
  .tag-mark { display: none; } /* the step rail does this job on phones */
  .tag-lane { font-size: 0.66rem; }
  .partners-stage::after {
    content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
    background: linear-gradient(0deg, var(--paper) 0%, color-mix(in srgb, var(--paper) 85%, transparent) 30%, transparent 52%);
  }
  .partners-copy { top: auto; bottom: 48px; transform: none; z-index: 2; }
  .pin-card { z-index: 2; }
}

/* short phone screens: tighter step text leaves room for the 3D above it */
@media (max-width: 760px) and (max-height: 720px) {
  .steps article, .steps .intro { bottom: 76px; }
  .steps h2 { font-size: 1.7rem; margin-bottom: 8px; }
  .steps .intro h1 { font-size: 2.05rem; margin-bottom: 12px; }
  .steps p:not(.num):not(.hint) { font-size: 0.94rem; line-height: 1.5; }
  .steps .num { margin-bottom: 4px; }
  .hint { margin-top: 12px; }
}

@media (max-width: 380px) {
  .mark { font-size: 1rem; gap: 7px; }
  .bar .btn { padding: 9px 12px; font-size: 0.8rem; }
}

@media (prefers-reduced-motion: reduce) {
  .hint span { animation: none; }
  .btn, .tag-mark, .loading { transition: none; }
}
