/* ========================================
   getlesslonely.com — Apple circa 2000
   Garamond, white space, editorial restraint
   ======================================== */

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

:root {
  --black: #000000;
  --text: #1a1a1a;
  --gray: #666666;
  --light-gray: #999999;
  --rule: #cccccc;
  --faint: #eeeeee;
  --white: #ffffff;
  --link: #0066cc;
  --link-hover: #003366;
  --transition-section: 500ms ease;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  font-family: 'Garamond', 'Apple Garamond', 'EB Garamond', 'Georgia', 'Times New Roman', serif;
  color: var(--text);
  background: var(--white);
  overflow: hidden;
  height: 100dvh;
  width: 100vw;
}

a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

a:hover {
  color: var(--link-hover);
}

/* ========================================
   Session Timer
   ======================================== */

.session-timer {
  position: fixed;
  top: 14px;
  left: 16px;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--gray);
  font-variant-numeric: tabular-nums;
  z-index: 1000;
  font-family: 'Courier New', Courier, monospace;
  opacity: 0;
  transition: opacity 2s ease;
  user-select: none;
}

.session-timer--visible {
  opacity: 1;
}

/* ========================================
   Music Toggle
   ======================================== */

.music-toggle {
  position: fixed;
  top: 11px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: none;
  border: none;
  padding: 4px;
  opacity: 0;
  transition: opacity 2s ease;
  user-select: none;
  color: var(--gray);
  font-size: 16px;
  line-height: 1;
}

.music-toggle--visible {
  opacity: 1;
}

.music-toggle:hover {
  color: var(--text);
}

.music-toggle svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* ========================================
   Custom 2000s Cursor
   ======================================== */

*, *::before, *::after {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='22' viewBox='0 0 24 28'%3E%3Cpath d='M2 1 L2 22 L7 17 L12 26 L15 24 L10 15 L17 15 Z' fill='%234A90D9' stroke='%23333' stroke-width='1.5' stroke-linejoin='round'/%3E%3C/svg%3E") 2 1, auto !important;
}

a, button, [role="button"], input[type="submit"], label,
.option-btn, .image-option, .landing__cta-link, .chat__send,
.pricing__btn, .pricing__close, .quiz__skip-btn, .music-toggle,
.consent__label, .chat__restart-btn, .chat__upsell-btn {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='22' viewBox='0 0 28 30'%3E%3Cpath d='M9 2 L9 11 L5 11 L5 15 L3 15 L3 23 L5 23 L5 25 L7 25 L7 27 L21 27 L21 25 L23 25 L23 23 L25 23 L25 15 L23 15 L23 11 L19 11 L19 7 L17 7 L17 4 L15 4 L15 2 Z' fill='%23FFB347' stroke='%23333' stroke-width='1.5'/%3E%3C/svg%3E") 9 2, pointer !important;
}

/* ========================================
   Sections
   ======================================== */

.section {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-section);
  overflow-y: auto;
  z-index: 1;
}

.section--active {
  opacity: 1;
  pointer-events: auto;
  z-index: 2;
}

.section--exiting {
  opacity: 0;
  pointer-events: none;
  z-index: 3;
}

/* ========================================
   Landing — editorial paragraph page
   ======================================== */

#landing {
  align-items: center;
  justify-content: center;
  padding: 0;
  overflow: hidden;
}

.landing__zoom-wrapper {
  position: relative;
  width: 160vw;
  height: 200vw;
  transform-origin: center center;
  opacity: 0;
  animation: fadeIn 1s ease 0.3s forwards;
}

@keyframes fadeIn {
  to { opacity: 1; }
}

.landing__person {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.85;
}

/* Text is inside SVG foreignObject — uses px that map to SVG coordinate space */
.landing__content {
  width: 100%;
  height: 100%;
  color: #1a1a1a;
  text-align: center;
  padding: 8px 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-sizing: border-box;
  font-family: 'Times New Roman', Georgia, serif;
  font-style: italic;
}

.landing__title {
  font-size: 9.5px;
  font-weight: normal;
  color: #1a1a1a;
  line-height: 1.35;
  margin: 0 0 5px 0;
}

.landing__body {
  font-size: 8px;
  font-weight: normal;
  color: #333;
  line-height: 1.4;
  margin: 0 0 5px 0;
}

.landing__body + .landing__body {
  margin-top: 0;
}

