/* ============================================================
   SOULSPELL STUDIO — THE HEART LIBRARY
   Brand stylesheet
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=IM+Fell+Double+Pica:ital@0;1&display=swap');

@font-face {
  font-family: 'HV Fitzgerald';
  src: url('https://static.showit.co/file/cdBvoXraQFStjGznakWGUw/132766/hv_fitzgerald_regular.woff') format('woff');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'HV Fitzgerald';
  src: url('https://static.showit.co/file/cjFfyyxKQquO4obdPgj9mg/132766/hv_fitzgerald_italic.woff') format('woff');
  font-weight: normal;
  font-style: italic;
}

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --gold:       #927144;
  --gold-light: #b89a6a;
  --cream:      #e6ddd0;
  --cream-dark: #d9cdc0;
  --wine:       #531824;
  --coral:      #ff6f4a;
  --ink:        #927144;
  --ink-light:  #927144;
  --bg:         #e6ddd0;
  --bg-warm:    #e6ddd0;
  --white-soft: rgba(255, 255, 255, 0.55);

  --font-title:  'HV Fitzgerald', serif;
  --font-body:   'IM Fell Double Pica', serif;

  --max-w: 720px;
  --transition: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.75;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Subtle paper texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

/* ── Typography ────────────────────────────────────────────── */
h1 {
  font-family: var(--font-title);
  font-weight: normal;
  font-style: normal;
  text-transform: uppercase;
  line-height: 1.15;
}

h2 {
  font-family: var(--font-title);
  font-weight: normal;
  font-style: italic;
  line-height: 1.3;
}

h3 {
  font-family: var(--font-body);
  font-weight: normal;
  font-size: 1.15rem;
  line-height: 1.5;
}

p, li {
  font-family: var(--font-body);
}

a {
  color: var(--wine);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s;
}

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

/* ── Layout ─────────────────────────────────────────────────── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
  position: relative;
  z-index: 1;
}

/* ── Header / Nav ───────────────────────────────────────────── */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1.25rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(to bottom, var(--bg) 60%, transparent);
}

.site-header .brand {
  font-family: var(--font-body);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  text-decoration: none;
}

/* ── Progress Dots ──────────────────────────────────────────── */
.progress-nav {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.progress-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cream-dark);
  border: 1.5px solid var(--gold-light);
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
}

.progress-dot.active {
  background: var(--gold);
  border-color: var(--gold);
  transform: scale(1.3);
}

.progress-dot.done {
  background: var(--gold-light);
  border-color: var(--gold-light);
}

.progress-dot[data-label]::after {
  content: attr(data-label);
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-body);
  font-size: 0.6rem;
  color: var(--ink-light);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.progress-dot:hover[data-label]::after {
  opacity: 1;
}

/* ── Save Indicator ─────────────────────────────────────────── */
.save-indicator {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.72rem;
  color: var(--gold);
  opacity: 0;
  transition: opacity 0.4s;
}

.save-indicator.visible {
  opacity: 1;
}

/* ── Screens ─────────────────────────────────────────────────── */
.screen {
  display: none;
  min-height: 100vh;
  padding-top: 5rem;
  padding-bottom: 6rem;
}

.screen.active {
  display: block;
}

/* ── Welcome Screen ─────────────────────────────────────────── */
#screen-welcome.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: 0;
}

.welcome-inner {
  padding: 0 2rem;
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  min-height: 100vh;
  justify-content: center;
}

.welcome-eyebrow {
  font-family: var(--font-body);
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold);
}

.welcome-title {
  font-size: clamp(2.8rem, 7vw, 4.5rem);
  color: var(--gold);
  line-height: 1.05;
}

.welcome-subtitle {
  font-style: italic;
  font-size: 1.15rem;
  color: var(--ink-light);
  max-width: 440px;
}

.welcome-client-name {
  font-family: var(--font-title);
  font-style: italic;
  font-size: 1.4rem;
  color: var(--gold);
}

.ornament {
  color: var(--gold-light);
  font-size: 1.4rem;
  letter-spacing: 0.4em;
  opacity: 0.7;
}

.welcome-intro {
  font-size: 0.95rem;
  color: var(--ink-light);
  line-height: 1.85;
  max-width: 480px;
  text-align: center;
}

/* ── Phase Screen ────────────────────────────────────────────── */
.phase-header {
  margin-bottom: 3.5rem;
  text-align: center;
}

.phase-eyebrow {
  display: block;
  font-family: var(--font-body);
  font-size: 0.62rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.6rem;
}

.phase-numeral {
  display: block;
  font-family: var(--font-body);
  font-size: 0.75rem;
  letter-spacing: 0.4em;
  color: var(--cream-dark);
  margin-bottom: 0.5rem;
}

