/* Base reset, typography, utilities, buttons, layout */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-feature-settings: "cv11", "ss01";
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

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

button,
input,
select,
textarea {
  font: inherit;
}

::selection {
  background: oklch(0.55 0.19 258 / 0.18);
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  letter-spacing: -0.028em;
  text-wrap: balance;
  margin: 0;
}

p {
  margin: 0;
}

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

/* Layout */
.container-editorial {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

@media (min-width: 768px) {
  .container-editorial {
    padding-inline: 2rem;
  }
}

@media (min-width: 1280px) {
  .container-editorial {
    padding-inline: 2.5rem;
  }
}

.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1.5rem;
}

.col-span-12 { grid-column: span 12 / span 12; }
.col-span-7 { grid-column: span 12 / span 12; }
.col-span-5 { grid-column: span 12 / span 12; }
.col-span-4 { grid-column: span 12 / span 12; }

/*
  Two-value span so lg-col-start-* can override only the start line
  without collapsing the item to a single grid track.
*/
@media (min-width: 1024px) {
  .lg-col-span-4 { grid-column: span 4 / span 4; }
  .lg-col-span-5 { grid-column: span 5 / span 5; }
  .lg-col-span-6 { grid-column: span 6 / span 6; }
  .lg-col-span-7 { grid-column: span 7 / span 7; }
  .lg-col-span-8 { grid-column: span 8 / span 8; }
  .lg-col-start-6 { grid-column-start: 6; }
  .lg-col-start-7 { grid-column-start: 7; }
  .lg-col-start-9 { grid-column-start: 9; }
}

/* Typography utilities */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.display-1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.75rem, 7.2vw, 6rem);
  line-height: 0.96;
  letter-spacing: -0.04em;
}

.display-2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.1rem, 4.4vw, 3.75rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.display-3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.5rem, 2.2vw, 2rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.lede {
  font-size: clamp(1.0625rem, 1.35vw, 1.3125rem);
  line-height: 1.6;
  color: var(--muted-foreground);
  text-wrap: pretty;
}

/* Hairline grid */
.hairline-grid {
  background-image:
    linear-gradient(to right, var(--hairline) 1px, transparent 1px),
    linear-gradient(to bottom, var(--hairline) 1px, transparent 1px);
  background-size: 88px 88px;
}

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 3rem;
  padding-inline: 1.5rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-foreground {
  background: var(--foreground);
  color: var(--background);
  box-shadow: var(--shadow-lift);
}

.btn-outline {
  background: var(--card);
  color: var(--foreground);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  border-color: oklch(0.17 0.012 260 / 0.35);
}

.btn-sm {
  height: 2.5rem;
  padding-inline: 1rem;
  font-size: 0.8125rem;
}

.btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* Scroll snap horizontal */
.scroll-x-snap {
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overflow-x: auto;
}

.scroll-x-snap::-webkit-scrollbar {
  display: none;
}

/* SVG pipeline animations */
@keyframes flow-dash {
  to { stroke-dashoffset: -240; }
}

@keyframes soft-pulse {
  0%, 100% { opacity: 0.35; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.18); }
}

.flow-line {
  stroke-dasharray: 6 10;
  animation: flow-dash 4s linear infinite;
}

.node-pulse {
  transform-box: fill-box;
  transform-origin: center;
  animation: soft-pulse 3.2s ease-in-out infinite;
}

/* Form */
.form-field {
  margin-top: 0.5rem;
  height: 3rem;
  width: 100%;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  background: var(--card);
  padding-inline: 1rem;
  font-size: 0.9375rem;
  color: var(--foreground);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-field:focus {
  border-color: oklch(0.55 0.19 258 / 0.6);
  box-shadow: 0 0 0 2px oklch(0.55 0.19 258 / 0.25);
}

.form-field--textarea {
  height: auto;
  min-height: 8rem;
  padding-block: 0.75rem;
  line-height: 1.6;
  resize: vertical;
}

.form-error {
  margin-top: 0.375rem;
  font-size: 0.78125rem;
  color: var(--destructive);
}

.form-message {
  margin-top: 1rem;
  padding: 0.875rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
}

.form-message--success {
  background: oklch(0.55 0.19 258 / 0.1);
  color: var(--primary);
  border: 1px solid oklch(0.55 0.19 258 / 0.25);
}

.form-message--error {
  background: oklch(0.577 0.245 27.325 / 0.1);
  color: var(--destructive);
  border: 1px solid oklch(0.577 0.245 27.325 / 0.25);
}

/* Icon arrow inline */
.icon-arrow {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

/* ── Motion gating ──
   `data-anim-paused` is set by the animation gate in main.js whenever a
   decorative section scrolls off screen or the tab is hidden. !important
   because it has to beat rules in the later stylesheets it parks. */
[data-anim-paused],
[data-anim-paused] *,
[data-anim-paused] *::before,
[data-anim-paused] *::after {
  animation-play-state: paused !important;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }
}
