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

:root {
  --app-height: 100dvh;

  --bg: #0e0d0a;
  --surface: #161410;
  --surface2: #1e1c16;
  --surface3: #27241a;
  --border: rgba(237,232,216,0.055);
  --border2: rgba(237,232,216,0.11);
  --text: #ede8d8;
  --muted: #78745f;
  --muted2: #48463a;
  --accent: #d1d5db;
  --accent2: #f3f4f6;
  --accent-dim: rgba(209,213,219,0.07);
  --accent-glow: rgba(209,213,219,0.18);
  --ai-bubble: #141310;
  --red: #ff6b6b;
  --sidebar-w: 254px;
  --rail-w: 46px;
  --font-display: 'Bricolage Grotesque', sans-serif;
  --font-body: 'Instrument Sans', sans-serif;
}

@supports not (height: 100dvh) {
  :root { --app-height: 100vh; }
}

html { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  display: flex;
  height: var(--app-height);
  position: relative;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: touch;
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

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

/* ── AMBIENT BG CANVAS ── */
#ambient-canvas {
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none; opacity: 0.55;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted2); }

/* ══════════════════════════════════
   SIDEBAR
══════════════════════════════════ */
#sidebar-wrap {
  position: relative; height: var(--app-height); flex-shrink: 0;
  display: flex; z-index: 10;
  transition: opacity 0.3s ease;
}
#sidebar-wrap.hidden-on-landing {
  display: none !important;
}

#sidebar {
  width: var(--sidebar-w);
  background: rgba(14,13,10,0.97);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  height: var(--app-height); overflow: hidden;
  transition: width 0.32s cubic-bezier(.4,0,.2,1), opacity 0.22s;
}
@supports (backdrop-filter: blur(1px)) {
  #sidebar { background: rgba(14,13,10,0.92); backdrop-filter: blur(16px); }
}
#sidebar.collapsed { width: 0; opacity: 0; pointer-events: none; }

#rail {
  width: var(--rail-w);
  background: rgba(14,13,10,0.97);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  align-items: center; padding: 0.8rem 0; gap: 2px;
  height: var(--app-height); flex-shrink: 0;
  opacity: 0; pointer-events: none;
  transition: opacity 0.22s;
}
@supports (backdrop-filter: blur(1px)) {
  #rail { background: rgba(14,13,10,0.92); backdrop-filter: blur(16px); }
}
#rail.visible { opacity: 1; pointer-events: all; }

.rail-btn {
  width: 32px; height: 32px; border-radius: 8px;
  background: none; border: none; color: var(--muted);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 14px; transition: background 0.15s, color 0.15s;
}
.rail-btn:hover { background: var(--surface2); color: var(--text); }
.rail-spacer { flex: 1; }
.rail-accent:hover { color: var(--accent); }

.sb-header {
  padding: 1rem 0.9rem 0.75rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.sb-logo {
  font-family: var(--font-display); font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.2em; color: var(--muted); text-transform: uppercase; flex: 1;
}
.sb-icon-btn {
  width: auto; height: auto; min-width: 26px; min-height: 26px; padding: 9px; background: none;
  border: 1px solid var(--border2); border-radius: 6px;
  color: var(--muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; transition: all 0.14s; flex-shrink: 0;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.sb-icon-btn:hover { border-color: var(--accent); color: var(--accent2); }

#sb-profile-mini {
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; transition: background 0.14s; flex-shrink: 0;
}
#sb-profile-mini:hover { background: var(--surface2); }

.profile-pic-mini {
  width: 34px; height: 34px; border-radius: 8px;
  background: var(--surface2); border: 1px solid var(--border2);
  overflow: hidden; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 16px;
  transition: filter 0.5s ease;
}
.profile-pic-mini img { width: 100%; height: 100%; object-fit: cover; }
.profile-mini-info { flex: 1; min-width: 0; }
.profile-mini-name {
  font-family: var(--font-display); font-size: 0.82rem; font-weight: 600;
  color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.profile-mini-sub { font-size: 0.68rem; color: var(--muted); }

.sb-section-label {
  padding: 0.6rem 0.9rem 0.2rem;
  font-size: 0.6rem; letter-spacing: 0.16em; color: var(--muted2);
  text-transform: uppercase; font-family: var(--font-display); flex-shrink: 0;
}

#history-list { flex: 1; overflow-y: auto; padding: 0.2rem 0.4rem 0.4rem; }

.history-item {
  padding: 0.5rem 0.65rem; border-radius: 7px;
  cursor: pointer; transition: background 0.12s; margin-bottom: 1px;
  display: flex; align-items: center; gap: 5px;
}
.history-item:hover { background: var(--surface2); }
.history-item.active { background: var(--accent-dim); border: 1px solid rgba(209,213,219,0.15); }
.history-item-text { flex: 1; min-width: 0; }
.history-item-title { font-size: 0.79rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-item-meta { font-size: 0.66rem; color: var(--muted); }

.delete-btn {
  width: auto; height: auto; padding: 12px; border-radius: 5px;
  background: none; border: none; color: var(--muted2); cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 10px;
  opacity: 0; transition: all 0.13s; flex-shrink: 0;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.history-item:hover .delete-btn { opacity: 1; }
.delete-btn:hover { background: rgba(255,107,107,0.12); color: var(--red); }

.new-chat-btn-sb {
  margin: 0.5rem 0.5rem 0.4rem;
  padding: 0.55rem; background: var(--accent-dim);
  border: 1px solid rgba(209,213,219,0.18); border-radius: 8px;
  color: var(--accent2); font-family: var(--font-display);
  font-size: 0.74rem; font-weight: 600; cursor: pointer;
  transition: all 0.14s; text-align: center; flex-shrink: 0; letter-spacing: 0.02em;
}
.new-chat-btn-sb:hover { background: rgba(209,213,219,0.14); }

/* ══════════════════════════════════
   MAIN
══════════════════════════════════ */
#main {
  flex: 1; display: flex; flex-direction: column;
  height: var(--app-height); overflow: hidden; position: relative; min-width: 0; z-index: 1;
}

/* ══════════════════════════════════
   LANDING — Anti-SaaS, raw
══════════════════════════════════ */
#landing {
  position: absolute; inset: 0; z-index: 20;
  display: flex; flex-direction: column;
  align-items: flex-start; justify-content: center;
  padding: 0 clamp(2rem, 8vw, 7rem);
  background: transparent;
}

.land-eyebrow {
  font-family: var(--font-display); font-size: 0.68rem; font-weight: 400;
  letter-spacing: 0.22em; color: var(--muted); text-transform: uppercase;
  margin-bottom: 1.5rem;
  opacity: 0; animation: riseIn 0.6s ease 0.1s forwards;
}

.land-title {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(3.2rem, 9vw, 7rem); line-height: 0.96;
  letter-spacing: -0.04em; color: var(--text);
  margin-bottom: 1.75rem; max-width: 14ch;
  filter: url(#ink);
  opacity: 0; animation: riseIn 0.7s ease 0.2s forwards;
}
.land-title em {
  font-style: normal; color: var(--accent);
  display: block; margin-left: -0.05em; /* intentional overflow */
}

.land-sub {
  font-size: clamp(0.88rem, 2vw, 1rem); color: var(--muted);
  max-width: 36ch; line-height: 1.75; margin-bottom: 2.5rem;
  font-weight: 400; font-style: italic;
  opacity: 0; animation: riseIn 0.7s ease 0.38s forwards;
}

.land-input-wrap {
  display: flex; flex-direction: column; gap: 0;
  width: 100%; max-width: 340px;
  opacity: 0; animation: riseIn 0.7s ease 0.52s forwards;
}

.land-input-label {
  font-family: var(--font-display); font-size: 0.62rem;
  letter-spacing: 0.16em; color: var(--muted2);
  text-transform: uppercase; margin-bottom: 0.65rem;
}

.land-input {
  width: 100%; background: transparent;
  border: none; border-bottom: 1px solid var(--border2);
  padding: 0.5rem 0; font-family: var(--font-display); font-size: 1.35rem;
  font-weight: 500; color: var(--text); outline: none;
  transition: border-color 0.2s; caret-color: var(--accent);
}
.land-input::placeholder { color: var(--muted2); font-style: italic; font-weight: 300; }
.land-input:focus { border-bottom-color: var(--accent); }

.land-btn {
  margin-top: 1.5rem; background: none; border: none; padding: 0;
  font-family: var(--font-display); font-size: 0.85rem; font-weight: 700;
  color: var(--accent); cursor: pointer; letter-spacing: 0.06em;
  text-transform: uppercase; width: fit-content;
  display: flex; align-items: center; gap: 8px;
  transition: gap 0.2s, opacity 0.2s;
}
.land-btn:hover { gap: 14px; }
.land-btn:disabled { opacity: 0.35; cursor: not-allowed; gap: 8px; }
.land-btn-arrow { transition: transform 0.2s; }
.land-btn:hover .land-btn-arrow { transform: translateX(4px); }

.land-trust {
  margin-top: 2rem; font-size: 0.7rem; color: var(--muted2);
  max-width: 30ch; line-height: 1.65; font-style: italic;
  opacity: 0; animation: riseIn 0.7s ease 0.68s forwards;
}

/* ══════════════════════════════════
   CHAT
══════════════════════════════════ */
#chat-screen {
  display: none; flex-direction: column; flex: 1; height: var(--app-height); overflow: hidden;
  position: relative;
}

.chat-header {
  background: rgba(14,13,10,0.97);
  border-bottom: 1px solid var(--border);
  padding: max(0.75rem, env(safe-area-inset-top)) max(1.25rem, env(safe-area-inset-right)) 0.75rem max(1.25rem, env(safe-area-inset-left));
  display: flex; align-items: center;
  gap: 10px; flex-shrink: 0; position: relative; z-index: 20; min-height: 56px;
}
@supports (backdrop-filter: blur(1px)) {
  .chat-header { background: rgba(14,13,10,0.88); backdrop-filter: blur(14px); }
}

.mobile-sidebar-btn {
  display: none; width: 44px; height: 44px; border-radius: 10px;
  background: none; border: 1px solid var(--border2); color: var(--muted);
  cursor: pointer; align-items: center; justify-content: center; font-size: 15px;
  transition: all 0.14s; flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.mobile-sidebar-btn:hover { border-color: var(--accent); color: var(--accent2); }

.atman-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); display: flex; align-items: center;
  justify-content: center; font-size: 13px; flex-shrink: 0;
  position: relative; color: var(--bg); font-weight: 800;
  font-family: var(--font-display);
}
.atman-avatar::after {
  content: ''; position: absolute; inset: -3px;
  border-radius: 50%; border: 1px solid rgba(209,213,219,0.3);
  animation: breathe 3s ease infinite;
}

@keyframes breathe {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.08); }
}

