/* RAWDOGGER — ALAMOai product surface. Tokens from /Users/ryan/alamoai-brand/DESIGN.md.
   Warm near-black canvas, single brass-gold accent, EB Garamond / Inter / Geist Mono.
   Semantic red/yellow/green allowed here: risk tiers are status indicators. */

:root {
  --ink: #0A0908;
  --panel: #11100E;
  --surface: #16140F;
  --surface-2: #1E1B14;
  --text-1: #F5F1E6;
  --text-2: #D9D2BE;
  --text-3: #8A8478;
  --text-4: #5C574E;
  --gold: #C9A84C;
  --gold-soft: #E0C26B;
  --gold-dark: #9E822E;
  --gold-btn-text: #1a1408;
  --hairline: rgba(255, 255, 255, 0.08);
  --hairline-strong: rgba(255, 255, 255, 0.14);
  --hairline-gold: rgba(201, 168, 76, 0.5);
  --red: #ef4444;
  --yellow: #eab308;
  --green: #22c55e;
  --radius: 0.5rem;
  --radius-card: 1rem;
  --radius-btn: 0.55rem;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-card: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--ink);
  color: var(--text-2);
  font-family: "Inter", ui-sans-serif, system-ui, sans-serif;
  font-feature-settings: "ss01", "cv11";
  font-size: 16px;
  line-height: 1.6;
  min-height: 100svh;
  -webkit-font-smoothing: antialiased;
}

#app {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.5rem 5.5rem;
}

h1, h2, h3 {
  font-family: "EB Garamond", ui-serif, "Times New Roman", serif;
  font-weight: 500;
  color: var(--text-1);
  letter-spacing: -0.015em;
}

.eyebrow {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}

.eyebrow--muted { color: var(--text-3); }

.display-lg {
  font-size: clamp(2.375rem, 9vw, 3.25rem);
  line-height: 1.0;
  letter-spacing: -0.022em;
}

.display-md {
  font-size: clamp(1.875rem, 6vw, 2.5rem);
  line-height: 1.05;
  letter-spacing: -0.018em;
}

.display-sm {
  font-size: clamp(1.4rem, 4vw, 1.875rem);
  line-height: 1.12;
  letter-spacing: -0.012em;
}

.lead { font-size: 1.0625rem; line-height: 1.65; letter-spacing: -0.005em; }
.caption { font-size: 0.8125rem; font-weight: 500; line-height: 1.4; color: var(--text-3); }
.mono-num { font-family: "Geist Mono", ui-monospace, monospace; font-variant-numeric: tabular-nums; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 3rem;
  padding-inline: 1.5rem;
  border-radius: var(--radius-btn);
  border: none;
  font-family: "Inter", sans-serif;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.005em;
  cursor: pointer;
  transition: all 320ms var(--ease);
  width: 100%;
}

.btn-gold {
  background: linear-gradient(180deg, #E0C26B 0%, #C9A84C 60%, #9E822E 100%);
  color: var(--gold-btn-text);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 -1px 0 rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(201, 168, 76, 0.75),
    0 4px 10px rgba(201, 168, 76, 0.35);
}
.btn-gold:hover { transform: translateY(-1px); }
.btn-gold:active { transform: translateY(0); background: var(--gold-dark); }
.btn[disabled], .btn-text[disabled] { opacity: 0.55; cursor: wait; }

.btn-ghost {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-1);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.06); border-color: rgba(201, 168, 76, 0.4); color: var(--gold-soft); }

.btn-text {
  background: none;
  border: none;
  color: var(--text-3);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.75rem;
  transition: color 320ms var(--ease);
}
.btn-text:hover { color: var(--gold-soft); }

/* ---------- cards ---------- */

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.005)), var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  padding: 1.5rem;
}

.card--gold {
  position: relative;
  border-color: rgba(201, 168, 76, 0.35);
}

/* ---------- onboarding ---------- */

.onboard {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  flex: 1;
  gap: 1.25rem;
  padding-bottom: 2rem;
}

.avatar {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 34%, #241E14, #0c0a06);
  border: 1.5px solid var(--hairline-gold);
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}

/* crew face crop — same framing as the chassis .face img */
.avatar img {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 150%;
  height: 150%;
  transform: translate(-50%, -36%);
  object-fit: contain;
  pointer-events: none;
  -webkit-user-drag: none;
}

