:root {
  --newsprint: #f4f1e9;
  --paper: #fffef9;
  --sand: #ece7d9;
  --ink: #141210;
  --ink-soft: #4b463f;
  --ink-faint: #7a736a;
  --line-soft: #d7d0c1;
  --amber: #f5a300;
  --amber-wash: #fbe7bd;
  --pine: #0f5257;
  --pine-dark: #0b3e42;
  --pine-wash: #dbe8e7;
  --rust: #c0442b;
  --success: #2f7d54;
  --border: 2px solid var(--ink);
  --shadow: 6px 6px 0 var(--ink);
  --shadow-small: 3px 3px 0 var(--ink);
  --radius: 14px;
  --font-display: "Arial Rounded MT Bold", "Trebuchet MS", sans-serif;
  --font-body: "Avenir Next", Avenir, "Trebuchet MS", sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  min-width: 20rem;
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(rgba(20, 18, 16, 0.035) 1px, transparent 1px),
    var(--newsprint);
  background-size: 100% 2rem;
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.55;
}

button, input, textarea { font: inherit; }

a { color: var(--pine); font-weight: 700; text-underline-offset: 0.16em; }
a:hover { color: var(--pine-dark); }

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

.skip-link {
  position: fixed;
  z-index: 20;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.75rem 1rem;
  border: var(--border);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow-small);
  transform: translateY(-150%);
}

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

.site-mark {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(100% - 2rem, 75rem);
  margin: 0 auto;
  padding: 1.25rem 0;
}

.site-mark__link {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  color: var(--ink);
  text-decoration: none;
}

.site-mark__badge {
  display: grid;
  place-items: center;
  width: 2.8rem;
  height: 2.8rem;
  border: var(--border);
  border-radius: 9px;
  background: var(--amber);
  box-shadow: var(--shadow-small);
  font-family: var(--font-display);
  font-weight: 900;
}

.site-mark strong, .site-mark small { display: block; }
.site-mark strong { font-family: var(--font-display); font-size: 1.05rem; letter-spacing: 0.02em; text-transform: uppercase; }
.site-mark small { color: var(--ink-faint); font-size: 0.72rem; }

.site-mark__status {
  border: 1px solid var(--pine);
  border-radius: 999px;
  background: var(--pine-wash);
  color: var(--pine-dark);
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.45rem 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

main {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(34rem, 1.2fr);
  align-items: start;
  gap: clamp(2rem, 5vw, 5rem);
  width: min(100% - 2rem, 75rem);
  margin: 2rem auto 5rem;
}

.intro {
  position: sticky;
  top: 2rem;
  padding: clamp(1rem, 3vw, 2.5rem) 0;
}

.eyebrow {
  margin: 0 0 0.7rem;
  color: var(--pine);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1, h2 {
  font-family: var(--font-display);
  line-height: 1.02;
  letter-spacing: -0.035em;
}

h1 {
  max-width: 10ch;
  margin: 0;
  font-size: clamp(3rem, 6vw, 5.4rem);
  text-transform: uppercase;
}

.intro__lede {
  max-width: 35rem;
  margin: 1.5rem 0 2rem;
  color: var(--ink-soft);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
}

.process-note {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.9rem 1rem;
  max-width: 34rem;
  border-top: var(--border);
  padding-top: 1.25rem;
}

.process-note span {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border: var(--border);
  border-radius: 50%;
  background: var(--amber-wash);
  font-size: 0.72rem;
  font-weight: 900;
}

.process-note p { margin: 0; color: var(--ink-soft); font-size: 0.92rem; }
.process-note strong { color: var(--ink); }

.form-card {
  position: relative;
  border: var(--border);
  border-radius: 20px;
  background: var(--paper);
  box-shadow: 9px 9px 0 var(--ink);
  padding: clamp(1.25rem, 4vw, 2.6rem);
}

.form-card__tape {
  position: absolute;
  top: -0.9rem;
  left: 50%;
  width: 7rem;
  height: 1.8rem;
  background: color-mix(in srgb, var(--amber-wash) 88%, transparent);
  transform: translateX(-50%) rotate(-2deg);
  opacity: 0.88;
}

.form-card__header { padding-bottom: 1.5rem; border-bottom: 1px solid var(--line-soft); }
.form-card__header h2, .success-state h2 { margin: 0; font-size: clamp(1.9rem, 4vw, 3rem); text-transform: uppercase; }
.form-card__header > p:last-child { margin: 0.75rem 0 0; color: var(--ink-faint); font-size: 0.85rem; }

.legal-note {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.8rem;
  margin: 1.5rem 0;
  border-left: 5px solid var(--amber);
  border-radius: 10px;
  background: var(--amber-wash);
  padding: 1rem;
}

.legal-note__icon {
  display: grid;
  place-items: center;
  width: 1.65rem;
  height: 1.65rem;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--amber);
  font-weight: 900;
}

.legal-note p { margin: 0; font-size: 0.84rem; }

form { display: grid; gap: 1.4rem; }
.field { display: grid; gap: 0.4rem; min-width: 0; }
.field-row { display: grid; grid-template-columns: 1fr 0.55fr; gap: 1rem; }

label, .field-label {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 850;
}

label > span { color: var(--rust); }
label em, .field-label em { color: var(--ink-faint); font-size: 0.74rem; font-style: normal; font-weight: 600; text-transform: uppercase; }
.help { margin: 0; color: var(--ink-faint); font-size: 0.78rem; }

input, textarea {
  width: 100%;
  border: var(--border);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  padding: 0.85rem 0.95rem;
  transition: box-shadow 160ms ease, transform 160ms ease, background 160ms ease;
}

textarea { resize: vertical; min-height: 7rem; }
input::placeholder, textarea::placeholder { color: #928b81; }
input:hover, textarea:hover { background: var(--newsprint); }
input:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--pine) 34%, transparent);
  outline-offset: 3px;
}

