/* ============================================================
   WristFile Design System — Foundation Tokens
   Two palettes share a neutral warm-gray spine:
   - In-app (dark, crimson primary)
   - Marketing (warm off-white, deep teal primary, coral accent)
   ============================================================ */

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

:root {
  /* ---------- Type stacks (SF Pro at runtime; Inter fallback in HTML) ---------- */
  --font-display: 'SF Pro Display', -apple-system, 'Inter', system-ui, sans-serif;
  --font-text:    'SF Pro Text', -apple-system, 'Inter', system-ui, sans-serif;
  --font-mono:    'SF Mono', ui-monospace, 'JetBrains Mono', Menlo, monospace;

  /* ---------- Type scale ---------- */
  --fs-display-xl: 60px;   /* App Store hero */
  --fs-display-lg: 48px;
  --fs-display-md: 40px;
  --fs-h1:         34px;   /* In-app screen title (Home, Settings) */
  --fs-h2:         28px;
  --fs-h3:         22px;   /* Card title in modal sheet */
  --fs-body-lg:    18px;
  --fs-body:       17px;   /* iOS body default */
  --fs-body-sm:    15px;
  --fs-caption:    13px;   /* Helper text, timestamps */
  --fs-overline:   12px;   /* SECTION HEADERS in Settings */
  --fs-mono:       14px;

  --lh-tight:    1.05;
  --lh-snug:     1.2;
  --lh-normal:   1.4;
  --lh-relaxed:  1.5;

  --tracking-display: -0.02em;
  --tracking-tight:   -0.01em;
  --tracking-normal:  0;
  --tracking-wide:    0.04em;
  --tracking-overline: 0.08em;

  --fw-regular:  400;
  --fw-medium:   500;
  --fw-semibold: 600;
  --fw-bold:     700;
  --fw-heavy:    800;

  /* ============================================================
     IN-APP PALETTE (dark by default)
     ============================================================ */

  /* Surfaces */
  --bg:            #0B0B0D;        /* near-black, screen background */
  --bg-elev-1:    #161618;        /* card / sheet base */
  --bg-elev-2:    #1C1C1F;        /* nested card, settings row group */
  --bg-elev-3:    #232327;
  --scrim:         rgba(0,0,0,0.5); /* modal backdrop */
  --tabbar-fill:  rgba(20,20,22,0.7);

  /* Text */
  --fg:            #FFFFFF;
  --fg-2:          #B5B7BB;        /* secondary, "no phone required" */
  --fg-3:          #6E7075;        /* tertiary, timestamps */
  --fg-disabled:  #4A4B4F;

  /* Hairlines */
  --line:          rgba(255,255,255,0.06);
  --line-strong:  rgba(255,255,255,0.12);

  /* Brand — in-app */
  --crimson:       #E63946;        /* primary action, tab selected, app icon */
  --crimson-hi:   #FF4D5C;        /* hover/press lighter */
  --crimson-soft: rgba(230,57,70,0.18); /* tint background for premium card */
  --premium-card: linear-gradient(135deg, #C8323F 0%, #8C1A24 100%);

  /* Status */
  --green-online: #34C759;        /* "Connected" dot */
  --warn:          #FF9F0A;
  --error:         #FF453A;

  /* ============================================================
     MARKETING PALETTE (warm light, premium)
     ============================================================ */

  --mkt-bg-top:    #FAFBFC;
  --mkt-bg-bot:    #EEF2F5;
  --mkt-bg-warm-top: #FAFAFA;
  --mkt-bg-warm-bot: #F0E8DD;

  --teal:          #0A4D5C;        /* primary headline */
  --teal-2:        #0D6072;
  --teal-soft:    #D6E4E7;

  --coral:         #FF6B6B;        /* accent, file pills, highlights */
  --coral-2:       #FF8A8A;
  --coral-soft:   #FFE3E3;

  --warm-gray:    #4A5568;        /* sub-caption body */
  --warm-gray-2:  #718096;
  --warm-gray-3:  #A0AEC0;

  /* Marketing accent for category badges (PDF/DOCX/XLSX/TXT) */
  --pill-pdf:      var(--coral);
  --pill-docx:    #4FB6C9;
  --pill-xlsx:    #6CB67A;
  --pill-txt:      #C9A14F;

  /* ============================================================
     SHARED — spacing, radii, shadows, motion
     ============================================================ */

  /* Spacing — 8pt with 4pt half-stops */
  --sp-1:   4px;
  --sp-2:   8px;
  --sp-3:  12px;
  --sp-4:  16px;
  --sp-5:  20px;
  --sp-6:  24px;
  --sp-8:  32px;
  --sp-10: 40px;
  --sp-14: 56px;
  --sp-20: 80px;

  /* Radii */
  --r-xs:    8px;
  --r-sm:   12px;
  --r-md:   14px;   /* icon chip in Add Document sheet */
  --r-lg:   18px;
  --r-xl:   20px;   /* cards */
  --r-2xl: 22px;   /* chat composer */
  --r-3xl: 24px;   /* sheet top edge */
  --r-pill: 999px;

  /* Shadows — used ONLY on marketing renders */
  --shadow-device: 0 12px 60px rgba(15, 23, 42, 0.08);
  --shadow-device-strong: 0 20px 80px rgba(15, 23, 42, 0.10);
  /* In-app: no shadows — elevation is surface-lightness only. */

  /* Motion */
  --ease-out:  cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-in:   cubic-bezier(0.4, 0, 1, 1);
  --dur-fast:    140ms;
  --dur-base:    200ms;
  --dur-slow:    320ms;
}

/* ============================================================
   SEMANTIC STYLES — apply directly to elements
   ============================================================ */

.h-display-xl,
.h-display-lg,
.h-display-md,
.h1, .h2, .h3 {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-display);
  text-wrap: balance;
}
.h-display-xl { font-size: var(--fs-display-xl); }
.h-display-lg { font-size: var(--fs-display-lg); }
.h-display-md { font-size: var(--fs-display-md); }
.h1 { font-size: var(--fs-h1); letter-spacing: var(--tracking-tight); }
.h2 { font-size: var(--fs-h2); letter-spacing: var(--tracking-tight); }
.h3 { font-size: var(--fs-h3); letter-spacing: var(--tracking-tight); line-height: var(--lh-snug); }

.body-lg, .body, .body-sm {
  font-family: var(--font-text);
  font-weight: var(--fw-regular);
  line-height: var(--lh-normal);
  letter-spacing: var(--tracking-normal);
}
.body-lg { font-size: var(--fs-body-lg); }
.body    { font-size: var(--fs-body); }
.body-sm { font-size: var(--fs-body-sm); }

.caption {
  font-family: var(--font-text);
  font-size: var(--fs-caption);
  font-weight: var(--fw-regular);
  color: var(--fg-3);
  letter-spacing: var(--tracking-normal);
}

.overline {
  font-family: var(--font-text);
  font-size: var(--fs-overline);
  font-weight: var(--fw-semibold);
  color: var(--fg-3);
  letter-spacing: var(--tracking-overline);
  text-transform: uppercase;
}

.mono {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  letter-spacing: var(--tracking-normal);
}

/* Marketing-specific text helpers */
.mkt-headline {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  font-size: var(--fs-display-xl);
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--teal);
  text-wrap: balance;
}
.mkt-subcap {
  font-family: var(--font-text);
  font-weight: var(--fw-medium);
  font-size: 22px;
  line-height: 1.35;
  color: var(--warm-gray);
  text-wrap: balance;
}
