/* ============================================================
   THE ATTACHMENT MIRROR — design tokens
   Palette built around a warm, muted "dusk study" feeling —
   deliberately avoiding the generic cream+terracotta AI default.
   Each attachment dimension gets its own quiet accent so color
   carries information (sage=secure, rose=anxious, slate=avoidant,
   mauve=fearful-avoidant), used sparingly.
   ============================================================ */

:root {
  /* Surfaces — warm violet */
  --bg: #F3E9FA;
  --bg-soft: #E4D6F0;
  --surface: #FBF7FC;
  --surface-raised: #FFFFFF;

  /* Ink */
  --ink: #3E2461;
  --ink-soft: #5B3A82;
  --ink-faint: #8B70A8;

  /* Brand / primary accent */
  --plum: #3E2461;
  --plum-light: #5B3A82;
  --gold: #8B5FAE;

  /* Dimension accents — kept within the warm violet family */
  --sage: #7A9E8E;      /* secure */
  --rose: #C77FA0;      /* anxious */
  --slate: #6B7FB0;     /* avoidant */
  --mauve: #8A5A9E;     /* fearful-avoidant */

  --border: rgba(62, 36, 97, 0.14);
  --border-soft: rgba(62, 36, 97, 0.08);
  --shadow-color: 62, 36, 97;

  --font-ui: 'Quicksand', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Baloo 2', 'Quicksand', -apple-system, sans-serif;

  --radius-s: 10px;
  --radius-m: 18px;
  --radius-l: 30px;

  --max-width: 1180px;
  --max-width-narrow: 760px;
}

/* ============================================================
   RESET
   ============================================================ */

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

html {
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  margin: 0;
  color: var(--ink);
}

p { margin: 0; }

a { color: inherit; }

ul { margin: 0; padding: 0; list-style: none; }

button { font-family: inherit; }

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.wrap--narrow {
  max-width: var(--max-width-narrow);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--plum);
  color: #fff;
  padding: 12px 20px;
  z-index: 200;
  border-radius: 0 0 8px 0;
}
.skip-link:focus {
  left: 0;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-ui);
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  padding: 15px 30px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  min-height: 48px;
}

.btn-primary {
  background: var(--plum);
  color: var(--surface);
  box-shadow: 0 10px 24px -10px rgba(62, 36, 97, 0.55);
}
.btn-primary:hover { background: var(--plum-light); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-outline {
  background: transparent;
  color: var(--plum);
  border: 2px solid var(--gold);
}
.btn-outline:hover { background: var(--bg-soft); transform: translateY(-1px); }

.btn-ghost {
  background: transparent;
  color: var(--plum);
  border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--plum); background: rgba(62,36,97,0.05); }

.btn-lg { padding: 16px 34px; font-size: 1rem; }

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

/* ============================================================
   HEADER
   ============================================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(243, 233, 250, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 16px;
  padding-bottom: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}
.brand-mark { color: var(--plum); display: inline-flex; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
  color: var(--plum);
}

/* ============================================================
   HERO
   ============================================================ */

.hero {
  padding: 72px 0 96px;
  overflow: hidden;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: center;
}

@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 48px;
  }
  .hero-visual { order: -1; }
}

.eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
  margin: 0 0 18px;
}
.eyebrow--center { text-align: center; }

.mirror-heading {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  color: var(--plum);
  margin-bottom: 18px;
}

