@import "tailwindcss";

/* ---------------------------------------------------------------------------
   Three Stars design tokens.
   Palette is drawn from the materials the mill actually works in: mill night,
   raw indigo, marigold thread, undyed cotton and melange grey.
--------------------------------------------------------------------------- */

@theme {
  --color-ink: #080b14;
  --color-ink-2: #0e1422;
  --color-indigo: #1b2a5b;
  --color-indigo-lit: #3a56a6;
  --color-thread: #e0a458;
  --color-cotton: #f5f1e8;
  --color-melange: #8a8f9c;
  --color-hiviz: #d8e04a;

  --font-display: var(--font-instrument-serif), Georgia, "Times New Roman", serif;
  --font-sans: var(--font-inter), ui-sans-serif, system-ui, sans-serif;
  --font-mono: var(--font-jetbrains-mono), ui-monospace, "SFMono-Regular", monospace;

  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out-quart: cubic-bezier(0.76, 0, 0.24, 1);
}

:root {
  --ink: #080b14;
  --ink-2: #0e1422;
  --indigo: #1b2a5b;
  --indigo-lit: #3a56a6;
  --thread: #e0a458;
  --cotton: #f5f1e8;
  --melange: #8a8f9c;
  --hiviz: #d8e04a;

  /* Section level surface tint. Individual pages override this so the denim
     page runs deeper indigo and the workwear page warms up. */
  --surface: var(--ink);
  --rule: color-mix(in srgb, var(--cotton) 12%, transparent);

  --gutter: clamp(1.25rem, 5vw, 5rem);
  --section-y: clamp(5rem, 12vw, 11rem);

  color-scheme: dark;
}

* {
  min-width: 0;
}

html {
  /* Lenis drives scrolling. Native smooth scroll would fight it. */
  scroll-behavior: auto;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--ink);
  color: var(--cotton);
  font-family: var(--font-sans);
  font-synthesis-weight: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

::selection {
  background: var(--thread);
  color: var(--ink);
}

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

/* --------------------------------------------------------------------------
   Typography scale
-------------------------------------------------------------------------- */

.display-xl {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.75rem, 8.5vw, 8rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
}

.display-lg {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.25rem, 6vw, 5rem);
  line-height: 1;
  letter-spacing: -0.015em;
}

.display-md {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.75rem, 3.6vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--thread);
}

.lede {
  font-size: clamp(1.0625rem, 1.6vw, 1.375rem);
  line-height: 1.6;
  color: color-mix(in srgb, var(--cotton) 78%, transparent);
}

.data {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* --------------------------------------------------------------------------
   Layout helpers
-------------------------------------------------------------------------- */

.shell {
  width: 100%;
  max-width: 90rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--section-y);
  position: relative;
}

.hairline {
  border-top: 1px solid var(--rule);
}

/* Grain, so the flat dark fields read as cloth rather than plastic. */
.grain::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------------------
   Reduced motion. Anything animated must still arrive at its final state.
-------------------------------------------------------------------------- */

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

/* --------------------------------------------------------------------------
   Keyframes used by non JS decoration
-------------------------------------------------------------------------- */

@keyframes marquee-x {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(-50%, 0, 0);
  }
}

@keyframes thread-pulse {
  0%,
  100% {
    opacity: 0.25;
    transform: scale(1);
  }
  50% {
    opacity: 0.75;
    transform: scale(1.6);
  }
}

@keyframes shuttle {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(400%);
  }
}

/* Scroll cue: a thread being paid out down the guide. */
@keyframes thread-drop {
  0% {
    transform: translateY(-120%);
    opacity: 0;
  }
  35% {
    opacity: 1;
  }
  100% {
    transform: translateY(280%);
    opacity: 0;
  }
}
