/* Knovya Marketing v3.2 — Editorial Light CSS Foundation
 * Global layer: :root design tokens, modern reset, reusable utilities.
 * Section-specific CSS lives inside each component's <style is:global>.
 * Mobile-first. WCAG AA. prefers-reduced-motion respected. */

/* ============================================================
   DESIGN TOKENS — Editorial Light kanat, Hasan canonical
   Brand gradient #3B6CE7 -> #5B7EF0 -> #8B5CF6 (sorgulanmaz)
   ============================================================ */

:root {
  /* Surfaces */
  --page-bg: #FAF8F4;
  --surface: #FFFFFF;
  --surface-warm: #FDFBF7;
  --surface-tint: #F4EFE5;
  --surface-deep: #F0E9D9;
  --surface-ink: #0E0E10;

  /* Borders */
  --border: #E8E2D5;
  --border-strong: #D4CCB8;
  --border-faint: rgba(15, 15, 15, 0.06);
  --border-soft: rgba(15, 15, 15, 0.06);

  /* Ink */
  --ink: #0E0E10;
  --ink-2: #2A2A2C;
  --ink-3: #4F4F52;
  --ink-muted: #6B6B6B;
  --ink-subtle: #94908A;
  --ink-on-dark: #F8F5EE;
  --ink-on-dark-muted: rgba(248, 245, 238, 0.62);

  /* Brand — Hasan canonical */
  --brand: #3B6CE7;
  --brand-bright: #5B7EF0;
  --brand-purple: #8B5CF6;
  --brand-gradient: linear-gradient(135deg, #3B6CE7 0%, #5B7EF0 40%, #8B5CF6 100%);
  --brand-gradient-soft: linear-gradient(135deg, rgba(59, 108, 231, 0.08), rgba(139, 92, 246, 0.08));
  --brand-tint: rgba(91, 126, 240, 0.06);
  --brand-line: rgba(59, 108, 231, 0.22);
  --brand-line-soft: rgba(91, 126, 240, 0.14);

  /* Type — Hasan canonical */
  --font-display: 'Source Serif 4', 'Source Serif Pro', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;

  /* Spacing (4/8 base) */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 2.5rem;
  --s-8: 4rem;
  --s-9: 6rem;
  --s-10: 8rem;
  --s-11: 10rem;
  --s-12: 12rem;

  /* Radius */
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 20px;
  --r-2xl: 28px;
  --r-pill: 999px;

  /* Shadow */
  --shadow-xs: 0 1px 2px rgba(15, 15, 15, 0.04);
  --shadow-sm: 0 2px 6px rgba(15, 15, 15, 0.04);
  --shadow-md: 0 8px 22px rgba(15, 15, 15, 0.06);
  --shadow-lg: 0 22px 48px rgba(15, 15, 15, 0.10);

  /* Layout */
  --container-max: 1200px;
  --container-prose: 720px;
  --container-narrow: 880px;
  --container-wide: 1320px;
  --container-chapter: 920px;

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --t-fast: 160ms;
  --t-base: 280ms;
  --t-slow: 480ms;
  --t-flip: 380ms;

  /* Type scale — fluid clamp, mobile-first */
  --t-eyebrow: clamp(0.6875rem, 0.66rem + 0.13vw, 0.75rem);
  --t-body-sm: clamp(0.875rem, 0.85rem + 0.13vw, 0.9375rem);
  --t-body: clamp(1rem, 0.97rem + 0.13vw, 1.0625rem);
  --t-body-lg: clamp(1.125rem, 1.07rem + 0.27vw, 1.3125rem);
  --t-h6: clamp(0.9375rem, 0.9rem + 0.2vw, 1rem);
  --t-h5: clamp(1.0625rem, 1rem + 0.27vw, 1.1875rem);
  --t-h4: clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem);
  --t-h3: clamp(1.625rem, 1.42rem + 0.93vw, 2.125rem);
  --t-h2: clamp(2.125rem, 1.78rem + 1.6vw, 3.125rem);
  --t-h1: clamp(2.75rem, 2rem + 3.4vw, 4.75rem);
  --t-display: clamp(3.25rem, 2.1rem + 4.8vw, 6rem);

  /* Backward-compat shims for any legacy v3 references that may
     still be in unrelated files (defensive: no-op if not used). */
  --v3-page-bg: var(--page-bg);
  --v3-surface: var(--surface);
  --v3-ink: var(--ink);
  --v3-brand: var(--brand);
  --v3-brand-gradient: var(--brand-gradient);
}

