/* LIFE OS: ORIENTEERING — STYLESHEET */
/* Design system aligned to Pulse — warm gold #C8922A, Cormorant/Georgia, #FAFAF7 bg */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,600&display=swap');

/* ─── CSS Variables ─────────────────────────────────────────────────────────── */
:root {
  --gold:           #C8922A;
  --gold-mid:       #B8821A;
  --gold-muted:     rgba(200,146,42,0.55);
  --gold-faint:     rgba(200,146,42,0.10);
  --gold-active:    rgba(200,146,42,0.10);
  --gold-border:    rgba(200,146,42,0.25);
  --gold-border-hi: rgba(200,146,42,0.55);
  --doc-bg:         #FAFAF7;
  --doc-dark:       #0F1523;
  --doc-mid:        #4A4A4A;
  --doc-light:      #6B6B6B;
  --doc-border:     rgba(200,146,42,0.25);
  --score-green:    #3B6B9E;
  --score-amber:    #8A7030;
  --score-orange:   #8A5030;
  --score-red:      #8A3030;
}

/* ─── Reset & base ─────────────────────────────────────────────────────────── */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Georgia, serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  background-color: var(--doc-bg);
  background-image:
    radial-gradient(ellipse at 15% 10%, rgba(200,146,42,0.06) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 90%, rgba(200,146,42,0.04) 0%, transparent 55%);
  background-attachment: fixed;
  min-height: 100vh;
  color: var(--doc-dark);
  overflow-x: hidden;
}

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(200,146,42,0.35); border-radius: 2px; }

/* ─── Layout ────────────────────────────────────────────────────────────────── */
.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 44px 24px 120px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─── Header ────────────────────────────────────────────────────────────────── */
.header {
  text-align: center;
  padding-bottom: 32px;
  position: relative;
  border-bottom: 1px solid rgba(200,146,42,0.25);
  margin-bottom: 36px;
}

.logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  margin-bottom: 16px;
  opacity: 1;
}

.header h1 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 52px;
  font-weight: 300;
  color: var(--gold);
  letter-spacing: -0.01em;
  line-height: 1;
  margin: 0;
}

.header-prefix {
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--gold);
}

.header-sub {
  font-family: Georgia, serif;
  font-size: 13px;
  color: var(--doc-light);
  font-style: italic;
  letter-spacing: 0.03em;
  margin-top: 8px;
}

/* ─── Progress bar ──────────────────────────────────────────────────────────── */
.progress-container {
  margin: 0 0 28px;
}

.progress-bar {
  height: 2px;
  background: rgba(200,146,42,0.15);
  border-radius: 1px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 1px;
  transition: width 0.5s ease;
  width: 0%;
}

.progress-label {
  font-family: Georgia, serif;
  font-size: 10px;
  color: var(--gold);
  font-weight: 600;
  margin-top: 7px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* ─── Chat area ─────────────────────────────────────────────────────────────── */
#chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 130px;
}

/* ─── Messages ──────────────────────────────────────────────────────────────── */
.message {
  max-width: 86%;
  line-height: 1.8;
  font-size: 1.02rem;
  white-space: pre-wrap;
  word-wrap: break-word;
  animation: fadeUp 0.35s ease-out;
}

.message-assistant {
  max-width: 92%;
  padding: 20px 24px;
  border-radius: 10px;
  background: #FFFFFF;
  border: 1px solid rgba(200,146,42,0.25);
  border-left: 3px solid rgba(200,146,42,0.55);
  align-self: flex-start;
  color: var(--doc-dark);
  font-family: Georgia, serif;
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.85;
  white-space: pre-wrap;
  word-wrap: break-word;
  animation: fadeUp 0.4s ease-out;
  box-shadow: 0 2px 8px rgba(200,146,42,0.08);
}

.message-user {
  background: rgba(200,146,42,0.08);
  border: 1px solid rgba(200,146,42,0.25);
  color: var(--doc-mid);
  align-self: flex-end;
  border-radius: 10px;
  padding: 14px 18px;
  font-family: Georgia, serif;
  font-size: 1rem;
  font-style: italic;
  line-height: 1.7;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Phase divider ─────────────────────────────────────────────────────────── */
.phase-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 10px 0;
}

