/* ==========================================================================
   Base: reset, typography, layout primitives, forms
   ========================================================================== */

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 1rem);
  overflow-x: hidden;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  font-family: var(--font);
  font-size: var(--t-base);
  line-height: var(--lh-normal);
  color: var(--ink-3);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv05' 1, 'ss03' 1;
  overflow-x: hidden;
}

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

/* --- Headings ------------------------------------------------------------ */

h1, h2, h3, h4, h5, h6 {
  color: var(--ink);
  font-weight: 600;
  line-height: var(--lh-tight);
  letter-spacing: var(--track-tight);
  text-wrap: balance;
}

h1 { font-size: var(--t-h1); }
h2 { font-size: var(--t-h2); }
h3 { font-size: var(--t-h3); line-height: var(--lh-snug); }
h4 { font-size: var(--t-h4); line-height: var(--lh-snug); letter-spacing: var(--track-snug); }
h5, h6 { font-size: var(--t-base); letter-spacing: 0; }

p { text-wrap: pretty; }

/* --- Links --------------------------------------------------------------- */

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--dur-1) var(--ease);
}

.prose a,
a.inline-link {
  color: var(--copper);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--copper-line);
}

.prose a:hover,
a.inline-link:hover {
  color: var(--copper-3);
  text-decoration-color: currentColor;
}

/* --- Focus --------------------------------------------------------------- */

:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 3px;
  border-radius: var(--r-1);
}

:focus:not(:focus-visible) { outline: none; }

.skip-link {
  position: absolute;
  left: var(--s-4);
  top: var(--s-4);
  z-index: 999;
  transform: translateY(-200%);
  background: var(--ink);
  color: var(--paper);
  padding: var(--s-3) var(--s-5);
  border-radius: var(--r-2);
  font-size: var(--t-sm);
  font-weight: 500;
  transition: transform var(--dur-2) var(--ease-out);
}

.skip-link:focus { transform: translateY(0); }

/* --- Layout -------------------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.wrap-narrow { max-width: var(--wrap-narrow); }

.section { padding-block: var(--section-y); }
.section-tight { padding-block: clamp(2.5rem, 4vw, 4rem); }

.section-ink {
  background: var(--ink);
  color: var(--muted-invert);
}

.section-ink h1,
.section-ink h2,
.section-ink h3,
.section-ink h4 { color: var(--paper); }

.section-paper { background: var(--paper-2); }

.rule {
  border: 0;
  border-top: 1px solid var(--line);
}

.section-ink .rule { border-color: var(--line-dark); }

/* --- Section headers ----------------------------------------------------- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  font-size: var(--t-eyebrow);
  font-weight: 600;
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: var(--copper);
  margin-bottom: var(--s-4);
}

.eyebrow::before {
  content: '';
  width: 28px;
  height: 1px;
  background: var(--copper);
  opacity: 0.7;
}

.section-ink .eyebrow { color: var(--copper-2); }
.section-ink .eyebrow::before { background: var(--copper-2); }

.section-head {
  max-width: 640px;
  margin-bottom: var(--s-8);
}

.section-head.center {
  margin-inline: auto;
  text-align: center;
}

.section-head.center .eyebrow { justify-content: center; }

.section-head p {
  margin-top: var(--s-4);
  font-size: var(--t-lg);
  color: var(--muted);
  line-height: var(--lh-relaxed);
}

.section-ink .section-head p { color: var(--muted-invert); }

.section-head-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-6);
  margin-bottom: var(--s-8);
  flex-wrap: wrap;
}

.section-head-row .section-head { margin-bottom: 0; }

/* --- Prose (CMS body content) -------------------------------------------- */

.prose {
  line-height: var(--lh-relaxed);
  color: var(--ink-3);
}

.prose > * + * { margin-top: var(--s-4); }
.prose h2 { font-size: var(--t-h3); margin-top: var(--s-7); }
.prose h3 { font-size: var(--t-h4); margin-top: var(--s-6); }
.prose h4 { font-size: var(--t-lg); margin-top: var(--s-5); }

.prose ul,
.prose ol {
  padding-left: 1.15rem;
  display: grid;
  gap: var(--s-2);
}

.prose li::marker { color: var(--copper); }
.prose strong { color: var(--ink); font-weight: 600; }

.prose blockquote {
  border-left: 2px solid var(--copper);
  padding-left: var(--s-5);
  color: var(--muted);
}

/* --- Forms --------------------------------------------------------------- */

.field { display: grid; gap: var(--s-2); }

.field > label,
.label {
  font-size: var(--t-sm);
  font-weight: 500;
  color: var(--ink);
  letter-spacing: var(--track-snug);
}

.req { color: var(--copper); }

.hint {
  font-size: var(--t-xs);
  color: var(--muted-2);
}

input[type='text'],
input[type='email'],
input[type='tel'],
input[type='search'],
input[type='number'],
input[type='url'],
textarea,
select {
  width: 100%;
  font: inherit;
  font-size: var(--t-sm);
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line-2);
  border-radius: var(--r-2);
  padding: 0.7rem 0.85rem;
  transition: border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
  -webkit-appearance: none;
  appearance: none;
}

textarea {
  resize: vertical;
  min-height: 7rem;
  line-height: var(--lh-normal);
}

input::placeholder,
textarea::placeholder { color: var(--muted-2); }

input:hover:not(:disabled),
textarea:hover:not(:disabled),
select:hover:not(:disabled) { border-color: var(--muted-2); }

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--copper);
  box-shadow: 0 0 0 3px var(--copper-wash);
}

input[aria-invalid='true'],
textarea[aria-invalid='true'] {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-wash);
}

.error-text {
  font-size: var(--t-xs);
  color: var(--danger);
  min-height: 1rem;
}

select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%2363696f' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1.5 6 6.5l5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.25rem;
  cursor: pointer;
}

input[type='checkbox'],
input[type='radio'] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--copper);
  cursor: pointer;
  flex: none;
}

fieldset { border: 0; padding: 0; }
legend { padding: 0; }

/* --- Utilities ----------------------------------------------------------- */

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

.is-hidden { display: none !important; }
.text-center { text-align: center; }
.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); font-size: 0.92em; }

.stack   { display: grid; gap: var(--s-4); }
.stack-6 { display: grid; gap: var(--s-6); }

.center-actions {
  display: flex;
  justify-content: center;
  gap: var(--s-3);
  flex-wrap: wrap;
  margin-top: var(--s-8);
}

/* --- Selection & scrollbar ------------------------------------------------ */

::selection {
  background: var(--copper);
  color: #fff;
}

@media print {
  .site-header,
  .site-footer,
  .whatsapp-fab,
  .toast-region { display: none !important; }
  body { color: #000; background: #fff; }
}
