/* Old Faithful Watch
   The geyser art and animation come from js/geyser.js; everything here is the poster-style UI laid over it.
   Single look on purpose: the poster is the theme, so there is no light/dark switch. */

:root {
  color-scheme: dark;
  --panel: #13283a;
  --panel-top: #183247;
  --panel-edge: #0a1622;
  --cream: #f3e6c4;
  --cream-dim: #c9bb96;
  --ochre: #e2a23b;
  --ochre-hi: #efb654;
  --ink: #14212b;
  --paper: #f4ecd6;
  --paper-edge: #b99c68;
  --steam: rgba(248, 250, 251, 0.9);
  --night: #0d1426;
  --erupt: #8fd3e8;

  --display: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
  --body: "Alegreya Sans", "Gill Sans", "Trebuchet MS", sans-serif;
  --serif: "Alegreya", Georgia, "Times New Roman", serif;
  --numerals: "Cormorant Garamond", "Alegreya", Georgia, serif;

  --gutter: 16px;
}

* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body {
  background: var(--night);
  color: var(--cream);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.4;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }

#scene {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: #f6981f; /* replaced by the art's own sky colour once it loads */
}

#fx {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- printed-paper grain over the scene ---------- */

#grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 45%, transparent 55%, rgba(40,28,10,.28) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .27 0 0 0 0 .15 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: .32;
  mix-blend-mode: multiply;
}

/* ---------- title: unboxed, over a light fade at the top ---------- */

.title {
  position: fixed;
  left: 0; top: 0;
  padding: calc(env(safe-area-inset-top, 0px) + 20px) 28px 32px;
  display: grid;
  gap: 4px;
  pointer-events: none;
  text-shadow: 0 1px 8px rgba(60,30,6,.35);
}
.title::before {
  content: "";
  position: fixed;
  left: 0; right: 0; top: 0;
  height: 130px;
  z-index: -1;
  background: linear-gradient(to bottom, rgba(64,34,10,.34), rgba(64,34,10,0));
}
.title h1 {
  margin: 0;
  font-family: var(--numerals);
  font-weight: 500;
  font-size: clamp(28px, 2.8vw, 38px);
  line-height: .95;
  color: #fbf4e4;
}
.title-eyebrow, .title-clock {
  margin: 0;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: rgba(251,244,228,.88);
}
.title-clock span { color: #fbf4e4; font-variant-numeric: tabular-nums; }

/* ---------- bottom bar: countdown and controls over a dark fade ---------- */

.bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  padding: 60px 28px calc(env(safe-area-inset-bottom, 0px) + 18px);
  display: grid;
  grid-template-columns: minmax(max-content, 1fr) auto minmax(max-content, 1fr);
  grid-template-areas: "next now actions";
  align-items: end;
  gap: 14px 32px;
  background: linear-gradient(to top, rgba(40,25,12,.86) 0%, rgba(40,25,12,.62) 45%, rgba(40,25,12,0) 100%);
  pointer-events: none;
  text-shadow: 0 1px 8px rgba(30,18,6,.45);
}
.next { grid-area: next; justify-self: start; }
.now { grid-area: now; justify-self: center; }
.actions { grid-area: actions; justify-self: end; }
.bar > * { pointer-events: auto; }

.next {
  display: grid;
  grid-template-columns: auto minmax(0, auto);
  column-gap: 22px;
  align-items: end;
  min-width: 0;
}
.next-label {
  grid-column: 1 / -1;
  margin: 0 0 -2px 3px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(243,230,196,.9);
}
.countdown {
  margin: 0;
  font-family: var(--numerals);
  font-weight: 500;
  font-size: clamp(44px, 4.6vw, 64px);
  line-height: .9;
  font-variant-numeric: lining-nums tabular-nums;
  color: #fbf4e4;
}
.countdown.is-word { font-size: clamp(32px, 3.4vw, 46px); }

