/* ==========================================================================
   Flowee — Foundations
   Colors, type, spacing, radii, shadows.
   Source of truth: Flowee Brand · Logo System v1.0 (05·2026)
   ========================================================================== */

/* DM Sans is the brand typeface (per logo-system PDF: "DM Sans 600,
   lowercase, tracking −0.045em"). The provided SVGs were drawn with an
   SF Pro fallback — the brand spec, not the SVG, is canonical.            */
@import url("https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600;9..40,700&family=DM+Mono:wght@400;500&display=swap");

:root {
  /* ---- Palette ---------------------------------------------------------- */
  /* Brand */
  --flowee-violet:   #3A2A6E;  /* PRIMARY — nodes, headings, key UI */
  --flowee-coral:    #F26B47;  /* ACCENT  — flow arc, CTAs, highlights */
  --flowee-ink:      #0D0D0D;  /* INK     — body text, dark backgrounds */
  --flowee-paper:    #F2F0E9;  /* PAPER   — warm off-white background */

  /* Violet scale (derived from #3A2A6E for hover/press/tints) */
  --violet-50:  #F1EEF7;
  --violet-100: #E0D9EE;
  --violet-200: #BDAFD8;
  --violet-300: #8E78BE;
  --violet-400: #5E479B;
  --violet-500: #3A2A6E;   /* = --flowee-violet */
  --violet-600: #2F235A;
  --violet-700: #251B47;
  --violet-800: #1A1333;
  --violet-900: #100A20;

  /* Coral scale */
  --coral-50:  #FEF1ED;
  --coral-100: #FCDCD0;
  --coral-200: #F9B8A1;
  --coral-300: #F59478;
  --coral-400: #F37B5C;
  --coral-500: #F26B47;    /* = --flowee-coral */
  --coral-600: #D45638;
  --coral-700: #A8412A;
  --coral-800: #7A2F1E;
  --coral-900: #4D1E13;

  /* Ink / Paper neutrals — warm-tinted to harmonize with PAPER */
  --ink-900: #0D0D0D;       /* = --flowee-ink */
  --ink-800: #1C1B19;
  --ink-700: #2E2C28;
  --ink-600: #4A4843;
  --ink-500: #6B6862;
  --ink-400: #908C84;
  --ink-300: #B9B4AA;
  --ink-200: #D9D4C7;
  --ink-100: #E8E4D7;
  --ink-50:  #F2F0E9;       /* = --flowee-paper */
  --ink-0:   #FBFAF6;       /* paper, lifted */

  /* Semantic */
  --success: #2F7D54;
  --success-bg: #E4F0E9;
  --warning: #C77B16;
  --warning-bg: #FBEFD8;
  --danger:  #C13B2C;
  --danger-bg: #FAE2DD;
  --info:    var(--violet-500);
  --info-bg: var(--violet-50);

  /* ---- Surface tokens (light is the default) --------------------------- */
  --bg:           var(--flowee-paper);    /* page */
  --bg-elevated:  #FFFFFF;                /* cards, modals */
  --bg-sunken:    #EAE7DC;                /* wells, footer band */
  --bg-inverse:   var(--ink-900);

  --fg:           var(--ink-900);         /* primary text */
  --fg-muted:     var(--ink-600);         /* secondary text */
  --fg-subtle:    var(--ink-500);         /* tertiary, captions */
  --fg-disabled:  var(--ink-400);
  --fg-on-violet: #FFFFFF;
  --fg-on-coral:  #FFFFFF;
  --fg-inverse:   var(--ink-50);

  --border:        var(--ink-200);
  --border-strong: var(--ink-300);
  --border-focus:  var(--flowee-violet);

  --accent:        var(--flowee-coral);
  --accent-hover:  var(--coral-600);
  --accent-press:  var(--coral-700);

  --primary:       var(--flowee-violet);
  --primary-hover: var(--violet-600);
  --primary-press: var(--violet-700);

  /* ---- Type ------------------------------------------------------------- */
  --font-sans: "DM Sans", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "DM Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --font-display: var(--font-sans);  /* Brand uses one family across the system */

  /* Brand-mark tracking (per spec: -0.045em) */
  --brand-tracking: -0.045em;

  /* Type scale — modular, 1.25 ratio, anchored at 16px */
  --fs-12: 0.75rem;     --lh-12: 1rem;
  --fs-14: 0.875rem;    --lh-14: 1.25rem;
  --fs-16: 1rem;        --lh-16: 1.5rem;
  --fs-18: 1.125rem;    --lh-18: 1.625rem;
  --fs-20: 1.25rem;     --lh-20: 1.75rem;
  --fs-24: 1.5rem;      --lh-24: 2rem;
  --fs-30: 1.875rem;    --lh-30: 2.25rem;
  --fs-36: 2.25rem;     --lh-36: 2.5rem;
  --fs-48: 3rem;        --lh-48: 3.25rem;
  --fs-60: 3.75rem;     --lh-60: 3.875rem;
  --fs-76: 4.75rem;     --lh-76: 4.875rem;

  /* Tracking — tighter as size grows, looser for small caps */
  --tracking-tight:    -0.02em;
  --tracking-tighter:  -0.035em;
  --tracking-display:  -0.045em;   /* matches brand-mark */
  --tracking-normal:    0em;
  --tracking-wide:     0.04em;
  --tracking-eyebrow:  0.12em;     /* uppercase eyebrows */

  /* Weights actually used in the system */
  --fw-regular: 400;
  --fw-medium:  500;
  --fw-semibold: 600;   /* brand weight */
  --fw-bold:    700;

  /* ---- Spacing (4px base) ---------------------------------------------- */
  --space-0:   0;
  --space-1:   4px;
  --space-2:   8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;
  --space-32: 128px;

  /* ---- Radii ----------------------------------------------------------- */
  /* App-icon spec: rounded square with 22% radius — the system extrapolates
     small radii from that ratio for a consistent feel.                    */
  --radius-xs:    4px;
  --radius-sm:    8px;
  --radius-md:   12px;
  --radius-lg:   18px;
  --radius-xl:   24px;
  --radius-2xl:  32px;
  --radius-app:  22%;          /* brand app-icon shape */
  --radius-pill: 999px;
  --radius-node: 50%;          /* the brand "node" — perfect circle */

  /* ---- Elevation -------------------------------------------------------- */
  /* Shadows are subtle and warm-tinted to match PAPER (not pure black). */
  --shadow-xs: 0 1px 2px rgba(13, 13, 13, 0.04);
  --shadow-sm: 0 1px 2px rgba(13, 13, 13, 0.04), 0 2px 6px rgba(13, 13, 13, 0.05);
  --shadow-md: 0 2px 4px rgba(13, 13, 13, 0.04), 0 8px 18px rgba(13, 13, 13, 0.06);
  --shadow-lg: 0 4px 8px rgba(13, 13, 13, 0.05), 0 18px 36px rgba(13, 13, 13, 0.09);
  --shadow-xl: 0 12px 24px rgba(13, 13, 13, 0.08), 0 32px 64px rgba(13, 13, 13, 0.12);
  --shadow-focus: 0 0 0 4px rgba(58, 42, 110, 0.18);   /* violet ring */
  --shadow-coral-focus: 0 0 0 4px rgba(242, 107, 71, 0.22);

  /* ---- Motion ----------------------------------------------------------- */
  --ease-flow:    cubic-bezier(.32, .72, .24, 1);     /* the "arc" curve */
  --ease-out:     cubic-bezier(.2, .7, .2, 1);
  --ease-in-out:  cubic-bezier(.65, .05, .36, 1);
  --dur-fast:     120ms;
  --dur-base:     200ms;
  --dur-slow:     360ms;
  --dur-flow:     560ms;       /* used for the signature arc draw */

  /* ---- Layout ----------------------------------------------------------- */
  --container: 1200px;
  --container-narrow: 880px;
  --container-wide: 1360px;
  --gutter: var(--space-6);
}

