/* ============================================================
   APTI — Attraction Pattern Type Indicator
   Shared stylesheet
   ============================================================ */

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

/* Design tokens */
:root {
  /* Backgrounds & surfaces */
  --bg: #0a0a0a;
  --bg-card: #141414;

  /* Text */
  --text: #f5f5f5;
  --text-muted: #999;
  --text-dim: #666;

  /* Borders */
  --border: #2a2a2a;

  /* Type accent colours */
  --c-SIMP: #ff6b6b;
  --c-COPE: #a8a8a8;
  --c-LOUD: #ff3e8a;
  --c-WILD: #ffaa00;
  --c-WAIT: #7eb8da;
  --c-COLD: #4ecdc4;
  --c-BOSS: #ff5722;
  --c-FLEE: #9c27b0;
  --c-GAVE: #66bb6a;
  --c-NICE: #90caf9;
  --c-ASAP: #f44336;
  --c-FREE: #ffd700;
  --c-TRAP: #ce93d8;
  --c-CALC: #00bcd4;
  --c-APEX: #ff9100;
  --c-GONE: #607d8b;

  /* Typography */
  --f-display: "Inter", system-ui, -apple-system, sans-serif;
  --f-body:    "Inter", system-ui, -apple-system, sans-serif;
  --f-mono:    "Fira Code", "Fira Mono", "Roboto Mono", monospace;

  /* Layout */
  --max-w: 640px;
  --px: 24px;
}