.phase-title {
  font-size: clamp(2rem, 5vw, 3rem);
  color: var(--gold);
  margin-bottom: 0.4rem;
}

.phase-subtitle {
  font-size: 1.1rem;
  color: var(--gold);
  margin-bottom: 1.5rem;
}

.phase-rule {
  width: 60px;
  height: 1px;
  background: var(--gold-light);
  margin: 1.5rem auto;
  opacity: 0.6;
}

.phase-intro {
  font-size: 0.95rem;
  color: var(--ink-light);
  line-height: 1.9;
  margin-bottom: 2.5rem;
}

.phase-intro-callout {
  border-left: 2px solid var(--gold-light);
  padding-left: 1.2rem;
  font-style: italic;
  color: var(--ink-light);
  font-size: 0.9rem;
  line-height: 1.9;
  margin: 1.5rem 0;
}

/* ── Question Block ─────────────────────────────────────────── */
.question-block {
  margin-bottom: 2.8rem;
}

.question-label {
  display: block;
  font-family: var(--font-body);
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.question-text {
  display: block;
  font-family: var(--font-body);
  font-size: 1.05rem;
  color: var(--ink);
  margin-bottom: 0.9rem;
  font-style: italic;
  line-height: 1.6;
}

textarea {
  width: 100%;
  min-height: 120px;
  background: var(--white-soft);
  border: none;
  border-bottom: 1.5px solid rgba(146, 113, 68, 0.35);
  border-radius: 0;
  padding: 0.7rem 0.85rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--ink);
  line-height: 1.75;
  resize: vertical;
  outline: none;
  transition: border-color 0.25s;
  -webkit-appearance: none;
}

textarea:focus {
  border-bottom-color: var(--gold);
  background: transparent;
}

textarea::placeholder {
  color: rgba(90, 62, 43, 0.35);
  font-style: italic;
}

/* Tall textarea for long-form answers */
textarea.tall {
  min-height: 200px;
}

/* ── Embedded Media ─────────────────────────────────────────── */
.soundcloud-wrap {
  margin: 2rem 0;
  border-radius: 4px;
  overflow: hidden;
  opacity: 0.9;
}

.external-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.external-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.9rem;
  color: var(--wine);
  text-decoration: none;
  border-bottom: 1px solid rgba(83, 24, 36, 0.25);
  padding-bottom: 2px;
  width: fit-content;
  transition: color 0.2s, border-color 0.2s;
}

.external-link-btn:hover {
  color: var(--gold);
  border-color: var(--gold);
}

.external-link-btn::before {
  content: '→';
  font-style: normal;
}

/* ── Optional badge ─────────────────────────────────────────── */
.optional-badge {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.58rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-light);
  border: 1px solid var(--gold-light);
  padding: 0.2em 0.7em;
  border-radius: 20px;
  margin-left: 0.75rem;
  vertical-align: middle;
}

/* ── Navigation Buttons ─────────────────────────────────────── */
.phase-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(146, 113, 68, 0.18);
  flex-wrap: wrap;
  gap: 1rem;
}

.btn {
  font-family: var(--font-body);
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  padding: 0.9em 2.2em;
  border-radius: 0;
  transition: all 0.25s;
  text-decoration: none;
  display: inline-block;
}

.btn-primary {
  background: var(--wine);
  color: var(--cream);
}

.btn-primary:hover {
  background: var(--gold);
  color: var(--cream);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-light);
  border: 1px solid rgba(90, 62, 43, 0.3);
}

.btn-ghost:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.btn-complete {
  background: var(--wine);
  color: var(--cream);
}

.btn-complete:hover {
  background: var(--gold);
}

/* ── Completion Screen ──────────────────────────────────────── */
#screen-complete.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: 0;
}

.complete-inner {
  max-width: 540px;
  margin: 0 auto;
  padding: 0 2rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.8rem;
}

.complete-title {
  font-size: clamp(2rem, 5vw, 3rem);
  color: var(--gold);
}

.complete-text {
  color: var(--ink-light);
  font-style: italic;
  font-size: 1rem;
  line-height: 1.9;
}

/* ── Sending state ──────────────────────────────────────────── */
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 5px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--cream-dark);
  border-radius: 10px;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 600px) {
  .site-header {
    padding: 1rem 1.25rem;
  }

  .container {
    padding: 0 1.25rem;
  }

  .phase-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .btn {
    text-align: center;
  }

  .progress-dot[data-label]::after {
    display: none;
  }
}

/* ── Fade-in animation ───────────────────────────────────────── */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.screen.active .container {
  animation: fadeUp 0.55s ease forwards;
}
