/* Bell & Co. Digital — coming soon
   Palette is sampled from the logo artwork; see build/colors.mjs.

   Structure note: the DEFAULT state of this stylesheet is the FINISHED page.
   Everything the intro animates is visible and in its final position with no
   classes applied, so a visitor with JavaScript off gets the complete page.
   `.js` hides the animated pieces, `.is-intro` runs the sequence, and
   `.is-done` forces the end state (used by the skip control). */

/* Archivo Black, self-hosted. SIL Open Font License 1.1 — see assets/fonts/OFL.txt.
   The weight range is declared 400–900 even though this is a single-weight face:
   the headline asks for 900, and without the range the browser would synthesise
   a fake bold on top of an already-black face and smear it. The unicode-range
   split is kept from Google's own CSS, so latin-ext is only fetched if the copy
   ever needs accented characters. */
@font-face {
  font-family: "Archivo Black";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("assets/fonts/archivo-black-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Archivo Black";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("assets/fonts/archivo-black-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --cream: #f7f3ec;
  --navy: #0d1e3b;
  --script: #25344f;
  --blue: #1355d9;
  --paper: #fffdf8;
  --ease: cubic-bezier(.22, .75, .2, 1);
  --gutter: clamp(20px, 4vw, 64px);
  --badge: clamp(112px, 13vw, 208px);
  --sans: "Archivo Black", "Helvetica Neue", Helvetica, Arial, sans-serif;
  /* deliberately does NOT name Archivo: we only ship Archivo Black, so naming it
     would render differently for the few visitors who happen to have it installed */
  --ui: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

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

html {
  min-width: 320px;
  overflow-x: hidden;
  background: var(--cream);
  color: var(--navy);
}

body {
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  background: var(--cream);
  font-family: var(--ui);
}

img { display: block; max-width: 100%; height: auto; }

.skip-link {
  position: absolute;
  left: -9999px;
  z-index: 200;
  padding: 12px 18px;
  background: var(--navy);
  color: var(--paper);
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none;
}
.skip-link:focus { left: 12px; top: 12px; }

/* ─── layout ─────────────────────────────────────────────────────────── */

.page {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: clamp(20px, 3.5vh, 44px);
  min-height: 100dvh;
  padding:
    max(var(--gutter), env(safe-area-inset-top))
    max(var(--gutter), env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom))
    max(var(--gutter), env(safe-area-inset-left));
  overflow: hidden;
}

.top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.badge-slot {
  width: var(--badge);
  flex: none;
  aspect-ratio: 1;
  transform-origin: center center;
}
.badge { display: block; width: 100%; height: 100%; overflow: visible; }

.coming {
  margin: .4rem 0 0;
  color: var(--script);
  font-size: clamp(.62rem, .75vw, .8rem);
  font-weight: 700;
  letter-spacing: .24em;
  text-transform: uppercase;
  text-align: right;
}
.coming span { color: var(--blue); }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(190px, 24vw, 330px);
  align-items: center;
  gap: clamp(32px, 6vw, 96px);
}

/* The three headline lines are a fixed part of the design and must never wrap.
   Sizing is derived, not guessed: the widest line ("YOUR BUSINESS") measures
   9.03x its font-size once uppercasing and the -.02em tracking are applied, and
   the copy column is roughly (100vw - gutters - photo - gap). 6.35vw keeps the
   longest line at ~92% of the space available across the whole desktop range.
   Do NOT reintroduce a ch-based max-width here: 13ch resolved narrower than the
   real text and silently broke "YOUR BUSINESS" onto two lines. */
.headline {
  margin: 0;
  font-family: var(--sans);
  font-size: clamp(2.3rem, 6.35vw, 6rem);
  font-weight: 900;
  line-height: .97;
  letter-spacing: -.02em;
  text-transform: uppercase;
}
.line { display: block; white-space: nowrap; }
.line--blue { color: var(--blue); }
.line--rule {
  display: inline-block;
  padding-bottom: .06em;
  border-bottom: .055em solid var(--navy);
}

.services {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: clamp(12px, 2.4vw, 40px);
  margin: clamp(24px, 4vh, 48px) 0 0;
  padding: 0;
  list-style: none;
  font-size: clamp(.72rem, 1.1vw, 1.05rem);
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
}
.service { white-space: nowrap; }
.sep { width: 6px; height: 6px; flex: none; background: var(--blue); }

.polaroid {
  width: 100%;
  margin: 0;
  padding: clamp(9px, 1.1vw, 16px) clamp(9px, 1.1vw, 16px) clamp(14px, 1.8vw, 24px);
  background: var(--paper);
  box-shadow: 0 18px 34px rgba(13, 30, 59, .14), 0 2px 5px rgba(13, 30, 59, .08);
  transform: rotate(2.4deg);
}
.mat { overflow: hidden; aspect-ratio: 1; background: #e6ded0; }
.mat img { width: 100%; height: 100%; object-fit: cover; }
.polaroid figcaption {
  margin-top: clamp(10px, 1.3vw, 18px);
  font-size: clamp(.6rem, .72vw, .76rem);
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  text-align: center;
}

.foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: clamp(14px, 2vw, 28px);
  position: relative;
  z-index: 2;
}
.foot-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: clamp(12px, 1.6vw, 24px);
}
.privacy-link {
  color: var(--script);
  font-size: clamp(.58rem, .72vw, .74rem);
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  text-decoration: none;
  opacity: .68;
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
  transition: opacity 160ms ease, color 160ms ease;
}
.privacy-link:hover { opacity: 1; color: var(--blue); }
.privacy-link:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }

.purpose {
  margin: 0;
  color: var(--blue);
  font-size: clamp(.62rem, .8vw, .82rem);
  font-weight: 700;
  letter-spacing: .24em;
  text-transform: uppercase;
}
.email {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 14px 30px;
  border: 2px solid var(--navy);
  background: var(--navy);
  color: var(--cream);
  font-size: clamp(.7rem, .85vw, .84rem);
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color 180ms ease, color 180ms ease;
}
.email:hover { background: var(--blue); border-color: var(--blue); }
.email:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }

.grid-floor {
  position: absolute;
  z-index: 0;
  right: 0;
  bottom: 0;
  left: 0;
  height: clamp(80px, 13vh, 150px);
  perspective: 420px;
  perspective-origin: 50% 0%;
  pointer-events: none;
}
.grid-floor > div {
  position: absolute;
  inset: 0 -25%;
  opacity: .5;
  background-image:
    linear-gradient(var(--blue) 1px, transparent 1px),
    linear-gradient(90deg, var(--blue) 1px, transparent 1px);
  background-size: clamp(38px, 5vw, 64px) clamp(38px, 5vw, 64px);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 32%, #000 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 32%, #000 100%);
  transform: rotateX(62deg);
  transform-origin: bottom center;
}

/* ─── intro: curtain + skip ──────────────────────────────────────────── */

.curtain {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: none;
  background: var(--cream);
}
.js .curtain { display: block; }
.js.is-revealing .curtain { opacity: 0; transition: opacity 420ms ease; }
.js.is-done .curtain { display: none; }

.skip-intro {
  position: fixed;
  z-index: 70;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  padding: 10px 16px;
  border: 1px solid rgba(13, 30, 59, .3);
  border-radius: 2px;
  background: transparent;
  color: var(--script);
  font: inherit;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  cursor: pointer;
}
.skip-intro:hover { border-color: var(--navy); color: var(--navy); }
.skip-intro:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.js.is-done .skip-intro { display: none; }

/* ─── badge: sits in its slot by default, JS lifts it to centre ──────── */

.js.is-intro .badge-slot {
  position: relative;
  z-index: 60;
  transform: translate(var(--ix, 0), var(--iy, 0)) scale(var(--is, 1));
}
.js.is-landing .badge-slot {
  transform: none;
  transition: transform var(--land, 620ms) var(--ease);
}