/* Base */
body {
  font-family: var(--f-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   LANDING PAGE
   ============================================================ */

.apti-landing {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  text-align: center;
  padding: 2rem var(--px);
  position: relative;
}

.apti-landing__wordmark {
  font-family: var(--f-mono);
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.apti-landing__title {
  font-family: var(--f-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1rem;
}

.apti-landing__subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.apti-landing__hook {
  font-size: 0.95rem;
  color: var(--text-dim);
  font-style: italic;
  margin-bottom: 2.5rem;
}

.apti-landing__cta {
  display: inline-block;
  padding: 1rem 3rem;
  background: #ffffff;
  color: #000000;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  text-decoration: none;
  border-radius: 4px;
  transition: transform 0.15s ease;
  margin-bottom: 2rem;
}

.apti-landing__cta:hover {
  transform: translateY(-2px);
}

.apti-landing__footer {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  color: var(--text-dim);
  white-space: nowrap;
}

.apti-landing__footer a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ============================================================
   TEST PAGE
   ============================================================ */

.apti-test {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--px);
}

/* Progress bar */
.apti-test__progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--border);
  z-index: 100;
}

.apti-test__progress-bar {
  height: 100%;
  background: #ffffff;
  transition: width 0.3s ease;
}

/* Counter */
.apti-test__counter {
  font-family: var(--f-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  text-align: center;
  padding-top: 1.5rem;
  margin-bottom: 2rem;
}

/* Question area */
.apti-test__question-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 0;
}

.apti-test__question {
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  font-weight: 500;
  line-height: 1.6;
  text-align: center;
  margin-bottom: 2.5rem;
  max-width: 560px;
}

/* Options */
.apti-test__options {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  max-width: 560px;
}

.apti-test__option {
  width: 100%;
  padding: 1.25rem;
  background: transparent;
  color: var(--text);
  font-family: var(--f-body);
  font-size: 0.95rem;
  line-height: 1.5;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.apti-test__option:hover {
  border-color: var(--text-muted);
  background: var(--bg-card);
}

.apti-test__option:active {
  background: rgba(255, 255, 255, 0.08);
}

/* ============================================================
   RESULT PAGE
   ============================================================ */

/* ---- Zone 1: Hero ---- */
.apti-result__zone1 {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem var(--px) 2rem;
  position: relative;
}

.apti-result__zone1::after {
  content: "↓";
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.5rem;
  color: var(--text-dim);
  opacity: 0.4;
  animation: pulse-down 2s ease-in-out infinite;
}

@keyframes pulse-down {
  0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.4; }
  50% { transform: translateX(-50%) translateY(6px); opacity: 0.7; }
}

.apti-result__wordmark {
  font-family: var(--f-mono);
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.apti-result__label {
  font-family: var(--f-mono);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.apti-result__code {
  font-family: var(--f-display);
  font-size: clamp(4rem, 12vw, 8rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 0.75rem;
}

.apti-result__alias {
  font-size: 1.1rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 1.5rem;
}

.apti-result__slogan {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  font-weight: 500;
  max-width: 500px;
  line-height: 1.5;
  margin-bottom: 2rem;
}

/* Badges */
.apti-result__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 2.5rem;
}

.apti-result__badge {
  font-family: var(--f-mono);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  padding: 0.3rem 0.75rem;
  border: 1px solid currentColor;
  border-radius: 999px;
}

.apti-result__dimensions {
  width: 100%;
  max-width: 420px;
  margin: 0 auto 2rem;
}

.apti-score-title {
  font-family: var(--f-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.apti-score-row {
  display: grid;
  grid-template-columns: 88px minmax(96px, 1fr) 88px;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.75rem;
  font-size: 0.72rem;
  color: var(--text-dim);
}

.apti-score-row span:first-child {
  text-align: right;
}

.apti-score-row span:last-child {
  text-align: left;
}

.apti-score-row .is-dominant {
  color: var(--text);
  font-weight: 700;
}

.apti-score-track {
  display: flex;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--border);
}

.apti-score-left,
.apti-score-right {
  transition: width 0.6s ease;
}

.apti-score-left {
  background: var(--text);
}

.apti-score-right {
  background: var(--text-dim);
}

.apti-result__intensity {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-style: italic;
  margin-top: 0.75rem;
  text-align: center;
}

/* Share row */
.apti-result__share-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.apti-result__btn {
  font-family: var(--f-body);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.6rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.apti-result__btn:hover {
  border-color: var(--text-muted);
}

.apti-result__btn--primary {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
}

.apti-result__btn--primary:hover {
  background: #e5e5e5;
  border-color: #e5e5e5;
}

/* ---- Zone 2: Details ---- */
.apti-result__zone2 {
  max-width: 640px;
  margin: 0 auto;
  padding: 4rem var(--px) 6rem;
}

.apti-result__section {
  margin-bottom: 3rem;
}

.apti-result__section h2 {
  font-family: var(--f-display);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.apti-result__section p {
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.apti-result__section ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.apti-result__section li {
  color: var(--text-muted);
  line-height: 1.6;
  padding-left: 1.25rem;
  position: relative;
}

.apti-result__section li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--text-dim);
}

/* Match cards */
.apti-result__matches {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  margin-top: 1rem;
}

.apti-result__match-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  text-align: center;
  gap: 0.4rem;
}

.apti-result__match-card-code {
  font-family: var(--f-display);
  font-size: 1.5rem;
  font-weight: 900;
}

.apti-result__match-card-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* CTA block */
.apti-result__cta-block {
  text-align: center;
  padding: 3rem var(--px);
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card);
  margin-bottom: 3rem;
}

.apti-result__cta-block h2 {
  font-family: var(--f-display);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.apti-result__cta-block p {
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.apti-result__cta-block a {
  display: inline-block;
  padding: 1rem 2.5rem;
  background: var(--text);
  color: var(--bg);
  font-weight: 700;
  border-radius: 4px;
  text-decoration: none;
  transition: transform 0.15s ease;
}

.apti-result__cta-block a:hover {
  transform: translateY(-2px);
}

/* Type grid */
.apti-result__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-top: 1rem;
}

.apti-result__grid-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s ease;
  gap: 0.3rem;
}

.apti-result__grid-item:hover {
  border-color: var(--text-muted);
}

.grid-code {
  font-family: var(--f-display);
  font-size: 1.2rem;
  font-weight: 900;
}

.grid-alias {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Footer */
.apti-result__footer {
  text-align: center;
  padding: 2rem var(--px);
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-dim);
}

.apti-result__footer a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 480px) {
  :root {
    --px: 16px;
  }

  .apti-result__matches {
    flex-direction: column;
  }

  .apti-result__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
