/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --cream: #F1E9D5;
  --dark: #272522;
  --dark-light: rgba(39,37,34,0.5);
  --dark-faint: rgba(0,0,0,0.05);
}

body {
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 300;
  background-color: var(--cream);
  color: var(--dark);
}

/* ===== Header ===== */
header {
  background-color: var(--dark);
  color: var(--cream);
  position: sticky;
  top: 0;
  z-index: 200;
  width: 100%;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-img { height: 44px; width: auto; display: block; }
.logo-img.hidden { display: none; }

.logo-text {
  font-family: 'Cinzel', serif;
  font-size: 1.30rem;
  font-weight: 700;
  color: var(--cream);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  white-space: nowrap;
}

nav { display: flex; }

nav ul {
  list-style: none;
  display: flex;
  gap: 2rem;
  align-items: center;
}

nav ul li a {
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 300;
  font-size: 0.95rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cream);
  text-decoration: none;
  transition: opacity 0.2s;
}
nav ul li a:hover { opacity: 0.6; }
nav ul li a.active { opacity: 1; font-weight: 700; }

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--cream);
  cursor: pointer;
  padding: 0.25rem;
}
.mobile-menu-toggle svg { display: block; }

@media (max-width: 700px) {
  .mobile-menu-toggle { display: flex; }
  nav {
    display: none;
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    background-color: var(--dark);
    padding: 1.5rem 2rem 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
  }
  nav.open { display: flex; }
  nav ul { flex-direction: column; gap: 1.25rem; }
}

/* ===== Hero Section (Calculator Page) ===== */
.page-hero {
  background-color: var(--dark);
  color: var(--cream);
  text-align: center;
  padding: 2.8rem 2rem 3.5rem;
}

.hero-logo {
  height: 150px;
  width: auto;
  max-width: 80%;
  display: block;
  margin: 0 auto 1rem;
}

.hero-title {
  font-family: 'Bebas Neue', cursive;
  font-size: clamp(2.2rem, 5.5vw, 4rem);
  letter-spacing: 0.04em;
  line-height: 0.95;
  color: var(--cream);
}

.hero-subtitle {
  margin-top: 1rem;
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 300;
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  letter-spacing: 0.12em;
  color: var(--cream);
}

/* ===== Calculator Wrapper ===== */
.calculator-wrapper {
  background-color: var(--cream);
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--dark);
  padding-bottom: 3rem;
  width: 100%;
}

/* ===== Date Section ===== */
.date-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1rem 2rem;
}

.date-label {
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 400;
  font-size: 1.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.date-row {
  display: flex;
  align-items: stretch;
  margin-bottom: 0.75rem;
}

.date-input {
  border: 1px solid var(--dark);
  background: var(--cream);
  color: var(--dark);
  padding: 0 1rem;
  height: 40px;
  font-family: 'Josefin Sans', sans-serif;
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  outline: none;
  min-width: 160px;
  cursor: pointer;
}

.styled-button {
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.85rem;
  background-color: var(--dark);
  color: var(--cream);
  border: none;
  padding: 0 1.2rem;
  height: 40px;
  cursor: pointer;
  transition: opacity 0.2s;
  white-space: nowrap;
  margin-left: 1rem;
}
.styled-button:hover { opacity: 0.85; }
.styled-button:disabled { opacity: 0.4; cursor: not-allowed; }

.date-hint {
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0.6;
}

/* ===== Result Section ===== */
.result-section {
  width: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: var(--dark-faint);
  padding-top: 1.5rem;
  margin-bottom: 0.5rem;
  display: none;
}
.result-section.visible { display: flex; }

.result-name {
  height: 28px;
  font-size: 1.4rem;
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 400;
  letter-spacing: 0.1em;
  margin-bottom: 0;
}

/* ===== Email Section ===== */
.email-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 3rem;
  padding-top: 0.5rem;
}

.email-teaser {
  font-size: clamp(1rem, 2vw, 1.15rem);
  text-align: center;
  padding: 0 2rem;
  margin-bottom: 0.25rem;
}

