/* ==========================================================================
   FUNDEN STUDIO — Design System
   --------------------------------------------------------------------------
   A premium, editorial design language for Fundinmentor.
   Influences: Stripe, Linear, Vercel, Apple, Republic.

   Layers (cascade order):
     1. Tokens         — colors, type, spacing, motion
     2. Reset & base   — sane defaults
     3. Typography     — type scale & utilities
     4. Layout         — container, grid, sections
     5. Components     — buttons, cards, forms, badges, etc.
     6. Patterns       — header, footer, hero, project card
     7. Utilities      — margin, display, etc.
   ========================================================================== */


/* =============================================================
   1. TOKENS
   ============================================================= */
:root {
  /* Brand */
  --brand: #0F6F4A;
  /* signature emerald */
  --brand-strong: #0A5236;
  --brand-soft: #E8F3EE;
  --brand-contrast: #FFFFFF;

  --gold: #B5894C;
  /* premium accent */
  --gold-soft: #F6EFE3;

  /* Surfaces (light) */
  --bg: #FBFAF7;
  /* warm off-white */
  --surface: #FFFFFF;
  --surface-2: #F5F3EE;
  --surface-3: #EFEDE6;

  --border: rgba(20, 23, 32, 0.10);
  --border-strong: rgba(20, 23, 32, 0.18);
  --border-faint: rgba(20, 23, 32, 0.06);

  /* Text (light) */
  --text: #0E1116;
  --text-2: #3A3F48;
  --text-3: #6B7280;
  --text-4: #9AA0AB;
  --text-on-brand: #FFFFFF;

  /* States */
  --success: #0F8A5F;
  --success-soft: #E1F4EB;
  --warning: #B5894C;
  --warning-soft: #F6EFE3;
  --danger: #B43232;
  --danger-soft: #F8E5E2;
  --info: #2563A8;
  --info-soft: #E5EEF7;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(20, 23, 32, 0.04);
  --shadow-sm: 0 2px 8px rgba(20, 23, 32, 0.05), 0 1px 2px rgba(20, 23, 32, 0.04);
  --shadow-md: 0 8px 24px rgba(20, 23, 32, 0.06), 0 2px 6px rgba(20, 23, 32, 0.04);
  --shadow-lg: 0 24px 48px rgba(20, 23, 32, 0.08), 0 8px 16px rgba(20, 23, 32, 0.05);
  --shadow-xl: 0 32px 64px rgba(20, 23, 32, 0.10), 0 16px 32px rgba(20, 23, 32, 0.06);

  /* Spacing scale (8px base) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;
  --space-10: 128px;

  /* Radius */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-2xl: 28px;
  --radius-full: 999px;

  /* Type */
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Inter', system-ui, sans-serif;
  --font-serif: 'Instrument Serif', 'Source Serif 4', 'Iowan Old Style', Georgia, serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, monospace;

  /* Type scale (responsive via clamp) */
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-md: 1.0625rem;
  --fs-lg: 1.1875rem;
  --fs-xl: 1.375rem;
  --fs-2xl: clamp(1.5rem, 1.4rem + 0.5vw, 1.875rem);
  --fs-3xl: clamp(1.875rem, 1.7rem + 0.9vw, 2.5rem);
  --fs-4xl: clamp(2.25rem, 2rem + 1.25vw, 3.25rem);
  --fs-5xl: clamp(2.75rem, 2.3rem + 2.25vw, 4.5rem);
  --fs-6xl: clamp(3.25rem, 2.6rem + 3.25vw, 6rem);

  /* Lines */
  --lh-tight: 1.05;
  --lh-snug: 1.2;
  --lh-base: 1.5;
  --lh-relaxed: 1.65;

  /* Letter-spacing */
  --tracking-tighter: -0.04em;
  --tracking-tight: -0.025em;
  --tracking-normal: 0;
  --tracking-wide: 0.04em;
  --tracking-wider: 0.08em;
  --tracking-widest: 0.18em;

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-1: 120ms;
  --dur-2: 200ms;
  --dur-3: 320ms;
  --dur-4: 500ms;
  --dur-5: 720ms;

  /* Layout */
  --container: 1200px;
  --container-wide: 1320px;
  --container-narrow: 800px;
  --header-h: 72px;

  /* Z-index */
  --z-base: 1;
  --z-dropdown: 10;
  --z-sticky: 20;
  --z-header: 30;
  --z-overlay: 50;
  --z-modal: 60;
  --z-toast: 70;
}

/* Dark mode tokens */
[data-theme="dark"] {
  --bg: #08090C;
  --surface: #0E1015;
  --surface-2: #14171E;
  --surface-3: #1B1F28;

  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --border-faint: rgba(255, 255, 255, 0.04);

  --text: #F5F2EB;
  --text-2: #B6BAC4;
  --text-3: #7C828D;
  --text-4: #585E68;

  --brand: #2EAB7A;
  --brand-strong: #34C68F;
  --brand-soft: rgba(46, 171, 122, 0.10);

  --gold: #D4A968;
  --gold-soft: rgba(212, 169, 104, 0.10);

  --success: #34D399;
  --success-soft: rgba(52, 211, 153, 0.10);
  --warning: #D4A968;
  --warning-soft: rgba(212, 169, 104, 0.10);
  --danger: #E55858;
  --danger-soft: rgba(229, 88, 88, 0.10);
  --info: #5AA3E5;
  --info-soft: rgba(90, 163, 229, 0.10);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.30);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.30), 0 1px 2px rgba(0, 0, 0, 0.20);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35), 0 2px 6px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 24px 48px rgba(0, 0, 0, 0.45), 0 8px 16px rgba(0, 0, 0, 0.30);
  --shadow-xl: 0 32px 64px rgba(0, 0, 0, 0.55), 0 16px 32px rgba(0, 0, 0, 0.35);

  color-scheme: dark;
}