.landing__cta-line {
  font-size: 9.5px;
  line-height: 1.35;
  margin: 0 0 4px 0;
  color: #1a1a1a;
}

.landing__cta-line + .landing__body {
  margin-top: 8px;
}

.landing__cta-link {
  font-family: inherit;
  font-size: inherit;
  color: #0055aa;
  background: none;
  border: none;
  text-decoration: underline;
  text-underline-offset: 1px;
  padding: 0;
  font-style: italic;
}

.landing__cta-link:hover {
  color: #003366;
}

.landing__disclaimer {
  font-size: 6px;
  color: rgba(0,0,0,0.4);
  line-height: 1.3;
  border-top: 1px solid rgba(0,0,0,0.15);
  padding-top: 3px;
  margin: 0;
  font-style: italic;
}

/* ========================================
   Quiz
   ======================================== */

#quiz {
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

#quiz::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60vh;
  height: 75vh;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 1000'%3E%3Ccircle cx='400' cy='135' r='75' fill='%23E8A84A'/%3E%3Cellipse cx='400' cy='85' rx='70' ry='42' fill='%236B3A10'/%3E%3Cellipse cx='345' cy='110' rx='18' ry='35' fill='%236B3A10'/%3E%3Cellipse cx='455' cy='110' rx='18' ry='35' fill='%236B3A10'/%3E%3Ccircle cx='375' cy='135' r='8' fill='%23333'/%3E%3Ccircle cx='425' cy='135' r='8' fill='%23333'/%3E%3Ccircle cx='377' cy='132' r='3' fill='%23fff'/%3E%3Ccircle cx='427' cy='132' r='3' fill='%23fff'/%3E%3Cpath d='M378 155 Q400 175 422 155' stroke='%23333' stroke-width='4' fill='none' stroke-linecap='round'/%3E%3Crect x='387' y='205' width='26' height='25' rx='5' fill='%23E8A84A'/%3E%3Cpath d='M300 230 Q400 220 500 230 L520 580 Q400 600 280 580 Z' fill='%236B8DB8'/%3E%3Cpath d='M300 260 Q200 300 40 350 Q20 355 15 370 Q10 390 30 395 Q50 398 120 380 L300 340' fill='%23E8A84A'/%3E%3Cpath d='M500 260 Q600 300 760 350 Q780 355 785 370 Q790 390 770 395 Q750 398 680 380 L500 340' fill='%23E8A84A'/%3E%3Ccircle cx='22' cy='378' r='18' fill='%23E8A84A'/%3E%3Ccircle cx='778' cy='378' r='18' fill='%23E8A84A'/%3E%3Crect x='290' y='570' width='220' height='18' rx='4' fill='%23A33525'/%3E%3Crect x='388' y='566' width='24' height='26' rx='3' fill='%23C9A830'/%3E%3Cpath d='M320 588 L310 850 Q310 860 320 860 L370 860 Q380 860 378 850 L360 588' fill='%234D5A9A'/%3E%3Cpath d='M440 588 L422 850 Q420 860 430 860 L480 860 Q490 860 490 850 L480 588' fill='%234D5A9A'/%3E%3Cellipse cx='345' cy='870' rx='45' ry='22' fill='%23C04535'/%3E%3Cellipse cx='455' cy='870' rx='45' ry='22' fill='%23C04535'/%3E%3C/svg%3E") no-repeat center center;
  background-size: contain;
  opacity: 0.06;
  pointer-events: none;
  z-index: 0;
}

.quiz__progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--faint);
  z-index: 100;
}

.quiz__progress-bar {
  height: 100%;
  width: 0;
  background: var(--rule);
  transition: width 700ms ease;
}

.quiz__counter {
  position: fixed;
  top: 14px;
  right: 16px;
  font-size: 12px;
  font-weight: 400;
  color: var(--gray);
  font-variant-numeric: tabular-nums;
  z-index: 100;
  font-family: 'Courier New', Courier, monospace;
  letter-spacing: 0.05em;
}

.quiz__container {
  width: 100%;
  max-width: 520px;
  padding: 2rem;
  z-index: 1;
}

/* Question card */
.question-card {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 400ms ease, transform 400ms ease;
}

.question-card--active {
  opacity: 1;
  transform: translateY(0);
}

.question-card--exiting {
  opacity: 0;
  transform: translateY(-15px);
  transition: opacity 250ms ease, transform 250ms ease;
}

