/* ============================================================
   MASHINA STUDIO — Base
   Reset, typography defaults, buttons, links, forms.
   ============================================================ */

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

* { margin: 0; }

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

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--size-body);
  line-height: var(--lh-body);
  font-size-adjust: from-font;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

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

/* --- Headlines --- */
h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

h1 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: var(--size-h1);
  line-height: var(--lh-tight);
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

h2 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: var(--size-h2);
  line-height: var(--lh-snug);
  letter-spacing: -0.005em;
  text-transform: uppercase;
}

h3 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--size-h3);
  line-height: var(--lh-mid);
}

p { max-width: 65ch; }

/* --- Spec labels (mono, uppercase) --- */
.label {
  font-family: var(--font-mono);
  font-size: var(--size-label);
  line-height: var(--lh-label);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-2);
}

.label--signal { color: var(--signal); }

/* --- Links --- */
a {
  color: var(--ink);
  text-decoration-color: var(--signal);
  text-underline-offset: 3px;
  transition: color var(--dur) var(--ease), text-decoration-color var(--dur) var(--ease);
}

a:hover {
  color: var(--signal);
  text-decoration-color: var(--signal);
}

/* --- Buttons: machined, crisp --- */
.btn {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--size-label);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: var(--sp-3) var(--sp-6);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  transition:
    background var(--dur) var(--ease),
    color var(--dur) var(--ease),
    transform var(--dur-fast) var(--ease);
}

.btn:hover {
  background: var(--ink);
  color: var(--paper);
}

.btn:active { transform: translateY(1px); }

/* Primary CTA — the ONE loud treatment */
.btn--signal {
  background: var(--signal);
  border-color: var(--signal);
  color: var(--white);
  font-weight: 500;
}

.btn--signal:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--white);
}

/* --- Forms --- */
input, textarea, select {
  font-family: var(--font-body);
  font-size: var(--size-body);
  line-height: var(--lh-body);
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--sp-3) var(--sp-4);
  width: 100%;
}

input:focus, textarea:focus, select:focus, .btn:focus-visible, a:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 2px;
}

textarea { resize: vertical; min-height: 120px; }

::placeholder { color: var(--metal); opacity: 1; }

/* --- Motion defaults: signature rise, consistent --- */
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.rise {
  animation: rise var(--dur-slow) var(--ease) both;
}

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

/* --- Utility: container --- */
.container {
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* --- Utility: hairline rules --- */
.rule { border: 0; border-top: 1px solid var(--line); }

/* --- Selection --- */
::selection { background: var(--signal); color: var(--paper); }