/* ============================================================
   Aureza Labs — Base: reset, elements, typography, utilities
   ============================================================ */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  font-family: var(--font-body);
  font-size: var(--t-md);
  line-height: var(--lh-base);
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv05" 1, "cv11" 1, "ss01" 1;
  overflow-x: hidden;
  min-height: 100vh;
}

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

input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
ul, ol { list-style: none; padding: 0; }
a { color: inherit; text-decoration: none; }
table { border-collapse: collapse; width: 100%; }
hr { border: 0; border-top: 1px solid var(--line); }

::selection { background: var(--brand); color: #fff; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}
:focus:not(:focus-visible) { outline: none; }

/* ---------------- Headings ---------------- */

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--lh-snug);
  letter-spacing: var(--tr-snug);
  text-wrap: balance;
}
h1 { font-size: var(--t-h1); line-height: var(--lh-tight); letter-spacing: var(--tr-tight); }
h2 { font-size: var(--t-h2); line-height: 1.1; letter-spacing: var(--tr-tight); }
h3 { font-size: var(--t-h3); }
h4 { font-size: var(--t-h4); }
h5 { font-size: var(--t-lg); }

p { text-wrap: pretty; }

strong, b { font-weight: 600; color: var(--text); }

/* ---------------- Layout primitives ---------------- */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--narrow { max-width: var(--container-narrow); }
.container--wide { max-width: 1440px; }

.section { padding-block: var(--section-y); }
.section--tight { padding-block: clamp(48px, 5vw, 80px); }
.section--sunk { background: var(--bg-sunk); }

.stack > * + * { margin-top: var(--flow, 1rem); }

.grid { display: grid; gap: var(--gap, var(--s-6)); }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 900px) {
  .cols-3, .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .cols-2, .cols-3, .cols-4 { grid-template-columns: minmax(0, 1fr); }
}

/* ---------------- Text utilities ---------------- */

.lead {
  font-size: var(--t-xl);
  line-height: 1.5;
  color: var(--text-soft);
  letter-spacing: -0.011em;
  max-width: 60ch;
}
.soft { color: var(--text-soft); }
.faint { color: var(--text-faint); }
.measure { max-width: 66ch; }
.measure-sm { max-width: 46ch; }
.center { text-align: center; }
.mono { font-family: var(--font-mono); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  font-weight: 500;
  letter-spacing: var(--tr-wide);
  text-transform: uppercase;
  color: var(--brand);
}
.eyebrow::before {
  content: "";
  width: 20px;
  height: 1px;
  background: currentColor;
  opacity: .65;
  flex: none;
}
.eyebrow--plain::before { display: none; }

.kicker {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  letter-spacing: var(--tr-wide);
  text-transform: uppercase;
  color: var(--text-faint);
}

/* Editorial serif accent — used for pull quotes and italic emphasis */
.editorial {
  font-family: var(--font-editorial);
  font-optical-sizing: auto;
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.005em;
}

/* Underline flourish drawn as a hand-inked stroke */
.ink {
  position: relative;
  display: inline-block;
  white-space: nowrap;
}
.ink > svg {
  position: absolute;
  left: 0;
  bottom: -0.14em;
  width: 100%;
  height: 0.34em;
  color: var(--brand);
  opacity: .5;
  overflow: visible;
}
.ink > svg path {
  stroke-dasharray: 200;
  stroke-dashoffset: 200;
  animation: ink-draw 1.1s var(--ease-out) .35s forwards;
}
@keyframes ink-draw { to { stroke-dashoffset: 0; } }

/* ---------------- Accessibility ---------------- */

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: 0; left: 12px;
  transform: translateY(-140%);
  z-index: var(--z-top);
  background: var(--brand);
  color: #fff;
  padding: 12px 20px;
  border-radius: 0 0 var(--r-sm) var(--r-sm);
  font-weight: 600;
  font-size: var(--t-base);
  transition: transform var(--dur) var(--ease-out);
}
.skip-link:focus { transform: translateY(0); }

/* ---------------- Scroll reveal ---------------- */

.js [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 22px, 0);
  transition:
    opacity 720ms var(--ease-out) var(--reveal-delay, 0ms),
    transform 720ms var(--ease-out) var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}
.js [data-reveal="fade"] { transform: none; }
.js [data-reveal="left"] { transform: translate3d(-26px, 0, 0); }
.js [data-reveal="right"] { transform: translate3d(26px, 0, 0); }
.js [data-reveal="scale"] { transform: scale(.965); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .js [data-reveal] { opacity: 1 !important; transform: none !important; }
}

/* ---------------- Decorative background texture ---------------- */

/* Fine film grain — flattens the "flat vector" look */
.grain::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .30;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.34'/%3E%3C/svg%3E");
}
:root[data-theme="dark"] .grain::before { mix-blend-mode: screen; opacity: .16; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .grain::before { mix-blend-mode: screen; opacity: .16; }
}

/* Engineering dot grid */
.dotgrid {
  background-image: radial-gradient(circle at 1px 1px, var(--line-strong) 1px, transparent 0);
  background-size: 26px 26px;
}

/* Blueprint rule grid */
.rulegrid {
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 72px 72px;
}