/* =============================================================
   2. RESET & BASE
   ============================================================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  font-weight: 400;
  line-height: var(--lh-base);
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
  font-feature-settings: "ss01", "cv11";
  position: relative;
}

/* Subtle paper-like noise (very, very faint) */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' /%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' /%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

[data-theme="dark"] body::before {
  opacity: 0.04;
  mix-blend-mode: screen;
}

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

/* `hidden` HTML attribute MUST always hide — overrides any class-based display rule. */
[hidden] {
  display: none !important;
}

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

input,
textarea,
select {
  font: inherit;
  color: inherit;
}

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

ul,
ol {
  list-style: none;
}

hr {
  border: 0;
  height: 1px;
  background: var(--border);
  margin: var(--space-6) 0;
}

::selection {
  background: var(--brand);
  color: var(--brand-contrast);
}

/* Scrollbar (subtle) */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 999px;
  border: 3px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-3);
}


/* =============================================================
   3. TYPOGRAPHY
   ============================================================= */
.eyebrow,
.f-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--brand);
}

.f-eyebrow::before {
  content: '';
  display: inline-block;
  width: 24px;
  height: 1px;
  background: var(--brand);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
}

.f-display-1 {
  font-size: var(--fs-6xl);
  font-weight: 700;
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tighter);
}

.f-display-2 {
  font-size: var(--fs-5xl);
  font-weight: 700;
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tighter);
}

h1,
.f-h1 {
  font-size: var(--fs-4xl);
  font-weight: 700;
  line-height: var(--lh-snug);
  letter-spacing: var(--tracking-tight);
}

h2,
.f-h2 {
  font-size: var(--fs-3xl);
  font-weight: 600;
  line-height: var(--lh-snug);
  letter-spacing: var(--tracking-tight);
}

h3,
.f-h3 {
  font-size: var(--fs-2xl);
  font-weight: 600;
  line-height: var(--lh-snug);
  letter-spacing: var(--tracking-tight);
}

h4,
.f-h4 {
  font-size: var(--fs-xl);
  font-weight: 600;
  line-height: var(--lh-snug);
  letter-spacing: var(--tracking-tight);
}

h5,
.f-h5 {
  font-size: var(--fs-lg);
  font-weight: 600;
  line-height: var(--lh-base);
}

h6,
.f-h6 {
  font-size: var(--fs-base);
  font-weight: 600;
  line-height: var(--lh-base);
}

p {
  color: var(--text-2);
  line-height: var(--lh-relaxed);
}

.f-lead {
  font-size: var(--fs-lg);
  line-height: var(--lh-relaxed);
  color: var(--text-2);
  font-weight: 400;
}

.f-small {
  font-size: var(--fs-sm);
}

.f-xs {
  font-size: var(--fs-xs);
}

.f-serif {
  font-family: var(--font-serif);
  font-weight: 400;
  letter-spacing: -0.005em;
  font-style: italic;
}

.f-mono {
  font-family: var(--font-mono);
}

.f-text {
  color: var(--text);
}

.f-text-2 {
  color: var(--text-2);
}

.f-text-3 {
  color: var(--text-3);
}

.f-text-brand {
  color: var(--brand);
}

.f-text-gold {
  color: var(--gold);
}

.f-text-success {
  color: var(--success);
}

.f-text-danger {
  color: var(--danger);
}


/* =============================================================
   4. LAYOUT
   ============================================================= */
.f-container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-5);
  position: relative;
}

@media (min-width: 768px) {
  .f-container {
    padding-inline: var(--space-6);
  }
}

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

.f-container-narrow {
  max-width: var(--container-narrow);
}

.f-section {
  padding-block: clamp(64px, 8vw, 120px);
  position: relative;
}

.f-section-tight {
  padding-block: clamp(48px, 6vw, 88px);
}

.f-section-head {
  max-width: 640px;
  margin-bottom: var(--space-7);
}

.f-section-head.is-center {
  text-align: center;
  margin-inline: auto;
}

.f-section-head h2 {
  margin-top: var(--space-3);
}

.f-section-head p {
  margin-top: var(--space-3);
}

.f-grid {
  display: grid;
  gap: var(--space-5);
}

.f-grid-2 {
  grid-template-columns: repeat(1, 1fr);
}

.f-grid-3 {
  grid-template-columns: repeat(1, 1fr);
}

.f-grid-4 {
  grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 768px) {
  .f-grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .f-grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .f-grid-4 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .f-grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .f-grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Special Layout: Content + Sidebar */
.f-grid-sidebar {
  grid-template-columns: 1fr;
}

@media (min-width: 1024px) {
  .f-grid-sidebar {
    grid-template-columns: 1.4fr 1fr;
  }
}


/* =============================================================
   5. COMPONENTS
   ============================================================= */

/* ---------- Button ---------- */
.f-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 22px;
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.005em;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition: background var(--dur-2) var(--ease-out),
    color var(--dur-2) var(--ease-out),
    border-color var(--dur-2) var(--ease-out),
    transform var(--dur-2) var(--ease-out),
    box-shadow var(--dur-2) var(--ease-out);
  position: relative;
}