.atman-name { font-family: var(--font-display); font-weight: 700; font-size: 0.88rem; }
.atman-status {
  font-size: 0.67rem; color: var(--muted);
  font-family: var(--font-display); letter-spacing: 0.03em;
  transition: color 0.3s;
}
.atman-status.thinking { color: var(--accent); animation: pulse-text 1.4s ease infinite; }

@keyframes pulse-text {
  0%, 100% { opacity: 0.6; } 50% { opacity: 1; }
}

.header-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.memory-pill {
  font-size: 0.65rem; color: var(--accent); background: var(--accent-dim);
  border: 1px solid rgba(209,213,219,0.2); border-radius: 20px;
  padding: 3px 9px; display: none; align-items: center; gap: 4px;
  font-family: var(--font-display); font-weight: 600; letter-spacing: 0.04em;
}
.memory-pulse {
  width: 5px; height: 5px; border-radius: 50%; background: var(--accent);
  animation: pulse-dot 2.4s ease infinite;
}
@keyframes pulse-dot { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }

/* Message area with spatial canvas */
.chat-canvas-wrap {
  flex: 1; min-height: 0; position: relative; overflow: hidden;
}
#connection-canvas {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
}

.messages {
  position: relative; z-index: 1;
  height: 100%; padding: 1.25rem 1.25rem 0.5rem;
  display: flex; flex-direction: column; gap: 0.85rem;
  overflow-y: auto; scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.msg { display: flex; gap: 9px; max-width: 80%; animation: msgRise 0.22s ease; }
.msg.ai { align-self: flex-start; }
.msg.kid { align-self: flex-end; flex-direction: row-reverse; }

.msg-avatar {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent); color: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 800; flex-shrink: 0; margin-top: 4px;
  font-family: var(--font-display);
}
.msg-avatar.kid-av { background: var(--surface3); color: var(--text); }
.msg-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* Organic, asymmetric bubbles */
.bubble {
  padding: 0.7rem 1rem; font-size: 0.91rem; line-height: 1.7;
  color: var(--text); word-break: break-word;
}
.msg.ai .bubble {
  background: var(--ai-bubble);
  border: 1px solid var(--border);
  border-radius: 3px 16px 16px 16px; /* asymmetric — organic */
}
.msg.kid .bubble {
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 16px 3px 16px 16px; /* asymmetric — organic */
  color: var(--text);
}

/* Memory anchor — session bridge messages */
.msg.memory-anchor .bubble {
  background: var(--accent-dim);
  border-color: rgba(209,213,219,0.2);
  border-style: dashed;
}

.system-msg {
  align-self: center; font-size: 0.68rem; color: var(--muted2);
  font-family: var(--font-display); letter-spacing: 0.08em;
  border: none; padding: 3px 0;
  animation: msgRise 0.22s ease;
}

.typing-indicator {
  display: flex; gap: 5px; padding: 0.7rem 1rem;
  background: var(--ai-bubble); border: 1px solid var(--border);
  border-radius: 3px 16px 16px 16px; width: fit-content; align-items: center;
}
.typing-dot {
  width: 5px; height: 5px; border-radius: 50%; background: var(--muted);
  animation: typeBounce 1.2s ease infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.18s; }
.typing-dot:nth-child(3) { animation-delay: 0.36s; }

/* Input area */
.chat-input-area {
  background: rgba(14,13,10,0.99);
  border-top: 1px solid var(--border);
  padding: 0.85rem max(1.25rem, env(safe-area-inset-right)) max(0.85rem, env(safe-area-inset-bottom)) max(1.25rem, env(safe-area-inset-left));
  display: flex; gap: 9px;
  align-items: flex-end; flex-shrink: 0; position: relative; z-index: 20;
  transition: background 0.3s;
}
@supports (backdrop-filter: blur(1px)) {
  .chat-input-area { background: rgba(14,13,10,0.9); backdrop-filter: blur(14px); }
}
.chat-input-area.focused { background: rgba(14,13,10,0.97); }

#msg-input {
  flex: 1; background: transparent; border: none;
  border-bottom: 1px solid var(--border2);
  padding: 0.5rem 0; font-family: var(--font-body);
  font-size: 16px; color: var(--text); resize: none;
  outline: none; min-height: 38px; max-height: 120px;
  transition: border-color 0.2s; line-height: 1.6;
  caret-color: var(--accent);
}
#msg-input::placeholder { color: var(--muted2); font-style: italic; }
#msg-input:focus { border-bottom-color: var(--accent); }

.send-btn {
  width: auto; height: auto; min-width: 44px; min-height: 44px; border-radius: 9px;
  background: var(--accent); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.14s, opacity 0.2s; flex-shrink: 0; color: var(--bg);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.send-btn:hover { transform: translateY(-1px); }
.send-btn:active { transform: scale(0.94); }
.send-btn:disabled { opacity: 0.3; cursor: not-allowed; transform: none; }
.send-btn svg { width: 15px; height: 15px; fill: var(--bg); }

/* ══════════════════════════════════
   BRAIN SNAPSHOT — Generative
══════════════════════════════════ */
#snapshot-screen {
  display: none; flex-direction: column; flex: 1;
  height: var(--app-height); overflow-y: auto; position: relative;
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
}

.snapshot-hero {
  position: relative; display: flex; flex-direction: column;
  align-items: center; padding: 2.5rem 1.5rem 1.5rem;
  overflow: hidden;
}

#brain-canvas-wrap {
  width: 260px; height: 260px; position: relative; cursor: pointer;
  margin-bottom: 1.5rem;
}
#brain-viz-canvas {
  width: 100%; height: 100%; border-radius: 50%;
  border: 1px solid rgba(209,213,219,0.15);
}
.brain-canvas-hint {
  position: absolute; bottom: -28px; left: 50%; transform: translateX(-50%);
  font-size: 0.62rem; color: var(--muted); white-space: nowrap;
  font-family: var(--font-display); letter-spacing: 0.1em;
}

.snapshot-name {
  font-family: var(--font-display); font-size: 2rem; font-weight: 800;
  letter-spacing: -0.03em; filter: url(#ink); margin-bottom: 0.3rem;
  text-align: center;
}
.snapshot-type-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent-dim); border: 1px solid rgba(209,213,219,0.2);
  border-radius: 20px; padding: 4px 14px;
  font-family: var(--font-display); font-size: 0.8rem; font-weight: 700;
  color: var(--accent2); margin-bottom: 1.5rem; letter-spacing: 0.04em;
}

.snapshot-body { padding: 0 1.5rem; display: flex; flex-direction: column; gap: 1rem; }

.snap-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 3px 14px 14px 14px; /* asymmetric like bubbles */
  padding: 1.15rem;
  transition: border-color 0.2s;
}
.snap-card:hover { border-color: var(--border2); }
.snap-card-label {
  font-family: var(--font-display); font-size: 0.6rem; letter-spacing: 0.16em;
  color: var(--muted); text-transform: uppercase; margin-bottom: 0.6rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.snap-card-text { font-size: 0.9rem; line-height: 1.78; color: var(--text); }

.trait-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 0.85rem; }
.pill {
  padding: 0.26rem 0.75rem; border-radius: 3px; font-size: 0.76rem;
  font-weight: 500; border: 1px solid var(--border2);
  color: var(--muted); background: var(--surface2);
  font-family: var(--font-display); letter-spacing: 0.02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.pill.hi { border-color: rgba(209,213,219,0.3); color: var(--accent2); background: var(--accent-dim); }

.direction-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 0.75rem; }
.direction-item {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 10px; padding: 0.85rem;
}
.direction-icon { font-size: 1.1rem; margin-bottom: 0.3rem; }
.direction-title { font-family: var(--font-display); font-size: 0.79rem; font-weight: 600; margin-bottom: 0.18rem; }
.direction-desc { font-size: 0.74rem; color: var(--muted); line-height: 1.5; }

