:root {
  --ink: #f4eddf;
  --muted: rgba(244, 237, 223, .62);
  --line: rgba(244, 237, 223, .24);
  --sky-a: #10182d;
  --sky-b: #7c5969;
  --sky-c: #df9b78;
  --accent: #ffd9a1;
  --ease: cubic-bezier(.77, 0, .18, 1);
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  background: linear-gradient(155deg, var(--sky-a), var(--sky-b) 64%, var(--sky-c));
  color: var(--ink);
  font-family: "DM Mono", monospace;
  font-weight: 300;
  overflow-x: hidden;
  transition: background 2s ease;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 77% 20%, color-mix(in srgb, var(--accent) 24%, transparent), transparent 30%),
              linear-gradient(to bottom, transparent 55%, rgba(3, 8, 16, .44));
  pointer-events: none;
}

button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; font: inherit; }

#weather {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

.grain {
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  pointer-events: none;
  z-index: 10;
  opacity: .055;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
  animation: grain .18s steps(2) infinite;
}

@keyframes grain {
  0% { transform: translate(0, 0); }
  25% { transform: translate(2%, -3%); }
  50% { transform: translate(-3%, 2%); }
  75% { transform: translate(3%, 4%); }
}

.topbar, footer {
  position: fixed;
  left: 0;
  width: 100%;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 34px;
  font-size: 10px;
  letter-spacing: .15em;
}

.topbar { top: 0; border-bottom: 1px solid var(--line); }
footer { bottom: 0; border-top: 1px solid var(--line); color: var(--muted); }
footer button { border: 0; background: none; padding: 0; cursor: pointer; letter-spacing: inherit; font-size: inherit; }
footer button:hover { color: var(--ink); }

