/* Bujeok — warm hanji ivory, ink black, cinnabar red. Mobile first. */
:root {
  --hanji: #F6EFE2;
  --hanji-2: #EFE4CF;
  --ink: #221C18;
  --ink-soft: #5b5047;
  --red: #B5121B;
  --red-dark: #8E0E15;
  --gold: #E9C46A;
  --line: #dccfb6;
  --serif: "EB Garamond", "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --display: "Cormorant Garamond", "EB Garamond", Georgia, serif;
  --brush: "Nanum Brush Script", "Nanum Myeongjo", serif;
  --gutter: max(16px, env(safe-area-inset-left));
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--hanji); color: var(--ink);
  font: 18px/1.55 var(--serif);
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  transition: background-color 1.6s ease, color 1.6s ease;
}
main { flex: 1; width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 var(--gutter); }
a { color: var(--red); }
h1, h2 { font-family: var(--display); font-weight: 500; line-height: 1.15; }
h1 { font-size: clamp(30px, 7vw, 46px); margin: .4em 0 .4em; }
h2 { font-size: 28px; margin: 1.4em 0 .4em; }
h1:focus { outline: none; }
img { max-width: 100%; height: auto; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.offscreen { position: fixed; left: -20000px; top: 0; width: 10px; height: 10px; pointer-events: none; }
.hint { color: var(--ink-soft); }
.small { font-size: 15px; }
.eyebrow { font-family: var(--display); font-style: italic; color: var(--red); margin: 1em 0 0; font-size: 20px; }
.error { color: var(--red); min-height: 1.4em; margin: .3em 0; font-style: italic; }
.row { display: flex; flex-wrap: wrap; gap: 10px; }
.center { text-align: center; }

/* header / footer */
.site-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) var(--gutter) 10px;
  max-width: 1040px; width: 100%; margin: 0 auto;
}
.brand { font-family: var(--display); font-size: 24px; font-weight: 600; color: var(--ink); text-decoration: none; letter-spacing: .02em; }
.brand-ko { font-family: var(--brush); color: var(--red); font-size: 28px; font-weight: 400; margin-right: 2px; }
.head-nav { display: flex; align-items: center; gap: 14px; }
.site-head nav a.nav-link { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); white-space: nowrap; }