.f-btn:active {
  transform: translateY(0.5px);
}

.f-btn-primary {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.f-btn-primary:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--brand-contrast);
}

.f-btn-brand {
  background: var(--brand);
  color: var(--brand-contrast);
  border-color: var(--brand);
}

.f-btn-brand:hover {
  background: var(--brand-strong);
  border-color: var(--brand-strong);
}

.f-btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-xs);
}

.f-btn-secondary:hover {
  border-color: var(--text);
  box-shadow: var(--shadow-sm);
}

.f-btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.f-btn-ghost:hover {
  border-color: var(--text);
  background: var(--surface);
}

.f-btn-link {
  padding: 0;
  background: transparent;
  border: 0;
  color: var(--text);
  border-radius: 0;
  position: relative;
  font-weight: 500;
}

.f-btn-link::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-3) var(--ease-out);
}

.f-btn-link:hover::after {
  transform: scaleX(1);
}

.f-btn-sm {
  padding: 8px 16px;
  font-size: var(--fs-xs);
}

.f-btn-lg {
  padding: 16px 28px;
  font-size: var(--fs-base);
}

.f-btn-block {
  width: 100%;
}

.f-btn[disabled],
.f-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Icon-only */
.f-btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-full);
}

/* ---------- Card / Surface ---------- */
.f-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--dur-3) var(--ease-out),
    box-shadow var(--dur-3) var(--ease-out),
    transform var(--dur-3) var(--ease-out);
}

.f-card-hover:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.f-card-flat {
  box-shadow: none;
  border-color: var(--border-faint);
}

.f-card-padded {
  padding: var(--space-6);
}

.f-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border-faint);
}

.f-card-head h3 {
  font-size: var(--fs-md);
  font-weight: 600;
}

.f-card-body {
  padding: var(--space-6);
}

.f-card-foot {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border-faint);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
}

/* ---------- Inputs ---------- */
.f-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.f-label {
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--text-2);
  letter-spacing: var(--tracking-wide);
}

.f-input,
.f-textarea,
.f-select {
  width: 100%;
  padding: 12px 16px;
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  transition: border-color var(--dur-2) var(--ease-out),
    box-shadow var(--dur-2) var(--ease-out),
    background var(--dur-2) var(--ease-out);
}

.f-input::placeholder,
.f-textarea::placeholder {
  color: var(--text-4);
}

.f-input:hover,
.f-textarea:hover,
.f-select:hover {
  border-color: var(--text-3);
}

.f-input:focus,
.f-textarea:focus,
.f-select:focus {
  outline: none;
  border-color: var(--text);
  box-shadow: 0 0 0 4px var(--brand-soft);
}

.f-textarea {
  resize: vertical;
  min-height: 120px;
  line-height: var(--lh-base);
}

.f-input-group {
  position: relative;
}

.f-input-group .f-input {
  padding-left: 44px;
}

.f-input-group .f-input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
  font-size: 0.95em;
}

.f-checkbox,
.f-radio {
  width: 18px;
  height: 18px;
  accent-color: var(--text);
  cursor: pointer;
}

.f-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: var(--fs-sm);
  color: var(--text-2);
}

.f-help {
  font-size: var(--fs-xs);
  color: var(--text-3);
  margin-top: 2px;
}

/* ---------- Badge ---------- */
.f-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: var(--radius-full);
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.f-badge-brand {
  background: var(--brand-soft);
  color: var(--brand);
  border-color: transparent;
}

.f-badge-gold {
  background: var(--gold-soft);
  color: var(--gold);
  border-color: transparent;
}

.f-badge-success {
  background: var(--success-soft);
  color: var(--success);
  border-color: transparent;
}

.f-badge-warning {
  background: var(--warning-soft);
  color: var(--warning);
  border-color: transparent;
}

.f-badge-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: transparent;
}

.f-badge-info {
  background: var(--info-soft);
  color: var(--info);
  border-color: transparent;
}

.f-badge-dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

/* ---------- Tag (pill chip) ---------- */
.f-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: var(--fs-xs);
  font-weight: 500;
  background: var(--surface-2);
  color: var(--text-2);
  border-radius: var(--radius-full);
  border: 1px solid transparent;
}

/* ---------- Progress ---------- */
.f-progress {
  width: 100%;
  height: 4px;
  background: var(--surface-2);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.f-progress-bar {
  height: 100%;
  background: var(--text);
  border-radius: var(--radius-full);
  transition: width var(--dur-5) var(--ease-out);
}

.f-progress-bar.is-brand {
  background: var(--brand);
}

.f-progress-bar.is-gold {
  background: var(--gold);
}

/* ---------- Stat ---------- */
.f-stat-value {
  font-size: var(--fs-3xl);
  font-weight: 600;
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--text);
  font-family: var(--font-display);
}

.f-stat-label {
  font-size: var(--fs-xs);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--text-3);
  margin-top: 4px;
}

/* ---------- Alert ---------- */
.f-alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: var(--fs-sm);
  line-height: var(--lh-base);
}

