/* ============================================
   ZACHARY CAROW — MASTER STYLESHEET
   Rule of 8 spacing system | rem-based
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400&display=swap');

/* ============================================
   CSS VARIABLES — DESIGN TOKENS
   ============================================ */
:root {
  /* Colors */
  --color-bg:           #FFECCC;
  --color-bg-alt:       #FFF6E8;
  --color-surface:      #FFF9F0;
  --color-iron:         #3E4E50;
  --color-iron-light:   #5A6E70;
  --color-iron-muted:   #8A9E9F;
  --color-pacific:      #75B8C8;
  --color-light-blue:   #A8CCC9;
  --color-ash:          #B3D6C6;
  --color-green:        #4EBB5B;
  --color-white:        #FFFFFF;

  /* Typography */
  --font-primary: 'Montserrat', sans-serif;

  --text-xs:   0.75rem;   /* 12px */
  --text-sm:   0.875rem;  /* 14px */
  --text-base: 1rem;      /* 16px */
  --text-md:   1.125rem;  /* 18px */
  --text-lg:   1.5rem;    /* 24px */
  --text-xl:   2rem;      /* 32px */
  --text-2xl:  2.5rem;    /* 40px */
  --text-3xl:  3.5rem;    /* 56px */
  --text-4xl:  5rem;      /* 80px */
  --text-5xl:  6.5rem;    /* 104px */

  --weight-light:   300;
  --weight-regular: 400;
  --weight-medium:  500;
  --weight-semibold:600;
  --weight-bold:    700;

  --leading-tight:  1.1;
  --leading-snug:   1.3;
  --leading-normal: 1.5;
  --leading-loose:  1.75;

  --tracking-tight: -0.03em;
  --tracking-snug:  -0.01em;
  --tracking-wide:  0.08em;
  --tracking-wider: 0.15em;

  /* Spacing — Rule of 8 */
  --space-1:  0.5rem;    /* 8px */
  --space-2:  1rem;      /* 16px */
  --space-3:  1.5rem;    /* 24px */
  --space-4:  2rem;      /* 32px */
  --space-5:  2.5rem;    /* 40px */
  --space-6:  3rem;      /* 48px */
  --space-8:  4rem;      /* 64px */
  --space-10: 5rem;      /* 80px */
  --space-12: 6rem;      /* 96px */
  --space-16: 8rem;      /* 128px */
  --space-20: 10rem;     /* 160px */
  --space-24: 12rem;     /* 192px */

  /* Layout */
  --max-width:      90rem;  /* 1440px */
  --content-width:  80rem;  /* 1280px */
  --narrow-width:   56rem;  /* 896px */
  --gutter:         var(--space-8);

  /* Borders */
  --radius-sm:   0.25rem;
  --radius-md:   0.5rem;
  --radius-lg:   1rem;
  --radius-xl:   1.5rem;
  --radius-full: 9999px;

  /* Shadows — light source top-right, shadows bottom-left */
  --shadow-soft:
    -3px 3px 7px rgba(62, 78, 80, 0.12),
    3px -3px 6px rgba(255, 255, 255, 0.55);
  --shadow-inset:
    inset -2px 2px 5px rgba(62, 78, 80, 0.08),
    inset 2px -2px 6px rgba(255, 255, 255, 0.5);
  --shadow-lift:
    -6px 8px 20px rgba(62, 78, 80, 0.18),
    4px -6px 12px rgba(255, 255, 255, 0.45);
  --shadow-card:
    -4px 6px 16px rgba(62, 78, 80, 0.08),
    0 12px 28px rgba(62, 78, 80, 0.07);

  /* Transitions */
  --ease-fluid:  cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out:    cubic-bezier(0.0, 0.0, 0.2, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);

  --duration-fast:   150ms;
  --duration-base:   300ms;
  --duration-slow:   500ms;
  --duration-slower: 800ms;
  --duration-crawl:  1200ms;
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  background-color: #FFECCC;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n' x='0' y='0'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeBlend in='SourceGraphic' mode='overlay'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.15'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}



body {
  font-family: var(--font-primary);
  font-weight: var(--weight-regular);
  color: var(--color-iron);
  background-color: transparent;
  line-height: var(--leading-normal);
  overflow-x: hidden;
  cursor: none;
}

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

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

ul, ol {
  list-style: none;
}

button {
  font-family: var(--font-primary);
  cursor: none;
  border: none;
  background: none;
}

/* ============================================
   CUSTOM CURSOR
   ============================================ */
.cursor {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 9999;
}

.cursor__dot {
  width: 0.5rem;
  height: 0.5rem;
  background: var(--color-iron);
  border-radius: 50%;
  margin-left: -0.25rem;
  margin-top: -0.25rem;
  will-change: transform;
  transition: opacity var(--duration-fast) var(--ease-fluid);
}

.cursor__ring {
  position: fixed;
  top: 0;
  left: 0;
  width: 2.5rem;
  height: 2.5rem;
  border: 1.5px solid var(--color-iron);
  border-radius: 50%;
  margin-left: -1.25rem;
  margin-top: -1.25rem;
  will-change: transform;
  pointer-events: none;
  z-index: 9998;
  transition: width var(--duration-base) var(--ease-fluid),
              height var(--duration-base) var(--ease-fluid),
              border-color var(--duration-base) var(--ease-fluid),
              opacity var(--duration-base) var(--ease-fluid);
  opacity: 0.4;
}

.cursor__ring.is-hovering {
  width: 3.5rem;
  height: 3.5rem;
  border-color: var(--color-pacific);
  opacity: 0.6;
}

/* ============================================
   LAYOUT
   ============================================ */
.container {
  width: 100%;
  max-width: var(--content-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

/* ============================================
   TYPOGRAPHY UTILITIES
   ============================================ */
.label {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--color-iron-muted);
}

.display {
  font-size: clamp(var(--text-3xl), 7vw, var(--text-5xl));
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--color-iron);
}

.headline {
  font-size: clamp(var(--text-xl), 3.5vw, var(--text-3xl));
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-tight);
}