.snap-actions { display: flex; gap: 9px; padding: 1rem 1.5rem 2rem; }
.snap-btn {
  flex: 1; border-radius: 8px; padding: 0.78rem;
  font-family: var(--font-display); font-size: 0.8rem; font-weight: 700;
  cursor: pointer; transition: all 0.16s; letter-spacing: 0.04em;
}
.snap-btn.pri { background: var(--accent); color: var(--bg); border: none; }
.snap-btn.pri:hover { opacity: 0.9; }
.snap-btn.sec { background: transparent; border: 1px solid var(--border2); color: var(--muted); }
.snap-btn.sec:hover { border-color: var(--accent); color: var(--accent2); }

.snap-loading { text-align: center; padding: 5rem 2rem; color: var(--muted); }
.spinner {
  width: 24px; height: 24px; border: 2px solid var(--border2);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin 0.8s linear infinite; margin: 0 auto 1rem;
}

.overlay-panel {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 30;
  background: var(--bg);
  flex-direction: column;
  overflow: hidden;
}

.panel-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(14,13,10,0.92);
}
@supports (backdrop-filter: blur(1px)) {
  .panel-header { backdrop-filter: blur(12px); }
}

.panel-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1.5rem 1.25rem;
}

.panel-title {
  font-family: var(--font-display); font-weight: 700; font-size: 0.95rem; flex: 1;
}

.back-btn {
  width: auto; height: auto; min-width: 44px; min-height: 44px; border-radius: 7px;
  background: none; border: 1px solid var(--border2); color: var(--muted);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 13px; transition: all 0.14s;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.back-btn:hover { border-color: var(--accent); color: var(--accent2); }

.profile-pic-section { display: flex; flex-direction: column; align-items: center; gap: 0.9rem; }
.profile-pic-large {
  width: 96px; height: 96px; border-radius: 20px;
  border: 1px solid var(--border2); overflow: hidden;
  background: var(--surface2); cursor: pointer; position: relative;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.2s, filter 0.5s ease;
}
.profile-pic-large:hover { border-color: var(--accent); }
.profile-pic-large img { width: 100%; height: 100%; object-fit: cover; }
.pic-overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,0.55);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; opacity: 0; transition: opacity 0.2s;
  font-size: 0.62rem; color: white; font-family: var(--font-display); font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.profile-pic-large:hover .pic-overlay { opacity: 1; }
.pic-placeholder { font-size: 2.2rem; }
.pic-hint { font-size: 0.7rem; color: var(--muted); text-align: center; max-width: 220px; line-height: 1.6; }
.pic-change-nudge { font-size: 0.67rem; color: var(--accent); display: none; font-family: var(--font-display); font-weight: 600; }

/* ══════════════════════════════════
   NEW PROFILE LAYOUT (DECLUTTERED)
══════════════════════════════════ */
.profile-container {
  max-width: 650px;
  margin: 0 auto;
  padding-bottom: 2rem;
}

.profile-header-flex {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 3rem;
  margin-top: 1rem;
}

.profile-header-text h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--text);
  margin: 0 0 0.25rem 0;
}

.pf-section-label {
  font-family: var(--font-display); font-size: 0.65rem; letter-spacing: 0.12em;
  color: var(--muted2); text-transform: uppercase; margin-bottom: 0.8rem;
  font-weight: 600;
}
.pf-fields { 
  display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1rem;
}
.pf-field { 
  display: flex; align-items: center; gap: 1rem;
}
.pf-label { 
  flex: 0 0 140px; font-size: 0.75rem; color: var(--text); font-family: var(--font-body);
}
.pf-input, .pf-select {
  flex: 1;
  background: var(--surface2); border: 1px solid transparent; border-radius: 6px;
  padding: 0.65rem 0.85rem; font-family: var(--font-body); font-size: 0.82rem;
  color: var(--text); outline: none; transition: border-color 0.2s, background 0.2s; width: 100%;
}
.pf-input::placeholder { color: var(--muted2); font-style: italic; }
.pf-input:focus, .pf-select:focus { border-color: rgba(255, 255, 255, 0.1); background: var(--surface3); }

.pf-select {
  cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2378745f'%3E%3Cpath d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.75rem center; background-size: 14px;
}
.pf-select option { background: var(--surface2); }

.pf-save-btn {
  width: 100%; background: var(--surface2); color: var(--text); border: 1px solid var(--border);
  border-radius: 6px; padding: 0.75rem; font-family: var(--font-body);
  font-size: 0.82rem; font-weight: 500; cursor: pointer; transition: all 0.2s;
  display: flex; align-items: center; justify-content: center; margin-top: 0.5rem;
}
.pf-save-btn:hover { background: var(--surface3); border-color: rgba(255,255,255,0.15); }
.pf-save-hint { font-size: 0.65rem; color: var(--muted2); text-align: center; margin-top: 0.5rem; }

/* Preferences & Settings Box */
.pf-preferences-box {
  background: var(--surface2); border: 1px solid var(--border); border-radius: 8px;
  padding: 1rem; display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem;
}
.pf-pref-title { font-size: 0.82rem; color: var(--text); font-weight: 500; }
.pf-pref-desc { font-size: 0.7rem; color: var(--muted); margin-top: 4px; }

/* Toggle Switch */
.toggle-switch { position: relative; width: 40px; height: 22px; flex-shrink: 0; cursor: pointer; }
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-track { position: absolute; inset: 0; border-radius: 11px; background: var(--surface3); transition: background 0.2s; }
.toggle-thumb { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: all 0.2s; }
.toggle-switch input:checked + .toggle-track { background: var(--text); }
.toggle-switch input:checked + .toggle-track .toggle-thumb { background: var(--bg); transform: translateX(18px); }

/* Settings List (iOS Style) */
.settings-list {
  display: flex; flex-direction: column;
  background: var(--surface2); border-radius: 8px;
  border: 1px solid var(--border);
  overflow: hidden;
}
.settings-item {
  display: flex; align-items: center; width: 100%; text-align: left;
  background: transparent; border: none; padding: 1rem;
  border-bottom: 1px solid var(--border); cursor: pointer;
  transition: background 0.2s; gap: 1rem;
}
.settings-item:last-child { border-bottom: none; }
.settings-item:hover { background: var(--surface3); }
.si-icon { width: 20px; color: var(--muted); display: flex; align-items: center; justify-content: center; }
.si-text { flex: 1; }
.si-title { font-size: 0.82rem; color: var(--text); font-weight: 500; display: flex; align-items: center; gap: 8px; }
.si-desc { font-size: 0.7rem; color: var(--muted); margin-top: 4px; }
.si-chevron { font-size: 1.2rem; color: var(--muted2); font-weight: 300; }
.si-tag { font-size: 0.55rem; background: var(--surface3); padding: 2px 6px; border-radius: 4px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }

.settings-item.danger .si-icon { color: var(--red); }
.settings-item.danger .si-title { color: var(--red); }
.settings-item.danger .si-chevron { color: var(--red); }


/* ══════════════════════════════════
   CANVAS PANEL — Physics brush
══════════════════════════════════ */
#canvas-panel {
  position: absolute; inset: 0; z-index: 1100;
  background: var(--bg); display: none; flex-direction: column;
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
}
.canvas-header {
  display: flex; align-items: center; gap: 12px;
  padding: 0.85rem 1.25rem; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.canvas-title { font-family: var(--font-display); font-weight: 700; font-size: 0.9rem; flex: 1; }
.canvas-tools {
  padding: 0.65rem 1rem; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap; flex-shrink: 0;
}
.tool-group { display: flex; align-items: center; gap: 5px; }
.tool-label { font-size: 0.62rem; color: var(--muted2); font-family: var(--font-display); letter-spacing: 0.1em; text-transform: uppercase; }
.tool-btn {
  width: auto; height: auto; min-width: 44px; min-height: 44px; border-radius: 6px; border: 1px solid var(--border2);
  background: var(--surface2); color: var(--muted); cursor: pointer; padding: 6px;
  display: flex; align-items: center; justify-content: center; font-size: 12px;
  transition: all 0.13s;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.tool-btn:hover, .tool-btn.active { border-color: var(--accent); color: var(--accent2); background: var(--accent-dim); }
.size-slider {
  -webkit-appearance: none; width: 76px; height: 2px;
  background: var(--surface3); border-radius: 1px; outline: none; cursor: pointer;
}
.size-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent); cursor: pointer;
}
.color-picker-wrap { position: relative; }
.color-preview {
  width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--border2);
  cursor: pointer; transition: border-color 0.13s;
}
.color-preview:hover { border-color: var(--accent); }
#color-input { position: absolute; opacity: 0; width: 0; height: 0; }
.swatch {
  width: 16px; height: 16px; border-radius: 50%; cursor: pointer;
  border: 1px solid rgba(237,232,216,0.12); transition: transform 0.1s; flex-shrink: 0;
}
.swatch:hover { transform: scale(1.25); }
.canvas-wrap {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 1rem; overflow: hidden; background: var(--surface);
}
#draw-canvas {
  border-radius: 14px; cursor: crosshair; touch-action: none;
  box-shadow: 0 0 0 1px var(--border); background: #141310;
}
.canvas-actions {
  padding: 0.8rem 1.25rem; border-top: 1px solid var(--border);
  display: flex; gap: 9px; flex-shrink: 0;
}
.canvas-save-btn {
  flex: 1; background: var(--accent); color: var(--bg); border: none;
  border-radius: 9px; padding: 0.72rem; font-family: var(--font-display);
  font-size: 0.82rem; font-weight: 700; cursor: pointer; transition: opacity 0.16s;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.canvas-save-btn:hover { opacity: 0.88; }
.canvas-clear-btn {
  width: 75px; background: transparent; border: 1px solid var(--border2);
  border-radius: 9px; padding: 0.72rem; font-family: var(--font-display);
  font-size: 0.78rem; color: var(--muted); cursor: pointer; transition: all 0.16s;
}
.canvas-clear-btn:hover { border-color: var(--red); color: var(--red); }

/* ══════════════════════════════════
   REPORT + HISTORY VIEW
══════════════════════════════════ */
#report-panel, #history-view {
  position: absolute; inset: 0; z-index: 35;
  background: var(--bg); display: none; flex-direction: column; overflow-y: auto;
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
}
.rp-header {
  display: flex; align-items: center; gap: 12px;
  padding: 0.9rem 1.25rem; border-bottom: 1px solid var(--border); flex-shrink: 0;
  background: rgba(14,13,10,0.92); backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 2;
}
.rp-title { font-family: var(--font-display); font-weight: 700; font-size: 0.95rem; flex: 1; }
.rp-body { padding: 1.5rem 1.25rem; display: flex; flex-direction: column; gap: 1.1rem; padding-bottom: 3rem; }
.rp-section { background: var(--surface); border: 1px solid var(--border); border-radius: 3px 13px 13px 13px; padding: 1.1rem; }
.rp-section-title { font-family: var(--font-display); font-size: 0.6rem; letter-spacing: 0.14em; color: var(--accent2); text-transform: uppercase; margin-bottom: 0.65rem; }
.rp-text { font-size: 0.88rem; line-height: 1.78; }
.rp-moment { background: var(--surface2); border-radius: 9px; padding: 0.72rem; margin-bottom: 0.55rem; }
.rp-moment-date { font-size: 0.62rem; color: var(--muted); margin-bottom: 0.2rem; font-family: var(--font-display); }
.rp-moment-text { font-size: 0.84rem; line-height: 1.6; }
.hv-back-btn {
  background: transparent; border: 1px solid var(--border2); border-radius: 8px;
  padding: 0.65rem 1.2rem; font-family: var(--font-display); font-size: 0.78rem;
  color: var(--muted); cursor: pointer; transition: all 0.16s; margin-top: 1rem;
}
.hv-back-btn:hover { border-color: var(--accent); color: var(--accent2); }
.hv-who { font-weight: 600; margin-right: 5px; }
.hv-who.atman-who { color: var(--accent2); }
.hv-who.kid-who { color: var(--text); }
.hv-msg { font-size: 0.84rem; line-height: 1.65; margin-bottom: 0.65rem; display: flex; gap: 5px; }

