/* ============================================================
   SUKOON — Design System
   A digital sanctuary. Warm, physical, unhurried.
   ============================================================ */

:root {
  /* Foundations: Sukoon v5 Color Palette (Simplified) */
  --parchment: #FAF5F1;       /* Very Soft Warm Cream background */
  --parchment-deep: #DEC8B5;  /* Exact Warm Tan Logo background */
  --surface: #FDFBFA;         /* Soft readable off-white */
  --surface-soft: #F6EEE8;
  --ink: #3B2D29;             /* espresso brown from logo text shadow */
  --ink-soft: #5C4B46;
  --ink-faint: #8E7A74;
  --line: #E7D9D0;

  --rust: #A0473C;            /* Logo Terracotta Brick-Red */
  --rust-deep: #843229;
  --rust-hover: #F6EEE8;      /* Warm hover tone */
  
  --green: #50764D;           /* Logo Peacock Feather Green */
  --teal: #004F5E;            /* Logo Peacock Feather Deep Teal Core */
  --blue: #00808B;            /* Logo Peacock Feather Turquoise Blue */
  --gold: #DEC8B5;            /* Logo Tan background */

  --shadow-soft: 0 10px 30px -15px rgba(44, 62, 80, 0.08);
  --shadow-lift: 0 5px 15px -8px rgba(44, 62, 80, 0.05);

  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --ease: cubic-bezier(0.25, 1, 0.5, 1);
  --fade: 0.8s;

  --touch-min: 48px;

  --letter-spacing: 0.01em;
  --line-height-body: 1.75;
}

/* Night theme variables (Subdued Espresso Bedside Lamp) */
[data-theme="night"] {
  --parchment: #1D1513;        /* Deep espresso bean background */
  --parchment-deep: #140E0C;   /* Even darker espresso background */
  --surface: #281D1A;          /* Warm dark brown card surface */
  --surface-soft: #332622;
  --ink: #F7EEEB;              /* Off-white warm text */
  --ink-soft: #DEC8B5;         /* Soft tan metadata */
  --ink-faint: #9E837E;
  --line: #42302C;
  --rust: #E26859;             /* Lighter brick-red for visibility in dark */
  --rust-deep: #C74F41;
  --rust-hover: #332622;
  --green: #81A87D;            /* Desaturated feather green */
  --teal: #338C9E;             /* Desaturated feather turquoise */
  --blue: #338C9E;
  --gold: #DEC8B5;
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.45);
  --shadow-lift: 0 5px 15px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--parchment);
  color: var(--ink);
  font-family: 'Quicksand', 'Nunito', -apple-system, sans-serif;
  font-weight: 500;
  line-height: var(--line-height-body);
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
  transition: background var(--fade) var(--ease), color var(--fade) var(--ease);
  /* Solid, flat background without heavy gradient patterns */
}

h1, h2, h3, blockquote {
  font-family: 'Playfair Display', 'Lora', Georgia, serif;
  font-weight: 600;
  margin: 0;
  color: var(--ink);
  letter-spacing: -0.01em;
}
p { margin: 0; }
button { font-family: inherit; cursor: pointer; }
a { color: inherit; }
img, svg { display: block; max-width: 100%; }

.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Visible, glowing focus states everywhere */
a:focus-visible, button:focus-visible, input:focus-visible,
textarea:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--parchment), 0 0 0 5px var(--rust);
  border-radius: var(--radius-sm);
}

/* ============ Layout & Centered Navigation ============ */
.wrap { max-width: 900px; margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: 640px; }

/* Doubled spacings (whitespace expansion) */
.center { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 40px; }

