/* Lunahora — Design-System
 * ---------------------------------------------------------------------------
 * Gestaltungsidee: Astrolabium, nicht Esoterik-Shop. Tiefes Nachtblau,
 * feines Gold, viel Ruhe. Farben und Maße stehen als Tokens ganz oben —
 * Marke ändern = nur diesen Block anfassen.
 *
 * Thai-Schrift: braucht mehr Zeilenhöhe und einen eigenen Font-Stack, sonst
 * kollidieren Ober-/Unterzeichen (ป ญ ฎ ฏ) mit den Nachbarzeilen.
 * ---------------------------------------------------------------------------
 */

/* ===== TOKENS ============================================================ */
:root {
  /* Flächen */
  --bg:          #0a0818;
  --bg-2:        #0e0b21;
  --surface:     #14102c;
  --surface-2:   #1b1638;
  --surface-3:   #241d47;
  --line:        #2e2850;
  --line-soft:   #221d40;

  /* Schrift */
  --ink:         #f0ecff;
  --ink-2:       #c4bee0;
  --ink-dim:     #8f89b0;
  --ink-faint:   #6b6690;

  /* Akzente */
  --gold:        #e0b978;
  --gold-2:      #c9a05c;
  --gold-soft:   #7a6543;
  --rose:        #e08fa8;
  --moon:        #c3cbe8;

  /* Elemente */
  --fire:        #e07a52;
  --earth:       #8aa86a;
  --air:         #8fb8e0;
  --water:       #7d8fd8;

  /* Zustände */
  --ok:          #6fb890;
  --warn:        #e0b978;
  --err:         #e0684a;

  /* Typografie */
  --font-display: ui-serif, 'Iowan Old Style', 'Palatino Linotype', Palatino,
                  Georgia, 'Times New Roman', serif;
  --font-body:    ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto,
                  'Helvetica Neue', Arial, sans-serif;
  --font-thai:    'Noto Sans Thai', 'Leelawadee UI', 'Sarabun', Thonburi,
                  'Krungthep', system-ui, sans-serif;
  --font-mono:    ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, Consolas, monospace;
  --font-glyph:   'Noto Sans Symbols 2', 'Noto Sans Symbols', 'DejaVu Sans',
                  'Segoe UI Symbol', sans-serif;

  /* Maße */
  --wrap:        1140px;
  --wrap-narrow: 760px;
  --r-sm:        8px;
  --r:           14px;
  --r-lg:        22px;
  --gap:         clamp(1rem, 2.5vw, 1.75rem);
  --section-y:   clamp(3.5rem, 9vw, 7rem);

  /* Schatten */
  --shadow:      0 18px 50px -22px rgba(0, 0, 0, .85);
  --glow-gold:   0 0 32px -8px rgba(224, 185, 120, .45);
}

/* ===== BASIS ============================================================= */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Thailändisch braucht Luft — sonst stoßen ป ญ ฎ ฏ an die Nachbarzeile. */
html[lang="th"] body,
html[lang="th"] .thai { font-family: var(--font-thai); line-height: 1.9; }
html[lang="th"] h1, html[lang="th"] h2, html[lang="th"] h3 { line-height: 1.5; }
:lang(th) { font-family: var(--font-thai); line-height: 1.9; }

img, svg { max-width: 100%; height: auto; display: block; }