.subheading {
  font-size: clamp(var(--text-base), 2vw, var(--text-md));
  font-weight: var(--weight-light);
  line-height: var(--leading-loose);
  letter-spacing: var(--tracking-snug);
  color: var(--color-iron-light);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-4);
  font-family: var(--font-primary);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  border-radius: var(--radius-full);
  transition: all var(--duration-base) var(--ease-fluid);
  cursor: none;
}

.btn--primary {
  background: var(--color-iron);
  color: var(--color-bg);
  box-shadow: var(--shadow-soft);
}

.btn--primary:hover {
  background: var(--color-iron-light);
  box-shadow: var(--shadow-lift);
  transform: translateY(-2px);
}

.btn--outline {
  background: transparent;
  color: var(--color-iron);
  border: 1.5px solid var(--color-iron);
  box-shadow: var(--shadow-soft);
}

.btn--outline:hover {
  background: var(--color-iron);
  color: var(--color-bg);
  box-shadow: var(--shadow-lift);
  transform: translateY(-2px);
}

.btn--ghost {
  background: transparent;
  color: var(--color-iron-light);
  padding-inline: var(--space-2);
}

.btn--ghost:hover {
  color: var(--color-iron);
}

/* ============================================
   NAVIGATION
   ============================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding-block: var(--space-3);
  transition: background var(--duration-slow) var(--ease-fluid),
              backdrop-filter var(--duration-slow) var(--ease-fluid);
}

.nav.scrolled {
  background: rgba(255, 236, 204, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

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

.nav__logo {
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--color-iron);
  transition: opacity var(--duration-base) var(--ease-fluid);
}

.nav__logo:hover {
  opacity: 0.6;
}

.nav__monogram {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--color-iron);
  color: var(--color-bg);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: 0.05em;
  box-shadow: var(--shadow-soft);
  transition: box-shadow var(--duration-base) var(--ease-fluid),
              transform var(--duration-base) var(--ease-spring);
}

.nav__monogram:hover {
  box-shadow: var(--shadow-lift);
  transform: scale(1.05);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.nav__link {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-snug);
  color: var(--color-iron-light);
  position: relative;
  transition: color var(--duration-base) var(--ease-fluid);
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--color-iron);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--duration-base) var(--ease-fluid);
}

.nav__link:hover {
  color: var(--color-iron);
}

.nav__link:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* ============================================
   TAGS / CHIPS
   ============================================ */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  border-radius: var(--radius-full);
  background: var(--color-surface);
  color: var(--color-iron-light);
  box-shadow: var(--shadow-soft);
  transition: all var(--duration-base) var(--ease-fluid);
}

