:root {
  color-scheme: dark;
  --ink: #f1f5fb;
  --muted: #a8b3c5;
  --deep: #0a1221;
  --panel: rgba(19, 31, 50, 0.82);
  --line: rgba(205, 222, 244, 0.16);
  --ice: #c7e6f4;
  --coral: #ff8f70;
  --mint: #9ce1d0;
  --shadow: 0 26px 70px rgba(0, 0, 0, 0.28);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 76% 8%, rgba(94, 139, 185, 0.22), transparent 30rem),
    radial-gradient(circle at 8% 70%, rgba(255, 143, 112, 0.08), transparent 24rem),
    var(--deep);
  overflow-x: hidden;
}

button, input { font: inherit; }
button { cursor: pointer; }

.page-noise {
  position: fixed;
  z-index: -1;
  inset: 0;
  opacity: 0.075;
  pointer-events: none;
  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='.34'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.shell {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: 30px 0 24px;
}

.topbar, .footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar { border-bottom: 1px solid var(--line); padding-bottom: 20px; }
.wordmark { color: var(--ink); font-size: 0.83rem; font-weight: 800; letter-spacing: 0.16em; text-decoration: none; }
.wordmark span { color: var(--ice); }
.connection, .footer, .field-hint, .source-line { color: var(--muted); font-size: 0.74rem; letter-spacing: 0.04em; }
.connection { display: flex; align-items: center; gap: 8px; margin: 0; }
.connection-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 4px rgba(156, 225, 208, 0.11); }

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(340px, 0.88fr);
  min-height: 520px;
  align-items: center;
  gap: clamp(38px, 6vw, 78px);
  padding: 52px 0 42px;
}

.hero-copy { position: relative; z-index: 2; max-width: 590px; }
.eyebrow { margin: 0 0 22px; color: var(--ice); font-size: 0.68rem; font-weight: 750; letter-spacing: 0.22em; }
h1, h2, p { margin-top: 0; }
h1 { max-width: 650px; margin-bottom: 24px; font-size: clamp(3.6rem, 8.4vw, 7.2rem); font-weight: 690; letter-spacing: -0.09em; line-height: 0.91; }
h1 em { color: var(--coral); font-style: normal; }
.intro { max-width: 440px; margin-bottom: 36px; color: var(--muted); font-size: 1rem; line-height: 1.75; word-break: keep-all; }

