/* ============================================================
   Cyncerity — Communication Style Quiz
   Palette and fonts inherited from cyncerity.xyz
   ============================================================ */

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

:root {
  --ink:          #1a1714;
  --ink-faint:    #4a4540;
  --ink-dim:      rgba(26,23,20,0.35);
  --paper:        #f5f0e8;
  --paper-warm:   #ede8dc;
  --paper-deep:   #e4ddd0;
  --amber:        #c8873a;
  --amber-light:  #e8a85a;
  --rule:         rgba(26,23,20,0.12);

  --fire:  #b84a2f;
  --wind:  #7a9cab;
  --water: #3f6b8a;
  --earth: #7a6a4f;

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-ui:      'Instrument Sans', system-ui, sans-serif;
  --font-mono:    'DM Mono', 'Courier New', monospace;

  --radius: 8px;
}

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

body {
  font-family: var(--font-ui);
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ── Header ────────────────────────────────────────────────── */
header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--rule);
}

.header-inner {
  max-width: 640px;
  margin: 0 auto;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.logo-dot { color: var(--amber); }

/* ── Main ──────────────────────────────────────────────────── */
main {
  flex: 1;
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
  padding: 3rem 2rem 4rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.screen { animation: fadeIn 0.4s ease-out; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Intro ─────────────────────────────────────────────────── */
.intro-title {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
}

.intro-lead {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--ink-faint);
  margin-bottom: 0.75rem;
  max-width: 460px;
}

.intro-note {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-dim);
  margin-bottom: 2.5rem;
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn-primary {
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--paper);
  background: var(--ink);
  border: none;
  border-radius: var(--radius);
  padding: 0.8rem 2.2rem;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
}
.btn-primary:hover:not(:disabled) { opacity: 0.85; }
.btn-primary:active:not(:disabled) { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.4; cursor: default; }

.btn-link {
  display: inline-block;
  text-decoration: none;
  text-align: center;
}

.btn-back {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-dim);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-top: 2rem;
  transition: color 0.2s;
}
.btn-back:hover { color: var(--ink); }

/* ── Progress ──────────────────────────────────────────────── */
.progress {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.progress-bar {
  flex: 1;
  height: 3px;
  background: var(--rule);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--amber);
  border-radius: 2px;
  transition: width 0.35s ease-out;
}

.progress-text {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-dim);
  flex-shrink: 0;
}

/* ── Question ──────────────────────────────────────────────── */
.question-text {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 400;
  line-height: 1.4;
  margin-bottom: 2rem;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.option {
  font-family: var(--font-ui);
  font-size: 0.95rem;
  line-height: 1.55;
  text-align: left;
  color: var(--ink);
  background: var(--paper-warm);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
.option:hover {
  border-color: var(--amber);
  background: var(--paper-deep);
}
.option:active { transform: scale(0.99); }

/* ── Analysing ─────────────────────────────────────────────── */
.analysing-inner {
  text-align: center;
  padding: 4rem 0;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 2px solid var(--rule);
  border-top-color: var(--amber);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1.25rem;
}

@keyframes spin { to { transform: rotate(360deg); } }

.analysing-text {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-style: italic;
  color: var(--ink-faint);
  transition: opacity 0.3s;
}

.analysing-text.fading { opacity: 0; }

/* ── Result ────────────────────────────────────────────────── */
.result-reveal {
  text-align: center;
  padding: 1rem 0 2.5rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 2.5rem;
}

.result-emoji {
  font-size: 3.5rem;
  line-height: 1;
  margin-bottom: 1rem;
  animation: rise 0.6s ease-out;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px) scale(0.9); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.result-title {
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  animation: fadeIn 0.6s ease-out 0.15s both;
}

.result-line {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-style: italic;
  font-weight: 300;
  line-height: 1.6;
  color: var(--ink-faint);
  max-width: 480px;
  margin: 0 auto;
  animation: fadeIn 0.6s ease-out 0.3s both;
}

/* Element accents */
.el-fire  .result-title { color: var(--fire); }
.el-wind  .result-title { color: var(--wind); }
.el-water .result-title { color: var(--water); }
.el-earth .result-title { color: var(--earth); }

/* ── Capture ───────────────────────────────────────────────── */
.capture { animation: fadeIn 0.6s ease-out 0.45s both; }

.capture-lead {
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--ink-faint);
  margin-bottom: 1.5rem;
}

.capture-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.email-input {
  font-family: var(--font-ui);
  font-size: 1rem;
  color: var(--ink);
  background: var(--paper-warm);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 0.85rem 1.25rem;
  transition: border-color 0.2s;
}
.email-input:focus {
  outline: none;
  border-color: var(--amber);
}
.email-input::placeholder { color: var(--ink-dim); }

.consent {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--ink-faint);
  cursor: pointer;
}

.consent input[type="checkbox"] {
  margin-top: 0.2rem;
  flex-shrink: 0;
  accent-color: var(--amber);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.consent a { color: var(--amber); }

.form-error {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: #b84040;
}

/* ── Thanks ────────────────────────────────────────────────── */
.thanks-title {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 400;
  margin-bottom: 1rem;
}

.thanks-line {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--ink-faint);
  margin-bottom: 2.5rem;
}

.thanks-cta {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-style: italic;
  font-weight: 300;
  line-height: 1.6;
  color: var(--ink);
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
  margin-bottom: 1.75rem;
}

/* ── Footer ────────────────────────────────────────────────── */
footer {
  padding: 1.5rem 2rem;
  border-top: 1px solid var(--rule);
}

.footer-inner {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
}

.disclaimer {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--ink-dim);
  line-height: 1.5;
}

.footer-link {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--ink-dim);
  text-decoration: none;
  flex-shrink: 0;
}
.footer-link:hover { color: var(--ink-faint); }

/* ── Privacy page ──────────────────────────────────────────── */
.page-content { max-width: 560px; }

.page-content h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 400;
  margin-bottom: 2rem;
}

.page-content h2 {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin: 2rem 0 0.75rem;
}

.page-content p {
  font-size: 0.92rem;
  line-height: 1.75;
  color: var(--ink);
  margin-bottom: 1rem;
}

.page-content ul {
  margin: 0 0 1rem 1.1rem;
  font-size: 0.92rem;
  line-height: 1.75;
}

.page-content li { margin-bottom: 0.4rem; }

.page-content a { color: var(--amber); }

.page-content .faint {
  color: var(--ink-faint);
  font-size: 0.88rem;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 600px) {
  header { padding: 1rem 1.25rem; }
  main   { padding: 2rem 1.25rem 3rem; }
  footer { padding: 1rem 1.25rem; }
  .footer-inner { flex-direction: column; gap: 0.75rem; }

  .intro-title   { font-size: 1.9rem; }
  .question-text { font-size: 1.35rem; }
  .result-title  { font-size: 2.1rem; }
  .result-line   { font-size: 1.1rem; }
  .result-emoji  { font-size: 3rem; }
  .btn-primary   { width: 100%; }
}
