/* Reset + typography + form basics */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--safe-top) + 1rem);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--c-bg);
  color: var(--c-ink);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
  transition: background-color .2s ease, color .2s ease;
}

h1, h2, h3, h4 { margin: 0 0 var(--s-3); line-height: 1.2; letter-spacing: -.015em; font-weight: 750; }
h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
p { margin: 0 0 var(--s-4); }
a { color: var(--c-accent-text); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
img, svg { max-width: 100%; height: auto; }
img { display: block; }
hr { border: 0; border-top: 1px solid var(--c-border); margin: var(--s-5) 0; }
small, .small { font-size: var(--fs-sm); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; background: var(--c-surface-2); padding: .1em .35em; border-radius: 6px; }

:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 2px; border-radius: 4px; }

.skip-link {
  position: absolute; left: var(--s-3); top: -100px; z-index: 100;
  background: var(--c-ink); color: var(--c-bg); padding: var(--s-2) var(--s-4); border-radius: var(--radius-sm);
}
.skip-link:focus { top: var(--s-3); }

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

/* Forms */
label { display: block; font-weight: 650; margin-bottom: var(--s-2); }
.input, .select, .textarea {
  width: 100%; min-height: var(--touch);
  padding: .7rem .9rem;
  font: inherit; color: var(--c-ink);
  background: var(--c-surface);
  border: 1.5px solid var(--c-border-strong);
  border-radius: var(--radius-md);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.textarea { min-height: 7rem; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--c-ink-3); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--c-accent); box-shadow: 0 0 0 4px var(--c-accent-soft); }
.field { margin-bottom: var(--s-4); }
.field-hint { color: var(--c-ink-3); font-size: var(--fs-sm); margin-top: var(--s-1); }
.field-error { color: var(--c-urgent); font-size: var(--fs-sm); margin-top: var(--s-1); font-weight: 600; }

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