.weather-form { max-width: 560px; }
.weather-form label { display: block; margin-bottom: 11px; color: var(--ink); font-size: 0.78rem; font-weight: 700; }
.input-row { display: flex; gap: 10px; }
input {
  min-width: 0;
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  padding: 16px 17px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.055);
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}
input::placeholder { color: #7f8da2; }
input:focus { border-color: var(--ice); background: rgba(255, 255, 255, 0.09); box-shadow: 0 0 0 4px rgba(199, 230, 244, 0.13); }
button {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  border: 0;
  border-radius: 12px;
  padding: 0 18px;
  color: var(--deep);
  background: var(--ice);
  font-size: 0.8rem;
  font-weight: 800;
  white-space: nowrap;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}
button:hover { background: #e0f3fb; box-shadow: 0 8px 24px rgba(199, 230, 244, 0.16); transform: translateY(-2px); }
button:focus-visible { outline: 3px solid var(--coral); outline-offset: 4px; }
button:disabled { cursor: wait; opacity: 0.7; transform: none; }
.button-arrow { font-size: 1.2rem; font-weight: 500; }
.button-loading { display: none; }
button.is-loading .button-label { display: none; }
button.is-loading .button-loading { display: inline; }
.field-hint { margin: 11px 0 0; }
.message { margin: 18px 0 0; font-size: 0.84rem; line-height: 1.6; }
.error-message { color: #ffb6a4; }

.result-stage { position: relative; min-height: 430px; display: flex; align-items: center; }
.weather-visual { position: relative; width: 100%; min-height: 430px; isolation: isolate; }
.result-stage.has-result .weather-visual { display: none; }
.weather-visual::before { position: absolute; inset: 16% 8% 10%; z-index: -1; border: 1px solid rgba(199, 230, 244, 0.16); border-radius: 50%; content: ""; transform: rotate(-18deg) scaleY(0.45); }
.weather-visual::after { position: absolute; top: 50%; left: 50%; width: 1px; height: 88%; background: linear-gradient(transparent, rgba(199, 230, 244, 0.23), transparent); content: ""; transform: translate(-50%, -50%) rotate(54deg); }
.orbit { position: absolute; top: 50%; left: 50%; border: 1px solid rgba(199, 230, 244, 0.3); border-radius: 50%; transform: translate(-50%, -50%); }
.orbit-large { width: min(31vw, 355px); height: min(31vw, 355px); border-color: rgba(255, 143, 112, 0.38); transform: translate(-50%, -50%) rotate(38deg) scaleY(0.5); }
.orbit-small { width: min(23vw, 260px); height: min(23vw, 260px); transform: translate(-50%, -50%) rotate(-28deg) scaleY(0.68); }
.sun-disc { position: absolute; top: 50%; left: 50%; width: min(17vw, 195px); height: min(17vw, 195px); border-radius: 50%; background: radial-gradient(circle at 37% 30%, #ffe5bd 0 5%, #ffb28e 30%, var(--coral) 70%, #b9585a 100%); box-shadow: 0 0 75px rgba(255, 143, 112, 0.24); transform: translate(-50%, -50%); }
.sun-disc span { position: absolute; inset: 10%; border: 1px solid rgba(255, 245, 222, 0.42); border-radius: 50%; }
.visual-label { position: absolute; color: #8092a9; font-size: 0.61rem; letter-spacing: 0.18em; }
.visual-label-top { top: 16%; right: 6%; }
.visual-label-bottom { bottom: 12%; left: 3%; max-width: 100px; line-height: 1.5; }

.result-card { width: 100%; margin: 0; padding: 32px 31px 26px; border: 1px solid rgba(199, 230, 244, 0.21); border-radius: 20px; background: linear-gradient(120deg, rgba(28, 48, 73, 0.92), rgba(15, 27, 45, 0.9)); box-shadow: var(--shadow); animation: arrive 420ms cubic-bezier(.2,.75,.2,1) both; }
.result-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.result-heading .eyebrow { margin-bottom: 10px; }
h2 { margin-bottom: 0; font-size: clamp(2rem, 5vw, 3.4rem); letter-spacing: -0.07em; line-height: 1; }
.umbrella-chip { border: 1px solid rgba(156, 225, 208, 0.38); border-radius: 999px; padding: 8px 11px; color: var(--mint); font-size: 0.74rem; font-weight: 700; white-space: nowrap; }
.umbrella-chip.needs-umbrella { border-color: rgba(255, 143, 112, 0.42); color: #ffb6a4; }
.result-summary { max-width: 640px; margin: 26px 0 25px; color: #d7e1ed; font-size: 1.05rem; line-height: 1.6; word-break: keep-all; }
.metric-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.metric { padding: 20px 18px 19px; border-left: 1px solid var(--line); }
.metric:first-child { border-left: 0; padding-left: 0; }
.metric span { display: block; margin-bottom: 9px; color: var(--muted); font-size: 0.7rem; letter-spacing: 0.1em; }
.metric strong { color: var(--ink); font-size: clamp(1.4rem, 3vw, 2.3rem); letter-spacing: -0.05em; }
.metric-featured strong { color: var(--ice); }
.source-line { margin: 18px 0 0; }
.source-line span { color: #d3ddea; }

.footer { padding-top: 22px; border-top: 1px solid var(--line); }
.footer p { margin: 0; }
.footer span { color: var(--coral); padding: 0 5px; }
[hidden] { display: none !important; }

@keyframes arrive { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 760px) {
  .shell { width: min(100% - 34px, 580px); padding-top: 21px; }
  .connection { font-size: 0.65rem; }
  .hero { display: block; min-height: 0; padding: 62px 0 45px; }
  h1 { font-size: clamp(3.7rem, 17vw, 6.1rem); }
  .intro { margin-bottom: 34px; font-size: 0.94rem; }
  .result-stage { min-height: 205px; margin-top: 30px; }
  .weather-visual { min-height: 205px; }
  .orbit-large { width: 220px; height: 220px; }
  .orbit-small { width: 170px; height: 170px; }
  .sun-disc { width: 128px; height: 128px; }
  .visual-label-top { top: 7%; right: 4%; }
  .visual-label-bottom { bottom: 5%; left: 9%; }
  .result-card { padding: 27px 21px 22px; }
  .result-summary { margin-top: 27px; font-size: 1rem; }
}

@media (max-width: 500px) {
  .input-row { display: block; }
  input, button { width: 100%; }
  button { justify-content: center; min-height: 54px; margin-top: 9px; }
  .metric { padding-right: 8px; padding-left: 12px; }
  .metric:first-child { padding-left: 0; }
  .metric strong { font-size: 1.35rem; }
  .source-line { line-height: 1.6; }
}

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