/* EFFECT79 Pond — "Living Pond" look: vertical Mincho headline under the fish, seal, ring logo,
   pill dock. Fonts: Shippori Mincho B1 + Zen Kaku Gothic New (SIL OFL, see fonts/OFL-shippori-zen.txt). */
@font-face { font-family: "Shippori Mincho B1"; src: url("../fonts/shippori-mincho-b1-800.woff2") format("woff2"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "Zen Kaku Gothic New"; src: url("../fonts/zen-kaku-gothic-new-500.woff2") format("woff2"); font-weight: 400 500; font-display: swap; }
@font-face { font-family: "Zen Kaku Gothic New"; src: url("../fonts/zen-kaku-gothic-new-700.woff2") format("woff2"); font-weight: 600 900; font-display: swap; }

:root {
  --bg: #9A0100;          /* water, set from fish.json theme */
  --text: #F7F0ED;        /* headline + UI text, set from theme */
  --dock: rgba(40, 0, 0, .38);          /* the colours below are derived from the theme in JS */
  --hover: rgba(247, 240, 237, .14);
  --line: rgba(247, 240, 237, .55);
  --line-soft: rgba(247, 240, 237, .22);
  --serif: "Shippori Mincho B1", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --sans: "Zen Kaku Gothic New", system-ui, -apple-system, "Segoe UI", sans-serif;
  --pad-x: clamp(16px, 3.3vw, 48px);
  --pad-y: clamp(16px, 3.6vh, 40px);
  --ease: cubic-bezier(.22, .8, .24, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); }
body {
  color: var(--text); font-family: var(--sans); -webkit-font-smoothing: antialiased;
  transition: color .6s var(--ease); touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }

/* ---- layers ---- */
/* The WebGL canvas draws water, sparkles, headline + seal, fish, then the UI, and bends all of it
   through the ripples. The DOM stays for layout, input, screen readers and the no-WebGL fallback. */
#water { position: fixed; inset: 0; background: var(--bg); z-index: 0; transition: background .9s var(--ease); }
#pond { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
#hero { position: fixed; inset: 0; z-index: 2; pointer-events: none; }
#hero .headline, #hero .tagline, #hero .seal { color: transparent; }
#hero .seal { background: transparent; }
body.no-gl #hero .headline, body.no-gl #hero .tagline { color: var(--text); }
body.no-gl #hero .seal { background: var(--text); color: var(--bg); }
#overlay { z-index: 4; }
.chrome { z-index: 5; }
/* GL mode: the buttons are drawn inside the water (canvas); the DOM ones stay for input only */
body.gl-ui .chrome { opacity: 0; }
/* GL mode: the About / Menu panel and its blur are drawn in the water too; the DOM panel stays for input */
body.gl-ui #overlay { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; filter: opacity(0); }

/* ---- headline (vertical, right side, under the fish) ---- */
.title-block { position: absolute; right: clamp(18px, 5vw, 72px); top: clamp(88px, 12vh, 116px);
  display: flex; gap: clamp(12px, 1.8vw, 26px); align-items: flex-start; }
.headline { margin: 0; writing-mode: vertical-rl; font: 800 min(13vh, 12vw)/1 var(--serif); letter-spacing: .06em;
  transition: color .6s var(--ease); }
.side { display: flex; flex-direction: column; align-items: center; gap: 18px; padding-top: 8px; }
.seal { --s: clamp(42px, 6.6vh, 60px); width: var(--s); height: var(--s); border-radius: 4px; display: grid; place-items: center;
  writing-mode: vertical-rl; font: 800 calc(var(--s) * .36)/1 var(--serif); letter-spacing: .02em; }
.tagline { margin: 0; writing-mode: vertical-rl; font: 500 13px/1 var(--sans); letter-spacing: .26em; white-space: nowrap; }

/* ---- chrome ---- */
.chrome { position: fixed; left: var(--pad-x); right: var(--pad-x); pointer-events: none; }
.chrome a, .chrome button, .chrome .dock { pointer-events: auto; }
.chrome.top { top: calc(var(--pad-y) - 6px); display: flex; justify-content: space-between; align-items: center; }
.chrome.bottom { bottom: calc(var(--pad-y) + env(safe-area-inset-bottom)); display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 16px; }

.logo { display: block; width: 72px; height: 72px; margin-left: -4px; border-radius: 50%; text-decoration: none; }
.chrome .logo svg { width: 100%; height: 100%; overflow: visible; stroke: none; }
.logo .ring text { fill: var(--text); font: 700 10.5px var(--sans); letter-spacing: 3.2px; }
.logo circle { fill: var(--text); }
.logo .mark { fill: var(--bg); font: 800 17px var(--serif); }
body:not(.gl-ui) .logo .ring { transform-origin: 56px 56px; animation: e79spin 24s linear infinite; }
@keyframes e79spin { to { transform: rotate(360deg); } }

.round { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center;
  transition: background .2s; }
.round:hover, .round[aria-expanded="true"] { background: var(--hover); }
.chrome svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
#menuBtn .i-close { display: none; }
#menuBtn[aria-expanded="true"] .i-close { display: block; } #menuBtn[aria-expanded="true"] .i-menu { display: none; }

.caption { justify-self: start; margin: 0 0 14px; max-width: 220px; font: 500 13px/1.6 var(--sans); letter-spacing: .08em; opacity: .9; }

.dock { display: flex; align-items: center; gap: 6px; padding: 8px; border-radius: 999px; background: var(--dock);
  border: 1px solid var(--line-soft); transition: background .6s var(--ease); }
.chips { display: flex; gap: 4px; }
.chip { height: 44px; padding: 0 20px; border-radius: 999px; font: 500 14px/1 var(--sans); letter-spacing: .08em; white-space: nowrap;
  transition: background .2s, color .2s; }
.chip:hover:not([aria-selected="true"]) { background: var(--hover); }
.chip[aria-selected="true"] { background: var(--text); color: var(--bg); font-weight: 700; cursor: default; }
.vdiv { width: 1px; height: 26px; margin: 0 6px; background: var(--line-soft); }
.counter { display: flex; align-items: center; gap: 2px; }
.tap { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font: 500 20px/1 var(--sans); transition: background .2s; }
.tap:hover:not(:disabled) { background: var(--hover); }
.tap:disabled { opacity: .35; cursor: default; }
.count { min-width: 22px; text-align: center; font: 700 14px/1 var(--sans); letter-spacing: .08em; }
#soundBtn .spk { fill: currentColor; stroke: none; }
#soundBtn .mute { display: block; } #soundBtn .wave { display: none; }
#soundBtn[aria-pressed="true"] .mute { display: none; } #soundBtn[aria-pressed="true"] .wave { display: block; }

.links { justify-self: end; display: flex; gap: 26px; margin-bottom: 10px; }
.link { font: 500 13px/1 var(--sans); letter-spacing: .16em; text-decoration: none; padding: 8px 0; text-underline-offset: 6px; }
.link:hover, .link[aria-expanded="true"] { text-decoration: underline; text-decoration-thickness: 1px; }

/* ---- overlays ---- */
#overlay { position: fixed; inset: 0; display: grid; align-items: center; padding: 0 clamp(24px, 9vw, 160px);
  background: color-mix(in srgb, var(--bg) 45%, transparent);
  backdrop-filter: blur(24px) saturate(1.1); -webkit-backdrop-filter: blur(24px) saturate(1.1);
  opacity: 0; visibility: hidden; transition: opacity .45s var(--ease), visibility 0s linear .45s; }
