/* ============================================================
   PAGES: the subpages (contact, terms, privacy).
   White ground throughout; the same tokens, type and controls as
   the index, without its pinned acts or folio.
   ============================================================ */

/* JS smooth scrolling (core/scroll.js) drives the real scroll
   position, so CSS smoothing must step aside or the two fight.
   The index gets this from motion.css, which subpages don't load. */
html.has-smooth { scroll-behavior: auto; }

/* ── the bar: brand home, and a way back ── */
.bar { position: relative; z-index: 5; border-bottom: 1px solid var(--line); }
.bar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding-block: clamp(1rem, 2.2vw, 1.6rem);
}
.bar .brand__name { color: var(--display); }
.bar .brand__mark { color: var(--orange); }
.bar__back .btn__arr { width: 2.6em; border-left: 0; border-right: 1px solid var(--rule); }
@media (hover: hover) and (pointer: fine) {
  .bar__back:hover .btn__label { transform: translateX(2px); }
  .bar__back:hover .btn__arr svg { transform: translateX(-3px); }
}

.page { padding-block: var(--s-6) var(--s-7); }
.page__title { max-width: 14ch; }
.page__sub { margin-top: var(--s-3); }

/* ═══════════════ CONTACT ═══════════════
   An editorial split: the ask and the notice hold on the left,
   the form runs on the right. */
.connect {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: var(--s-5) var(--s-6);
  align-items: start;
}
.connect__intro { position: sticky; top: var(--s-5); }
.notice {
  margin-top: var(--s-5);
  padding: var(--s-3);
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--orange);
  border-radius: var(--radius);
  font-size: var(--t-sm);
  line-height: 1.6;
  max-width: 44ch;
}
.connect__alt { margin-top: var(--s-4); font-size: var(--t-body); }

/* ── form ── */
.form { display: grid; gap: var(--s-4); }
.form__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4) var(--s-3); }
.form__intro { font-size: var(--t-sm); }

.field { display: grid; gap: 0.5rem; align-content: start; }
.field > label,
.field > legend,
.group > legend {
  font-size: var(--t-sm);
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
}
.req { color: var(--orange); font-weight: 600; }
.opt { font-weight: 400; }

.input {
  width: 100%;
  min-height: 3rem;
  padding: 0.8rem 0.95rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--orange-ink);
  font: 400 1rem/1.4 var(--f-text);
  letter-spacing: -0.006em;
  transition: border-color var(--d-fast) var(--e-out), box-shadow var(--d-fast) var(--e-out);
}
.input::placeholder { color: rgb(204 53 16 / 0.62); opacity: 1; }
textarea.input { min-height: 7.5rem; resize: vertical; }
select.input {
  appearance: none;
  padding-right: 2.75rem;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23CC3510' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 0.8rem;
}
select.input:invalid { color: rgb(204 53 16 / 0.62); }
select.input option { color: var(--orange-ink); }
@media (hover: hover) and (pointer: fine) {
  .input:hover { border-color: var(--orange-ink); }
}
.input:focus-visible {
  outline: 2px solid var(--orange-ink);
  outline-offset: 1px;
  border-color: var(--orange-ink);
}
.input[aria-invalid="true"] {
  border-color: var(--orange-press);
  box-shadow: inset 0 0 0 1px var(--orange-press);
  background-color: rgb(255 77 46 / 0.04);
}

.field__err {
  display: flex;
  gap: 0.45rem;
  align-items: baseline;
  font-size: var(--t-sm);
  font-weight: 600;
  color: var(--orange-press);
}
.field__err::before { content: "!"; font-family: var(--f-mono); font-weight: 700; }
.field__err[hidden] { display: none; }