.f-alert-success {
  background: var(--success-soft);
  color: var(--success);
  border-color: transparent;
}

.f-alert-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: transparent;
}

.f-alert-info {
  background: var(--info-soft);
  color: var(--info);
  border-color: transparent;
}

.f-alert-warning {
  background: var(--warning-soft);
  color: var(--warning);
  border-color: transparent;
}

/* ---------- Divider ---------- */
.f-divider {
  height: 1px;
  background: var(--border);
  margin: var(--space-5) 0;
}

.f-divider-vertical {
  width: 1px;
  height: 100%;
  background: var(--border);
}


/* =============================================================
   6. PATTERNS
   ============================================================= */

/* ---------- Header ---------- */
.f-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-header);
  height: var(--header-h);
  background: rgba(251, 250, 247, 0.72);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-3) var(--ease-out),
    background var(--dur-3) var(--ease-out);
}

[data-theme="dark"] .f-header {
  background: rgba(8, 9, 12, 0.72);
}

.f-header.is-scrolled {
  border-bottom-color: var(--border);
}

.f-header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.f-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-md);
  letter-spacing: -0.028em;
  color: var(--text);
  text-decoration: none;
  transition: opacity var(--dur-2);
}

.f-logo:hover {
  opacity: 0.85;
}

.f-logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--text);
  color: var(--bg);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  position: relative;
  transition: background var(--dur-3) var(--ease-out);
}

.f-logo-mark svg {
  width: 100%;
  height: 100%;
  display: block;
}

[data-theme="dark"] .f-logo-mark {
  background: var(--brand);
  color: var(--brand-contrast);
}

.f-logo-text {
  font-feature-settings: "ss01", "cv11";
  display: inline-flex;
  align-items: baseline;
}

.f-logo-text .f-logo-suffix {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  margin-left: 1px;
  color: var(--text-2);
  letter-spacing: -0.005em;
}

[data-theme="dark"] .f-logo-text .f-logo-suffix {
  color: var(--brand);
}

/* Footer logo variant — slightly larger */
.f-footer-brand .f-logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.f-footer-brand .f-logo {
  font-size: var(--fs-lg);
}

.f-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: var(--space-5);
}

.f-nav>li {
  position: relative;
}

.f-nav a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-2);
  border-radius: var(--radius-full);
  transition: color var(--dur-2) var(--ease-out), background var(--dur-2) var(--ease-out);
}

.f-nav a:hover,
.f-nav a.is-active {
  color: var(--text);
}

.f-nav a .f-caret {
  font-size: 0.7em;
  opacity: 0.6;
  transition: transform var(--dur-2);
}

.f-nav>li:hover a .f-caret {
  transform: rotate(180deg);
}

.f-nav-spacer {
  flex: 1;
}

.f-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 240px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity var(--dur-2) var(--ease-out),
    transform var(--dur-2) var(--ease-out);
}

.f-nav>li:hover .f-dropdown,
.f-nav>li:focus-within .f-dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.f-dropdown a {
  display: block;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: var(--fs-sm);
  color: var(--text);
}

.f-filters-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

@media (min-width: 992px) {
  .f-filters-wrap {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.f-tabs-scroll {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
  /* Firefox */
  -ms-overflow-style: none;
  /* IE/Edge */
}

.f-tabs-scroll::-webkit-scrollbar {
  display: none;
}

.f-tabs-scroll .f-btn {
  white-space: nowrap;
  flex-shrink: 0;
}

.f-filters-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

@media (min-width: 768px) {
  .f-filters-actions {
    flex-wrap: nowrap;
    min-width: 400px;
  }
}

.f-header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.f-theme-toggle {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--dur-2);
}

.f-theme-toggle:hover {
  border-color: var(--text);
  color: var(--text);
}

.f-theme-toggle .f-icon-sun {
  display: none;
}

.f-theme-toggle .f-icon-moon {
  display: block;
}

[data-theme="dark"] .f-theme-toggle .f-icon-sun {
  display: block;
}

[data-theme="dark"] .f-theme-toggle .f-icon-moon {
  display: none;
}

.f-mobile-toggle {
  display: none;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text);
}

@media (max-width: 991.98px) {
  .f-nav {
    display: none;
  }

  .f-mobile-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/* User menu (auth-aware) */
.f-user-menu {
  position: relative;
}

.f-user-trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 4px 14px 4px 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  transition: border-color var(--dur-2);
}

.f-user-trigger:hover {
  border-color: var(--text);
}

.f-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--brand-contrast);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 600;
  overflow: hidden;
  flex-shrink: 0;
}

.f-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.f-avatar-lg {
  width: 56px;
  height: 56px;
  font-size: 18px;
}

.f-avatar-md {
  width: 42px;
  height: 42px;
  font-size: 14px;
}

.f-user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 260px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity var(--dur-2), transform var(--dur-2);
  z-index: var(--z-dropdown);
}

.f-user-menu.is-open .f-user-dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.f-user-dropdown a,
.f-user-dropdown button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  font-size: var(--fs-sm);
  color: var(--text);
  border-radius: var(--radius-md);
  text-align: left;
}

.f-user-dropdown a:hover,
.f-user-dropdown button:hover {
  background: var(--surface-2);
}

.f-user-info {
  padding: 12px;
  border-bottom: 1px solid var(--border-faint);
  margin-bottom: 4px;
}

