@font-face {
  font-family: "Nunito Sans";
  src: url("assets/fonts/nunito-sans-latin.woff2") format("woff2");
  font-weight: 400 600;
  font-display: optional;
}
:root {
  color-scheme: light;
  --ink: #333333;
  --paper: #f0f0f0;
}
* {
  box-sizing: border-box;
  -webkit-user-select: none;
  user-select: none;
}
html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
}
body {
  background: #078bdd;
  color: var(--paper);
  font-family: "Nunito Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.world {
  position: relative;
  isolation: isolate;
  width: 100%;
  height: 100%;
  height: 100svh;
  min-height: 320px;
  overflow: hidden;
  touch-action: pan-y;
}
.poster,
canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
}
.poster {
  transform: scale(1.12);
}
canvas {
  opacity: 0;
  transition: opacity 0.12s ease;
  pointer-events: none;
}
.ready canvas {
  opacity: 1;
}
.world::after {
  content: "";
  position: absolute;
  inset: 65% 0 0;
  pointer-events: none;
  background: linear-gradient(transparent, rgba(15, 35, 19, 0.27));
  z-index: 1;
}
header {
  position: absolute;
  z-index: 2;
  top: max(28px, env(safe-area-inset-top));
  left: 0;
  padding: 13px 17px;
  padding-left: calc(max(32px, env(safe-area-inset-left)) + 17px);
  background: rgba(240, 240, 240, 0.88);
  border-radius: 0 3px 3px 0;
}
.logo {
  display: block;
  width: clamp(120px, 12vw, 176px);
  height: auto;
}
.message {
  position: absolute;
  z-index: 2;
  bottom: max(38px, env(safe-area-inset-bottom));
  left: max(42px, env(safe-area-inset-left));
  pointer-events: none;
  text-shadow: 0 2px 12px rgba(0, 30, 12, 0.3);
}
h1 {
  font-size: clamp(26px, 2.5vw, 42px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.08;
  margin: 0;
}
.message p {
  margin: 12px 0 0;
  font-size: 14px;
  opacity: 0.85;
}
footer {
  position: absolute;
  z-index: 2;
  right: max(38px, env(safe-area-inset-right));
  bottom: max(40px, env(safe-area-inset-bottom));
  display: flex;
  gap: 22px;
  font-size: 13px;
}
a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}
a:hover {
  opacity: 0.75;
}
a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 5px;
}
@media (max-width: 600px) {
  header {
    top: max(20px, env(safe-area-inset-top));
    padding: 10px 12px;
    padding-left: 32px;
  }
  .logo {
    width: 120px;
  }
  .message {
    left: 25px;
    bottom: max(76px, env(safe-area-inset-bottom));
  }
  footer {
    left: 25px;
    right: auto;
    bottom: max(28px, env(safe-area-inset-bottom));
  }
}
@media (max-height: 450px) and (min-width: 601px) {
  .message {
    bottom: 22px;
  }
  h1 {
    font-size: 25px;
  }
  footer {
    bottom: 24px;
  }
}
@media (prefers-reduced-motion: reduce) {
  canvas {
    transition: none;
  }
}

