/* zeo's work house — Metaphysics / Tarot
   standalone: --zeo-* 토큰 자체 정의 (style.css 와 동일 값) */

:root {
  /* ===== zeo base (외장 v2 동일) ===== */
  --zeo-bg: #FFFFFF;
  --zeo-fg: #111111;
  --zeo-accent: #6B3FA0;
  --zeo-muted: #767676;
  --zeo-border: #E5E5E5;
  /* ===== case (외장 v2 결 매핑) ===== */
  --case-bg: #EBE2CE;
  --case-fg: #2A2620;
  --case-line: #C8BFA8;
  --case-ink: #6E6859;
  --inset: #161310;
  --inset-fg: #E8E1CC;
  --inset-soft: #D7CCB3;
  --raise: #F2EBD9;
  --accent-glow: rgba(107,63,160,.5);
  --led-off: #B3A98F;
}

:root[data-theme="dark"] {
  --zeo-bg: #0F0F12;
  --zeo-fg: #EDEDED;
  --zeo-accent: #B69CE0;
  --zeo-muted: #9B9B9B;
  --zeo-border: #2A2A2E;
  --case-bg: #221F1A;
  --case-fg: #E8E1CC;
  --case-line: #3A352D;
  --case-ink: #9B948A;
  --inset: #0B0A08;
  --inset-fg: #E8E1CC;
  --inset-soft: #15130F;
  --raise: #2D2822;
  --accent-glow: rgba(182,156,224,.55);
  --led-off: #4A4640;
}

:root[data-theme="blue"] {
  --zeo-bg: #232C40;
  --zeo-fg: #DCE3F0;
  --zeo-accent: #B69CE0;
  --zeo-muted: #8995AA;
  --zeo-border: #3A4358;
  --case-bg: #232C40;
  --case-fg: #DCE3F0;
  --case-line: #3A4358;
  --case-ink: #8995AA;
  --inset: #0E121C;
  --inset-fg: #DCE3F0;
  --inset-soft: #1A2233;
  --raise: #2D3852;
  --accent-glow: rgba(182,156,224,.55);
  --led-off: #51596D;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--case-bg);
  color: var(--case-fg);
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  line-height: 1.6;
}

code, pre, kbd, samp, textarea.markdown {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* header.php 의 .zeo-toggle 패턴 그대로 */
.zeo-toggle {
  position: fixed;
  top: 48px;
  right: 16px;
  z-index: 9999;
  font-size: 1.4rem;
  padding: 6px 10px;
  border: 1px solid var(--zeo-border);
  border-radius: 8px;
  background: var(--zeo-bg);
  color: var(--zeo-fg);
  cursor: pointer;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.2rem 3rem;
}

.tarot-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.tarot-header h1 {
  margin: 0 0 0.3rem;
  font-size: 1.8rem;
  color: var(--zeo-fg);
}

.tarot-header p {
  margin: 0;
  color: var(--zeo-muted);
  font-size: 0.92rem;
}

.aside-link {
  text-align: center;
  margin: 0 0 1rem;
  font-size: 0.92rem;
}

.aside-link a {
  color: var(--zeo-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.aside-link a:hover { color: var(--zeo-accent); }

.controls {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  margin: 1.5rem 0;
}

.controls button {
  padding: 0.6rem 1.4rem;
  font-family: inherit;
  font-size: 1rem;
  background: var(--raise);
  color: var(--case-fg);
  border: 1px solid var(--case-line);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  box-shadow:
    inset 0 1px 0 color-mix(in oklab, var(--raise) 60%, #FFFFFF 40%),
    inset 0 -1px 0 color-mix(in oklab, var(--raise) 80%, #000000 20%),
    0 1px 0 color-mix(in oklab, var(--case-bg) 70%, #000000 30%);
}

.controls button:hover { border-color: var(--zeo-accent); color: var(--zeo-accent); }

#tarot-cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.2rem;
  margin: 2rem 0;
  min-height: 200px;
}

#tarot-cards.spread-5 {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.8rem;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

#tarot-cards.spread-9 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

#tarot-cards.spread-5 .tarot-card,
#tarot-cards.spread-9 .tarot-card {
  max-width: none;
}

.tarot-card {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 220px;
}

.tarot-pos {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  color: var(--zeo-muted);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
}

.tarot-card img {
  display: block;
  width: 100%;
  max-width: 220px;
  height: auto;
  border: 1px solid var(--case-line);
  border-radius: 6px;
}

.tarot-card figcaption {
  margin-top: 0.6rem;
  text-align: center;
  font-size: 0.92rem;
  color: var(--zeo-fg);
}

.tarot-arrow {
  display: inline-block;
  margin-left: 0.3rem;
  color: var(--zeo-accent);
  font-weight: bold;
}

.markdown-section { margin-top: 2.5rem; }

.markdown-section h2 {
  margin: 0 0 0.6rem;
  font-size: 0.85rem;
  color: var(--zeo-muted);
  font-weight: normal;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

#tarot-markdown {
  width: 100%;
  min-height: 280px;
  padding: 1rem;
  background: var(--inset);
  color: var(--inset-fg);
  border: 1px solid var(--case-line);
  border-radius: 8px;
  font-size: 0.88rem;
  line-height: 1.5;
  resize: vertical;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.4);
}

#tarot-markdown:focus {
  outline: none;
  border-color: var(--zeo-accent);
}

#btn-copy {
  display: block;
  margin: 0.8rem 0 0 auto;
  padding: 0.5rem 1.2rem;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  background: var(--raise);
  color: var(--case-fg);
  border: 1px solid var(--case-line);
  border-radius: 3px;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 color-mix(in oklab, var(--raise) 60%, #FFFFFF 40%),
    inset 0 -1px 0 color-mix(in oklab, var(--raise) 80%, #000000 20%),
    0 1px 0 color-mix(in oklab, var(--case-bg) 70%, #000000 30%);
  transition: color 0.15s, border-color 0.15s;
}

#btn-copy:hover { color: var(--zeo-accent); border-color: var(--zeo-accent); }

.tarot-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--zeo-border);
  text-align: center;
  font-size: 0.82rem;
  color: var(--zeo-muted);
}

@media (max-width: 600px) {
  .container { padding: 1.5rem 1rem 2rem; }
  #tarot-cards { flex-direction: column; align-items: center; }
  #tarot-cards.spread-5,
  #tarot-cards.spread-9 { grid-template-columns: 1fr; }
  .tarot-card { max-width: 280px; }
  .controls { flex-direction: column; }
}
