@font-face {
  font-family: "Meadow Serif";
  src: url("assets/meadow-serif.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  --paper: #f3f3e9;
  --ink: #293c31;
  --muted: #536456;
  --rule: #d8ded0;
  --selected: #dce5d6;
  --serif: "Meadow Serif", "Songti SC", "Noto Serif CJK SC", SimSun, serif;
}

* { box-sizing: border-box; }

body {
  min-width: 0;
  min-height: 100vh;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  transition: background-color 650ms ease, color 650ms ease;
}

body[data-wind="dusk"] {
  --paper: #f4ece5;
  --ink: #422e3a;
  --muted: #6c505d;
  --rule: #e3d5d7;
  --selected: #eddad9;
}

body[data-wind="night"] {
  color-scheme: dark;
  --paper: #1b2734;
  --ink: #edf0e7;
  --muted: #bbcad1;
  --rule: #425463;
  --selected: #354c5f;
}

button {
  color: inherit;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

.frame {
  width: min(100% - 104px, 1248px);
  margin-inline: auto;
}

.masthead {
  min-height: 92px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.brand, .sound { display: flex; align-items: center; }

.brand { gap: 0.8rem; }

.brand-mark {
  width: 39px;
  height: 39px;
  border-radius: 50%;
  background: #e0e8da;
}

.brand-name { display: grid; gap: 0.12rem; }

.brand-name > span:first-child {
  font-family: var(--serif);
  font-size: 1.15rem;
  letter-spacing: 0.13em;
  line-height: 1.2;
}

.brand-english {
  font: italic 0.82rem/1.15 Georgia, serif;
  color: var(--muted);
}

.sound {
  min-height: 44px;
  gap: 0.55rem;
  padding: 0 0.75rem;
  border: 1px solid var(--rule);
  border-radius: 99px;
  background: transparent;
  font-size: 0.875rem;
  white-space: nowrap;
}

.sound:hover, .sound[aria-pressed="true"] { background: var(--selected); }
.sound:disabled { cursor: default; }
.sound-state { color: var(--muted); }

.sound-icon {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 17px;
  opacity: 0.7;
}

.sound-icon i {
  width: 1.5px;
  height: 5px;
  background: currentColor;
  border-radius: 1px;
}

.sound-icon i:nth-child(2) { height: 11px; }
.sound-icon i:nth-child(3) { height: 15px; }
.sound-icon i:nth-child(4) { height: 8px; }
.sound[aria-pressed="true"] .sound-icon { opacity: 1; }

.meadow {
  position: relative;
  isolation: isolate;
  height: clamp(540px, 74svh, 720px);
  overflow: hidden;
  border-radius: 18px;
  background: #4f614c;
  color: #fff9e8;
}

.landscape, .wash, .stars, #meadow-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.landscape {
  background: #687257 url("assets/meadow.webp") center 56% / cover no-repeat;
  transition: filter 850ms ease;
}

.wash {
  background:
    linear-gradient(90deg, rgb(17 37 29 / 76%), rgb(21 38 29 / 58%) 30%, transparent 72%),
    linear-gradient(0deg, rgb(12 28 19 / 64%), transparent 29%);
}

.wash::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  background: linear-gradient(115deg, #151f40 10%, #293e61 54%, #426b8b 100%);
  mix-blend-mode: color;
  transition: opacity 850ms ease;
}

[data-wind="dusk"] .landscape { filter: sepia(28%) hue-rotate(326deg) saturate(1.55) brightness(0.9); }
[data-wind="dusk"] .wash::after {
  opacity: 0.62;
  background: linear-gradient(105deg, #3b2646 20%, #a56882 65%, #ee9865);
}

[data-wind="night"] .landscape { filter: saturate(0.45) brightness(0.51); }
[data-wind="night"] .wash::after { opacity: 0.98; }

.stars {
  opacity: 0;
  background:
    radial-gradient(circle at 48% 17%, #ffe9c9 0.65px, transparent 1.6px),
    radial-gradient(circle at 58% 9%, #daedff 0.6px, transparent 1.5px),
    radial-gradient(circle at 65% 21%, #fff6de 0.8px, transparent 1.8px),
    radial-gradient(circle at 72% 13%, #e3f1ff 0.7px, transparent 1.6px),
    radial-gradient(circle at 79% 26%, #fff5d5 0.7px, transparent 1.6px),
    radial-gradient(circle at 85% 11%, #cfe4f9 0.7px, transparent 1.7px),
    radial-gradient(circle at 93% 25%, #dfebf5 0.8px, transparent 1.8px);
  transition: opacity 850ms ease;
}

.stars::before {
  content: "";
  position: absolute;
  right: 11%;
  top: 16%;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  transform: rotate(-30deg);
  box-shadow: inset 8px -4px 0 #e2e6cf;
  filter: drop-shadow(0 0 9px rgb(217 230 221 / 45%));
}

[data-wind="night"] .stars { opacity: 0.82; }

.invitation {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: clamp(2rem, 6.2vw, 6.25rem);
  transform: translateY(-54%);
}

h1 {
  margin: 0;
  font: 400 clamp(4rem, 6.5vw, 6.75rem)/1.12 var(--serif);
  letter-spacing: 0.045em;
  text-shadow: 0 2px 28px rgb(17 33 24 / 30%);
}

.intro {
  margin: 1.45rem 0 1.75rem;
  color: #fff9e8;
  font-size: 1.02rem;
  letter-spacing: 0.075em;
  line-height: 1.75;
}

.small-screen { display: none; }

.blow {
  min-height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  padding: 0 1.3rem;
  background: #f9f3d9;
  color: #293a2d;
  border: 1px solid transparent;
  border-radius: 99px;
  font-weight: 600;
  letter-spacing: 0.06em;
  box-shadow: 0 5px 22px rgb(19 35 24 / 23%);
  transition: background 180ms ease, transform 180ms ease;
}

.blow:hover { background-color: #fff9e9; transform: translateY(-2px); }
.blow:active { transform: translateY(1px); }
.blow:focus-visible { outline-color: #fff9e8; }

.wind-icon {
  width: 19px;
  height: 16px;
  position: relative;
  display: inline-block;
}

.wind-icon i {
  display: block;
  position: absolute;
  height: 6px;
  border: 1.4px solid currentColor;
  border-left: 0;
  border-top-color: transparent;
  border-radius: 0 5px 5px 0;
}

.wind-icon i:nth-child(1) { top: 0; left: 3px; width: 12px; }
.wind-icon i:nth-child(2) { top: 5px; left: 0; width: 19px; }
.wind-icon i:nth-child(3) { top: 10px; left: 5px; width: 8px; }

.hint {
  margin: 0.85rem 0 0;
  font-size: 0.8125rem;
  color: #fff8e4;
  letter-spacing: 0.05em;
}

kbd {
  font: inherit;
  padding: 0.05em 0.38em;
  border: 1px solid rgb(255 248 228 / 50%);
  border-radius: 4px;
}

.flower-target {
  display: none;
  position: absolute;
  transform: translate(-50%, -50%);
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 50%;
}

.flower-target.ready { display: block; }

.field-note {
  position: absolute;
  left: clamp(2rem, 6.2vw, 6.25rem);
  bottom: 1.9rem;
  max-width: calc(100% - 4rem);
  margin: 0;
  padding-left: 0.8rem;
  border-left: 1px solid rgb(247 238 212 / 63%);
  color: #fff5db;
  font: 400 1rem/1.6 var(--serif);
  letter-spacing: 0.12em;
  pointer-events: none;
}

.noscript {
  position: absolute;
  bottom: 4rem;
  left: 2rem;
  padding: 0.65rem;
  background: #293c31;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 82px;
}

.wind-picker, .choices { display: flex; align-items: center; }

.wind-picker { gap: 1rem; }

.picker-label {
  color: var(--muted);
  font-size: 0.875rem;
  white-space: nowrap;
}

.choices {
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--rule);
  border-radius: 99px;
}

.choices button, .reset {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0 0.85rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 99px;
  font-size: 0.9rem;
  white-space: nowrap;
}

.choices button { min-height: 40px; }
.choices button:hover, .choices button[aria-pressed="true"], .reset:hover { background: var(--selected); }
.choices button[aria-pressed="true"] { font-weight: 650; }
.choices button:focus-visible { outline-offset: -2px; }

.scene-icon {
  display: inline-grid;
  place-items: center;
  width: 1rem;
  font: 1.17rem/1 Georgia, serif;
}

.sunset {
  position: relative;
  height: 12px;
  border-bottom: 1px solid currentColor;
}

.sunset::before {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  bottom: 2px;
  height: 5px;
  border: 1px solid currentColor;
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
}

.reset { color: var(--muted); }

.reset-icon { font: 1.32rem/1 Georgia, serif; }

@media (pointer: coarse) {
  .keys { display: none; }
  .choices button { min-height: 44px; }
}

@media (max-width: 840px) {
  .frame { width: calc(100% - 48px); }
  .masthead { min-height: 74px; }
  h1 { font-size: clamp(3.25rem, 8.6vw, 5.1rem); }
}

@media (max-width: 600px) {
  .frame { width: calc(100% - 28px); }
  .masthead { min-height: 68px; padding-inline: 0.2rem; }
  .meadow {
    height: clamp(580px, 84svh, 690px);
    border-radius: 14px;
  }

  .landscape { background-position: 62% 50%; }
  .wash { background: linear-gradient(120deg, rgb(17 37 29 / 81%), rgb(21 38 29 / 34%) 50%, transparent 77%), linear-gradient(0deg, rgb(12 28 19 / 73%), transparent 24%); }
  .stars::before { right: 12%; top: 13%; width: 1.65rem; height: 1.65rem; }
  .invitation { left: 1.45rem; top: 5.5%; transform: none; }
  .intro { margin: 0.88rem 0 1rem; font-size: 1rem; }
  .small-screen { display: initial; }
  .blow { min-height: 47px; }
  .hint { margin-top: 0.65rem; }
  .field-note { left: 1.45rem; bottom: 1.1rem; }
  .toolbar { min-height: 76px; gap: 0.35rem; padding-block: 0.5rem; }
  .picker-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .choices button, .reset { gap: 0.23rem; padding-inline: 0.62rem; }
  .scene-icon { width: 0.82rem; }
}

@media (max-width: 365px) {
  .choices button, .reset { padding-inline: 0.42rem; }
  .toolbar { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::after, *::before { transition: none !important; }
  .blow:hover, .blow:active { transform: none; }
}
