/* Shared base for index.html and portal.html. No brand values here:
   every color, font and radius comes from brand.css custom properties. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: var(--body-size);
  line-height: var(--body-leading);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
svg { display: block; }
a { color: inherit; text-underline-offset: .18em; text-decoration-thickness: 1px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
::selection { background: var(--accent-soft); }

img { max-width: 100%; height: auto; }
/* JetBrains Mono joins some letter pairs by default. Off, so copied commands read as typed. */
code, pre, kbd, .label { font-variant-ligatures: none; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- type ---------- */
.h1, .h2 {
  font-family: var(--f-head);
  font-weight: var(--head-weight);
  font-stretch: var(--head-stretch);
  letter-spacing: var(--head-tracking);
  line-height: var(--head-leading);
  text-wrap: balance;
}
.h1 { font-size: var(--h1-size); }
.h2 { font-size: var(--h2-size); }
.h3 {
  font-family: var(--f-sub);
  font-weight: var(--sub-weight);
  font-stretch: var(--sub-stretch);
  letter-spacing: var(--sub-tracking);
  font-size: 1.15rem;
  line-height: 1.35;
  text-wrap: balance;
}
.label {
  font-family: var(--f-label);
  font-size: var(--label-size);
  letter-spacing: var(--label-tracking);
  text-transform: var(--label-transform);
  line-height: 1.35;
  color: var(--muted);
}
.lede { font-size: clamp(1.06rem, 1.6vw, 1.22rem); line-height: 1.55; color: var(--ink); max-width: 38em; }
.muted { color: var(--muted); }
.wrap { width: 100%; max-width: 1120px; margin-inline: auto; padding-left: clamp(16px, 4vw, 40px); padding-right: clamp(16px, 4vw, 40px); }

/* ---------- wordmark: the name in type. No logo for now. ---------- */
.mark { display: inline-flex; align-items: baseline; gap: .5rem; color: var(--ink); text-decoration: none; white-space: nowrap; }
.mark b { font-family: var(--f-name); font-weight: 400; font-size: 1.12rem; line-height: 1; letter-spacing: var(--name-tracking); }
.mark span { font-family: var(--f-label); font-weight: 500; font-size: .8rem; line-height: 1; color: var(--muted); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 46px; padding: .7em 1.2em;
  border-radius: var(--radius); border: 1px solid var(--ink);
  background: transparent; color: var(--ink);
  font-family: var(--btn-font); font-weight: var(--btn-weight);
  letter-spacing: var(--btn-tracking); text-transform: var(--btn-transform);
  font-size: .98rem; line-height: 1.1; text-decoration: none; text-align: center;
  transition: transform .15s ease, opacity .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-ink { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn-quiet { border-color: var(--line); background: var(--surface); }
.btn-sm { min-height: 38px; padding: .5em .9em; font-size: .92rem; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.linkish { background: none; border: 0; padding: 0; color: var(--accent-text); text-decoration: underline; text-underline-offset: .18em; font-size: inherit; }

/* ---------- form fields ---------- */
.field { display: grid; gap: 6px; }
.field > span { font-family: var(--f-label); font-size: var(--label-size); letter-spacing: var(--label-tracking); text-transform: var(--label-transform); color: var(--muted); }
.input, .select, .textarea {
  width: 100%; min-height: 46px; padding: .65em .8em;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--ink); font-size: 1rem; line-height: 1.4;
}
.textarea { min-height: 110px; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--muted); opacity: .8; }
.input:focus, .select:focus, .textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }

/* ---------- labelled placeholders (never a real shop) ---------- */
.ph-note {
  display: inline-block; padding: .1em .45em; border: 1px dashed var(--ph-ink);
  border-radius: var(--radius); color: var(--ph-ink);
  font-family: var(--f-label); font-size: .8em; letter-spacing: 0; text-transform: none;
}

/* ---------- icons ---------- */
.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }


/* ---------- motion: transform and opacity only ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
