/* ==========================================================================
   Alignmates — Base: reset, typography scale, layout, and the four shared
   systems (surfaces, cards, buttons, identity).
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--dark-bg-page);
  color: var(--dark-text-primary);
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

ul {
  list-style: none;
}

::selection {
  background: var(--purple-500);
  color: #fff;
}

:focus-visible {
  outline: 3px solid var(--purple-400);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ==========================================================================
   1. LAYOUT
   ========================================================================== */

.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--outer-margin);
}

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

.container--narrow {
  max-width: 900px;
}

.section {
  padding: var(--space-120) 0;
  position: relative;
}

.section--compact {
  padding: var(--space-80) 0;
}

.section--tight {
  padding: var(--space-64) 0;
}

@media (max-width: 900px) {
  .section {
    padding: var(--space-80) 0;
  }
  .section--compact,
  .section--tight {
    padding: var(--space-56) 0;
  }
}

/* ---- Surface families ---------------------------------------------------
   Five surfaces, not two. Adjacent sections of the same polarity must use
   different surfaces so the page never reads as flat alternating bands.  */

.section--dark {
  background: var(--navy-950);
  color: var(--dark-text-primary);
}

.section--dark-raised {
  background: var(--navy-900);
  color: var(--dark-text-primary);
}

.section--dark-violet {
  background: linear-gradient(180deg, var(--navy-950) 0%, #17102b 55%, var(--navy-950) 100%);
  color: var(--dark-text-primary);
}

.section--light {
  background: var(--light-bg-page);
  color: var(--light-text-primary);
}

.section--light-tint {
  background: var(--cloud-100);
  color: var(--light-text-primary);
}

/* Soft radial energy — used sparingly on hero / communities / final CTA */
.section--glow::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(58% 48% at 78% 4%, rgba(139, 92, 246, 0.17), transparent 62%),
    radial-gradient(46% 38% at 8% 22%, rgba(34, 211, 238, 0.07), transparent 62%);
}

.section > .container {
  position: relative;
  z-index: 1;
}

/* Colour inheritance for the light/dark families */
.section--dark .muted,
.section--dark-raised .muted,
.section--dark-violet .muted {
  color: var(--dark-text-secondary);
}

.section--light .muted,
.section--light-tint .muted {
  color: var(--light-text-secondary);
}

.section--light .eyebrow,
.section--light-tint .eyebrow {
  color: var(--light-accent);
}

/* ==========================================================================
   2. TYPOGRAPHY
   ========================================================================== */

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.015em;
}

/* Hero only */
.display-hero {
  font-size: clamp(48px, 5.9vw, 86px);
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: -0.028em;
}

/* Manifesto / editorial statement */
.display-editorial {
  font-size: clamp(38px, 4.6vw, 66px);
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -0.024em;
}