.page-section {
  position: relative;
  z-index: 1;
  padding: 120px 0 160px; /* Doubled page padding */
  animation: soft-fade var(--fade) var(--ease);
}
@keyframes soft-fade {
  from { opacity: 0; transform: translateY(4px); } /* Calmer, micro-translation */
  to { opacity: 1; transform: translateY(0); }
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  color: var(--teal);
  font-weight: 700;
}
.display {
  font-size: clamp(2.4rem, 5.5vw, 3.6rem);
  line-height: 1.25;
}
.display-sm {
  font-size: clamp(1.6rem, 3.8vw, 2.2rem);
  line-height: 1.35;
}
.lede {
  font-size: 1.12rem;
  color: var(--ink-soft);
  max-width: 560px;
}
.lede-sm { font-size: 1.02rem; }
.fineprint { font-size: 0.85rem; color: var(--ink-faint); }

/* Unified Centered Navigation Header */
.site-header {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 48px 24px;
  max-width: 1000px;
  margin: 0 auto;
}
@media (min-width: 768px) {
  .site-header {
    flex-direction: row;
    justify-content: space-between;
  }
}
.brand {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--ink);
  padding: 4px 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.main-nav {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  justify-content: center;
}
.main-nav a {
  text-decoration: none;
  font-weight: 600;
  color: var(--ink-soft);
  font-size: 0.98rem;
  transition: color 0.25s;
  padding: 4px 8px;
}
.main-nav a:hover,
.main-nav a.active {
  color: var(--rust);
}
.header-actions { display: flex; align-items: center; gap: 10px; }

/* ============ Buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--touch-min);
  min-width: var(--touch-min);
  border: none;
  border-radius: var(--radius-md);
  padding: 12px 28px;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  transition: background 0.25s, color 0.25s, transform 0.2s;
  box-shadow: var(--shadow-lift);
}
.btn-primary { background: var(--rust); color: #fff9f2; }
.btn-primary:hover { background: var(--rust-deep); }
.btn-primary:active { transform: scale(0.98); }
.btn-secondary { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.btn-secondary:hover { background: var(--parchment-deep); }
.btn-ghost { background: transparent; color: var(--ink-soft); box-shadow: none; }
.btn-ghost:hover { color: var(--rust); }
.btn-lg { padding: 16px 34px; font-size: 1.05rem; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.link-btn {
  background: none;
  border: none;
  min-height: var(--touch-min);
  padding: 6px 10px;
  color: var(--ink-soft);
  font-size: 0.92rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--line);
}
.link-btn:hover { color: var(--teal); text-decoration-color: var(--teal); }

/* ============ Cards ============ */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 48px; /* Doubled spacing inside cards */
  transition: box-shadow 0.3s var(--ease);
}
.card:hover { box-shadow: var(--shadow-soft); } /* Flattened: no translational hover lift */


.brand-mark {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--parchment-deep);
  display: inline-block;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.brand-mark-img {
  position: absolute;
  width: 148px;
  max-width: none;
  left: -54px;
  top: -15px;
}
.header-actions { display: flex; align-items: center; gap: 10px; }

/* ============ Ambient breathing background ============ */
.breath-bg {
  display: none !important;
}

/* ============ Floating global controls ============ */
.floating-controls {
  position: fixed;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.fc-bottom-right { bottom: 24px; right: 24px; align-items: flex-end; }
.fc-bottom-left { bottom: 24px; left: 24px; }
.fc-top-right { top: 90px; right: 24px; }

.porch-light {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: var(--touch-min);
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--rust);
  color: #fff9f2;
  font-weight: 700;
  border: none;
  box-shadow: 0 0 0 0 rgba(163, 74, 69, 0.5);
  animation: porch-glow 2.6s ease-in-out infinite;
}
@keyframes porch-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(163, 74, 69, 0.45); }
  50% { box-shadow: 0 0 0 10px rgba(163, 74, 69, 0); }
}

.quick-exit {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: var(--touch-min);
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.88rem;
}
.quick-exit:hover { border-color: var(--rust); color: var(--rust); }