.question__text {
  font-size: 1.2rem;
  font-weight: normal;
  line-height: 1.65;
  margin-bottom: 2rem;
  color: var(--text);
}

.question__subtext {
  font-size: 0.9rem;
  color: var(--gray);
  margin-top: -1.25rem;
  margin-bottom: 2rem;
  font-style: italic;
}

/* Options */
.option-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.option-btn {
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: normal;
  padding: 0.75rem 1rem;
  border: 1px solid var(--rule);
  border-radius: 0;
  background: var(--white);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: border-color 150ms ease, background 150ms ease;
  line-height: 1.5;
}

.option-btn:hover {
  border-color: var(--gray);
  background: #fafafa;
}

.option-btn:active {
  background: var(--faint);
}

.option-btn--selected {
  border-color: var(--black);
  background: var(--faint);
}

/* Scale */
.scale-container {
  padding: 1rem 0;
}

.scale-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--light-gray);
  margin-bottom: 0.75rem;
  font-style: italic;
}

.scale-input {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 1px;
  background: var(--rule);
  outline: none;
  cursor: pointer;
}

.scale-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--black);
  cursor: pointer;
  transition: transform 100ms ease;
}

.scale-input::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.scale-input::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--black);
  cursor: pointer;
  border: none;
}

.scale-value {
  text-align: center;
  font-size: 2.5rem;
  font-weight: normal;
  margin-top: 1rem;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.scale-comment {
  text-align: center;
  font-size: 0.85rem;
  color: var(--gray);
  margin-top: 0.5rem;
  min-height: 1.5em;
  transition: opacity 200ms ease;
  font-style: italic;
}

.scale-submit {
  display: block;
  margin: 2rem auto 0;
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0.5rem 1.5rem;
  border: 1px solid var(--black);
  background: var(--white);
  color: var(--black);
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}

.scale-submit:hover {
  background: var(--black);
  color: var(--white);
}

/* Image selection */
.image-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.image-option {
  border: 1px solid var(--rule);
  padding: 1.25rem 0.75rem 1rem;
  cursor: pointer;
  text-align: center;
  transition: border-color 150ms ease, background 150ms ease;
  background: var(--white);
}

.image-option:hover {
  border-color: var(--gray);
  background: #fafafa;
}

.image-option:active {
  background: var(--faint);
}

.image-option--selected {
  border-color: var(--black);
  border-width: 2px;
}

.image-option svg {
  width: 52px;
  height: 52px;
  margin-bottom: 0.5rem;
  display: block;
  margin-left: auto;
  margin-right: auto;
  color: var(--gray);
}

.image-option__label {
  font-size: 0.8rem;
  color: var(--gray);
  line-height: 1.35;
}

/* Text input */
.text-input-container {
  position: relative;
}

.text-input {
  font-family: inherit;
  font-size: 1rem;
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--rule);
  outline: none;
  transition: border-color 150ms ease;
  background: var(--white);
  color: var(--text);
}

.text-input:focus {
  border-color: var(--black);
}

.text-input-counter {
  font-size: 0.7rem;
  color: var(--light-gray);
  text-align: right;
  margin-top: 0.4rem;
  font-family: 'Courier New', Courier, monospace;
}

.text-input-feedback {
  font-size: 0.85rem;
  color: var(--gray);
  margin-top: 0.75rem;
  min-height: 1.5em;
  font-style: italic;
}

.text-submit {
  display: block;
  margin: 1.5rem auto 0;
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0.5rem 1.5rem;
  border: 1px solid var(--black);
  background: var(--white);
  color: var(--black);
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}

.text-submit:hover {
  background: var(--black);
  color: var(--white);
}

/* Skip */
.quiz__skip {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  font-size: 0.85rem;
  color: var(--light-gray);
  opacity: 0;
  pointer-events: none;
  transition: opacity 400ms ease;
  z-index: 50;
  width: calc(100% - 3rem);
  max-width: 400px;
}

.quiz__skip--visible {
  opacity: 1;
  pointer-events: auto;
}

.quiz__skip-btn {
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--link);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  margin-top: 0.3rem;
}

.quiz__skip-btn:hover {
  color: var(--link-hover);
}

/* ========================================
   Loading
   ======================================== */

#loading {
  flex-direction: column;
  gap: 1.5rem;
}

.loading__content {
  text-align: center;
}

