/* ==========================================================================
   Web Mastro — Base / Reset
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: auto; /* Lenis drives smooth scroll; native stays auto to avoid double-handling */
}

html.no-scroll,
body.no-scroll {
  overflow: hidden;
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  background: var(--surface);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color var(--dur-fast) var(--ease-mastro), color var(--dur-fast) var(--ease-mastro);
}

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

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

ul { list-style: none; margin: 0; padding: 0; }

h1, h2, h3, h4, p, figure { margin: 0; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: var(--ls-tight);
  line-height: var(--lh-tight);
  color: inherit;
}

::selection {
  background: var(--mastro-blue);
  color: var(--white);
}

/* Visible focus states — never suppressed */
:focus-visible {
  outline: 2px solid var(--mastro-blue);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.section-dark :focus-visible {
  outline-color: var(--mastro-blue);
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -48px;
  left: var(--space-2);
  z-index: 10000;
  background: var(--surface);
  color: var(--text-primary);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: var(--fs-small);
  font-weight: 600;
  transition: top var(--dur-fast) var(--ease-mastro);
}

.skip-link:focus {
  top: var(--space-2);
}

.container {
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--section-pad-x);
}

.section {
  position: relative;
  padding-block: var(--section-pad-y);
  transition: background-color var(--dur-fast) var(--ease-mastro), color var(--dur-fast) var(--ease-mastro);
}

.section-dark {
  background: var(--mastro-black);
  color: var(--white);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-family: var(--font-display);
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  color: var(--text-secondary);
}

.section-dark .eyebrow { color: var(--text-secondary-inverse); }

.eyebrow::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--mastro-flow);
}

.gradient-text {
  background: var(--mastro-flow);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* Text reveal primitive — lines are pre-split by JS, masked by overflow */
.reveal-line {
  overflow: hidden;
}

.reveal-line > * {
  display: inline-block;
  will-change: transform;
}

[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
}

.no-js [data-reveal] {
  opacity: 1;
  transform: none;
}

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