.mini-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--touch-min);
  height: var(--touch-min);
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 1.2rem;
}
.mini-toggle:hover { border-color: var(--teal); }
.mini-toggle[aria-pressed="true"] { background: var(--teal); color: #fff; }

@media (max-width: 640px) {
  .floating-controls { gap: 8px; }
  .fc-bottom-right { bottom: 14px; right: 14px; }
  .fc-bottom-left { bottom: 14px; left: 14px; }
  .porch-light span.label, .quick-exit span.label { display: none; }
}

/* ============ Footer ============ */
.site-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 40px 24px 120px;
  color: var(--ink-faint);
  font-size: 0.85rem;
  max-width: 560px;
  margin: 0 auto;
}
.site-footer nav {
  display: flex;
  gap: 18px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.site-footer nav a {
  color: var(--ink-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
  min-height: var(--touch-min);
  display: inline-flex;
  align-items: center;
}

/* ============ Welcome Mat (onboarding) ============ */
.welcome-mat-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(44, 42, 41, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: overlay-in var(--fade) var(--ease);
}
@keyframes overlay-in { from { opacity: 0; } to { opacity: 1; } }

.welcome-mat-card {
  max-width: 560px;
  width: 100%;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
  animation: mat-rise 0.7s var(--ease);
}
@keyframes mat-rise {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.welcome-mat-logo {
  width: 240px;
  max-width: 75%;
  height: auto;
  border-radius: var(--radius-md);
  margin-bottom: -4px;
}
.promise-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  text-align: left;
}
.promise-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  font-size: 0.95rem;
}
.promise-list .promise-icon { font-size: 1.2rem; }

.gentle-guide {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}
.tour-dots { display: flex; gap: 8px; }
.tour-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--line);
  transition: background 0.3s;
}
.tour-dot.active { background: var(--rust); }

/* ============ Foyer (homepage) ============ */
.mood-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  width: 100%;
  margin-top: 16px;
}
.mood-card {
  min-height: var(--touch-min);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 26px 14px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lift);
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 700;
  text-align: center;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.mood-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-soft); border-color: var(--teal); }
.mood-card .mood-emoji { font-size: 1.8rem; }
@media (max-width: 780px) { .mood-grid { grid-template-columns: repeat(2, 1fr); } }

/* ============ Nightstand ============ */
.nightstand-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lift);
  padding: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}
.active-counter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-soft);
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 0.9rem;
  color: var(--ink-soft);
}
.active-counter .dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--green);
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ============ Garden ============ */
.garden-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  width: 100%;
  margin-top: 12px;
}
@media (max-width: 780px) { .garden-grid { grid-template-columns: 1fr; } }

.reset-circle-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.reset-circle-svg circle.pulse {
  transform-origin: center;
  animation: reset-breathe 19s ease-in-out infinite;
}
@keyframes reset-breathe {
  0%   { r: 40; opacity: 0.55; }
  21%  { r: 90; opacity: 0.9; }   /* inhale ~4s */
  53%  { r: 90; opacity: 0.9; }   /* hold ~7s */
  100% { r: 40; opacity: 0.55; }  /* exhale ~8s */
}
.reset-word {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  color: var(--teal);
}

.sound-window {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sound-track {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  border: 1px solid var(--line);
}
.sound-track button {
  min-width: var(--touch-min);
  min-height: var(--touch-min);
  border-radius: 50%;
  border: none;
  background: var(--teal);
  color: #fff;
  font-size: 1.1rem;
}

.scream-jar-canvas {
  width: 100%;
  height: 160px;
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  border: 1px solid var(--line);
}

/* ============ First Aid Kit (crisis) ============ */
.crisis-hero {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  padding: 36px 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
  box-shadow: var(--shadow-soft);
}
.tel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
}
.tel-link {
  min-height: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border-radius: var(--radius-md);
  background: var(--rust);
  color: #fff9f2;
  font-weight: 700;
  text-decoration: none;
  padding: 10px;
}
.tel-link small { font-weight: 500; opacity: 0.85; font-size: 0.75rem; }
@media (max-width: 560px) { .tel-grid { grid-template-columns: 1fr; } }

