/* turner.haus
   Every colour in the scene is a custom property. scene.js rewrites them for the visitor's local
   time; the values in the first block are the no-JS default (dusk, 19:10). */

@font-face {
  font-family: "Fraunces Haus"; /* Fraunces (SIL OFL 1.1), subset to the glyphs used here: fonts/OFL.txt */
  src: url("/fonts/fraunces-haus.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: fallback;
}

:root {
  /* @defaults-start */
  --sky0: #2a3972; --sky1: #5d5894; --sky2: #bb7a8f; --sky3: #f2a277; --far: #716a76; --far-tree: #606067;
  --mid: #5d6454; --mid-tree: #485545; --near: #465c3a; --fore: #2b472c; --tuft: #213d25; --path: #9c7468;
  --stone: #8d6f74; --wall: #7e2b22; --wall-dark: #581c17; --roof: #33273d; --roof-dark: #231a2c;
  --trim: #a78894; --door: #233e46; --door-dark: #172b31; --glass: #747692; --brick: #662720;
  --brick-dark: #4d1b18; --trunk: #4b2c25; --leaf: #385337; --leaf-hi: #4a623f; --pine: #26433a;
  --pine-dark: #1c352e; --bush: #355131; --bush-hi: #465f3d; --fence: #a68692; --smoke: #a1869d;
  --curtain: #a37f7b; --flower: #ad4949; --box: #553026; --cloud: #c594a3; --cloud-shade: #c28b9c;
  --cloud-o: .717; --glow: #ff9166; --glow-o: .678; --stars: .244; --l2: 1.000; --l0: 1.000; --l1: 1.000;
  --l1b: 1.000; --l6: 1.000; --l3: 1.000; --l4: 1.000; --l5: .978; --cat: .000; --sun-p: 1.0128; --sun-o: .676;
  --moon-p: .0145; --moon-o: 1.000; --sun: #ff8f57; --orb-p: .0145; --ink: #fff7ea; --ink-inv: #141b38;
  --halo: rgb(8 12 32 / .35); --scrim: rgb(8 10 31 / 0.00); --dot: #ffc061; --dot-glow: rgb(255 176 74 / .55);
  /* @defaults-end */

  /* geometry: the landscape artwork is 700×900 units and --s is pixels per unit. Phones see at
     least its middle 620 units; elsewhere it takes ~80% of the height and scenery spills sideways. */
  --s: min(100vw / 620, 80svh / 900);
  --hz: calc(100dvh - var(--s) * 430);   /* horizon (top of the far hills) inside the fixed scene */
  --hz-v: calc(100svh - var(--s) * 430); /* the same line, for laying out the text */
  --ry: calc(var(--hz) * .46);           /* sun/moon arc: half-height … */
  --rx: min(44vw, var(--ry) * 1.6);      /* … and half-width */
  --orb-r: clamp(18px, calc(var(--s) * 40), 80px);
}
@supports not (height: 1dvh) {
  :root { --s: min(100vw / 620, 80vh / 900); --hz: calc(100vh - var(--s) * 430); --hz-v: var(--hz); }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  background: var(--sky0);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overscroll-behavior: none;
}
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  color: var(--ink);
  font: 400 1rem/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ---------- the scene (decorative, aria-hidden) ---------- */
.scene { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.sky {
  position: absolute;
  inset: 0;
  background: linear-gradient(var(--sky0), var(--sky1) calc(var(--hz) * .42), var(--sky2) calc(var(--hz) * .78), var(--sky3) var(--hz));
  background: linear-gradient(in oklab, var(--sky0), var(--sky1) calc(var(--hz) * .42), var(--sky2) calc(var(--hz) * .78), var(--sky3) var(--hz));
}

.sky::after { /* deepens (or lightens) the upper sky while it is mid-tone, keeping the text at 4.5:1+ */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(var(--scrim), var(--scrim) calc(var(--hz) * .46), transparent calc(var(--hz) * .72));
}

.stars { position: absolute; inset: 0; opacity: var(--stars); }
[data-night="0"] .stars { display: none; }
.starfield { position: absolute; inset: 0; fill: #fff9ec; }
.starfield .d { opacity: .5; }
.t1, .t2, .t3 { animation: twinkle 4.2s ease-in-out infinite; }
.t2 { animation-duration: 5.7s; animation-delay: -2.1s; }
.t3 { animation-duration: 3.3s; animation-delay: -1.3s; }
@keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: .2; } }
@media (max-width: 640px) { .starfield .o { display: none; } }

.meteor {
  position: absolute;
  top: 9%;
  left: 68%;
  width: 140px;
  height: 1.5px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgb(255 251 240 / .95), rgb(255 251 240 / 0));
  rotate: -26deg;
  opacity: 0;
  animation: meteor 19s linear 7s infinite;
}
@keyframes meteor {
  0%, 94% { opacity: 0; translate: 0 0; }
  95% { opacity: 1; }
  99%, 100% { opacity: 0; translate: -300px 146px; }
}

