@font-face { font-family: Mitr; src: url('/fonts/mitr_regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: Mitr; src: url('/fonts/mitr_semibold.ttf') format('truetype'); font-weight: 600; font-display: swap; }
@font-face { font-family: Mitr; src: url('/fonts/mitr_bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }
:root { color-scheme: light; --ink: #241b14; --muted: #786552; --saffron: #b66a22; --paper: #fffdf8; --line: #d9c7ad; }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: radial-gradient(circle at 20% 0%, rgba(239,193,121,.24), transparent 28rem), linear-gradient(180deg,#f8efe1 0%,#f2e5d1 48%,#ead8bd 100%); color: var(--ink); font-family: Mitr,system-ui,sans-serif; }
button,input { font: inherit; }
[hidden] { display: none !important; }
.site-shell { width: min(100%,760px); margin: 0 auto; padding: 28px 14px 48px; }
.language-picker { display: flex; justify-content: center; gap: 8px; margin: 0 auto 14px; }
.language-picker button { min-width: 55px; min-height: 43px; padding: 0 12px; border: 1px solid rgba(176,115,31,.55); border-radius: 999px; background: rgba(255,250,238,.92); color: #6a3617; font-size: 14px; font-weight: 600; cursor: pointer; }
.language-picker button[aria-pressed="true"] { color: #fff; background: #8a510f; box-shadow: 0 5px 16px rgba(92,44,18,.22); }
.masthead { text-align: center; margin-bottom: 18px; }
.eyebrow { display: inline-block; padding: 5px 12px; border: 1px solid rgba(182,106,34,.3); border-radius: 999px; background: rgba(255,253,248,.7); color: #8f4d16; font-size: 13px; font-weight: 600; }
.masthead h1 { margin: 9px 0 2px; font-size: clamp(25px,6vw,38px); line-height: 1.2; }
.masthead p { margin: 0; color: var(--muted); font-size: 14px; }
.oracle-paper { position: relative; overflow: hidden; min-height: 900px; border: 1px solid rgba(151,114,76,.34); border-radius: 4px; background: var(--paper); box-shadow: 0 16px 50px rgba(63,39,19,.16); }
.ornament-frame { position: absolute; inset: 0; z-index: 0; background: url('/images/hindu_print_frame.png') center top/100% 100% no-repeat; opacity: .34; pointer-events: none; }
.paper-content { position: relative; z-index: 1; padding: clamp(50px,9vw,82px) clamp(34px,10vw,92px) clamp(54px,10vw,92px); }
.card-number { margin: 0 0 16px; text-align: center; font-size: 18px; font-weight: 700; }
.card-figure { width: min(100%,390px); margin: 0 auto; padding: 7px; border: 1px solid rgba(88,65,44,.48); background: #fff; box-shadow: 0 9px 25px rgba(40,26,14,.14); }
.card-figure img { display: block; width: 100%; height: auto; object-fit: contain; }
.title-block { margin-top: 23px; text-align: center; }
.title-block h2 { margin: 7px 0 0; font-size: clamp(27px,7vw,39px); line-height: 1.2; }
.english-title { margin: 3px 0 0; font-size: 13px; letter-spacing: .12em; color: var(--muted); }
.category { margin: 7px 0 0; font-size: 15px; font-weight: 600; color: #8d5527; }
.tone { display: inline-block; margin: 0; padding: 4px 13px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.tone-ดี { background: #e6f2df; color: #315a28; }
.tone-กลางๆ { background: #f6ecd4; color: #75571c; }
.tone-ไม่ดี { background: #f3dfdc; color: #78352e; }
.poem-section { margin-top: 30px; padding: 24px 18px; border-block: 1px solid var(--line); text-align: center; }
.poem-section h3,.reading-item h3 { margin: 0; font-size: 16px; color: #86501f; }
.poem { margin-top: 14px; }
.poem p { margin: 6px 0; font-size: clamp(16px,4.2vw,20px); line-height: 1.75; }
.reading-section { margin-top: 26px; display: grid; gap: 17px; }
.reading-item { padding: 16px 18px; border-left: 3px solid #c78138; background: rgba(244,231,210,.62); }
.reading-item p { margin: 7px 0 0; font-size: 16px; line-height: 1.72; }
.paper-footer { margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--line); text-align: center; }
.paper-footer p { margin: 0; font-size: 13px; color: var(--muted); }
.paper-footer strong { display: block; margin-top: 5px; font-size: 18px; }
.card-nav { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 10px; margin-top: 18px; }
.card-nav button,.card-nav input { min-height: 46px; border: 1px solid rgba(128,82,38,.3); border-radius: 10px; background: rgba(255,253,248,.86); color: var(--ink); }
.card-nav button { padding: 0 12px; cursor: pointer; font-weight: 600; }
.card-nav button:disabled { cursor: not-allowed; opacity: .42; }
.card-nav label { display: grid; gap: 4px; text-align: center; color: var(--muted); font-size: 11px; }
.card-nav input { width: 82px; padding: 0 8px; text-align: center; font-size: 16px; }
.site-note { margin: 18px 0 0; text-align: center; color: var(--muted); font-size: 13px; }
.state { min-height: 55vh; display: grid; place-content: center; justify-items: center; gap: 15px; padding: 24px; text-align: center; }
.loader { width: 34px; height: 34px; border: 3px solid rgba(182,106,34,.2); border-top-color: var(--saffron); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width:520px) { .site-shell { padding-inline: 8px; } .paper-content { padding-inline: 38px; } .poem-section { padding-inline: 6px; } .reading-item { padding: 14px; } .card-nav { gap: 6px; } .card-nav button { padding-inline: 8px; font-size: 13px; } }
@media (prefers-reduced-motion:reduce) { html { scroll-behavior: auto; } .loader { animation: none; } }
