/* ============================================================
   ROMATIONAL — BRAND FOUNDATION
   The single source of truth for color, type, and theming.
   ============================================================ */

/* ---------- TYPEFACE ---------- */
/* Helvetica Neue first (Apple devices ship it). Inter as a near-twin
   fallback for everyone else. System sans as a final safety net. */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --font-sans:
    "Helvetica Neue",
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
}

/* ---------- BRAND COLORS (from official brand guide) ---------- */
:root {
  /* Master gradient (logo + menu bar) */
  --brand-teal:        #4BDBC4;  /* gradient start */
  --brand-orange:      #FF8803;  /* gradient middle */
  --brand-pink:        #FE1A68;  /* gradient end */

  --brand-gradient:
    linear-gradient(90deg, #4BDBC4 0%, #FF8803 50%, #FE1A68 100%);

  /* RomType identity colors */
  --romtype-balanced:    #F44508;
  --romtype-structured:  #C906F9;
  --romtype-casual:      #2AC6AF;
  --romtype-dating:      #2CA8C4;
  --romtype-commitment:  #2D85C1;

  /* FlexScore flexibility tier colors */
  --flex-not-at-all:     #4BDBC4;
  --flex-slightly:       #28B04B;
  --flex-somewhat:       #F1C020;
  --flex-very:           #FF8803;
  --flex-extremely:      #FE1A68;

  /* Compatibility tier colors (derived from extras palette) */
  --tier-exact:          #22C48A;  /* green */
  --tier-compatible:     #85BFFA;  /* light blue */
  --tier-issue:          #F1C020;  /* yellow */
  --tier-major:          #FF8803;  /* orange */
  --tier-serious:        #F20C0C;  /* red */
}

/* ---------- THEME: LIGHT (default) ---------- */
:root,
[data-theme="light"] {
  --bg:              #F1F2F2;  /* brand background */
  --bg-elevated:     #FFFFFF;  /* cards, modals */
  --bg-subtle:       #E8E9E9;  /* subtle sections */
  --button-highlight:#D8D6D8;  /* hover/pressed neutral */

  --text:            #070707;  /* primary text (brand outline) */
  --text-muted:      #727070;  /* brand text gray */
  --text-soft:       #9A9898;  /* tertiary */

  --border:          #D8D6D8;
  --border-strong:   #070707;

  --shadow-sm:       0 1px 2px rgba(7, 7, 7, 0.04);
  --shadow-md:       0 4px 16px rgba(7, 7, 7, 0.06);
  --shadow-lg:       0 12px 40px rgba(7, 7, 7, 0.08);
  --shadow-brand:    0 12px 40px rgba(254, 26, 104, 0.12);
}

/* ---------- THEME: DARK ---------- */
/* Brand identity colors stay fixed. Only neutrals re-derive. */
[data-theme="dark"] {
  --bg:              #0A0A0A;
  --bg-elevated:     #161616;
  --bg-subtle:       #1F1F1F;
  --button-highlight:#2A2A2A;

  --text:            #F1F2F2;
  --text-muted:      #A8A6A6;
  --text-soft:       #6E6C6C;

  --border:          #2A2A2A;
  --border-strong:   #F1F2F2;

  --shadow-sm:       0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-md:       0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg:       0 12px 40px rgba(0, 0, 0, 0.5);
  --shadow-brand:    0 12px 40px rgba(254, 26, 104, 0.25);
}

/* ---------- AUTO-DETECT SYSTEM PREFERENCE ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg:              #0A0A0A;
    --bg-elevated:     #161616;
    --bg-subtle:       #1F1F1F;
    --button-highlight:#2A2A2A;
    --text:            #F1F2F2;
    --text-muted:      #A8A6A6;
    --text-soft:       #6E6C6C;
    --border:          #2A2A2A;
    --border-strong:   #F1F2F2;
    --shadow-sm:       0 1px 2px rgba(0, 0, 0, 0.5);
    --shadow-md:       0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg:       0 12px 40px rgba(0, 0, 0, 0.5);
    --shadow-brand:    0 12px 40px rgba(254, 26, 104, 0.25);
  }
}

/* ---------- TYPOGRAPHIC SCALE ---------- */
:root {
  --fs-xs:   0.75rem;   /* 12px */
  --fs-sm:   0.875rem;  /* 14px */
  --fs-base: 1rem;      /* 16px */
  --fs-md:   1.125rem;  /* 18px */
  --fs-lg:   1.375rem;  /* 22px */
  --fs-xl:   1.75rem;   /* 28px */
  --fs-2xl:  2.5rem;    /* 40px */
  --fs-3xl:  3.5rem;    /* 56px */
  --fs-4xl:  5rem;      /* 80px */

  --lh-tight: 1.1;
  --lh-snug:  1.3;
  --lh-base:  1.55;
  --lh-loose: 1.75;

  --tracking-tight: -0.02em;
  --tracking-base:  0;
  --tracking-wide:  0.08em;
  --tracking-wider: 0.15em;
}

/* ---------- SPACING SCALE ---------- */
:root {
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.5rem;
  --space-6:  2rem;
  --space-7:  3rem;
  --space-8:  4rem;
  --space-9:  6rem;
  --space-10: 8rem;
}

/* ---------- RADIUS ---------- */
:root {
  --radius-sm:   6px;
  --radius-md:   12px;
  --radius-lg:   20px;
  --radius-xl:   28px;
  --radius-pill: 999px;
}

/* ---------- TRANSITION ---------- */
:root {
  --t-fast: 120ms ease;
  --t-base: 200ms ease;
  --t-slow: 400ms ease;
  --t-bezier: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ---------- BASE ELEMENT STYLES ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-family: var(--font-sans);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  font-weight: 400;
  transition: background-color var(--t-base), color var(--t-base);
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: 700;
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--text);
}

p {
  margin: 0;
}

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

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

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

/* ---------- TYPE HELPERS ---------- */
.eyebrow {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--text-muted);
}

.display {
  font-size: clamp(var(--fs-2xl), 6vw, var(--fs-4xl));
  font-weight: 800;
  line-height: var(--lh-tight);
  letter-spacing: -0.03em;
}

.headline {
  font-size: clamp(var(--fs-xl), 4vw, var(--fs-2xl));
  font-weight: 700;
  letter-spacing: -0.02em;
}

.lede {
  font-size: var(--fs-md);
  line-height: var(--lh-base);
  color: var(--text-muted);
  font-weight: 400;
}

.text-muted { color: var(--text-muted); }
.text-soft  { color: var(--text-soft); }

/* ---------- BRAND LOGOTYPE (CSS-rendered) ---------- */
/* Renders the "Romational" wordmark using brand gradient. */
.logotype {
  font-weight: 800;
  letter-spacing: -0.04em;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
}

.logotype-r { /* small R variant for inline marks */
  font-weight: 800;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- LAYOUT CONTAINER ---------- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-5);
}

.container-narrow {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 var(--space-5);
}

/* ---------- UTILITY: brand gradient surfaces ---------- */
.gradient-bar {
  height: 4px;
  background: var(--brand-gradient);
  border: none;
}

.gradient-bar-thick {
  height: 8px;
  background: var(--brand-gradient);
  border: none;
}

/* ---------- ACCESSIBILITY ---------- */
:focus-visible {
  outline: 2px solid var(--brand-pink);
  outline-offset: 3px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