#overlay.open { opacity: 1; visibility: visible; transition: opacity .45s var(--ease), visibility 0s; }
.panel { grid-area: 1 / 1; display: none; }
#overlay[data-panel="about"] #aboutPanel, #overlay[data-panel="menu"] #menuPanel { display: block; }
.panel > * { opacity: 0; transform: translateY(14px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
#overlay.open .panel > * { opacity: 1; transform: none; }
#overlay.open .panel > *:nth-child(2) { transition-delay: .06s; } #overlay.open .panel > *:nth-child(3) { transition-delay: .12s; }
.panel-title { margin: 0 0 .4em; font: 800 clamp(44px, 8.5vh, 88px)/.95 var(--serif); letter-spacing: .04em; }
.about-text { max-width: 44ch; margin: 0 0 1.6em; font: 500 clamp(13px, 1.1vw, 15px)/1.75 var(--sans); letter-spacing: .03em; }
.about-link { font: 700 13px/1 var(--sans); letter-spacing: .14em; text-underline-offset: 5px; }
#menuList { list-style: none; margin: 0; padding: 0; }
#menuList li { opacity: 0; transform: translateY(14px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
#overlay.open #menuList li { opacity: 1; transform: none; }
#menuList a { display: inline-block; font: 800 clamp(40px, 9.5vh, 96px)/1.08 var(--serif); letter-spacing: .04em; text-decoration: none;
  transition: transform .35s var(--ease), opacity .35s var(--ease); }
#menuList a:hover, #menuList a:focus-visible { transform: translateX(10px); opacity: .72; outline: none; }

:focus-visible { outline: 1px solid var(--text); outline-offset: 3px; }
.noscript { position: fixed; bottom: 50%; width: 100%; text-align: center; z-index: 9; }

/* ---- small screens: dock on two rows, links above it ---- */
@media (max-width: 820px) {
  .chrome.bottom { grid-template-columns: 1fr; justify-items: center; gap: 10px; }
  .caption { display: none; }
  .links { order: -1; justify-self: center; margin: 0; }
  .dock { flex-wrap: wrap; justify-content: center; border-radius: 28px; max-width: calc(100vw - 2 * var(--pad-x)); }
  .chips { width: 100%; justify-content: center; }
  .chip { height: 40px; padding: 0 13px; font-size: 12px; }
  .dock > .vdiv:first-of-type { display: none; }
  .logo { width: 56px; height: 56px; }
  .headline { font-size: min(9.5vh, 15vw); }
  .title-block { top: clamp(84px, 11vh, 104px); }
  .tagline { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition-duration: .01s !important; animation: none !important; }
}