.loading__text {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.8rem;
  color: var(--light-gray);
  transition: opacity 200ms ease;
  min-height: 1.5em;
  letter-spacing: 0.03em;
}

.loading__dots {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin-top: 1.25rem;
}

.loading__dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--light-gray);
  animation: dotPulse 1.2s ease-in-out infinite;
}

.loading__dot:nth-child(2) { animation-delay: 200ms; }
.loading__dot:nth-child(3) { animation-delay: 400ms; }

@keyframes dotPulse {
  0%, 60%, 100% { opacity: 0.2; }
  30% { opacity: 1; }
}

.loading__bar {
  width: 100px;
  height: 1px;
  background: var(--faint);
  margin: 1.5rem auto 0;
  overflow: hidden;
}

.loading__bar-fill {
  height: 100%;
  width: 0;
  background: var(--rule);
  transition: width cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   Results
   ======================================== */

#results {
  align-items: flex-start;
  padding-top: 4rem;
}

.results__content {
  max-width: 600px;
  width: 100%;
  padding: 2rem;
  margin: 0 auto;
}

.results__title {
  font-size: 1.3rem;
  font-weight: normal;
  font-style: italic;
  text-align: center;
  margin-bottom: 3rem;
  color: var(--text);
  line-height: 1.5;
}

.results__cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  border: 1px solid var(--rule);
}

.result-card {
  background: var(--white);
  border: none;
  padding: 1.5rem;
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 400ms ease, transform 400ms ease;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.result-card:nth-child(2n) {
  border-right: none;
}

.result-card--visible {
  opacity: 1;
  transform: translateY(0);
}

.result-card--cta {
  grid-column: 1 / -1;
  text-align: center;
  border-right: none;
  border-bottom: none;
  border-top: 1px solid var(--rule);
  padding: 2rem 1.5rem;
}

.result-card__icon {
  margin-bottom: 0.5rem;
}

.result-card__icon svg {
  width: 32px;
  height: 32px;
  color: var(--gray);
}

.result-card__title {
  font-size: 1rem;
  font-weight: bold;
  margin-bottom: 0.15rem;
}

.result-card__subtitle {
  font-size: 0.65rem;
  color: var(--light-gray);
  font-weight: normal;
  letter-spacing: 0.05em;
  margin-bottom: 0.6rem;
  text-transform: uppercase;
  font-family: 'Courier New', Courier, monospace;
}

.result-card__desc {
  font-size: 0.85rem;
  color: var(--gray);
  line-height: 1.6;
}

.result-card__btn {
  display: inline-block;
  margin-top: 1.25rem;
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.6rem 2rem;
  border: 1px solid var(--black);
  background: var(--white);
  color: var(--black);
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}

.result-card__btn:hover {
  background: var(--black);
  color: var(--white);
}

/* ========================================
   Consent Modal
   ======================================== */

.consent-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
  padding: 1rem;
}

.consent-overlay--active {
  opacity: 1;
  pointer-events: auto;
}

.consent__modal {
  background: var(--white);
  border: 1px solid var(--rule);
  padding: 2.5rem;
  max-width: 460px;
  width: 100%;
  transform: translateY(15px);
  transition: transform 400ms ease;
}

.consent-overlay--active .consent__modal {
  transform: translateY(0);
}

.consent__title {
  font-size: 1.15rem;
  font-weight: bold;
  margin-bottom: 1rem;
}

.consent__text {
  font-size: 0.9rem;
  color: var(--gray);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.consent__label {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  cursor: pointer;
  margin-bottom: 1.5rem;
}

.consent__label input[type="checkbox"] {
  display: none;
}

.consent__checkmark {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border: 1px solid var(--rule);
  margin-top: 3px;
  transition: border-color 150ms ease, background 150ms ease;
  position: relative;
}

.consent__label:hover .consent__checkmark {
  border-color: var(--gray);
}

.consent__label input[type="checkbox"]:checked + .consent__checkmark {
  background: var(--black);
  border-color: var(--black);
}

.consent__label input[type="checkbox"]:checked + .consent__checkmark::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 8px;
  border: solid var(--white);
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}

.consent__label-text {
  font-size: 0.8rem;
  color: var(--gray);
  line-height: 1.6;
}

.consent__btn {
  display: block;
  width: 100%;
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0.65rem;
  border: 1px solid var(--rule);
  background: var(--faint);
  color: var(--light-gray);
  cursor: not-allowed;
  transition: background 200ms ease, color 200ms ease, border-color 200ms ease;
}