a { color: var(--gold); text-decoration: none; transition: color .18s ease; }
a:hover { color: var(--ink); }
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
}

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 400; line-height: 1.18; margin: 0 0 .6em; letter-spacing: -.01em; }
h1 { font-size: clamp(2.1rem, 5.2vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.4rem); }
p  { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

.lede { font-size: clamp(1.05rem, 1.9vw, 1.28rem); color: var(--ink-2); line-height: 1.7; }
.dim  { color: var(--ink-dim); }
.faint{ color: var(--ink-faint); }
.small{ font-size: .875rem; }
.tiny { font-size: .8rem; }
.glyph{ font-family: var(--font-glyph); }
.center { text-align: center; }

/* ===== LAYOUT ============================================================ */
.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.wrap-narrow { width: min(100% - 2.5rem, var(--wrap-narrow)); margin-inline: auto; }
.section { padding-block: var(--section-y); }
.stack > * + * { margin-top: var(--gap); }

.grid { display: grid; gap: var(--gap); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }

.eyebrow {
  font-size: .75rem; letter-spacing: .22em; text-transform: uppercase;
  color: var(--gold); font-family: var(--font-body); font-weight: 600;
  margin-bottom: .9rem;
}
html[lang="th"] .eyebrow { letter-spacing: .1em; }

/* ===== HEADER ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(10, 8, 24, .82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.header-inner { display: flex; align-items: center; gap: 1.25rem; padding-block: .85rem; }

.logo { display: inline-flex; align-items: center; gap: .6rem; color: var(--ink); flex-shrink: 0; }
.logo:hover { color: var(--ink); }
.logo svg { width: 34px; height: 34px; }
.logo-word { font-family: var(--font-display); font-size: 1.32rem; letter-spacing: .04em; }

.nav { display: flex; gap: 1.4rem; margin-left: auto; align-items: center; }
.nav a { color: var(--ink-2); font-size: .93rem; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--gold); }

.lang-switch { display: flex; gap: .35rem; align-items: center; margin-left: .5rem; }
.lang-switch a {
  font-size: .82rem; color: var(--ink-dim); padding: .25rem .5rem;
  border: 1px solid var(--line); border-radius: var(--r-sm);
}
.lang-switch a[aria-current="true"] { color: var(--bg); background: var(--gold); border-color: var(--gold); }

.burger {
  display: none; margin-left: auto; background: none; border: 1px solid var(--line);
  border-radius: var(--r-sm); color: var(--ink); padding: .5rem .7rem; cursor: pointer;
}

@media (max-width: 900px) {
  .burger { display: block; }
  .nav {
    position: fixed; inset: 61px 0 auto 0; flex-direction: column; align-items: stretch;
    gap: 0; background: var(--bg-2); border-bottom: 1px solid var(--line);
    padding: .5rem 1.25rem 1.25rem; margin: 0; display: none;
  }
  .site-header.menu-open .nav { display: flex; }
  .nav a { padding: .8rem 0; border-bottom: 1px solid var(--line-soft); font-size: 1rem; }
  .lang-switch { margin: .9rem 0 0; }
}

/* ===== BUTTONS =========================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .82rem 1.5rem; border-radius: 999px; border: 1px solid transparent;
  font-family: var(--font-body); font-size: .95rem; font-weight: 600;
  cursor: pointer; transition: transform .16s ease, box-shadow .2s ease,
    background .2s ease, color .2s ease, border-color .2s ease;
  text-align: center;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--gold); color: #1a1305; }
.btn-primary:hover { background: #eec98c; color: #1a1305; box-shadow: var(--glow-gold); }
.btn-ghost { border-color: var(--line); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; }

/* ===== KARTEN ============================================================ */
.card {
  background: linear-gradient(160deg, var(--surface) 0%, var(--bg-2) 100%);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: clamp(1.3rem, 2.6vw, 2rem);
}
.card-flat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 1.15rem 1.3rem; }
.card h3 { color: var(--ink); }

.badge {
  display: inline-block; padding: .22rem .65rem; border-radius: 999px;
  font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  background: rgba(224, 185, 120, .14); color: var(--gold); border: 1px solid rgba(224, 185, 120, .3);
}
html[lang="th"] .badge { letter-spacing: .04em; text-transform: none; }

/* ===== HERO ============================================================== */
.hero { position: relative; padding-block: clamp(3.5rem, 10vw, 7.5rem); overflow: hidden; }
.hero::before {
  content: ''; position: absolute; inset: -30% -10% auto -10%; height: 130%;
  background:
    radial-gradient(ellipse 55% 42% at 22% 18%, rgba(122, 101, 200, .20), transparent 70%),
    radial-gradient(ellipse 45% 38% at 82% 12%, rgba(224, 185, 120, .13), transparent 70%);
  pointer-events: none; z-index: 0;
}
.hero > * { position: relative; z-index: 1; }
.hero-grid { display: grid; gap: clamp(2rem, 5vw, 4rem); align-items: center; grid-template-columns: 1fr; }
@media (min-width: 940px) { .hero-grid { grid-template-columns: 1.05fr .95fr; } }

/* Sternenfeld — rein dekorativ, per CSS statt Bild (spart einen Request) */
.starfield { position: absolute; inset: 0; z-index: 0; opacity: .5; pointer-events: none; }

