/* ============================================================
   ALETHEIA Day — design tokens mirror geodesicnexus.com
   ============================================================ */

:root {
  --bg:            #030406;
  --surface:       rgba(5, 8, 12, 0.7);
  --border:        rgba(255, 255, 255, 0.04);
  --border-hover:  rgba(255, 255, 255, 0.10);
  --text:          rgba(255, 255, 255, 0.85);
  --text-muted:    rgba(255, 255, 255, 0.45);
  --text-subtle:   rgba(255, 255, 255, 0.20);
  --cyan:          #0891b2;
  --cyan-bright:   #22d3ee;
  --cyan-dim:      rgba(8, 145, 178, 0.12);
  --cyan-border:   rgba(8, 145, 178, 0.25);

  --c-pets:    #d97706;
  --c-baby:    #38bdf8;
  --c-home:    #a3e635;
  --c-water:   #06b6d4;
  --c-body:    #e879f9;
  --c-food:    #fb923c;
  --c-outdoor: #84cc16;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-font-smoothing: antialiased; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Syne', system-ui, sans-serif;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 15% 20%, rgba(8, 145, 178, 0.05) 0%, transparent 50%),
    radial-gradient(ellipse at 85% 80%, rgba(8, 145, 178, 0.04) 0%, transparent 50%);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

.mono { font-family: 'IBM Plex Mono', ui-monospace, monospace; }
::selection { background: rgba(8, 145, 178, 0.25); }
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.06); border-radius: 3px; }

body::after {
  content: '';
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  opacity: 0.025;
  pointer-events: none;
  z-index: 9999;
}

.hex-bg {
  position: fixed; inset: 0;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='52'%3E%3Cpath d='M30 0l26 15v22L30 52 4 37V15z' fill='none' stroke='%230891b2' stroke-width='0.5'/%3E%3C/svg%3E");
  background-size: 60px 52px;
  pointer-events: none;
  z-index: 0;
}

