@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@300;400&family=Inter:ital,wght@0,300;0,400;1,300;1,400&display=swap");

/* Worlding — its own colour environment (see WORLDING.md) */
:root {
  --w-bg: #141B29; --w-text: #E2E6ED; --w-muted: #A9B5C7; --w-line: rgba(226,230,237,.22); --w-jade: #3FAE86;
  --sans: "Inter", "Noto Sans JP", "Helvetica Neue", "Hiragino Sans", "Yu Gothic", Arial, sans-serif;
  --serif: var(--sans);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--w-bg); color: var(--w-text); font-family: var(--sans); font-weight: 300; font-size: 16px; line-height: 1.65; }
html[lang="ja"] body { line-height: 1.9; }
a { color: inherit; text-underline-offset: .22em; text-decoration-thickness: 1px; }
:focus-visible { outline: 2px solid var(--w-jade); outline-offset: 3px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--w-text); color: var(--w-bg); padding: .5rem 1rem; z-index: 20; }

.w-top { position: fixed; z-index: 5; top: 0; left: 0; right: 0; display: flex; gap: 1.5rem; align-items: baseline;
  padding: max(1.25rem, env(safe-area-inset-top)) clamp(1.25rem, 4vw, 3.5rem) 0; font-size: .9375rem; pointer-events: none; }
.w-top a, .w-top span { pointer-events: auto; text-decoration: none; }
.w-home { letter-spacing: .08em; }
.w-name { color: var(--w-muted); }
.w-lang { margin-left: auto; padding: .35rem 0; }

.w-intro { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: repeat(12, 1fr); column-gap: clamp(1rem, 2.4vw, 2.25rem);
  align-content: end; padding: 7rem clamp(1.25rem, 4vw, 3.5rem) clamp(3rem, 10vh, 6rem); position: relative; overflow: hidden; }
.w-intro::before { content: ""; position: absolute; width: 60vmin; height: 60vmin; right: 8%; top: 6%; border-radius: 50%;
  background: radial-gradient(circle, rgba(63,174,134,.22) 0%, rgba(63,174,134,0) 66%); pointer-events: none; }
.w-intro > * { grid-column: 1 / span 6; position: relative; }
.w-title { font-family: var(--serif); font-weight: 400; font-size: clamp(2rem, 5vw, 3.5rem); margin: 0 0 2rem; }
.w-text p { max-width: 34em; margin: 0 0 1rem; }
.w-small { font-size: .875rem; color: var(--w-muted); }
.w-enter { font: inherit; font-size: 1.0625rem; color: var(--w-bg); background: var(--w-text); border: 0; padding: .8rem 2.25rem; margin-top: 1.5rem; cursor: pointer; min-height: 48px; }
.w-enter:hover { background: #fff; }
.w-enter[disabled] { opacity: .6; cursor: progress; }
.w-back { font-size: .875rem; margin-top: 1.25rem; }
.w-back a { color: var(--w-muted); }

.w-stage { position: fixed; inset: 0; background: var(--w-bg); }
.w-stage[hidden] { display: none; }
#w-canvas { display: block; width: 100%; height: 100%; }
.w-status { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); margin: 0; color: var(--w-muted); font-size: .9375rem; text-align: center; max-width: 80vw; }
.w-status:empty { display: none; }
.w-controls { position: absolute; left: clamp(1rem, 3vw, 2.5rem); bottom: max(1rem, env(safe-area-inset-bottom)); display: flex; flex-wrap: wrap; gap: .25rem .4rem;
  transition: opacity .6s ease; }
.w-controls button, .w-controls a { font: inherit; font-size: .8125rem; color: var(--w-text); background: rgba(20,27,41,.55); border: 1px solid var(--w-line);
  padding: .45rem .8rem; min-height: 40px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; backdrop-filter: blur(2px); }
.w-controls button:hover, .w-controls a:hover { border-color: var(--w-text); }
.w-top { transition: opacity .6s ease; }
body.w-idle .w-top:not(:focus-within), body.w-idle .w-controls:not(:focus-within) { opacity: 0; }
body.w-idle .w-stage { cursor: none; }
body.w-running .w-top { z-index: 60; }
.w-info { position: absolute; right: clamp(1rem, 3vw, 2.5rem); bottom: calc(max(1rem, env(safe-area-inset-bottom)) + 3.5rem); width: min(26rem, calc(100vw - 2rem));
  max-height: 70vh; overflow: auto; background: rgba(20,27,41,.97); border: 1px solid var(--w-line); padding: 1.25rem 1.25rem .75rem; font-size: .8125rem; }
.w-info dl { display: grid; grid-template-columns: max-content 1fr; gap: .2rem 1rem; margin: 1rem 0; }
.w-info dt { color: var(--w-muted); }
.w-info dd { margin: 0; overflow-wrap: anywhere; }
.w-info-poem { font-family: var(--serif); font-size: .9375rem; white-space: pre-wrap; border-left: 1px solid var(--w-line); padding-left: .9rem; }
.w-info button { font: inherit; color: var(--w-text); background: none; border: 1px solid var(--w-line); padding: .35rem .7rem; cursor: pointer; }
.w-stage.expanded { z-index: 50; }

@media (max-width: 760px) {
  .w-intro > * { grid-column: 1 / -1; }
  .w-controls button, .w-controls a { font-size: .75rem; padding: .4rem .6rem; }
  .w-info { left: 1rem; right: 1rem; width: auto; bottom: 6.5rem; }
}
@media (prefers-reduced-motion: reduce) { .w-controls, .w-top { transition: none !important; } }

/* pale worlds: interface ink follows the ground */
body.w-pale .w-top { color: #20211F; }
body.w-pale .w-name { color: #4d524e; }
body.w-pale .w-controls button, body.w-pale .w-controls a { color: #20211F; background: rgba(236,232,220,.7); border-color: rgba(32,33,31,.25); }