.hero-sub {
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  color: var(--ink-soft);
  max-width: 40ch;
  margin-bottom: 32px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

/* Hero visual: an abstract "mirror" object built from CSS only */
.hero-visual {
  display: flex;
  justify-content: center;
}

.mirror-object {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(320px, 80vw);
}

.mirror-glass {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 50% 50% 46% 46% / 58% 58% 42% 42%;
  background:
    radial-gradient(120% 130% at 30% 20%, rgba(255,255,255,0.65), transparent 55%),
    linear-gradient(160deg, #B79AD6 0%, #6B3FA0 55%, #3E2461 100%);
  border: 10px solid var(--surface-raised);
  outline: 2px solid var(--border);
  box-shadow:
    0 30px 60px -20px rgba(var(--shadow-color), 0.45),
    inset 0 0 40px rgba(0,0,0,0.25);
  overflow: hidden;
}

.mirror-sheen {
  position: absolute;
  top: -20%;
  left: -30%;
  width: 60%;
  height: 140%;
  background: linear-gradient(120deg, rgba(255,255,255,0.5), transparent 60%);
  transform: rotate(18deg);
  animation: sheen-drift 9s ease-in-out infinite;
}

@keyframes sheen-drift {
  0%, 100% { transform: rotate(18deg) translateX(0); opacity: 0.8; }
  50% { transform: rotate(18deg) translateX(40px); opacity: 0.5; }
}

.mirror-ripple {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.35);
}
.mirror-ripple--1 { width: 70%; height: 70%; top: 15%; left: 15%; }
.mirror-ripple--2 { width: 44%; height: 44%; top: 28%; left: 28%; border-color: rgba(255,255,255,0.22); }

.mirror-stand {
  width: 14px;
  height: 46px;
  background: linear-gradient(180deg, var(--surface-raised), var(--bg-soft));
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 6px 6px;
  margin-top: -2px;
}

/* ============================================================
   SECTION SHELL
   ============================================================ */

.section { padding: 88px 0; }
.section-title {
  font-size: clamp(1.7rem, 3.4vw, 2.3rem);
  text-align: center;
  max-width: 30ch;
  margin: 0 auto 18px;
}
.section-lede {
  text-align: center;
  max-width: 58ch;
  margin: 0 auto 48px;
  color: var(--ink-soft);
  font-size: 1.02rem;
}
.section-footnote {
  text-align: center;
  max-width: 56ch;
  margin: 48px auto 0;
  color: var(--ink-faint);
  font-size: 0.92rem;
  font-style: italic;
}

/* ============================================================
   ATTACHMENT STYLE CARDS
   ============================================================ */

.styles-section { background: var(--surface); }

.style-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

@media (max-width: 980px) {
  .style-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .style-grid { grid-template-columns: 1fr; }
}

.style-card {
  background: var(--surface-raised);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-m);
  padding: 30px 24px;
  position: relative;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.style-card::before {
  content: "";
  position: absolute;
  left: 0; top: 24px; bottom: 24px;
  width: 3px;
  border-radius: 3px;
  background: var(--accent);
  opacity: 0.7;
}
.style-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 34px -20px rgba(var(--shadow-color), 0.35);
  border-color: var(--border);
}
.style-card__icon {
  display: inline-block;
  font-size: 1.3rem;
  color: var(--accent);
  margin-bottom: 14px;
}
.style-card h3 {
  font-size: 1.15rem;
  margin-bottom: 10px;
}
.style-card p {
  font-size: 0.92rem;
  color: var(--ink-soft);
}

/* ============================================================
   QUIZ INTRO
   ============================================================ */

.quiz-intro { text-align: center; }

.disclaimer-box {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-m);
  padding: 20px 26px;
  margin: 8px 0 36px;
  text-align: left;
  font-size: 0.92rem;
  color: var(--ink-soft);
}
.disclaimer-box strong { color: var(--ink); }

.quiz-intro-actions { margin-top: 8px; }

/* ============================================================
   QUIZ
   ============================================================ */

.quiz-section { padding-top: 56px; }

.quiz-progress { margin-bottom: 40px; }
.quiz-progress__meta {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
  font-size: 0.85rem;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}

.progress-track {
  height: 6px;
  border-radius: 999px;
  background: var(--bg-soft);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 3.33%;
  background: linear-gradient(90deg, var(--gold), var(--plum));
  border-radius: 999px;
  transition: width 0.45s cubic-bezier(0.65, 0, 0.35, 1);
}

.question-card {
  border: none;
  margin: 0 0 32px;
  padding: 0;
  animation: card-in 0.4s ease both;
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.question-text {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.6vw, 1.6rem);
  line-height: 1.4;
  color: var(--ink);
  padding: 0;
  margin: 0 0 32px;
  text-align: center;
}

.likert {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.likert-option {
  position: relative;
}

.likert-option input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.likert-option label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  background: var(--surface-raised);
  cursor: pointer;
  min-height: 56px;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
  font-size: 0.98rem;
}

.likert-option label:hover {
  border-color: var(--plum-light);
}

.likert-option input:focus-visible + label {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.likert-option input:checked + label {
  background: var(--plum);
  border-color: var(--plum);
  color: #F6F1EA;
  transform: translateX(2px);
}

.likert-marker {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  flex-shrink: 0;
  position: relative;
}
.likert-option input:checked + label .likert-marker::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: currentColor;
}

.quiz-nav {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

/* ============================================================
   RESULTS
   ============================================================ */

.results-section { background: var(--surface); }

.results-header { text-align: center; margin-bottom: 56px; }

.result-title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.5rem, 3.4vw, 2.1rem);
  color: var(--plum);
  margin: 8px 0 20px;
}

.result-summary {
  max-width: 58ch;
  margin: 0 auto;
  color: var(--ink-soft);
  font-size: 1.02rem;
}