/* ══════════════════════════════════
   CONFIRM DIALOG
══════════════════════════════════ */
#confirm-dialog {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.65); backdrop-filter: blur(6px);
  display: none; align-items: center; justify-content: center; padding: 1rem;
}
.confirm-box {
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: 3px 16px 16px 16px; padding: 1.5rem; max-width: 308px; width: 100%;
  animation: riseIn 0.2s ease;
}
.confirm-title { font-family: var(--font-display); font-weight: 700; font-size: 0.97rem; margin-bottom: 0.55rem; }
.confirm-sub { font-size: 0.81rem; color: var(--muted); line-height: 1.65; margin-bottom: 1.2rem; }
.confirm-btns { display: flex; gap: 8px; }
.confirm-btn {
  flex: 1; border-radius: 8px; padding: 0.65rem;
  font-family: var(--font-display); font-size: 0.79rem; font-weight: 700; cursor: pointer; transition: all 0.14s;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.confirm-btn.danger { background: rgba(255,107,107,0.12); border: 1px solid rgba(255,107,107,0.28); color: var(--red); }
.confirm-btn.danger:hover { background: rgba(255,107,107,0.22); }
.confirm-btn.cancel { background: transparent; border: 1px solid var(--border2); color: var(--muted); }

/* ══════════════════════════════════
   MOBILE
══════════════════════════════════ */
@media (max-width: 640px) {
  #rail { display: none !important; }
  #sidebar-wrap { width: 0 !important; min-width: 0 !important; overflow: visible; }
  #sidebar {
    position: fixed; inset: 0; z-index: 60;
    width: 100% !important; min-width: 100% !important;
    transform: translateX(-100%);
    transition: transform 0.26s cubic-bezier(.4,0,.2,1);
    opacity: 1 !important; pointer-events: all !important;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }
  #sidebar.mobile-open { transform: translateX(0); }
  #sidebar.collapsed { transform: translateX(-100%); }
  .mobile-sidebar-btn { display: flex !important; }
  .mobile-backdrop { display: none !important; }
  .sb-mobile-close { display: flex !important; }
  .new-chat-btn-sb { margin-bottom: max(0.4rem, env(safe-area-inset-bottom)); }
}

@media (min-width: 641px) {
  #msg-input { font-size: 0.92rem; }
}

