/* TotemAstrology.com styles — rev 20260903 (search this on live site to verify upload) */
/* Totem Astrology — celestial theme */
:root {
  --bg-deep: #0a0e1a;
  --bg-card: #121829;
  --bg-elevated: #1a2236;
  --gold: #c9a962;
  --gold-light: #e8d5a3;
  --gold-dim: #8a7344;
  --text: #e8eaf0;
  --text-muted: #9aa3b8;
  --accent-purple: #6b5b95;
  --border: rgba(201, 169, 98, 0.15);
  --radius: 12px;
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-body: "Source Sans 3", system-ui, sans-serif;
  --max-width: 1100px;
  --header-height: 72px;
  --lang-bar-height: 44px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg-deep);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(107, 91, 149, 0.25), transparent),
    radial-gradient(circle at 20% 80%, rgba(201, 169, 98, 0.06), transparent 40%),
    radial-gradient(circle at 80% 60%, rgba(107, 91, 149, 0.08), transparent 35%);
}

.starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.7;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 200;
  padding: 0.75rem 1rem;
  background: var(--gold);
  color: var(--bg-deep);
  font-weight: 600;
  border-radius: 0 0 8px 8px;
}

.skip-link:focus {
  top: 0;
}

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

a {
  color: var(--gold-light);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover,
a:focus-visible {
  color: var(--gold);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 0.75rem;
}

h1 { font-size: clamp(2.25rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); }

p { margin: 0 0 1rem; }

.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;
}

