/* ─────────────────────────────────────────────────────────────────────────────
   PathwAI — Global Styles
   Design tokens, CSS reset, base typography, and utility classes.
   ───────────────────────────────────────────────────────────────────────────── */

/* ── Google Fonts ──────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Bricolage+Grotesque:wght@600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,700;1,9..144,300;1,9..144,700&display=swap');

/* ── Design Tokens ─────────────────────────────────────────────────────────── */
:root {
  /* Brand — Indigo primary, Emerald success, Amber accent */
  --color-primary-50:  #eef2ff;
  --color-primary-100: #e0e7ff;
  --color-primary-200: #c7d2fe;
  --color-primary-300: #a5b4fc;
  --color-primary-400: #818cf8;
  --color-primary-500: #6366f1;
  --color-primary-600: #634dff;
  --color-primary-700: #5038e0;
  --color-primary-800: #3730a3;
  --color-primary-900: #312e81;

  --color-emerald-50:  #ecfdf5;
  --color-emerald-100: #d1fae5;
  --color-emerald-500: #10b981;
  --color-emerald-600: #059669;
  --color-emerald-700: #047857;

  --color-amber-50:  #fffbeb;
  --color-amber-100: #fef3c7;
  --color-amber-400: #fbbf24;
  --color-amber-500: #f59e0b;
  --color-amber-600: #d97706;

  --color-red-50:  #fef2f2;
  --color-red-100: #fee2e2;
  --color-red-500: #ef4444;
  --color-red-600: #dc2626;
  --color-red-700: #b91c1c;

  --color-sky-50:  #f0f9ff;
  --color-sky-100: #e0f2fe;
  --color-sky-500: #0ea5e9;
  --color-sky-600: #0284c7;

  /* Semantic aliases */
  --color-brand:         var(--color-primary-600);
  --color-brand-hover:   var(--color-primary-700);
  --color-brand-light:   var(--color-primary-50);
  --color-success:       var(--color-emerald-500);
  --color-success-light: var(--color-emerald-50);
  --color-warning:       var(--color-amber-500);
  --color-warning-light: var(--color-amber-50);
  --color-danger:        var(--color-red-600);
  --color-danger-light:  var(--color-red-50);
  --color-info:          var(--color-sky-500);
  --color-info-light:    var(--color-sky-50);

  /* Neutrals — Slate scale */
  --color-slate-50:  #f8fafc;
  --color-slate-100: #f1f5f9;
  --color-slate-200: #e2e8f0;
  --color-slate-300: #cbd5e1;
  --color-slate-400: #94a3b8;
  --color-slate-500: #64748b;
  --color-slate-600: #475569;
  --color-slate-700: #334155;
  --color-slate-800: #1e293b;
  --color-slate-900: #0f172a;
  --color-white:     #ffffff;

  /* Text */
  --text-primary:   var(--color-slate-900);
  --text-secondary: var(--color-slate-600);
  --text-muted:     var(--color-slate-400);
  --text-inverse:   var(--color-white);
  --text-brand:     var(--color-primary-600);

  /* Backgrounds */
  --bg-page:       var(--color-slate-50);
  --bg-surface:    var(--color-white);
  --bg-subtle:     var(--color-slate-100);
  --bg-hover:      var(--color-slate-50);
  --bg-overlay:    rgba(15, 23, 42, 0.6);

  /* Borders */
  --border-default:  var(--color-slate-200);
  --border-strong:   var(--color-slate-300);
  --border-brand:    var(--color-primary-400);

  /* ── Typography ──────────────────────────────────────────────────────────── */
  --font-sans:    'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Noto Sans Georgia', 'Inter', sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;

  --text-xs:   0.6875rem;  /* 11px */
  --text-sm:   0.8125rem;  /* 13px */
  --text-base: 0.9375rem;  /* 15px */
  --text-md:   1rem;       /* 16px */
  --text-lg:   1.125rem;   /* 18px */
  --text-xl:   1.25rem;    /* 20px */
  --text-2xl:  1.5rem;     /* 24px */
  --text-3xl:  1.875rem;   /* 30px */
  --text-4xl:  2.25rem;    /* 36px */
  --text-5xl:  3rem;       /* 48px */
  --text-6xl:  3.75rem;    /* 60px */
  --text-7xl:  4.5rem;     /* 72px */

  --weight-regular:   400;
  --weight-medium:    500;/*
  --weight-semibold:  600;
  --weight-bold:      700;
  --weight-extrabold: 800;

  --leading-none:    1;
  --leading-tight:   1.2;
  --leading-snug:    1.375;
  --leading-normal:  1.5;
  --leading-relaxed: 1.625;
  --leading-loose:   2;

  --tracking-tight:  -0.025em;
  --tracking-normal:  0em;
  --tracking-wide:    0.025em;
  --tracking-wider:   0.05em;

  /* ── Spacing (4px base) ───────────────────────────────────────────────────── */
  --space-px:  1px;
  --space-0:   0;
  --space-1:   0.25rem;   /* 4px */
  --space-1-5: 0.375rem;  /* 6px */
  --space-2:   0.5rem;    /* 8px */
  --space-3:   0.75rem;   /* 12px */
  --space-4:   1rem;      /* 16px */
  --space-5:   1.25rem;   /* 20px */
  --space-6:   1.5rem;    /* 24px */
  --space-7:   1.75rem;   /* 28px */
  --space-8:   2rem;      /* 32px */
  --space-10:  2.5rem;    /* 40px */
  --space-12:  3rem;      /* 48px */
  --space-14:  3.5rem;    /* 56px */
  --space-16:  4rem;      /* 64px */
  --space-20:  5rem;      /* 80px */
  --space-24:  6rem;      /* 96px */
  --space-32:  8rem;      /* 128px */

  /* ── Border Radius ────────────────────────────────────────────────────────── */
  --radius-sm:   0.25rem;   /* 4px */
  --radius-md:   0.5rem;    /* 8px */
  --radius-lg:   0.75rem;   /* 12px */
  --radius-xl:   1rem;      /* 16px */
  --radius-2xl:  1.25rem;   /* 20px */
  --radius-full: 9999px;

  /* ── Shadows ──────────────────────────────────────────────────────────────── */
  --shadow-xs:  0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-sm:  0 1px 3px 0 rgb(0 0 0 / 0.08), 0 1px 2px -1px rgb(0 0 0 / 0.06);
  --shadow-md:  0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.05);
  --shadow-lg:  0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.05);
  --shadow-xl:  0 20px 25px -5px rgb(0 0 0 / 0.08), 0 8px 10px -6px rgb(0 0 0 / 0.04);
  --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.18);
  --shadow-brand: 0 4px 14px 0 rgb(79 70 229 / 0.3);
  --shadow-inner: inset 0 2px 4px 0 rgb(0 0 0 / 0.06);

  /* ── Transitions ──────────────────────────────────────────────────────────── */
  --transition-fast:   100ms ease;
  --transition-base:   175ms ease;
  --transition-slow:   280ms ease;
  --transition-spring: 200ms cubic-bezier(0.175, 0.885, 0.32, 1.275);

  /* ── Z-index ──────────────────────────────────────────────────────────────── */
  --z-base:     1;
  --z-raised:   10;
  --z-dropdown: 100;
  --z-sticky:   200;
  --z-overlay:  300;
  --z-modal:    400;
  --z-toast:    500;

  /* ── Layout ───────────────────────────────────────────────────────────────── */
  --sidebar-width:      260px;
  --sidebar-collapsed:  68px;
  --topbar-height:      56px;
  --content-max-width:  1280px;
}