.pacer-static {
  width: 140px; height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--teal), var(--blue));
  animation: reset-breathe-simple 12s ease-in-out infinite;
}
@keyframes reset-breathe-simple {
  0%, 100% { transform: scale(0.85); opacity: 0.7; }
  50% { transform: scale(1.15); opacity: 1; }
}

/* ============ Foundation (about) ============ */
.belief-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  width: 100%;
}
.belief-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 20px;
  font-size: 0.95rem;
  text-align: left;
}
@media (max-width: 640px) { .belief-grid { grid-template-columns: 1fr; } }

/* ============ Sensory Thermostat control panel ============ */
.thermostat-panel {
  position: fixed;
  z-index: 50;
  bottom: 24px;
  right: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  padding: 16px;
  width: 240px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ============ Auth (Attic / Living Room) ============ */
.auth-card {
  max-width: 420px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.field-label { font-size: 0.85rem; color: var(--ink-soft); display:block; margin-bottom: 6px; }
.text-input {
  width: 100%;
  min-height: var(--touch-min);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
}
.text-input:focus { outline: none; border-color: var(--teal); }
.textarea-input {
  width: 100%;
  min-height: 140px;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface);
  font-family: inherit;
  font-size: 1.02rem;
  color: var(--ink);
  resize: vertical;
}
.textarea-input:focus { outline: none; border-color: var(--teal); }

.not-connected-note {
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  padding: 20px;
  font-size: 0.92rem;
  color: var(--ink-soft);
}
.not-connected-note code {
  background: var(--surface-soft);
  padding: 2px 6px;
  border-radius: 6px;
}

/* ============ Growth Garden ============ */
.growth-garden {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface-soft);
  border-radius: var(--radius-md);
  padding: 16px 20px;
}
.growth-garden .sprout { font-size: 1.6rem; }

/* ============ The Fireplace (ephemeral burn, reused motif) ============ */
.fireplace-stage {
  position: relative;
  min-height: 90px;
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  justify-content: center;
  gap: 3px 5px;
  padding: 12px;
}
.fireplace-stage.is-burning {
  background: radial-gradient(circle at 50% 100%, rgba(163, 74, 69, 0.18), transparent 70%);
}
.ash-char {
  display: inline-block;
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  color: var(--ink-soft);
  animation: ash-rise 2.4s ease-in forwards;
  animation-delay: var(--d, 0s);
}
@keyframes ash-rise {
  0% { opacity: 1; transform: translateY(0) translateX(0) rotate(0deg); color: var(--ink-soft); }
  30% { color: var(--rust); text-shadow: 0 0 8px rgba(163, 74, 69, 0.6); }
  100% {
    opacity: 0;
    transform: translateY(-70px) translateX(calc(var(--dx, 0) * 1px)) rotate(calc(var(--dx, 0) * 0.6deg));
    filter: blur(4px);
    color: var(--rust);
  }
}

/* ============ Keepsake Box entries ============ */
.entry-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.entry-row:last-child { border-bottom: none; }
.entry-meta { font-size: 0.8rem; color: var(--ink-faint); }
.entry-delete {
  background: none; border: none;
  min-height: var(--touch-min);
  color: var(--ink-faint);
  font-size: 0.8rem;
  text-decoration: underline;
  white-space: nowrap;
}
.entry-delete:hover { color: var(--rust); }

/* ============ Overthinker's Desk ============ */
.overthink-upload {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ============ Living Room: Shared Couch + Leave a Light On ============ */
.couch-post {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.light-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  min-height: var(--touch-min);
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.88rem;
}
.light-btn:hover { border-color: var(--rust); color: var(--rust); }
.light-btn.lit { background: var(--rust); color: #fff9f2; border-color: var(--rust); }

/* ============ The Heavy Blanket ============ */
.heavy-blanket-stage {
  width: 100%;
  max-width: 320px;
  height: 200px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--teal), var(--blue));
  box-shadow: var(--shadow-soft);
  animation: blanket-weight 8s ease-in-out infinite;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff9f2;
  font-family: 'Playfair Display', serif;
  text-align: center;
  padding: 20px;
}
@keyframes blanket-weight {
  0%, 100% { transform: scale(1); opacity: 0.92; }
  50% { transform: scale(1.03); opacity: 1; }
}