.f-user-info-name {
  font-weight: 600;
  font-size: var(--fs-sm);
}

.f-user-info-email {
  font-size: var(--fs-xs);
  color: var(--text-3);
  margin-top: 2px;
}

/* Mobile drawer */
.f-mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(86%, 360px);
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: var(--z-modal);
  padding: 24px;
  transform: translateX(100%);
  transition: transform var(--dur-4) var(--ease-out);
  overflow-y: auto;
}

.f-mobile-drawer.is-open {
  transform: translateX(0);
}

.f-mobile-drawer ul {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.f-mobile-drawer a {
  display: block;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-weight: 500;
  color: var(--text);
}

.f-mobile-drawer a:hover {
  background: var(--surface-2);
  color: var(--brand);
}

.f-mobile-drawer-sub {
  font-size: var(--fs-xs);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--text-3);
  padding: 16px 14px 6px;
}

.f-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: var(--z-overlay);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-3);
  backdrop-filter: blur(2px);
}

.f-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}


/* ---------- Footer ---------- */
.f-footer {
  margin-top: var(--space-9);
  padding-top: var(--space-8);
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.f-footer-grid {
  display: grid;
  gap: var(--space-7);
  grid-template-columns: 1.6fr repeat(3, 1fr);
  padding-block: var(--space-6) var(--space-8);
}

@media (max-width: 768px) {
  .f-footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-5);
  }

  .f-footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 480px) {
  .f-footer-grid {
    grid-template-columns: 1fr;
  }

  .f-footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: var(--space-2);
  }

  .f-btn {
    width: 100%;
  }

  /* Optional: make buttons full width on very small mobile if needed */
  .f-btn-sm {
    width: auto;
  }
}

.f-footer h6 {
  font-size: var(--fs-xs);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: var(--space-4);
  font-weight: 500;
}

.f-footer ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.f-footer ul a {
  font-size: var(--fs-sm);
  color: var(--text-2);
  transition: color var(--dur-2);
}

.f-footer ul a:hover {
  color: var(--text);
}

.f-footer-brand p {
  max-width: 360px;
  margin-top: var(--space-3);
  font-size: var(--fs-sm);
}

.f-footer-bottom {
  padding: var(--space-5) 0;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  font-size: var(--fs-xs);
  color: var(--text-3);
}

.f-social {
  display: flex;
  gap: var(--space-2);
}

.f-social a {
  width: 36px;
  height: 36px;
  /* Slightly larger touch target for mobile */
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  display: grid;
  place-items: center;
  color: var(--text-2);
  transition: all var(--dur-2);
}

.f-social a:hover {
  border-color: var(--text);
  color: var(--text);
}


/* ---------- Hero ---------- */
.f-hero {
  position: relative;
  padding-top: calc(var(--header-h) + var(--space-8));
  padding-bottom: var(--space-9);
  overflow: hidden;
}

.f-hero-grid {
  display: grid;
  gap: var(--space-7);
  align-items: center;
}

@media (min-width: 992px) {
  .f-hero-grid {
    grid-template-columns: 1.1fr 1fr;
    gap: var(--space-8);
  }
}

.f-hero-eyebrow {
  margin-bottom: var(--space-4);
}

.f-hero-title {
  font-size: var(--fs-5xl);
  line-height: 1.02;
  font-weight: 600;
  letter-spacing: -0.035em;
  color: var(--text);
  margin-bottom: var(--space-5);
}

.f-hero-title em {
  font-style: italic;
  font-family: var(--font-serif);
  font-weight: 400;
  color: var(--text);
  letter-spacing: -0.005em;
}

.f-hero-text {
  font-size: var(--fs-lg);
  color: var(--text-2);
  line-height: 1.55;
  max-width: 540px;
  margin-bottom: var(--space-6);
}

.f-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-7);
}

.f-hero-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border);
}

@media (min-width: 576px) {
  .f-hero-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-5);
  }
}

.f-hero-stat .f-stat-value {
  font-size: var(--fs-xl);
}

@media (min-width: 768px) {
  .f-hero-stat .f-stat-value {
    font-size: var(--fs-2xl);
  }
}

/* Featured card on hero */
.f-feature-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transition: transform var(--dur-4) var(--ease-out),
    box-shadow var(--dur-4) var(--ease-out);
}

.f-feature-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-xl);
}

.f-feature-img {
  aspect-ratio: 16 / 11;
  overflow: hidden;
  position: relative;
}

.f-feature-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.4s var(--ease-out);
}

.f-feature-card:hover .f-feature-img img {
  transform: scale(1.04);
}

.f-feature-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  background: var(--surface);
  color: var(--text);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: var(--shadow-sm);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.f-feature-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
  animation: f-pulse 2s var(--ease-out) infinite;
}

@keyframes f-pulse {

  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.6);
    opacity: 0.4;
  }
}

.f-feature-body {
  padding: var(--space-5) var(--space-6) var(--space-6);
}

.f-feature-cat {
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--text-3);
}

.f-feature-name {
  font-size: var(--fs-xl);
  font-weight: 600;
  letter-spacing: var(--tracking-tight);
  line-height: 1.25;
  margin: var(--space-2) 0 var(--space-3);
}

