/* ============================================================
   BLINK BASE STYLES
   Reset, typography, utilities, components, animations
   ============================================================ */

/* ── Reset ──────────────────────────────────────────────────── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: auto; /* Lenis handles smooth scroll */
  font-size: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-base);
  overflow-x: hidden;
  cursor: none;
}

/* Restore cursor for touch / small screens */
@media (pointer: coarse) {
  body { cursor: auto; }
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: none;
  outline: none;
}

@media (pointer: coarse) {
  button { cursor: pointer; }
}

input,
textarea,
select {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}

ul, ol {
  list-style: none;
}

/* ── Typography ─────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl);  }
h5 { font-size: var(--text-lg);  }

p {
  color: var(--text-secondary);
  max-width: 60ch;
}

.text-xs   { font-size: var(--text-xs);   }
.text-sm   { font-size: var(--text-sm);   }
.text-base { font-size: var(--text-base); }
.text-lg   { font-size: var(--text-lg);   }
.text-xl   { font-size: var(--text-xl);   }
.text-2xl  { font-size: var(--text-2xl);  }
.text-3xl  { font-size: var(--text-3xl);  }
.text-4xl  { font-size: var(--text-4xl);  }

.text-primary   { color: var(--text-primary);   }
.text-secondary { color: var(--text-secondary); }
.text-muted     { color: var(--text-muted);     }
.text-light     { color: var(--text-light);     }

.font-heading { font-family: var(--font-heading); }
.font-body    { font-family: var(--font-body);    }
.font-mono    { font-family: var(--font-mono);    }

.font-medium   { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold     { font-weight: 700; }

.leading-tight  { line-height: 1.15; }
.leading-normal { line-height: 1.6;  }
.leading-loose  { line-height: 1.8;  }

.tracking-tight { letter-spacing: -0.02em; }
.tracking-wide  { letter-spacing: 0.05em;  }

.uppercase { text-transform: uppercase; }

.text-center { text-align: center; }

/* ── Layout ─────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding-left: var(--space-8);
  padding-right: var(--space-8);
}

.container-narrow {
  max-width: 960px;
}

.container-wide {
  max-width: 1600px;
}

.section {
  padding: var(--space-14) 0;
  position: relative;
}

@media (max-width: 768px) {
  .section {
    padding: var(--space-10) 0;
  }
}

/* ── Section Labels ─────────────────────────────────────────── */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: var(--space-4);
}

.section-label::before {
  content: '';
  display: block;
  width: 24px;
  height: 1px;
  background: var(--border-default);
}

.section-label--light {
  color: var(--text-light-secondary);
}

.section-label--light::before {
  background: var(--border-dark);
}

.section-heading {
  margin-bottom: var(--space-5);
}

.section-sub {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  max-width: 52ch;
}

.section-sub--light {
  color: var(--text-light-secondary);
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-full);
  transition:
    background var(--duration-normal) var(--ease-out),
    color var(--duration-normal) var(--ease-out),
    transform var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-normal) var(--ease-out);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--brand-black);
  color: var(--text-light);
  border: 1px solid var(--brand-black);
}

.btn-primary:hover {
  background: #333;
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-default);
}

.btn-secondary:hover {
  background: var(--bg-elevated);
  border-color: var(--text-primary);
}

.btn-light {
  background: var(--bg-base);
  color: var(--brand-black);
  border: 1px solid var(--bg-base);
}

.btn-light:hover {
  background: #fff;
  box-shadow: var(--shadow-md);
}

.btn-ghost {
  background: transparent;
  color: var(--text-light);
  border: 1px solid rgba(245, 240, 232, 0.2);
}

.btn-ghost:hover {
  background: rgba(245, 240, 232, 0.08);
  border-color: rgba(245, 240, 232, 0.4);
}

.btn-lg {
  font-size: var(--text-base);
  padding: var(--space-4) var(--space-8);
}

.btn-sm {
  font-size: var(--text-xs);
  padding: var(--space-2) var(--space-4);
}

.btn-icon {
  padding: var(--space-2);
  border-radius: var(--radius-md);
}

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition:
    transform var(--duration-normal) var(--ease-out),
    box-shadow var(--duration-normal) var(--ease-out),
    border-color var(--duration-normal) var(--ease-out);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-default);
}

.card--surface {
  background: var(--bg-surface);
}

.card--dark {
  background: #222;
  border-color: var(--border-dark);
  color: var(--text-light);
}

.card--dark:hover {
  border-color: #444;
}

.card-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  margin-bottom: var(--space-4);
  color: var(--text-primary);
}

.card-icon svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card-title {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.card-text {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.65;
}

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  letter-spacing: 0.02em;
}

.badge--dark {
  background: rgba(245, 240, 232, 0.08);
  color: var(--text-light-secondary);
  border-color: rgba(245, 240, 232, 0.12);
}

.badge--accent {
  background: rgba(196, 163, 90, 0.12);
  color: var(--brand-accent);
  border-color: rgba(196, 163, 90, 0.25);
}

.badge--green {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
  border-color: rgba(34, 197, 94, 0.2);
}

/* ── Grid utilities ─────────────────────────────────────────── */
.grid {
  display: grid;
  gap: var(--space-5);
}

.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-6 { grid-template-columns: repeat(6, 1fr); }

@media (max-width: 1024px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-6 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .grid-6 { grid-template-columns: repeat(2, 1fr); }
}

/* ── Flex utilities ─────────────────────────────────────────── */
.flex          { display: flex; }
.flex-col      { flex-direction: column; }
.flex-wrap     { flex-wrap: wrap; }
.items-center  { align-items: center; }
.items-start   { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* ── Spacing utilities ──────────────────────────────────────── */
.mt-2  { margin-top: var(--space-2); }
.mt-4  { margin-top: var(--space-4); }
.mt-5  { margin-top: var(--space-5); }
.mt-6  { margin-top: var(--space-6); }
.mt-8  { margin-top: var(--space-8); }
.mt-10 { margin-top: var(--space-10); }
.mb-4  { margin-bottom: var(--space-4); }
.mb-6  { margin-bottom: var(--space-6); }
.mb-8  { margin-bottom: var(--space-8); }
.mx-auto { margin-left: auto; margin-right: auto; }

/* ── Reveal animation targets ───────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  will-change: transform, opacity;
}

.reveal-left {
  opacity: 0;
  transform: translateX(-32px);
  will-change: transform, opacity;
}

.reveal-right {
  opacity: 0;
  transform: translateX(32px);
  will-change: transform, opacity;
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.92);
  will-change: transform, opacity;
}

.reveal--visible {
  opacity: 1;
  transform: translate(0) scale(1);
}

/* ── Dividers ───────────────────────────────────────────────── */
.divider {
  width: 100%;
  height: 1px;
  background: var(--border-subtle);
}

.divider--dark {
  background: var(--border-dark);
}

/* ── Selection ──────────────────────────────────────────────── */
::selection {
  background: rgba(26, 26, 26, 0.15);
  color: var(--text-primary);
}

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-base);
}

::-webkit-scrollbar-thumb {
  background: var(--border-default);
  border-radius: var(--radius-full);
}

/* ── Visually hidden ────────────────────────────────────────── */
.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;
}

/* ── Reduced motion ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal-left,
  .reveal-right,
  .reveal-scale {
    opacity: 1;
    transform: none;
  }
}