/* ══════════════════════════════════
   ANIMATIONS
══════════════════════════════════ */
@keyframes riseIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes msgRise { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes typeBounce { 0%,60%,100% { transform: translateY(0); opacity: 0.4; } 30% { transform: translateY(-4px); opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes dissolveOut { 0% { opacity:1; filter:blur(0); transform:scale(1); } 100% { opacity:0; filter:blur(6px); transform:scale(0.96); } }

.octo-body { fill: #0e0d0a; stroke: #d1d5db; stroke-width: 1.5; }
          .octo-glow { fill: url(#bioglow); animation: pulseCore 4s infinite alternate; }
          .octo-arms { transform-origin: 50% 50%; animation: spinArms 48s linear infinite; }
          .octo-eye { fill: #d1d5db; animation: blinkEye 3.2s infinite; }
          @keyframes pulseCore { from { opacity: 0.4; transform: scale(0.9); } to { opacity: 0.9; transform: scale(1.1); } }
          @keyframes spinArms { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
          @keyframes blinkEye { 0%, 96% { transform: scaleY(1); } 98% { transform: scaleY(0.1); } 100% { transform: scaleY(1); } }

/* ══════════════════════════════════
   REPORT V2 REDESIGN STYLES
══════════════════════════════════ */
.rp-hero {
  position: relative;
  display: flex; flex-direction: column;
  padding: 2rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
@media (min-width: 641px) {
  .rp-hero { flex-direction: row; align-items: center; justify-content: space-between; padding: 3rem 2rem; }
}
.rp-hero-text { flex: 1; z-index: 2; display: flex; flex-direction: column; justify-content: center; }
.rp-hero-title-label {
  font-family: var(--font-display); font-size: 0.65rem; letter-spacing: 0.16em;
  color: var(--muted); text-transform: uppercase; margin-bottom: 0.5rem;
}
.rp-hero-title {
  font-family: var(--font-display); font-size: clamp(1.8rem, 5vw, 2.5rem); font-weight: 700;
  color: var(--accent2); filter: url(#ink-strong); line-height: 1.1; margin-bottom: 1rem;
}
.rp-hero-desc { font-size: 0.95rem; line-height: 1.6; color: var(--text); max-width: 400px; }
.rp-hero-canvas-wrap {
  width: 100%; display: flex; justify-content: center; align-items: center; margin-top: 1.5rem;
}
@media (min-width: 641px) {
  .rp-hero-canvas-wrap { width: 560px; height: 280px; margin-top: 0; justify-content: flex-end; }
}

.rp-section-box {
  padding: 2rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.rp-section-box:last-child { border-bottom: none; }
.rp-label {
  font-family: var(--font-display); font-size: 0.65rem; letter-spacing: 0.16em;
  color: var(--muted2); text-transform: uppercase; margin-bottom: 1.25rem;
}
.rp-desc { font-size: 0.9rem; color: var(--text); line-height: 1.6; margin-top: 1.25rem; }

/* Constellation */
.constellation-wrap { width: 100%; display: flex; justify-content: center; }
.mobile-word-cloud { display: flex; flex-wrap: wrap; justify-content: center; padding: 1rem 0; }

/* Strengths */
.strength-row { margin-bottom: 1.5rem; }
.strength-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 0.5rem; }
.strength-keyword { font-family: var(--font-display); font-weight: 600; font-size: 0.95rem; color: var(--text); text-transform: capitalize; }
.strength-intensity { font-size: 0.75rem; color: var(--muted); }
.strength-canvas-wrap { width: 100%; height: 60px; }

/* Pulse */
.pulse-wrap { width: 100%; height: 100px; margin-bottom: 1rem; }
.pulse-card {
  border-left: 2px solid var(--accent);
  background: var(--surface2); padding: 1rem; margin-bottom: 0.75rem;
  border-radius: 0 8px 8px 0;
}
.pulse-card-text { font-size: 0.9rem; color: var(--text); line-height: 1.5; }

/* Learning Matrix */
.learning-matrix { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 1.25rem; }
.learning-cell {
  border-radius: 10px; padding: 1rem 0.5rem; display: flex; flex-direction: column; align-items: center; text-align: center;
}
.learning-icon { font-family: var(--font-display); font-size: 2.2rem; margin-bottom: 0.5rem; }
.learning-label { font-size: 0.72rem; }

/* Growth Horizon */
.growth-section {
  background: rgba(251,191,36,0.04); border: 1px solid rgba(251,191,36,0.14);
  border-radius: 3px 14px 14px 14px; padding: 1.5rem; position: relative; margin: 1.5rem;
}
.growth-label {
  font-family: var(--font-display); font-size: 0.6rem; letter-spacing: 0.16em;
  color: rgba(251,191,36,0.55); text-transform: uppercase; margin-bottom: 1rem;
}
.growth-compass { position: absolute; top: 1.25rem; right: 1.25rem; opacity: 0.8; }
.growth-text { font-size: 0.95rem; color: rgba(255,255,255,0.85); line-height: 1.6; margin-right: 40px; margin-bottom: 1rem; }
.growth-footer { font-size: 0.68rem; font-style: italic; color: rgba(251,191,36,0.4); }

/* Contribution */
.contribution-wrap { padding: 4rem 1.5rem; background: radial-gradient(circle at center, rgba(209,213,219,0.03) 0%, transparent 70%); text-align: center; border-bottom: 1px solid var(--border); }
.contribution-rule { height: 1px; background: rgba(209,213,219,0.15); width: 100%; margin: 2rem 0; }
.contribution-statement {
  font-family: var(--font-display); font-weight: 700; font-size: clamp(1.1rem, 4.5vw, 1.8rem);
  color: var(--text); filter: url(#ink); line-height: 1.4;
}

/* Timeline */
.timeline-track {
  display: flex; align-items: center; position: relative; padding: 60px 40px;
  overflow-x: auto; scrollbar-width: none; gap: 48px;
}
.timeline-track::-webkit-scrollbar { display: none; }
.timeline-track::before {
  content: ''; position: absolute; top: 50%; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(209,213,219,0.2), transparent);
}
.rp-moment-item { opacity: 0; transform: translateY(15px); transition: all 0.5s ease; }
.rp-moment-item.visible { opacity: 1; transform: translateY(0); }
.timeline-card {
  width: 200px; background: var(--surface2); border: 1px solid var(--border2);
  border-radius: 12px; padding: 1rem; position: relative;
}
.timeline-date {
  position: absolute; left: 50%; transform: translateX(-50%);
  font-family: var(--font-display); font-size: 0.65rem; color: var(--accent);
  background: var(--bg); padding: 0 6px; white-space: nowrap;
}
.timeline-text { font-size: 0.85rem; color: var(--text); line-height: 1.5; }
.mobile-timeline { display: flex; flex-direction: column; gap: 1.5rem; padding: 1rem 0; position: relative; }
.mobile-timeline::before {
  content: ''; position: absolute; top: 1rem; bottom: 1rem; left: 6px; width: 1px;
  background: rgba(209,213,219,0.15);
}
.mobile-timeline .rp-moment-item { display: flex; gap: 1rem; position: relative; }
.mobile-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); position: absolute; left: 3px; top: 6px; }
.mobile-content { padding-left: 24px; }
.mobile-date { font-family: var(--font-display); font-size: 0.65rem; color: var(--accent); margin-bottom: 0.2rem; text-transform: uppercase; letter-spacing: 0.05em; }

/* Evolution */
.evolution-wrap { width: 100%; height: 200px; margin-bottom: 1rem; }

/* ── LANDING PAGE STYLES ── */
#new-landing-page { display: none; flex-direction: column; width: 100%; overflow-x: hidden; background: var(--bg); color: var(--text); font-family: var(--font-body); }
.landing-section { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 4rem 2rem; position: relative; opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease, transform 0.6s ease; }
.landing-section.visible { opacity: 1; transform: translateY(0); }
.hero-sec { flex-direction: row; justify-content: center; gap: 4rem; }
@media(max-width:900px){ .hero-sec{ flex-direction:column; text-align:center; gap: 2rem; } .hero-logo-wrap { width: 240px; height: 240px; margin: 0 auto; } .hero-sec { padding: 2rem 1rem; } }
.hero-logo-wrap { position: relative; width: 320px; height: 320px; transition: transform 0.1s ease-out; }
.hero-radial-glow { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 600px; height: 600px; background: radial-gradient(circle, rgba(209,213,219,0.12) 0%, rgba(14,13,10,0) 70%); animation: pulseHeroGlow 6s infinite alternate ease-in-out; z-index: -1; pointer-events: none; }
@keyframes pulseHeroGlow { from { transform: translate(-50%, -50%) scale(1); opacity: 0.8; } to { transform: translate(-50%, -50%) scale(1.1); opacity: 1; } }
.orbit-ring { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); border: 1px solid rgba(237,232,216,0.03); border-radius: 50%; pointer-events: none; }
.orbit-r1 { width: 400px; height: 400px; } .orbit-r2 { width: 520px; height: 520px; }
.hero-text-col { max-width: 500px; }
.hero-eyebrow { font-size: 10px; letter-spacing: 0.2em; color: var(--muted); font-family: var(--font-display); text-transform: uppercase; margin-bottom: 1.5rem; }
.hero-title { font-family: var(--font-display); font-weight: 800; font-size: clamp(3rem, 8vw, 6.5rem); line-height: 0.95; letter-spacing: -0.04em; margin-bottom: 1.5rem; }
.word-span { display: inline-block; transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.2s; }
.word-span:hover { transform: scale(1.04); color: var(--accent); }
.hero-title .accent-text { color: var(--accent); filter: url(#ink); }
.hero-sub { font-family: var(--font-body); font-style: italic; font-size: 1.1rem; color: var(--muted); max-width: 38ch; line-height: 1.5; margin-bottom: 2.5rem; }
@media(max-width:900px){ .hero-sub{ margin-left:auto; margin-right:auto; } }
.hero-ctas { display: flex; gap: 1rem; }
@media(max-width:900px){ .hero-ctas{ justify-content:center; } }
@media(max-width:600px){ .hero-ctas{ flex-direction:column; gap: 0.8rem; width: 100%; max-width: 280px; margin: 0 auto; } .hero-ctas > button { width: 100%; } }
.btn-primary { background: var(--accent); color: var(--bg); font-family: var(--font-display); font-weight: 700; font-size: 1rem; padding: 1rem 1.5rem; border: none; border-radius: 4px 14px 14px 14px; cursor: pointer; transition: transform 0.15s, box-shadow 0.15s; }
.btn-primary:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 4px 20px rgba(209,213,219,0.25); }
.btn-ghost { background: transparent; color: var(--text); font-family: var(--font-display); font-weight: 700; font-size: 1rem; padding: 1rem 1.5rem; border: 1px solid rgba(209,213,219,0.3); border-radius: 4px 14px 14px 14px; cursor: pointer; transition: background 0.15s, border-color 0.15s; }
.btn-ghost:hover { border-color: var(--accent); background: rgba(209,213,219,0.05); }

/* Sec 2 */
.typewriter-sec { text-align: center; }
.type-line { font-family: var(--font-body); font-size: 1.25rem; color: var(--muted); margin-bottom: 1rem; position: relative; display: inline; text-decoration: line-through; text-decoration-color: transparent; text-decoration-thickness: 2px; transition: text-decoration-color 0.4s ease-out; line-height: 1.6; }
.type-line.strike { text-decoration-color: var(--red); }
.truth-reveal { opacity: 0; transform: translateY(10px); transition: opacity 0.4s, transform 0.4s; margin-top: 3rem; }
.truth-reveal.visible { opacity: 1; transform: translateY(0); }
.truth-title { font-family: var(--font-display); font-weight: 800; font-size: 4rem; color: var(--accent); line-height: 1.1; letter-spacing: -0.03em; margin-bottom: 1rem; }
.truth-sub { font-size: 1.1rem; color: var(--text); max-width: 400px; margin: 0 auto; line-height: 1.5; }

/* Sec 3 */
.cards-container { display: flex; gap: 2.5rem; max-width: 1000px; margin: 0 auto 4rem; flex-wrap: wrap; justify-content: center; }
.l-card { 
  width: 320px; 
  background: linear-gradient(145deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.0) 100%);
  border: 1px solid rgba(255,255,255,0.06); 
  border-radius: 16px; 
  padding: 2.5rem; 
  display: flex; 
  flex-direction: column; 
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s, border-color 0.4s; 
}
.l-card:hover { 
  transform: translateY(-8px); 
  border-color: rgba(255,255,255,0.15);
  box-shadow: 0 20px 40px rgba(0,0,0,0.6), inset 0 0 0 1px rgba(255,255,255,0.05); 
}
.l-card-header { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; color: var(--text); margin-bottom: 1.5rem; display: flex; align-items: center; gap: 12px; }
.l-card-header span { color: var(--red); font-size: 1.4rem; opacity: 0.9; }
.l-card-body { font-size: 1rem; line-height: 1.7; color: var(--muted); }
.l-card-body strong { color: var(--text); font-weight: 600; }

/* Sec 4 */
.demo-sec { max-width: 1100px; width: 100%; }
.demo-label { text-align: center; font-family: var(--font-display); font-size: 0.75rem; letter-spacing: 0.15em; color: var(--muted); margin-bottom: 3rem; }
.demo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; }
@media (max-width: 800px) { .demo-grid { grid-template-columns: 1fr; } }
.mock-chat { display: flex; flex-direction: column; gap: 1rem; }
.mock-bubble { opacity: 0; transform: translateY(15px); transition: opacity 0.2s, transform 0.2s; }
.mock-bubble.visible { opacity: 1; transform: translateY(0); }
.mock-snap-card { opacity: 0; transform: scale(0.95); transition: opacity 0.3s, transform 0.3s; background: var(--surface); border: 1px solid var(--border); border-radius: 3px 16px 16px 16px; padding: 2rem; }
.mock-snap-card.visible { opacity: 1; transform: scale(1); }

/* Sec 5 */
.rings-sec { max-width: 900px; width: 100%; }
.rings-flex { display: flex; align-items: center; justify-content: center; gap: 4rem; margin: 0 auto; }
@media (max-width: 768px) { .rings-flex { flex-direction: column; text-align: center; } }
.rings-diagram { position: relative; width: 320px; height: 320px; flex-shrink: 0; }
.diagram-ring { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); border-radius: 50%; background: var(--bg); border: 1px solid var(--accent); display: flex; align-items: center; justify-content: center; transition: border-color 0.4s, background 0.4s; }
.diagram-ring:hover { background: rgba(209,213,219,0.05); }
.ring-4 { width: 320px; height: 320px; border-color: rgba(209,213,219,0.12); z-index: 1; }
.ring-3 { width: 240px; height: 240px; border-color: rgba(209,213,219,0.22); z-index: 2; }
.ring-2 { width: 160px; height: 160px; border-color: rgba(209,213,219,0.35); z-index: 3; }
.ring-1 { width: 80px; height: 80px; border-color: rgba(209,213,219,0.55); z-index: 4; }
.ring-label { position: absolute; top: -24px; left: -50%; width: 200%; text-align: center; font-family: var(--font-display); font-size: 0.7rem; color: var(--muted); white-space: nowrap; transition: opacity 0.2s; opacity: 0; pointer-events: none; }
.rings-text p { font-size: 1.15rem; line-height: 1.6; color: var(--text); margin-bottom: 1rem; }
.rings-text p:last-child { color: var(--muted); }

/* Sec 6 */
.privacy-sec { text-align: center; max-width: 1000px; width: 100%; margin: 0 auto; }
.privacy-title { font-family: var(--font-display); font-weight: 800; font-size: 3rem; color: var(--accent); filter: url(#ink); margin-bottom: 4rem; }
.privacy-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3rem; text-align: left; }
@media (max-width: 768px) { .privacy-grid { grid-template-columns: 1fr; text-align: center; } }
.privacy-item { color: var(--muted); font-size: 1rem; line-height: 1.5; }
.privacy-item::before { content: '◯'; display: block; color: var(--accent); font-size: 1.5rem; margin-bottom: 1rem; }

/* Sec 7 */
.cta-sec { text-align: center; }
.cta-title { font-family: var(--font-display); font-weight: 800; font-size: clamp(2.5rem, 6vw, 5rem); margin: 2rem 0; line-height: 1; letter-spacing: -0.02em; }
.cta-title span { color: var(--accent); }
.btn-large-signin { width: 100%; max-width: 360px; background: var(--accent); color: var(--bg); font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; padding: 1.2rem; border: none; border-radius: 4px 16px 16px 16px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 12px; transition: transform 0.2s, box-shadow 0.2s; }
.btn-large-signin:hover { transform: scale(1.02); box-shadow: 0 10px 30px rgba(209,213,219,0.25); }

/* ── ONBOARDING FLOW ── */
#onboarding-flow { position: fixed; inset: 0; z-index: 10000; background: var(--bg); display: none; flex-direction: column; }
.ob-screen { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem; padding-bottom: max(2rem, env(safe-area-inset-bottom)); transform: translateY(100%); transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1); background: var(--bg); overflow-y: auto; }

.ob-back-btn { position: absolute; top: 1.5rem; left: 1.5rem; background: transparent; border: none; color: var(--muted); font-size: 0.9rem; font-weight: 500; padding: 0.5rem 1rem; border-radius: 8px; cursor: pointer; transition: all 0.2s ease; z-index: 10; display: flex; align-items: center; gap: 6px; }
.ob-back-btn:hover { background: var(--surface2); color: var(--text); }

.ob-screen.active { transform: translateY(0); }
.ob-screen.done { transform: translateY(-100%); }
.ob-progress { position: absolute; top: 2rem; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; z-index: 101; }
.ob-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--surface3); transition: background 0.3s; }
.ob-dot.active { background: var(--accent); }
.ob-title { font-family: var(--font-display); font-weight: 800; font-size: 2.4rem; margin-bottom: 1.5rem; text-align: center; }
.ob-sub { font-family: var(--font-body); font-size: 1rem; color: var(--muted); text-align: center; max-width: 38ch; line-height: 1.6; margin-bottom: 2.5rem; }
.ob-rules { display: flex; flex-direction: column; gap: 1.5rem; margin-bottom: 3rem; }
.ob-rule { opacity: 0; transform: translateY(10px); transition: all 0.4s; }
.ob-rule.visible { opacity: 1; transform: translateY(0); }
.rule-wrong { color: var(--muted); font-size: 0.95rem; text-decoration: line-through; margin-bottom: 0.2rem; }
.rule-right { color: var(--accent); font-size: 1.05rem; font-weight: 500; }

/* ── CURSOR TRAIL ── */
.cursor-dot { position: fixed; width: 3px; height: 3px; background: var(--accent); border-radius: 50%; pointer-events: none; z-index: 9999; opacity: 0; transition: transform 0.1s linear, opacity 0.3s; }
#scroll-progress { position: fixed; top: 0; left: 0; bottom: 0; width: 1px; background: var(--accent); opacity: 0.2; transform-origin: top; transform: scaleY(0); z-index: 90; pointer-events: none; }

/* ── INTERACTIVE MOCKUPS (PHASE 6 & 7) ── */
.preview-badge {
  position: absolute;
  top: 14px; right: 14px;
  font-family: var(--font-display);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 20px;
  padding: 4px 11px;
  display: flex;
  align-items: center;
  gap: 5px;
  z-index: 5;
}
.preview-badge::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.6;
}

.mockup-dashboard {
  height: 0;
  overflow: hidden;
  opacity: 0;
  transition: height 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
  position: relative;
  border-top: 1px solid transparent;
  margin-top: 0;
  padding-top: 0;
}
.mockup-dashboard.expanded {
  height: auto; /* Handled via JS inline style for transition */
  opacity: 1;
  border-top: 1px solid var(--border);
  margin-top: 1rem;
  padding-top: 1rem;
}

/* Screen Time Bar Chart */
.st-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 80px;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 4px;
}
.st-bar {
  width: 12%;
  background: var(--accent);
  border-radius: 4px 4px 0 0;
  height: 0; /* Animated in JS */
}
@keyframes growBar {
  from { height: 0; }
  to { height: var(--target-h); }
}

/* Social Patterns Grid */
.sp-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 4px;
  margin-bottom: 1rem;
}
.sp-cell {
  background: var(--accent);
  aspect-ratio: 1;
  border-radius: 2px;
  opacity: 0;
  transform: scale(0.5);
}
@keyframes popCell {
  from { opacity: 0; transform: scale(0.5); }
  to { opacity: var(--target-o); transform: scale(1); }
}