/* ── CSS Reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  tab-size: 2;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background-color: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  max-width: 100vw;
  overflow-x: hidden;
}

/* Remove default list styles when inside nav or utility containers */
nav ul, nav ol,
[role="list"] {
  list-style: none;
}

/* Improve media defaults */
img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

/* Inherit fonts for form elements */
input, button, textarea, select {
  font: inherit;
}

/* ── Global form baseline ─────────────────────────────────────────────────── */
/* Base border for all non-interactive inputs (overridden by component classes) */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="hidden"]):not([type="color"]):not(.tag-text-input),
textarea,
select {
  border: 1px solid #d1d5db;
}

/* Suppress focus outline on the bare input — wrapper handles focus ring */
/* Suppress focus outline on the bare input — wrapper handles focus ring */
.ob-tags-input:focus-visible {
  outline: none;
}

/* All labels and form titles left-justified */
label,
.form-label,
.field-label,
.section-title,
.card-label {
  text-align: left;
}

/* Avoid text overflow */
p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

/* Make headings bold by default */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--text-primary);
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl);  }
h4 { font-size: var(--text-lg);  }
h5 { font-size: var(--text-base); font-weight: var(--weight-medium); }
h6 { font-size: var(--text-sm);  font-weight: var(--weight-medium); }

a {
  color: var(--color-brand);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover { color: var(--color-brand-hover); }

strong, b { font-weight: var(--weight-semibold); }

small { font-size: var(--text-sm); }

hr {
  border: none;
  border-top: 1px solid var(--border-default);
  margin: var(--space-6) 0;
}

/* Focus styles — accessible, brand-consistent */
:focus-visible {
  outline: 2px solid var(--color-primary-500);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Remove focus ring for mouse users */
:focus:not(:focus-visible) {
  outline: none;
}

/* Scrollbars — subtle, consistent */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--color-slate-300);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--color-slate-400); }