/* sun, moon, their glow and the button that sits on whichever is up: all ride one arc */
.glow, .sun, .moon, .orb {
  position: absolute;
  left: 0;
  top: 0;
  translate: calc(50vw - var(--rx) * cos(var(--p) * 180deg) - 50%) calc(var(--hz) - var(--ry) * sin(var(--p) * 180deg) - 50%);
}
.glow {
  --p: var(--sun-p);
  width: calc(var(--ry) * 4.4);
  height: calc(var(--ry) * 2.1);
  background: radial-gradient(closest-side, var(--glow), color-mix(in srgb, var(--glow) 32%, transparent) 42%, transparent);
  opacity: var(--glow-o);
}
.sun, .moon { width: calc(var(--orb-r) * 2); height: calc(var(--orb-r) * 2); border-radius: 50%; }
.sun {
  --p: var(--sun-p);
  opacity: var(--sun-o);
  background: radial-gradient(circle, #fffdf4 0 38%, var(--sun) 78%);
  box-shadow: 0 0 0 calc(var(--orb-r) * .3) color-mix(in srgb, var(--sun) 24%, transparent),
    0 0 calc(var(--orb-r) * 2.2) calc(var(--orb-r) * .5) color-mix(in srgb, var(--sun) 42%, transparent);
}
.moon {
  --p: var(--moon-p);
  opacity: var(--moon-o);
  box-shadow: 0 0 calc(var(--orb-r) * 1.1) calc(var(--orb-r) * .12) rgb(246 239 214 / .2);
}
.moon svg { display: block; width: 100%; height: 100%; overflow: visible; }
.moon-dark { fill: #c9d3f5; opacity: .14; }
.moon-lit { fill: #f6efd6; }
.craters { fill: #ddd2b2; opacity: .6; }

.clouds { position: absolute; inset: 0; opacity: var(--cloud-o); }
.cloud { position: absolute; left: 0; width: clamp(120px, 15vw, 360px); height: auto; animation: drift 230s linear infinite; }
.c1 { top: calc(var(--hz) * .6); animation-delay: -70s; }
.c2 { top: calc(var(--hz) * .73); width: clamp(84px, 10vw, 240px); animation-duration: 280s; animation-delay: -205s; }
.c3 { top: calc(var(--hz) * .5); width: clamp(70px, 7.5vw, 190px); animation-duration: 330s; animation-delay: -130s; }
@keyframes drift { from { translate: -45vw 0; } to { translate: 115vw 0; } }
.cl { fill: var(--cloud); }
.cl-shade { fill: var(--cloud-shade); }

.land {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: calc(var(--s) * 700);
  height: calc(var(--s) * 900);
  translate: -50% 0;
  overflow: visible;
}
.shade { position: absolute; inset: auto 0 0; height: max(16%, 90px); background: linear-gradient(rgb(6 10 24 / 0), rgb(6 10 24 / .5)); }

/* artwork colours */
.far { fill: var(--far); }
.far-tree { fill: var(--far-tree); }
.mid { fill: var(--mid); }
.mid-tree { fill: var(--mid-tree); }
.near { fill: var(--near); }
.fore { fill: var(--fore); }
.tuft { fill: none; stroke: var(--tuft); stroke-width: 1.8; stroke-linecap: round; }
.path { fill: var(--path); }
.stone { fill: var(--stone); }
.wall { fill: var(--wall); }
.boards { fill: none; stroke: var(--wall-dark); stroke-width: 1.3; opacity: .45; }
.soffit { fill: var(--wall-dark); opacity: .5; }
.roof { fill: var(--roof); }
.roof-dark, .iron { fill: var(--roof-dark); }
.roof-edge { fill: none; stroke: var(--roof-dark); stroke-width: 3; stroke-linejoin: round; }
.trim { fill: var(--trim); }
.mullion { fill: none; stroke: var(--trim); stroke-width: 2.6; }
.glass { fill: var(--glass); }
.curtain { fill: var(--curtain); opacity: .92; }
.door { fill: var(--door); }
.door-line { fill: none; stroke: var(--door-dark); stroke-width: 1.4; }
.brick { fill: var(--brick); }
.brick-dark { fill: var(--brick-dark); }
.trunk { fill: var(--trunk); }
.leaf { fill: var(--leaf); }
.leaf-hi { fill: var(--leaf-hi); }
.pine { fill: var(--pine); }
.pine-dark { fill: var(--pine-dark); }
.bush { fill: var(--bush); }
.bush-hi { fill: var(--bush-hi); }
.fence { fill: var(--fence); }
.rail { fill: none; stroke: var(--fence); stroke-width: 2.6; stroke-linecap: round; }
.flower { fill: var(--flower); }
.box { fill: var(--box); }
.lit-lamp { fill: #ffd98c; }

/* window light: each window has its own switch-on point (see LAMPS in scene.js) */
.l0 { opacity: var(--l0); }
.l1 { opacity: var(--l1); }
.l1b { opacity: var(--l1b); }
.l2 { opacity: var(--l2); }
.l3 { opacity: var(--l3); }
.l4 { opacity: var(--l4); }
.l5 { opacity: var(--l5); }
.l6 { opacity: var(--l6); }

.sm0 { stop-color: var(--smoke); stop-opacity: .95; }
.sm1 { stop-color: var(--smoke); stop-opacity: .6; }
.sm2 { stop-color: var(--smoke); stop-opacity: 0; }
.puff {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  animation: puff 7.5s ease-out infinite;
}
.p2 { animation-delay: -2.5s; }
.p3 { animation-delay: -5s; }
@keyframes puff {
  0% { opacity: 0; transform: translate(0, 0) scale(.5); }
  14% { opacity: .75; }
  100% { opacity: 0; transform: translate(30px, -100px) scale(2.7); }
}

/* the cat only comes out at night (and on the 404 page) */
.cat-g { opacity: var(--cat); }
.lost .cat-g { opacity: 1; }
.cat { fill: #16121e; }
.tail { fill: none; stroke: #16121e; stroke-width: 3.4; stroke-linecap: round; transform-origin: 359px 404px; animation: swish 3.8s ease-in-out infinite; }
.cat-eye { fill: #ffd75e; }
.eyes { transform-origin: 350px 379.6px; animation: blink 6s infinite; }
@keyframes swish { 0%, 100% { rotate: 0deg; } 50% { rotate: -20deg; } }
@keyframes blink { 0%, 93%, 100% { scale: 1 1; } 95% { scale: 1 .1; } }

/* ---------- text ---------- */
.hero {
  position: relative;
  z-index: 1;
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 16px;
}
.hero-inner {
  position: relative;
  min-height: calc(var(--hz-v) * .44);
  padding-top: max(env(safe-area-inset-top), 3svh);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.mark {
  margin: 0;
  font-family: "Fraunces Haus", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-weight: 600;
  font-size: clamp(2.6rem, min(19vw, 11.5svh + .6rem), 24rem);
  line-height: 1;
  letter-spacing: -.02em;
  font-synthesis: none;
  color: var(--ink);
  text-shadow: 0 .02em .22em var(--halo);
  transition: color .6s;
}
.dot { color: var(--dot); text-shadow: 0 0 .25em var(--dot-glow); transition: color .6s; }
.tagline {
  margin: .6em 0 0;
  max-width: 34ch;
  font-size: clamp(1.05rem, .6rem + .55vw + .75svh, 3rem);
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: .01em;
  text-wrap: balance;
  color: var(--ink);
  text-shadow: 0 1px .6em var(--halo);
  transition: color .6s;
}

/* 404 */
.kicker { margin: 0 0 .6rem; font-size: .8rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--ink); text-shadow: 0 1px .5em var(--halo); }
.mark-404 { font-size: clamp(2rem, min(9.5vw, 7.2svh + .5rem), 7.5rem); line-height: 1.04; text-wrap: balance; }
.lost .tagline { font-size: clamp(1rem, .8rem + .6vw, 1.45rem); }
.lost { --ry: calc(var(--hz) * .4); } /* taller text block: keep the noon sun clear of it */
.home {
  margin-top: 1rem;
  padding: .6rem 1.25rem;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink-inv);
  background: var(--ink);
  box-shadow: 0 6px 20px rgb(0 0 0 / .18);
}
.home:hover { text-decoration: underline; text-underline-offset: .2em; }

/* ---------- controls ---------- */
.orb {
  --p: var(--orb-p);
  position: fixed;
  z-index: 2;
  width: max(48px, calc(var(--orb-r) * 2 + 14px));
  height: max(48px, calc(var(--orb-r) * 2 + 14px));
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff7ea;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.orb::before { /* two gentle pings after load hint that the sun/moon can be clicked */
  content: "";
  position: absolute;
  inset: 6px;
  border: 2px solid rgb(255 250 235 / .85);
  border-radius: 50%;
  opacity: 0;
  animation: ping 1.8s ease-out 2.4s 2;
}
@keyframes ping { from { opacity: .9; scale: .85; } to { opacity: 0; scale: 1.75; } }
.orb::after {
  content: attr(data-hint);
  position: absolute;
  left: 50%;
  top: 100%;
  translate: calc(-50% + (.5 - var(--orb-p)) * 70%) 6px;
  padding: .3rem .7rem;
  border-radius: 999px;
  background: rgb(12 16 38 / .78);
  font-size: .8125rem;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  transition: opacity .2s;
  pointer-events: none;
}
@media (hover: hover) {
  .orb:hover { box-shadow: 0 0 0 2px rgb(255 250 235 / .7); }
  .orb:hover::after { opacity: 1; }
}
.orb:focus-visible::after { opacity: 1; }

:focus-visible { outline: 3px solid #fff; outline-offset: 2px; box-shadow: 0 0 0 7px #10142c; }
.orb:focus-visible { outline-offset: 0; }

.chip {
  position: fixed;
  z-index: 3;
  left: 50%;
  bottom: calc(max(14px, env(safe-area-inset-bottom)) + 2.2rem);
  translate: -50% 0;
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .35rem .4rem .35rem 1rem;
  border-radius: 999px;
  background: rgb(12 16 38 / .74);
  color: #fff7ea;
  font-size: .875rem;
  white-space: nowrap;
  box-shadow: 0 8px 28px rgb(0 0 0 / .25);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.chip-back {
  padding: .35rem .85rem;
  border: 1px solid rgb(255 255 255 / .4);
  border-radius: 999px;
  background: rgb(255 255 255 / .1);
  color: inherit;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.chip-back:hover { background: rgb(255 255 255 / .2); }

.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

.foot {
  position: relative;
  z-index: 1;
  padding: 0 16px max(14px, env(safe-area-inset-bottom));
  text-align: center;
  font-size: clamp(.8125rem, .7rem + .2vw, 1rem);
  letter-spacing: .03em;
  color: #f7f2e8;
  text-shadow: 0 1px 3px rgb(0 0 0 / .5);
}
.foot p { margin: 0; }
@media (max-height: 520px) { /* short landscape screens: the footer lands on the path */
  .foot p { display: inline-block; padding: .05rem .7rem; border-radius: 999px; background: rgb(8 12 28 / .6); }
}

/* ---------- preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-play-state: paused !important; transition: none !important; }
  .meteor, .orb::before { display: none; }
}
@media (forced-colors: active) {
  .scene, .orb { display: none; }
}