/* ============================================================
   SUKOON v4 — Sensory Thermostat & Living World CSS
   ============================================================ */

/* 1. Sensory Thermostat Core classes */
.no-animations,
.no-animations * {
  animation: none !important;
  transition: none !important;
}
.reduce-transparency,
.reduce-transparency * {
  backdrop-filter: none !important;
  opacity: 1 !important;
  box-shadow: none !important;
}
.reduce-transparency .orb,
.reduce-transparency .welcome-mat-overlay {
  background: var(--parchment) !important;
}
.large-text {
  font-size: 1.18rem !important;
}
.large-text .display {
  font-size: clamp(2.4rem, 6vw, 3.8rem) !important;
}
.large-text .display-sm {
  font-size: clamp(1.8rem, 4.5vw, 2.4rem) !important;
}
.large-text p, 
.large-text button, 
.large-text input, 
.large-text textarea, 
.large-text a, 
.large-text li {
  font-size: 1.15rem !important;
}
.freeze-bg .orb,
.freeze-bg .breath-bg *,
.freeze-bg .weather-particle,
.freeze-bg .swaying-tree {
  animation-play-state: paused !important;
}

/* 2. Living World: Time of Day Styles */
[data-time="morning"] {
  background-image:
    radial-gradient(circle at 10% 10%, rgba(254, 245, 231, 0.6), transparent 50%),
    radial-gradient(circle at 85% 92%, rgba(0, 0, 0, 0.03), transparent 40%);
}
[data-time="afternoon"] {
  background-image:
    radial-gradient(circle at 50% 10%, rgba(255, 255, 255, 0.4), transparent 60%),
    radial-gradient(circle at 85% 92%, rgba(0, 0, 0, 0.02), transparent 40%);
}
[data-time="evening"] {
  background-image:
    radial-gradient(circle at 90% 15%, rgba(245, 199, 169, 0.7), transparent 60%),
    radial-gradient(circle at 15% 85%, rgba(184, 131, 111, 0.2), transparent 50%);
}
[data-time="night"] {
  background-image:
    radial-gradient(circle at 80% 15%, rgba(104, 133, 139, 0.25), transparent 50%),
    radial-gradient(circle at 15% 85%, rgba(44, 62, 80, 0.4), transparent 60%);
}
[data-time="nightstand"] {
  --parchment: #0C0A09 !important;
  --parchment-deep: #070605 !important;
  --surface: #141110 !important;
  --surface-soft: #1C1917 !important;
  --ink: #A8A29E !important;
  --ink-soft: #78716C !important;
  --ink-faint: #57524D !important;
  --line: #292524 !important;
  --rust: #78350F !important;
  --rust-deep: #451A03 !important;
  --rust-hover: #B45309 !important;
  --green: #27272A !important;
  --teal: #1E293B !important;
  --blue: #0F172A !important;
  --gold: #78350F !important;
  --shadow-soft: 0 10px 30px rgba(0,0,0,0.8);
  --shadow-lift: 0 5px 15px rgba(0,0,0,0.7);
  background-image: radial-gradient(circle at 50% 0%, rgba(180, 83, 9, 0.12), transparent 60%) !important;
}
[data-time="nightstand"] .orb {
  opacity: 0.03 !important;
}

/* 3. Living World: Season Styles & Accents
   Scoped to [data-theme="day"] specifically. Season and day/night theme are
   independent dimensions that can both be active at once (e.g. monsoon at
   night); without this scoping, a season rule and the night theme rule both
   have equal specificity and whichever comes later in the stylesheet wins
   outright, silently overriding the night palette's dark background with a
   daytime-light one while the text stays night-mode pale, killing contrast. */