.email-consent {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  max-width: 700px;
  padding: 0 1rem;
  margin-bottom: 1rem;
  margin-top: 0.75rem;
}
.email-consent input[type="checkbox"] { width: 1.25rem; height: 1.25rem; flex-shrink: 0; margin-top: 1px; }
.email-consent p { font-size: clamp(0.9rem, 1.5vw, 1rem); color: var(--dark-light); }

.email-form-desktop {
  display: flex;
  width: 100%;
  max-width: 550px;
  height: 40px;
  justify-content: center;
}
.email-form-mobile {
  display: none;
  flex-direction: column;
  width: 100%;
  max-width: 300px;
  gap: 0.75rem;
}

.email-input {
  flex: 1;
  min-width: 0;
  padding: 0 1rem;
  font-size: 1rem;
  font-family: 'Josefin Sans', sans-serif;
  border: 1px solid var(--dark);
  background: var(--cream);
  color: var(--dark);
  height: 40px;
  outline: none;
}
.email-input-mobile {
  padding: 0 1rem;
  font-size: 1rem;
  font-family: 'Josefin Sans', sans-serif;
  border: 1px solid var(--dark);
  background: var(--cream);
  color: var(--dark);
  height: 40px;
  min-height: 40px;
  outline: none;
  width: 100%;
}

/* ===== Mobile arrows row below wheel ===== */
.wheel-arrows-mobile {
  display: none;
  justify-content: center;
  gap: 3rem;
  margin-top: 0.5rem;
  width: 100%;
}

@media (max-width: 700px) {
  .hero-logo { height: 100px; }
  .page-hero { padding-top: 1.96rem; }

  /* Date row: stack vertically */
  .date-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  .date-input-wrap { width: 100%; }
  .date-input { width: 100%; min-width: unset; }
  .styled-button { margin-left: 0; width: 100%; }

  /* Email section */
  .email-form-desktop { display: none; }
  .email-form-mobile { display: flex; }

  /* Wheel: hide side arrows, show bottom row */
  #arrow-left, #arrow-right { display: none; }
  .wheel-arrows-mobile { display: flex; }
  .wheel-arrows-mobile .wheel-arrow-btn { position: static; }

  /* Full-width wheel */
  .wheel-outer { padding: 0; }
  .wheel-ring { margin-left: auto; margin-right: auto; }

  /* wheel-center overflow clips dynamic cross to circle */
}

@media (min-width: 701px) {
  .email-form-desktop { display: flex; }
  .email-form-mobile { display: none; }
}

/* Prevent horizontal overflow */
html, body { overflow-x: hidden; max-width: 100%; }
.calculator-wrapper { overflow-x: hidden; }

/* ===== Wheel Section ===== */
.wheel-outer {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wheel-arrow-btn {
  position: absolute;
  z-index: 10;
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(39,37,34,0.6);
  transition: color 0.2s;
  flex-shrink: 0;
}
.wheel-arrow-btn:hover { color: var(--dark); }
.wheel-arrow-btn.disabled { color: rgba(39,37,34,0.3); cursor: default; }
.wheel-arrow-btn svg { width: 48px; height: 48px; display: block; }

.wheel-ring {
  position: relative;
  border-radius: 50%;
  margin-top: 1rem;
  flex-shrink: 0;
}

/* Spin animation - 4s linear, single rotation */
@keyframes rotateTenTimes {
  0%   { transform: rotate(0deg); animation-timing-function: cubic-bezier(0.175,0.885,0.32,1.275); }
  100% { transform: rotate(1turn); }
}
.wheel-ring.spinning {
  animation: 4s linear 0s 1 normal none running rotateTenTimes;
}

.wheel-icon {
  position: absolute;
  border-radius: 50%;
  cursor: default;
}
.wheel-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.wheel-center {
  position: absolute;
  background-color: var(--cream);
  border-radius: 50%;
  overflow: hidden;
  padding: 0;
  transition: transform 0.2s;
}

/* Dynamic cross inside the wheel center */
.cross-inner {
  position: absolute;
  top: 20px; left: 20px; right: 20px; bottom: 20px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 1fr 1fr 1fr;
  gap: 40px;
}
.ci-empty {
  position: relative;
  z-index: 1;
}
.ci-card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-evenly;
  overflow: visible;
  padding: 10px 8px;
  border: none;
}
.ci-pos {
  font-size: clamp(0.5rem, 1.7vw, 1.05rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.85;
  line-height: 1.1;
  text-align: center;
  overflow-wrap: break-word;
  width: 100%;
}
.ci-icon {
  width: 42%;
  height: 42%;
  object-fit: contain;
  flex-shrink: 0;
}
.ci-name {
  font-size: clamp(0.65rem, 2.1vw, 1.30rem);
  font-weight: 400;
  letter-spacing: 0.03em;
  line-height: 1.1;
  text-align: center;
  overflow-wrap: break-word;
  width: 100%;
  margin-top: 10px;
}

@media (max-width: 600px) {
  .cross-inner { gap: 14px; top: 8px; left: 8px; right: 8px; bottom: 8px; }
  .ci-card {
    padding: 8px;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
    box-sizing: border-box;
  }
  .ci-icon { width: 32%; height: 32%; }
  .ci-pos { font-size: 0.55rem; letter-spacing: 0; }
  .ci-name { font-size: 0.62rem; margin-top: 1px; letter-spacing: 0; }
}

/* ===== Date Picker (Calendar Style) ===== */
.date-input-wrap {
  position: relative;
}

.date-picker {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 300;
  background: var(--cream);
  border: 1px solid var(--dark);
  width: 290px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.18);
  border-radius: 4px;
  overflow: hidden;
}