.f-feature-desc {
  font-size: var(--fs-sm);
  color: var(--text-2);
  line-height: 1.55;
  margin-bottom: var(--space-4);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.f-feature-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-faint);
  margin-bottom: var(--space-4);
}

.f-feature-stat-num {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--text);
  letter-spacing: var(--tracking-tight);
  line-height: 1.1;
}

.f-feature-stat-lab {
  font-size: 10px;
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--text-3);
  margin-top: 2px;
}


/* ---------- Project card ---------- */
.f-project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--dur-3) var(--ease-out);
  display: flex;
  flex-direction: column;
}

.f-project-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.f-project-card-img {
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.f-project-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-5) var(--ease-out);
}

.f-project-card:hover .f-project-card-img img {
  transform: scale(1.04);
}

.f-project-card-body {
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  flex: 1;
}

.f-project-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--fs-xs);
  color: var(--text-3);
  margin-bottom: var(--space-3);
}

.f-project-card-name {
  font-size: var(--fs-lg);
  font-weight: 600;
  letter-spacing: var(--tracking-tight);
  margin-bottom: var(--space-2);
  line-height: 1.3;
}

.f-project-card-desc {
  font-size: var(--fs-sm);
  color: var(--text-2);
  line-height: 1.55;
  margin-bottom: var(--space-4);
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.f-project-card-progress {
  margin-bottom: var(--space-3);
}

.f-project-card-stats {
  display: flex;
  justify-content: space-between;
  font-size: var(--fs-xs);
  color: var(--text-3);
}

.f-project-card-stats strong {
  color: var(--text);
  font-weight: 600;
}


/* ---------- Page header (inner pages) ---------- */
.f-page-header {
  padding-top: calc(var(--header-h) + var(--space-7));
  padding-bottom: var(--space-7);
  border-bottom: 1px solid var(--border-faint);
}

.f-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-xs);
  color: var(--text-3);
  margin-bottom: var(--space-3);
}

.f-breadcrumb a:hover {
  color: var(--text);
}

.f-breadcrumb li:not(:last-child)::after {
  content: '/';
  margin-left: 8px;
  color: var(--text-4);
}

.f-page-header h1 {
  font-size: var(--fs-4xl);
  letter-spacing: -0.03em;
  font-weight: 600;
}

.f-page-header p {
  margin-top: var(--space-3);
  max-width: 640px;
}


/* ---------- Auth ---------- */
.f-auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: calc(var(--header-h) + var(--space-5)) var(--space-4) var(--space-5);
}

.f-auth-card {
  width: 100%;
  max-width: 460px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: var(--space-7) var(--space-6);
  box-shadow: var(--shadow-lg);
}

.f-auth-card h2 {
  font-size: var(--fs-2xl);
  margin-bottom: var(--space-2);
}

.f-auth-card .f-lead {
  margin-bottom: var(--space-5);
}


/* ---------- Modal ---------- */
.f-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 9, 12, 0.50);
  backdrop-filter: blur(4px);
  z-index: var(--z-modal);
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
}

.f-modal-backdrop.is-open {
  display: flex;
}

.f-modal {
  width: 100%;
  max-width: 520px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-xl);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.f-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border-faint);
}

.f-modal-head h3 {
  font-size: var(--fs-lg);
}

.f-modal-body {
  padding: var(--space-6);
  overflow-y: auto;
}

.f-modal-foot {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border-faint);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
}


/* =============================================================
   7. UTILITIES
   ============================================================= */
.u-mt-1 {
  margin-top: var(--space-1);
}

.u-mt-2 {
  margin-top: var(--space-2);
}

.u-mt-3 {
  margin-top: var(--space-3);
}

.u-mt-4 {
  margin-top: var(--space-4);
}

.u-mt-5 {
  margin-top: var(--space-5);
}

.u-mt-6 {
  margin-top: var(--space-6);
}

.u-mt-7 {
  margin-top: var(--space-7);
}

.u-mt-8 {
  margin-top: var(--space-8);
}

.u-mb-1 {
  margin-bottom: var(--space-1);
}

.u-mb-2 {
  margin-bottom: var(--space-2);
}

.u-mb-3 {
  margin-bottom: var(--space-3);
}

.u-mb-4 {
  margin-bottom: var(--space-4);
}

.u-mb-5 {
  margin-bottom: var(--space-5);
}

.u-mb-6 {
  margin-bottom: var(--space-6);
}

.u-mx-auto {
  margin-inline: auto;
}

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

.u-text-left {
  text-align: left;
}

.u-text-right {
  text-align: right;
}

.u-flex {
  display: flex;
}

.u-flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.u-flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.u-flex-col {
  display: flex;
  flex-direction: column;
}

.u-flex-wrap {
  flex-wrap: wrap;
}

.u-gap-1 {
  gap: var(--space-1);
}

.u-gap-2 {
  gap: var(--space-2);
}

.u-gap-3 {
  gap: var(--space-3);
}

.u-gap-4 {
  gap: var(--space-4);
}

.u-gap-5 {
  gap: var(--space-5);
}

.u-gap-6 {
  gap: var(--space-6);
}

.u-hidden {
  display: none !important;
}

.u-relative {
  position: relative;
}

.u-full-width {
  width: 100%;
}

@media (max-width: 575.98px) {
  .u-hide-xs {
    display: none !important;
  }
}

@media (max-width: 767.98px) {
  .u-hide-sm {
    display: none !important;
  }
}