[data-theme="day"][data-season="spring"] {
  --green: #82a86b;
  --teal: #507e8b;
}
[data-theme="day"][data-season="monsoon"] {
  --parchment: #E6E8EA;
  --parchment-deep: #D5D8DC;
  --teal: #4b6f7a;
}
[data-theme="day"][data-season="autumn"] {
  --rust: #A05C45;
  --gold: #A98548;
}
[data-theme="day"][data-season="winter"] {
  --parchment: #EFF2F5;
  --teal: #788a9c;
  --blue: #2F4F4F;
}

/* Night-time season accents: shift accent colors only, never parchment/ink/
   surface, so the night palette's contrast is never compromised. */
[data-theme="night"][data-season="spring"] {
  --green: #6f9c68;
  --teal: #3f7a86;
}
[data-theme="night"][data-season="monsoon"] {
  --teal: #4a7986;
}
[data-theme="night"][data-season="autumn"] {
  --rust: #c9704f;
  --gold: #b8925a;
}
[data-theme="night"][data-season="winter"] {
  --teal: #6f8aa0;
  --blue: #37506b;
}

/* Weather Overlays */
.season-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}
.weather-particle {
  position: absolute;
  opacity: var(--p-op, 0.5);
  animation: fall var(--p-dur, 10s) linear infinite;
  will-change: transform;
}
@keyframes fall {
  0% { transform: translateY(-20px) translateX(0) rotate(0deg); }
  100% { transform: translateY(105vh) translateX(var(--p-dx, 30px)) rotate(var(--p-rot, 360deg)); }
}

/* 4. Room Visual Decoration Modules */
/* Living Room Atmosphere Details */
.living-room-decor {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-top: 24px;
  flex-wrap: wrap;
}
.cozy-element {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
}
.cozy-element .lamp-glow {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #F9E79F;
  box-shadow: 0 0 10px #F9E79F;
  animation: flicker 4s ease-in-out infinite;
}
@keyframes flicker {
  0%, 100% { opacity: 0.95; }
  50% { opacity: 0.75; }
}
.cozy-element .tea-steam {
  display: inline-block;
  animation: steam 3s ease-in-out infinite;
}
@keyframes steam {
  0%, 100% { transform: translateY(0) scaleX(1); opacity: 0.4; }
  50% { transform: translateY(-4px) scaleX(1.1); opacity: 0.8; }
}

/* Garden Swaying Trees & Skies */
.garden-decor {
  width: 100%;
  max-width: 480px;
  margin: 20px auto;
  display: flex;
  justify-content: space-around;
  opacity: 0.75;
}
.swaying-tree {
  animation: sway 6s ease-in-out infinite alternate;
  transform-origin: bottom center;
}
@keyframes sway {
  0% { transform: rotate(-2deg); }
  100% { transform: rotate(2deg); }
}

/* Garden fireflies: purely decorative, ambient motion */
.firefly-field {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 40px;
  margin: 0 auto;
  pointer-events: none;
}
.firefly {
  position: absolute;
  bottom: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px 2px var(--gold);
  opacity: 0;
  animation: firefly-drift var(--f-dur, 9s) ease-in-out infinite;
  animation-delay: var(--f-delay, 0s);
  left: var(--f-x, 50%);
}
@keyframes firefly-drift {
  0%   { opacity: 0; transform: translate(0, 0) scale(0.8); }
  15%  { opacity: 0.9; }
  50%  { opacity: 0.5; transform: translate(var(--f-dx, 20px), -60px) scale(1.1); }
  85%  { opacity: 0.9; }
  100% { opacity: 0; transform: translate(calc(var(--f-dx, 20px) * -1), -110px) scale(0.7); }
}
.freeze-bg .firefly,
.no-animations .firefly {
  animation-play-state: paused !important;
}