.phase-divider::before,
.phase-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(200,146,42,0.2);
}

.phase-divider span {
  font-family: Georgia, serif;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  white-space: nowrap;
}

/* ─── Typing indicator ──────────────────────────────────────────────────────── */
.typing-indicator {
  display: none;
  align-self: flex-start;
  background: #FFFFFF;
  border: 1px solid rgba(200,146,42,0.25);
  border-left: 3px solid rgba(200,146,42,0.35);
  border-radius: 10px;
  padding: 14px 18px;
  gap: 6px;
  align-items: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}

.typing-indicator.active {
  display: flex;
}

.typing-dot {
  width: 5px;
  height: 5px;
  background: rgba(200,146,42,0.5);
  border-radius: 50%;
  animation: typingBounce 1.3s infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.3; }
  30%            { transform: translateY(-4px); opacity: 0.8; }
}

/* ─── Input area ────────────────────────────────────────────────────────────── */
.input-area {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(250,250,247,0.96);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(200,146,42,0.25);
  padding: 16px 20px;
  z-index: 100;
}

.input-inner {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

#user-input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid rgba(200,146,42,0.25);
  border-radius: 8px;
  font-family: Georgia, serif;
  font-size: 1rem;
  font-style: italic;
  color: var(--doc-dark);
  background: #FFFFFF;
  resize: none;
  min-height: 48px;
  max-height: 120px;
  line-height: 1.6;
  transition: border-color 0.2s ease;
  outline: none;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

#user-input:focus {
  border-color: rgba(200,146,42,0.55);
}

#user-input::placeholder {
  color: #BBAB90;
  font-style: italic;
}

#user-input:disabled {
  opacity: 0.4;
}

.btn-send {
  background: var(--gold);
  color: #FFFFFF;
  border: none;
  border-radius: 8px;
  padding: 12px 22px;
  font-family: Georgia, serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 48px;
  white-space: nowrap;
}

.btn-send:hover  { background: var(--gold-mid); }
.btn-send:active { opacity: 0.85; }
.btn-send:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ─── Welcome carousel ───────────────────────────────────────────────────────── */
#welcome-screen {
  background: #FFFFFF;
  border: 1px solid rgba(200,146,42,0.25);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(200,146,42,0.08);
}

.carousel-track {
  display: flex;
  width: 300%;
  transition: transform 0.55s cubic-bezier(0.77, 0, 0.175, 1);
}

.carousel-slide {
  width: 33.333%;
  padding: 48px 44px 36px;
  box-sizing: border-box;
  flex-shrink: 0;
}

.slide-label {
  display: block;
  font-family: Georgia, serif;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 18px;
}

.carousel-heading {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 26px;
  font-weight: 400;
  color: var(--doc-dark);
  line-height: 1.3;
  margin-bottom: 22px;
  letter-spacing: 0.01em;
}

.carousel-slide p {
  margin-bottom: 16px;
  color: var(--doc-mid);
  font-family: Georgia, serif;
  font-size: 15px;
  font-weight: 400;
  font-style: italic;
  line-height: 1.85;
}

.carousel-slide p:last-of-type {
  margin-bottom: 0;
}

/* ─── Carousel nav ───────────────────────────────────────────────────────────── */
.carousel-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 44px 32px;
  border-top: 1px solid rgba(200,146,42,0.15);
}

.carousel-dots {
  display: flex;
  gap: 8px;
  align-items: center;
}

.carousel-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(200,146,42,0.25);
  transition: all 0.3s ease;
  display: inline-block;
}

.carousel-dot.active {
  background: var(--gold);
  transform: scale(1.4);
}

.carousel-arrow {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s ease;
  opacity: 0.5;
}

.carousel-arrow:hover  { opacity: 0.9; }
.carousel-arrow:active { transform: scale(0.92); }

.carousel-begin {
  background: var(--gold);
  border: none;
  cursor: pointer;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 19px;
  font-weight: 500;
  color: #FFFFFF;
  letter-spacing: 0.06em;
  padding: 12px 28px;
  border-radius: 8px;
  transition: opacity 0.15s ease;
}

