/* TUMA website base layer (owner: site-foundation): reset, typography, focus, layout
   helpers, buttons, form controls, reduced motion. Uses tokens.css only. */

/* --- reset --- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + var(--s-4)); }
body, h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd, ul, ol { margin: 0; }
ul[role="list"], ol[role="list"], .list-reset { list-style: none; padding: 0; }
img, svg, picture, video { display: block; max-width: 100%; }
img, video { height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* --- page --- */
body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
main { flex: 1 0 auto; }
main:focus { outline: none; }

/* --- typography --- */
h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 600;
  line-height: var(--lh-tight);
  letter-spacing: -0.01em;
  text-wrap: balance;
}
h1 { font-size: var(--fs-4xl); font-weight: 700; }
h2 { font-size: var(--fs-3xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }
p { text-wrap: pretty; }
p + p { margin-top: var(--s-4); }
strong, b { font-weight: 700; }
small { font-size: var(--fs-sm); }

a { color: var(--brand-2); text-decoration-thickness: 0.08em; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 0.14em; }

.eyebrow {
  display: inline-block;
  font-family: var(--font-head);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand-1);
}
.lead { font-size: var(--fs-lg); color: var(--text-muted); }
.muted { color: var(--text-muted); }

/* --- focus (visible only for keyboard users) --- */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}
:focus:not(:focus-visible) { outline: none; }

/* --- accessibility helpers --- */
.visually-hidden:not(:focus):not(:active) {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.skip-link {
  position: absolute;
  top: var(--s-2);
  left: var(--s-2);
  z-index: 1000;
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  box-shadow: var(--sh-2);
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

/* --- layout --- */
.container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container-narrow { max-width: calc(var(--container-narrow) + 2 * var(--gutter)); }
.section { padding-block: var(--s-9); }
.section-tight { padding-block: var(--s-7); }
.section-head { max-width: 46rem; margin-bottom: var(--s-7); }
.section-head > * + * { margin-top: var(--s-3); }
.center { text-align: center; margin-inline: auto; }
.stack > * + * { margin-top: var(--s-4); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; }

@media (max-width: 640px) {
  .section { padding-block: var(--s-8); }
}

/* --- icons (inlined SVG) --- */
.icon { width: 1.5rem; height: 1.5rem; flex: none; }
.icon-sm { width: 1.125rem; height: 1.125rem; }

/* --- buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-width: var(--tap);
  min-height: var(--tap);
  padding: var(--s-3) var(--s-5);
  border: 2px solid transparent;
  border-radius: var(--r-pill);
  font-family: var(--font-head);
  font-size: var(--fs-base);
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: transform var(--dur-2) var(--ease-bounce), box-shadow var(--dur-2) var(--ease-out),
              background-color var(--dur-2) var(--ease-out), color var(--dur-2) var(--ease-out),
              border-color var(--dur-2) var(--ease-out);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--grad-cta);
  background-size: 140% 100%;
  background-position: 0% 50%;
  color: var(--on-brand);
  box-shadow: var(--sh-2);
}
.btn-primary:hover { background-position: 100% 50%; box-shadow: var(--sh-3); color: var(--on-brand); }

.btn-secondary {
  background: var(--surface);
  color: var(--brand-2);
  border-color: var(--brand-2);
}
.btn-secondary:hover { background: var(--brand-2-soft); color: var(--brand-2); }

.btn-ghost {
  background: transparent;
  color: var(--text);
}
.btn-ghost:hover { background: var(--bg-soft); color: var(--text); }

.btn-lg { padding: var(--s-4) var(--s-6); font-size: var(--fs-lg); }
.btn-sm { padding: var(--s-2) var(--s-4); font-size: var(--fs-sm); }
.btn-block { display: flex; width: 100%; }
.btn-icon { padding: var(--s-2); border-radius: var(--r-pill); }

/* --- form controls --- */
.field { display: grid; gap: var(--s-2); }
.field + .field { margin-top: var(--s-4); }
label, .label { font-weight: 700; }
.hint { font-size: var(--fs-sm); color: var(--text-muted); }
.field-error { font-size: var(--fs-sm); font-weight: 700; color: var(--err); }

.input, .select, .textarea,
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="search"], input[type="tel"], input[type="url"], select, textarea {
  width: 100%;
  min-height: var(--tap);
  padding: var(--s-3) var(--s-4);
  border: 2px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text);
  font-size: var(--fs-base);
  line-height: 1.4;
  transition: border-color var(--dur-1) var(--ease-out), box-shadow var(--dur-1) var(--ease-out);
}
textarea { min-height: 7rem; resize: vertical; }
select { appearance: auto; }
input::placeholder, textarea::placeholder { color: var(--text-muted); opacity: 1; }
input:hover, select:hover, textarea:hover { border-color: var(--brand-2); }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-color: var(--brand-2);
}
[aria-invalid="true"] { border-color: var(--err) !important; }

input[type="checkbox"], input[type="radio"] {
  width: 1.375rem;
  height: 1.375rem;
  margin: 0;
  accent-color: var(--brand-2);
  flex: none;
}
.check { display: flex; gap: var(--s-3); align-items: flex-start; min-height: var(--tap); padding-block: var(--s-2); font-weight: 400; }
.check input { margin-top: 0.15rem; }

fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend { padding: 0; font-weight: 700; }

/* --- alerts --- */
.alert {
  padding: var(--s-4) var(--s-5);
  border-radius: var(--r-md);
  border: 2px solid var(--border);
  background: var(--surface);
}
.alert-error { border-color: var(--err); color: var(--text); }
.alert-ok { border-color: var(--ok); color: var(--text); }
.alert-info { border-color: var(--brand-2); color: var(--text); }

/* --- reduced motion: no transforms, no transitions, no animations --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .btn:hover, .btn:active { transform: none; }
}