input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--rust); background: #fff8f5; }
.field-error { min-height: 1.15rem; margin: 0; color: var(--rust); font-size: 0.76rem; font-weight: 700; }
.field-meta { display: flex; justify-content: space-between; gap: 1rem; color: var(--ink-faint); font-size: 0.72rem; }

.upload-button, .secondary-button {
  justify-self: start;
  border: var(--border);
  border-radius: 9px;
  background: var(--paper);
  box-shadow: var(--shadow-small);
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
  padding: 0.7rem 1rem;
}

.upload-button:hover, .secondary-button:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.upload-button:active, .secondary-button:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }

.file-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: 0.8rem; }
.file-card { position: relative; min-width: 0; border: var(--border); border-radius: 10px; background: var(--sand); overflow: hidden; }
.file-card img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-bottom: 2px solid var(--ink); }
.file-card__meta { display: grid; gap: 0.15rem; padding: 0.55rem; }
.file-card__meta strong { overflow: hidden; font-size: 0.7rem; text-overflow: ellipsis; white-space: nowrap; }
.file-card__meta small { color: var(--ink-faint); font-size: 0.65rem; }
.file-card button { position: absolute; top: 0.4rem; right: 0.4rem; display: grid; place-items: center; width: 1.8rem; height: 1.8rem; border: 2px solid var(--ink); border-radius: 50%; background: var(--paper); cursor: pointer; font-weight: 900; }

.form-alert { border: 2px solid var(--rust); border-radius: 10px; background: #fff0eb; color: #7c2517; padding: 0.9rem 1rem; font-size: 0.85rem; font-weight: 700; }
.turnstile-region { display: grid; gap: 0.75rem; border: 2px dashed var(--pine); border-radius: 10px; background: var(--pine-wash); padding: 1rem; }
.turnstile-region p { margin: 0; }

.submit-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  min-height: 3.6rem;
  border: var(--border);
  border-radius: 10px;
  background: var(--amber);
  box-shadow: var(--shadow);
  color: var(--ink);
  cursor: pointer;
  font-weight: 900;
  padding: 0.9rem 1.25rem;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.submit-button:hover:not(:disabled) { background: #ffb213; transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--ink); }
.submit-button:active:not(:disabled) { transform: translate(4px, 4px); box-shadow: 2px 2px 0 var(--ink); }
.submit-button:disabled { cursor: wait; opacity: 0.72; }
.privacy-note { margin: -0.25rem 0 0; color: var(--ink-faint); font-size: 0.76rem; text-align: center; }

.success-state { display: grid; justify-items: start; gap: 1rem; padding: 2rem 0 0; }
.success-state__mark { display: grid; place-items: center; width: 5rem; height: 5rem; border: var(--border); border-radius: 50%; background: var(--pine); box-shadow: var(--shadow); color: var(--paper); font-size: 2.4rem; font-weight: 900; }
.success-state > p { margin: 0; color: var(--ink-soft); }
.reference-box { display: grid; gap: 0.2rem; width: 100%; border: 2px dashed var(--pine); border-radius: 10px; background: var(--pine-wash); padding: 1rem; }
.reference-box span { color: var(--pine-dark); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.reference-box strong { overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.success-state__note { font-size: 0.82rem; }

footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem 2rem;
  width: min(100% - 2rem, 75rem);
  margin: 0 auto;
  border-top: var(--border);
  padding: 1.5rem 0 2rem;
  color: var(--ink-faint);
  font-size: 0.75rem;
}

footer p { margin: 0; }

[hidden] { display: none !important; }

@media (max-width: 58rem) {
  main { grid-template-columns: 1fr; max-width: 44rem; margin-top: 0.5rem; }
  .intro { position: static; padding-bottom: 0; }
  h1 { max-width: 12ch; }
  .process-note { display: none; }
}

@media (max-width: 38rem) {
  .site-mark__status { display: none; }
  main, .site-mark, footer { width: min(100% - 1.25rem, 75rem); }
  .form-card { border-radius: 14px; box-shadow: 6px 6px 0 var(--ink); padding: 1.15rem; }
  .field-row { grid-template-columns: 1fr; }
  .file-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  footer { display: grid; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
