/* Home page (web/index.html, assets/js/home.js, assets/js/home-wheel.js). From the design handoff, "TaraLumi Home".
   Tokens only (nocturne.css), so both themes work. Loaded after nocturne.css and site.css. */

main.home { gap: 0; padding-top: 0; padding-bottom: 0; }
.home h2:not(.kicker) { font-size: clamp(30px, 3.6vw, 44px); }
.home .kicker + h2, .home .kicker + h1 { margin-top: 14px; }

/* ---- Hero ---- */
.home-hero { display: flex; flex-wrap: wrap; align-items: center; gap: 40px clamp(32px, 6vw, 88px); padding: clamp(48px, 8vw, 96px) 0 48px; }
.home-hero-text { flex: 1 1 380px; min-width: 0; }
.home-hero h1 { font-size: clamp(42px, 6.4vw, 84px); line-height: 1.08; letter-spacing: -0.02em; margin: 22px 0 0 -0.05em; }
.home-lead { max-width: 50ch; margin-top: 22px; }

.home-kicker { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.home-kicker time { color: inherit; }
.home-kicker-rule { width: 24px; height: 1px; background: var(--color-accent); }
.home-city-btn {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-height: 32px; padding: 3px 8px 3px 10px;
  border: 1px solid var(--color-divider); border-radius: var(--radius-md); background: var(--color-surface);
  font: 400 13px/1.2 var(--font-body); color: var(--text-strong); cursor: pointer;
  transition: border-color var(--dur) var(--ease);
}
.home-city-btn:hover { border-color: color-mix(in srgb, var(--color-text) 40%, transparent); }
.home-city-btn .icon { width: 16px; height: 16px; }
.home-city-btn .city-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-caret { transform: rotate(90deg); color: var(--text-meta); transition: transform var(--dur) var(--ease); }
.home-city-btn[aria-expanded="true"] .home-caret { transform: rotate(-90deg); }
.home-city-panel {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 20; width: min(380px, 100%);
  padding: 14px; border-radius: var(--radius-md); background: var(--color-surface); box-shadow: var(--shadow-lg);
}
.home-city-panel .city-field { max-width: none; }

.home-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 22px 28px; margin-top: 36px; }
.home-fact { display: flex; gap: 12px; align-items: flex-start; min-height: 66px; min-width: 0; }
.home-fact > .icon { width: 20px; height: 20px; margin-top: 2px; }
.home-fact > div, .home-fact.is-empty { display: flex; flex-direction: column; min-width: 0; }
.home-fact-value { margin-top: 3px; font: 500 18px/1.3 var(--font-body); color: var(--text-strong); font-feature-settings: "tnum" 1; }
.home-fact .meta { margin-top: 2px; line-height: 1.45; }
.home-facts-empty { grid-column: 1 / -1; font-size: 15px; }
.home-actions { margin-top: 36px; }
@media (max-width: 560px) {
  .home-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 16px; margin-top: 28px; }
  .home-fact { min-height: 58px; }
  .home-fact > .icon { display: none; }
  .home-fact-value { font-size: 16px; }
  .home-actions { margin-top: 28px; }
}

.home-wheel { flex: 1 1 360px; max-width: 500px; min-width: 0; margin: 0 auto; }
.home-wheel-box { aspect-ratio: 1; }
.home-wheel figcaption { margin-top: 14px; text-align: center; }