.carousel-begin:hover { opacity: 0.85; }

/* ─── Live wheel ─────────────────────────────────────────────────────────────── */
.wheel-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 24px 20px;
  background: #FFFFFF;
  border: 1px solid rgba(200,146,42,0.25);
  border-radius: 12px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(200,146,42,0.08);
}

.wheel-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  justify-content: center;
  margin-top: 16px;
}

.wheel-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.wheel-legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.wheel-legend-name {
  font-family: Georgia, serif;
  font-size: 10px;
  color: var(--doc-light);
  letter-spacing: 0.05em;
}

.wheel-legend-score {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--doc-dark);
}

/* ─── Domain readout card ────────────────────────────────────────────────────── */
.domain-readout {
  align-self: flex-start;
  margin-bottom: 4px;
}

.domain-readout-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 20px;
  background: #FFFFFF;
  border: 1px solid rgba(200,146,42,0.25);
  border-left: 3px solid var(--gold);
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(200,146,42,0.06);
}

.domain-readout-label {
  font-family: Georgia, serif;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
}

.domain-readout-score {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
}

.domain-readout-denom {
  font-size: 13px;
  font-weight: 400;
  color: var(--doc-light);
}

.domain-readout-tier {
  font-family: Georgia, serif;
  font-size: 10px;
  color: var(--doc-light);
  letter-spacing: 0.06em;
}

.domain-readout-horizon {
  font-family: Georgia, serif;
  font-size: 10px;
  color: var(--gold-muted);
  letter-spacing: 0.05em;
}

/* ─── Profile delivery ──────────────────────────────────────────────────────── */
.message-profile {
  max-width: 100%;
  align-self: stretch;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
}

.profile-card {
  background: #FFFFFF;
  border-radius: 12px;
  overflow: hidden;
  color: var(--doc-dark);
  font-family: Georgia, serif;
  font-size: 1rem;
  line-height: 1.75;
  border: 1px solid rgba(200,146,42,0.25);
  border-left: 3px solid rgba(200,146,42,0.55);
  box-shadow: 0 2px 16px rgba(200,146,42,0.08);
}

.profile-hero {
  padding: 28px 32px 22px;
  border-bottom: 1px solid rgba(200,146,42,0.15);
  background: rgba(200,146,42,0.03);
}

.profile-card-heading {
  font-family: Georgia, serif;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
  display: block;
}

.profile-archetype-name {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 42px;
  font-weight: 300;
  color: var(--doc-dark);
  letter-spacing: 0.02em;
  line-height: 1.1;
  margin-bottom: 8px;
}

