/* Fonts are loaded from index.html (preconnect + <link>) so first paint
   isn't blocked by a CSS @import chain. */

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

body {
  font-family: var(--font-body);
  background-color: var(--color-bg-dark);
  color: var(--color-text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;

  /* Physical paper sheet: warm fibre mottle + newsprint grain. The even blue
     grid was pulled — it read as a dev default; craft surfaces are fibrous. */
  background-image:
    var(--tx-fleck),
    var(--tx-fiber),
    var(--tx-grain),
    radial-gradient(120% 60% at 50% 0%, rgba(255, 255, 255, 0.8) 0%, transparent 60%),
    linear-gradient(180deg, #f9f7f0 0%, #f5f2e9 100%);
  /* NOTE: no background-attachment:fixed — it disables the fast scroll path
     (and is ignored on iOS); the paper scrolls with the page, which also
     reads more like a physical sheet. */
}

/* Global ultra-fine film grain overlay.
   Plain opacity instead of mix-blend-mode:multiply — visually near-identical
   at this strength, but multiply forces full-screen blending every frame. */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 4000;
  pointer-events: none;
  background-image: var(--tx-grain);
  opacity: 0.09;
}

/* Soft lens vignette on the whole page */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 3999;
  pointer-events: none;
  background: radial-gradient(130% 130% at 50% 45%, transparent 62%, rgba(58, 38, 20, 0.1) 100%);
}

::selection {
  background: rgba(194, 65, 122, 0.25);
  color: var(--color-ink);
}

a {
  color: inherit;
  text-decoration: none;
  transition: all var(--transition-fast);
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  background: none;
  border: none;
  outline: none;
}

/* Visible focus for keyboard users — drawn like a cut guide */
:focus-visible {
  outline: 2px dashed var(--color-brand-pink);
  outline-offset: 3px;
}

button {
  cursor: pointer;
}

ul {
  list-style: none;
}

/* Editorial serif headings — sharp newsprint look */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-headings);
  font-weight: 600;
  line-height: 1.12;
  color: var(--color-text-primary);
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(2.6rem, 6vw, 3.9rem);
  margin-bottom: var(--spacing-sm);
}

h2 {
  font-size: clamp(1.9rem, 4vw, 2.4rem);
  margin-bottom: var(--spacing-md);
  position: relative;
  display: inline-block;
}

/* Hand-drawn marker squiggle instead of the neon bar */
h2::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  width: min(70%, 200px);
  height: 9px;
  background-image: var(--tx-squiggle);
  background-repeat: repeat-x;
  background-size: 88px 9px;
}

h3 {
  font-size: clamp(1.3rem, 2.5vw, 1.55rem);
}

p {
  color: var(--color-text-secondary);
  font-size: 1.05rem;
  line-height: 1.7;
}

/* Old gradient-text class, repurposed: inked accent text on paper */
.text-gradient {
  background: none;
  -webkit-background-clip: initial;
  -webkit-text-fill-color: currentColor;
  color: var(--color-brand-pink);
  text-shadow: none;
}

/* Blueprint accent — the technical/B2B voice (Machine Hub) */
.text-blueprint {
  color: var(--color-brand-purple);
  -webkit-text-fill-color: var(--color-brand-purple);
}

.handwritten {
  font-family: var(--font-handwritten);
  font-weight: 600;
  color: var(--color-brand-pink);
  font-size: 1.6rem;
  letter-spacing: 0.01em;
  transform: rotate(-2deg);
  display: inline-block;
}

/* Typewriter utility — SKUs, prices, spec numbers */
.mono {
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

/* Containers */
.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 var(--spacing-xl);
}

.section-padding {
  padding: var(--spacing-xxl) 0;
}

/* Layout Utilities */
.flex {
  display: flex;
}

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

.grid {
  display: grid;
}

/* Halftone print-dot wash for alternating sections */
.halftone-section {
  background-color: rgba(58, 38, 20, 0.035);
  background-image: radial-gradient(rgba(42, 31, 22, 0.07) 1px, transparent 1.4px);
  background-size: 9px 9px;
  border-top: 1px solid rgba(42, 31, 22, 0.08);
  border-bottom: 1px solid rgba(42, 31, 22, 0.08);
}

/* Scrollbar — wood on paper */
::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: #ece2cd;
}

::-webkit-scrollbar-thumb {
  background: #c9ab7c;
  border-radius: var(--radius-round);
  border: 3px solid #ece2cd;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-brand-pink);
}

/* Animations */
@keyframes float {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-7px) rotate(1deg);
  }
}

.animate-float {
  animation: float 6s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .animate-float {
    animation: none;
  }
}