.next-meta { display: grid; gap: 3px; padding-bottom: 6px; min-width: 0; max-width: 48ch; }
.meta-main { margin: 0; font-size: 14.5px; font-weight: 500; color: #fbf4e4; font-variant-numeric: tabular-nums; text-wrap: pretty; }
.meta-sub { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 0; font-size: 13px; color: var(--cream-dim); }

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: #b7c7a4;
}
.status { position: relative; cursor: help; border-radius: 3px; }
/* the data attribution GeyserTimes asks for, always visible */
.credit { font-size: 11px; letter-spacing: .02em; color: rgba(201,187,150,.8); }
.credit::before { content: "·"; margin: 0 9px; }
.credit a { color: inherit; text-decoration: underline; text-decoration-color: rgba(201,187,150,.45); text-underline-offset: 2px; }
.credit a:hover { color: #fbf4e4; }
.status .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px rgba(183,199,164,.22); }
.status[data-state="saved"] { color: var(--cream-dim); }
.status[data-state="window"] { color: var(--ochre-hi); }
.status[data-state="window"] .dot { animation: blink 1.2s steps(2) infinite; }
.status[data-state="erupting"] { color: var(--erupt); }
.status[data-state="erupting"] .dot { animation: blink .6s steps(2) infinite; }
.status[data-state="after"] { color: #dfe4e6; }
@keyframes blink { 50% { opacity: .25; } }

/* details on hover, or on tap/focus for touch and keyboard */
.status .tip {
  position: absolute;
  left: -10px; bottom: calc(100% + 10px);
  width: max-content; max-width: min(300px, calc(100vw - 32px));
  padding: 9px 12px;
  border-radius: 4px;
  background: rgba(24,15,7,.94);
  color: var(--cream);
  font-size: 13.5px; font-weight: 500; line-height: 1.4;
  letter-spacing: 0; text-transform: none; text-shadow: none;
  box-shadow: 0 8px 22px rgba(0,0,0,.35);
  opacity: 0; transform: translateY(4px);
  pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
}
.status .tip:empty { display: none; }
.status:hover .tip, .status:focus .tip { opacity: 1; transform: none; }

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px 22px;
  padding-bottom: 6px;
}

button { font: inherit; color: inherit; }

