@font-face {
  font-family: TodaySerif;
  src: url('/title.woff') format('woff');
  font-weight: 700;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --bg: #101525;
  --paper: #1a2137;
  --layer: #232c47;
  --inset: #141b30;
  --ink: #f2f4ff;
  --dim: #b0b9d2;
  --soft: #d3daf2;
  --accent: #bec6ff;
  --accent-strong: #dbe0ff;
  --accent-ink: #141b38;
  --line: #3b4564;
  --plum: var(--accent);
  --status: #ffc0d7;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 18px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", "Noto Sans CJK KR", "Malgun Gothic", system-ui, sans-serif;
}
a { color: inherit; }
:where(a, button, input, select, textarea, summary):focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 3px; }
.shell { width: min(100%, 1140px); margin-inline: auto; padding-inline: clamp(15px, 4vw, 40px); }
header { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 64px; font-weight: 800; }
header a { text-decoration: none; white-space: nowrap; letter-spacing: -.02em; }
header i { color: var(--accent); }
.usage { padding: 4px 11px; border-radius: 999px; background: var(--layer); color: var(--soft); font-size: .8rem; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .9fr); align-items: start; gap: 20px; }
.form-side, .stage { min-width: 0; }
.hero { isolation: isolate; position: relative; display: flex; align-items: end; overflow: hidden; border-radius: 22px; min-height: 228px; color: var(--ink); background: var(--inset); margin-bottom: 14px; grid-column: 1/-1; }
.hero picture, .hero img, .hero::after { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero img { object-fit: cover; object-position: 50% 31%; z-index: -2; }
.hero::after { content: ""; z-index: -1; background: linear-gradient(0deg,#101733f4 1%,#131c3b44 64%,transparent); }
.hero-copy { padding: 24px; max-width: 95%; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.92rem, 7vw, 3.1rem); font-weight: 800; line-height: 1.18; letter-spacing: -.065em; }
.hero p { font-size: .9rem; color: #e4e9ff; margin-top: 8px; word-break: keep-all; }
h2 { font-size: 1.2rem; letter-spacing: -.04em; line-height: 1.36; margin-bottom: 12px; }
h3 { font-size: 1rem; line-height: 1.36; margin: 0 0 6px; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: clamp(14px, 3vw, 23px); margin-bottom: 13px; }
.dates { display: grid; grid-template-columns: minmax(0, 1.35fr) repeat(2, minmax(0, 1fr)); gap: 7px; }
.second { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 10px; }
label { display: block; font-size: .84rem; font-weight: 720; color: var(--soft); min-width: 0; }
.check { display: flex; align-items: center; gap: 7px; min-height: 44px; }
input, textarea, select, button { font: inherit; }
input::placeholder, textarea::placeholder { color: #929fbf; }
input:not([type=checkbox]), select, textarea { display: block; width: 100%; min-width: 0; max-width: 100%; color: var(--ink); background: var(--inset); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; min-height: 45px; font-size: 16px; }
textarea { resize: vertical; }
input[type=time] { min-inline-size: 0; }
button { cursor: pointer; }
button:disabled { opacity: .62; cursor: default; }
.primary, .quiet { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 7px 13px; border: 1px solid transparent; border-radius: 10px; text-decoration: none; font-weight: 750; font-size: .88rem; text-align: center; }
.primary { background: var(--accent); color: var(--accent-ink); }
.quiet { color: var(--ink); background: var(--layer); border-color: var(--line); }
.primary:hover { background: var(--accent-strong); }
.quiet:hover { border-color: var(--accent); }
.wide { width: 100%; }
details { color: var(--dim); font-size: .86rem; margin-top: 9px; }
summary { cursor: pointer; }
details p { margin-top: 5px; }
.small, footer, .status { font-size: .83rem; color: var(--dim); }
.status:empty { display: none; }
.status:not(:empty) { margin-top: 8px; color: var(--status); }
.topics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.topics button, .suggestions button { background: var(--inset); border: 1px solid var(--line); border-radius: 9px; color: var(--ink); min-height: 44px; padding: 5px; font-size: .84rem; }
.topics button[aria-pressed=true] { background: var(--layer); border-color: var(--accent); color: var(--accent-strong); font-weight: 750; }
.suggestions { display: flex; flex-wrap: wrap; gap: 6px; margin: 9px 0 11px; }
.suggestions button { text-align: left; padding-inline: 8px; }
.buttons { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 11px; }
.pillars { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-bottom: 10px; }
.pillar { text-align: center; border-radius: 9px; background: var(--layer); padding: 8px 2px; }
.pillar b { display: block; font-size: 1.34rem; color: var(--ink); }
.pillar span { font-size: .76rem; color: var(--dim); }
.elements { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; text-align: center; margin-bottom: 8px; }
.element { border-top: 3px solid var(--line); padding-top: 5px; font-size: .82rem; }
.element:nth-child(1) { border-color: #79c7c5; }
.element:nth-child(2) { border-color: #f0a1b5; }
.element:nth-child(3) { border-color: #e7bd9f; }
.element:nth-child(4) { border-color: #d1d4e9; }
.element:nth-child(5) { border-color: #9ab3fc; }
.card-wrap { float: right; margin: 0 0 8px 12px; width: clamp(102px, 31%, 164px); padding: 0; border: 0; background: none; }
canvas { display: block; width: 100%; height: auto; border-radius: 12px; background: var(--inset); box-shadow: 0 8px 20px #06081250; }
canvas.reveal { animation: reveal .42s ease-out both; }
@keyframes reveal { from { transform: perspective(650px) rotateY(-42deg) scale(.97); opacity: .35; } to { transform: perspective(650px) rotateY(0) scale(1); opacity: 1; } }
#result { display: flow-root; }
#result h2 { margin: 4px 0 9px; }
#result > p { overflow-wrap: anywhere; }
.action { clear: both; background: var(--layer); border-inline-start: 3px solid var(--accent); padding: 9px 11px; margin-top: 11px; border-radius: 0 8px 8px 0; }
#share-result { margin-top: 9px; }
#share-status { margin-top: 6px; }
.again { display: block; font-weight: 750; color: var(--accent); margin-top: 12px; }
footer { padding: 8px 0 25px; }
dialog { width: min(100% - 24px, 520px); max-width: none; border: 1px solid var(--line); border-radius: 22px; padding: 20px; background: var(--paper); color: var(--ink); }
dialog::backdrop { background: #070a15bb; }
dialog h2 { padding-inline-end: 32px; }
.close { position: absolute; right: 9px; top: 9px; min-width: 44px; min-height: 44px; border: 0; background: transparent; border-radius: 11px; font-size: 1.42rem; color: var(--accent-strong); }
.close:hover { background: var(--layer); }
.plans { display: grid; gap: 8px; margin: 13px 0; }
.plan { min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--layer); border: 1px solid var(--line); border-radius: 10px; color: var(--ink); padding: 8px 10px; text-align: left; }
.plan strong { font-size: 1.1rem; }
[hidden] { display: none !important; }
.birth-heading { display: flex; align-items: center; justify-content: space-between; gap: 7px; margin-bottom: 5px; }
.birth-heading h2 { margin: 0; }
.birth-heading button { min-height: 44px; font-size: .8rem; }
#art-dialog { padding: 12px; width: auto; max-width: calc(100% - 22px); background: var(--inset); overflow: hidden; }
#art-dialog canvas { width: min(78vw, calc((100dvh - 65px) * .5625), 370px); margin-inline: auto; }
#art-dialog .close { color: #fff; background: #131830dc; }
.periods { display: flex; gap: 5px; align-items: center; overflow-x: auto; margin-bottom: 12px; }
.periods > a { flex: none; white-space: nowrap; }
.periods button { flex: 1; white-space: nowrap; min-height: 44px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); color: var(--soft); font-weight: 750; padding: 4px 8px; }
.periods button[aria-pressed=true] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.periods .account-link { flex: 0 0 auto; }
.feature { order: 0; }
.feature h2 { font-size: 1.4rem; margin: .2em 0; }
.flow-date { color: var(--accent); font-size: .82rem; font-weight: 750; }
.flow-action { margin-top: 8px; font-weight: 730; }
.flow-reading { color: var(--dim); }
.paths { display: grid; gap: 8px; margin-top: 12px; }
.paths article { background: var(--inset); border: 1px solid var(--line); border-radius: 11px; padding: 12px; }
.paths p { font-size: .93rem; }
#reflection { border-top: 1px solid var(--line); margin-top: 13px; padding-top: 12px; }
#reflection label { margin-top: 7px; }
#reflection .primary, #alert-form .primary { margin-top: 8px; }
.setting { margin: 12px 0; padding-top: 11px; border-top: 1px solid var(--line); }
#settings, #meditation, #paywall { max-height: calc(100dvh - 24px); }
#meditation { width: min(100% - 20px, 645px); padding: clamp(14px, 3vw, 22px); }
#morning-video { display: block; width: 100%; height: min(43vh, 340px); border-radius: 14px; object-fit: cover; background: var(--inset); }
.meditation-body p { margin-top: 8px; }
#meditation-line { min-height: 3rem; font-size: 1.08rem; font-weight: 740; }
#meditation-progress { display: block; width: 100%; accent-color: var(--accent); }
#mute-morning[aria-pressed=true] { border-color: var(--accent); }
.term-inline { color: var(--accent); text-decoration: underline; text-decoration-color: #8594cf; text-underline-offset: .2em; }
@media (max-width: 760px) {
  .periods > :is(a, button) { flex: none; padding-inline: 7px; font-size: .79rem; }
  .layout { display: flex; flex-direction: column; gap: 0; }
  .form-side, .stage { display: contents; }
  .layout :is(.hero, .panel) { width: 100%; }
  .hero { min-height: 168px; }
  .hero-copy { padding: 16px; }
  .intro { margin-top: 4px; }
  .birth { order: 1; }
  #chart { order: 2; }
  #question-panel { order: 3; }
  #result { order: 4; }
  .result-buttons > a { flex-grow: 1; }
  dialog { margin: auto auto max(8px, env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; scroll-behavior: auto !important; transition: none !important; }
}