/* handwriting: the mask is attached only when JS is present */
.js .badge .script { mask: url(#handwriting); }

.pen {
  fill: none;
  stroke: #fff;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}
.js.is-intro .pen {
  animation: pen-draw var(--dur, .1s) linear var(--del, 0s) forwards;
}
@keyframes pen-draw { to { stroke-dashoffset: 0; } }

/* DIGITAL letters + flanking dots: crisp step-on, no fade.
   jump-start, NOT the usual steps(1, end): for steps(n, end) the output is
   floor(progress * n) / n, which for n = 1 is 0 across the whole animation and
   stays 0 even when filled forwards -- the letter would never appear. jump-start
   flips to the end value the instant the delay elapses, which is what we want. */
.js .dig, .js .flank { opacity: 0; }
.js.is-intro .dig,
.js.is-intro .flank { animation: step-on .01s steps(1, jump-start) var(--del, 0s) forwards; }
@keyframes step-on { from { opacity: 0; } to { opacity: 1; } }

.underline { transform-origin: 44.7px 203.4px; }
.js .underline { transform: scaleX(0); }
.js.is-intro .underline { animation: rule-out .34s var(--ease) var(--del, 0s) forwards; }
@keyframes rule-out { to { transform: scaleX(1); } }

/* the chase orb rides the generated `orb-run` keyframes (see index.html) */
.orb { opacity: 0; }
.js.is-intro .orb {
  animation:
    orb-run var(--orb-dur, .9s) linear var(--orb-del, 2s) both,
    orb-flash .01s steps(1, jump-start) var(--orb-del, 2s) forwards,
    orb-out .01s steps(1, jump-start) calc(var(--orb-del, 2s) + var(--orb-dur, .9s)) forwards;
}
@keyframes orb-flash { from { opacity: 0; } to { opacity: 1; } }
@keyframes orb-out { from { opacity: 1; } to { opacity: 0; } }

/* the ring is plain vector: it scales with the badge, so no thickness snap */
.ring {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  transform: rotate(-90deg);
  transform-origin: 160.39px 159.45px;
}
.js .ring { stroke-dashoffset: 1; }
.js.is-intro .ring {
  animation: ring-draw var(--ring-dur, 1s) var(--ease) var(--ring-del, 3.3s) forwards;
}
@keyframes ring-draw { to { stroke-dashoffset: 0; } }

/* ─── page content reveal ────────────────────────────────────────────── */

.js .r { opacity: 0; transform: translateY(16px); }
.js .r.polaroid { transform: translateY(-26px) rotate(6deg) scale(.97); }
.js.is-revealing .r {
  opacity: 1;
  transform: none;
  transition:
    opacity 620ms var(--ease) var(--rd, 0ms),
    transform 620ms var(--ease) var(--rd, 0ms);
}
.js.is-revealing .r.polaroid { transform: rotate(2.4deg); }
.r-1 { --rd: 40ms; }  .r-2 { --rd: 0ms; }    .r-3 { --rd: 90ms; }
.r-4 { --rd: 170ms; } .r-5 { --rd: 250ms; }  .r-6 { --rd: 320ms; }
.r-7 { --rd: 390ms; } .r-8 { --rd: 470ms; }

/* skip / finished: drop straight to the end state */
.js.is-done .pen,
.js.is-done .dig,
.js.is-done .flank,
.js.is-done .underline,
.js.is-done .ring,
.js.is-done .orb,
.js.is-done .r,
.js.is-done .badge-slot { animation: none !important; transition: none !important; }
.js.is-done .pen { stroke-dashoffset: 0; }
.js.is-done .dig,
.js.is-done .flank { opacity: 1; }
.js.is-done .underline { transform: scaleX(1); }
.js.is-done .ring { stroke-dashoffset: 0; }
.js.is-done .orb { opacity: 0; }
.js.is-done .badge-slot { transform: none; }
.js.is-done .r { opacity: 1; transform: none; }
.js.is-done .r.polaroid { transform: rotate(2.4deg); }

/* ─── document pages (privacy policy) ────────────────────────────────── */
/* Plain static pages. They deliberately carry none of the intro machinery:
   no `js` class, no mask, no curtain — just the logo and readable prose. */

.doc-page {
  min-height: 100dvh;
  padding:
    max(28px, env(safe-area-inset-top))
    max(var(--gutter), env(safe-area-inset-right))
    max(48px, env(safe-area-inset-bottom))
    max(var(--gutter), env(safe-area-inset-left));
}
.doc-head { margin-bottom: clamp(28px, 5vh, 56px); }
.doc-logo { display: block; width: clamp(84px, 9vw, 118px); }
.doc-logo img { width: 100%; height: auto; }
.doc-logo:focus-visible { outline: 3px solid var(--blue); outline-offset: 6px; }

.doc {
  max-width: 68ch;
  color: var(--script);
  font-size: clamp(1rem, 1.05vw, 1.075rem);
  line-height: 1.65;
}
.doc h1 {
  margin: 0 0 .35rem;
  color: var(--navy);
  font-family: var(--sans);
  font-size: clamp(2rem, 4.4vw, 3.25rem);
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: -.02em;
  text-transform: uppercase;
}
.doc-meta {
  margin: 0 0 clamp(24px, 4vh, 40px);
  color: var(--script);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  opacity: .6;
}
.doc .lede {
  margin: 0 0 clamp(28px, 4vh, 44px);
  padding-bottom: clamp(20px, 3vh, 32px);
  border-bottom: 2px solid var(--navy);
  font-size: clamp(1.06rem, 1.25vw, 1.2rem);
  line-height: 1.6;
}
.doc h2 {
  margin: clamp(30px, 4.4vh, 46px) 0 .5rem;
  color: var(--navy);
  font-size: clamp(.76rem, .92vw, .88rem);
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
}
.doc p { margin: 0 0 1rem; }
.doc ul { margin: 0 0 1rem; padding-left: 1.15rem; }
.doc li { margin-bottom: .5rem; }
.doc strong { color: var(--navy); }
.doc a { color: var(--blue); text-underline-offset: 3px; }
.doc a:hover { color: var(--navy); }
.doc a:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

.doc-back {
  margin-top: clamp(36px, 6vh, 64px);
  padding-top: clamp(20px, 3vh, 28px);
  border-top: 1px solid rgba(13, 30, 59, .18);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.doc-back a { text-decoration: none; }
.doc-back a:hover { text-decoration: underline; }

/* ─── responsive ─────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(28px, 5vh, 44px);
  }
  /* single column here, so the copy column is 100vw minus the two gutters.
     9.5vw keeps the longest line inside that down to a 320px screen. */
  .headline { font-size: clamp(1.85rem, 9.5vw, 3.4rem); }
  .polaroid { align-self: flex-end; width: min(74vw, 300px); margin-left: auto; }
  .foot { flex-direction: column; align-items: flex-start; }
  .email { width: min(100%, 260px); }
}

@media (max-width: 420px) {
  .coming { max-width: 9ch; line-height: 1.6; }
  .services { gap: 10px 14px; }
  .service { font-size: .7rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-delay: 0ms !important;
    transition-duration: .001ms !important;
    transition-delay: 0ms !important;
  }
  .curtain { display: none !important; }
  .skip-intro { display: none !important; }
  .badge-slot { transform: none !important; }
  .js .badge .script { mask: none; }
  .js .r { opacity: 1; transform: none; }
  .js .r.polaroid { transform: rotate(2.4deg); }
  .js .dig, .js .flank { opacity: 1; }
  .js .underline { transform: scaleX(1); }
  .js .ring { stroke-dashoffset: 0; }
  .js .orb { opacity: 0; }
}
