/* ============================================================
   MA & PC — site styles (clean white)
   ============================================================ */

:root {
  --bg: #ffffff;
  --bg-soft: #fafafa;
  --ink: #1d1d1f;
  --ink-soft: #4a4a4e;
  --ink-faint: #86868b;
  --accent: #8a1719;
  --hair: #e7e7e5;
  --field: #fcfcfc;

  --sans: "Inter", system-ui, -apple-system, sans-serif;

  --maxw: 1040px;
  --readw: 680px;
  --formw: 640px;
  --gutter: clamp(1.25rem, 5vw, 3rem);
}

html { -webkit-text-size-adjust: 100%; }

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 1.0625rem;            /* 17px */
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

main { flex: 1 0 auto; padding-top: clamp(2rem, 5vw, 3.5rem); padding-bottom: clamp(2.5rem, 6vw, 4.5rem); }
main > section { width: 100%; max-width: var(--maxw); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }

/* vertically centered pages (cookies, confirmations) */
main.page_center_middle { display: flex; flex-direction: column; }
.middle { flex: 1; display: grid; place-items: center; text-align: center; }
.middle img { border-radius: 8px; }

.eyebrow {
  display: block;
  font-size: 0.74rem; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-faint);
  margin-bottom: 1rem;
}

/* ---------- typography ---------- */
h1, h2, h3, h4, h5 { font-weight: 600; letter-spacing: -0.01em; color: var(--ink); line-height: 1.18; }
h1 { font-size: clamp(2rem, 4.4vw, 3rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.05rem; margin-top: 2rem; }
h5 { font-size: 0.95rem; color: var(--ink-soft); margin-top: 1.3rem; }

p { color: var(--ink-soft); }
p + p { margin-top: 1rem; }
strong { font-weight: 600; color: var(--ink); }

/* content links (prose, page intros) — underlined, accent on hover.
   header/footer/route/button links keep their own colors. */
.prose a:not(.btn), .page-head a:not(.btn), .middle a:not(.btn) { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.prose a:not(.btn):hover, .page-head a:not(.btn):hover, .middle a:not(.btn):hover { color: var(--accent); }

ul { margin: 0.7rem 0 0; padding-left: 1.2rem; list-style: disc; }
li { color: var(--ink-soft); margin-top: 0.3rem; }

hr { border: none; border-top: 1px solid var(--hair); margin: 2rem 0; }

.text_space { margin-top: 1rem; }

/* generic page intro + prose */
.page-head { margin-bottom: clamp(1.5rem, 3vw, 2.2rem); }
.page-head h1, .page-head h2 { margin: 0; max-width: 22ch; }
.page-head p { margin-top: 1.1rem; max-width: 62ch; }
.prose { max-width: var(--readw); }
.prose h4:first-child, .prose h1 + p { margin-top: 0; }

/* long-form policy pages (legal, privacy) — wider, smaller text, airier headings */
.prose.policy { max-width: 820px; }
.policy p, .policy li { font-size: 0.95rem; line-height: 1.8; }
.policy h1 { margin-bottom: 0.5rem; }
.policy h4 { margin-top: 2.8rem; margin-bottom: 0.7rem; }
.policy h5 { margin-top: 2rem; margin-bottom: 0.4rem; }
.policy ul { margin-top: 0.6rem; }
.policy li { margin-top: 0.45rem; }

/* ---------- buttons ---------- */
.btn, button.btn {
  display: inline-block;
  font-family: var(--sans); font-weight: 500; font-size: 0.92rem;
  text-decoration: none; padding: 0.75rem 1.4rem; border-radius: 6px;
  border: 1px solid var(--ink); background: var(--ink); color: #fff;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.btn:hover, button.btn:hover { background: #000; color: #fff; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--hair); }
.btn.ghost:hover { border-color: var(--ink); background: transparent; color: var(--ink); }

/* ---------- header ---------- */
header { background: var(--bg); border-bottom: 1px solid var(--hair); }
header section, header .wrap {
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  max-width: var(--maxw); margin: 0 auto;
  padding: 1.1rem var(--gutter);
}
header .brand { display: flex; flex-direction: column; align-items: center; }
header .brand .mark { font-weight: 900; letter-spacing: -0.035em; font-size: 1.2rem; color: var(--ink); line-height: 1.2; }
header .brand .est { font-size: 0.62rem; letter-spacing: 0.08em; color: var(--ink-faint); }
header nav { display: flex; align-items: center; gap: 1.7rem; }
header nav a { font-size: 0.9rem; font-weight: 500; color: var(--ink-soft); transition: color .15s; }
header nav a:hover { color: var(--ink); }
@media (max-width: 720px) {
  header nav { gap: 1.05rem; }
}

/* ---------- footer ---------- */
footer { background: var(--bg-soft); border-top: 1px solid var(--hair); padding: 2.6rem 0 2.2rem; flex-shrink: 0; }
footer section, footer .wrap {
  display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 2rem;
  max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter);
}
footer .mark { font-weight: 900; letter-spacing: -0.035em; font-size: 1.1rem; }
footer .est { font-size: 0.7rem; color: var(--ink-faint); margin-top: 0.2rem; line-height: 1.5; }
footer .about { font-size: 0.88rem; color: var(--ink-faint); margin: 0.7rem 0 0; max-width: 32ch; line-height: 1.55; }
footer h5 { font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); margin: 0 0 0.8rem; font-weight: 600; }
footer nav { display: flex; flex-direction: column; gap: 0.5rem; }
footer nav a { color: var(--ink-soft); font-size: 0.92rem; }
footer nav a:hover { color: var(--ink); }
footer .colophon {
  grid-column: 1 / -1; border-top: 1px solid var(--hair); margin-top: 1.5rem; padding-top: 1.2rem;
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  font-size: 0.82rem; color: var(--ink-faint);
}
@media (max-width: 720px) {
  footer section, footer .wrap { grid-template-columns: 1fr 1fr; }
  footer section > div { text-align: center; }
  footer .brandcol { grid-column: 1 / -1; }
  footer .about { margin-left: auto; margin-right: auto; }
  footer .colophon { justify-content: center; text-align: center; }
}

/* ---------- homepage hero ---------- */
.hero .wrap { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(1.5rem, 5vw, 4rem); align-items: center; }
.hero h1 { margin: 0; max-width: 20ch; font-weight: 900; letter-spacing: -0.035em; line-height: 1.02; font-size: clamp(3.2rem, 7vw, 5rem); }
.hero .hero-title { width: fit-content; }
.hero .hero-est {
  display: block;
  margin-top: 0.35rem;
  text-align: center;
  font-size: 0.95rem;
  color: var(--ink-faint);
}
.hero .hero-service {
  display: block;
  margin-top: 0.5rem;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 500;
}
.hero .lede { margin-top: 1.4rem; max-width: 46ch; font-size: clamp(1.05rem, 1.3vw, 1.2rem); color: var(--ink-soft); line-height: 1.62; }
.hero .actions { margin-top: 2rem; display: flex; gap: 0.8rem; align-items: center; flex-wrap: wrap; }
.hero .art { justify-self: center; max-width: 420px; width: 100%; }
.hero .art img { width: 100%; height: auto; mix-blend-mode: multiply; }
@media (max-width: 760px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero .art { order: -1; max-width: 300px; margin-bottom: 0.5rem; }
  .hero .hero-copy { text-align: center; }
  .hero .hero-title, .hero h1, .hero .lede { margin-left: auto; margin-right: auto; }
  .hero .actions { justify-content: center; }
}

/* ---------- request routes ---------- */
.routes { border-top: 1px solid var(--hair); margin-top: 1.4rem; }
.route {
  display: grid; grid-template-columns: 1fr auto; gap: 1.5rem; align-items: center;
  padding: clamp(1.3rem, 2.5vw, 1.7rem) 0; border-bottom: 1px solid var(--hair);
  color: inherit;
}
.route h3 { font-size: clamp(1.25rem, 2.2vw, 1.55rem); margin: 0; }
.route p { margin: 0.3rem 0 0; color: var(--ink-soft); font-size: 0.98rem; }
.route .go { font-size: 1.2rem; color: var(--ink-faint); transition: color .15s; }
.route:hover h3, .route:hover .go { color: var(--accent); }
@media (max-width: 640px) { .route .go { display: none; } }

/* signed-in bar */
.session-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  font-size: 0.82rem; color: var(--ink-faint);
  border: 1px solid var(--hair); background: var(--bg-soft); border-radius: 8px;
  padding: 0.6rem 0.95rem; margin-top: 1.8rem;
}
.session-bar a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }

/* ============================================================
   Forms  (IDs/classes kept in sync with js/app.js)
   ============================================================ */
.form { max-width: var(--formw); margin-top: 2rem; }
.form .field { display: flex; flex-direction: column; gap: 0.45rem; }
.form .field + .field,
.form .row + .field,
.form .field + .row,
.form .row + .row { margin-top: 1.3rem; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }

.form label { font-size: 0.82rem; font-weight: 500; color: var(--ink); }
.form label .opt { color: var(--ink-faint); font-weight: 400; }

.form input,
.form textarea {
  font-size: 1rem; color: var(--ink);
  background: var(--field); border: 1px solid var(--hair); border-radius: 6px;
  padding: 0.7rem 0.85rem; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
.form textarea { min-height: 120px; resize: vertical; line-height: 1.6; }
.form input::placeholder, .form textarea::placeholder { color: var(--ink-faint); }
.form input:focus, .form textarea:focus {
  outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(29,29,31,.06);
}
.form input.alert, .form textarea.alert { border-color: var(--accent); }

.form .divider { margin: 2rem 0; }

/* file upload */
.upload { margin-top: 1.8rem; }
.upload input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload .file-btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.9rem; font-weight: 500; color: var(--ink);
  background: transparent; border: 1px dashed #c9c9c5; border-radius: 6px;
  padding: 0.75rem 1.2rem; cursor: pointer; transition: border-color .15s;
}
.upload .file-btn:hover { border-color: var(--ink); }
#request_files_target { margin-top: 0.7rem; font-size: 0.88rem; color: var(--ink-soft); }
#request_files_target p { margin: 0.15rem 0; color: var(--ink-soft); }