.cal-header {
  background: var(--dark);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
}

.cal-nav-btn {
  background: none;
  border: none;
  color: var(--cream);
  font-size: 22px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  opacity: 0.85;
}
.cal-nav-btn:hover { opacity: 1; }

.cal-header-center {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cal-month-sel {
  background: var(--dark);
  color: var(--cream);
  border: none;
  font-family: 'Josefin Sans', sans-serif;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  padding: 2px 4px;
}

.cal-year-display {
  color: var(--cream);
  font-family: 'Josefin Sans', sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  user-select: none;
  padding: 2px 6px;
  border-radius: 3px;
}
.cal-year-display:hover { background: rgba(255,255,255,0.12); }
.cal-year-arrow { font-size: 9px; opacity: 0.7; }

.cal-year-list {
  position: absolute;
  top: 42px;
  left: 0; right: 0; bottom: 0;
  background: var(--cream);
  overflow-y: auto;
  z-index: 10;
  scrollbar-width: thin;
}
.cal-year-list::-webkit-scrollbar { width: 4px; }
.cal-year-list::-webkit-scrollbar-thumb { background: rgba(39,37,34,0.3); }

.cal-year-item {
  font-family: 'Josefin Sans', sans-serif;
  font-size: 0.9rem;
  padding: 0.5rem;
  text-align: center;
  cursor: pointer;
  transition: background 0.1s;
}
.cal-year-item:hover { background: rgba(39,37,34,0.08); }
.cal-year-item.selected { background: var(--dark); color: var(--cream); }

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--dark);
  padding: 4px 8px 3px;
}
.cal-weekday {
  font-family: 'Josefin Sans', sans-serif;
  font-size: 0.65rem;
  letter-spacing: 0.05em;
  color: var(--cream);
  text-align: center;
  opacity: 0.6;
}

.cal-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  padding: 6px 8px 10px;
}

.cal-day {
  font-family: 'Josefin Sans', sans-serif;
  font-size: 0.82rem;
  padding: 6px 2px;
  text-align: center;
  cursor: pointer;
  border-radius: 3px;
  transition: background 0.1s;
  border: 1px solid transparent;
}
.cal-day:hover { background: rgba(39,37,34,0.08); }
.cal-day.today { border-color: rgba(39,37,34,0.35); }
.cal-day.selected { background: var(--dark); color: var(--cream); }
.cal-day.empty { visibility: hidden; }

/* ===== Description Section ===== */
.description-section {
  display: none;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 800px;
  padding: 2rem 2.5rem 1rem;
  gap: 2rem;
}
.description-section.visible { display: flex; }

.nahual-header { display: flex; flex-direction: column; align-items: center; padding: 2rem 0 1rem; }