.btn-hurry {
  cursor: pointer;
  padding: 5px 14px 6px;
  border: 1px solid rgba(236,217,170,.45);
  border-radius: 999px;
  background: rgba(236,217,170,.2);
  color: #f6ecd2;
  font-family: var(--numerals);
  font-style: italic;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.1;
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  transition: background .2s, border-color .2s, color .2s;
}
.btn-hurry:hover:not(:disabled) { background: rgba(236,217,170,.34); border-color: rgba(236,217,170,.7); color: #fff; }
.btn-hurry:active:not(:disabled) { background: rgba(236,217,170,.44); }
.btn-hurry:disabled { cursor: default; background: transparent; border-color: rgba(236,217,170,.22); color: rgba(246,236,210,.6); }

.btn-text {
  cursor: pointer;
  padding: 8px 2px;
  border: 0;
  background: none;
  color: #efe4c9;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .15em;
  text-transform: uppercase;
  transition: color .2s;
}
.btn-text:hover { color: #fff; }
.btn-text[aria-pressed="true"] { color: var(--ochre-hi); }
.btn-text .count::before { content: "·"; margin: 0 8px; }

:focus-visible { outline: 3px solid var(--ochre); outline-offset: 3px; }

/* ---------- field notes: a frosted, amber-tinted card docked on the right ---------- */

.notes {
  --notes-line: rgba(255,225,170,.11);
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 28px);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 28px);
  right: 32px;
  width: min(510px, calc(100% - 64px));
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  border: 1px solid rgba(255,225,170,.14);
  background: rgba(35,22,8,.6);
  -webkit-backdrop-filter: blur(28px);
  backdrop-filter: blur(28px);
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  color: #f2eada;
  overflow: hidden;
  z-index: 10;
}
.notes-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 44px 36px 26px;
  border-bottom: 1px solid var(--notes-line);
}
.notes-eyebrow {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: #d2b683;
}
.notes h2 {
  margin: 6px 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 600;
  font-size: 39px;
  line-height: 1.05;
  color: #f2eada;
}
.notes-close {
  cursor: pointer;
  width: 32px; height: 32px;
  margin: -10px -10px 0 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: #c7ba99;
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
}
.notes-close:hover { color: #f2eada; background: rgba(255,225,170,.08); }
.notes-body {
  flex: 1; overflow-y: auto; padding: 0 36px 28px; scrollbar-width: none;
  /* entries fade as they scroll under the header instead of being sliced */
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 14px);
  mask-image: linear-gradient(to bottom, transparent, #000 14px);
}
.notes-body::-webkit-scrollbar { display: none; }
.notes ol { margin: 0; padding: 0; list-style: none; }
.notes li {
  display: grid;
  grid-template-columns: 44px 1fr;
  padding: 28px 0 30px;
  border-bottom: 1px solid var(--notes-line);
}
.notes li .num {
  font-family: var(--serif);
  font-style: italic;
  font-size: 19px;
  line-height: 1;
  color: #a08e6b;
  font-variant-numeric: tabular-nums;
}
.notes li .cat {
  display: block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #d0b482;
  line-height: 18px;
}
.notes li p {
  margin: 6px 0 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 22px;
  line-height: 35px;
  color: #f2eada;
  text-wrap: pretty;
}
.notes-empty { margin: 28px 0 0; font-family: var(--serif); font-style: italic; font-size: 18px; color: #c7ba99; }
.notes-foot { margin: 26px 0 0; font-size: 13px; line-height: 1.5; color: #a08e6b; }
.notes-foot p { margin: 0 0 8px; }
.notes-foot a { color: #d2b683; }

/* the steam-message label reuses this look */
.note .cat {
  display: block;
  font-family: var(--body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #8a5a22;
}

/* ---------- trivia carriers (positioned by JS) ---------- */

.note {
  position: absolute;
  left: 0; top: 0;
  will-change: transform, opacity;
  color: var(--ink);
}
.note p {
  margin: 2px 0 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 17px;
  line-height: 1.35;
  text-wrap: pretty;
}

/* steam: a soft cloud whose edges feather into the plume */
.note.steam .card {
  width: min(330px, 78vw);
  padding: 20px 26px 22px;
  text-align: center;
  background: radial-gradient(ellipse at 50% 50%, rgba(250,251,252,.95) 0%, rgba(246,248,250,.9) 55%, rgba(246,248,250,.72) 100%);
  border-radius: 48% 52% 46% 54% / 58% 50% 50% 42%;
  box-shadow: 0 0 22px 14px rgba(246,248,250,.62), 0 0 60px 30px rgba(246,248,250,.28);
}
.note.steam .cat { color: #5b6a70; }

/* raven banner: a cloth pennant with swallowtail ends */
.note.raven .card {
  width: min(300px, 70vw);
  padding: 10px 30px 12px 22px;
  background: linear-gradient(180deg, #f6eed8, #eadcb8);
  clip-path: polygon(0 0, 100% 0, calc(100% - 16px) 50%, 100% 100%, 0 100%);
  filter: drop-shadow(0 4px 6px rgba(0,0,0,.25));
  animation: flutter 1.4s ease-in-out infinite;
  transform-origin: 100% 0;
}
.note.raven.to-left .card {
  padding: 10px 22px 12px 30px;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 16px 50%);
  transform-origin: 0 0;
}
.note.raven p { font-size: 16px; }
@keyframes flutter {
  0%, 100% { transform: skewY(0deg) rotate(0deg); }
  30% { transform: skewY(-1.8deg) rotate(.6deg); }
  65% { transform: skewY(1.2deg) rotate(-.5deg); }
}

/* bison scroll: parchment that unrolls upward out of the dirt */
.note.scroll .card {
  position: relative;
  width: min(290px, 74vw);
  padding: 16px 20px 16px;
  background: linear-gradient(90deg, #e4d3a8, var(--paper) 12%, var(--paper) 88%, #e4d3a8);
  animation: unroll .9s cubic-bezier(.2,.8,.2,1) both;
  transform-origin: 50% 100%;
}
.note.scroll .card::before, .note.scroll .card::after {
  content: "";
  position: absolute;
  left: -8px; right: -8px;
  height: 11px;
  border-radius: 3px;
  background: linear-gradient(180deg, #a07a48, #6d4b27);
  box-shadow: 0 2px 3px rgba(0,0,0,.3);
}
.note.scroll .card::before { top: -6px; }
.note.scroll .card::after { bottom: -6px; }
@keyframes unroll {
  from { transform: translateY(40px) scaleY(.08); opacity: 0; }
  40% { opacity: 1; }
  to { transform: translateY(0) scaleY(1); opacity: 1; }
}

.note.out .card { opacity: 0; transition: opacity .7s ease; }

/* ---------- "Now": what the geyser is doing, with a stage track during eruptions ---------- */

.now { display: grid; justify-items: center; gap: 8px; padding-bottom: 9px; min-width: 0; }
.now-line { margin: 0; display: flex; align-items: baseline; gap: 9px; white-space: nowrap; }
.now-dot {
  align-self: center;
  width: 7px; height: 7px; border-radius: 50%;
  background: #e9edee;
  box-shadow: 0 0 0 3px rgba(233,237,238,.18);
  animation: breathe 3.2s ease-in-out infinite;
}
.now-label { font-size: 10.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--cream-dim); }
.now-text { font-family: var(--numerals); font-style: italic; font-weight: 600; font-size: 17px; line-height: 1; color: #f6eedb; }
.now[data-state="window"] .now-dot { background: var(--ochre-hi); box-shadow: 0 0 0 3px rgba(239,182,84,.22); animation-duration: 1.6s; }
.now[data-state="erupting"] .now-dot { background: var(--erupt); box-shadow: 0 0 0 3px rgba(143,211,232,.25); animation-duration: .9s; }
@keyframes breathe { 50% { opacity: .35; } }

.stages {
  margin: 0; padding: 0; list-style: none;
  display: flex; gap: 5px;
  opacity: 0; transition: opacity .8s ease;
}
.now[data-state="erupting"] .stages, .now[data-state="after"] .stages { opacity: 1; }
.stages li {
  position: relative;
  width: 28px; height: 2px; border-radius: 2px;
  background: rgba(243,230,196,.22);
  overflow: hidden;
}
.stages li::after {
  content: "";
  position: absolute; inset: 0;
  background: #f3e6c4;
  transform-origin: 0 50%;
  transform: scaleX(var(--fill, 0));
}
.stages li[data-done] { --fill: 1; }
.stages li[data-done]::after { background: rgba(243,230,196,.7); }
.stages li span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- steam messages (js/steam-message.js) ---------- */

.steam-msg { position: absolute; left: 0; top: 0; pointer-events: none; will-change: transform; }
.steam-msg canvas { display: block; }
.steam-msg-text {
  position: absolute; left: 0; top: 0;
  transform-origin: 50% 50%;
  text-align: center;
  color: #3a2716;
  /* the cloud behind is faint, so the words carry their own soft cream glow */
  text-shadow: 0 0 14px rgba(252,246,234,1), 0 0 7px rgba(252,246,234,.95), 0 0 2px rgba(252,246,234,.95);
}
/* Cormorant Garamond, like the title and countdown: finer and more elegant than the body serif */
.steam-msg-text p { margin: 6px 0 0; font-family: var(--numerals); font-weight: 600; font-size: 1.12em; line-height: 1.32; letter-spacing: .005em; text-wrap: balance; }
.steam-msg-cat {
  display: block;
  font-family: var(--body);
  font-size: .6em;
  font-weight: 600;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: #8a5a22;
}

/* at night the message clouds are grey against a dark sky: light words, dark glow */
[data-look="night"] .steam-msg-text { color: #f1e8d6; text-shadow: 0 0 12px rgba(14,20,38,.95), 0 0 5px rgba(14,20,38,.9), 0 0 2px rgba(14,20,38,.9); }
[data-look="night"] .steam-msg-cat { color: #d2b683; }

/* ---------- small screens ---------- */

/* not enough room for three columns: "Now" becomes the strip's first line */
@media (max-width: 1399px) {
  .bar { grid-template-columns: 1fr auto; grid-template-areas: "now now" "next actions"; }
  .now { justify-self: start; grid-auto-flow: column; align-items: center; gap: 16px; padding-bottom: 0; }
}

@media (max-width: 720px) {
  .bar { grid-template-columns: 1fr; grid-template-areas: "now" "next" "actions"; padding: 56px 16px calc(env(safe-area-inset-bottom, 0px) + 14px); gap: 12px; }
  .next, .actions { justify-self: stretch; }
  .now { gap: 12px; }
  .now-text { font-size: 16px; }
  .stages li { width: 22px; }
  .next { column-gap: 16px; }
  .next-label { font-size: 10px; }
  .countdown { font-size: 42px; }
  .countdown.is-word { font-size: 30px; }
  .next-meta { padding-bottom: 4px; }
  .meta-main { font-size: 13.5px; }
  .meta-sub { font-size: 12px; }
  .status { font-size: 10px; }
  .status .tip { left: 0; }
  .title { padding: calc(env(safe-area-inset-top, 0px) + 16px) 16px 32px; }
  .title-eyebrow, .title-clock { font-size: 9.5px; }
  .title h1 { font-size: 26px; }
  .actions { justify-content: space-between; gap: 6px 12px; padding-bottom: 0; }
  .next { justify-self: start; }
  .btn-hurry { flex: 1 1 100%; font-size: 15px; padding: 7px 14px; }
  .btn-text { font-size: 11.5px; letter-spacing: .12em; }
  .note p { font-size: 15px; }
  .notes { top: calc(env(safe-area-inset-top, 0px) + 12px); bottom: calc(env(safe-area-inset-bottom, 0px) + 12px); right: 12px; width: calc(100% - 24px); }
  .notes-head { padding: 28px 22px 18px; }
  .notes h2 { font-size: 32px; }
  .notes-body { padding: 0 22px 22px; }
  .notes li { grid-template-columns: 36px 1fr; padding: 22px 0 24px; }
  .notes li p { font-size: 19px; line-height: 30px; }
}

@media (max-height: 560px) and (min-width: 721px) {
  .bar { padding-top: 36px; }
  .countdown { font-size: 42px; }
}

@media (prefers-reduced-motion: reduce) {
  .note.raven .card { animation: none; }
  .note.scroll .card { animation-duration: .01s; }
  .status .dot, .now-dot { animation: none !important; }
  .stages { transition: none; }
}