/* Attic Moonlight and Dust */
.attic-moonlight {
  position: absolute;
  top: 0; left: 25%;
  width: 20%; height: 100%;
  background: linear-gradient(105deg, rgba(255, 255, 255, 0.08), transparent 70%);
  pointer-events: none;
  z-index: 0;
}
.dust-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

/* 5. Companion Chat & Onboarding Rating */
.companion-card {
  margin-top: 28px;
  text-align: left;
}
.chat-log {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 400px;
  overflow-y: auto;
  padding: 10px 4px;
  margin-bottom: 16px;
}
.chat-bubble {
  max-width: 85%;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  line-height: 1.6;
  font-size: 0.98rem;
  animation: bubble-in 0.5s var(--ease) forwards;
}
@keyframes bubble-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.chat-bubble.companion {
  background: var(--surface-soft);
  color: var(--ink);
  border: 1px solid var(--line);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.chat-bubble.user {
  background: var(--rust);
  color: #FFF;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.typing-indicator {
  display: flex;
  gap: 5px;
  align-items: center;
  padding: 8px 16px;
  color: var(--ink-soft);
  font-size: 0.88rem;
  font-style: italic;
}
.typing-indicator span {
  width: 6px; height: 6px;
  background: var(--ink-soft);
  border-radius: 50%;
  animation: typing-dot 1.4s infinite ease-in-out;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing-dot {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* Rating Screen (does weight feel different) */
.reflection-rating-overlay {
  text-align: center;
  animation: soft-fade 0.6s var(--ease);
}
.weather-rating-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  width: 100%;
  margin: 20px 0;
}
.weather-rating-card {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  transition: all 0.25s var(--ease);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}
.weather-rating-card:hover {
  border-color: var(--rust);
  background: var(--surface-soft);
  transform: translateY(-2px);
}
.weather-rating-card .weather-icon {
  font-size: 2rem;
}

/* 6. The Window Visual Scenes & Empty Chair (Safe Room) */
.safe-room-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 30px;
  width: 100%;
  margin-top: 24px;
}
@media(max-width: 768px) {
  .safe-room-layout { grid-template-columns: 1fr; }
}
.window-scenes-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.scene-nav-btn {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 14px;
  border-radius: var(--radius-sm);
  text-align: left;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s;
}
.scene-nav-btn.active {
  background: var(--rust);
  color: #FFF;
  border-color: var(--rust);
}
.scene-nav-btn:hover:not(.active) {
  background: var(--rust-hover);
  border-color: var(--rust);
}
.window-canvas-container {
  position: relative;
  width: 100%;
  height: 380px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #000;
  border: 1px solid var(--line);
}
.window-canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.window-overlay-text {
  position: absolute;
  bottom: 20px; left: 20px;
  color: rgba(255,255,255,0.7);
  font-size: 0.88rem;
  font-family: inherit;
  pointer-events: none;
}

/* Empty Chair feature styles */
.empty-chair-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  align-items: center;
  text-align: left;
}
@media(max-width: 640px) {
  .empty-chair-grid { grid-template-columns: 1fr; }
}
.empty-chair-graphic {
  display: flex;
  justify-content: center;
  align-items: center;
}
.chair-icon {
  width: 160px; height: 160px;
  fill: none;
  stroke: var(--rust);
  stroke-width: 2;
  opacity: 0.8;
  animation: breathe 8s ease-in-out infinite;
}

/* 7. The Haven Dashboard Components */
.haven-dashboard {
  display: flex;
  flex-direction: column;
  gap: 36px;
  width: 100%;
}
.plant-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
  padding: 30px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
@media(max-width: 560px) {
  .plant-box { flex-direction: column; text-align: center; }
}
.plant-svg {
  width: 120px; height: 120px;
}
.plant-stem { fill: none; stroke: var(--green); stroke-width: 4; stroke-linecap: round; }
.plant-leaf { fill: var(--green); }
.plant-pot { fill: var(--rust); }

