/* AppyOurs front door. One screen that says what we do, one clock that keeps moving by itself,
   and a manifesto page. Palette: dusk plum ground (the sky just after the sun goes, easy on the
   eye at night), two soft glows (violet above, the last warm light near the clock), lilac-white
   paper, a warm gold reserved for happiness, coral only on the dial's second hand. */
@font-face {
  font-family: "Instrument Serif";
  src: url("/a/instrument-serif.679bdf80.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("/a/instrument-serif-italic.0c072eaa.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("/a/instrument-sans.7f88d7ac.woff2") format("woff2");
  font-weight: 400 700; font-stretch: 75% 100%; font-display: swap;
}

:root {
  /* Every text colour is >= 4.5:1 on the ground (ink 16:1, soft ink 10:1, sun 11:1). */
  --ground: #21173a;
  --ground-deep: #150e27;
  --ink: #fbf6ff;
  --ink-soft: #cdc2e6;
  --ink-quiet: #a99cc8;
  --rule: rgb(251 246 255 / 0.12);
  --sun: #ffc94a;
  --pop: #ff6f61;
  --dial: #fbf6ff;
  --dial-tick: #1d1433;
  --dial-edge: rgb(20 12 40 / 0.3);
  --hand-shadow: rgb(20 12 40 / 0.22);
  --lift: rgb(8 4 20 / 0.6);
  --glow: rgb(255 201 74 / 0.24);
  --glow-on: 0;
  --sky-violet: rgb(150 100 255 / 0.2);
  --sky-warm: rgb(255 140 90 / 0.14);
  --card: rgb(251 246 255 / 0.05);

  --serif: "Instrument Serif", ui-serif, Georgia, serif;
  --sans: "Instrument Sans", ui-sans-serif, system-ui, sans-serif;
  --gutter: clamp(16px, 5.4vw, 72px);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  --enter-delay: 300ms;
  --word-stagger: 38ms;

  /* Portrait (phones): the page scrolls, so sizes follow the width only. Landscape caps by height
     so desktop stays one screen. */
  --clock: min(72vw, 420px);
  --glow-reach: -18%;   /* 72vw clock + 2 x 18% glow stays inside the screen */
  --mark: calc((100vw - 2 * var(--gutter)) / 3.8);
  --tagline: clamp(1.5rem, min(7.4vw, 4.2dvh), 2.5rem);
  --caption: clamp(1rem, min(4.2vw, 2.3dvh), 1.2rem);
  --small: 0.875rem;
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
/* The sky lives on the root so it covers the whole page; the clock's glow must never widen it. */
html {
  min-height: 100%; overflow-x: hidden; overflow-x: clip;
  background:
    radial-gradient(80% 50% at 0% 0%, var(--sky-violet), transparent 70%),
    radial-gradient(70% 45% at 85% 70%, var(--sky-warm), transparent 70%),
    var(--ground);
}
body {
  overflow-x: clip;
  min-height: 100dvh;
  padding: max(calc(var(--gutter) * 0.6), env(safe-area-inset-top)) max(var(--gutter), env(safe-area-inset-right))
           max(calc(var(--gutter) * 0.6), env(safe-area-inset-bottom)) max(var(--gutter), env(safe-area-inset-left));
  color: var(--ink);
  font-family: var(--sans);
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  font-kerning: normal;
  -webkit-tap-highlight-color: transparent;
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
[tabindex="-1"]:focus { outline: none; }
:focus-visible { outline: 2px solid var(--sun); outline-offset: 3px; border-radius: 4px; }
a { color: inherit; }

/* ---- header: sound on the left, the logo on the right ------------------------------------ */
.bar { display: flex; align-items: center; justify-content: space-between; min-height: 48px; position: relative; z-index: 2; }
.brand {
  font: 400 clamp(1.75rem, 6.2vw, 2.25rem)/1 var(--serif); letter-spacing: -0.01em; color: var(--ink);
  text-decoration: none; padding: 8px 0; margin-left: auto;
}
.brand:hover { color: var(--sun); }
.ctl {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; min-width: 40px; padding: 0 14px 0 12px; border-radius: 999px;
  border: 1px solid var(--rule); background: transparent; color: var(--ink);
  font: 500 var(--small)/1 var(--sans); letter-spacing: 0.01em; cursor: pointer;
  transition: border-color 0.3s;
}
.ctl:hover { border-color: var(--ink-soft); }
.ctl svg { width: 18px; height: 18px; fill: currentColor; flex: none; }
.i-sound rect { transform-box: fill-box; transform-origin: 50% 50%; transform: scaleY(0.5); transition: transform 0.6s var(--ease-out); }
:root[data-music] .ctl-sound { border-color: var(--sun); }
:root[data-music] .i-sound rect { fill: var(--sun); animation: breathe 1.62s var(--ease-in-out) infinite alternate; }
:root[data-music] .i-sound .b2 { animation-delay: -0.54s; }
:root[data-music] .i-sound .b3 { animation-delay: -1.08s; }
@keyframes breathe { from { transform: scaleY(0.45); } to { transform: scaleY(1); } }

/* ---- home: words, then the clock ---------------------------------------------------------- */
/* Portrait: one column that scrolls if it must: name, clock, then the words. Nothing overlaps. */
body.home { display: grid; grid-template-rows: auto 1fr auto; min-height: 100dvh; }
.stage {
  display: flex; flex-direction: column; align-items: flex-start; gap: clamp(14px, 3dvh, 28px);
  padding: clamp(4px, 1.5dvh, 16px) 0 clamp(28px, 5dvh, 56px); position: relative;
}
.copy { display: contents; }
.mark { order: 1; }
.clock { order: 2; width: var(--clock); aspect-ratio: 1; position: relative; align-self: center; margin: clamp(4px, 2dvh, 20px) 0; }
.tagline { order: 3; }
.caption { order: 4; }
.cta { order: 5; }
/* The dial is a lit object: a lilac-white disc with a fine edge and a deep shadow on the blue. */
.clock::before {
  content: ""; position: absolute; inset: 3%; border-radius: 50%; background: var(--dial);
  box-shadow: 0 0 0 1px var(--dial-edge), 0 2px 3px -1px var(--lift), 0 24px 48px -18px var(--lift), 0 60px 90px -40px var(--lift);
}
.clock::after {
  content: ""; position: absolute; inset: var(--glow-reach); border-radius: 50%; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, var(--glow), transparent);
  opacity: var(--glow-on); transition: opacity 1.6s var(--ease-in-out);
}
:root[data-reveal] { --glow-on: 1; }
.dial { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.ticks-minute { stroke: var(--dial-tick); opacity: 0.5; fill: none; }
.ticks-hour { stroke: var(--dial-tick); fill: none; }
.hands, .hub { fill: var(--dial-tick); }
.shadow { fill: var(--hand-shadow); }
.second { fill: var(--pop); }
.mouth { stroke: var(--dial-tick); fill: none; stroke-linecap: round; }

/* ---- type -------------------------------------------------------------------------- */
.mark { font: 400 var(--mark)/0.86 var(--serif); letter-spacing: -0.028em; color: var(--ink); width: fit-content; padding-bottom: 0.06em; }
.name { white-space: nowrap; display: inline-block; }
/* The two guests: h + appy + h + ours. They open room for themselves and drop in, italic and
   in the sun colour, whenever the clock smiles (or the name is hovered). No labels, no arrows. */
.x { display: inline-block; max-width: 0; transition: max-width 1.1s var(--ease-in-out) 0.12s; }
.x i {
  display: inline-block; font-style: italic; color: var(--sun); letter-spacing: 0;
  opacity: 0; transform: translateY(-0.32em) rotate(-10deg) scale(0.7); transform-origin: 40% 90%;
  transition: opacity 0.35s ease-in, transform 0.6s ease-in;
}
:root[data-reveal] .x { max-width: 0.43em; transition: max-width 1.1s var(--ease-in-out); }
:root[data-reveal] .x i { opacity: 1; transform: none; transition: opacity 0.7s ease-out 0.45s, transform 1.2s var(--ease-spring) 0.45s; }
:root[data-reveal] .x ~ .x i { transition-delay: 0.6s; }

.tagline { font: 400 var(--tagline)/1.08 var(--serif); letter-spacing: -0.01em; max-width: 19ch; text-wrap: balance; }
.tagline .em { font-style: italic; color: var(--sun); }
.caption { font: 400 var(--caption)/1.45 var(--sans); color: var(--ink-soft); max-width: 34ch; text-wrap: pretty; }
.cta {
  display: inline-flex; align-items: center; gap: 0.6em; min-height: 48px;
  font: 600 var(--small)/1 var(--sans); letter-spacing: 0.02em; color: var(--ground-deep); background: var(--sun);
  padding: 0 1.3em; border-radius: 999px; text-decoration: none; transition: transform 0.4s var(--ease-spring);
}
.cta:hover { transform: translateY(-2px); }
.cta span { transition: transform 0.4s var(--ease-spring); }
.cta:hover span { transform: translateX(3px); }

/* The home page text cascades in word by word, once, on load. Nothing here depends on scrolling. */
.w { display: inline-block; opacity: 0; transform: translateY(0.4em); animation: rise 1.1s var(--ease-out) both; animation-delay: calc(var(--enter-delay) + var(--i, 0) * var(--word-stagger)); }
.mark .name { animation: rise 1.4s var(--ease-out) both; }
.cta, .caption { animation: fade 1.2s ease-out 1.1s both; }
@keyframes rise { from { opacity: 0; transform: translateY(0.4em); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.foot { min-height: 44px; display: flex; align-items: center; justify-content: space-between; font: 400 var(--small)/1 var(--sans); color: var(--ink-soft); position: relative; z-index: 2; }
.foot a { text-underline-offset: 0.35em; text-decoration-thickness: 1px; display: inline-flex; align-items: center; min-height: 44px; }

/* ---- landscape: words on the left, the clock on the right -------------------------------- */
@media (min-aspect-ratio: 5/4) {
  :root {
    --clock: min(40vw, 64dvh, 700px);
    --glow-reach: -22%;
    --mark: min(calc(52vw / 4.25), 20dvh);
    --tagline: clamp(1.6rem, min(3.2vw, 6dvh), 3.4rem);
    --caption: clamp(1rem, min(1.4vw, 2.8dvh), 1.3rem);
  }
  body.home { height: 100dvh; overflow: hidden; grid-template-rows: auto minmax(0, 1fr) auto; }
  .stage {
    display: grid; grid-template-rows: minmax(0, 1fr); grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
    align-items: center; column-gap: clamp(24px, 4vw, 80px); min-height: 0; padding: 0;
  }
  .copy { display: block; align-self: center; grid-column: 1; grid-row: 1; }
  .clock { grid-column: 2; grid-row: 1; justify-self: center; margin: 0; }
  .tagline { margin-top: 0.7em; }
  .caption { margin-top: 0.9em; }
  .cta { margin-top: 1.3em; }
}
@media (min-aspect-ratio: 5/4) and (max-height: 520px) {
  :root { --clock: min(36vw, 62dvh); --mark: min(10vw, 22dvh); --tagline: clamp(1.2rem, 5dvh, 1.8rem); --caption: clamp(0.85rem, 3.6dvh, 1rem); }
  .bar { min-height: 38px; }
  .caption { display: none; }
}

/* ---- manifesto page ----------------------------------------------------------------- */
/* House rules: each rule is one short serif line you can read at a glance, with one quiet sans
   sentence under it. The first rule is set larger (it frames the rest) and the last one gets its own
   lit card (it is what people remember). No dividers: space does the separating. */
.doc { max-width: 40rem; margin: 0 auto; padding: clamp(28px, 8dvh, 96px) 0 clamp(48px, 10dvh, 120px); }
.doc .kicker { font: 600 var(--small)/1 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--sun); }
.doc h1 { font: 400 clamp(3.4rem, 15vw, 7rem)/0.9 var(--serif); letter-spacing: -0.03em; margin: 0.22em 0 0.4em; }
.doc h1 em { font-style: italic; color: var(--sun); }
.intro { font: 400 clamp(1.1rem, 4.4vw, 1.3rem)/1.6 var(--sans); color: var(--ink-soft); max-width: 32em; text-wrap: pretty; }
.intro em { font-style: normal; color: var(--ink); }
.rules { list-style: none; counter-reset: r; margin-top: clamp(48px, 10dvh, 104px); display: grid; gap: clamp(30px, 5.5dvh, 48px); }
.rules li { counter-increment: r; display: grid; grid-template-columns: 2.75rem 1fr; align-items: baseline; }
.rules li::before { content: counter(r, decimal-leading-zero); font: 600 0.8rem/1 var(--sans); letter-spacing: 0.08em; color: var(--sun); }
.rules h2 { font: 400 clamp(1.6rem, 6.4vw, 2.3rem)/1.1 var(--serif); letter-spacing: -0.012em; text-wrap: balance; }
.rules h2 em { font-style: italic; color: var(--sun); }
.rules p { grid-column: 2; margin-top: 0.5em; font: 400 1rem/1.55 var(--sans); color: var(--ink-soft); max-width: 30em; text-wrap: pretty; }
.rules .lead h2 { font-size: clamp(2.2rem, 9vw, 3.3rem); line-height: 1; }
.rules .lead p { font-size: 1.1rem; }
.rules .finale {
  margin-top: clamp(16px, 4dvh, 40px); padding: clamp(28px, 7vw, 52px) clamp(22px, 6vw, 48px);
  border-radius: 32px; background: var(--card); box-shadow: inset 0 0 0 1px var(--rule);
  grid-template-columns: 1fr;
}
.rules .finale::before { margin-bottom: 1.2em; }
.rules .finale h2 { font-size: clamp(2.6rem, 11.5vw, 4.6rem); line-height: 0.95; letter-spacing: -0.025em; }
.rules .finale p { grid-column: 1; font-size: clamp(1.05rem, 4.2vw, 1.25rem); color: var(--ink); margin-top: 0.8em; }
.sign { margin-top: clamp(40px, 9dvh, 88px); font: italic 400 clamp(1.6rem, 6vw, 2.4rem)/1.1 var(--serif); color: var(--ink-soft); }
.sign a { font: 600 var(--small)/1 var(--sans); letter-spacing: 0.02em; display: inline-flex; align-items: center; min-height: 44px; margin-top: 1.2em; font-style: normal; color: var(--ink); text-underline-offset: 0.35em; }
.doc > * { animation: fade 1s ease-out both; }

/* ---- 404 --------------------------------------------------------------------------- */
.lost .caption a { color: var(--sun); }

/* ---- no JavaScript: the name, the line and the 10:10 clock -------------------------------- */
@media (scripting: none) { .ctl { display: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0s !important; transition-delay: 0s !important; }
  .w, .mark .name { opacity: 1; transform: none; }
}
.w:nth-child(1){--i:0}.w:nth-child(2){--i:1}.w:nth-child(3){--i:2}.w:nth-child(4){--i:3}.w:nth-child(5){--i:4}.w:nth-child(6){--i:5}.w:nth-child(7){--i:6}.w:nth-child(8){--i:7}.w:nth-child(9){--i:8}.w:nth-child(10){--i:9}.w:nth-child(11){--i:10}.w:nth-child(12){--i:11}.w:nth-child(13){--i:12}.w:nth-child(14){--i:13}.w:nth-child(15){--i:14}.w:nth-child(16){--i:15}