.avatar::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 1px solid var(--hairline-gold);
  opacity: 0;
  transition: opacity 320ms var(--ease);
}

.avatar.talking::after { opacity: 1; animation: talk-ring 1.6s var(--ease) infinite; }

@keyframes talk-ring {
  0%   { transform: scale(1);    opacity: 0.9; }
  70%  { transform: scale(1.12); opacity: 0; }
  100% { transform: scale(1.12); opacity: 0; }
}

.avatar--sm { width: 64px; height: 64px; }
.avatar--lg { width: 96px; height: 96px; }

.onboard-text {
  min-height: 7.5rem;
  max-width: 38ch;
}

.beat-dots { display: flex; gap: 0.5rem; justify-content: center; }
.beat-dots span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-4);
  transition: all 320ms var(--ease);
}
.beat-dots span.active { background: var(--gold); transform: scale(1.35); }
.beat-dots span.done { background: var(--gold-dark); }

.reveal { animation: reveal 700ms var(--ease) both; }
@keyframes reveal {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- setup form ---------- */

.field { display: flex; flex-direction: column; gap: 0.5rem; text-align: left; width: 100%; }

.field input, .field select {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  color: var(--text-1);
  font-family: "Inter", sans-serif;
  font-size: 1rem;
  padding: 0.875rem 1rem;
  width: 100%;
  color-scheme: dark;
}
.field input:focus, .field select:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: transparent; }

/* ---------- main app ---------- */

.screen { display: none; flex-direction: column; gap: 1.5rem; flex: 1; }
.screen.active { display: flex; }

.app-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--hairline);
}

.wordmark {
  font-family: "EB Garamond", serif;
  font-weight: 500;
  font-size: 1.375rem;
  color: var(--text-1);
  letter-spacing: -0.012em;
}
.wordmark em { font-style: normal; color: var(--gold); }

/* today report */

.report-card { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 1rem; padding: 2rem 1.5rem; }

.tier-badge {
  font-family: "Geist Mono", monospace;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: 0.375rem 0.875rem;
  border-radius: 9999px;
  border: 1px solid;
}
.tier-badge.green  { color: var(--green);  border-color: rgba(34, 197, 94, 0.4);  background: rgba(34, 197, 94, 0.08); }
.tier-badge.yellow { color: var(--yellow); border-color: rgba(234, 179, 8, 0.4);  background: rgba(234, 179, 8, 0.08); }
.tier-badge.red    { color: var(--red);    border-color: rgba(239, 68, 68, 0.4);  background: rgba(239, 68, 68, 0.10); }

.report-line { font-size: 1.1875rem; line-height: 1.55; color: var(--text-1); max-width: 34ch; }

.play-report {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  background: none;
  border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent);
  color: var(--text-1);
  border-radius: 9999px;
  padding: 0.625rem 1.25rem;
  font-family: "Inter", sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 320ms var(--ease);
}
.play-report:hover { border-color: var(--gold); color: var(--gold-soft); }
.play-report[disabled] { opacity: 0.45; cursor: default; }

.cycle-meta { display: flex; gap: 1.5rem; justify-content: center; }
.cycle-meta .stat { display: flex; flex-direction: column; gap: 0.125rem; }
.cycle-meta .stat b {
  font-family: "Geist Mono", monospace;
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text-1);
  font-variant-numeric: tabular-nums;
}

/* week strip (free tier) */

.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.375rem; }
.week-day {
  display: flex; flex-direction: column; align-items: center; gap: 0.375rem;
  padding: 0.625rem 0;
  border-radius: var(--radius);
  border: 1px solid var(--hairline);
  background: var(--surface);
}
.week-day.today { border-color: rgba(201, 168, 76, 0.5); }
.week-day .caption { font-size: 0.6875rem; }
.week-day b { font-family: "Geist Mono", monospace; font-weight: 500; color: var(--text-1); font-size: 0.9375rem; }
.dot { width: 8px; height: 8px; border-radius: 50%; }
.dot.green  { background: var(--green); }
.dot.yellow { background: var(--yellow); }
.dot.red    { background: var(--red); }
.dot.unknown { background: var(--text-4); }

/* month calendar */