.consent__btn--active {
  background: var(--white);
  color: var(--black);
  border-color: var(--black);
  cursor: pointer;
}

.consent__btn--active:hover {
  background: var(--black);
  color: var(--white);
}

/* ========================================
   Chat
   ======================================== */

#chat {
  flex-direction: column;
  align-items: stretch;
  padding: 0;
}

.chat__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.25rem;
  padding-top: 2rem;
  border-bottom: 1px solid var(--rule);
  flex-shrink: 0;
}

.chat__header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chat__companion-name {
  font-weight: bold;
  font-size: 0.95rem;
}

.chat__status {
  font-size: 0.7rem;
  color: #338833;
  display: flex;
  align-items: center;
  gap: 4px;
}

.chat__status::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #338833;
}

.chat__header-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.chat__restart-text {
  font-size: 0.75rem;
  color: var(--light-gray);
}

.chat__restart-btn {
  font-family: inherit;
  font-size: 0.75rem;
  color: var(--link);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 0;
}

.chat__restart-btn:hover {
  color: var(--link-hover);
}

.chat__messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.chat-bubble {
  max-width: 75%;
  padding: 0.65rem 0.9rem;
  font-size: 0.9rem;
  line-height: 1.6;
  opacity: 0;
  transform: translateY(6px);
  animation: bubbleIn 250ms ease forwards;
}

@keyframes bubbleIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  opacity: 0;
  transform: translateY(6px);
  animation: bubbleIn 250ms ease forwards;
}

.chat-row--companion {
  align-self: flex-start;
}

.chat-avatar {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.chat-avatar svg {
  width: 100%;
  height: 100%;
}

.chat-row .chat-bubble {
  opacity: 1;
  transform: none;
  animation: none;
}

.chat-row .chat-typing {
  opacity: 1;
  transform: none;
  animation: none;
}

.chat-bubble--companion {
  background: var(--faint);
  color: var(--text);
  align-self: flex-start;
  border: 1px solid var(--rule);
}

.chat-bubble--user {
  background: var(--text);
  color: var(--white);
  align-self: flex-end;
}

.chat-typing {
  align-self: flex-start;
  padding: 0.65rem 0.9rem;
  display: flex;
  gap: 4px;
  opacity: 0;
  animation: bubbleIn 200ms ease forwards;
  background: var(--faint);
  border: 1px solid var(--rule);
}

.chat-typing__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--light-gray);
  animation: typingBounce 1.2s ease-in-out infinite;
}

.chat-typing__dot:nth-child(2) { animation-delay: 150ms; }
.chat-typing__dot:nth-child(3) { animation-delay: 300ms; }

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

.chat__input-area {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--rule);
  flex-shrink: 0;
  touch-action: auto;
}

.chat__input {
  flex: 1;
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--rule);
  outline: none;
  transition: border-color 150ms ease;
  background: var(--white);
  color: var(--text);
}

.chat__input:focus {
  border-color: var(--black);
}

.chat__input:disabled {
  background: var(--faint);
  cursor: not-allowed;
}

.chat__send {
  font-family: inherit;
  font-size: 0.85rem;
  padding: 0.6rem 1rem;
  border: 1px solid var(--black);
  background: var(--white);
  color: var(--black);
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}

.chat__send:hover {
  background: var(--black);
  color: var(--white);
}

.chat__send:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Upsell */
.chat__upsell {
  position: fixed;
  bottom: 68px;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  background: var(--white);
  border: 1px solid var(--rule);
  padding: 0.75rem 1rem;
  max-width: 480px;
  width: calc(100% - 2rem);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  opacity: 0;
  pointer-events: none;
  transition: transform 400ms ease, opacity 400ms ease;
  z-index: 50;
}

.chat__upsell--visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.chat__upsell p {
  font-size: 0.75rem;
  color: var(--gray);
  line-height: 1.5;
  flex: 1;
}

.chat__upsell-btn {
  font-family: inherit;
  font-size: 0.75rem;
  color: var(--link);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}

.chat__upsell-btn:hover {
  color: var(--link-hover);
}

/* Pricing */
.pricing-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
  padding: 1rem;
}

.pricing-overlay--active {
  opacity: 1;
  pointer-events: auto;
}