/* Dark surface mode — rarely used; brand spec says "DARK UI · #0D0D0D".  */
[data-theme="dark"] {
  --bg:          var(--ink-900);
  --bg-elevated: #161513;
  --bg-sunken:   #050505;
  --bg-inverse:  var(--flowee-paper);
  --fg:          var(--flowee-paper);
  --fg-muted:    #C9C4B8;
  --fg-subtle:   #908C84;
  --fg-inverse:  var(--ink-900);
  --border:        #2A2823;
  --border-strong: #3D3A33;
}

/* ==========================================================================
   Semantic typography roles
   Apply a single class — each one is fully resolved (size, line-height,
   weight, tracking). No need to compose.
   ========================================================================== */

html { -webkit-text-size-adjust: 100%; }

body, .t-body {
  font-family: var(--font-sans);
  font-size: var(--fs-16);
  line-height: var(--lh-16);
  font-weight: var(--fw-regular);
  letter-spacing: var(--tracking-tight);
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* The brand wordmark style — apply to anything that should READ as "the
   flowee mark" (e.g. footer wordmark, login lockup).                     */
.t-wordmark {
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--brand-tracking);
  text-transform: lowercase;
  color: var(--flowee-ink);
}

/* Display — hero copy. */
.t-display-xl {
  font-family: var(--font-display);
  font-size: var(--fs-76);
  line-height: var(--lh-76);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-display);
  color: var(--fg);
}
.t-display-lg {
  font-family: var(--font-display);
  font-size: var(--fs-60);
  line-height: var(--lh-60);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-display);
  color: var(--fg);
}
.t-display-md {
  font-family: var(--font-display);
  font-size: var(--fs-48);
  line-height: var(--lh-48);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-tighter);
  color: var(--fg);
}

