/*
 * The Thinker's Lounge
 * Copyright (c) 2026 The Thinker's Lounge. All rights reserved.
 *
 * This stylesheet and its design system (color palettes, theme architecture,
 * layout patterns) are proprietary. Unauthorized copying or redistribution
 * is prohibited.
 */

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

:root {
  --bg: #F5EFE0;
  --parchment: #EDE3CC;
  --ink: #1E140A;
  --muted: #8A7055;
  --gold: #B8860B;
  --border: rgba(107,78,42,0.2);
  --font-heading: 'Merriweather', Georgia, serif;
  --font-body: 'Nunito', 'Helvetica Neue', sans-serif;
  --purple-bg: #EEEDFE; --purple-text: #3C3489;
  --teal-bg: #E1F5EE; --teal-text: #085041;
  --blue-bg: #E6F1FB; --blue-text: #0C447C;
  --coral-bg: #FAECE7; --coral-text: #712B13;
  --amber-bg: #FAEEDA; --amber-text: #633806;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-weight: 300;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 14px;
  padding: 10px 24px;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  text-decoration: none;
  line-height: 1.4;
}
.btn-primary {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.btn-primary:hover { background: #3a2a18; text-decoration: none; }
.btn-secondary {
  background: transparent;
  color: var(--ink);
}
.btn-secondary:hover { background: var(--parchment); text-decoration: none; }
.btn-accent {
  background: var(--gold);
  color: #fff;
  border-color: var(--gold);
}
.btn-accent:hover { background: #9a7209; text-decoration: none; }

/* ─── Navigation ──────────────────────────────────────────────────────────── */
.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-wordmark {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 600;
  color: var(--gold);
  text-decoration: none;
  letter-spacing: 0.01em;
}
.nav-wordmark:hover { text-decoration: none; }
.nav-links { display: flex; gap: 28px; }
.nav-link {
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  padding-bottom: 2px;
  transition: color 0.2s;
}
.nav-link:hover { color: var(--ink); text-decoration: none; }
.nav-link.active {
  color: var(--ink);
  border-bottom: 2px solid var(--gold);
}

/* Hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  transition: transform 0.2s;
}

/* ─── Hero ────────────────────────────────────────────────────────────────── */
.hero {
  max-width: 720px;
  margin: 0 auto;
  padding: 80px 32px 48px;
  text-align: center;
}
.hero-logo {
  display: block;
  width: 300px;
  height: auto;
  border-radius: 8px;
  margin: 0 auto 28px;
}
.hero-label {
  display: block;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: 0.08em;
  color: var(--gold);
  margin-bottom: 28px;
  text-transform: none;
}
.hero-quote {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 17px;
  line-height: 1.4;
  color: var(--gold);
  border: none;
  margin: 0 0 28px;
  padding: 0;
}
.hero-body {
  font-size: 15px;
  line-height: 1.8;
  color: var(--muted);
  margin-bottom: 36px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
  text-align: left;
  text-indent: 2em;
}
.hero-ctas {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ─── Disclaimer ──────────────────────────────────────────────────────────── */
.disclaimer-box {
  max-width: 720px;
  margin: 0 auto 48px;
  padding: 16px 24px;
  border: 1px solid var(--border);
  border-radius: 4px;
  text-align: center;
}
.disclaimer-box p {
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
}

/* Color key */
.color-key {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 1100px;
  margin: 0 auto 32px;
  scroll-margin-top: 75px;
}
.color-key-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
  background: none;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 10px;
  cursor: pointer;
  font-family: var(--font-body);
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  white-space: nowrap;
}
.color-key-item:hover {
  border-color: var(--gold);
  color: var(--ink);
}
.color-key-item.active {
  border-color: var(--gold);
  color: var(--ink);
  background: var(--parchment);
}
.color-key-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid;
  flex-shrink: 0;
}
.color-key-dot-all {
  background: var(--gold);
  border-color: var(--gold);
}

/* ─── Mentor Grid ─────────────────────────────────────────────────────────── */
.mentor-grid-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 32px 64px;
}
.mentor-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.mentor-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 28px 24px;
  transition: border-color 0.2s;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.mentor-card:hover { border-color: var(--gold); }

.mentor-avatar {
  width: 100px;
  height: auto;
  border-radius: 8px;
  object-fit: cover;
  margin-bottom: 16px;
  border: 2px solid var(--border);
  transition: border-color 0.2s;
}
a:hover > .mentor-avatar {
  border-color: var(--gold);
}
.mentor-avatar--profile {
  width: 120px;
  height: auto;
  border-radius: 8px;
  object-fit: cover;
  margin-bottom: 16px;
  border: 2px solid var(--border);
}
.mentor-card-name-link {
  text-decoration: none;
  color: inherit;
}
.mentor-card-name-link:hover .mentor-card-name {
  color: var(--gold);
}
.mentor-card-name {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 2px;
}
.mentor-card-title {
  font-style: italic;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 10px;
}
.mentor-card-tradition {
  display: inline-block;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.03em;
  padding: 3px 10px;
  border-radius: 12px;
  margin-bottom: 14px;
}
.mentor-card-bio {
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
  margin-bottom: 12px;
  text-align: left;
  text-indent: 2em;
}
.mentor-card-inspired {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
  font-style: italic;
}
.mentor-card-links {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}
.mentor-card-links a {
  font-size: 12px;
  color: var(--gold);
}
.mentor-card .btn {
  width: 100%;
  text-align: center;
  font-size: 13px;
  padding: 8px 16px;
}

/* ─── Chat Layout ─────────────────────────────────────────────────────────── */
.chat-layout {
  display: flex;
  min-height: calc(100vh - 57px - 48px);
}

/* Sidebar */
.sidebar-close {
  display: none;
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}
.sidebar-close:hover { color: var(--heading); }
.chat-sidebar {
  position: relative;
  width: 280px;
  min-width: 280px;
  padding: 32px 24px;
  border-right: 1px solid var(--border);
  background: var(--bg);
  overflow-y: auto;
  flex-shrink: 0;
}
.sidebar-avatar {
  width: 64px;
  height: auto;
  border-radius: 6px;
  object-fit: cover;
  border: 2px solid var(--border);
  margin-bottom: 16px;
}
.sidebar-name {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 4px;
}
.sidebar-title {
  font-style: italic;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 10px;
}
.sidebar-tradition {
  display: inline-block;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 12px;
  margin-bottom: 16px;
}
.sidebar-bio {
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
  margin-bottom: 12px;
}
.sidebar-inspired {
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
  margin-bottom: 8px;
}
.sidebar-links {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}
.sidebar-links a { font-size: 12px; }
.sidebar-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}
.sidebar-action {
  display: block;
  font-size: 13px;
  color: var(--gold);
  margin-bottom: 8px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: var(--font-body);
  text-align: left;
}
.sidebar-action:hover { text-decoration: underline; }
.sidebar-disclaimer {
  font-size: 11px;
  color: var(--muted);
  margin-top: 24px;
  line-height: 1.6;
}