/* The wheel (home-wheel.js) */
.hw { display: block; width: 100%; height: auto; overflow: visible; }
.hw-signs text { font: 500 10.5px var(--font-body); letter-spacing: 0.08em; fill: var(--text-meta); text-anchor: middle; dominant-baseline: central; transition: fill var(--dur) var(--ease); }
.hw-signs text.on { fill: var(--color-accent-200); }
.hw-wedge { pointer-events: none; }
.hw-body { cursor: pointer; outline: none; }
.hw-disc { fill: var(--color-neutral-900); stroke: var(--color-neutral-700); transition: fill var(--dur) var(--ease), stroke var(--dur) var(--ease); }
.hw-body.on .hw-disc { fill: var(--color-accent-800); stroke: var(--color-accent-300); }
.hw-body:focus-visible .hw-disc { stroke: var(--color-accent); stroke-width: 2; }
.hw-r { font: 600 9px var(--font-body); fill: var(--color-accent-300); text-anchor: middle; dominant-baseline: central; }
@media (max-width: 520px) { .hw-signs text { font-size: 13px; } .hw-r { font-size: 11px; } }
/* The Moon keeps a lit face on a dark disc in the light theme too, where the mirrored ramps would invert it. */
:root[data-theme="light"] .hw-moon-disc, :root[data-theme="light"] .hm-disc { fill: var(--color-neutral-700); stroke: var(--color-neutral-600); }
:root[data-theme="light"] .hw-moon-lit, :root[data-theme="light"] .hm-lit { fill: var(--color-surface); }
@media (prefers-reduced-motion: no-preference) {
  .hw-orbit { transform-box: view-box; transform-origin: 220px 220px; animation: hw-spin 90s linear infinite; }
  .hw-glow { animation: hw-pulse 6s ease-in-out infinite; }
}
@keyframes hw-spin { to { transform: rotate(360deg); } }
@keyframes hw-pulse { 0%, 100% { opacity: 0.6; } 50% { opacity: 1; } }