.cal-header { display: flex; align-items: center; justify-content: space-between; }
.cal-nav {
  background: none; border: 1px solid var(--hairline); color: var(--text-2);
  border-radius: var(--radius); width: 2.25rem; height: 2.25rem; cursor: pointer;
  transition: all 320ms var(--ease); font-size: 1rem;
}
.cal-nav:hover { border-color: rgba(201, 168, 76, 0.4); color: var(--gold-soft); }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.25rem; }
.cal-grid .dow { text-align: center; font-family: "Geist Mono", monospace; font-size: 0.625rem; letter-spacing: 0.1em; color: var(--text-4); text-transform: uppercase; padding: 0.375rem 0; }
.cal-cell {
  aspect-ratio: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border-radius: var(--radius);
  font-family: "Geist Mono", monospace;
  font-size: 0.8125rem;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.cal-cell.green  { background: rgba(34, 197, 94, 0.07); }
.cal-cell.yellow { background: rgba(234, 179, 8, 0.10); }
.cal-cell.red    { background: rgba(239, 68, 68, 0.13); color: var(--text-1); }
.cal-cell.today  { outline: 1px solid var(--gold); }
.cal-cell.blank  { visibility: hidden; }

/* paywall */

.locked-wrap { position: relative; }
.locked-blur { filter: blur(7px); pointer-events: none; user-select: none; opacity: 0.7; }
.locked-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.875rem;
  text-align: center; padding: 1.5rem;
}

.price-line { display: flex; align-items: baseline; gap: 0.375rem; justify-content: center; }
.price-line b { font-family: "Geist Mono", monospace; font-size: 2rem; font-weight: 500; color: var(--text-1); }

/* crew picker */

.crew-list { display: flex; flex-direction: column; gap: 0.75rem; }
.crew-row {
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem; border-radius: var(--radius-card);
  border: 1px solid var(--hairline);
  background: var(--surface);
  cursor: pointer;
  transition: all 400ms var(--ease-card);
  text-align: left;
  width: 100%;
}
.crew-row:hover { transform: translateY(-2px); border-color: rgba(201, 168, 76, 0.35); }
.crew-row.selected { border-color: var(--gold); }
.crew-row .who { flex: 1; }
.crew-row .who b { display: block; font-family: "EB Garamond", serif; font-weight: 500; font-size: 1.25rem; color: var(--text-1); letter-spacing: -0.012em; }

/* settings */

.settings-list { display: flex; flex-direction: column; gap: 1rem; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

.toggle { position: relative; width: 52px; height: 30px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 100%; height: 100%; position: absolute; cursor: pointer; z-index: 1; }
.toggle .track {
  position: absolute; inset: 0; border-radius: 9999px;
  background: var(--surface-2); border: 1px solid var(--hairline-strong);
  transition: all 320ms var(--ease);
}
.toggle .track::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--text-3);
  transition: all 320ms var(--ease);
}
.toggle input:checked + .track { background: rgba(201, 168, 76, 0.25); border-color: var(--hairline-gold); }
.toggle input:checked + .track::after { transform: translateX(22px); background: var(--gold); }

/* mode banner */
.mode-banner { text-align: center; }

/* honest odds */
.odds-figure { display: flex; flex-direction: column; gap: 0.375rem; margin: 0.75rem 0; }
.odds-bar { height: 10px; border-radius: 9999px; background: var(--surface-2); overflow: hidden; }
.odds-bar i { display: block; height: 100%; border-radius: 9999px; }

/* tab bar */

.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--panel);
  border-top: 1px solid var(--hairline);
  display: flex;
  justify-content: space-around;
  padding: 0.625rem 0 calc(0.625rem + env(safe-area-inset-bottom));
  backdrop-filter: blur(12px);
  max-width: 520px;
  margin: 0 auto;
}
.tab {
  background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 0.25rem;
  color: var(--text-3);
  font-family: "Geist Mono", monospace;
  font-size: 0.625rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: color 320ms var(--ease);
  min-width: 64px;
  padding: 0.25rem;
}
.tab.active, .tab:hover { color: var(--gold); }
.tab svg { width: 22px; height: 22px; }

.disclaimer {
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--text-4);
  text-align: center;
  padding-top: 0.5rem;
  border-top: 1px solid var(--hairline);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