/* Chat Panel */
.chat-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--parchment);
  position: relative;
}
.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  font-size: 13px;
}
.chat-sidebar-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px 4px 4px;
  border-radius: 4px;
}
.chat-sidebar-toggle:hover { background: var(--parchment); }
.toggle-avatar {
  width: 28px;
  height: auto;
  border-radius: 4px;
  object-fit: cover;
  border: 1px solid var(--border);
}
.toggle-name {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
}
.chat-session-label {
  font-style: italic;
  color: var(--muted);
}
.chat-date {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}

/* Journal Import */
.journal-import {
  padding: 0 24px;
  background: var(--parchment);
}
.journal-import-toggle {
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--gold);
  cursor: pointer;
  padding: 10px 0 4px;
  display: block;
}
.journal-import-toggle:hover { text-decoration: underline; }
.journal-import-panel {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px;
  margin: 8px 0 12px;
}
.journal-import-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
  font-weight: 400;
}
.journal-import-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
  margin-bottom: 4px;
}
.journal-import-item:hover { background: var(--parchment); }
.journal-import-item-date {
  font-size: 12px;
  color: var(--gold);
  min-width: 90px;
}
.journal-import-item-preview {
  font-size: 13px;
  color: var(--ink);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-left: 12px;
}
.journal-import-item-btn {
  font-size: 11px;
  color: var(--gold);
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 10px;
  cursor: pointer;
  margin-left: 12px;
  white-space: nowrap;
}
.journal-import-item-btn:hover { background: var(--parchment); }
.journal-import-notice {
  font-size: 11px;
  color: var(--muted);
  margin-top: 10px;
  font-style: italic;
}
.journal-import-empty {
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
}