.nahual-big-name {
  font-family: 'Josefin Sans', sans-serif;
  font-size: clamp(2.30rem, 5vw, 3rem);
  font-weight: 400;
  letter-spacing: 0.04em;
}
.nahual-pronunciation { font-style: italic; font-size: 1.25rem; margin: 0.25rem 0 0.5rem; }
.nahual-attributes {
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  letter-spacing: 0.05em;
  margin-bottom: 2.5rem;
}

.info-row { display: flex; flex-direction: column; align-items: center; }
.info-label {
  font-family: 'Josefin Sans', sans-serif;
  font-size: clamp(1.375rem, 2.5vw, 2rem);
  font-weight: 400;
}
.info-value { font-size: clamp(1.25rem, 2vw, 1.75rem); font-weight: 300; }

.desc-block { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; width: 100%; }
.section-title {
  font-family: 'Josefin Sans', sans-serif;
  font-size: 1.75rem;
  font-weight: 400;
}
.desc-para {
  font-size: clamp(1.28rem, 2vw, 1.45rem);
  font-weight: 300;
  text-align: center;
  opacity: 1;
  color: var(--dark);
  line-height: 1.75;
}

/* ===== Birthday Returns ===== */
.desc-para--muted {
  opacity: 0.65;
  font-size: clamp(1.05rem, 1.6vw, 1.15rem) !important;
}

.birthday-returns {
  width: 100%;
  border-top: 1px solid rgba(39,37,34,0.15);
}

.birthday-return-row {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(39,37,34,0.1);
  font-size: clamp(1.1rem, 1.8vw, 1.25rem);
  flex-wrap: wrap;
}
.birthday-return-row.birth { font-weight: 400; }
.birthday-return-row.past  { opacity: 0.45; }

.br-date { flex-shrink: 0; min-width: 130px; }
.br-sign { font-weight: 400; }
.br-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.6;
  margin-left: auto;
}

/* ===== Static Info Blocks (bottom) ===== */
.info-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 800px;
  padding: 2.5rem 2.5rem 0;
  gap: 1rem;
}
.info-block:last-of-type { padding-bottom: 3rem; }

/* ===== Success Toast ===== */
.success-toast {
  display: none;
  background: var(--dark);
  color: var(--cream);
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 0.5rem;
}
.success-toast.visible { display: block; }

/* ===== Home page ===== */
.home-hero {
  background-color: var(--dark);
  color: var(--cream);
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 5rem 2rem 4rem;
}

.home-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(2.75rem, 8vw, 5.75rem);
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  color: var(--cream);
}

.home-subtitle {
  font-weight: 300;
  font-size: clamp(1.15rem, 2.5vw, 1.5rem);
  letter-spacing: 0.15em;
  opacity: 0.75;
  max-width: 560px;
  margin-bottom: 3rem;
  line-height: 1.8;
}

.home-logo-img {
  max-height: 160px;
  max-width: 80%;
  object-fit: contain;
  margin-bottom: 2rem;
}

/* ===== Home Tools Section ===== */
.home-tools {
  background: var(--cream);
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 2.5rem;
  padding: 5rem 2rem 6rem;
  flex-wrap: wrap;
}

.home-tool-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  max-width: 340px;
  width: 100%;
  text-align: center;
  padding: 3rem 2.5rem;
  border: 1px solid rgba(39,37,34,0.14);
  text-decoration: none;
  color: var(--dark);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.home-tool-card:hover {
  border-color: rgba(39,37,34,0.38);
  box-shadow: 0 8px 32px rgba(39,37,34,0.08);
  transform: translateY(-4px);
}

.home-tool-icon {
  width: 56px;
  height: 56px;
  color: var(--dark);
  opacity: 0.6;
}
.home-tool-icon svg { width: 100%; height: 100%; display: block; }

.home-tool-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--dark);
}

.home-tool-desc {
  font-family: 'Josefin Sans', sans-serif;
  font-size: clamp(1.05rem, 1.8vw, 1.2rem);
  font-weight: 300;
  line-height: 1.75;
  color: var(--dark);
  opacity: 0.68;
  flex: 1;
}

.home-tool-cta {
  font-family: 'Josefin Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dark);
  margin-top: 0.5rem;
}

@media (max-width: 700px) {
  .home-tools { padding: 3.5rem 1.25rem 4rem; gap: 1.5rem; }
  .home-tool-card { padding: 2.25rem 1.75rem; }
}