@media (max-width: 991.98px) {
  .u-hide-md {
    display: none !important;
  }
}

@media (min-width: 768px) {
  .u-show-md {
    display: revert;
  }
}


/* =============================================================
   GLOBAL MOBILE RESPONSIVE OVERRIDES
   Catches common inline-style patterns on small screens — saves
   touching every page individually. !important needed to win
   against inline style attribute.
   ============================================================= */
@media (max-width: 640px) {

  /* Collapse any inline 2-4 col grid to single column */
  [style*="grid-template-columns: 1fr 1fr 1fr 1fr"],
  [style*="grid-template-columns: 1fr 1fr 1fr"],
  [style*="grid-template-columns: 1fr 1fr"],
  [style*="grid-template-columns:1fr 1fr 1fr 1fr"],
  [style*="grid-template-columns:1fr 1fr 1fr"],
  [style*="grid-template-columns:1fr 1fr"],
  [style*="grid-template-columns: 2fr 1fr"],
  [style*="grid-template-columns:2fr 1fr"],
  [style*="grid-template-columns: 1fr 2fr"],
  [style*="grid-template-columns:1fr 2fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Sidebar grids (1fr + fixed sidebar) → stack */
  [style*="grid-template-columns: 1fr 380px"],
  [style*="grid-template-columns: 1fr 340px"],
  [style*="grid-template-columns: 1fr 320px"],
  [style*="grid-template-columns: 1fr 300px"],
  [style*="grid-template-columns: 320px 1fr"],
  [style*="grid-template-columns: 280px 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Forms — long inline inputs sometimes overflow */
  .f-input,
  .f-select,
  .f-textarea {
    max-width: 100%;
  }

  /* Tables in admin/panel — allow horizontal scroll */
  .a-table,
  .p-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Modal panels — ensure they fit screen */
  .a-modal {
    max-width: calc(100vw - 24px) !important;
  }

  /* Section padding — tighten */
  .f-section {
    padding-block: var(--space-7);
  }

  .f-section-tight {
    padding-block: var(--space-5);
  }

  /* Hero-style large titles inside modals or cards — clamp down */
  h1 {
    word-wrap: break-word;
    overflow-wrap: anywhere;
  }

  /* Stat bands often have border-block + 4 columns inline — reduce padding */
  [style*="grid-template-columns: repeat(4"],
  [style*="grid-template-columns:repeat(4"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 480px) {

  /* Even tighter on very small phones */
  .f-container {
    padding-inline: 16px;
  }

  .f-btn-lg {
    padding: 12px 18px;
    font-size: var(--fs-sm);
  }

  /* Stack any 4-col stat band to 1 col */
  [style*="grid-template-columns: repeat(4"],
  [style*="grid-template-columns:repeat(4"] {
    grid-template-columns: 1fr !important;
  }

  /* Reduce article body and lead font on tiny screens */
  .f-lead {
    font-size: var(--fs-md);
  }

  /* Buttons in flex rows wrap nicely */
  .u-flex {
    flex-wrap: wrap;
  }

  /* Avoid horizontal page overflow from long inline word/code */
  body,
  html {
    overflow-x: hidden;
    max-width: 100vw;
  }

  /* Topbar on admin/panel mobile fits content */
  .a-topbar,
  .p-topbar {
    flex-wrap: wrap;
  }
}


/* =============================================================
   ANIMATIONS
   ============================================================= */
@keyframes f-fade-up {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes f-fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.f-reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--dur-5) var(--ease-out),
    transform var(--dur-5) var(--ease-out);
}

.f-reveal.is-in {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   Verification / Trust Badges — Kampanya doğrulama sistemi
   ============================================================ */
.f-trust-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: var(--space-5);
}

.f-trust-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.f-trust-title {
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--text-3);
}

.f-trust-score {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  font-family: var(--font-display);
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--text);
}

.f-trust-score-total {
  font-size: 11px;
  color: var(--text-3);
  font-weight: 400;
  margin-left: 2px;
}

.f-trust-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
}

.f-trust-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: var(--fs-xs);
  background: var(--surface);
  transition: all var(--dur-2);
}

.f-trust-item.is-verified {
  border-color: transparent;
  background: var(--success-soft);
  color: var(--success);
}

.f-trust-item.is-verified .f-trust-icon {
  background: var(--success);
  color: white;
}

.f-trust-item .f-trust-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--text-3);
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
}

.f-trust-item .f-trust-label {
  font-weight: 500;
  color: var(--text);
  line-height: 1.3;
}

.f-trust-item.is-verified .f-trust-label {
  color: var(--success);
}

/* Risk level — full-width row */
.f-trust-risk {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: var(--fs-xs);
  font-weight: 500;
}

.f-trust-risk-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.f-trust-risk[data-level="low"] {
  background: var(--success-soft);
  border-color: transparent;
  color: var(--success);
}

.f-trust-risk[data-level="low"] .f-trust-risk-dot {
  background: var(--success);
}

.f-trust-risk[data-level="medium"] {
  background: var(--warning-soft);
  border-color: transparent;
  color: var(--warning);
}

.f-trust-risk[data-level="medium"] .f-trust-risk-dot {
  background: var(--warning);
}

.f-trust-risk[data-level="high"] {
  background: var(--danger-soft);
  border-color: transparent;
  color: var(--danger);
}