/* ===== FORMULARE ========================================================= */
.field { display: block; margin-bottom: 1.05rem; position: relative; }
.field > label { display: block; font-size: .84rem; color: var(--ink-dim); margin-bottom: .4rem; font-weight: 600; letter-spacing: .02em; }
.input, select.input, textarea.input {
  width: 100%; padding: .78rem .95rem; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--bg-2); color: var(--ink);
  font-family: inherit; font-size: 1rem; transition: border-color .18s ease, background .18s ease;
}
.input:hover { border-color: var(--line); background: var(--surface); }
.input:focus { outline: none; border-color: var(--gold); background: var(--surface); }
.input::placeholder { color: var(--ink-faint); }
select.input { appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-dim) 50%),
                    linear-gradient(135deg, var(--ink-dim) 50%, transparent 50%);
  background-position: calc(100% - 19px) 51%, calc(100% - 14px) 51%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }

.field-row { display: grid; gap: .9rem; grid-template-columns: 1fr; }
@media (min-width: 560px) { .field-row-2 { grid-template-columns: 1fr 1fr; } }

.checkbox { display: flex; align-items: flex-start; gap: .6rem; cursor: pointer; font-size: .92rem; color: var(--ink-2); }
.checkbox input { margin-top: .28rem; accent-color: var(--gold); width: 17px; height: 17px; flex-shrink: 0; }

.hint { font-size: .82rem; color: var(--ink-faint); margin-top: .4rem; }
.error-msg { color: var(--err); font-size: .87rem; margin-top: .45rem; }
.notice {
  border-left: 3px solid var(--warn); background: rgba(224, 185, 120, .08);
  padding: .8rem 1rem; border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-size: .9rem; color: var(--ink-2);
}

/* Ortssuche */
.autocomplete { position: relative; }
.ac-list {
  position: absolute; inset-inline: 0; top: calc(100% + 4px); z-index: 40;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-sm); box-shadow: var(--shadow);
  max-height: 268px; overflow-y: auto; display: none;
}
.ac-list.open { display: block; }
.ac-item {
  padding: .62rem .9rem; cursor: pointer; font-size: .93rem;
  display: flex; justify-content: space-between; gap: 1rem; align-items: baseline;
  border-bottom: 1px solid var(--line-soft);
}
.ac-item:last-child { border-bottom: none; }
.ac-item:hover, .ac-item.active { background: var(--surface-3); }
.ac-item .cc { color: var(--ink-faint); font-size: .78rem; flex-shrink: 0; }

/* ===== CHART-ERGEBNIS ==================================================== */
.chart-layout { display: grid; gap: var(--gap); grid-template-columns: 1fr; }
@media (min-width: 1000px) { .chart-layout { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; } }

.wheel-holder { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-lg); padding: .5rem; }
.wheel-holder svg { width: 100%; height: auto; }

.bigthree { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; }
.bigthree .b3 { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: .9rem .6rem; text-align: center; }
.bigthree .b3 .sym { font-family: var(--font-glyph); font-size: 1.55rem; display: block; margin-bottom: .3rem; }
.bigthree .b3 .lbl { font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); }
.bigthree .b3 .val { font-family: var(--font-display); font-size: 1.02rem; color: var(--ink); margin-top: .2rem; }
html[lang="th"] .bigthree .b3 .lbl { letter-spacing: .02em; text-transform: none; }

.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { text-align: start; padding: .55rem .5rem; border-bottom: 1px solid var(--line-soft); }
.table th { color: var(--ink-faint); font-weight: 600; font-size: .76rem; letter-spacing: .1em; text-transform: uppercase; }
html[lang="th"] .table th { letter-spacing: .02em; text-transform: none; }
.table td.sym { font-family: var(--font-glyph); font-size: 1.1rem; width: 1.9rem; }
.table tr:last-child td { border-bottom: none; }
.retro { color: var(--err); font-size: .8rem; }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Elementbalken */
.bar { display: grid; grid-template-columns: 4.6rem 1fr 2.9rem; gap: .7rem; align-items: center; margin-bottom: .5rem; font-size: .87rem; }
.bar-track { height: 7px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; transition: width .5s cubic-bezier(.4, 0, .2, 1); }
.bar-val { text-align: end; color: var(--ink-dim); font-variant-numeric: tabular-nums; }

.el-fire  { background: var(--fire); }  .c-fire  { color: var(--fire); }
.el-earth { background: var(--earth); } .c-earth { color: var(--earth); }
.el-air   { background: var(--air); }   .c-air   { color: var(--air); }
.el-water { background: var(--water); } .c-water { color: var(--water); }