.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 14px;
}
.timeline-item {
  border-left: 3px solid var(--green);
  padding: 8px 18px;
  text-align: left;
  background: var(--surface-soft);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}
.timeline-date {
  font-size: 0.8rem;
  color: var(--ink-faint);
  margin-bottom: 4px;
}
.timeline-weather-badge {
  font-size: 0.85rem;
  background: var(--surface);
  padding: 6px 12px;
  border-radius: 99px;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  white-space: nowrap;
}

/* Exporter and finite library */
.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  width: 100%;
  margin-top: 16px;
}
.library-category-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: left;
}
.library-item-list {
  list-style: none;
  padding: 0; margin: 12px 0 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.library-item-list li {
  font-size: 0.92rem;
  border-bottom: 1px dashed var(--line);
  padding-bottom: 8px;
}
.library-item-list li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.library-item-list a {
  text-decoration: none;
  font-weight: 600;
  color: var(--teal);
}
.library-item-list a:hover {
  color: var(--rust);
}
.library-item-list span.book-author {
  font-size: 0.8rem;
  color: var(--ink-faint);
  display: block;
}

/* 8. Persistent Thermostat Panel Styles */
.thermostat-toggle-btn {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 10px 18px;
  border-radius: 999px;
  color: var(--ink-soft);
  font-weight: 700;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s;
}
.thermostat-toggle-btn:hover {
  border-color: var(--rust);
  color: var(--rust);
}
.thermostat-overlay {
  position: fixed;
  inset: 0;
  background: rgba(44, 62, 80, 0.4);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: overlay-in 0.4s var(--ease);
}
.thermostat-drawer {
  width: 100%;
  max-width: 600px;
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: 0 -10px 40px rgba(0,0,0,0.15);
  padding: 30px;
  animation: drawer-up 0.4s var(--ease);
  text-align: left;
}
@keyframes drawer-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.thermostat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 16px;
}
@media(max-width: 480px) {
  .thermostat-grid { grid-template-columns: 1fr; }
}
.thermostat-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.thermostat-group label {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}
.thermostat-select {
  width: 100%;
  min-height: var(--touch-min);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.95rem;
}
.thermostat-checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  grid-column: 1 / -1;
  margin-top: 10px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.thermostat-checkbox-item {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
}
.thermostat-checkbox-item input {
  width: 18px; height: 18px;
  cursor: pointer;
}

/* ============ Mobile Viewport Optimizations ============ */
@media (max-width: 768px) {
  .site-header {
    padding: 24px 16px;
    gap: 16px;
  }
  .main-nav {
    gap: 12px 16px;
  }
  .main-nav a {
    font-size: 0.92rem;
    padding: 2px 4px;
  }
  .page-section {
    padding: 40px 16px 60px;
  }
  .card {
    padding: 24px;
    border-radius: var(--radius-md);
  }
  .center {
    gap: 24px;
  }
  .mood-grid {
    gap: 16px !important;
    margin-top: 12px !important;
  }
  .library-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 480px) {
  .mood-grid {
    grid-template-columns: 1fr !important;
  }
  .brand {
    font-size: 1.25rem;
  }
}

/* ============ Speech to text ============ */
.mic-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 1.1rem;
  margin: 8px 0 0 0;
  flex-shrink: 0;
  transition: transform 0.2s var(--ease), border-color 0.2s, color 0.2s, background 0.2s;
}
.mic-btn:hover:not(:disabled) { border-color: var(--rust); color: var(--rust); transform: translateY(-2px); }
.mic-btn.is-listening {
  background: var(--rust);
  color: #fff9f2;
  border-color: var(--rust);
  animation: mic-pulse 1.4s ease-in-out infinite;
}
@keyframes mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(160, 71, 60, 0.5); }
  50% { box-shadow: 0 0 0 8px rgba(160, 71, 60, 0); }
}