/* Voice Mockup */
.voice-mockup-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80px;
}
.waveform-bars {
  display: flex;
  gap: 3px;
  align-items: center;
  justify-content: center;
  height: 24px;
}
.wave-bar {
  width: 4px;
  background: var(--accent);
  border-radius: 2px;
  animation: wave 0.8s ease-in-out infinite alternate;
}
.wave-bar:nth-child(1) { height: 40%; animation-delay: 0.1s; }
.wave-bar:nth-child(2) { height: 80%; animation-delay: 0.2s; }
.wave-bar:nth-child(3) { height: 100%; animation-delay: 0.3s; }
.wave-bar:nth-child(4) { height: 60%; animation-delay: 0.4s; }
.wave-bar:nth-child(5) { height: 40%; animation-delay: 0.5s; }
@keyframes wave {
  0% { transform: scaleY(0.5); }
  100% { transform: scaleY(1.2); }
}

.transcript-text {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text);
  margin-top: 1rem;
  text-align: center;
  font-style: italic;
  min-height: 40px;
}

/* Avatar Mockup */
.avatar-mockup-wrapper {
  position: relative;
  width: 100%;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 8px;
}
.avatar-svg-container {
  transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.avatar-svg-container.scaled {
  transform: scale(2.5);
}
.avatar-eye {
  transition: cx 0.2s, cy 0.2s;
}

/* =========================================================================
   Z-INDEX REGISTRY
   =========================================================================
   Keep this as the single source of truth for stacking order.
*/
#ambient-canvas                                         { z-index: 0 !important; }
#main, #sidebar-wrap                                    { z-index: 1 !important; }
.chat-header, .chat-input-area                          { z-index: 2 !important; }
.rp-header                                              { z-index: 10 !important; }

/* Standard Panels */
#profile-panel, #report-panel, #history-view,
#terms-panel, #privacy-panel, #account-panel,
#parent-connect-panel, #parent-dashboard-preview,
#insights-hub-panel, #roadmap-preview-panel,
#daily-checkin-panel                                    { z-index: 30 !important; }

/* Elevated Panels */
#canvas-panel                                           { z-index: 40 !important; }
#eligibility-gate-panel                                 { z-index: 45 !important; }

/* Critical Overlays */
#crisis-card                                            { z-index: 90 !important; }
#confirm-dialog, #report-limit-dialog,
#delete-confirm-modal, .toast                           { z-index: 100 !important; }
#onboarding-flow                                        { z-index: 10000 !important; }
.cursor-dot                                             { z-index: 99999 !important; }

/* Category 3: Responsive Breakpoints */
@media (min-width: 641px) and (max-width: 1024px) {
  #sidebar-wrap {
    width: 220px;
  }
}

