/* ============================================================
   IGNITION CREATIVE — Design System
   A meticulous foundation. Every value is intentional.
   ============================================================ */

/* --- 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 */
}

body {
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  color: var(--color-text-primary);
  background-color: var(--color-bg);
  letter-spacing: var(--tracking-body);
  overflow-x: hidden;
}

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

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

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

ul, ol { list-style: none; }

/* --- Custom Properties -------------------------------------- */
:root {

  /* ---- Typography ---- */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /*
   * Type Scale — Major Third (1.25)
   * Fluid with clamp(). No breakpoint jumps.
   * Large headings get negative tracking (tighter).
   * Body stays at 0. Small text gets slightly positive.
   */
  --text-display:   clamp(3rem, 5.5vw, 5rem);      /* 48–80px */
  --text-h1:        clamp(2.5rem, 4.5vw, 4rem);     /* 40–64px */
  --text-h2:        clamp(2rem, 3.5vw, 3rem);        /* 32–48px */
  --text-h3:        clamp(1.5rem, 2vw, 1.75rem);     /* 24–28px */
  --text-body:      clamp(1.0625rem, 1.1vw, 1.1875rem); /* 17–19px */
  --text-body-sm:   0.9375rem;                        /* 15px */
  --text-caption:   0.8125rem;                        /* 13px */
  --text-overline:  0.75rem;                          /* 12px */

  /* Leading (line-height) */
  --leading-display: 1.05;
  --leading-h1:      1.1;
  --leading-h2:      1.15;
  --leading-h3:      1.25;
  --leading-body:    1.65;
  --leading-caption:  1.5;

  /* Tracking (letter-spacing) */
  --tracking-display: -0.035em;
  --tracking-h1:      -0.03em;
  --tracking-h2:      -0.02em;
  --tracking-h3:      -0.015em;
  --tracking-body:     0em;
  --tracking-caption:  0.01em;
  --tracking-overline: 0.08em;

  /* Weights */
  --weight-regular:  400;
  --weight-medium:   500;
  --weight-semibold: 600;

  /* Measure (max line length for readability) */
  --measure-text:    42rem;   /* ~672px — 60-75 char line */
  --measure-wide:    52rem;   /* ~832px — for wider blocks */

  /* ---- Color ---- */

  /* Backgrounds */
  --color-bg:          #FAFAF8;    /* Warm off-white — NOT sterile */
  --color-bg-alt:      #F3F2EF;    /* Subtle warm shift for alternating sections */
  --color-bg-elevated: #FFFFFF;    /* Cards, elevated surfaces */
  --color-bg-dark:     #141414;    /* Footer, dark bands */

  /* Text */
  --color-text-primary:   #1A1A1A;   /* Near-black, soft */
  --color-text-secondary: #5C5C5C;   /* Warm gray */
  --color-text-tertiary:  #8A8A86;   /* Muted, for captions */
  --color-text-inverse:   #FAFAF8;   /* On dark backgrounds */
  --color-text-inverse-secondary: #9A9A96;

  /* Accent */
  --color-accent:       #2C2C2C;   /* Deep charcoal — our "color" is authority */
  --color-accent-hover: #444444;

  /* Borders & Dividers */
  --color-border:       rgba(0, 0, 0, 0.08);
  --color-border-strong: rgba(0, 0, 0, 0.12);

  /* ---- Spacing ---- */
  /*
   * 8px base scale.
   * Content groups: tight (8–16px).
   * Sections: enormous (120–200px).
   * Ratio between intra-group and inter-section: 8:1+
   */
  --space-1:  0.25rem;   /* 4px */
  --space-2:  0.5rem;    /* 8px */
  --space-3:  0.75rem;   /* 12px */
  --space-4:  1rem;      /* 16px */
  --space-6:  1.5rem;    /* 24px */
  --space-8:  2rem;      /* 32px */
  --space-10: 2.5rem;    /* 40px */
  --space-12: 3rem;      /* 48px */
  --space-16: 4rem;      /* 64px */
  --space-20: 5rem;      /* 80px */
  --space-24: 6rem;      /* 96px */
  --space-32: 8rem;      /* 128px */
  --space-40: 10rem;     /* 160px */
  --space-48: 12rem;     /* 192px */

  /* Section spacing — the premium differentiator */
  --section-gap: clamp(6rem, 12vw, 12rem);   /* 96–192px */
  --section-gap-lg: clamp(8rem, 15vw, 14rem); /* 128–224px */

  /* ---- Layout ---- */
  --container-max:   75rem;     /* 1200px */
  --container-wide:  87.5rem;   /* 1400px */
  --container-text:  var(--measure-text);
  --gutter:          clamp(1.25rem, 5vw, 5rem); /* 20–80px side padding */

  /* ---- Borders & Radii ---- */
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  16px;
  --radius-xl:  24px;

  /* ---- Shadows ---- */
  /* Barely visible, layered. Depth without weight. */
  --shadow-sm:  0 1px 3px rgba(0, 0, 0, 0.04), 0 0 1px rgba(0, 0, 0, 0.06);
  --shadow-md:  0 4px 16px rgba(0, 0, 0, 0.05), 0 0 1px rgba(0, 0, 0, 0.06);
  --shadow-lg:  0 12px 40px rgba(0, 0, 0, 0.06), 0 0 1px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.08);

  /* ---- Motion ---- */
  /* Two curves. That's all you need. */
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);     /* Primary — spring feel */
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);   /* Morphs, transforms */

  --duration-fast:    150ms;
  --duration-normal:  300ms;
  --duration-slow:    500ms;
  --duration-reveal:  700ms;

  /* ---- Z-Index ---- */
  --z-base:    1;
  --z-nav:     100;
  --z-overlay: 200;
  --z-modal:   300;
}