/* ── option tiles: checkboxes as ruled tiles, an orange port when ticked ── */
.group { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 0.75rem; }
.group > legend { padding: 0; margin-bottom: 0.75rem; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
.tile {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 3rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font-size: var(--t-sm);
  line-height: 1.35;
  cursor: pointer;
  transition: border-color var(--d-fast) var(--e-out), background-color var(--d-fast) var(--e-out), transform var(--d-fast) var(--e-out);
}
.tile:active { transform: scale(0.985); }
.tile:has(:checked) { border-color: var(--orange-ink); background: rgb(255 77 46 / 0.06); }
.tile:has(:focus-visible) { outline: 2px solid var(--orange-ink); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) {
  .tile:hover { border-color: var(--orange-ink); }
}
.group[aria-invalid="true"] .tile { border-color: var(--orange-press); }

.check {
  flex: none;
  appearance: none;
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  border: 1.5px solid var(--orange-ink);
  border-radius: 1px;
  background: var(--white);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background-color var(--d-fast) var(--e-out);
}
.check::after {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  background: var(--white);
  transform: scale(0);
  transition: transform var(--d-fast) var(--e-out);
}
.check:checked { background: var(--orange-ink); }
.check:checked::after { transform: scale(1); }
.check:focus-visible { outline: 2px solid var(--orange-ink); outline-offset: 2px; }

.field > .consent { display: flex; gap: 0.75rem; align-items: flex-start; font-size: var(--t-sm); font-weight: 400; line-height: 1.5; cursor: pointer; }
.consent .check { margin-top: 0.18rem; }
.consent[aria-invalid="true"] .check { border-color: var(--orange-press); box-shadow: 0 0 0 1px var(--orange-press); }

/* spam trap: off screen, out of the tab order */
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form__foot {
  display: grid;
  gap: var(--s-2);
  padding-top: var(--s-3);
  border-top: 1px solid var(--line);
}
.form__send { justify-self: start; font-size: 1.0625rem; }
.form__send[disabled] { opacity: 0.6; cursor: progress; transform: none; }
.form__status { font-size: var(--t-sm); font-weight: 600; min-height: 1.4em; }
.form__status:empty { min-height: 0; }

/* ── sent: shown in place by contact.js, or by :target after the
   no-JS redirect lands on contact.html?sent=1#sent ── */
.sent { display: none; padding: var(--s-5) 0; border-top: 1px solid var(--line-strong); }
.sent:target,
.sent.is-on { display: block; }
.sent:target ~ .form,
.connect.is-sent .form { display: none; }
.sent__t {
  font-family: var(--f-display);
  font-size: var(--t-h2);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: var(--tr-head);
  color: var(--display);
}
.sent p { margin-top: var(--s-3); font-size: var(--t-lead); line-height: 1.6; max-width: 46ch; }
.sent .link { margin-top: var(--s-4); }

@media (max-width: 900px) {
  .connect { grid-template-columns: minmax(0, 1fr); }
  .connect__intro { position: static; }
}
@media (max-width: 560px) {
  .form__row, .tiles { grid-template-columns: minmax(0, 1fr); }
  .form__send { justify-self: stretch; }
  .form__send .btn__label { flex: 1; justify-content: center; }
}

/* ═══════════════ LEGAL ═══════════════
   Long-form reading: a 64ch measure, display-face section heads,
   a hairline between sections. */
.legal {
  display: grid;
  grid-template-columns: minmax(0, 0.42fr) minmax(0, 1fr);
  gap: var(--s-4) var(--s-6);
  align-items: start;
}
.legal__head { position: sticky; top: var(--s-5); }
.legal__date { margin-top: var(--s-3); }
.legal__toc { margin-top: var(--s-4); display: grid; gap: 0.35rem; font-size: var(--t-sm); }
.legal__toc a { display: inline-block; padding-block: 0.15rem; }
@media (hover: hover) and (pointer: fine) {
  .legal__toc a:hover { text-decoration: underline; text-underline-offset: 0.2em; }
}

.prose { max-width: 64ch; }
.prose > section { padding-block: var(--s-4); border-top: 1px solid var(--line); }
.prose > section:first-child { border-top: 0; padding-top: 0; }
.prose h2 {
  font-family: var(--f-display);
  font-size: clamp(1.2rem, 1.05rem + 0.5vw, 1.5rem);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: var(--tr-head);
  color: var(--orange-ink);
  scroll-margin-top: var(--s-4);
}
.prose p, .prose li { font-size: var(--t-body); line-height: 1.7; text-wrap: pretty; }
.prose p { margin-top: var(--s-2); }
.prose ul { margin-top: var(--s-2); display: grid; gap: 0.4rem; }
.prose li { position: relative; padding-left: 1.3rem; }
.prose li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 0.4rem;
  height: 0.4rem;
  background: var(--orange);
}
.prose strong { font-weight: 600; }
.prose .link { font-weight: 600; }

@media (max-width: 900px) {
  .legal { grid-template-columns: minmax(0, 1fr); }
  .legal__head { position: static; }
  .legal__toc { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .input, .tile, .check, .check::after { transition-duration: 0.01ms !important; }
}