/* ─── NAV ────────────────────────────────────────────────── */
nav {
  position: fixed; top: 0; left: 0; right: 0;
  background: rgba(3, 4, 6, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  height: 56px;
  display: flex; align-items: center; justify-content: space-between;
  z-index: 50;
}
.nav-brand { font-size: 0.95rem; font-weight: 700; letter-spacing: 0.06em; text-decoration: none; color: var(--text); }
.nav-links { display: flex; align-items: center; gap: 2rem; }
.nav-links a { font-size: 0.82rem; color: var(--text-muted); text-decoration: none; letter-spacing: 0.04em; transition: color 0.2s; }
.nav-links a:hover { color: var(--text); }
.nav-links a[aria-current="page"] { color: var(--cyan); }

main { position: relative; z-index: 1; padding-top: 56px; }

/* ─── HERO ───────────────────────────────────────────────── */
.hero { text-align: center; padding: 5rem 2rem 3rem; max-width: 920px; margin: 0 auto; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--cyan-border); background: var(--cyan-dim);
  border-radius: 20px;
  font-size: 0.72rem; color: rgba(8,145,178,0.85); letter-spacing: 0.14em;
  margin-bottom: 1.75rem;
}
.hero h1 {
  font-size: clamp(2.25rem, 5.5vw, 4rem);
  font-weight: 800; letter-spacing: -0.02em; line-height: 1.05; margin-bottom: 0.75rem;
  background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.55) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.hero h1 .accent {
  background: linear-gradient(135deg, var(--cyan-bright) 0%, var(--cyan) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.hero-tagline { font-size: clamp(1rem, 2vw, 1.2rem); color: var(--text-muted); margin-bottom: 1.5rem; letter-spacing: 0.03em; }
.hero-desc { max-width: 640px; font-size: 0.95rem; color: var(--text-muted); line-height: 1.8; margin: 0 auto; }
.hero-desc em { color: var(--text); font-style: normal; }

/* ─── CONTAINER + SECTIONS ──────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }
section { padding: 4rem 0; }

.section-label { font-size: 0.7rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-subtle); margin-bottom: 1rem; }
.section-title { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 700; letter-spacing: -0.02em; margin-bottom: 1rem; color: rgba(255,255,255,0.92); }
.section-desc  { font-size: 0.95rem; color: var(--text-muted); max-width: 640px; line-height: 1.8; margin-bottom: 1.5rem; }

/* ─── STAGE (clock + panel) ─────────────────────────────── */
.stage { padding-top: 1rem; }

.stage-controls {
  display: flex; flex-wrap: wrap; gap: 1rem;
  align-items: center; justify-content: space-between;
  margin-bottom: 1.5rem;
}
.stage-personas {
  display: flex; gap: 0.4rem; flex-wrap: wrap;
}
.persona-btn {
  padding: 0.5rem 0.85rem;
  font-size: 0.72rem; letter-spacing: 0.10em;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
}
.persona-btn:hover { color: var(--text); border-color: var(--border-hover); }
.persona-btn.active {
  color: var(--cyan); border-color: var(--cyan-border); background: var(--cyan-dim);
}

.stage-toggles { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.toggle-btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.55rem 0.9rem;
  font-size: 0.7rem; letter-spacing: 0.12em;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer; text-decoration: none;
  transition: all 0.15s;
}
.toggle-btn:hover { color: var(--text); border-color: var(--border-hover); }
.toggle-btn.active { color: var(--cyan); border-color: var(--cyan-border); background: var(--cyan-dim); }
.toggle-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 5px rgba(8,145,178,0.6);
  animation: live-pulse 2.5s ease-in-out infinite;
}
.toggle-btn:not(.active) .toggle-dot { background: var(--text-subtle); animation: none; box-shadow: none; }
@keyframes live-pulse {
  0%, 100% { box-shadow: 0 0 5px rgba(8,145,178,0.5); }
  50%      { box-shadow: 0 0 11px rgba(8,145,178,0.9); }
}

.clock-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 2rem;
  align-items: start;
}
.clock-frame {
  background: rgba(255, 255, 255, 0.012);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
  aspect-ratio: 1 / 1;
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.clock-frame svg { width: 100%; height: 100%; display: block; }

/* Event markers — JS plots <g class="day-event" data-app="..." data-idx="..."> */
.day-event { cursor: pointer; outline: none; }
.day-event polygon, .day-event circle { transition: filter 0.2s, stroke-width 0.2s; }
.day-event:hover polygon, .day-event:focus-visible polygon,
.day-event:hover circle, .day-event:focus-visible circle {
  filter: drop-shadow(0 0 4px currentColor);
  stroke-width: 2;
}
.day-event[data-selected="true"] polygon,
.day-event[data-selected="true"] circle {
  filter: drop-shadow(0 0 8px currentColor);
  stroke-width: 2.4;
}

.detail-panel {
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.75rem;
  min-height: 480px;
  position: sticky; top: 80px;
}

.dp-eyebrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.65rem; letter-spacing: 0.18em; color: var(--text-subtle);
  text-transform: uppercase; margin-bottom: 0.75rem;
}
.dp-pill {
  padding: 0.18rem 0.5rem;
  border: 1px solid currentColor; border-radius: 4px;
  color: var(--cyan); font-size: 0.62rem; letter-spacing: 0.16em;
}
.dp-time {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 0.85rem; color: var(--cyan); margin-bottom: 0.4rem;
}
.dp-title { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 0.4rem; color: rgba(255,255,255,0.95); }
.dp-subtitle { font-size: 0.78rem; letter-spacing: 0.10em; color: var(--text-muted); margin-bottom: 1.25rem; }
.dp-body { font-size: 0.92rem; color: var(--text-muted); line-height: 1.75; margin-bottom: 1.25rem; }