.profile-meta {
  font-family: Georgia, serif;
  font-size: 13px;
  color: var(--doc-light);
  font-style: italic;
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-meta-divider {
  display: inline-block;
  width: 1px;
  height: 12px;
  background: rgba(200,146,42,0.3);
  vertical-align: middle;
}

.profile-section-label {
  font-family: Georgia, serif;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
  display: block;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(200,146,42,0.15);
}

.profile-section {
  padding: 20px 32px;
  border-bottom: 1px solid rgba(200,146,42,0.08);
}

.profile-section:last-child {
  border-bottom: none;
  padding-bottom: 24px;
}

.profile-section p {
  color: var(--doc-dark);
  font-family: Georgia, serif;
  font-size: 1rem;
  line-height: 1.8;
  margin: 0;
}

/* ─── Section break ──────────────────────────────────────────────────────────── */
.section-break {
  margin: 1.5rem 0;
  border: none;
  border-top: 1px solid rgba(200,146,42,0.15);
}

.question-header {
  font-family: Georgia, serif;
  margin-bottom: 0.75rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 9px;
  font-weight: 600;
}

/* ─── Synthesis mirror ───────────────────────────────────────────────────────── */
.message-synthesis-mirror {
  max-width: 92%;
  padding: 24px 28px;
  border-radius: 10px;
  background: #FFFFFF;
  border: 1px solid rgba(200,146,42,0.25);
  border-left: 3px solid rgba(200,146,42,0.55);
  align-self: flex-start;
  color: var(--doc-dark);
  font-family: Georgia, serif;
  font-size: 1.05rem;
  line-height: 1.9;
  white-space: pre-wrap;
  word-wrap: break-word;
  animation: fadeUp 0.4s ease-out;
  box-shadow: 0 2px 8px rgba(200,146,42,0.08);
}

.synthesis-heading {
  font-family: Georgia, serif;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  text-align: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(200,146,42,0.15);
}

.synthesis-intro {
  color: var(--doc-light);
  font-family: Georgia, serif;
  font-size: 0.97rem;
  font-style: italic;
  margin-bottom: 22px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(200,146,42,0.08);
  line-height: 1.8;
}

.synthesis-section { margin-bottom: 20px; }
.synthesis-section:last-child { margin-bottom: 0; }

.synthesis-section-label {
  font-family: Georgia, serif;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
  display: block;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(200,146,42,0.12);
}

.synthesis-section p {
  color: var(--doc-dark);
  font-family: Georgia, serif;
  font-size: 1.02rem;
  line-height: 1.85;
  margin: 0;
}

/* ─── Profile closing ─────────────────────────────────────────────────────────── */
.profile-closing {
  padding: 20px 32px 28px;
  text-align: center;
  color: var(--doc-light);
  font-family: Georgia, serif;
  font-size: 11px;
  font-style: italic;
  letter-spacing: 0.05em;
  border-top: 1px solid rgba(200,146,42,0.08);
}

/* ─── Map components ─────────────────────────────────────────────────────────── */
.map-stage-badge {
  display: inline-block;
  background: transparent;
  border: 1px solid rgba(200,146,42,0.35);
  border-radius: 6px;
  padding: 4px 14px;
  font-family: Georgia, serif;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 12px;
}

.map-stage-desc {
  color: var(--doc-mid);
  font-family: Georgia, serif;
  font-size: 0.97rem;
  line-height: 1.75;
  font-style: italic;
}

.map-domains {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.map-domain-row {
  display: grid;
  grid-template-columns: 160px 1fr 80px;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(200,146,42,0.08);
}

.map-domain-row.map-domain-focus {
  background: rgba(200,146,42,0.04);
  border-radius: 6px;
  padding: 10px 12px;
  border-bottom: none;
  border-left: 2px solid rgba(200,146,42,0.45);
  grid-template-columns: 160px 1fr 80px 52px;
}

.map-domain-name {
  font-family: Georgia, serif;
  font-size: 13px;
  color: var(--doc-dark);
}

.map-domain-focus .map-domain-name { color: var(--gold); }

.map-domain-thesis {
  font-family: Georgia, serif;
  font-size: 10px;
  color: var(--doc-light);
  font-style: italic;
}

.map-domain-bar-wrap {
  height: 3px;
  background: rgba(200,146,42,0.12);
  border-radius: 2px;
  overflow: hidden;
}

.map-domain-bar {
  height: 100%;
  border-radius: 2px;
  transition: width 0.8s ease;
}

.map-domain-score {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--doc-mid);
  text-align: right;
  line-height: 1;
}

.map-domain-fractal {
  font-family: Georgia, serif;
  font-size: 9px;
  color: rgba(107,107,107,0.45);
  text-align: right;
  white-space: nowrap;
}

.map-focus-tag {
  font-family: Georgia, serif;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}

/* ─── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .container { padding: 32px 18px 100px; }
  .header h1 { font-size: 40px; }
  .header-prefix { font-size: 18px; }
  .logo { width: 56px; height: 56px; }
  .message { max-width: 96%; font-size: 0.97rem; }
  .message-assistant { max-width: 98%; }
  .carousel-slide { padding: 30px 24px 22px; }
  .carousel-heading { font-size: 22px; }
  .carousel-nav { padding: 18px 24px 26px; }
  .profile-hero { padding: 22px 20px 18px; }
  .profile-archetype-name { font-size: 34px; }
  .profile-section { padding: 16px 20px; }
  .wheel-container { padding: 20px 16px 16px; }
  .map-domain-row,
  .map-domain-row.map-domain-focus {
    grid-template-columns: 120px 1fr 64px;
  }
  .map-domain-row.map-domain-focus {
    grid-template-columns: 120px 1fr 64px 40px;
  }
}
