/* Legwork — risograph two-ink print design system */

:root {
  --paper: oklch(0.962 0.014 83);
  --panel: oklch(0.925 0.020 83);
  --ink: oklch(0.190 0.020 265);
  --ink-2: oklch(0.190 0.020 265 / 0.62);
  --line: oklch(0.190 0.020 265 / 0.16);
  --cobalt: oklch(0.480 0.200 261);
  --cobalt-ink: oklch(0.400 0.170 261);
  --cobalt-soft: oklch(0.905 0.045 255);
  --vermilion: oklch(0.620 0.200 31);
  --verm-soft: oklch(0.915 0.050 45);

  --r: 14px;
  --shadow: 5px 5px 0 var(--ink);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  --z-rail: 10;
  --z-sticky: 20;
  --z-grain: 40;
  --z-modal: 60;
  --z-toast: 80;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
img { max-width: 100%; height: auto; display: block; } /* never stretch */

body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Hanken Grotesk", system-ui, sans-serif;
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.1rem);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  position: relative;
  min-height: 100vh;
}

/* --- the grain overlay: one fixed layer, whole viewport --- */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: var(--z-grain);
  pointer-events: none;
  opacity: 0.16; /* subtle — enough for texture, not enough to mute the inks */
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* --- typography --- */
h1, h2, h3, h4 {
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.6rem, 1.8rem + 4vw, 5.4rem); }
h2 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3.4rem); }
h3 { font-size: clamp(1.3rem, 1.1rem + 0.9vw, 1.85rem); letter-spacing: -0.02em; }
p { text-wrap: pretty; max-width: 68ch; }
a { color: var(--cobalt-ink); text-decoration-thickness: 2px; text-underline-offset: 3px; }

.mono {
  font-family: "Spline Sans Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
}

/* --- layout --- */
.wrap { width: min(1140px, 92vw); margin-inline: auto; }
.narrow { width: min(760px, 92vw); margin-inline: auto; }
section { padding-block: clamp(3.5rem, 2rem + 7vw, 8rem); }

/* --- buttons --- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: "Bricolage Grotesque", sans-serif; font-weight: 700;
  font-size: 1.02rem; letter-spacing: -0.01em;
  padding: 0.85rem 1.5rem; border-radius: 12px;
  border: 2px solid var(--ink); cursor: pointer;
  background: var(--paper); color: var(--ink);
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), background 0.18s;
  text-decoration: none;
}
.btn-primary { background: var(--cobalt); color: var(--paper); box-shadow: 4px 4px 0 var(--vermilion); }
.btn-primary:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--vermilion); }
.btn-primary:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--vermilion); }
.btn-ghost { background: transparent; }
.btn-ghost:hover { transform: translate(-2px, -2px); box-shadow: 3px 3px 0 var(--ink); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }

/* --- print marks / decorative --- */
.tag {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.3rem 0.7rem; border: 2px solid var(--ink); border-radius: 999px;
  background: var(--paper); font-family: "Spline Sans Mono", monospace;
  font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 500;
}
.tag.hot { background: var(--verm-soft); border-color: var(--vermilion); color: var(--vermilion); }
.tag.cool { background: var(--cobalt-soft); border-color: var(--cobalt); color: var(--cobalt-ink); }

.halftone {
  background-image: radial-gradient(var(--ink) 1.4px, transparent 1.5px);
  background-size: 9px 9px;
}

/* --- reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; scroll-behavior: auto; }
}