/* Window chrome recalls Tiger: restrained metal, pinstripes, and Aqua glass. */
button, a, .water-hover { cursor: pointer; }
button { font: inherit; }
img, a { -webkit-user-drag: none; }
button:focus-visible, .aqua-button:focus-visible { outline: 3px solid #3675a9; outline-offset: 4px; }
.logo-button { display: block; padding: 0; border: 0; background: none; }
.world::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: radial-gradient(ellipse at 50% 45%, transparent 48%, rgba(12, 27, 35, .22) 100%); }
.loading-screen { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; background: #edf0ed; color: var(--ink); }
.loading-screen[hidden] { display: none; }
.loading-card { width: min(320px, 85vw); text-align: center; }
.loading-card img { max-width: 100%; height: auto; }
.loading-card p { margin: 28px 0 16px; font-size: 13px; }
progress { display: block; width: 220px; max-width: 100%; height: 13px; margin: auto; border: 1px solid #8a9298; border-radius: 10px; overflow: hidden; background: #ddd; }
progress::-webkit-progress-bar { background: linear-gradient(#bbb, #f8f8f8); }
progress::-webkit-progress-value { border-radius: 8px; background: linear-gradient(#d7edff, #73b9f1 45%, #3284c9 50%, #97d8ff); }
progress::-moz-progress-bar { background: linear-gradient(#d7edff, #3284c9, #97d8ff); }
dialog { position: fixed; padding: 0; width: min(440px, calc(100% - 32px)); max-height: calc(100svh - 32px); overflow: auto; color: var(--ink); border: 1px solid #737373; border-radius: 7px; background: #eee; box-shadow: 0 20px 55px #0006, 0 2px 7px #0005; font-family: "Lucida Grande", "Lucida Sans Unicode", system-ui, sans-serif; }
dialog::backdrop { background: rgba(18, 30, 36, .28); }
.window-titlebar { position: sticky; top: 0; z-index: 1; cursor: grab; touch-action: none; border-bottom: 1px solid #888; padding: 7px 38px; background: linear-gradient(#fafafa, #d8d8d8 45%, #bcbcbc 50%, #d1d1d1); box-shadow: inset 0 1px white; }
.window-titlebar.dragging { cursor: grabbing; }
.window-titlebar h2 { margin: 0; font-size: 13px; line-height: 18px; font-weight: 500; text-align: center; text-shadow: 0 1px #fff9; }
.window-close { position: absolute; left: 10px; top: 9px; width: 15px; height: 15px; padding: 0; border: 1px solid #99463e; border-radius: 50%; background: radial-gradient(ellipse at 50% 15%, #fff9, transparent 55%), linear-gradient(#e88778, #d34936 55%, #f99a79); box-shadow: 0 1px #fff9, inset 0 0 2px #853e35; color: #582c23; line-height: 11px; }
.window-close::before { content: ""; position: absolute; inset: -7px; }
.window-titlebar h2:focus { outline: none; }
.window-close span { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.window-close span::before, .window-close span::after { content: ""; position: absolute; left: 50%; top: 50%; width: 7px; height: 1px; background: currentColor; transform: translate(-50%, -50%) rotate(45deg); }
.window-close span::after { transform: translate(-50%, -50%) rotate(-45deg); }
.window-close:hover span, .window-close:focus-visible span { opacity: 1; }
.window-content { padding: 30px 34px 22px; text-align: center; background: repeating-linear-gradient(#f6f6f6 0 2px, #ededed 2px 4px); }
.about-logo { display: block; max-width: 80%; height: auto; margin: 0 auto 25px; }
.window-content p { font-size: 13px; line-height: 1.65; margin: 0 0 15px; }
.window-content nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin: 24px 0; }
.aqua-button { display: inline-block; min-width: 112px; padding: 5px 17px; border: 1px solid #7795ae; border-radius: 18px; background: linear-gradient(#fff, #d9efff 45%, #a4cdec 50%, #e0f3ff); box-shadow: inset 0 1px white, 0 1px 2px #0003; text-shadow: 0 1px #fff; text-decoration: none; font-size: 12px; }
.aqua-button:active { background: linear-gradient(#8abce2, #d9efff); }
.window-content .window-note { margin: 0; font-size: 11px; color: #666; overflow-wrap: anywhere; }

@media (pointer: coarse), (max-width: 600px) {
  .window-titlebar { padding-block: 13px; padding-inline: 48px; }
  .window-close { left: 16px; top: 16px; }
  .window-close::before { inset: -15px; }
  .window-content { padding: 24px 22px 20px; }
  .aqua-button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
  footer a { min-height: 44px; display: inline-flex; align-items: center; }
  footer { bottom: max(14px, env(safe-area-inset-bottom)); }
  #about-mail { display: inline-flex; min-height: 44px; align-items: center; }
}