/* Text selection */
::selection {
  background: var(--color-primary-100);
  color: var(--color-primary-900);
}

/* ── Base Typography Classes ──────────────────────────────────────────────── */
.display-1 {
  font-family: var(--font-display);
  font-size: var(--text-7xl);
  font-weight: var(--weight-extrabold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}
.display-2 {
  font-family: var(--font-display);
  font-size: var(--text-6xl);
  font-weight: var(--weight-extrabold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}
.display-3 {
  font-family: var(--font-display);
  font-size: var(--text-5xl);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}

.text-xs     { font-size: var(--text-xs); }
.text-sm     { font-size: var(--text-sm); }
.text-base   { font-size: var(--text-base); }
.text-md     { font-size: var(--text-md); }
.text-lg     { font-size: var(--text-lg); }
.text-xl     { font-size: var(--text-xl); }

.text-primary   { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted     { color: var(--text-muted); }
.text-brand     { color: var(--text-brand); }
.text-success   { color: var(--color-success); }
.text-warning   { color: var(--color-warning); }
.text-danger    { color: var(--color-danger); }

.font-regular   { font-weight: var(--weight-regular); }
.font-medium    { font-weight: var(--weight-medium); }
.font-semibold  { font-weight: var(--weight-semibold); }
.font-bold      { font-weight: var(--weight-bold); }
.font-extrabold { font-weight: var(--weight-extrabold); }

.leading-tight  { line-height: var(--leading-tight); }
.leading-normal { line-height: var(--leading-normal); }

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Layout Utilities ─────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--content-max-width);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.flex        { display: flex; }
.flex-col    { flex-direction: column; }
.flex-wrap   { flex-wrap: wrap; }
.items-start   { align-items: flex-start; }
.items-center  { align-items: center; }
.items-end     { align-items: flex-end; }
.justify-start  { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end    { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.gap-1  { gap: var(--space-1); }
.gap-2  { gap: var(--space-2); }
.gap-3  { gap: var(--space-3); }
.gap-4  { gap: var(--space-4); }
.gap-6  { gap: var(--space-6); }
.gap-8  { gap: var(--space-8); }

.grid         { display: grid; }
.grid-2       { grid-template-columns: repeat(2, 1fr); }
.grid-3       { grid-template-columns: repeat(3, 1fr); }
.grid-4       { grid-template-columns: repeat(4, 1fr); }
.grid-auto    { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

.w-full  { width: 100%; }
.h-full  { height: 100%; }
.min-h-screen { min-height: 100vh; }

/* ── Spacing Utilities ────────────────────────────────────────────────────── */
.p-2  { padding: var(--space-2); }
.p-3  { padding: var(--space-3); }
.p-4  { padding: var(--space-4); }
.p-5  { padding: var(--space-5); }
.p-6  { padding: var(--space-6); }
.p-8  { padding: var(--space-8); }

.px-3 { padding-inline: var(--space-3); }
.px-4 { padding-inline: var(--space-4); }
.px-6 { padding-inline: var(--space-6); }
.py-2 { padding-block: var(--space-2); }
.py-3 { padding-block: var(--space-3); }
.py-4 { padding-block: var(--space-4); }

.m-auto { margin: auto; }
.mt-2   { margin-top: var(--space-2); }
.mt-4   { margin-top: var(--space-4); }
.mt-6   { margin-top: var(--space-6); }
.mb-2   { margin-bottom: var(--space-2); }
.mb-4   { margin-bottom: var(--space-4); }
.mb-6   { margin-bottom: var(--space-6); }

/* ── Visibility & Display ─────────────────────────────────────────────────── */
.hidden      { display: none !important; }
.visible     { display: block !important; }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border-width: 0;
}
.opacity-0 { opacity: 0; }
.opacity-50 { opacity: 0.5; }
.opacity-100 { opacity: 1; }

/* ── Animations & Keyframes ──────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
@keyframes slideOutRight {
  from { transform: translateX(0); opacity: 1; }
  to   { transform: translateX(100%); opacity: 0; }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}
@keyframes bounceIn {
  0%   { transform: scale(0.8); opacity: 0; }
  60%  { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1); }
}

.animate-fadeIn     { animation: fadeIn  var(--transition-base) ease both; }
.animate-fadeUp     { animation: fadeUp  var(--transition-slow) ease both; }
.animate-scaleIn    { animation: scaleIn var(--transition-base) ease both; }
.animate-spin       { animation: spin 1s linear infinite; }
.animate-pulse      { animation: pulse 2s ease-in-out infinite; }
.animate-shimmer    {
  background: linear-gradient(90deg, var(--color-slate-100) 25%, var(--color-slate-200) 50%, var(--color-slate-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.8s ease-in-out infinite;
}

/* ── Skeleton loading placeholder ──────────────────────────────────────────── */
.skeleton {
  border-radius: var(--radius-md);
}
.skeleton::after {
  content: '';
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--color-slate-100) 25%, var(--color-slate-50) 50%, var(--color-slate-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.8s ease-in-out infinite;
}

/* ── Surface variants ─────────────────────────────────────────────────────── */
.surface {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
}
.surface-subtle {
  background: var(--bg-subtle);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
}

/* ── Gradient helpers (used in landing + hero sections) ───────────────────── */
.gradient-brand {
  background: linear-gradient(135deg, var(--color-primary-600) 0%, var(--color-primary-800) 100%);
}
.gradient-hero {
  background: linear-gradient(135deg,
    #1e1b4b 0%,
    #312e81 30%,
    #4338ca 60%,
    #6366f1 100%);
}
.gradient-text {
  background: linear-gradient(135deg, var(--color-primary-500), var(--color-primary-300));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.gradient-success {
  background: linear-gradient(135deg, var(--color-emerald-600), var(--color-emerald-500));
}

/* ── Print ────────────────────────────────────────────────────────────────── */
@media print {
  .no-print { display: none !important; }
  body { background: white; color: black; }
}

/* ── Responsive breakpoints ──────────────────────────────────────────────── */
/* Desktop-first: defaults are desktop, override for smaller screens */
@media (max-width: 1280px) {
  :root { --content-max-width: 100%; }
}
@media (max-width: 1024px) {
  :root { --sidebar-width: 220px; }
}
@media (max-width: 768px) {
  :root { --sidebar-width: 0px; --topbar-height: 60px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .display-1 { font-size: var(--text-5xl); }
  .display-2 { font-size: var(--text-4xl); }
  .display-3 { font-size: var(--text-3xl); }
}
@media (max-width: 480px) {
  :root { --space-page: var(--space-4); }
  .container { padding-inline: var(--space-4); }
}

/* ── Logo wordmark ───────────────────────────────────────────────────────────── */
.landing-nav-logo-name {
  font-family: 'Fraunces', 'Inter', serif;
  font-weight: 700;
  letter-spacing: -0.04em;
  font-size: 1.1rem;
}

.logo-ai {
  font-style: italic;
  font-weight: 300;
  background: linear-gradient(135deg, #a78bfa, #38bdf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  padding-right: 0.15em; /* prevent italic slant from clipping the trailing I */
}

/* App icon / mark colors updated to new violet */
.landing-nav-logo-mark {
  background: linear-gradient(145deg, #634dff, #a855f7) !important;
}