/* Messages */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.chat-msg {
  display: flex;
  gap: 12px;
  max-width: 680px;
}
.chat-msg--mentor { align-self: flex-start; }
.chat-msg--user { align-self: flex-end; flex-direction: row-reverse; }

.chat-msg-avatar {
  width: 36px;
  height: 45px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 4px;
  border: 1px solid var(--border);
}
.chat-msg-bubble {
  padding: 14px 18px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.7;
}
.chat-msg--mentor .chat-msg-bubble {
  background: var(--bg);
  border: 1px solid var(--border);
  border-top-left-radius: 4px;
}
.chat-msg--user .chat-msg-bubble {
  background: var(--parchment);
  border: 1px solid var(--border);
  border-top-right-radius: 4px;
}
.chat-msg--user .chat-msg-avatar { display: none; }
.chat-msg-time {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
}

/* Typing indicator */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 14px 18px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  border-top-left-radius: 4px;
  width: fit-content;
}
.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  animation: typingBounce 1.4s 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.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* Input area */
.chat-input-area {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.chat-input-wrap {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: var(--parchment);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
}
.chat-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 14px;
  color: var(--ink);
  resize: none;
  line-height: 1.6;
  max-height: 120px;
  overflow-y: auto;
}
.chat-input::placeholder { color: var(--muted); }
.chat-send {
  background: var(--ink);
  color: var(--bg);
  border: none;
  border-radius: 6px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s;
}
.chat-send:hover { background: #3a2a18; }
.chat-send:disabled { opacity: 0.4; cursor: not-allowed; }
.chat-input-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
}
.chat-input-hint {
  font-size: 11px;
  color: var(--muted);
}
.suggest-btn {
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--gold);
  cursor: pointer;
  padding: 0;
}
.suggest-btn:hover { text-decoration: underline; }
.suggest-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Starter chips */
.starter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 24px 12px;
  background: var(--parchment);
}
.starter-chips:empty { display: none; }
.starter-chip {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 8px 16px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 300;
  color: var(--gold);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  line-height: 1.4;
}
.starter-chip:hover {
  border-color: var(--gold);
  background: var(--parchment);
}

/* ─── Journal Page ────────────────────────────────────────────────────────── */
.journal-page {
  max-width: 860px;
  margin: 0 auto;
  padding: 48px 32px 80px;
}
.journal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 40px;
  gap: 16px;
}
.journal-heading {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 600;
  margin-bottom: 4px;
}
.journal-subtitle {
  font-size: 15px;
  color: var(--muted);
  font-style: italic;
}