/* --- Typography Classes ------------------------------------- */

.text-display {
  font-size: var(--text-display);
  line-height: var(--leading-display);
  letter-spacing: var(--tracking-display);
  font-weight: var(--weight-semibold);
}

.text-h1 {
  font-size: var(--text-h1);
  line-height: var(--leading-h1);
  letter-spacing: var(--tracking-h1);
  font-weight: var(--weight-semibold);
}

.text-h2 {
  font-size: var(--text-h2);
  line-height: var(--leading-h2);
  letter-spacing: var(--tracking-h2);
  font-weight: var(--weight-medium);
}

.text-h3 {
  font-size: var(--text-h3);
  line-height: var(--leading-h3);
  letter-spacing: var(--tracking-h3);
  font-weight: var(--weight-medium);
}

.text-body {
  font-size: var(--text-body);
  line-height: var(--leading-body);
  letter-spacing: var(--tracking-body);
  font-weight: var(--weight-regular);
}

.text-body-sm {
  font-size: var(--text-body-sm);
  line-height: var(--leading-body);
  letter-spacing: var(--tracking-body);
  font-weight: var(--weight-regular);
}

.text-caption {
  font-size: var(--text-caption);
  line-height: var(--leading-caption);
  letter-spacing: var(--tracking-caption);
  font-weight: var(--weight-regular);
  color: var(--color-text-tertiary);
}

.text-overline {
  font-size: var(--text-overline);
  line-height: var(--leading-caption);
  letter-spacing: var(--tracking-overline);
  font-weight: var(--weight-medium);
  text-transform: uppercase;
  color: var(--color-text-tertiary);
}

/* --- Color Utilities ---------------------------------------- */

.color-primary   { color: var(--color-text-primary); }
.color-secondary { color: var(--color-text-secondary); }
.color-tertiary  { color: var(--color-text-tertiary); }
.color-inverse   { color: var(--color-text-inverse); }