.dp-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-bottom: 1.25rem; }
.dp-stat  { background: rgba(255,255,255,0.02); border: 1px solid var(--border); border-radius: 8px; padding: 0.7rem 0.9rem; }
.dp-stat-num { font-size: 1.05rem; font-weight: 700; color: rgba(255,255,255,0.95); }
.dp-stat-label { font-size: 0.62rem; letter-spacing: 0.14em; color: var(--text-subtle); text-transform: uppercase; margin-top: 0.15rem; }

.dp-list { list-style: none; display: grid; gap: 0.4rem; margin-bottom: 1.25rem; }
.dp-list li {
  font-size: 0.82rem; color: var(--text-muted);
  padding: 0.45rem 0.7rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-left: 2px solid var(--cyan);
  border-radius: 4px;
  display: flex; gap: 0.6rem; align-items: flex-start;
}
.dp-list li b { color: var(--text); font-weight: 600; }
.dp-list li.is-pets    { border-left-color: var(--c-pets); }
.dp-list li.is-baby    { border-left-color: var(--c-baby); }
.dp-list li.is-home    { border-left-color: var(--c-home); }
.dp-list li.is-water   { border-left-color: var(--c-water); }
.dp-list li.is-body    { border-left-color: var(--c-body); }
.dp-list li.is-food    { border-left-color: var(--c-food); }
.dp-list li.is-outdoor { border-left-color: var(--c-outdoor); }

.dp-risk {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem;
  font-size: 0.7rem; letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0.55rem 0.7rem;
  background: rgba(255,255,255,0.015);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 1rem;
}
.dp-risk-pill {
  display: inline-block;
  padding: 0.18rem 0.55rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  font-weight: 600;
}

.dp-cta {
  display: inline-block;
  padding: 0.65rem 1.1rem;
  background: var(--cyan-dim); border: 1px solid var(--cyan-border);
  border-radius: 6px; color: var(--cyan-bright);
  font-size: 0.82rem; font-weight: 600; text-decoration: none; letter-spacing: 0.04em;
  transition: background 0.15s;
}
.dp-cta:hover { background: rgba(8,145,178,0.2); }

.stage-hint { text-align: center; font-size: 0.68rem; letter-spacing: 0.18em; color: var(--text-subtle); margin-top: 1.5rem; text-transform: uppercase; }

/* ─── HOURLY LIST ───────────────────────────────────────── */
.hourly { border-top: 1px solid var(--border); }
.hour-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
  margin-top: 2rem;
}
.hour-list li {
  background: rgba(255,255,255,0.012);
  border: 1px solid var(--border);
  border-left: 2px solid var(--cyan);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  display: flex; gap: 0.75rem; align-items: flex-start;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}
.hour-list li:hover { background: rgba(255,255,255,0.025); transform: translateX(2px); }
.hour-list .hl-time {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 0.75rem; color: var(--cyan); flex-shrink: 0;
  min-width: 48px;
}
.hour-list .hl-icon { font-size: 1.05rem; flex-shrink: 0; }
.hour-list .hl-label { font-size: 0.88rem; color: var(--text); }
.hour-list .hl-app   { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.15rem; letter-spacing: 0.06em; font-family: 'IBM Plex Mono', ui-monospace, monospace; }
.hour-list li.is-pets    { border-left-color: var(--c-pets); }
.hour-list li.is-baby    { border-left-color: var(--c-baby); }
.hour-list li.is-home    { border-left-color: var(--c-home); }
.hour-list li.is-water   { border-left-color: var(--c-water); }
.hour-list li.is-body    { border-left-color: var(--c-body); }
.hour-list li.is-food    { border-left-color: var(--c-food); }
.hour-list li.is-outdoor { border-left-color: var(--c-outdoor); }