/* ============================================================
   RESET + BASE
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  tab-size: 4;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--t-body);
  line-height: 1.55;
  color: var(--ink);
  background: var(--page-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

img, svg, video, canvas, picture { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; padding: 0; }

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

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection {
  background: rgba(91, 126, 240, 0.22);
  color: var(--ink);
}

ul, ol { padding: 0; margin: 0; list-style: none; }
p { margin: 0; }

/* Heading reset — class-based typography is the canonical source.
   Prevents bare h-tags from inheriting browser defaults (bold +
   larger size) when used semantically inside a classed parent
   (e.g. inside summary, persona-card, or trust-row). */
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
  font-family: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  color: inherit;
}

code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: var(--surface-tint);
  padding: 0.1em 0.4em;
  border-radius: 3px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
   PRIMITIVES — Container, Section
   ============================================================ */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--s-5);
}
.container--prose { max-width: var(--container-prose); }
.container--narrow { max-width: var(--container-narrow); }
.container--wide { max-width: var(--container-wide); }

.section { padding: var(--s-9) 0; position: relative; }
.section--tight { padding: var(--s-8) 0; }
.section--loose { padding: var(--s-10) 0; }
.section--surface { background: var(--surface); }
.section--warm { background: var(--surface-warm); }
.section--tint { background: var(--surface-tint); }
.section--ink { background: var(--ink); color: var(--ink-on-dark); }

@media (min-width: 768px) {
  .section { padding: var(--s-10) 0; }
  .section--loose { padding: var(--s-11) 0; }
}

/* ============================================================
   TYPOGRAPHY UTILITIES
   ============================================================ */

.eyebrow {
  font-family: var(--font-body);
  font-size: var(--t-eyebrow);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
}
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 22px;
  height: 1px;
  background: var(--brand-gradient);
}
.eyebrow--ink-on-dark { color: rgba(248, 245, 238, 0.6); }
.eyebrow--ink-on-dark::before { background: var(--brand-gradient); }

.heading-display {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.022em;
  line-height: 1.04;
  color: var(--ink);
  margin: 0;
  text-wrap: balance;
}
.heading-h1 { font-size: var(--t-h1); }
.heading-h2 { font-size: var(--t-h2); line-height: 1.06; }
.heading-h3 { font-size: var(--t-h3); line-height: 1.14; }
.heading-h4 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--t-h4);
  line-height: 1.2;
  letter-spacing: -0.014em;
  margin: 0;
  color: var(--ink);
}

.lede {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--t-body-lg);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 56ch;
  margin: 0;
  text-wrap: pretty;
}
.body-text {
  font-size: var(--t-body);
  line-height: 1.65;
  color: var(--ink-2);
  margin: 0;
}
.muted { color: var(--ink-muted); }

.gradient-text {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.editorial-em {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
}

/* ============================================================
   BUTTONS + EDITORIAL LINK
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--t-body-sm);
  letter-spacing: -0.005em;
  padding: 0.875rem 1.375rem;
  min-height: 48px;
  border-radius: var(--r-pill);
  transition:
    transform var(--t-fast) var(--ease-out),
    background-color var(--t-fast) var(--ease-out),
    color var(--t-fast) var(--ease-out),
    box-shadow var(--t-fast) var(--ease-out),
    border-color var(--t-fast) var(--ease-out);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}
.btn--primary { background: var(--ink); color: var(--surface); }
.btn--primary:hover {
  background: var(--brand);
  color: var(--surface);
  transform: translateY(-1px);
}
.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--border-strong);
}
.btn--ghost:hover {
  background: var(--surface);
  border-color: var(--ink);
  color: var(--ink);
}
.btn--lg {
  padding: 1rem 1.625rem;
  font-size: var(--t-body);
}

.btn .arrow {
  width: 16px;
  height: 16px;
  transition: transform var(--t-base) var(--ease-out);
}
.btn:hover .arrow { transform: translateX(3px); }

.link-editorial {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-family: var(--font-body);
  font-size: var(--t-body-sm);
  font-weight: 500;
  color: var(--ink);
  padding-bottom: 2px;
  border-bottom: 1px solid var(--border-strong);
  transition:
    color var(--t-fast) var(--ease-out),
    border-color var(--t-fast) var(--ease-out);
}
.link-editorial:hover {
  color: var(--brand);
  border-color: var(--brand);
}
.link-editorial .arrow {
  width: 14px;
  height: 14px;
  transition: transform var(--t-base) var(--ease-out);
}
.link-editorial:hover .arrow { transform: translateX(3px); }

/* ============================================================
   ACCESSIBILITY
   ============================================================ */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 0.625rem 1rem;
  background: var(--ink);
  color: var(--surface);
  border-radius: var(--r-md);
  font-size: var(--t-body-sm);
  z-index: 1000;
  transform: translateY(-150%);
  transition: transform var(--t-base) var(--ease-out);
}
.skip-link:focus-visible {
  transform: translateY(0);
  color: var(--surface);
}