/* ---- Positions now ---- */
.home-positions { padding: 0 0 clamp(56px, 8vw, 96px); }
.home-inline-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 16px; margin-bottom: 14px; }
.home-inline-head h2.kicker { font: 400 var(--fs-meta)/1.3 var(--font-body); letter-spacing: 0.06em; }
.home-planets { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: var(--gap-grid); list-style: none; margin: 0; padding: 0; }
.home-planet {
  display: flex; align-items: center; gap: 12px; min-width: 0; padding: 10px 12px; border-radius: var(--radius-md);
  background: var(--color-surface); box-shadow: var(--shadow-sm); transition: box-shadow var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.home-planet.is-lit { box-shadow: var(--ring-selected); background: var(--fill-selected); }
.home-planet .planet { width: 48px; height: 48px; }
.home-planet > div { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.home-planet .meta { font-size: 12px; }
.home-planet-pos { font-size: 14px; font-weight: 500; color: var(--text-strong); font-feature-settings: "tnum" 1; }
@media (max-width: 560px) {
  .home-planets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-planet { gap: 10px; padding: 10px; }
  .home-planet .planet { width: 36px; height: 36px; }
}

/* ---- Sections ---- */
.home-section { padding: clamp(40px, 6vw, 72px) 0; scroll-margin-top: 80px; }
.home-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; }
.home-head > div { min-width: 0; }
.home-head .btn-ghost { margin-right: -6px; }
.home-blurb { font-size: 16px; line-height: 1.65; max-width: 52ch; margin-top: 14px; color: var(--text-body); }
.home-after { margin-top: 14px; }

/* ---- Birth chart teaser ---- */
.home-chart { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 40px clamp(32px, 6vw, 88px); }
.home-chart-text { flex: 1 1 380px; min-width: 0; }
.home-form { margin-top: 28px; max-width: 520px; }
.home-chart-fig { flex: 1 1 300px; max-width: 400px; min-width: 0; margin: 0 auto; }
.home-chart-fig:has(.home-now-chart:empty) { display: none; }
.home-now-chart { aspect-ratio: 1; justify-content: center; }
.home-now-chart svg { max-width: 100%; }
.home-chart-fig figcaption { margin-top: 12px; text-align: center; }

/* ---- Week strip ---- */
.home-week { display: grid; grid-template-columns: repeat(auto-fit, minmax(108px, 1fr)); gap: var(--gap-grid); list-style: none; margin: 28px 0 0; padding: 0; }
.home-week:empty { display: none; }
.home-day {
  display: flex; flex-direction: column; gap: 12px; height: 100%; padding: 16px 14px; border-radius: var(--radius-md);
  background: var(--color-surface); box-shadow: var(--shadow-sm); color: var(--text-strong); text-decoration: none;
  transition: transform var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.home-day:hover { color: var(--text-strong); background: var(--fill-selected); transform: var(--lift-feature); }
.home-day.is-today { box-shadow: var(--ring-selected); }
.home-day-top { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; font-size: 13px; }
.home-day-name { font-weight: 500; }
.home-day.is-today .home-day-name { color: var(--text-accent); }
.home-day-top .meta { font-feature-settings: "tnum" 1; white-space: nowrap; }
.home-day > span:last-child { display: flex; flex-direction: column; }
.home-day-title { font-size: 14px; font-weight: 500; line-height: 1.3; }
.home-day-sub { font-size: 12px; color: var(--text-meta); margin-top: 3px; }
.home-day-extra { font-size: 12px; color: var(--text-accent); margin-top: 6px; line-height: 1.4; }
.home-moon { display: block; flex: none; }
/* Phones: the week becomes one row that scrolls sideways. */
@media (max-width: 560px) {
  .home-week { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 132px; overflow-x: auto; scroll-snap-type: x proximity; margin-inline: calc(-1 * var(--gutter)); padding: 4px var(--gutter) 8px; scroll-padding-inline: var(--gutter); scrollbar-width: none; }
  .home-week::-webkit-scrollbar { display: none; }
  .home-week > li { scroll-snap-align: start; }
}

/* ---- Coming up in the sky ---- */
.home-events { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: var(--gap-grid); list-style: none; margin: 28px 0 0; padding: 0; }
.home-event {
  display: flex; align-items: center; gap: 14px; height: 100%; padding: 16px; border-radius: var(--radius-md);
  background: var(--color-surface); box-shadow: var(--shadow-sm); color: var(--text-strong); text-decoration: none;
  transition: transform var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.home-event:hover { color: var(--text-strong); background: var(--fill-selected); transform: var(--lift-feature); }
.home-event-icon { display: grid; place-items: center; flex: none; width: 44px; height: 44px; color: var(--color-accent); }
.home-event-icon:empty { display: none; }
.home-event-icon > svg { width: 44px; height: 44px; }
.home-event-text { display: flex; flex-direction: column; min-width: 0; }
.home-event .kicker { font-size: 12px; }
.home-event-label { margin-top: 3px; font-size: 16px; font-weight: 500; line-height: 1.3; }

/* ---- Sign outlooks ---- */
.home-signs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(160px, 100%), 1fr)); gap: var(--gap-grid); list-style: none; margin: 28px 0 0; padding: 0; }
@media (max-width: 380px) { .home-signs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.home-sign {
  display: flex; flex-direction: column; gap: 18px; height: 100%; padding: 16px; border-radius: var(--radius-md);
  background: var(--color-surface); box-shadow: var(--shadow-sm); color: var(--text-strong); text-decoration: none;
  transition: transform var(--dur) var(--ease), background-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.home-sign:hover { color: var(--text-strong); background: var(--fill-selected); box-shadow: var(--ring-selected); transform: var(--lift-feature); }
.home-sign-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.home-sign-top .icon { width: 32px; height: 32px; color: var(--text-accent); }
.home-sign-el { font-size: 11px; color: var(--text-meta); }
.home-sign-name { font-size: 17px; font-weight: 500; line-height: 1.2; }
.home-sign-names { display: flex; flex-direction: column; }
.home-sign-sub { font-size: 12px; color: var(--text-meta); margin-top: 3px; }

/* ---- Written readings ---- */
.home-readings { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: var(--gap-grid); list-style: none; margin: 28px 0 0; padding: 0; }
.home-reading {
  display: flex; flex-direction: column; gap: 14px; height: 100%; padding: 20px; border-radius: var(--radius-md);
  background: var(--color-surface); box-shadow: var(--shadow-sm); color: var(--text-strong); text-decoration: none;
  transition: transform var(--dur) var(--ease), background-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.home-reading:hover { color: var(--text-strong); background: var(--fill-selected); box-shadow: var(--ring-selected); transform: var(--lift-feature); }
.home-reading .planet { width: 64px; height: 64px; }
.home-reading > span:nth-of-type(1) { display: flex; flex-direction: column; flex: 1; }
.home-reading-name { font: var(--font-heading-weight) 22px/1.2 var(--font-heading); letter-spacing: -0.02em; }
.home-reading-sub { margin-top: 6px; font-size: 14px; line-height: 1.5; color: var(--text-body); }
.home-reading-more { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; color: var(--text-accent); }
.home-reading-more .icon { color: inherit; }
.home-reading-tag { align-self: flex-start; margin-bottom: 8px; }
.home-reading.is-season { box-shadow: inset 0 0 0 1px var(--color-accent-700); }
@media (max-width: 560px) {
  .home-readings { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-reading { gap: 12px; padding: 16px 14px; }
  .home-reading .planet { width: 48px; height: 48px; }
  .home-reading-name { font-size: 19px; }
  .home-reading-sub { font-size: 13px; }
  .home-reading-more { font-size: 13px; }
}

/* ---- Calculators ---- */
.home-tools { padding-bottom: clamp(56px, 8vw, 96px); }
.home-tools h2 { margin-bottom: 20px; }
.home-rows { list-style: none; margin: 0; padding: 0; }
.home-rows > li { background: var(--rule) no-repeat top / 100% 1px; }
.home-rows a {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 28px; padding: 22px 8px; border-radius: var(--radius-md);
  color: var(--text-strong); text-decoration: none; transition: background-color var(--dur) var(--ease);
}
.home-rows a:hover { color: var(--text-strong); background: color-mix(in srgb, var(--color-accent) 8%, transparent); }
.home-rows .icon { width: 26px; height: 26px; }
.home-rows .home-row-go { width: 18px; height: 18px; }
.home-row-title { flex: 1 1 220px; font-size: 20px; font-weight: 500; letter-spacing: -0.01em; line-height: 1.3; }
.home-row-desc { flex: 2 1 280px; font-size: 15px; line-height: 1.55; color: var(--text-body); }
@media (max-width: 560px) {
  .home-rows a { display: grid; grid-template-columns: 26px minmax(0, 1fr) 18px; gap: 4px 14px; padding: 18px 4px; }
  .home-rows .icon:first-child { grid-row: 1 / span 2; align-self: start; }
  .home-row-title { grid-column: 2; font-size: 18px; }
  .home-row-desc { grid-column: 2; grid-row: 2; font-size: 14px; }
  .home-rows .home-row-go { grid-column: 3; grid-row: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .home-day, .home-event, .home-sign, .home-reading { transition: none; }
  .home-day:hover, .home-event:hover, .home-sign:hover, .home-reading:hover { transform: none; }
}

/* ---- Page not found (web/404.html), which borrows the calculator rows above ---- */
.nf-hero { display: flex; flex-direction: column; align-items: flex-start; gap: 0; padding: clamp(48px, 8vw, 96px) 0 clamp(32px, 5vw, 56px); }
.nf-hero .tl-mark { margin: 0 0 24px -6px; }
.nf-hero h1 { margin-top: 14px; text-wrap: balance; }
.nf-lead { max-width: 52ch; margin: 22px 0 32px; }
.nf-tools { padding-top: 0; }
.nf-tools h2.kicker { font: 400 var(--fs-meta)/1.3 var(--font-body); letter-spacing: 0.06em; margin-bottom: 14px; }