/* ─── BREAKDOWN ─────────────────────────────────────────── */
.breakdown { border-top: 1px solid var(--border); }
.breakdown-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}
.bd-cell {
  background: rgba(255,255,255,0.012);
  border: 1px solid var(--border);
  border-top: 2px solid var(--cyan);
  border-radius: 10px;
  padding: 1.4rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}
.bd-cell:hover { background: rgba(255,255,255,0.025); transform: translateY(-2px); }
.bd-cell.is-pets    { border-top-color: var(--c-pets); }
.bd-cell.is-baby    { border-top-color: var(--c-baby); }
.bd-cell.is-home    { border-top-color: var(--c-home); }
.bd-cell.is-water   { border-top-color: var(--c-water); }
.bd-cell.is-body    { border-top-color: var(--c-body); }
.bd-cell.is-food    { border-top-color: var(--c-food); }
.bd-cell.is-outdoor { border-top-color: var(--c-outdoor); }
.bd-icon  { font-size: 1.4rem; margin-bottom: 0.4rem; }
.bd-num   { font-size: 1.6rem; font-weight: 800; color: rgba(255,255,255,0.95); letter-spacing: -0.01em; }
.bd-label { font-size: 0.68rem; letter-spacing: 0.14em; color: var(--text-muted); margin-top: 0.3rem; font-family: 'IBM Plex Mono', ui-monospace, monospace; }
.bd-desc  { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.6rem; line-height: 1.55; }

/* ─── COMPANION CTA ─────────────────────────────────────── */
.companion { border-top: 1px solid var(--border); }
.companion-box {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; flex-wrap: wrap;
  background: rgba(8,145,178,0.04);
  border: 1px solid rgba(8,145,178,0.15);
  border-radius: 14px; padding: 2rem;
}
.companion-title { font-size: 1.4rem; font-weight: 700; color: rgba(255,255,255,0.95); margin: 0.25rem 0 0.4rem; }
.companion-desc  { color: var(--text-muted); font-size: 0.92rem; max-width: 560px; }
.companion-desc a { color: var(--cyan); text-decoration: none; }
.companion-desc a:hover { color: var(--cyan-bright); }
.companion-cta {
  display: inline-block; padding: 0.85rem 1.6rem;
  background: var(--cyan-dim); border: 1px solid var(--cyan-border);
  border-radius: 8px; color: var(--cyan-bright);
  font-weight: 600; text-decoration: none; letter-spacing: 0.04em;
  white-space: nowrap; transition: background 0.15s;
}
.companion-cta:hover { background: rgba(8,145,178,0.20); }

/* ─── FOOTER ────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 3rem 2rem; text-align: center;
  position: relative; z-index: 1;
}
.footer-links { display: flex; gap: 1.6rem; justify-content: center; flex-wrap: wrap; margin-bottom: 1.5rem; }
.footer-links a { font-size: 0.82rem; color: var(--text-subtle); text-decoration: none; transition: color 0.2s; }
.footer-links a:hover { color: var(--text-muted); }
.footer-copy { font-size: 0.7rem; color: var(--text-subtle); opacity: 0.7; }
.footer-copy a { color: inherit; }

/* ─── RESPONSIVE ────────────────────────────────────────── */
@media (max-width: 980px) {
  .clock-grid { grid-template-columns: 1fr; }
  .detail-panel { position: static; min-height: 0; }
}
@media (max-width: 768px) {
  nav { padding: 0 1.25rem; gap: 0.75rem; }
  .nav-links { gap: 1rem; }
  .nav-links a { font-size: 0.75rem; }
  .container { padding: 0 1.25rem; }
  .hero { padding: 4rem 1.25rem 2rem; }
  .clock-frame { padding: 0.5rem; }
}
@media (max-width: 520px) {
  .nav-links a:nth-child(n+3) { display: none; }
  .stage-controls { flex-direction: column; align-items: stretch; }
  .companion-box  { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .toggle-dot, .now-marker { animation: none !important; }
  html { scroll-behavior: auto; }
}
