/* FlatHunt — Berlin Signal brand layer
   Tokens + fonts + shared atmosphere / motion / buttons
   Loaded by landing (index.html) and SEO pages (via seo-build shell). */

@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/fraunces-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/fraunces-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/fraunces-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/fraunces-700.woff2') format('woff2');
}

:root {
  /* Brand blue (matches logo) + cool mist surfaces */
  --fh-ink: #161c24;
  --fh-mist: #f1f3f6;
  --fh-surface: #ffffff;
  --fh-blue: #2563eb;
  --fh-blue-hover: #1d4ed8;
  --fh-blue-soft: #dbeafe;
  --fh-blue-muted: rgba(37, 99, 235, 0.12);
  --fh-blue-light: #60a5fa;
  --fh-muted: #5c6570;
  --fh-muted-2: #7a8490;
  --fh-border: #d8dee6;
  --fh-border-soft: #e8ecf1;
  --fh-danger: #dc2626;
  --fh-success: #15803d;

  --fh-font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --fh-font-body: 'DM Sans', system-ui, -apple-system, sans-serif;

  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4.5rem;
  --space-section: clamp(4rem, 8vw, 6.5rem);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-search: 1.25rem;

  --shadow-sm: 0 1px 2px rgba(22, 28, 36, 0.05);
  --shadow-md: 0 8px 24px rgba(22, 28, 36, 0.08);
  --shadow-lg: 0 18px 48px rgba(22, 28, 36, 0.12);
  --shadow-search: 0 1px 2px rgba(22, 28, 36, 0.04), 0 18px 48px rgba(22, 28, 36, 0.12);

  --header-height: 4.25rem;
  --transition-fast: 0.18s ease;
  --transition-base: 0.28s ease;

  /* Compatibility aliases (landing + SEO) */
  --primary: var(--fh-blue);
  --primary-dark: var(--fh-blue-hover);
  --primary-light: var(--fh-blue-soft);
  --primary-lighter: #eff6ff;
  --text-primary: var(--fh-ink);
  --text-secondary: var(--fh-muted);
  --text-muted: var(--fh-muted-2);
  --bg-white: var(--fh-surface);
  --bg-light: var(--fh-mist);
  --bg-section: #e9eef3;
  --border-light: var(--fh-border);
  --border-lighter: var(--fh-border-soft);
  --success: var(--fh-success);
  --success-light: #dcfce7;
  --warning: #d97706;
  --danger: var(--fh-danger);
  --telegram: #0088cc;
  --shadow-primary: 0 4px 14px rgba(37, 99, 235, 0.28);

  --color-primary: var(--fh-blue);
  --color-primary-hover: var(--fh-blue-hover);
  --color-primary-light: var(--fh-blue-soft);
  --color-primary-dark: var(--fh-blue-hover);
  --color-secondary: var(--fh-muted);
  --color-success: var(--fh-success);
  --color-info: #0ea5e9;
  --color-warning: var(--fh-blue);
  --color-danger: var(--fh-danger);
  --color-bg: var(--fh-mist);
  --color-bg-elevated: var(--fh-surface);
  --color-text-primary: var(--fh-ink);
  --color-text-secondary: var(--fh-muted);
  --color-text-muted: var(--fh-muted-2);
  --color-text-inverse: #ffffff;
  --color-border: var(--fh-border);
  --shadow-xl: 0 20px 40px rgba(22, 28, 36, 0.14);
  --transition-base: 0.28s ease;
}

/* Atmosphere helpers */
.fh-grain::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  z-index: 1;
}

.fh-display {
  font-family: var(--fh-font-display);
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--fh-ink);
}

.fh-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--fh-font-body);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fh-blue);
}

.fh-kicker::before {
  content: '';
  width: 1.25rem;
  height: 2px;
  background: var(--fh-blue);
  border-radius: 1px;
}

/* Bootstrap utility overrides (SEO pages). Matches logo blue for "Flat". */
.text-primary {
  color: var(--fh-blue) !important;
}

.text-muted {
  color: var(--fh-muted-2) !important;
}

/* Shared buttons (landing + SEO) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.35rem;
  min-height: 44px;
  font-family: var(--fh-font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  border-radius: var(--radius-md);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast),
    border-color var(--transition-fast), box-shadow var(--transition-fast),
    transform var(--transition-fast);
}

.btn:focus-visible {
  outline: 2px solid var(--fh-blue);
  outline-offset: 3px;
}

.btn-primary {
  background: var(--fh-blue);
  color: #fff !important;
  box-shadow: var(--shadow-primary);
}

.btn-primary:hover {
  background: var(--fh-blue-hover);
  color: #fff !important;
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-lg {
  padding: 0.9rem 1.6rem;
  font-size: 1rem;
  min-height: 48px;
}

.btn-outline,
.btn-outline-primary {
  background: transparent;
  color: var(--fh-blue) !important;
  border-color: rgba(37, 99, 235, 0.35);
}

.btn-outline:hover,
.btn-outline-primary:hover {
  background: var(--fh-blue-muted);
  border-color: var(--fh-blue);
  color: var(--fh-blue-hover) !important;
}

/* Scroll reveal */
[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.45s ease, transform 0.45s ease;
  transition-delay: var(--reveal-delay, 0ms);
}

[data-reveal].is-revealed {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .btn:hover,
  .btn-primary:hover,

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