/* Major section headline */
.display-section {
  font-size: clamp(34px, 3.6vw, 52px);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Supporting / sub-section headline */
.display-sub {
  font-size: clamp(26px, 2.5vw, 38px);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.heading-l {
  font-size: clamp(22px, 2vw, 30px);
  line-height: 1.25;
  font-weight: 700;
}

.heading-m {
  font-size: 22px;
  line-height: 1.3;
  font-weight: 700;
}

.heading-s {
  font-size: 19px;
  line-height: 1.35;
  font-weight: 600;
}

.body-xl {
  font-family: var(--font-body);
  font-size: 20px;
  line-height: 1.6;
}

.body-l {
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.65;
}

.body-m {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
}

.body-s {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
}

.caption {
  font-family: var(--font-body);
  font-size: 13.5px;
  line-height: 1.45;
  font-weight: 500;
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--purple-300);
  margin-bottom: var(--space-20);
}

.grad {
  background: linear-gradient(115deg, var(--purple-300), var(--purple-500));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.section--light .grad,
.section--light-tint .grad {
  background: linear-gradient(115deg, var(--purple-600), var(--purple-500));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---- Shared heading blocks ---- */

.chapter-head {
  max-width: var(--measure-lede);
  margin: 0 auto var(--space-64);
  text-align: center;
}

.chapter-head p {
  max-width: var(--measure-copy);
  margin: var(--space-24) auto 0;
}

.text-center {
  text-align: center;
}

.measure {
  max-width: var(--measure-copy);
}

/* ==========================================================================
   3. BUTTON SYSTEM  (one primary, one secondary, one text link, one icon)
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 17px;
  min-height: 56px;
  padding: 0 var(--space-32);
  border-radius: var(--radius-full);
  transition:
    transform var(--motion-fast) var(--ease-standard),
    box-shadow var(--motion-fast) var(--ease-standard),
    background var(--motion-fast) var(--ease-standard),
    border-color var(--motion-fast) var(--ease-standard);
}

.btn-primary {
  background: linear-gradient(135deg, var(--purple-500), var(--purple-700));
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn-secondary {
  background: transparent;
  border: 1.5px solid var(--dark-border);
  color: var(--dark-text-primary);
}

.section--light .btn-secondary,
.section--light-tint .btn-secondary {
  border-color: var(--light-border);
  color: var(--light-text-primary);
}

@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--glow-purple);
  }
  .btn-secondary:hover {
    border-color: var(--purple-500);
    transform: translateY(-2px);
  }
}

.btn:active {
  transform: scale(0.98);
}

.btn-text {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 17px;
  color: var(--purple-300);
}

.section--light .btn-text,
.section--light-tint .btn-text {
  color: var(--light-accent);
}

.btn-text::after {
  content: "→";
  margin-left: var(--space-8);
  transition: transform var(--motion-fast) var(--ease-standard);
  display: inline-block;
}

.btn-text:hover::after {
  transform: translateX(5px);
}

.btn-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--dark-bg-surface-raised);
  border: 1px solid var(--dark-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cta-group {
  display: flex;
  align-items: center;
  gap: var(--space-28);
  flex-wrap: wrap;
}

/* Store badges — locked to one height so they always align */
.store-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-16);
  flex-wrap: wrap;
}

.store-row a {
  display: block;
  transition: transform 0.18s ease;
}

.store-row a:hover {
  transform: translateY(-2px);
}

.store-row img {
  height: 52px;
  width: auto;
}

/* ==========================================================================
   4. CARD SYSTEM  (product / narrative / fragment)
   ========================================================================== */

/* -- 4a. Product card: models real in-app UI. Always dark, on any surface. */
.post-card {
  border-radius: var(--radius-lg);
  padding: var(--space-24);
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
  border: 1px solid var(--dark-border);
  background: var(--dark-bg-surface);
  color: var(--dark-text-primary);
}

.post-card .muted,
.post-card__meta {
  color: var(--dark-text-secondary);
}

.post-card--neutral {
  background: var(--dark-bg-surface);
}
.post-card--blue {
  background: linear-gradient(160deg, #1a2440, #131a2c);
  border-color: rgba(99, 130, 246, 0.28);
}
.post-card--purple {
  background: linear-gradient(160deg, #241a40, #1a1430);
  border-color: rgba(139, 92, 246, 0.3);
}
.post-card--green {
  background: linear-gradient(160deg, #16302a, #10201c);
  border-color: rgba(52, 211, 153, 0.28);
}
.post-card--cyan {
  background: linear-gradient(160deg, #123236, #0e2528);
  border-color: rgba(34, 211, 238, 0.28);
}
.post-card--orange {
  background: linear-gradient(160deg, #33241a, #241a12);
  border-color: rgba(251, 146, 60, 0.28);
}
.post-card--pink {
  background: linear-gradient(160deg, #331a2a, #24121e);
  border-color: rgba(244, 114, 182, 0.28);
}

.post-card__header {
  display: flex;
  align-items: center;
  gap: var(--space-12);
}

.post-card__identity {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.post-card__username {
  font-weight: 600;
}

.post-card__footer {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  flex-wrap: wrap;
}

/* -- 4b. Narrative card: light neutral, used in editorial chapters. */
.note-card {
  border-radius: var(--radius-lg);
  padding: var(--space-32);
  background: var(--light-bg-surface);
  border: 1px solid var(--light-border);
  color: var(--light-text-primary);
}

.section--light-tint .note-card {
  background: var(--white);
}

/* -- 4c. Floating fragment: hero / storytelling only. */
.fragment {
  background: var(--dark-bg-surface-raised);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius-md);
  padding: var(--space-20);
  box-shadow: var(--shadow-lg);
}

/* -- 4d. Shared interactive lift. Desktop/mouse only — no sticky hover
   states on touch devices. */
.post-card,
.note-card,
.scenario-card,
.lift {
  transition:
    transform var(--motion-fast) var(--ease-standard),
    box-shadow var(--motion-fast) var(--ease-standard);
}

@media (hover: hover) and (pointer: fine) {
  .post-card:hover,
  .note-card:hover,
  .scenario-card:hover,
  .lift:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
  }
}

/* ==========================================================================
   5. PILLS / CHIPS
   ========================================================================== */

.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-4);
  font-size: 13.5px;
  font-weight: 500;
  border-radius: var(--radius-full);
  padding: var(--space-8) var(--space-16);
  background: rgba(255, 255, 255, 0.07);
  color: var(--dark-text-secondary);
  white-space: nowrap;
}

.section--light .pill,
.section--light-tint .pill {
  background: var(--light-bg-surface-tint);
  color: var(--light-text-secondary);
}

.post-card .pill,
.fragment .pill {
  background: rgba(255, 255, 255, 0.07);
  color: var(--dark-text-secondary);
}

.pill--accent {
  background: var(--purple-600);
  color: #fff;
}

.pill--success {
  background: rgba(52, 211, 153, 0.16);
  color: #7fe3c0;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-12);
}

.pill-row--center {
  justify-content: center;
}

/* ==========================================================================
   6. IDENTITY (MoodMoji avatars)
   ========================================================================== */

.moodmoji {
  border-radius: var(--radius-full);
  object-fit: cover;
  background: var(--navy-800);
  flex-shrink: 0;
}

.moodmoji--xs { width: 28px; height: 28px; }
.moodmoji--sm { width: 36px; height: 36px; }
.moodmoji--md { width: 48px; height: 48px; }
.moodmoji--lg { width: 64px; height: 64px; }
.moodmoji--xl { width: 88px; height: 88px; }

.moodmoji--ring {
  outline: 2px solid var(--purple-500);
  outline-offset: 3px;
}

/* ==========================================================================
   7. WAVEFORM (audio)
   ========================================================================== */

.waveform {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 28px;
}

.waveform span {
  width: 3px;
  background: var(--purple-300);
  border-radius: 2px;
  opacity: 0.85;
  flex: 1;
  max-width: 6px;
}

.waveform--lg {
  height: 44px;
  gap: 4px;
}
.waveform--lg span {
  width: 4px;
}

.waveform--xl {
  height: 64px;
  gap: 5px;
}
.waveform--xl span {
  width: 6px;
}

/* ==========================================================================
   8. UTILITIES
   ========================================================================== */

.stack {
  display: flex;
  flex-direction: column;
}

.row {
  display: flex;
  align-items: center;
}

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

/* Scroll-reveal (.reveal) and all other motion — see css/motion.css.
   Deliberately NOT defined here: reveal must default to visible so the
   page stays fully readable if JS never runs (see motion.css §1). */