/* Thai-Profil */
.thai-day-card { display: flex; gap: 1.1rem; align-items: center; flex-wrap: wrap; }
.color-dot { width: 46px; height: 46px; border-radius: 50%; border: 2px solid rgba(255,255,255,.22); flex-shrink: 0; box-shadow: 0 0 22px -6px currentColor; }
.color-chips { display: flex; gap: .45rem; flex-wrap: wrap; }
.color-chip { display: inline-flex; align-items: center; gap: .4rem; font-size: .82rem; color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: .28rem .7rem .28rem .32rem; }
.color-chip i { width: 15px; height: 15px; border-radius: 50%; border: 1px solid rgba(255,255,255,.25); display: block; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: .45rem 1rem; font-size: .93rem; }
.kv dt { color: var(--ink-faint); }
.kv dd { margin: 0; color: var(--ink); }

/* Aspektliste */
.aspect-row { display: flex; align-items: center; gap: .55rem; padding: .42rem 0; border-bottom: 1px solid var(--line-soft); font-size: .9rem; }
.aspect-row:last-child { border-bottom: none; }
.aspect-row .glyph { font-size: 1.05rem; }
.aspect-row .orb { margin-left: auto; color: var(--ink-faint); font-size: .8rem; font-variant-numeric: tabular-nums; }
.nat-soft { color: var(--ok); } .nat-hard { color: var(--err); }
.nat-neutral { color: var(--gold); } .nat-tense { color: #9a86c4; }

/* ===== ZEICHEN-RASTER ==================================================== */
.sign-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 138px), 1fr)); gap: .7rem; }
.sign-tile {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 1rem .7rem; text-align: center; transition: border-color .18s ease, transform .18s ease, background .18s ease;
  color: var(--ink); display: block;
}
.sign-tile:hover { border-color: var(--gold); transform: translateY(-2px); background: var(--surface-2); color: var(--ink); }
.sign-tile .sym { font-family: var(--font-glyph); font-size: 1.75rem; display: block; margin-bottom: .35rem; }
.sign-tile .nm { font-size: .9rem; }
.sign-tile .dt { font-size: .72rem; color: var(--ink-faint); margin-top: .15rem; }

/* ===== PREISE / READINGS ================================================= */
.price-card { display: flex; flex-direction: column; height: 100%; }
.price-card .price { font-family: var(--font-display); font-size: 2rem; color: var(--gold); margin: .3rem 0 .1rem; }
.price-card .price small { font-size: .85rem; color: var(--ink-dim); font-family: var(--font-body); }
.price-card ul { list-style: none; padding: 0; margin: 1rem 0 1.4rem; }
.price-card li { padding-left: 1.5rem; position: relative; margin-bottom: .5rem; font-size: .92rem; color: var(--ink-2); }
.price-card li::before { content: '✦'; position: absolute; left: 0; color: var(--gold); }
.price-card .btn { margin-top: auto; }

/* ===== FOOTER ============================================================ */
.site-footer { border-top: 1px solid var(--line-soft); background: var(--bg-2); padding-block: 3rem 2rem; margin-top: 2rem; }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }
.footer-grid h4 { font-family: var(--font-body); font-size: .76rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: .8rem; }
html[lang="th"] .footer-grid h4 { letter-spacing: .04em; text-transform: none; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: .45rem; }
.footer-grid a { color: var(--ink-2); font-size: .9rem; }
.footer-grid a:hover { color: var(--gold); }
.footer-bottom { margin-top: 2.4rem; padding-top: 1.4rem; border-top: 1px solid var(--line-soft); display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; }

.disclaimer { font-size: .8rem; color: var(--ink-faint); max-width: 62ch; line-height: 1.6; }

/* ===== HILFSKLASSEN ====================================================== */
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: -9999px; top: 0; background: var(--gold); color: #1a1305;
  padding: .7rem 1.2rem; z-index: 100; border-radius: 0 0 var(--r-sm) 0; font-weight: 600;
}
.skip-link:focus { left: 0; }

.divider { height: 1px; background: var(--line-soft); margin-block: var(--gap); border: 0; }

.fade-in { animation: fadeIn .45s ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

@media print {
  .site-header, .site-footer, .btn, .no-print { display: none !important; }
  body { background: #fff; color: #111; }
  .card, .card-flat { border-color: #ccc; background: #fff; }
}

/* Abgesetzter Abschnitt (Wechsel der Flächenfarbe zwischen Sektionen) */
.band { background: var(--bg-2); border-block: 1px solid var(--line-soft); }