/* Headings */
h1, .t-h1 {
  font-family: var(--font-display);
  font-size: var(--fs-36);
  line-height: var(--lh-36);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-tighter);
  color: var(--fg);
}
h2, .t-h2 {
  font-family: var(--font-display);
  font-size: var(--fs-30);
  line-height: var(--lh-30);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-tighter);
  color: var(--fg);
}
h3, .t-h3 {
  font-family: var(--font-display);
  font-size: var(--fs-24);
  line-height: var(--lh-24);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-tight);
  color: var(--fg);
}
h4, .t-h4 {
  font-family: var(--font-sans);
  font-size: var(--fs-20);
  line-height: var(--lh-20);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-tight);
  color: var(--fg);
}

/* Body */
.t-lead {
  font-size: var(--fs-20);
  line-height: var(--lh-20);
  font-weight: var(--fw-regular);
  letter-spacing: var(--tracking-tight);
  color: var(--fg-muted);
}
p, .t-p {
  font-size: var(--fs-16);
  line-height: var(--lh-16);
  font-weight: var(--fw-regular);
  letter-spacing: var(--tracking-tight);
  color: var(--fg);
}
.t-small {
  font-size: var(--fs-14);
  line-height: var(--lh-14);
  letter-spacing: 0;
  color: var(--fg-muted);
}
.t-caption {
  font-size: var(--fs-12);
  line-height: var(--lh-12);
  letter-spacing: var(--tracking-wide);
  color: var(--fg-subtle);
}

/* Eyebrow — small UPPERCASE label above a section title */
.t-eyebrow {
  font-family: var(--font-sans);
  font-size: var(--fs-12);
  line-height: var(--lh-12);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--flowee-violet);
}

/* Mono — use for IDs, code, numerics, technical chrome. */
code, .t-code, .t-mono {
  font-family: var(--font-mono);
  font-size: 0.95em;
  letter-spacing: 0;
  color: var(--fg);
}

/* Links */
a {
  color: var(--flowee-violet);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in oklab, var(--flowee-violet) 35%, transparent);
  transition: color var(--dur-fast) var(--ease-out),
              text-decoration-color var(--dur-fast) var(--ease-out);
}
a:hover { color: var(--violet-700); text-decoration-color: var(--violet-700); }

::selection { background: var(--coral-200); color: var(--ink-900); }

/* Focus rings — violet by default, coral on accent surfaces. */
:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
  border-radius: var(--radius-sm);
}