.pricing__modal {
  background: var(--white);
  border: 1px solid var(--rule);
  padding: 2.5rem;
  max-width: 680px;
  width: 100%;
  position: relative;
  transform: translateY(15px);
  transition: transform 400ms ease;
}

.pricing-overlay--active .pricing__modal {
  transform: translateY(0);
}

.pricing__close {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  font-size: 1.25rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--light-gray);
  line-height: 1;
}

.pricing__close:hover {
  color: var(--black);
}

.pricing__title {
  font-size: 1.3rem;
  font-weight: bold;
  text-align: center;
  margin-bottom: 2rem;
}

.pricing__plans {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1px solid var(--rule);
}

.pricing__plan {
  border-right: 1px solid var(--rule);
  padding: 1.5rem 1rem;
  text-align: center;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pricing__plan:last-child {
  border-right: none;
}

.pricing__plan--featured {
  background: #fafafa;
}

.pricing__badge {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--black);
  color: var(--white);
  font-size: 0.6rem;
  font-weight: normal;
  padding: 1px 8px;
  font-family: 'Courier New', Courier, monospace;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.pricing__plan h4 {
  font-size: 1rem;
  font-weight: bold;
  margin-bottom: 0.4rem;
}

.pricing__price {
  font-size: 1.5rem;
  font-weight: normal;
  margin-bottom: 0.6rem;
  font-style: italic;
}

.pricing__desc {
  font-size: 0.75rem;
  color: var(--gray);
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

.pricing__btn {
  font-family: inherit;
  font-size: 0.8rem;
  padding: 0.45rem 1rem;
  border: 1px solid var(--rule);
  background: var(--white);
  color: var(--text);
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
  width: 100%;
  margin-top: auto;
}

.pricing__btn:hover {
  border-color: var(--black);
}

.pricing__btn--primary {
  background: var(--black);
  border-color: var(--black);
  color: var(--white);
}

.pricing__btn--primary:hover {
  background: var(--text);
}

.pricing__punchline {
  text-align: center;
  margin-top: 1.75rem;
  font-size: 1rem;
  font-weight: normal;
  font-style: italic;
  color: var(--text);
  min-height: 1.5em;
  opacity: 0;
  transition: opacity 500ms ease;
}

.pricing__punchline--visible {
  opacity: 1;
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 640px) {
  .question__text {
    font-size: 1.05rem;
  }

  .quiz__container {
    padding: 1.5rem 1.25rem;
  }

  .option-btn {
    font-size: 0.9rem;
    padding: 0.85rem 1rem;
    min-height: 44px;
  }

  .image-grid {
    gap: 0.5rem;
  }

  .image-option {
    padding: 1rem 0.5rem 0.75rem;
  }

  .image-option svg {
    width: 44px;
    height: 44px;
  }

  .image-option__label {
    font-size: 0.7rem;
  }

  .scale-submit,
  .text-submit {
    min-height: 44px;
    padding: 0.6rem 2rem;
  }

  .results__content {
    padding: 1.5rem 1.25rem;
  }

  .results__cards {
    grid-template-columns: 1fr;
  }

  .results__cards .result-card {
    border-right: none;
  }

  .pricing__modal {
    padding: 1.5rem;
  }

  .pricing__plans {
    grid-template-columns: 1fr;
  }

  .pricing__plan {
    border-right: none;
    border-bottom: 1px solid var(--rule);
  }

  .pricing__plan:last-child {
    border-bottom: none;
  }

  .consent__modal {
    padding: 1.5rem;
  }

  .chat__header {
    padding: 0.6rem 1rem;
    padding-top: 1.75rem;
  }

  .chat__header-right .chat__restart-text {
    display: none;
  }

  .chat__messages {
    padding: 1rem;
  }

  .chat-bubble {
    max-width: 85%;
    font-size: 0.85rem;
  }

  .chat__input-area {
    padding: 0.6rem 1rem;
  }

  .chat__input {
    font-size: 16px; /* prevents iOS zoom */
  }

  .chat__upsell {
    flex-direction: column;
    text-align: center;
    bottom: 56px;
  }

  .quiz__skip {
    bottom: 1.5rem;
  }
}

@media (max-width: 380px) {
  .image-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem;
  }

  .image-option svg {
    width: 36px;
    height: 36px;
  }

  .pricing__title {
    font-size: 1.1rem;
  }
}

/* ========================================
   Reduced Motion
   ======================================== */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
