:root {
  color-scheme: dark;
  --bg: #121418;
  --bg-deep: #1c2028;
  --surface: rgba(18, 20, 24, 0.9);
  --surface-strong: #1d222b;
  --text: #f5efe3;
  --muted: #b7b0a1;
  --accent: #d59a3d;
  --accent-dark: #f1c064;
  --accent-soft: rgba(213, 154, 61, 0.16);
  --border: rgba(255, 255, 255, 0.1);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.24);
}

body[data-theme="light"] {
  color-scheme: light;
  --bg: #f7efe2;
  --bg-deep: #efe0c3;
  --surface: rgba(255, 250, 242, 0.84);
  --surface-strong: #fffaf0;
  --text: #2c241c;
  --muted: #6f6457;
  --accent: #b9832d;
  --accent-dark: #84611f;
  --accent-soft: rgba(185, 131, 45, 0.15);
  --border: rgba(44, 36, 28, 0.12);
  --shadow: 0 22px 60px rgba(44, 36, 28, 0.14);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  font-family: "Inter", "Segoe UI", Roboto, Arial, sans-serif;
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg-deep) 100%);
  color: var(--text);
  overflow: hidden;
}

body {
  min-height: 100dvh;
  min-height: 100svh;
}

.page-shell {
  position: relative;
  width: 100%;
  min-height: 100dvh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vw, 40px);
  overflow: hidden;
}

.theme-toggle {
  position: absolute;
  top: 22px;
  right: 24px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.theme-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}

.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  inset: 0;
  background: var(--accent-soft);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.slider::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: var(--text);
  transition: transform 0.2s ease;
}

.switch input:checked + .slider::before {
  transform: translateX(20px);
}

.screen {
  display: none;
  width: 100%;
  height: 100%;
}

.screen.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.intro-screen,
.card-screen {
  min-height: 0;
}

.intro-card,
.card-panel {
  width: 100%;
  max-width: 1200px;
  height: 100%;
  min-height: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.intro-card {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  align-content: start;
  gap: clamp(16px, 3vw, 24px);
  padding: clamp(64px, 10vw, 120px) clamp(32px, 6vw, 72px) clamp(32px, 6vw, 72px);
}

.eyebrow {
  display: inline-block;
  margin: 0 0 12px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent-dark);
}

h1 {
  margin: 0;
  font-size: clamp(2.8rem, 5vw, 5rem);
  line-height: 1;
}

.intro-copy {
  max-width: 760px;
  margin: 22px 0 36px;
  font-size: clamp(1.15rem, 1.8vw, 1.45rem);
  line-height: 1.8;
  color: var(--muted);
}

.primary-btn {
  border: none;
  border-radius: 999px;
  padding: 14px 24px;
  font-size: 1rem;
  font-weight: 700;
  color: white;
  background: linear-gradient(135deg, var(--accent) 0%, #d29b3e 100%);
  cursor: pointer;
  box-shadow: 0 16px 30px rgba(185, 131, 45, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  align-self: flex-start;
  justify-self: start;
}

.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 34px rgba(185, 131, 45, 0.24);
}

.card-panel {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  align-content: start;
  min-height: 100%;
  padding: clamp(28px, 5vw, 80px);
  gap: clamp(18px, 3vh, 32px);
}

.prompt-stack {
  min-height: 0;
  width: 100%;
  max-width: 920px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: clamp(10px, 1.8vh, 16px);
  margin-bottom: auto;
  padding-bottom: clamp(12px, 2vh, 24px);
}

.card-question {
  margin: 0;
  font-size: clamp(2.4rem, 4vw, 4.8rem);
  line-height: 1.05;
  max-width: 100%;
}

.reflection-panel {
  width: 100%;
  max-width: 100%;
  min-height: 64px;
  margin-top: 0;
  padding: 12px 18px;
  border-left: 4px solid var(--accent);
  border-radius: 18px;
  background: rgba(185, 131, 45, 0.08);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
}

.reflection-panel.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity 1.8s ease, transform 1.8s ease;
}



.reflection-text {
  margin: 0;
  font-size: clamp(1.2rem, 2vw, 2rem);
  line-height: 1.45;
  color: var(--muted);
}

.completion-message {
  color: var(--text);
}

.card-actions {
  margin-top: clamp(48px, 8vh, 96px);
  width: 100%;
  padding-top: clamp(28px, 4vh, 40px);
}

[hidden] {
  display: none !important;
}

@media (orientation: landscape) and (max-height: 700px) {
  .page-shell {
    padding: 8px 12px;
  }

  .theme-toggle {
    top: 10px;
    right: 10px;
  }

  .intro-card {
    gap: 10px;
    padding: 40px 20px 16px;
  }

  h1 {
    font-size: clamp(1.5rem, 3.2vh, 2.2rem);
  }

  .intro-copy {
    margin: 0 0 12px;
    font-size: clamp(0.9rem, 1.5vh, 1rem);
    line-height: 1.45;
  }

  .primary-btn {
    padding: 10px 16px;
    font-size: 0.92rem;
  }

  .card-panel {
    padding: 16px 20px;
    gap: 10px;
  }

  .prompt-stack {
    gap: 8px;
  }

  .card-question,
  .completion-message {
    font-size: clamp(1.35rem, 3vh, 2rem);
  }

  .reflection-text {
    font-size: clamp(0.9rem, 1.4vh, 1rem);
  }

  .card-actions {
    margin-top: 14px;
  }
}

@media (max-width: 700px) {
  .page-shell {
    padding: 10px;
  }

  .theme-toggle {
    top: 12px;
    right: 12px;
  }

  .intro-card,
  .card-panel {
    height: 100%;
    min-height: 0;
  }

  .intro-card {
    padding: 96px 20px 20px;
  }

  .card-panel {
    padding: 20px;
    gap: 14px;
  }

  h1 {
    font-size: clamp(1.7rem, 1.2rem + 2vw, 2.7rem);
  }

  .intro-copy {
    font-size: 0.95rem;
  }

  .card-question,
  .completion-message {
    font-size: clamp(1.45rem, 1rem + 1.6vw, 2.2rem);
  }

  .reflection-text {
    font-size: 0.95rem;
  }
}

@media (max-width: 480px) {
  .page-shell {
    padding: 8px;
  }

  .theme-toggle {
    top: 8px;
    right: 8px;
    gap: 6px;
    padding: 6px 10px;
  }

  .theme-label {
    font-size: 0.74rem;
  }

  .intro-card {
    gap: 10px;
    padding: 70px 16px 16px;
  }

  h1 {
    font-size: clamp(1.35rem, 1rem + 1.8vw, 1.9rem);
  }

  .intro-copy {
    margin: 0 0 18px;
    font-size: 0.92rem;
    line-height: 1.55;
  }

  .primary-btn {
    padding: 12px 18px;
    font-size: 0.95rem;
  }

  .card-panel {
    padding: 16px;
    gap: 10px;
  }

  .card-question,
  .completion-message {
    font-size: clamp(1.15rem, 0.95rem + 1.6vw, 1.7rem);
  }

  .reflection-text {
    font-size: 0.9rem;
    line-height: 1.45;
  }
}