.f-trust-risk[data-level="high"] .f-trust-risk-dot {
  background: var(--danger);
}

/* Certification chip */
.f-trust-cert {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-size: var(--fs-xs);
  background: var(--gold-soft);
  color: var(--gold);
  font-weight: 500;
}

.f-trust-cert-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--gold);
  color: white;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}

.f-trust-foot {
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-faint);
  font-size: 11px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ============================================================
   Milestone Timeline — Aşamalı fon serbest bırakma
   ============================================================ */
.f-milestone-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: var(--space-5);
}

.f-milestone-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.f-milestone-progress-bar {
  height: 4px;
  background: var(--surface-2);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-5);
}

.f-milestone-progress-fill {
  height: 100%;
  background: var(--brand);
  border-radius: var(--radius-full);
  transition: width var(--dur-5) var(--ease-out);
}

.f-milestone-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}

.f-milestone-list::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 12px;
  bottom: 12px;
  width: 1px;
  background: var(--border);
  z-index: 0;
}

.f-milestone-item {
  display: flex;
  gap: var(--space-3);
  padding-block: 12px;
  position: relative;
  z-index: 1;
}

.f-milestone-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--border);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  margin-top: 1px;
}

.f-milestone-item.is-released .f-milestone-dot {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.f-milestone-item.is-active .f-milestone-dot {
  background: var(--brand);
  border-color: var(--brand);
  color: white;
}

.f-milestone-body {
  flex: 1;
  min-width: 0;
}

.f-milestone-name {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.f-milestone-percent {
  font-size: var(--fs-xs);
  color: var(--text-3);
  font-family: var(--font-mono);
}

.f-milestone-note {
  font-size: var(--fs-xs);
  color: var(--text-2);
  margin-top: 4px;
  line-height: 1.4;
}

.f-milestone-meta {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.f-milestone-tag {
  display: inline-block;
  padding: 1px 6px;
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
  border-radius: var(--radius-full);
}

.f-milestone-tag.is-released {
  background: var(--success-soft);
  color: var(--success);
}

.f-milestone-tag.is-active {
  background: var(--brand-soft);
  color: var(--brand);
}

.f-milestone-tag.is-pending {
  background: var(--surface-2);
  color: var(--text-3);
}

.f-milestone-foot {
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-faint);
  font-size: 11px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ============================================================
   Production Tracker — Üretim & Teslimat Panosu
   ============================================================ */
.f-prod-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: var(--space-5);
}

.f-prod-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.f-prod-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: var(--radius-full);
}

.f-prod-status-badge.is-not-started {
  background: var(--surface-2);
  color: var(--text-3);
}

.f-prod-status-badge.is-in-progress {
  background: var(--brand-soft);
  color: var(--brand);
}

.f-prod-status-badge.is-completed {
  background: var(--success-soft);
  color: var(--success);
}

.f-prod-status-badge.is-shipping {
  background: var(--info-soft);
  color: var(--info);
}

.f-prod-status-badge.is-delayed {
  background: var(--danger-soft);
  color: var(--danger);
}

.f-prod-status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.f-prod-stages {
  display: flex;
  gap: 4px;
  margin-bottom: var(--space-4);
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.f-prod-stages::-webkit-scrollbar {
  display: none;
}

.f-prod-stage {
  flex: 1 0 auto;
  min-width: 80px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-align: center;
  font-size: 11px;
  background: var(--surface);
  color: var(--text-3);
}

.f-prod-stage.is-done {
  background: var(--success-soft);
  color: var(--success);
  border-color: transparent;
  font-weight: 600;
}

.f-prod-stage.is-active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
  font-weight: 600;
}

.f-prod-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
  padding: var(--space-4) 0;
  border-block: 1px solid var(--border-faint);
  margin-bottom: var(--space-4);
}

.f-prod-stat-num {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
}

.f-prod-stat-lab {
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  margin-top: 4px;
}

.f-prod-stat-meta {
  font-size: 11px;
  color: var(--text-2);
  margin-top: 4px;
}

.f-prod-stat-meta.is-late {
  color: var(--danger);
}

.f-prod-stat-meta.is-on-time {
  color: var(--success);
}

.f-prod-update-row {
  display: flex;
  justify-content: space-between;
  font-size: var(--fs-xs);
  color: var(--text-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-faint);
}

.f-prod-delay {
  background: var(--danger-soft);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: var(--fs-xs);
  color: var(--danger);
  margin-bottom: var(--space-3);
  line-height: 1.5;
}

/* Inline trust pill (cards / lists) */
.f-trust-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--success);
  background: var(--success-soft);
  border-radius: var(--radius-full);
}

.f-trust-pill::before {
  content: '✓';
  font-size: 10px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}


/* Auth-aware visibility (Firebase sets data-fund-auth on <html>) */
[data-fund-show="in"] {
  display: none;
}

[data-fund-show="out"] {
  display: none;
}

[data-fund-auth="in"] [data-fund-show="in"] {
  display: revert;
}

[data-fund-auth="out"] [data-fund-show="out"] {
  display: revert;
}

[data-fund-auth="in"] .f-btn[data-fund-show="in"],
[data-fund-auth="out"] .f-btn[data-fund-show="out"] {
  display: inline-flex;
}

[data-fund-auth="in"] .f-user-menu[data-fund-show="in"] {
  display: inline-flex;
}