/* --- Layout Utilities --------------------------------------- */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.container-wide {
  width: 100%;
  max-width: var(--container-wide);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.container-text {
  width: 100%;
  max-width: var(--container-text);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.section {
  padding-top: var(--section-gap);
  padding-bottom: var(--section-gap);
}

.section-lg {
  padding-top: var(--section-gap-lg);
  padding-bottom: var(--section-gap-lg);
}

/* --- Animation Utilities ------------------------------------ */

/* Elements that will animate in on scroll */
[data-animate] {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity var(--duration-reveal) var(--ease-out),
              transform var(--duration-reveal) var(--ease-out);
}

[data-animate].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
[data-animate-stagger] > * {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity var(--duration-reveal) var(--ease-out),
              transform var(--duration-reveal) var(--ease-out);
}

[data-animate-stagger].is-visible > *:nth-child(1) { transition-delay: 0ms; }
[data-animate-stagger].is-visible > *:nth-child(2) { transition-delay: 80ms; }
[data-animate-stagger].is-visible > *:nth-child(3) { transition-delay: 160ms; }
[data-animate-stagger].is-visible > *:nth-child(4) { transition-delay: 240ms; }
[data-animate-stagger].is-visible > *:nth-child(5) { transition-delay: 320ms; }
[data-animate-stagger].is-visible > *:nth-child(6) { transition-delay: 400ms; }

[data-animate-stagger].is-visible > * {
  opacity: 1;
  transform: translateY(0);
}

/* Line-by-line text reveal */
.reveal-line {
  clip-path: inset(0 0 100% 0);
  transition: clip-path 0.8s var(--ease-in-out);
}

.reveal-line.is-visible {
  clip-path: inset(0 0 0% 0);
}

/* --- Interactive Elements ----------------------------------- */

/* Links */
.link {
  position: relative;
  display: inline-block;
}

.link::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 0;
  height: 1px;
  background: currentColor;
  transition: width var(--duration-normal) var(--ease-in-out);
}

.link:hover::after {
  width: 100%;
}

/* Arrow links */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: var(--weight-medium);
  transition: gap var(--duration-normal) var(--ease-out);
}

.link-arrow:hover {
  gap: var(--space-3);
}

.link-arrow svg {
  width: 1em;
  height: 1em;
  transition: transform var(--duration-normal) var(--ease-out);
}

.link-arrow:hover svg {
  transform: translateX(4px);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3) var(--space-8);
  font-size: var(--text-body-sm);
  font-weight: var(--weight-medium);
  letter-spacing: 0.005em;
  border-radius: var(--radius-sm);
  transition: background-color var(--duration-fast) var(--ease-out),
              transform var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out);
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background-color: var(--color-text-primary);
  color: var(--color-text-inverse);
}

.btn-primary:hover {
  background-color: var(--color-accent-hover);
}

.btn-secondary {
  background-color: transparent;
  color: var(--color-text-primary);
  box-shadow: inset 0 0 0 1px var(--color-border-strong);
}

.btn-secondary:hover {
  background-color: rgba(0, 0, 0, 0.03);
}

/* Cards */
.card {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-10);
  transition: transform var(--duration-normal) var(--ease-out),
              box-shadow var(--duration-normal) var(--ease-out);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

/* Tags / Badges */
.tag {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-overline);
  letter-spacing: var(--tracking-overline);
  text-transform: uppercase;
  font-weight: var(--weight-medium);
  color: var(--color-text-tertiary);
  border: 1px solid var(--color-border);
  border-radius: 100px;
}

/* Dividers */
.divider {
  width: 100%;
  height: 1px;
  background: var(--color-border);
  border: none;
}

/* --- Image Placeholders ------------------------------------- */
.placeholder {
  background: var(--color-bg-alt);
  border: 1px dashed var(--color-border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-tertiary);
  font-size: var(--text-caption);
  letter-spacing: var(--tracking-caption);
  border-radius: var(--radius-md);
  overflow: hidden;
}

/* --- Selection ---------------------------------------------- */
::selection {
  background: rgba(26, 26, 26, 0.12);
}

/* --- Focus -------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--color-text-primary);
  outline-offset: 2px;
}

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

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

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.25);
}
