/* Forgeville Weather Station web page: full-window canvas under a title card in the island's own glass (the HUD's look). */
@font-face { font-family: "IBM Plex Sans"; src: url("fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "IBM Plex Serif"; src: url("fonts/ibm-plex-serif-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Serif"; src: url("fonts/ibm-plex-serif-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --paper: #f6f3ec;
  --ink: #191714;
  --muted: #6a6152;
  --rule: #d9d1c3;
  --rust: #b85a36;
  --rust-ink: #a44d2c;
  --spruce: #22362d;
  /* The island's glass, as in the HUD: smoked spruce, one light hairline, cream type, lantern amber. */
  --glass: rgba(18, 33, 28, .72);
  --hairline: rgba(255, 255, 255, .24);
  --cream: #f2ead8;
  --haze: rgba(242, 234, 216, .72);
  --ember: #e8b04b;
  --ember-lit: #f3c263;
  --sans: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --serif: "IBM Plex Serif", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}

html, body { margin: 0; height: 100%; overflow: hidden; background: var(--spruce); }
body { font-family: var(--sans); color: var(--ink); -webkit-font-smoothing: antialiased; }

#unity-canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; outline: none; background: var(--spruce); }

/* The opening: no solid screen. While the island downloads, the window is a misty sky over the lake (the
   island's own colours) with the card slid in at the side; once it's ready the island fades in behind and the
   card stays put, off to the right, clear of the weather reading. */
.cover {
  position: fixed; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, #7ea6c6 0%, #b8cfdd 38%, #d9e4e8 47%, #4f8db1 49%, #2c6488 72%, #1d4664 100%);
  transition: opacity 1.2s ease;
}
/* The opening film, filling the window the way the live camera does (it's 21:9 at the camera's own vertical field of
   view: a narrower window crops its sides, as the camera would show less at the sides). It fades out over the live
   island once both are ready. */
.intro { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; transition: opacity 1.2s ease; }
.cover.ready .intro { opacity: 0; }
/* Mist drifting across the lake while it loads ("raising the island from the mist"). */
.cover::before {
  content: ""; position: absolute; inset: -20% -40%; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 40% 12% at 30% 48%, rgba(255, 255, 255, .55), transparent 70%),
    radial-gradient(ellipse 35% 10% at 70% 52%, rgba(255, 255, 255, .45), transparent 70%),
    radial-gradient(ellipse 50% 14% at 50% 44%, rgba(255, 255, 255, .35), transparent 70%);
  filter: blur(8px);
  animation: mist 18s ease-in-out infinite alternate;
}
@keyframes mist { from { transform: translateX(-6%); } to { transform: translateX(6%); } }
/* Ready: the sky and mist fade away and the island is there; only the card is left. */
.cover.ready { background: transparent; }
.cover.ready::before { opacity: 0; transition: opacity 1.2s ease; }
.cover.gone { opacity: 0; }

.card {
  position: absolute; z-index: 2; right: max(24px, env(safe-area-inset-right)); top: 96px; pointer-events: auto;
  max-height: calc(100% - 120px); overflow-y: auto;
  animation: slide-in .7s cubic-bezier(.16, 1, .3, 1) .15s both;
  width: min(400px, calc(100% - 48px)); box-sizing: border-box; color: var(--cream);
  background: var(--glass); border: 1px solid var(--hairline); border-radius: 14px; padding: 22px 24px 18px;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  display: grid; gap: 14px;
}
/* The Forge wordmark (FORGE plus the rust period) over a tracked mono label, as on forge-wy.com. */
.brand { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--hairline); }
.wordmark { display: block; height: 15px; width: auto; }
@keyframes slide-in { from { transform: translateX(calc(100% + 40px)); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes slide-out { to { transform: translateX(calc(100% + 40px)); opacity: 0; } }
.cover.gone .card { animation: slide-out .45s cubic-bezier(.7, 0, .84, 0) both; pointer-events: none; }
/* A phone: a sheet that rises from the bottom instead. */
@media (max-width: 640px) {
  .card { left: 12px; right: 12px; top: auto; bottom: max(12px, env(safe-area-inset-bottom)); width: auto; max-height: 70%; animation-name: rise; }
  .cover.gone .card { animation-name: sink; }
  @keyframes rise { from { transform: translateY(calc(100% + 24px)); opacity: 0; } to { transform: none; opacity: 1; } }
  @keyframes sink { to { transform: translateY(calc(100% + 24px)); opacity: 0; } }
}
.wordmark g { fill: var(--cream); } /* the letters in cream on the glass; the rust period stays */
.eyebrow { margin: 0; font: 500 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--haze); }
.period { color: var(--rust); }
h1 { margin: 0; font-family: var(--serif); font-weight: 600; font-size: clamp(32px, 7vw, 42px); line-height: 1; letter-spacing: -.01em; color: #fff; }
/* The subtitle under the name: the tracked mono label in Forge rust, tucked up under the heading. */
.subtitle { margin: -6px 0 0; font: 500 13px var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--ember); }
/* Read by screen readers only: the live region the island mirrors its story cards into. */
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.lede { margin: 0; font-family: var(--sans); font-size: 16px; line-height: 1.5; color: var(--cream); }
.progress { height: 4px; background: rgba(255, 255, 255, .14); border-radius: 2px; overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--ember); transition: width .2s ease; }
.status { margin: 8px 0 0; font-size: 13px; color: var(--haze); }
.status.error { color: var(--ember); }
.note { margin: 0; font-size: 15px; line-height: 1.5; }
.how { margin: 0; font: 500 11px/1.6 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--haze); border-top: 1px solid var(--hairline); padding-top: 12px; }
.foot { margin: 0; font-size: 13px; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; }
.foot a { color: var(--ember); text-underline-offset: 3px; }
/* Sound credits: a small mono disclosure beside the link; opened, it takes the card's full width. */
.credits summary { font: 500 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--haze); cursor: pointer; list-style: none; }
.credits summary::-webkit-details-marker { display: none; }
.credits summary::after { content: " +"; color: var(--ember); }
.credits[open] summary::after { content: " \2212"; }
.credits summary:hover { color: var(--cream); }
.credits[open] { flex-basis: 100%; }
.credits p, .credits ul { margin: 8px 0 0; font-size: 12px; line-height: 1.5; color: var(--haze); }
.credits ul { padding-left: 16px; max-height: 168px; overflow-y: auto; }
.credits li + li { margin-top: 2px; }
.credits summary:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }

.enter, .ghost {
  font: 600 15px var(--sans); min-height: 44px; border-radius: 10px; cursor: pointer; padding: 0 18px;
}
.choose { display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px; }
.enter { background: var(--ember); color: #1a1a12; border: 0; }
.enter:hover { background: var(--ember-lit); }
.ghost { background: rgba(255, 255, 255, .04); color: var(--cream); border: 1px solid rgba(255, 255, 255, .34); }
.ghost:hover { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .5); }
#phone .ghost { margin-top: 12px; }
.enter:focus-visible, .ghost:focus-visible, .foot a:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }

[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) { .cover, .progress i, .cover.ready::before, .intro { transition: none; } .cover::before, .card, .cover.gone .card { animation: none; } }