.reflection-profile {
  background: var(--surface-raised);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-m);
  padding: 32px 30px;
  margin-bottom: 56px;
}
.reflection-profile h3 {
  font-size: 1.2rem;
  margin-bottom: 6px;
}
.profile-note {
  font-size: 0.86rem;
  color: var(--ink-faint);
  margin-bottom: 26px;
}

.score-bars {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.score-bar-row__head {
  display: flex;
  justify-content: space-between;
  font-size: 0.92rem;
  margin-bottom: 8px;
}
.score-bar-row__head strong { font-weight: 500; }

.score-bar-track {
  height: 10px;
  border-radius: 999px;
  background: var(--bg-soft);
  overflow: hidden;
}
.score-bar-fill {
  height: 100%;
  border-radius: 999px;
  width: 0%;
  transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
}

.result-body {
  display: flex;
  flex-direction: column;
  gap: 40px;
  margin-bottom: 56px;
}

.result-block h3 {
  font-size: 1.15rem;
  margin-bottom: 12px;
  color: var(--plum);
}
.result-block p { color: var(--ink-soft); margin-bottom: 10px; }
.result-block ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.result-block li {
  position: relative;
  padding-left: 22px;
  color: var(--ink-soft);
}
.result-block li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--gold);
}

.reflection-questions {
  background: var(--bg-soft);
  border-radius: var(--radius-m);
  padding: 32px 30px;
  margin-bottom: 56px;
}
.reflection-questions h3 { margin-bottom: 18px; font-size: 1.15rem; }
.reflection-questions ul {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.reflection-questions li {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.02rem;
  color: var(--ink);
  padding-left: 20px;
  border-left: 2px solid var(--gold);
}

.result-actions {
  text-align: center;
  margin-bottom: 72px;
}
.result-actions h3 { margin-bottom: 18px; font-size: 1.1rem; }
.action-buttons {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}
.share-feedback {
  margin-top: 14px;
  font-size: 0.86rem;
  color: var(--ink-soft);
  min-height: 1.2em;
}

/* Book CTA */
.book-cta { text-align: center; }
.book-cta h3 { font-size: 1.4rem; margin-bottom: 14px; }
.book-cta > p {
  max-width: 52ch;
  margin: 0 auto 36px;
  color: var(--ink-soft);
}

.book-card {
  display: flex;
  align-items: stretch;
  gap: 28px;
  max-width: 620px;
  margin: 0 auto;
  background: var(--surface-raised);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-m);
  padding: 24px;
  text-align: left;
}

@media (max-width: 560px) {
  .book-card { flex-direction: column; text-align: center; }
}

.book-cover {
  flex-shrink: 0;
  width: 140px;
  height: 200px;
  border-radius: 6px;
  background: linear-gradient(160deg, #D6BEEA 0%, #8B5FAE 55%, #3E2461 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 16px;
  color: var(--surface);
  box-shadow: 0 16px 30px -14px rgba(var(--shadow-color), 0.5);
  margin: 0 auto;
}
.book-cover__title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1rem;
  margin-bottom: 10px;
}
.book-cover__sub {
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  opacity: 0.8;
  line-height: 1.5;
}

.book-card__body { flex: 1; }
.book-card__body h4 { font-size: 1.1rem; margin-bottom: 8px; }
.book-card__body p { color: var(--ink-soft); font-size: 0.92rem; margin-bottom: 18px; }
.book-bonus-note {
  background: var(--bg-soft);
  border-radius: var(--radius-s);
  padding: 10px 14px;
  font-size: 0.86rem !important;
  color: var(--ink) !important;
  margin-bottom: 20px !important;
}
.book-bonus-note strong { color: var(--plum); }

.disclaimer-footnote {
  text-align: center;
  max-width: 60ch;
  margin: 0 auto;
  font-size: 0.84rem;
  color: var(--ink-faint);
  font-style: italic;
}

/* ============================================================
   FOOTER
   ============================================================ */

.site-footer {
  padding: 40px 0 60px;
  text-align: center;
  border-top: 1px solid var(--border-soft);
}
.footer-brand {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--plum);
  margin-bottom: 8px;
}
.footer-privacy {
  font-size: 0.82rem;
  color: var(--ink-faint);
  max-width: 50ch;
  margin: 0 auto;
}

/* ============================================================
   PRINT
   ============================================================ */

@media print {
  .site-header, .site-footer, .hero, .styles-section, .quiz-intro,
  .quiz-section, .result-actions, .book-cta, .skip-link {
    display: none !important;
  }
  .results-section { padding: 0; background: #fff; }
  body { background: #fff; }
  .reflection-profile, .reflection-questions { border: 1px solid #ccc; }
}