/* Editor */
.journal-editor {
  margin-bottom: 40px;
  padding: 32px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.journal-editor-date {
  font-size: 14px;
  color: var(--gold);
  font-weight: 400;
  margin-bottom: 20px;
}
.journal-editor-title {
  display: block;
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 16px;
  padding: 0;
}
.journal-editor-title::placeholder { color: var(--muted); font-weight: 400; }
/* Formatting toolbar */
.journal-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.toolbar-btn {
  background: none;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--ink);
  font-size: 14px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
}
.toolbar-btn:hover { background: var(--parchment); border-color: var(--border); }
.toolbar-select {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--ink);
  font-size: 12px;
  font-family: var(--font-body);
  padding: 4px 6px;
  height: 32px;
  cursor: pointer;
}
.toolbar-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 4px;
}
.toolbar-color {
  position: relative;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 4px;
}
.toolbar-color:hover { background: var(--parchment); border-color: var(--border); }
.toolbar-color input[type="color"] {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  top: 0;
  left: 0;
}
.toolbar-color-label {
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
  pointer-events: none;
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-underline-offset: 3px;
}
.toolbar-highlight-icon {
  background: #fff59d;
  padding: 1px 4px;
  border-radius: 2px;
  text-decoration: none;
  color: #3b2f1e;
}

/* Editor body (contenteditable) */
.journal-editor-body {
  display: block;
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 15px;
  color: var(--ink);
  line-height: 1.8;
  min-height: 200px;
  max-height: 70vh;
  overflow-y: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.journal-editor-body:empty::before {
  content: attr(data-placeholder);
  color: var(--muted);
  pointer-events: none;
}
.journal-editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  gap: 12px;
  flex-wrap: wrap;
}
.journal-word-count {
  font-size: 12px;
  color: var(--muted);
}
.journal-editor-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Entry list */
.journal-list { display: flex; flex-direction: column; gap: 1px; }
.journal-entry-item {
  display: flex;
  flex-direction: column;
  padding: 20px 24px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 12px;
  gap: 8px;
}
.journal-entry-date {
  font-size: 13px;
  color: var(--gold);
  min-width: 100px;
  font-weight: 400;
}
.journal-entry-title {
  flex: 1;
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 600;
  min-width: 150px;
}
.journal-entry-words {
  font-size: 12px;
  color: var(--muted);
  min-width: 60px;
  text-align: right;
}
.journal-entry-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}
.journal-entry-actions a,
.journal-entry-actions button {
  font-size: 12px;
  color: var(--gold);
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 12px;
  cursor: pointer;
  text-decoration: none;
  font-family: var(--font-body);
  white-space: nowrap;
}
.journal-entry-actions a:hover,
.journal-entry-actions button:hover { background: var(--parchment); text-decoration: none; }

.journal-entry-actions .btn-danger {
  color: #c0392b;
  border-color: #c0392b;
}
.journal-entry-actions .btn-danger:hover {
  background: #c0392b;
  color: #fff;
}

/* Entry layout with summary */
.journal-entry-top {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  flex-wrap: wrap;
}
.journal-entry-summary {
  width: 100%;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  margin: 4px 0 0;
  font-style: italic;
}
.journal-entry-archived {
  opacity: 0.65;
}

/* Archive toggle */
.journal-archive-toggle {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

/* Empty state */
.journal-empty {
  text-align: center;
  padding: 60px 20px;
}
.journal-empty p {
  font-size: 15px;
  color: var(--muted);
  font-style: italic;
  margin-bottom: 20px;
}

/* ─── Settings Page ───────────────────────────────────────────────────────── */
.settings-page {
  max-width: 680px;
  margin: 0 auto;
  padding: 48px 32px 80px;
}
.settings-header { margin-bottom: 40px; }
.settings-heading {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 600;
  margin-bottom: 4px;
}
.settings-subtitle {
  font-size: 15px;
  color: var(--muted);
  font-style: italic;
}
.settings-section { margin-bottom: 40px; }
.settings-section-title {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 20px;
}

/* Feedback form */
.feedback-description {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 20px;
  line-height: 1.6;
}
.feedback-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.feedback-input,
.feedback-textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
}
.feedback-input:focus,
.feedback-textarea:focus {
  border-color: var(--gold);
}
.feedback-input::placeholder,
.feedback-textarea::placeholder {
  color: var(--muted);
}
.feedback-textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
}
.feedback-footer {
  display: flex;
  align-items: center;
  gap: 16px;
}
.feedback-status {
  font-size: 13px;
  color: var(--gold);
}
.feedback-status.error {
  color: #c0392b;
}

