/* ============================================================
   HugTone — Web Brand System
   Shared design tokens + base components for the companion site.
   Dark cosmic theme matching the app and resonance field.
   ============================================================ */

:root {
  /* Tokens mirror app/src/theme.ts (HugTone Design System) exactly. */
  --bg: #0f0d13;            /* colors.background */
  --bg-deep: #08070a;
  --surface-low: #151219;   /* colors.surfaceLow */
  --surface-solid: #1b1821; /* colors.surface / cardBg */
  --surface-high: #211e28;  /* colors.surfaceHigh */
  --surface-bright: #2e2a37;/* colors.surfaceBright */
  --surface: #1b1821;
  --surface-2: #211e28;
  --border: #4a4652;        /* colors.outlineVariant / cardBorder */
  --border-strong: #797381; /* colors.outline */

  --purple: #edbaff;        /* colors.primary */
  --purple-dim: #d49cea;    /* colors.primaryDim */
  --on-purple: #5f2f74;     /* colors.onPrimary */
  --cyan: #71d7cd;          /* colors.secondary (teal) */
  --cyan-dim: #62c9bf;
  --gold: #ffc87f;          /* colors.tertiary */
  --gold-dim: #eea840;
  --grad: linear-gradient(135deg, #edbaff 0%, #71d7cd 100%);        /* gradients.primary */
  --grad-warm: linear-gradient(135deg, #edbaff 0%, #ffc87f 100%);   /* gradients.warm */
  --grad-full: linear-gradient(135deg, #edbaff 0%, #71d7cd 50%, #ffc87f 100%); /* gradients.full */

  --ink: #eae2f2;           /* colors.onSurface / text */
  --ink-dim: #afa8b7;       /* colors.onSurfaceVariant / textSecondary */
  --ink-faint: #797381;     /* colors.textMuted */

  --danger: #fd6f85;        /* colors.error */
  --radius-sm: 8px; --radius: 14px; --radius-lg: 20px; --radius-xl: 28px; /* borderRadius */
  /* The app sets no custom fontFamily: it renders in the platform system font.
     Same here (San Francisco on Apple devices, Roboto on Android, Segoe on Windows). */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

/* Subtle starfield backdrop on every page */
body {
  background:
    radial-gradient(ellipse at 20% -10%, rgba(237,186,255,0.06), transparent 50%),
    radial-gradient(ellipse at 90% 10%, rgba(113,215,205,0.06), transparent 45%),
    var(--bg);
  background-attachment: fixed;
}

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

/* ---------- WORDMARK ---------- */
.wordmark {
  font-size: 13px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink-dim);
}
.wordmark .h { color: var(--purple); }
.wordmark .t { color: var(--cyan); }

/* ---------- LAYOUT ---------- */
.page {
  max-width: 480px;
  margin: 0 auto;
  padding: 32px 24px 64px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 48px;
}

/* ---------- TYPE ---------- */
.eyebrow {
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 600;
  margin-bottom: 14px;
}
h1.display {
  font-size: 38px;
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.12;
  margin-bottom: 16px;
}
.gradient-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.lede {
  font-size: 16px;
  color: var(--ink-dim);
  margin-bottom: 32px;
}

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 16px 20px;
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.btn:active { transform: scale(0.985); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: var(--grad);
  color: var(--on-purple);
}
.btn-ghost {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink);
}
.btn-link {
  background: none;
  border: none;
  color: var(--ink-dim);
  font-size: 14px;
  cursor: pointer;
  width: auto;
  padding: 8px;
}
.btn-link:hover { color: var(--ink); }

/* ---------- FORMS ---------- */
.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 8px;
  font-weight: 600;
}
.field input,
.field select {
  width: 100%;
  padding: 14px 16px;
  background: var(--surface-low);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--ink);
  font-family: inherit;
  font-size: 16px;
  transition: border-color 0.15s ease;
}
.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--purple);
}
.field input::placeholder { color: var(--ink-faint); }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }

/* ---------- CARD ---------- */
.card {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
}

/* ---------- ALERTS ---------- */
.alert {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  margin-bottom: 18px;
  display: none;
}
.alert.show { display: block; }
.alert-error {
  background: rgba(253, 111, 133, 0.12);
  border: 1px solid rgba(253, 111, 133, 0.35);
  color: #ffb3c0;
}
.alert-ok {
  background: rgba(113, 215, 205, 0.12);
  border: 1px solid rgba(113, 215, 205, 0.35);
  color: #a9ece5;
}

/* ---------- MISC ---------- */
.spacer { flex: 1; }
.center { text-align: center; }
.muted { color: var(--ink-faint); font-size: 13px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }

/* Loading spinner */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(95,47,116,0.3);
  border-top-color: var(--on-purple);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- APP ICONS (assets/icons, shared with the phone app) ---------- */
.app-icon { display: inline-block; object-fit: contain; vertical-align: middle; }
.app-icon.xs { width: 20px; height: 20px; }
.app-icon.sm { width: 28px; height: 28px; }
.app-icon.md { width: 44px; height: 44px; }
.app-icon.lg { width: 72px; height: 72px; }
.app-icon.xl { width: 120px; height: 120px; }