.submit-row { margin-top: 2rem; }
#tag_loading { display: none; color: var(--ink-faint); font-size: 0.95rem; margin-left: 0.5rem; }
#alert_message { margin-top: 1rem; color: var(--accent); font-weight: 500; font-size: 0.95rem; min-height: 1.2em; }

@media (max-width: 560px) { .form .row { grid-template-columns: 1fr; gap: 1.3rem; } }

/* ============================================================
   Login wall
   ============================================================ */
.gate { flex: 1; display: grid; place-items: center; padding: clamp(2rem, 6vw, 4rem) 0; }
.gate .panel {
  width: 100%; max-width: 400px;
  border: 1px solid var(--hair); border-radius: 10px; padding: clamp(1.6rem, 4vw, 2.2rem);
}
.gate h2 { font-size: 1.4rem; margin: 0 0 0.4rem; }
.gate .sub { margin: 0 0 1.5rem; color: var(--ink-soft); font-size: 0.95rem; }
.gate .field { display: flex; flex-direction: column; gap: 0.4rem; }
.gate .field + .field { margin-top: 1rem; }
.gate label { font-size: 0.8rem; font-weight: 500; }
.gate input {
  font-size: 1rem; color: var(--ink);
  background: var(--field); border: 1px solid var(--hair); border-radius: 6px;
  padding: 0.7rem 0.85rem; width: 100%;
}
.gate input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(29,29,31,.06); }
.gate .btn { width: 100%; margin-top: 1.4rem; text-align: center; }
.gate .help { margin-top: 1.3rem; font-size: 0.85rem; color: var(--ink-faint); line-height: 1.55; }
.gate #alert_message { text-align: center; }

a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