/* language menu (top right) */
.lang { position: relative; }
.lang summary {
  list-style: none; display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  min-height: 40px; padding: 6px 12px; border: 1.5px solid var(--line); border-radius: 999px;
  font-size: 16px; color: var(--ink); background: #fbf6ec; user-select: none;
}
.lang summary::-webkit-details-marker { display: none; }
.lang summary:hover { border-color: var(--ink-soft); }
.lang[open] summary { border-color: var(--ink); }
.lang .globe { flex: none; }
.lang-cur { font-weight: 600; }
.lang-cur::before { content: "·"; margin-right: 6px; font-weight: 400; color: var(--ink-soft); }
.lang-list {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; margin: 0; padding: 6px; list-style: none;
  min-width: 150px; background: var(--hanji); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 28px rgba(80, 40, 0, .16);
}
.lang-list a { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.lang-list a:hover, .lang-list a:focus-visible { background: var(--hanji-2); }
.lang-list a[aria-current] { color: var(--red); font-weight: 600; }
body.in-ritual .lang { visibility: hidden; }
@media (max-width: 480px) {
  .head-nav { gap: 10px; font-size: 16px; }
  .lang-label, .lang-cur::before { display: none; }
  .lang summary { padding: 6px 10px; }
  .brand { font-size: 21px; }
}
@media (max-width: 360px) { .head-nav .nav-link:first-child { display: none; } }
.site-foot { text-align: center; padding: 28px var(--gutter) calc(24px + env(safe-area-inset-bottom, 0px)); color: var(--ink-soft); font-size: 15px; }
.site-foot a { color: var(--ink-soft); }
.disclaimer { font-style: italic; margin: .4em 0 0; }
.copy { margin: .3em 0 0; font-size: 14px; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 22px; border-radius: 999px;
  border: 1.5px solid var(--ink); background: transparent; color: var(--ink);
  font: 500 18px/1.2 var(--serif); text-decoration: none; cursor: pointer;
  transition: background .2s, color .2s, transform .1s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-red { background: var(--red); border-color: var(--red); color: #fff; }
.btn-red:hover { background: var(--red-dark); border-color: var(--red-dark); }
.btn-ghost { border-color: var(--line); }
.btn-big { min-height: 56px; padding: 14px 30px; font-size: 20px; }
.link-btn { background: none; border: 0; color: var(--ink-soft); font: inherit; cursor: pointer; padding: 8px; text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* home */
.hero { display: grid; gap: 24px; align-items: center; padding: 8px 0 24px; }
.examples { position: relative; width: min(200px, 48vw); aspect-ratio: 600 / 1440; margin: 0 auto; filter: drop-shadow(0 12px 22px rgba(80, 40, 0, .22)); }
.ex { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; animation: exfade 12s infinite; border-radius: 3px; }
.ex0 { animation-delay: 0s; } .ex1 { animation-delay: 4s; } .ex2 { animation-delay: 8s; }
@keyframes exfade { 0% { opacity: 0; } 6% { opacity: 1; } 33% { opacity: 1; } 40% { opacity: 0; } 100% { opacity: 0; } }
.hero-text { text-align: center; }
.lede { font-size: 20px; max-width: 32em; margin: 0 auto 22px; }
.what { max-width: 40em; margin: 0 auto; padding-bottom: 12px; }
@media (min-width: 760px) {
  .hero { grid-template-columns: 260px 1fr; gap: 56px; padding: 40px 0; }
  .examples { width: 260px; }
  .hero-text { text-align: left; }
  .lede { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .ex { animation: none; } .ex0 { opacity: 1; }
}

/* make: top bar */
.ritual-bar { display: grid; grid-template-columns: 88px 1fr 88px; align-items: center; min-height: 44px; }
.ritual-bar #close { grid-column: 3; justify-self: end; font-size: 20px; text-decoration: none; }
.ritual-bar #back { grid-column: 1; justify-self: start; text-decoration: none; white-space: nowrap; }
.dots { grid-column: 2; display: flex; justify-content: center; gap: 8px; }
.dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--line); transition: background .3s, transform .3s; }
.dots span.on { background: var(--red); }
.dots span.now { transform: scale(1.35); }
.step { text-align: center; padding-bottom: 24px; }
.step h1 { margin-top: .3em; }

/* 1. categories */
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; text-align: left; }
.card {
  display: flex; flex-direction: column; gap: 2px; padding: 14px 14px 16px; min-height: 140px;
  background: #fbf6ec; border: 2px solid var(--line); border-radius: 14px; color: var(--ink);
  font: inherit; text-align: left; cursor: pointer; transition: border-color .2s, transform .15s, box-shadow .2s;
}
.card:hover { box-shadow: 0 6px 18px rgba(80, 40, 0, .1); }
.card.picked { border-color: var(--red); transform: translateY(-2px); box-shadow: 0 0 0 3px rgba(181, 18, 27, .15); }
.card-ko { font-family: var(--brush); font-size: 38px; line-height: 1; color: var(--red); }
.card-en { font-family: var(--display); font-size: 22px; font-weight: 600; }
.card-line { font-size: 15px; line-height: 1.35; color: var(--ink-soft); font-style: italic; }
@media (min-width: 900px) { .cards { grid-template-columns: repeat(5, 1fr); } }

/* 2. wish */
.wish-input {
  width: 100%; max-width: 560px; font: italic 22px/1.3 var(--display); padding: 14px 4px;
  background: transparent; border: 0; border-bottom: 2px solid var(--ink); color: var(--ink); text-align: center;
}
.wish-input:focus { outline: none; border-bottom-color: var(--red); }
.wish-input::placeholder { color: #a79a8a; }
.wish-meta { color: var(--ink-soft); font-size: 15px; margin-top: 6px; }

/* 3. birthday */
.bd { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 18px 0 6px; }
.bd label { display: flex; flex-direction: column; text-align: left; font-size: 14px; color: var(--ink-soft); }
.bd select {
  font: 18px var(--serif); min-height: 48px; padding: 8px 10px; border: 1.5px solid var(--line);
  border-radius: 10px; background: #fbf6ec; color: var(--ink); min-width: 92px;
}
.bd label:first-child select { min-width: 140px; }
.z-result { margin: 10px auto 14px; max-width: 420px; padding: 18px; border-radius: 16px; background: #fbf6ec; border: 1px solid var(--line); animation: rise .5s ease; }
.z-emoji { font-size: 56px; line-height: 1.1; }
.z-line { font: 500 22px/1.3 var(--display); margin: .3em 0 .1em; }
.z-trait { font-style: italic; margin: 0 0 .4em; }
.z-blocked { max-width: 420px; margin: 18px auto; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* 4. breathe */
body.ritual-dark { background: #17120f; color: #f3e9d8; }
body.ritual-dark .site-head, body.ritual-dark .site-foot { opacity: .25; }
body.ritual-dark .brand, body.ritual-dark .site-head nav a { color: #f3e9d8; }
.breathe { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 62vh; }
.breath-circle {
  width: 90px; height: 90px; border-radius: 50%;
  background: radial-gradient(circle, rgba(233, 196, 106, .9), rgba(181, 18, 27, .55) 70%, rgba(181, 18, 27, 0) 72%);
  transform: scale(1); transition: transform 4s ease-in-out; margin: 40px 0 50px;
}
.breath-circle.in { transform: scale(2.3); }
.breath-text { font: italic 24px var(--display); min-height: 1.5em; }
.breath-wish { opacity: .45; font-style: italic; max-width: 26em; }
.skip { color: #b9ab98; font-size: 15px; margin-top: 18px; }

/* 5–8. ritual stage */
.ritual { display: flex; flex-direction: column; align-items: center; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; min-height: 70vh; }
body.brushing .ritual { touch-action: none; }
body.brushing { overscroll-behavior: none; }
.tal-wrap { position: relative; margin: 6px auto 12px; line-height: 0; filter: drop-shadow(0 12px 24px rgba(80, 40, 0, .25)); }
.tal-wrap canvas { display: block; border-radius: 3px; transition: width .7s ease, height .7s ease; }
.tal-wrap.pressing { filter: drop-shadow(0 6px 12px rgba(80, 40, 0, .3)); }
.ritual.small .tal-wrap canvas { width: 120px !important; height: 288px !important; }
.ritual-title { font-size: clamp(26px, 6vw, 36px); margin: .2em 0 .2em; }
.seal-target {
  position: absolute; border: 3px dashed var(--red); border-radius: 8px; background: rgba(192, 38, 45, .12);
  cursor: pointer; animation: blink 1.1s ease-in-out infinite; padding: 0;
}
@keyframes blink { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
.shake { animation: shake .35s ease; }
@keyframes shake { 0%, 100% { transform: none; } 20% { transform: translate(-3px, 2px) rotate(-.6deg); } 40% { transform: translate(3px, -2px) rotate(.6deg); } 60% { transform: translate(-2px, 1px); } 80% { transform: translate(2px, -1px); } }
@media (prefers-reduced-motion: reduce) { .seal-target { animation: none; opacity: .9; } .shake { animation: none; } .tal-wrap canvas { transition: none; } }

/* meaning card */
.card-meaning { text-align: left; max-width: 34em; margin: 0 auto 18px; padding: 18px 20px; background: #fbf6ec; border: 1px solid var(--line); border-radius: 16px; animation: rise .6s ease; }
.card-meaning p { margin: .45em 0; }
.m-head { font: 500 21px/1.35 var(--display); }
.m-ko { font-family: var(--brush); font-size: 1.6em; color: var(--red); font-weight: 400; vertical-align: -2px; }
.m-lead { font-style: italic; }
.m-seal { color: var(--ink-soft); font-size: 16px; border-top: 1px solid var(--line); padding-top: .6em; }

/* keep panel */
.keep { max-width: 34em; margin: 0 auto; text-align: left; }
.keep-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.keep-buttons .btn { width: 100%; padding: 10px 12px; font-size: 17px; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0 0; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 4px; accent-color: var(--red); flex: none; }
.keep .hint { margin: 2px 0 8px 30px; }
.keep [data-ready] { width: 100%; margin-top: 10px; }
.keep-status { min-height: 1.4em; color: var(--ink-soft); font-style: italic; word-break: break-word; }
.after { margin-top: 18px; text-align: center; }

/* result page */
.result-grid { display: grid; gap: 18px; padding-top: 8px; }
.tal-col { display: flex; flex-direction: column; align-items: center; }
.tal-col .tal-wrap img { position: absolute; inset: 0; width: 100%; height: 100%; }
.info-col { text-align: center; }
.info-col h1 { margin-top: 0; }
.info-col .eyebrow { margin-top: 0; }
.wish { font: italic 24px/1.35 var(--display); margin: 0 auto 18px; max-width: 26em; }
.danger { margin-top: 24px; text-align: center; }
.danger .row { justify-content: center; }
@media (min-width: 760px) {
  .result-grid { grid-template-columns: 320px 1fr; gap: 48px; padding-top: 24px; align-items: start; }
  .info-col { text-align: left; }
  .info-col .card-meaning, .info-col .keep, .info-col .wish { margin-left: 0; }
  .info-col .after, .info-col .danger { text-align: left; }
  .info-col .danger .row { justify-content: flex-start; }
}

/* modal & toast */
.modal { position: fixed; inset: 0; background: rgba(23, 18, 15, .55); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.modal-box { position: relative; background: var(--hanji); border-radius: 18px; padding: 22px 22px 18px; max-width: 420px; width: 100%; box-shadow: 0 20px 50px rgba(0, 0, 0, .3); color: var(--ink); text-align: left; }
.modal-box h2 { margin-top: 0; font-size: 26px; }
.modal-x { position: absolute; top: 6px; right: 10px; background: none; border: 0; font-size: 28px; cursor: pointer; color: var(--ink-soft); }
.field { display: flex; flex-direction: column; gap: 4px; margin: 6px 0; font-size: 15px; color: var(--ink-soft); }
.field input { font: 18px var(--serif); padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
.modal form .btn { margin-top: 14px; width: 100%; }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px; opacity: 0; transition: opacity .25s, transform .25s; pointer-events: none; z-index: 60; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* pages */
.page { max-width: 40em; margin: 0 auto; padding-bottom: 24px; }
.prose li { margin: .3em 0; }
.cat-list { list-style: none; padding: 0; }
.cat-list .m-ko { font-size: 1.3em; margin-right: 4px; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 16px; }
th, td { text-align: left; vertical-align: top; padding: 10px 8px; border-bottom: 1px solid var(--line); }
code { font-size: .9em; background: var(--hanji-2); padding: 1px 5px; border-radius: 4px; }
.mine { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px; }
.mine a { display: flex; flex-direction: column; gap: 4px; color: var(--ink); text-decoration: none; }
.mine img { width: 100%; aspect-ratio: 600 / 1440; border-radius: 3px; box-shadow: 0 6px 14px rgba(80, 40, 0, .18); background: var(--gold); }
.mine-name { font: 600 20px var(--display); margin-top: 6px; }
.mine-wish { font-style: italic; font-size: 15px; color: var(--ink-soft); overflow-wrap: anywhere; }
.mine-meta { font-size: 14px; color: var(--ink-soft); }

/* Korean UI: a serif that has Hangul; no italics (Hangul has no true italic) */
body.lang-ko { --serif: "Gowun Batang", "EB Garamond", "Apple SD Gothic Neo", "Noto Serif KR", serif;
               --display: "Gowun Batang", "Cormorant Garamond", serif; word-break: keep-all; }
body.lang-ko em, body.lang-ko .eyebrow, body.lang-ko .lede, body.lang-ko .card-line, body.lang-ko .m-lead,
body.lang-ko .wish-input, body.lang-ko .breath-text, body.lang-ko .error, body.lang-ko .keep-status,
body.lang-ko .disclaimer, body.lang-ko .wish, body.lang-ko .z-trait, body.lang-ko .mine-wish { font-style: normal; }
body.lang-ko h1 { font-size: clamp(26px, 6vw, 40px); }
body.lang-ko .card-en { font-size: 19px; }

/* home: how it works, wishes, articles */
.how, .video, .wishes, .learn { max-width: 52em; margin: 0 auto; }
.how-list { padding-left: 1.3em; }
.how-list li { margin: .5em 0; }
.wish-grid { list-style: none; padding: 0; margin: 14px 0 8px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.wish-grid a {
  display: flex; flex-direction: column; gap: 2px; height: 100%; padding: 12px 14px; border-radius: 14px;
  background: #fbf6ec; border: 1.5px solid var(--line); color: var(--ink); text-decoration: none;
  transition: border-color .2s, box-shadow .2s;
}
.wish-grid a:hover, .wish-grid a:focus-visible { border-color: var(--red); box-shadow: 0 6px 18px rgba(80, 40, 0, .1); }
.wish-grid .card-ko { font-size: 32px; }
.wg-name { font: 600 19px/1.2 var(--display); }
.wg-line { font-size: 14px; line-height: 1.35; color: var(--ink-soft); }
@media (min-width: 760px) { .wish-grid { grid-template-columns: repeat(5, 1fr); } }
.article-list { list-style: none; padding: 0; margin: 12px 0 20px; display: grid; gap: 10px; }
.article-list a {
  display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: 14px;
  border: 1.5px solid var(--line); color: var(--ink); text-decoration: none; background: #fbf6ec;
}
.article-list a:hover, .article-list a:focus-visible { border-color: var(--red); }
.article-list strong { font: 600 21px/1.25 var(--display); }
.article-list span { color: var(--ink-soft); font-size: 16px; }
@media (min-width: 760px) { .learn .article-list { grid-template-columns: 1fr 1fr; } }
.lede-sm { font-size: 19px; color: var(--ink-soft); }
.crumbs { margin: 1em 0 0; font-size: 15px; }
.crumbs a { color: var(--ink-soft); }
.crumbs a::after { content: " ›"; }
.cta-box { margin: 28px 0; padding: 18px 20px; border-radius: 16px; background: var(--hanji-2); text-align: center; }
.cta-box p { margin-top: 0; }
.symbols dt { font: 600 20px var(--display); margin-top: .8em; color: var(--red); }
.symbols dd { margin: .2em 0 0; }
.zodiac-order { padding-left: 1.6em; }
.zodiac-table td:first-child { white-space: nowrap; }
.zy { white-space: nowrap; }
.zy small { color: var(--ink-soft); }
.z-em { font-size: 1.3em; }
.m-more { font-size: 16px; margin-top: .6em !important; }
.m-script { font-size: 15px; color: var(--ink-soft); margin-top: .6em !important; }

/* wish page */
.wish-hero { display: grid; gap: 20px; align-items: center; padding: 8px 0 8px; text-align: center; }
.wish-img { width: min(160px, 40vw); margin: 0 auto; border-radius: 3px; filter: drop-shadow(0 12px 22px rgba(80, 40, 0, .22)); }
.wish-hero h1 { margin: .2em 0 .3em; }
.wish-hero h1 .m-ko { font-size: 1.15em; margin-right: 8px; }
@media (min-width: 760px) {
  .wish-hero { grid-template-columns: 200px 1fr; gap: 48px; text-align: left; padding: 32px 0 8px; }
  .wish-img { width: 200px; }
}
.examples-list { list-style: none; padding: 0; }
.examples-list li { font-style: italic; margin: .35em 0; }
body.lang-ko .examples-list li { font-style: normal; }

/* ads: clearly labelled, out of the way, never inside the ritual */
.ad { margin: 32px auto; max-width: 728px; padding-top: 6px; border-top: 1px solid var(--line); }
.ad-label { margin: 0 0 6px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); text-align: center; }
.ad ins.adsbygoogle { display: block; min-height: 100px; }

/* Home page video (thumbnail first, YouTube player after a press) */
.video .yt, .video .yt-frame { display: block; position: relative; width: 100%; aspect-ratio: 16 / 9; border: 0; padding: 0;
  border-radius: 10px; overflow: hidden; background: #2a1a14; box-shadow: 0 6px 24px rgba(80, 40, 10, .18); }
.video .yt { cursor: pointer; }
.video .yt img { display: block; width: 100%; height: 100%; object-fit: cover; }
.video .yt-play { position: absolute; inset: 0; display: grid; place-items: center; transition: transform .15s; }
.video .yt:hover .yt-play, .video .yt:focus-visible .yt-play { transform: scale(1.08); }
.video .yt:focus-visible { outline: 3px solid var(--red, #B5121B); outline-offset: 3px; }
.video .hint { margin-top: .6em; }