.tag:hover {
  box-shadow: var(--shadow-inset);
  color: var(--color-iron);
}

.tag--accent {
  background: var(--color-ash);
  color: var(--color-iron);
}

/* ============================================
   CARDS
   ============================================ */
.card {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: box-shadow var(--duration-slow) var(--ease-fluid),
              transform var(--duration-slow) var(--ease-fluid);
}

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

/* ============================================
   DIVIDER
   ============================================ */
.divider {
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    var(--color-light-blue),
    transparent
  );
  border: none;
  margin-block: var(--space-8);
}

/* ============================================
   SCROLL ANIMATIONS
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(2rem);
  transition: opacity var(--duration-slower) var(--ease-out),
              transform var(--duration-slower) var(--ease-fluid);
}

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

.reveal-delay-1 { transition-delay: 100ms; }
.reveal-delay-2 { transition-delay: 200ms; }
.reveal-delay-3 { transition-delay: 350ms; }
.reveal-delay-4 { transition-delay: 500ms; }

/* ============================================
   CALLOUT BLOCK — breaks content container
   Used on all case study pages. Override
   --callout-color-a / b / c per project.
   ============================================ */
.cs-callout {
  /* Per-project palette — override in each case study's <style> block */
  --callout-color-a: #3D7A4F;
  --callout-color-b: #75B8C8;
  --callout-color-c: #8FC49A;

  position: relative;
  margin-block: var(--space-8);
  background: #FFFFFF;
  border-radius: var(--radius-xl);
  box-shadow:
    0 2px 12px rgba(62,78,80,0.07),
    0 8px 32px rgba(62,78,80,0.06);
  overflow: hidden;
  display: flex;
  align-items: stretch;
  min-height: 10rem;
}

/* Animated color bar — left edge */
.cs-callout__bar {
  flex-shrink: 0;
  width: 0.5rem;
  position: relative;
  overflow: hidden;
}

.cs-callout__bar canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* Quote content */
.cs-callout__body {
  padding: var(--space-8) var(--space-8) var(--space-8) var(--space-6);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-3);
}

.cs-callout__quote {
  font-size: clamp(var(--text-md), 2.2vw, var(--text-lg));
  font-weight: var(--weight-light);
  line-height: var(--leading-loose);
  color: var(--color-iron);
  font-style: italic;
}

.cs-callout__source {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--color-iron-muted);
}

/* Dark section variant */
.cs-section--dark .cs-callout {
  background: rgba(255,255,255,0.05);
  box-shadow: none;
}
.cs-section--dark .cs-callout__quote { color: var(--dw-green-light, #8FC49A); }

/* ============================================
   FOOTER
   ============================================ */
.footer {
  padding-block: var(--space-8);
  border-top: 1px solid rgba(62, 78, 80, 0.1);
}

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

.footer__copy {
  font-size: var(--text-xs);
  color: var(--color-iron-muted);
  letter-spacing: var(--tracking-snug);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 48rem) {
  :root {
    --gutter: var(--space-4);
  }

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

  body {
    cursor: auto;
  }

  .cursor, .cursor__ring {
    display: none;
  }
}

@media (max-width: 30rem) {
  :root {
    --gutter: var(--space-3);
  }
}