@media (max-width: 340px) {
  .canvas-tools, .pf-card-grid {
    flex-wrap: wrap;
  }
  .toast {
    left: 8px; right: 8px; bottom: 8px;
    font-size: 0.8rem;
  }
}

@media (max-height: 420px) and (orientation: landscape) {
  .chat-header {
    min-height: 40px; padding: 4px 12px;
  }
  .chat-input-area {
    padding: 8px; min-height: 44px;
  }
  .message {
    padding: 10px 14px;
  }
}

/* Custom Dropdown */
.custom-select { position: relative; width: 100%; margin-bottom: 1rem; }
.custom-select-trigger { background: var(--surface2); border: 1px solid var(--border2); border-radius: 8px; padding: 0.55rem 0.85rem; font-family: var(--font-body); font-size: 0.88rem; color: var(--text); cursor: pointer; display: flex; justify-content: space-between; align-items: center; user-select: none; }
.custom-select-trigger:after { content: '▼'; margin-left: 10px; color: var(--muted); }
.custom-options { position: absolute; display: none; top: 100%; left: 0; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; margin-top: 4px; z-index: 10; max-height: 200px; overflow-y: auto; box-shadow: 0 4px 12px rgba(0,0,0,0.5); }
.custom-options.open { display: block; }
.custom-option { padding: 0.55rem 0.85rem; font-family: var(--font-body); font-size: 0.88rem; color: var(--text); cursor: pointer; transition: background 0.1s; }
.custom-option:hover { background: var(--surface2); color: var(--accent); }

/* ── INTERACTIVE MOCKUPS (PHASE 6 & 7) ── */
.preview-badge {
  position: absolute;
  top: 14px; right: 14px;
  font-family: var(--font-display);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 20px;
  padding: 4px 11px;
  display: flex;
  align-items: center;
  gap: 5px;
  z-index: 5;
}
.preview-badge::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.6;
}

.mockup-dashboard {
  height: 0;
  overflow: hidden;
  opacity: 0;
  transition: height 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
  position: relative;
  border-top: 1px solid transparent;
  margin-top: 0;
  padding-top: 0;
}
.mockup-dashboard.expanded {
  height: auto;
  opacity: 1;
  border-top: 1px solid var(--border);
  margin-top: 1rem;
  padding-top: 1rem;
}

/* Screen Time Bar Chart */
.st-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 80px;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 4px;
}
.st-bar {
  width: 12%;
  background: var(--accent);
  border-radius: 4px 4px 0 0;
  height: 0;
}
@keyframes growBar {
  from { height: 0; }
  to { height: var(--target-h); }
}

/* Social Patterns Grid */
.sp-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 4px;
  margin-bottom: 1rem;
}
.sp-cell {
  background: var(--accent);
  aspect-ratio: 1;
  border-radius: 2px;
  opacity: 0;
  transform: scale(0.5);
}
@keyframes popCell {
  from { opacity: 0; transform: scale(0.5); }
  to { opacity: var(--target-o); transform: scale(1); }
}

/* Voice Mockup */
.voice-mockup-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80px;
}
.waveform-bars {
  display: flex;
  gap: 3px;
  align-items: center;
  justify-content: center;
  height: 24px;
}
.wave-bar {
  width: 4px;
  background: var(--accent);
  border-radius: 2px;
  animation: wave 0.8s ease-in-out infinite alternate;
}
.wave-bar:nth-child(1) { height: 40%; animation-delay: 0.1s; }
.wave-bar:nth-child(2) { height: 80%; animation-delay: 0.2s; }
.wave-bar:nth-child(3) { height: 100%; animation-delay: 0.3s; }
.wave-bar:nth-child(4) { height: 60%; animation-delay: 0.4s; }
.wave-bar:nth-child(5) { height: 40%; animation-delay: 0.5s; }
@keyframes wave {
  0% { transform: scaleY(0.5); }
  100% { transform: scaleY(1.2); }
}

.transcript-text {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text);
  margin-top: 1rem;
  text-align: center;
  font-style: italic;
  min-height: 40px;
}

/* Avatar Mockup */
.avatar-mockup-wrapper {
  position: relative;
  width: 100%;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 8px;
}
.avatar-svg-container {
  transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.avatar-svg-container.scaled {
  transform: scale(2.5);
}
.avatar-eye {
  transition: cx 0.2s, cy 0.2s;
}

/* ═══════════════════════════════════════════════
   ĀTMAN LOGO ANIMATIONS — Singularity × Bloom
═══════════════════════════════════════════════ */
.logo-ring-outer {
  transform-origin: 300px 300px;
  animation: logo-spin-cw 82s linear infinite;
}
.logo-ring-inner {
  transform-origin: 300px 300px;
  animation: logo-spin-ccw 110s linear infinite;
}
@keyframes logo-spin-cw  { to { transform: rotate(360deg);  } }
@keyframes logo-spin-ccw { to { transform: rotate(-360deg); } }

.logo-cglow {
  animation: logo-breathe 5s ease-in-out infinite;
}
@keyframes logo-breathe {
  0%, 100% { opacity: .92; }
  50%      { opacity: .52; }
}

.logo-petal {
  stroke-dasharray: 1500;
  stroke-dashoffset: 1500;
  animation: logo-draw 0.6s ease-out forwards;
}
@keyframes logo-draw { to { stroke-dashoffset: 0; } }

.pdot {
  opacity: 0;
  transition: opacity 0.28s ease 0s;
}

@keyframes logo-vtx {
  0%, 85%, 100% { opacity: .88; transform: scale(1);   }
  42%           { opacity: 1;    transform: scale(1.5); }
}

#hero-logo-wrap svg,
#cta-logo-svg svg,
#ob-logo-svg svg,
#ob-logo-svg-small svg {
  transition: transform 0.35s ease-out;
}
#hero-logo-wrap:hover svg,
#cta-logo-svg:hover svg,
#ob-logo-svg:hover svg,
#ob-logo-svg-small:hover svg {
  transform: scale(1.045);
}

#hero-logo-wrap {
  transform-style: preserve-3d;
  will-change: transform;
}


/* NEW PITCH DECK SECTIONS */
.systemic-cage-sec, .event-horizon-sec, .atlas-sec, .sovereign-sec {
  max-width: 1100px;
  margin: 0 auto;
  padding: 10rem 2rem;
  color: var(--text);
  position: relative;
}

.systemic-cage-sec::before, .event-horizon-sec::before, .atlas-sec::before, .sovereign-sec::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 150%;
  height: 150%;
  background: radial-gradient(circle, rgba(255,255,255,0.02) 0%, rgba(255,255,255,0) 60%);
  pointer-events: none;
  z-index: -1;
}

.sc-header, .eh-header, .atlas-header, .sov-header {
  text-align: center;
  margin-bottom: 5rem;
}
.sc-eyebrow, .eh-eyebrow, .atlas-eyebrow, .sov-eyebrow {
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 1.2rem;
  background: linear-gradient(90deg, var(--muted), var(--text));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}
.sc-title, .eh-title, .atlas-title, .sov-title {
  font-family: var(--font-display);
  font-size: 3.2rem;
  line-height: 1.15;
  font-weight: 700;
  max-width: 850px;
  margin: 0 auto;
  letter-spacing: -0.02em;
}
.sc-grid, .eh-grid, .atlas-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: start;
}
.sc-subtitle, .eh-subtitle, .atlas-subtitle, .sov-subtitle {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-bottom: 1.5rem;
  color: var(--text);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding-bottom: 0.75rem;
  text-transform: uppercase;
}
.sc-left p, .sc-right p, .eh-left p, .eh-right p, .atlas-left p, .atlas-right p {
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 2.5rem;
  font-size: 1.05rem;
}

/* Premium Card Material Mixin */
.sc-card, .eh-shift, .eh-tel-item, .atlas-layer, .sov-item {
  background: linear-gradient(145deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.0) 100%);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s, border-color 0.4s;
}
.sc-card:hover, .eh-shift:hover, .eh-tel-item:hover, .atlas-layer:hover, .sov-item:hover {
  transform: translateY(-4px);
  border-color: rgba(255,255,255,0.12);
  box-shadow: 0 15px 35px rgba(0,0,0,0.5), inset 0 0 0 1px rgba(255,255,255,0.03);
}

.sc-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
.sc-card {
  padding: 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.75rem;
  font-weight: 500;
}
.sc-card span { 
  font-size: 2.2rem; 
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.4));
  margin-bottom: 0.25rem;
  transition: transform 0.4s;
}
.sc-card:hover span { transform: scale(1.1); }

.sc-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.sc-list li {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  color: var(--text);
  font-weight: 500;
  font-size: 1.05rem;
}
.sc-list li span { color: var(--red); opacity: 0.8; }

.sc-footer {
  margin-top: 6rem;
  background: linear-gradient(145deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.0) 100%);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 20px;
  padding: 3rem 2rem;
  text-align: center;
}
.sc-first-principle {
  background: rgba(255,255,255,0.1);
  color: var(--text);
  display: inline-block;
  padding: 0.35rem 1.25rem;
  border-radius: 20px;
  font-weight: 600;
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(255,255,255,0.15);
}
.sc-footer-text {
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
}