.container {
  width: min(100% - 2rem, var(--max-width));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: rgba(10, 14, 26, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-header--with-lang {
  height: auto;
  display: flex;
  flex-direction: column;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  gap: 1rem;
}

/* Second header row: collapsible language picker */
.lang-bar {
  position: relative;
  z-index: 60;
  border-top: 1px solid var(--border);
  background: rgba(8, 11, 20, 0.96);
  padding: 0.3rem 0;
}

.lang-bar-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.lang-bar-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0.32rem 0.55rem 0.32rem 0.45rem;
  border: 1px solid rgba(201, 169, 98, 0.35);
  border-radius: 8px;
  background: rgba(201, 169, 98, 0.1);
  color: var(--gold-light);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.72rem;
  line-height: 1;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.lang-bar-toggle:hover,
.lang-bar-toggle:focus-visible {
  border-color: rgba(201, 169, 98, 0.7);
  background: rgba(201, 169, 98, 0.16);
  outline: none;
}

.lang-bar-toggle__emoji {
  font-size: 1.1rem;
  line-height: 1;
}

.lang-bar-toggle__code {
  font-weight: 700;
  letter-spacing: 0.04em;
}

.lang-bar-toggle__name {
  color: var(--text-muted);
  font-weight: 500;
  max-width: 9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lang-bar-toggle__chevron {
  width: 0.45rem;
  height: 0.45rem;
  margin-left: 0.15rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  opacity: 0.8;
  transition: transform 0.18s ease;
}

.lang-bar.is-open .lang-bar-toggle__chevron {
  transform: rotate(225deg) translateY(-1px);
}

.lang-bar-menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  z-index: 70;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.75rem 0.85rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(12, 16, 28, 0.98);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.lang-bar-menu[hidden] {
  display: none;
}

.lang-bar-label {
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.lang-flags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  max-height: min(50vh, 18rem);
  overflow-y: auto;
  padding-right: 0.15rem;
}

.lang-flag {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  margin: 0;
  padding: 0.28rem 0.42rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.68rem;
  line-height: 1;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.lang-flag:hover,
.lang-flag:focus-visible {
  border-color: var(--border);
  color: var(--text);
  outline: none;
}

.lang-flag.is-active {
  border-color: rgba(201, 169, 98, 0.55);
  background: rgba(201, 169, 98, 0.12);
  color: var(--gold-light);
}

.lang-flag__emoji {
  font-size: 1.05rem;
  line-height: 1;
}

.lang-flag__code {
  font-weight: 700;
  letter-spacing: 0.03em;
}

@media (max-width: 520px) {
  .lang-bar-toggle__name {
    display: none;
  }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

.user-profile-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: 0.25rem;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--gold);
  border-radius: 999px;
  background: rgba(201, 169, 98, 0.16);
  color: var(--gold-light);
  font-family: var(--font-sans, "Source Sans 3", sans-serif);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.user-profile-btn:hover,
.user-profile-btn:focus-visible {
  background: rgba(201, 169, 98, 0.28);
  border-color: var(--gold-light);
  color: #f5e6c0;
  outline: none;
}

.user-profile-btn[aria-current="page"] {
  background: rgba(201, 169, 98, 0.35);
  color: #1a1510;
  border-color: var(--gold);
}

.home-promo-banners {
  /* card grid wrapper — sits below hero zodiac */
}

.home-promo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: 1.25rem;
}

.home-promo-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.75rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.home-promo-card:hover {
  border-color: rgba(201, 169, 98, 0.4);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(201, 169, 98, 0.08);
}

.home-promo-card--featured {
  border-color: rgba(201, 169, 98, 0.35);
  background: linear-gradient(180deg, rgba(201, 169, 98, 0.1) 0%, var(--bg-card) 50%);
}

.home-promo-card__icon {
  width: 52px;
  height: 52px;
  margin-bottom: 1rem;
  color: var(--gold);
  flex-shrink: 0;
}

.home-promo-card__title {
  margin: 0 0 0.625rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--gold-light);
}

.home-promo-card__copy {
  margin: 0 0 1.25rem;
  flex: 1;
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.55;
}

.home-promo-card__cta {
  width: 100%;
  margin-top: auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.logo:hover { color: var(--gold-light); }

.logo-icon {
  width: 36px;
  height: 36px;
  color: var(--gold);
}

.site-nav ul {
  display: flex;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  display: block;
  padding: 0.5rem 1rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
  font-weight: 500;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a[aria-current="page"] {
  color: var(--gold-light);
  background: rgba(201, 169, 98, 0.08);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  color: var(--gold);
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.25s, opacity 0.25s;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.btn-primary {
  color: var(--bg-deep);
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dim) 100%);
  box-shadow: 0 4px 20px rgba(201, 169, 98, 0.25);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  color: var(--bg-deep);
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(201, 169, 98, 0.35);
}

.btn-outline {
  color: var(--gold-light);
  background: transparent;
  border: 1px solid var(--gold-dim);
}

.btn-outline:hover,
.btn-outline:focus-visible {
  color: var(--gold-light);
  background: rgba(201, 169, 98, 0.1);
  border-color: var(--gold);
}

/* Hero */
.hero {
  padding: clamp(3rem, 10vw, 6rem) 0 clamp(4rem, 8vw, 5rem);
  text-align: center;
}

.hero-badge {
  display: inline-block;
  margin-bottom: 1.25rem;
  padding: 0.375rem 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin-inline: auto;
  margin-bottom: 2rem;
  text-align: center;
}

.hero h1 {
  width: 100%;
  max-width: 100%;
  margin: 0 0 1rem;
  font-size: clamp(1.75rem, 5vw, 3.5rem);
  line-height: 1.15;
  text-align: center;
}

.hero-tagline {
  display: block;
  width: 100%;
  max-width: 42ch;
  margin: 0 auto;
  margin-bottom: 0;
  font-size: clamp(1.0625rem, 2.2vw, 1.25rem);
  line-height: 1.55;
  color: var(--text-muted);
  text-align: center;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.stars-decoration {
  position: relative;
}

.stars-decoration::before {
  content: "✦";
  position: absolute;
  top: 1rem;
  left: 10%;
  font-size: 0.75rem;
  color: var(--gold-dim);
  opacity: 0.6;
}

.stars-decoration::after {
  content: "✦";
  position: absolute;
  top: 3rem;
  right: 12%;
  font-size: 0.5rem;
  color: var(--gold);
  opacity: 0.4;
}

/* Sections */
.section {
  padding: clamp(3rem, 8vw, 5rem) 0;
}

.section-header {
  text-align: center;
  max-width: 560px;
  margin: 0 auto 3rem;
}

.section-header p {
  color: var(--text-muted);
  margin-bottom: 0;
}

.section-label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
}

/* Cards grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.card-grid--centered {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
}

.card-grid--centered > .card {
  flex: 0 1 320px;
  width: min(100%, 320px);
  max-width: 360px;
}

.card {
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s, transform 0.2s;
}

.card:hover {
  border-color: rgba(201, 169, 98, 0.35);
  transform: translateY(-4px);
}

.card-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 1.25rem;
  color: var(--gold);
}

.card h3 {
  margin-bottom: 0.75rem;
}

.card p {
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  font-size: 0.9375rem;
}

.card-price {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--gold-light);
}

.card-price span {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Testimonials */
.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.testimonial {
  padding: 2rem;
  background: var(--bg-elevated);
  border-left: 3px solid var(--gold-dim);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.testimonial blockquote {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-style: italic;
  color: var(--text);
}

.testimonial cite {
  font-size: 0.875rem;
  font-style: normal;
  color: var(--text-muted);
}

/* CTA band */
.cta-band {
  padding: clamp(2.5rem, 6vw, 4rem);
  text-align: center;
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-elevated) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.cta-band h2 { margin-bottom: 0.75rem; }

.cta-band p {
  max-width: 480px;
  margin: 0 auto 1.5rem;
  color: var(--text-muted);
}

.section--values {
  background: linear-gradient(180deg, rgba(201, 169, 98, 0.08) 0%, transparent 100%);
  border-block: 1px solid var(--border);
}

.values-full {
  margin-top: 2.5rem;
}

.values-full h3 {
  margin-top: 2rem;
  color: var(--gold-light);
}

.values-full h3:first-child {
  margin-top: 0;
}

.values-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  max-width: 640px;
  margin-inline: auto;
}

.values-grid .card {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 1rem;
  text-align: center;
}

.values-grid .card h3 {
  color: var(--gold-light);
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  margin-bottom: 0.5rem;
}

.values-grid .card p {
  margin-bottom: 0;
  font-size: 0.875rem;
  line-height: 1.45;
}

@media (min-width: 640px) {
  .values-grid {
    gap: 1.25rem;
    max-width: 720px;
  }

  .values-grid .card {
    padding: 1.5rem;
  }
}

.values-teaser {
  max-width: 42rem;
  margin: 2rem auto 1.5rem;
  text-align: center;
  color: var(--text-muted);
}

.values-teaser-cta {
  text-align: center;
  margin: 0;
}

.learn-prose {
  max-width: 42rem;
  margin-inline: auto;
}

.learn-prose h2 {
  margin-top: 0.25rem;
}

.learn-callout {
  margin-top: 2rem;
  padding: 1.75rem 2rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold-dim);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.learn-callout p:last-child {
  margin-bottom: 0;
}

.learn-callout__closing {
  font-family: var(--font-display);
  font-size: 1.125rem;
  color: var(--gold-light);
}

.faq-intro {
  font-family: var(--font-display);
  font-size: 1.125rem;
  color: var(--gold-light);
  margin-bottom: 1rem;
}

.faq-item + .faq-item {
  margin-top: 3rem;
  padding-top: 3rem;
  border-top: 1px solid var(--border);
}

.faq-question {
  margin: 0 0 1.75rem;
  padding: 1.25rem 1.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold-dim);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.faq-question p {
  margin: 0;
  font-style: italic;
  color: var(--text-muted);
}

.faq-answer p:last-child {
  margin-bottom: 0;
}

.faq-more {
  margin-top: 2.5rem;
  text-align: center;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.faq-cta-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin: 0;
}

.faq-home-cta {
  text-align: center;
  margin: 0;
}

/* About page */
.about-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.about-photo {
  width: min(100%, 605px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  padding: 0.25rem;
  box-sizing: border-box;
  line-height: 0;
}

.about-photo img,
.about-photo svg {
  width: 100%;
  height: auto;
  display: block;
}

.home-zodiac-visual {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}

.hero .home-zodiac-visual {
  margin-bottom: 0.25rem;
}

.hero .home-zodiac-visual + .home-elements-visual {
  margin-top: 1.25rem;
}

.hero .home-elements-visual + .home-promo-banners {
  margin-top: 1.75rem;
}

.about-bio {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(100%, 42rem);
  margin-top: 2.5rem;
}

.about-bio h2,
.about-bio h3,
.about-bio .about-lead,
.about-bio p {
  width: 100%;
  text-align: center;
}

.about-bio h2 {
  margin-bottom: 0.5rem;
}

.about-bio h3 {
  margin-top: 0.5rem;
}

.credentials-list {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
}

.credentials-list li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.75rem;
  color: var(--text-muted);
}

.credentials-list li::before {
  content: "✦";
  position: absolute;
  left: 0;
  color: var(--gold);
  font-size: 0.75rem;
}

.about-lead {
  font-family: var(--font-display);
  font-size: 1.125rem;
  color: var(--gold-light);
  margin-bottom: 1.25rem;
  text-align: center;
}

.about-guides-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-top: 2.5rem;
  margin-bottom: 0;
}

.about-guides .step-num {
  font-family: var(--font-display);
  font-size: 1.125rem;
}

.about-guides .step--interactive {
  width: 100%;
  margin: 0;
  padding: 1.25rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: inherit;
  font: inherit;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.about-guides .step--interactive:hover,
.about-guides .step--interactive:focus-visible {
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  outline: none;
}

.about-guides .step__hint {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gold-light);
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 3rem;
  align-items: start;
}

.contact-info h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  font-size: 1rem;
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.contact-info p,
.contact-info a {
  color: var(--text-muted);
}

.social-links {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
}

.social-links a {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.875rem;
}

.social-links a:hover {
  border-color: var(--gold-dim);
  background: rgba(201, 169, 98, 0.08);
}

/* Form */
.contact-form,
.bazi-form {
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group fieldset {
  border: none;
  margin: 0;
  padding: 0;
}

.form-group legend {
  display: block;
  margin-bottom: 0.375rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.form-group label {
  display: block;
  margin-bottom: 0.375rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text);
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color 0.2s;
}

.form-group select {
  cursor: pointer;
  min-height: 3rem;
  appearance: auto;
  -webkit-appearance: menulist;
  color-scheme: dark;
  position: relative;
  z-index: 2;
}

.form-group select option {
  color: var(--bg-deep);
  background: var(--text);
}


.form-group input[type="date"],
.form-group input[type="time"],
.form-group input[name="birthDate"],
.form-group input[name="birthTime"] {
  color-scheme: dark;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--gold-dim);
}

.form-group textarea {
  min-height: 140px;
  resize: vertical;
}

.form-note {
  margin-top: 1rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.form-hint {
  margin: 0.35rem 0 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.form-success {
  display: none;
  padding: 1rem;
  margin-bottom: 1rem;
  background: rgba(201, 169, 98, 0.12);
  border: 1px solid var(--gold-dim);
  border-radius: 8px;
  color: var(--gold-light);
}

.form-success.visible { display: block; }

.form-error {
  display: none;
  padding: 1rem;
  margin-bottom: 1rem;
  background: rgba(180, 60, 60, 0.15);
  border: 1px solid rgba(200, 100, 100, 0.4);
  border-radius: 8px;
  color: #f0b0b0;
}

.form-error.visible { display: block; }

/* Page hero (inner pages) */
.page-hero {
  padding: clamp(2.5rem, 6vw, 4rem) 0 2rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.page-hero p {
  max-width: 540px;
  margin: 0 auto;
  color: var(--text-muted);
}

/* Footer */
.site-footer {
  margin-top: auto;
  padding: 3rem 0 2rem;
  border-top: 1px solid var(--border);
  background: rgba(10, 14, 26, 0.6);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}

.footer-brand {
  font-family: var(--font-display);
  font-size: 1.125rem;
  color: var(--text-muted);
}

.footer-nav {
  display: flex;
  gap: 1.5rem;
}

.footer-nav a {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.footer-nav a:hover { color: var(--gold-light); }

.footer-copy {
  width: 100%;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-align: center;
}

.footer-copy a {
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.footer-copy a:hover {
  color: var(--gold-light);
}

.legal-prose section {
  margin-top: 2.5rem;
}

.legal-prose section:first-of-type {
  margin-top: 0;
}

.legal-notice {
  margin-bottom: 2rem;
  padding: 1.25rem 1.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold-dim);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.legal-notice p:last-child {
  margin-bottom: 0;
}

.legal-list {
  padding-left: 1.25rem;
}

.legal-list li + li {
  margin-top: 0.35rem;
}

.legal-list--ordered {
  padding-left: 1.5rem;
}

.legal-checklist {
  margin-top: 1rem;
  padding: 1.5rem 1.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.legal-checklist h3 {
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.legal-checklist h3:first-child {
  margin-top: 0;
}

.legal-checklist code {
  font-size: 0.875em;
  color: var(--gold-light);
}

.legal-updated {
  margin-top: 2.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  text-align: center;
}

/* Layout wrapper */
.page-wrap {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main { flex: 1; }

/* Hero wheel */
.hero-visual {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
}

.totem-wheel {
  width: min(200px, 40vw);
  height: min(200px, 40vw);
  color: var(--gold);
  opacity: 1;
  transform-origin: center center;
  animation: slow-spin 72s linear infinite;
}

.hero-yinyang.totem-wheel {
  animation: slow-spin 72s linear infinite;
}

.hero-yinyang .yinyang-swirl-orange {
  stroke: #FF8C22;
  fill: none;
  stroke-linecap: round;
}

.hero-yinyang .yinyang-swirl-green {
  stroke: #12A05F;
  fill: none;
  stroke-linecap: round;
}

.hero-yinyang .yinyang-ring-orange {
  stroke: #FF8C22;
  fill: none;
}

.hero-yinyang .yinyang-ring-green {
  stroke: #12A05F;
  fill: none;
}

.hero-yinyang .yinyang-yang {
  fill: #FF8C22;
}

.hero-yinyang .yinyang-yin {
  fill: #12A05F;
}

.hero-yinyang .yinyang-dot-yang {
  fill: #FFB366;
}

.hero-yinyang .yinyang-dot-yin {
  fill: #1AD47A;
}

@keyframes slow-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(-360deg); }
}

/* Steps */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  counter-reset: step;
}

.step {
  text-align: center;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-bottom: 1rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--gold);
  border: 1px solid var(--border);
  border-radius: 50%;
}

.step h3 {
  margin-bottom: 0.5rem;
}

.step p {
  color: var(--text-muted);
  font-size: 0.9375rem;
  margin-bottom: 0;
}

/* Responsive */
@media (max-width: 768px) {
  .nav-toggle { display: flex; }

  .user-profile-btn {
    order: 2;
    padding: 0.4rem 0.7rem;
    font-size: 0.75rem;
  }

  .site-nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    padding: 1rem;
    background: var(--bg-deep);
    border-bottom: 1px solid var(--border);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s, opacity 0.3s, visibility 0.3s;
  }

  .site-header--with-lang .site-nav {
    top: calc(var(--header-height) + var(--lang-bar-height));
  }

  .site-nav.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .site-nav ul {
    flex-direction: column;
  }

  .site-nav a {
    padding: 0.875rem 1rem;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  .about-photo {
    max-width: min(100%, 550px);
  }
}

/* Four Pillars calculator */
.section--calculator {
  padding-top: clamp(2rem, 5vw, 3rem);
}

.calculator-layout {
  display: grid;
  gap: 2rem;
  max-width: 720px;
  margin-inline: auto;
}

.bazi-form {
  padding: clamp(1.75rem, 4vw, 2.5rem);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: visible;
}

.bazi-form .form-group {
  overflow: visible;
}

.bazi-form .section-label {
  margin-bottom: 0.35rem;
}

.bazi-form-title {
  margin: 0 0 1.75rem;
  font-size: clamp(1.5rem, 3vw, 1.875rem);
}

.field-label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.bazi-gender-toggle {
  display: inline-flex;
  padding: 4px;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.bazi-gender-option {
  position: relative;
  margin: 0;
  cursor: pointer;
}

.bazi-gender-option input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.bazi-gender-option span {
  display: block;
  padding: 0.5rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: 999px;
  transition: color 0.2s, background 0.2s;
}

.bazi-gender-option input:checked + span {
  color: var(--bg-deep);
  background: var(--gold);
}

.bazi-gender-option input:focus-visible + span {
  outline: 2px solid var(--gold-light);
  outline-offset: 2px;
}

.bazi-form .form-note {
  margin: 1.25rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.5;
}

.bazi-submit {
  width: 100%;
  margin-top: 1.5rem;
}

.bazi-about {
  padding: 1.5rem 1.75rem;
  background: var(--bg-elevated);
  border-left: 3px solid var(--gold-dim);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.bazi-about h3 {
  margin: 0 0 0.75rem;
  font-size: 1.125rem;
}

.bazi-about p {
  margin: 0 0 0.75rem;
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.bazi-about p:last-child {
  margin-bottom: 0;
}

.bazi-about-subhead {
  margin: 1.25rem 0 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}

.bazi-about-links {
  margin: 0 0 0.75rem;
  padding-left: 1.1rem;
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.bazi-about-links a {
  color: var(--gold-light);
}

.bazi-results {
  grid-column: 1 / -1;
  display: grid;
  gap: 1.5rem;
  margin-top: 0.5rem;
}

.bazi-result-block {
  padding: clamp(1.5rem, 4vw, 2rem);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.bazi-result-block h3 {
  margin: 0 0 1.25rem;
  font-size: 1.375rem;
}

.bazi-detail-list {
  display: grid;
  gap: 0.75rem;
  margin: 0;
}

.bazi-detail-list > div {
  display: grid;
  grid-template-columns: minmax(8rem, 11rem) 1fr;
  gap: 0.5rem 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.bazi-detail-list > div:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.bazi-detail-list dt {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.bazi-detail-list dd {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text);
}

.bazi-tag {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--gold-light);
  background: rgba(201, 169, 98, 0.12);
  border-radius: 999px;
}

.bazi-footnote {
  margin: 1.25rem 0 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.bazi-pillars-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(0.35rem, 1.5vw, 0.75rem);
  width: 100%;
  min-width: 0;
}

.bazi-pillar {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem;
  min-width: 0;
  padding: 1rem 0.65rem 1.15rem;
  text-align: center;
  background: linear-gradient(180deg, rgba(201, 169, 98, 0.06) 0%, var(--bg-deep) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.bazi-pillar--interactive {
  width: 100%;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.bazi-pillar--interactive:hover {
  border-color: rgba(201, 169, 98, 0.45);
  box-shadow: 0 4px 20px rgba(201, 169, 98, 0.12);
}

.bazi-pillar--interactive:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.bazi-pillar--interactive:active {
  transform: scale(0.985);
}

.bazi-pillar-cta {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}

.bazi-chart-hint {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--text-muted);
  text-align: center;
  border: 1px solid rgba(201, 169, 98, 0.22);
  border-radius: 10px;
  background: rgba(201, 169, 98, 0.08);
}

.bazi-chart-hint strong {
  color: var(--gold-light);
}

.bazi-totem-art-wrap {
  width: 100%;
  max-width: min(3in, 100%);
  height: auto;
  aspect-ratio: 1;
  flex-shrink: 1;
  display: block;
  padding: 0;
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
  overflow: hidden;
  position: relative;
}

.bazi-totem-art-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.bazi-totem-art-wrap--yang-wood { box-shadow: 0 4px 16px rgba(36, 95, 34, 0.45); }
.bazi-totem-art-wrap--yin-wood { box-shadow: 0 4px 14px rgba(90, 150, 80, 0.35); }
.bazi-totem-art-wrap--yang-fire { box-shadow: 0 4px 18px rgba(200, 60, 20, 0.5); }
.bazi-totem-art-wrap--yin-fire { box-shadow: 0 4px 14px rgba(220, 140, 60, 0.35); }
.bazi-totem-art-wrap--yang-earth { box-shadow: 0 4px 16px rgba(110, 75, 45, 0.45); }
.bazi-totem-art-wrap--yin-earth { box-shadow: 0 4px 14px rgba(180, 150, 60, 0.4); }
.bazi-totem-art-wrap--yang-metal { box-shadow: 0 4px 16px rgba(60, 100, 150, 0.45); }
.bazi-totem-art-wrap--yin-metal { box-shadow: 0 4px 14px rgba(130, 100, 180, 0.4); }
.bazi-totem-art-wrap--yang-water { box-shadow: 0 4px 16px rgba(20, 70, 140, 0.5); }
.bazi-totem-art-wrap--yin-water { box-shadow: 0 4px 14px rgba(100, 160, 210, 0.35); }

.bazi-totem-art {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.bazi-pillar-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  width: 100%;
}

.bazi-pillar-line {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(0.6875rem, 2.4vw, 0.9375rem);
  font-weight: 500;
  line-height: 1.3;
  color: var(--gold-light);
}

.bazi-pillar-line--guide {
  font-weight: 600;
}

.bazi-pillar-line--polarity {
  font-weight: 500;
}

.bazi-pillar-line--totems {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 0.5rem;
}

.bazi-pillar-guide {
  font-weight: 600;
}

.bazi-element-name {
  font-weight: 600;
}

.bazi-polarity-sign {
  font-weight: 700;
  color: var(--text-muted);
}

.bazi-totem-part {
  white-space: normal;
}

.bazi-totem-emoji {
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  font-style: normal;
}

.bazi-totem-icon {
  display: inline-block;
  width: 1.45em;
  height: 1.15em;
  vertical-align: -0.2em;
  flex-shrink: 0;
}

.bazi-pillar-stem,
.bazi-pillar-branch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}

.bazi-hanzi {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  line-height: 1.1;
  color: var(--gold-light);
}

.bazi-label {
  font-size: 0.6875rem;
  line-height: 1.3;
  color: var(--text-muted);
}

.bazi-pillar-empty {
  font-size: 1.5rem;
  color: var(--text-muted);
  opacity: 0.5;
}

.bazi-day-master {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.25rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, rgba(201, 169, 98, 0.08) 0%, rgba(201, 169, 98, 0.02) 100%);
  border: 1px solid rgba(201, 169, 98, 0.25);
  border-radius: var(--radius);
}

.bazi-day-master-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}

.bazi-day-master-value {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--gold-light);
}

/* Birth city lookup */
.bazi-city-field {
  position: relative;
}

.bazi-city-suggestions {
  position: absolute;
  z-index: 30;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  margin: 0;
  padding: 0.35rem 0;
  list-style: none;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  max-height: 240px;
  overflow-y: auto;
}

.bazi-city-suggestion {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding: 0.65rem 1rem;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  text-align: left;
  cursor: pointer;
}

.bazi-city-suggestion:hover,
.bazi-city-suggestion:focus-visible {
  background: rgba(201, 169, 98, 0.1);
  outline: none;
}

.bazi-city-suggestion--empty {
  color: var(--text-muted);
  cursor: default;
}

.bazi-city-name {
  flex: 1;
}

.bazi-city-offset {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.bazi-city-timezone {
  margin: 0.5rem 0 0;
  font-size: 0.8125rem;
  color: var(--gold-light);
}

.bazi-time-selects {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.bazi-time-selects select {
  flex: 1;
  max-width: 7rem;
}

.bazi-time-sep {
  font-size: 1.25rem;
  color: var(--gold-light);
  line-height: 1;
}

.bazi-version-tag {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  opacity: 0.7;
}

@media (max-width: 640px) {
  .bazi-pillars-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }

  .bazi-pillar {
    padding: 0.65rem 0.45rem 0.75rem;
    gap: 0.5rem;
  }

  .bazi-pillar-line {
    font-size: clamp(0.6875rem, 3.2vw, 0.8125rem);
    line-height: 1.28;
  }

  .bazi-pillar-line--totems {
    gap: 0.2rem 0.35rem;
  }

  .bazi-totem-art-wrap {
    max-width: min(2.75in, 100%);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
  }

  .bazi-result-block {
    padding: 1.15rem 0.75rem;
  }

  .bazi-result-block h3 {
    font-size: 1.125rem;
    margin-bottom: 0.85rem;
  }

  .bazi-detail-list > div {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
}

@media (min-width: 900px) {
  .calculator-layout {
    max-width: 960px;
    grid-template-columns: 1fr 280px;
    align-items: start;
  }

  .bazi-form {
    grid-column: 1;
    grid-row: 1 / 3;
  }

  .bazi-about {
    grid-column: 2;
    grid-row: 1;
  }

  .bazi-results {
    grid-column: 1 / -1;
  }
}

/* Totem detail modal (calculator card pop-up) */
.totem-modal {
  width: min(32rem, calc(100vw - 2rem));
  max-height: calc(100dvh - 2rem);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  background: transparent;
  color: var(--text);
  color-scheme: dark;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.totem-modal::backdrop {
  background: rgba(5, 8, 16, 0.82);
  backdrop-filter: blur(6px);
}

.totem-modal__panel {
  position: relative;
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background-color: var(--bg-deep);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(107, 91, 149, 0.28), transparent),
    radial-gradient(circle at 18% 82%, rgba(201, 169, 98, 0.08), transparent 42%),
    radial-gradient(circle at 82% 58%, rgba(107, 91, 149, 0.12), transparent 38%);
}

.totem-modal__panel::before,
.totem-modal__panel::after {
  pointer-events: none;
  position: absolute;
  color: var(--gold);
  opacity: 0.45;
  z-index: 0;
}

.totem-modal__panel::before {
  content: "✦";
  top: 1.25rem;
  left: 12%;
  font-size: 0.75rem;
}

.totem-modal__panel::after {
  content: "✦ ✦";
  top: 2.5rem;
  right: 10%;
  font-size: 0.5rem;
  letter-spacing: 0.35rem;
  color: var(--gold-dim);
}

.totem-modal__close {
  position: sticky;
  top: calc(env(safe-area-inset-top, 0px) + 0.75rem);
  float: right;
  z-index: 3;
  width: 2.25rem;
  height: 2.25rem;
  margin: 0.65rem 0.65rem 0.25rem 0.5rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(10, 14, 26, 0.85);
  color: var(--gold-light);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.totem-modal__close:hover,
.totem-modal__close:focus-visible {
  border-color: rgba(201, 169, 98, 0.45);
  color: var(--gold);
}

.totem-modal__body {
  position: relative;
  z-index: 1;
  clear: both;
  padding: 0.25rem 1.35rem 1.75rem;
}

.totem-modal__header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 1.25rem;
}

.totem-modal__art {
  display: flex;
  justify-content: center;
  width: 100%;
  margin: 0 0 1rem;
}

.totem-modal__art .bazi-totem-art-wrap {
  width: min(12.5rem, 72vw);
  max-width: 100%;
  background: rgba(18, 24, 41, 0.65);
}

.totem-modal__guide {
  margin: 0.75rem 0 0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.totem-modal__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.625rem, 4vw, 2rem);
  line-height: 1.15;
  color: var(--gold-light);
}

.totem-modal__subtitle {
  margin: 0.5rem 0 0;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.totem-modal__copy {
  color: var(--text);
  line-height: 1.65;
}

.totem-modal__copy p {
  margin: 0 0 1rem;
  color: var(--text-muted);
}

.totem-modal__copy p:last-child {
  margin-bottom: 0;
}

.totem-modal__element-lore {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(201, 169, 98, 0.22);
}

.totem-modal__element-title {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--gold-light);
  letter-spacing: 0.04em;
}

.totem-modal__element-lore p {
  margin: 0;
}

.totem-modal__copy strong {
  color: var(--text);
}

.totem-modal__copy a {
  color: var(--gold-light);
}

@media (max-width: 640px) {
  .totem-modal {
    width: min(32rem, calc(100vw - 1rem));
    max-height: calc(100dvh - 1rem);
  }

  .totem-modal__panel {
    max-height: calc(100dvh - 1rem);
  }

  .totem-modal__close {
    top: calc(env(safe-area-inset-top, 0px) + 2.5rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .totem-wheel,
  .hero-yinyang { animation: none; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Totem Connections directory */
.section--connections,
.section--connections-results,
.section--connections-manage {
  padding-top: 0;
}

.connections-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  align-items: start;
}

.connections-column,
.connections-form,
.connection-profile-summary,
.connection-manage-panel,
.connection-remove-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.connection-mode-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1.25rem;
  max-width: 56rem;
  margin-inline: auto;
}

.connection-mode-grid .card:nth-child(1) { grid-column: 1 / span 2; }
.connection-mode-grid .card:nth-child(2) { grid-column: 3 / span 2; }
.connection-mode-grid .card:nth-child(3) { grid-column: 5 / span 2; }
.connection-mode-grid .card:nth-child(4) { grid-column: 2 / span 2; }
.connection-mode-grid .card:nth-child(5) { grid-column: 4 / span 2; }

.connection-mode-grid .card {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 1.35rem;
}

.connection-mode-grid .card h3 {
  margin-top: 0;
}

.connection-mode-grid .card p {
  margin-bottom: 0;
}

.connection-mode-card {
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.connection-mode-card:hover,
.connection-mode-card:focus-visible {
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.connection-mode-card__cta {
  display: inline-block;
  margin-top: 0.85rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gold-light);
}

.connection-type-links {
  margin: 1rem 0 0;
  padding-left: 1.25rem;
}

.connection-type-links li + li {
  margin-top: 0.35rem;
}

.connections-form .btn,
.connection-filters .btn,
.connection-remove-form .btn {
  text-transform: none;
  letter-spacing: 0.01em;
}

.connection-profile-summary h3,
.connection-manage-panel h2,
.connection-remove-form h3 {
  margin-top: 0;
  color: var(--gold-light);
}

.connection-profile-animals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 1rem;
  margin: 1rem 0 0;
}

.connection-profile-animals dt {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.connection-profile-animals dd {
  margin: 0.15rem 0 0;
  font-weight: 600;
  color: var(--text);
}

.connection-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1rem;
}

.connection-filters .form-group {
  min-width: 12rem;
  margin: 0;
}

.connections-results {
  display: grid;
  gap: 1rem;
}

.connection-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
}

.connection-card__header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
  margin-bottom: 0.75rem;
}

.connection-card__name {
  margin: 0;
  color: var(--gold-light);
}

.connection-card__verified {
  display: inline-block;
  margin-left: 0.55rem;
  padding: 0.12rem 0.5rem;
  vertical-align: middle;
  font-family: var(--font-sans, "Source Sans 3", sans-serif);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #1a1510;
  background: rgba(201, 169, 98, 0.45);
  border: 1px solid var(--gold);
  border-radius: 999px;
}

.connection-card__verified--time {
  color: #2a2010;
  background: linear-gradient(135deg, #f0d78c 0%, #c9a962 55%, #a8883a 100%);
  border-color: #e8c56a;
  box-shadow: 0 0 0 1px rgba(232, 197, 106, 0.35);
}

.connection-card--verified {
  border-color: rgba(201, 169, 98, 0.55);
}

.connection-card--time-verified {
  border-color: rgba(232, 197, 106, 0.75);
}

.connection-card__intro {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
}

.connection-card__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
}

.connection-card__score {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.connection-card__score--full {
  border-color: rgba(107, 191, 138, 0.45);
  color: #8fd4a8;
}

.connection-card__matches {
  margin: 0.75rem 0 0;
  padding-left: 1.1rem;
  color: var(--text-muted);
}

.connection-card__meta {
  margin: 0.75rem 0 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.connection-card__contact {
  margin: 0.75rem 0 0;
}

.connection-card__contact a {
  color: var(--gold);
}

.connection-empty {
  color: var(--text-muted);
  margin: 0;
}

.connection-manage-panel,
.connection-remove-form {
  margin-top: 1.5rem;
}

.checkbox-label {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  color: var(--text-muted);
  line-height: 1.5;
}

.checkbox-label input {
  margin-top: 0.2rem;
}

.field-optional {
  font-weight: 400;
  color: var(--text-muted);
}

.form-message {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(201, 169, 98, 0.06);
  color: var(--text-muted);
}

.form-message.visible {
  display: block;
}

.form-message--error {
  border-color: rgba(232, 93, 76, 0.35);
  color: #f0a59c;
}

.form-message--success {
  border-color: rgba(107, 191, 138, 0.35);
  color: #8fd4a8;
}

.form-message--info {
  border-color: rgba(201, 169, 98, 0.25);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 960px) {
  .connections-layout {
    grid-template-columns: 1fr;
  }

  .connection-mode-grid {
    grid-template-columns: 1fr;
    max-width: 18rem;
  }

  .connection-mode-grid .card:nth-child(n) {
    grid-column: auto;
  }

  .connection-mode-grid .card {
    aspect-ratio: auto;
    min-height: 10rem;
  }
}