.wordmark { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.mark { display: grid; place-items: center; border: 1px solid var(--ink); border-radius: 50%; width: 25px; height: 25px; font-size: 13px; }
.coordinates { color: var(--muted); }

main { position: relative; min-height: 100svh; z-index: 3; }

.arrival {
  width: min(820px, calc(100% - 48px));
  min-height: 100svh;
  margin: auto;
  padding: 130px 0 100px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: opacity .7s ease, transform 1s var(--ease), visibility .7s;
}

.arrival.leaving { opacity: 0; transform: translateY(-40px) scale(.98); visibility: hidden; }

.eyebrow { color: var(--accent); font-size: 10px; letter-spacing: .22em; margin: 0 0 17px; }
h1, h2 { font-family: "Instrument Serif", Georgia, serif; font-weight: 400; letter-spacing: -.035em; line-height: .88; margin: 0; }
h1 { font-size: clamp(60px, 8.2vw, 116px); }
h2 { font-size: clamp(54px, 7vw, 100px); }
h1 em, h2 em { color: var(--accent); font-weight: 400; }

.intro { color: var(--muted); max-width: 490px; margin: 30px 0 35px; font-size: 13px; line-height: 1.8; }

.moods { display: grid; grid-template-columns: repeat(4, 1fr); border: 0; padding: 0; margin: 0 0 30px; gap: 8px; }
.mood {
  border: 1px solid var(--line);
  background: rgba(8, 12, 24, .12);
  padding: 15px 16px;
  min-height: 74px;
  display: flex;
  align-items: center;
  text-align: left;
  gap: 12px;
  cursor: pointer;
  transition: .25s ease;
}
.mood:hover, .mood.selected { background: rgba(244, 237, 223, .12); border-color: rgba(244, 237, 223, .72); transform: translateY(-2px); }
.mood-symbol { font-family: serif; font-size: 25px; }
.mood b { display: block; font-size: 10px; letter-spacing: .14em; font-weight: 400; }
.mood small { display: block; margin-top: 6px; color: var(--muted); font-size: 9px; white-space: nowrap; }

.depart {
  align-self: flex-start;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #192033;
  min-width: 268px;
  height: 57px;
  padding: 0 8px 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-size: 10px;
  letter-spacing: .16em;
  transition: .25s ease;
}
.depart:hover { background: transparent; color: var(--ink); transform: translateX(4px); }
.depart .arrow { display: grid; place-items: center; width: 41px; height: 41px; border: 1px solid currentColor; border-radius: 50%; font-size: 17px; }

.place {
  display: none;
  min-height: 100svh;
  position: relative;
  padding: 120px 6vw 95px;
  align-items: center;
}
.place.visible { display: flex; animation: arrive 1.15s var(--ease) both; }
@keyframes arrive { from { opacity: 0; transform: scale(1.025); } }

.field-note { width: 58%; position: relative; z-index: 5; }
.description { max-width: 590px; margin: 30px 0 28px; color: rgba(244,237,223,.82); line-height: 1.8; font-size: 13px; }
.instruction { border-left: 1px solid var(--accent); padding-left: 18px; font-family: "Instrument Serif", Georgia, serif; font-size: 20px; line-height: 1.25; max-width: 500px; }
.instruction span:first-child { color: var(--accent); font: 9px "DM Mono", monospace; letter-spacing: .18em; }

.scene { position: absolute; inset: 0; overflow: hidden; }
.orb {
  position: absolute;
  left: 72%; top: 17%;
  width: clamp(100px, 16vw, 230px); aspect-ratio: 1;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 80px color-mix(in srgb, var(--accent) 42%, transparent);
  opacity: .88;
  animation: breathe 7s ease-in-out infinite;
}
@keyframes breathe { 50% { transform: scale(1.025); filter: brightness(1.12); } }

.horizon { position: absolute; bottom: 0; width: 130%; left: -15%; transform-origin: bottom; }
.horizon.far {
  height: 40%;
  opacity: .48;
  background: color-mix(in srgb, var(--sky-a) 75%, black);
  clip-path: polygon(0 52%, 8% 38%, 18% 49%, 28% 20%, 37% 46%, 49% 28%, 60% 48%, 72% 15%, 83% 42%, 92% 27%, 100% 48%, 100% 100%, 0 100%);
}
.horizon.near {
  height: 26%;
  background: color-mix(in srgb, var(--sky-a) 82%, black);
  clip-path: polygon(0 55%, 12% 30%, 24% 45%, 36% 24%, 49% 55%, 62% 34%, 76% 53%, 88% 25%, 100% 48%, 100% 100%, 0 100%);
}
.reflection { position: absolute; bottom: 0; left: 60%; width: 26%; height: 19%; background: linear-gradient(to bottom, color-mix(in srgb, var(--accent) 35%, transparent), transparent); filter: blur(12px); clip-path: polygon(44% 0, 58% 0, 100% 100%, 0 100%); opacity: .5; }

.place-actions { position: absolute; z-index: 8; right: 3vw; bottom: 90px; display: flex; flex-direction: column; gap: 12px; }
.round-action { width: 86px; height: 86px; border: 1px solid var(--line); border-radius: 50%; background: rgba(10,15,28,.18); backdrop-filter: blur(8px); cursor: pointer; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 8px; transition: .25s ease; }
.round-action:hover { border-color: var(--ink); background: rgba(244,237,223,.1); transform: scale(1.05); }
.action-icon { font-size: 20px; }
.action-label { font-size: 7px; letter-spacing: .13em; }
.sound-bars { height: 18px; display: flex; align-items: center; gap: 3px; }
.sound-bars i { display: block; width: 1px; height: 7px; background: currentColor; }
.sound-bars i:nth-child(2) { height: 15px; }
.sound-bars i:nth-child(3) { height: 10px; }
.sound-on .sound-bars i { animation: bars .65s ease-in-out infinite alternate; }
.sound-on .sound-bars i:nth-child(2) { animation-delay: -.3s; }
.sound-on .sound-bars i:nth-child(3) { animation-delay: -.5s; }
@keyframes bars { to { height: 18px; } }

dialog { width: min(550px, calc(100% - 40px)); border: 1px solid var(--line); color: var(--ink); background: rgba(15,22,38,.92); backdrop-filter: blur(20px); padding: 50px; }
dialog::backdrop { background: rgba(4,8,16,.55); backdrop-filter: blur(3px); }
dialog h2 { font-size: 58px; margin-bottom: 27px; }
dialog > p:not(.eyebrow) { color: var(--muted); font-size: 12px; line-height: 1.8; }
.dialog-close { position: absolute; right: 18px; top: 15px; border: 0; background: none; font-size: 27px; cursor: pointer; }
.toast { position: fixed; z-index: 30; left: 50%; bottom: 85px; transform: translate(-50%, 20px); background: var(--ink); color: #182033; padding: 12px 18px; font-size: 9px; letter-spacing: .1em; opacity: 0; pointer-events: none; transition: .35s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

@media (max-width: 720px) {
  .topbar, footer { padding: 18px 20px; }
  .coordinates, footer > span { display: none; }
  .arrival { width: calc(100% - 40px); padding-top: 105px; }
  .moods { grid-template-columns: repeat(2, 1fr); }
  .mood { min-height: 67px; }
  .place { align-items: flex-start; padding: 128px 22px 180px; }
  .field-note { width: 100%; }
  .place-actions { right: auto; left: 20px; bottom: 65px; flex-direction: row; }
  .round-action { width: 72px; height: 72px; }
  .orb { left: 66%; top: 14%; opacity: .5; }
  dialog { padding: 40px 25px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