.eh-shifts {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.eh-shift {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 2rem;
  font-weight: 500;
  font-size: 1.05rem;
}
.eh-shift span { color: var(--accent); font-weight: 400; opacity: 0.7; }

.eh-telemetry-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
.eh-tel-item {
  padding: 1.75rem;
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.6;
}
.eh-tel-item strong {
  display: block;
  color: var(--text);
  margin-bottom: 0.75rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.atlas-layers {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.atlas-layer {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  padding: 1.5rem;
}
.al-icon { 
  width: 68px;
  height: 68px;
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(255,255,255,0.03);
  padding: 0.6rem;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.05);
  transition: transform 0.4s;
}
.atlas-layer:hover .al-icon { transform: scale(1.05); border-color: rgba(255,255,255,0.1); }
.al-content strong { color: var(--text); display:block; margin-bottom: 0.35rem; font-size:1.05rem;}
.al-content { color: var(--muted); font-size: 0.95rem; line-height: 1.5; }

.atlas-skills {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  margin-top: 1rem;
}
.as-item {
  padding-left: 1.75rem;
  border-left: 2px solid rgba(255,255,255,0.15);
  color: var(--muted);
  line-height: 1.6;
  font-size: 1.05rem;
  position: relative;
  transition: border-color 0.3s;
}
.as-item:hover {
  border-left-color: var(--text);
}
.as-item strong { color: var(--text); display: block; margin-bottom: 0.35rem; font-weight: 600; }

.sov-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
}
.sov-item {
  padding: 3rem 2rem;
  text-align: center;
}
.sov-icon { 
  width: 96px;
  height: 96px;
  margin-bottom: 2rem; 
  display: inline-flex;
  justify-content: center;
  align-items: center;
  filter: drop-shadow(0 10px 20px rgba(0,0,0,0.5));
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.sov-item:hover .sov-icon { transform: translateY(-8px) scale(1.05); }
.sov-item h3 { font-family: var(--font-display); margin-bottom: 1.25rem; font-size: 1.4rem;}
.sov-item p { color: var(--muted); line-height: 1.7; font-size: 1.05rem; }

.sov-footer {
  margin-top: 6rem;
  text-align: center;
}
.sov-subtitle {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1.2;
}
.sov-subtitle span { 
  background: linear-gradient(90deg, var(--muted), var(--text));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

@media (max-width: 768px) {
  .sc-grid, .eh-grid, .atlas-grid, .sov-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  .systemic-cage-sec, .event-horizon-sec, .atlas-sec, .sovereign-sec {
    padding: 6rem 1.5rem;
  }
  .sc-title, .eh-title, .atlas-title, .sov-title {
    font-size: 2.2rem;
  }
}

/* WORK IN PROGRESS BADGE */
.working-on-it-badge {
  background: var(--surface2, rgba(20, 20, 20, 0.6));
  border: 1px solid rgba(255, 69, 58, 0.2);
  color: rgba(255, 69, 58, 0.75);
  padding: 6px 14px;
  border-radius: 6px;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(8px);
  animation: badgePulse 4s infinite alternate ease-in-out;
  white-space: nowrap;
  transition: all 0.3s ease;
}

.working-on-it-badge:hover {
  background: rgba(255, 69, 58, 0.05);
  color: rgba(255, 69, 58, 0.9);
  border-color: rgba(255, 69, 58, 0.3);
}

@keyframes badgePulse {
  0% { box-shadow: 0 2px 8px rgba(255, 69, 58, 0.02); border-color: rgba(255, 69, 58, 0.1); }
  100% { box-shadow: 0 2px 12px rgba(255, 69, 58, 0.08); border-color: rgba(255, 69, 58, 0.25); }
}

@media (max-width: 768px) {
  .working-on-it-badge {
    font-size: 0.65rem;
    padding: 6px 12px;
  }
}


/* ═══════════════════════════════════════════════
   API KEY MODAL
═══════════════════════════════════════════════ */
.api-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000;
}

.api-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 440px;
  background: rgba(20, 20, 20, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 1.5rem;
  z-index: 10001;
  box-shadow: 0 24px 64px rgba(0,0,0,0.4);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.api-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  padding-bottom: 0.75rem;
}

.api-modal-close {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1.2rem;
  cursor: pointer;
  transition: color 0.2s;
}
.api-modal-close:hover {
  color: var(--text);
}

.api-input-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 0.4rem;
  margin-top: 1rem;
}

.api-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.api-input:focus {
  outline: none;
  border-color: rgba(255,255,255,0.3);
}

.api-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.landing-badge {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 999;
}

@media (max-width: 768px) {
  .landing-badge {
    top: 16px;
    right: 16px;
  }
}

@media (max-width: 768px) {
  .pf-field { flex-direction: column; align-items: flex-start; gap: 0.35rem; }
  .pf-label { flex: none; font-size: 0.72rem; color: var(--muted); }
  .profile-header-flex { flex-direction: column; align-items: center; text-align: center; gap: 1rem; margin-top: 2rem; }
}

@media (max-width: 768px) {
  .pf-field { flex-direction: column; align-items: flex-start; gap: 0.35rem; }
  .pf-label { flex: none; font-size: 0.72rem; color: var(--muted); }
  .profile-header-flex { flex-direction: column; align-items: center; text-align: center; gap: 1rem; margin-top: 2rem; }
}

/* Past Reports Buttons */
.pf-report-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: all 0.2s ease;
  width: 100%;
}
.pf-report-btn:hover {
  background: var(--surface3);
  border-color: var(--border2);
  transform: translateY(-1px);
}

/* =========================================================
   CINEMATIC & ATMOSPHERIC ENGINE
   ========================================================= */

/* 1. Global Ambient Cursor Glow */
#ambient-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(255,255,255,0.025) 0%, rgba(255,255,255,0) 60%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform-origin: center center;
  mix-blend-mode: screen;
  margin-left: -300px; /* Offset to center on cursor */
  margin-top: -300px;
}

/* 2. Reveal Utilities (Intersection Observer) */
.reveal-blur {
  opacity: 0;
  filter: blur(20px);
  transform: scale(0.95) translateY(20px);
  transition: all 1.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, filter, transform;
}
.reveal-blur.in-view {
  opacity: 1;
  filter: blur(0px);
  transform: scale(1) translateY(0);
}

.reveal-up {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1), transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}
.reveal-up.in-view {
  opacity: 1;
  transform: translateY(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.9);
  transition: all 1.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-scale.in-view {
  opacity: 1;
  transform: scale(1);
}

/* 3. Stagger Transitions */
.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }
.stagger-5 { transition-delay: 0.5s; }
.stagger-6 { transition-delay: 0.6s; }

/* 4. Magnetic Card (3D Tilt overrides) */
.magnetic-card {
  transform-style: preserve-3d;
  /* We remove the fixed hover transform so JS can control it */
}
.magnetic-card:hover {
  /* Let JS handle transform, but add border glow */
  border-color: rgba(255,255,255,0.15) !important;
  box-shadow: 0 20px 50px rgba(0,0,0,0.8), inset 0 0 0 1px rgba(255,255,255,0.05) !important;
}

/* 5. Section Specific Atmospheres */
.systemic-cage-sec { background: radial-gradient(ellipse at center, rgba(10, 0, 0, 0.2) 0%, rgba(0,0,0,0) 80%); }
.event-horizon-sec { background: radial-gradient(ellipse at center, rgba(0, 10, 15, 0.1) 0%, rgba(0,0,0,0) 80%); }
.atlas-sec { background: radial-gradient(circle at center, rgba(15, 15, 20, 0.2) 0%, rgba(0,0,0,0) 80%); }
.sovereign-sec { background: radial-gradient(ellipse at bottom, rgba(30, 0, 10, 0.15) 0%, rgba(0,0,0,0) 80%); }

/* Ambient floating particles / dust simulation */
.ambient-dust {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,0.01) 1px, transparent 1px);
  background-size: 50px 50px;
  opacity: 0.5;
  z-index: -1;
  animation: drift 60s linear infinite;
}
@keyframes drift {
  from { background-position: 0 0; }
  to { background-position: 500px 500px; }
}

/* =========================================================
   OCTOPUS CURSOR & TENTACLES
   ========================================================= */
body, a, button, .magnetic-card, .btn, input, textarea, .pf-report-btn {
  cursor: none !important;
}

#atman-tentacles {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 9998;
  pointer-events: none;
}

#octopus-cursor {
  position: fixed;
  top: 0; left: 0;
  width: 44px; height: 44px;
  margin-top: -22px; margin-left: -22px;
  z-index: 9999;
  pointer-events: none;
  filter: drop-shadow(0 10px 15px rgba(0,0,0,0.5));
}

#octopus-cursor svg {
  width: 100%; height: 100%;
  fill: var(--text);
  opacity: 0.9;
}

/* =========================================================
   YANTRA ICONS (Ancient Bharat SVGs)
   ========================================================= */
.yantra-icon {
  width: 1.5em;
  height: 1.5em;
  display: inline-block;
  vertical-align: text-bottom;
  stroke: var(--text);
  color: var(--text);
  transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  overflow: visible;
}

.al-icon .yantra-icon,
.sov-icon .yantra-icon {
  width: 100%;
  height: 100%;
  stroke-width: 1px;
}

.sc-card:hover .yantra-icon,
.atlas-item:hover .yantra-icon,
.feature:hover .yantra-icon,
.atlas-layer:hover .al-icon .yantra-icon,
.sov-item:hover .sov-icon .yantra-icon {
  transform: scale(1.1);
}


