/* ============ 이귀자 할머니 — occult theme ============ */
:root {
  --bg: #0b0a0d;
  --bg2: #14111a;
  --panel: #1a1620;
  --ink: #d9d2c7;
  --ink-dim: #8f8779;
  --crimson: #b3202e;
  --crimson-glow: #e03a4a;
  --gold: #c9a227;
  --line: #2c2533;
  --font-serif: "Songti TC", "Noto Serif TC", "Noto Serif JP", "Iowan Old Style", Georgia, serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--font-serif);
  line-height: 1.75; overflow-x: hidden;
}
a { color: var(--crimson-glow); text-decoration: none; }
img, video { max-width: 100%; display: block; }

/* grain overlay */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 9999;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
}

.wrap { max-width: 720px; margin: 0 auto; padding: 0 20px; }

/* ---------- language gate ---------- */
.gate {
  min-height: 100svh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 40px; text-align: center;
  background: radial-gradient(ellipse at 50% 30%, #1c1218 0%, var(--bg) 70%);
}
.gate h1 { font-size: 1.05rem; letter-spacing: 0.4em; color: var(--ink-dim); font-weight: 400; }
.gate .tree { font-size: 3rem; filter: grayscale(0.4); }
.cloths { display: flex; gap: 28px; flex-wrap: wrap; justify-content: center; }
.cloth {
  display: block; width: 120px; padding: 34px 12px 44px;
  background: linear-gradient(175deg, #8f1a26 0%, var(--crimson) 45%, #7a1420 100%);
  color: #f3e9dd; text-align: center; letter-spacing: 0.1em; font-size: 1rem;
  clip-path: polygon(0 0, 100% 0, 100% 88%, 82% 100%, 60% 90%, 38% 100%, 16% 91%, 0 100%);
  transform-origin: top center; animation: sway 5s ease-in-out infinite;
  box-shadow: 0 12px 40px rgba(179, 32, 46, 0.25);
  transition: filter .3s;
}
.cloth:hover { filter: brightness(1.25); }
.cloth:nth-child(2) { animation-delay: -1.7s; }
.cloth:nth-child(3) { animation-delay: -3.4s; }
.cloth small { display: block; margin-top: 6px; opacity: 0.65; font-size: 0.72rem; }
@keyframes sway { 0%,100% { transform: rotate(2.2deg);} 50% { transform: rotate(-2.2deg);} }
.gate .whisper { color: var(--ink-dim); font-size: 0.82rem; max-width: 420px; line-height: 1.9; }

/* ---------- hero ---------- */
.hero { position: relative; min-height: 88svh; display: flex; align-items: flex-end; overflow: hidden; }
.hero video, .hero .hero-fallback {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.5;
}
.hero .hero-fallback { background: radial-gradient(ellipse at 50% 80%, #2a1016 0%, var(--bg) 65%); }
.hero .veil { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11,10,13,0.2) 0%, rgba(11,10,13,0.95) 85%); }
.hero .inner { position: relative; padding: 60px 0 70px; width: 100%; }
.hero h1 { font-size: clamp(1.7rem, 5vw, 2.6rem); font-weight: 600; letter-spacing: 0.06em; line-height: 1.4; }
.hero h1 .red { color: var(--crimson-glow); }
.hero p.sub { margin-top: 18px; color: var(--ink-dim); max-width: 520px; }
.langswitch { position: absolute; top: 18px; right: 20px; z-index: 3; font-size: 0.78rem; color: var(--ink-dim); }
.langswitch a { color: var(--ink-dim); margin-left: 10px; }
.langswitch a:hover { color: var(--ink); }

/* ---------- story ---------- */
.story { padding: 90px 0; background: var(--bg2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.story .label, .label { color: var(--gold); letter-spacing: 0.35em; font-size: 0.72rem; margin-bottom: 26px; }
.story p { margin-bottom: 1.2em; color: #c7bfb2; }
.story p strong { color: var(--crimson-glow); font-weight: 600; }

/* ---------- cinematic story beats ---------- */
.beat { position: relative; min-height: 74svh; display: flex; align-items: center; justify-content: center; text-align: center; padding: 40px 24px; overflow: hidden; }
.beat p { position: relative; z-index: 2; font-size: clamp(1.1rem, 3.6vw, 1.55rem); line-height: 2.3; color: #cfc7ba; max-width: 580px; letter-spacing: 0.05em; }
.beat .em { color: var(--crimson-glow); }
.beat .gold { color: var(--gold); }
.beat video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.35; z-index: 0; }
.beat .veil2 { position: absolute; inset: 0; z-index: 1; background: radial-gradient(ellipse at center, rgba(11,10,13,0.1) 0%, rgba(11,10,13,0.92) 78%); }
.beat.short { min-height: 46svh; }
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 1.2s ease, transform 1.2s ease; }
.reveal.on { opacity: 1; transform: none; }
.stageline { opacity: 0; transition: opacity 1s ease; margin-bottom: 16px; }
.stageline.on { opacity: 1; }
.scrollhint { text-align: center; color: var(--ink-dim); font-size: 1.1rem; animation: bob 2.2s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0);} 50% { transform: translateY(8px);} }

/* ---------- form ---------- */
.reading { padding: 90px 0; }
h2.sec { font-size: 1.4rem; margin-bottom: 8px; letter-spacing: 0.08em; }
p.secdesc { color: var(--ink-dim); margin-bottom: 36px; font-size: 0.9rem; }
form.birth { display: grid; gap: 18px; }
.frow { display: grid; gap: 18px; grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .frow { grid-template-columns: 1fr; } }
label.f { display: block; font-size: 0.8rem; color: var(--ink-dim); letter-spacing: 0.06em; }
label.f span { display: block; margin-bottom: 7px; }
input, select {
  width: 100%; padding: 13px 14px; background: var(--panel); border: 1px solid var(--line);
  color: var(--ink); font-family: inherit; font-size: 1rem; border-radius: 4px;
  appearance: none; -webkit-appearance: none;
}
input:focus, select:focus { outline: none; border-color: var(--crimson); }
.check { display: flex; align-items: center; gap: 10px; font-size: 0.85rem; color: var(--ink-dim); }
.check input { width: auto; }
button.rite, a.rite {
  margin-top: 14px; padding: 17px; width: 100%;
  background: linear-gradient(160deg, var(--crimson) 0%, #7c1520 100%);
  color: #f6ece0; border: none; font-family: inherit; font-size: 1.05rem;
  letter-spacing: 0.14em; cursor: pointer; border-radius: 4px;
  box-shadow: 0 8px 30px rgba(179,32,46,0.35); transition: filter .2s, transform .2s;
  text-align: center;
}
button.rite:hover, a.rite:hover { filter: brightness(1.15); transform: translateY(-1px); }
button.rite:disabled { filter: grayscale(0.6); cursor: wait; }

/* ---------- preview ---------- */
#preview { display: none; padding: 0 0 90px; }
.pillars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 30px 0 10px; }
.pillar { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 16px 6px 14px; text-align: center; }
.pillar .pl { font-size: 0.68rem; color: var(--ink-dim); letter-spacing: 0.12em; margin-bottom: 10px; }
.pillar .han { font-size: 1.9rem; line-height: 1.35; }
.pillar .han .b { color: var(--gold); }
.pillar .tg { font-size: 0.65rem; color: var(--ink-dim); margin-top: 8px; }
.granny-note {
  margin-top: 40px; padding: 26px 24px; background: var(--panel);
  border-left: 3px solid var(--crimson); border-radius: 0 6px 6px 0;
  font-size: 1.02rem; line-height: 2;
}
.granny-note .who { color: var(--ink-dim); font-size: 0.72rem; letter-spacing: 0.2em; margin-bottom: 12px; }

/* ---------- paywall ---------- */
.paywall { margin-top: 50px; position: relative; }
.teaser { filter: blur(7px); pointer-events: none; user-select: none; opacity: 0.75; }
.teaser .granny-note { margin-top: 16px; }
.paycard {
  position: relative; margin-top: -140px; z-index: 2;
  background: linear-gradient(180deg, rgba(11,10,13,0) 0%, var(--bg) 26%);
  padding-top: 150px;
}
.paycard .box { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 36px 28px; text-align: center; }
.paycard h3 { font-size: 1.25rem; margin-bottom: 8px; }
.paycard .price { font-size: 2rem; color: var(--gold); margin: 16px 0 4px; }
.paycard .price small { font-size: 0.85rem; color: var(--ink-dim); }
.cats { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 22px 0; }
.cat { font-size: 0.75rem; border: 1px solid var(--line); color: #c7bfb2; padding: 6px 12px; border-radius: 999px; }
.paycard input[type=email] { max-width: 380px; margin: 8px auto 0; text-align: center; }
.paycard .agree { font-size: 0.72rem; color: var(--ink-dim); margin-top: 14px; }
.paycard .agree a { text-decoration: underline; }

/* ---------- result ---------- */
.result-load { min-height: 70svh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; text-align: center; }
.result-load .clothv {
  width: min(430px, 88vw);
  border-radius: 6px;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.8);
  opacity: 0.92;
}
.report { padding: 70px 0 90px; }
.report h3.rsec { color: var(--gold); font-size: 1.05rem; letter-spacing: 0.15em; margin: 46px 0 14px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.report .rbody { white-space: pre-wrap; font-size: 1.02rem; line-height: 2.05; color: #d5cdc0; }

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--line); padding: 44px 0 60px; font-size: 0.75rem; color: var(--ink-dim); }
footer .links { display: flex; flex-wrap: wrap; gap: 18px; margin-bottom: 18px; }
footer a { color: var(--ink-dim); text-decoration: underline; }
.disclaimer { margin-top: 10px; line-height: 1.8; }

/* ---------- legal ---------- */
.legal { padding: 70px 0; }
.legal h1 { font-size: 1.5rem; margin-bottom: 30px; }
.legal h2 { font-size: 1.05rem; color: var(--gold); margin: 34px 0 10px; }
.legal p, .legal li { font-size: 0.88rem; color: #c0b8ab; margin-bottom: 10px; }
.legal ul { padding-left: 20px; }

.fadein { opacity: 0; transform: translateY(18px); transition: opacity .8s, transform .8s; }
.fadein.on { opacity: 1; transform: none; }

/* ---------- locked chapter list ---------- */
.chaplist { width: 100%; margin-top: 18px; text-align: left; }
.chaprow {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 6px; border-bottom: 1px solid var(--line);
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.chaprow.on { opacity: 1; transform: none; }
.chaprow:last-child { border-bottom: none; }
.chapnum { color: var(--gold); font-size: 0.85rem; flex: none; width: 1.2em; text-align: center; }
.chapbody { min-width: 0; }
.chapt { display: block; font-size: 0.9rem; letter-spacing: 0.04em; }
.chapd { display: block; font-size: 0.72rem; color: var(--ink-dim); margin-top: 4px; line-height: 1.7; }
.chaplock {
  margin-left: auto; flex: none;
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid rgba(179, 32, 46, 0.55);
  color: var(--crimson-glow); font-size: 0.78rem;
  display: flex; align-items: center; justify-content: center;
}

/* ---------- sealed letter (result page) ---------- */
.sealwrap { min-height: 72svh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 30px; text-align: center; }
.sealbtn {
  width: 112px; height: 112px; border-radius: 50%; border: none; cursor: pointer;
  background: radial-gradient(circle at 35% 30%, #c22836 0%, #8f1a26 55%, #6a1119 100%);
  color: #f6ece0; font-size: 2.1rem; font-family: inherit;
  box-shadow: 0 0 46px rgba(179,32,46,0.45), inset 0 2px 8px rgba(255,255,255,0.15);
  animation: sealpulse 2.4s ease-in-out infinite;
}
.sealbtn:hover { filter: brightness(1.15); }
@keyframes sealpulse { 0%,100% { transform: scale(1);} 50% { transform: scale(1.05);} }
.letter {
  background: #15111c; border: 1px solid var(--line); border-radius: 10px;
  padding: 40px 26px 48px; box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  animation: letterin 1.1s ease;
}
@keyframes letterin { from { opacity: 0; transform: translateY(26px);} to { opacity: 1; transform: none;} }
.secdiv { text-align: center; color: var(--crimson); opacity: 0.55; margin: 40px 0 0; font-size: 0.8rem; letter-spacing: 0.5em; }
.sig { display: flex; align-items: center; justify-content: flex-end; gap: 16px; margin-top: 54px; padding-top: 26px; border-top: 1px solid var(--line); }
.sig img { width: 62px; height: 62px; border-radius: 50%; object-fit: cover; object-position: center 20%; filter: grayscale(1); opacity: 0.85; }
.sig .name { letter-spacing: 0.3em; color: var(--ink-dim); font-size: 0.9rem; }
.stamp {
  display: inline-block; border: 2px solid #b3202e; color: #e03a4a;
  padding: 5px 9px; font-size: 1.25rem; border-radius: 4px;
  transform: rotate(-8deg); opacity: 0.9;
}
