/* Attune — main.css */
/* Cool slate palette, EB Garamond, refined minimal */

@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500&display=swap');

:root {
  --bg:           #F4F5F6;
  --surface:      #FFFFFF;
  --surface-2:    #ECEEF1;
  --text:         #1C1F24;
  --text-muted:   #6B7280;
  --text-light:   #9CA3AF;
  --accent:       #4A7C8E;
  --accent-light: #E8F1F4;
  --accent-dark:  #3A6270;
  --border:       #E2E5E9;
  --border-dark:  #C8CDD5;
  --error:        #B91C1C;
  --error-light:  #FEE2E2;
  --success:      #2D6A4F;
  --success-light:#D8F3DC;

  --radius:       6px;
  --radius-lg:    12px;
  --shadow-sm:    0 1px 3px rgba(28,31,36,0.08);
  --shadow:       0 4px 16px rgba(28,31,36,0.10);
  --shadow-lg:    0 8px 32px rgba(28,31,36,0.12);

  --font:         'EB Garamond', Georgia, serif;
  --max-w:        680px;
  --max-w-wide:   960px;
}

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

html {
  font-size: 18px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
}

/* ── Typography ─────────────────────────────────────────────────────────── */

h1, h2, h3, h4 {
  font-family: var(--font);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

h1 { font-size: 2.4rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.3rem; }

p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

em, i { font-style: italic; }

/* ── Layout ─────────────────────────────────────────────────────────────── */

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container--wide {
  max-width: var(--max-w-wide);
}

/* ── Header / Nav ───────────────────────────────────────────────────────── */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-w-wide);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.wordmark {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--text);
}

.wordmark__name {
  font-size: 1.4rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1;
}

.wordmark__sub {
  font-size: 0.78rem;
  font-style: italic;
  color: var(--text-muted);
  line-height: 1;
  margin-top: 2px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-link {
  font-size: 0.9rem;
  color: var(--text-muted);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.nav-link:hover {
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}

.nav-link--active {
  color: var(--accent);
  background: var(--accent-light);
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 500;
  padding: 0.6rem 1.4rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  white-space: nowrap;
}

.btn--primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn--primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  text-decoration: none;
  color: #fff;
}

.btn--secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-dark);
}
.btn--secondary:hover {
  background: var(--surface-2);
  text-decoration: none;
}

.btn--ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
}
.btn--ghost:hover {
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}

.btn--lg {
  font-size: 1.1rem;
  padding: 0.8rem 2rem;
}

.btn--full { width: 100%; }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Cards ───────────────────────────────────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
}

.card--elevated {
  box-shadow: var(--shadow);
}

/* ── Forms ───────────────────────────────────────────────────────────────── */

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.form-input {
  width: 100%;
  font-family: var(--font);
  font-size: 1rem;
  padding: 0.6rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(74,124,142,0.12);
}

.form-error {
  font-size: 0.85rem;
  color: var(--error);
  margin-top: 0.4rem;
}

/* ── Options (situation choices) ─────────────────────────────────────────── */

.option {
  display: block;
  width: 100%;
  text-align: left;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  padding: 0.9rem 1.2rem;
  margin-bottom: 0.6rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
  color: var(--text);
}

.option:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.option--selected {
  border-color: var(--accent);
  background: var(--accent-light);
}

.option--correct {
  border-color: var(--success);
  background: var(--success-light);
  color: var(--success);
}

.option--incorrect {
  border-color: var(--error);
  background: var(--error-light);
  color: var(--error);
}

.option:disabled {
  cursor: default;
}

/* ── Feedback panel ─────────────────────────────────────────────────────── */

.feedback {
  background: var(--surface-2);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.25rem 1.5rem;
  margin-top: 1.5rem;
  font-size: 0.95rem;
  line-height: 1.7;
}

.feedback__label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  font-style: normal;
}

.feedback__section {
  margin-bottom: 1rem;
}

.feedback__section:last-child {
  margin-bottom: 0;
}

/* ── Progress bar ───────────────────────────────────────────────────────── */

.progress-bar {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 2rem;
}

.progress-bar__fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.4s ease;
}

/* ── Domain badge ───────────────────────────────────────────────────────── */

.domain-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  padding: 0.25rem 0.6rem;
  background: var(--surface-2);
  border-radius: 20px;
  border: 1px solid var(--border);
}

/* ── State indicators ───────────────────────────────────────────────────── */

.state-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.state-dot--building { background: var(--accent); }
.state-dot--solid    { background: var(--success); }
.state-dot--empty    { background: var(--border-dark); }

/* ── Alert ───────────────────────────────────────────────────────────────── */

.alert {
  padding: 0.8rem 1.1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.alert--error {
  background: var(--error-light);
  color: var(--error);
  border: 1px solid #FECACA;
}

.alert--success {
  background: var(--success-light);
  color: var(--success);
  border: 1px solid #A7F3D0;
}

/* ── Utilities ───────────────────────────────────────────────────────────── */

.text-muted   { color: var(--text-muted); }
.text-small   { font-size: 0.85rem; }
.text-italic  { font-style: italic; }
.text-center  { text-align: center; }
.mt-1  { margin-top: 0.5rem; }
.mt-2  { margin-top: 1rem; }
.mt-3  { margin-top: 1.5rem; }
.mt-4  { margin-top: 2rem; }
.mb-1  { margin-bottom: 0.5rem; }
.mb-2  { margin-bottom: 1rem; }
.mb-3  { margin-bottom: 1.5rem; }
.mb-4  { margin-bottom: 2rem; }

.hidden { display: none !important; }

/* ── Loading spinner ────────────────────────────────────────────────────── */

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

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

/* ── Fade in ────────────────────────────────────────────────────────────── */

.fade-in {
  animation: fadeIn 0.3s ease;
}

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

/* ── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 600px) {
  html { font-size: 16px; }
  .card { padding: 1.25rem; }
  h1 { font-size: 1.9rem; }
}