.palette-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.palette-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 16px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.2s;
  font-family: var(--font-body);
}
.palette-card:hover { border-color: var(--gold); }
.palette-card.active { border-color: var(--gold); border-width: 2px; }
.palette-swatch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  width: 64px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(128,128,128,0.2);
}
.swatch-bg, .swatch-parchment, .swatch-ink, .swatch-gold {
  width: 100%;
  height: 100%;
}
.palette-name {
  font-size: 13px;
  font-weight: 400;
  color: var(--ink);
}
.palette-card.active .palette-name { color: var(--gold); font-weight: 700; }

/* ─── Legal Pages ────────────────────────────────────────────────────────── */
.legal-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 32px 80px;
}
.legal-header { margin-bottom: 40px; }
.legal-heading {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 600;
  margin-bottom: 4px;
}
.legal-effective {
  font-size: 14px;
  color: var(--muted);
  font-style: italic;
}
.legal-body h2 {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 600;
  margin-top: 36px;
  margin-bottom: 12px;
}
.legal-body h3 {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 600;
  margin-top: 20px;
  margin-bottom: 8px;
}
.legal-body p {
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 12px;
}
.legal-body ul {
  margin-bottom: 12px;
  padding-left: 24px;
}
.legal-body li {
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 6px;
}
.legal-body a {
  color: var(--gold);
  text-decoration: underline;
}
.legal-body a:hover {
  opacity: 0.8;
}
.site-footer-links {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}
.site-footer-links a {
  color: var(--muted);
  text-decoration: underline;
  margin: 0 6px;
}

/* ─── Footer ──────────────────────────────────────────────────────────────── */
.site-footer {
  text-align: center;
  padding: 24px 32px;
  border-top: 1px solid var(--border);
}
.site-footer p {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}
.site-footer a { font-size: 12px; }
.site-footer--chat { flex-shrink: 0; }
.site-footer-copyright {
  margin-top: 0.75rem;
  font-size: 0.75rem;
  opacity: 0.6;
}

/* ─── Mobile ──────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .mentor-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  /* Nav */
  .nav-hamburger { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 16px 32px;
    gap: 16px;
  }
  .nav-links.open { display: flex; }

  /* Hero */
  .hero { padding: 48px 20px 32px; }
  .hero-quote { font-size: 18px; }

  /* Grid */
  .mentor-grid { grid-template-columns: 1fr; }
  .mentor-grid-section { padding: 0 20px 48px; }

  /* Chat */
  .chat-sidebar {
    display: none;
    position: fixed;
    top: 57px;
    left: 0;
    bottom: 0;
    z-index: 90;
    width: 300px;
    box-shadow: 4px 0 16px rgba(0,0,0,0.1);
  }
  .chat-sidebar.open { display: block; }
  .chat-sidebar.open .sidebar-close { display: block; }
  .chat-sidebar-toggle { display: flex; }
  .chat-messages { padding: 16px; }
  .chat-input-area { padding: 12px 16px; }

  /* Legal */
  .legal-page { padding: 32px 20px 60px; }

  /* Settings */
  .settings-page { padding: 32px 20px 60px; }
  .palette-grid { grid-template-columns: repeat(2, 1fr); }

  /* Journal */
  .journal-page { padding: 32px 20px 60px; }
  .journal-header { flex-direction: column; }
  .journal-editor { padding: 20px; }
  .journal-editor-actions { flex-direction: column; }
  .journal-editor-actions .btn { width: 100%; text-align: center; }
  .journal-entry-top { flex-direction: column; align-items: flex-start; }
  .journal-entry-actions { margin-top: 4px; flex-wrap: wrap; }
}

@media (max-width: 480px) {
  .hero-ctas { flex-direction: column; }
  .hero-ctas .btn { width: 100%; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  body::before { display: none; }
}

@media print {
  .top-nav, .chat-input-area, .chat-sidebar, .starter-chips { display: none; }
  .chat-messages { width: 100%; max-width: 100%; }
}
