:root {
  color-scheme: light;
  --cream: #fefff4;
  --white: #ffffff;
  --ink: #16130f;
  --brown: #3d301f;
  --green: #163c24;
  --green-light: #dce9df;
  --muted: #625d55;
  --line: #3d392f;
  --error: #9a2b1f;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 0;
  overflow-x: hidden;
  background: var(--white);
}

body {
  min-width: 0;
  margin: 0;
  overflow-x: hidden;
  background: var(--white);
  color: var(--ink);
  font-family: 'Work Sans', sans-serif;
  font-size: 17px;
  font-weight: 300;
  line-height: 1.6;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
input,
select,
textarea,
a {
  -webkit-tap-highlight-color: transparent;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-underline-offset: 0.2em;
}

[hidden] {
  display: none !important;
}

.site-header {
  border-bottom: 1px solid #e5e3d4;
  background: var(--cream);
}

.site-header__inner {
  width: min(100% - 32px, 1120px);
  margin: 0 auto;
  padding: 20px 0 30px;
}

.back-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  font-size: 14px;
  font-weight: 500;
}

.logo-link {
  display: block;
  width: min(100%, 220px);
  margin: 20px auto 0;
}

.site-logo {
  width: 100%;
  height: auto;
}

.page-shell {
  width: min(100% - 32px, 680px);
  margin: 0 auto;
  padding: 52px 0 72px;
}

.intro {
  margin-bottom: 52px;
}

h1,
h2,
h3 {
  margin-top: 0;
  font-family: 'Archivo Black', sans-serif;
  font-weight: 400;
  line-height: 1.08;
}

h1 {
  max-width: 620px;
  margin-bottom: 24px;
  font-size: clamp(36px, 10vw, 58px);
  overflow-wrap: anywhere;
}

h2 {
  margin-bottom: 12px;
  font-size: clamp(28px, 7vw, 38px);
}

h3 {
  margin-bottom: 10px;
  font-size: 20px;
}

.intro__lead {
  margin: 0;
  font-size: 19px;
  line-height: 1.65;
}

.review-note {
  margin: 24px 0 0;
  padding: 15px 18px;
  border-left: 5px solid var(--green);
  background: var(--green-light);
  font-weight: 500;
}

.form-section {
  border-top: 8px solid var(--brown);
  padding-top: 34px;
}

.required-note {
  margin: 0 0 34px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
}

.required-note span,
.required-marker {
  color: var(--error);
}

#photoForm {
  display: grid;
  gap: 34px;
}

.form-field {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.form-field > label,
.form-field > legend,
.label-row label {
  display: block;
  margin: 0 0 9px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
}

.optional {
  color: var(--muted);
  font-weight: 300;
}

input[type='text'],
input[type='email'],
select,
textarea {
  display: block;
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--white);
  color: var(--ink);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
}

textarea {
  min-height: 142px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #777168;
  opacity: 1;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible,
a:focus-visible,
[tabindex='-1']:focus-visible {
  outline: 3px solid #2f7c48;
  outline-offset: 3px;
}

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

.field-help {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
}

.photo-fieldset > .field-help {
  margin: 0 0 14px;
}

.field-error {
  margin: 8px 0 0;
  color: var(--error);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
}

.error-summary {
  padding: 22px;
  border: 2px solid var(--error);
  background: #fff8f6;
}

.error-summary p {
  margin: 0;
}

.error-summary ul {
  margin: 12px 0 0;
  padding-left: 22px;
}

.error-summary a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  font-weight: 500;
}

.drop-zone {
  display: grid;
  justify-items: center;
  padding: 24px 16px;
  border: 1px dashed var(--line);
  background: var(--cream);
  text-align: center;
}

.drop-zone.is-dragging {
  border-color: var(--green);
  background: var(--green-light);
  box-shadow: inset 0 0 0 2px var(--green);
}

.drop-zone[aria-invalid='true'] {
  border-color: var(--error);
  box-shadow: inset 0 0 0 1px var(--error);
}

.drop-zone__badge {
  width: 64px;
  height: 64px;
  margin-bottom: 12px;
}

.drop-zone__copy p {
  margin: 0;
}

.drop-zone__copy .drop-zone__hint {
  margin-top: 2px;
  color: var(--muted);
  font-size: 14px;
}

/* Phones can't drag files, so they get copy without "drop". */
.drop-zone__touch {
  display: none;
}

.drop-zone__actions {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

/* Compound selector so it outranks .file-picker's display, which comes later in the file. */
.file-picker.camera-picker {
  display: none;
}

@media (pointer: coarse) {
  .drop-zone__fine {
    display: none;
  }

  .drop-zone__touch {
    display: block;
  }

  .drop-zone__actions {
    width: min(100%, 280px);
  }

  .file-picker.camera-picker {
    display: flex;
  }

  /* The camera is the main action on a phone; choosing existing photos is secondary. */
  .camera-picker + .file-picker {
    border: 1px solid var(--green);
    background: var(--white);
    color: var(--green);
  }
}

.file-picker {
  position: relative;
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 10px 22px;
  overflow: hidden;
  background: var(--green);
  color: var(--white);
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
}

.file-picker:focus-within {
  outline: 3px solid #2f7c48;
  outline-offset: 3px;
}

.file-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  opacity: 0;
}

.photo-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.photo-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  border: 1px solid #c8c4ba;
  background: var(--white);
}

.photo-preview {
  position: relative;
  display: grid;
  aspect-ratio: 1;
  place-items: center;
  overflow: hidden;
  background: #ecebe5;
}

.photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-placeholder {
  padding: 10px;
  overflow-wrap: anywhere;
  color: var(--brown);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  text-align: center;
}

.photo-meta {
  min-width: 0;
  padding: 9px 10px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
}

.photo-name {
  display: block;
  overflow: hidden;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-size {
  display: block;
  color: var(--muted);
}

.remove-photo {
  width: 100%;
  min-height: 44px;
  padding: 8px;
  border: 0;
  border-top: 1px solid #c8c4ba;
  border-radius: 0;
  background: var(--white);
  color: var(--error);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}

.remove-photo:hover {
  background: #fff4f1;
}

.label-row {
  display: flex;
  gap: 12px;
  align-items: baseline;
  justify-content: space-between;
}

.character-count {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

.prefixed-input {
  display: flex;
  min-height: 50px;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--white);
}

.prefixed-input > span {
  padding-left: 14px;
  color: var(--muted);
  font-weight: 500;
}

.prefixed-input input {
  min-width: 0;
  border: 0;
  box-shadow: none;
}

.prefixed-input:focus-within {
  outline: 3px solid #2f7c48;
  outline-offset: 3px;
}

.prefixed-input.has-error {
  border-color: var(--error);
  box-shadow: 0 0 0 1px var(--error);
}

.permission-fieldset {
  padding: 22px;
  border: 1px solid var(--brown);
  background: var(--cream);
}

.permission-fieldset > legend {
  padding: 0 8px;
  background: var(--cream);
  font-family: 'Archivo Black', sans-serif;
  font-size: 19px;
  font-weight: 400;
}

/* .form-field > label would otherwise win and make this a bold block. */
.form-field > .checkbox-label {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  cursor: pointer;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.55;
}

.checkbox-label input {
  width: 22px;
  height: 22px;
  margin: 2px 0 0;
  accent-color: var(--green);
}

.honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.turnstile-mount {
  min-height: 65px;
  max-width: 100%;
  overflow-x: auto;
}

.turnstile-widget {
  max-width: 100%;
}

.upload-status {
  padding: 20px;
  border: 1px solid var(--green);
  background: #f5faf6;
}

.upload-status > p {
  margin: 0 0 14px;
  font-weight: 500;
}

.progress-item + .progress-item {
  margin-top: 14px;
}

.progress-label {
  display: flex;
  min-width: 0;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 400;
}

.progress-label span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

progress {
  display: block;
  width: 100%;
  height: 12px;
  accent-color: var(--green);
}

.primary-button {
  min-height: 58px;
  padding: 16px 30px;
  border: 1px solid var(--green);
  border-radius: 0;
  background: var(--green);
  color: var(--white);
  cursor: pointer;
  font-size: 17px;
  font-weight: 500;
}

.primary-button:hover {
  background: #0d2c18;
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.submit-button {
  width: 100%;
}

#photoForm.is-submitting .drop-zone {
  opacity: 0.65;
}

.result-panel {
  padding: 30px 24px;
  background: var(--brown);
  color: var(--white);
}

.result-panel p {
  margin: 0;
}

.result-panel p + p {
  margin-top: 14px;
}

.result-button {
  margin-top: 24px;
  border-color: var(--white);
}

.site-footer {
  background: var(--brown);
  color: var(--white);
}

.site-footer__inner {
  width: min(100% - 32px, 1120px);
  margin: 0 auto;
  padding: 30px 0;
  font-size: 14px;
  font-weight: 400;
}

.site-footer p {
  margin: 0 0 12px;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
}

.site-footer nav a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
}

.is-embedded .site-header,
.is-embedded .site-footer {
  display: none;
}

.is-embedded .page-shell {
  padding-top: 24px;
  padding-bottom: 24px;
}

@media (min-width: 600px) {
  .site-header__inner {
    padding-top: 24px;
    padding-bottom: 38px;
  }

  .page-shell {
    padding-top: 72px;
    padding-bottom: 96px;
  }

  .drop-zone {
    grid-template-columns: 76px minmax(0, 1fr) auto;
    justify-items: start;
    align-items: center;
    gap: 18px;
    padding: 24px;
    text-align: left;
  }

  .drop-zone__badge {
    width: 76px;
    height: 76px;
    margin: 0;
  }

  .drop-zone__actions {
    margin: 0;
  }

  .photo-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .submit-button {
    width: auto;
    min-width: 210px;
    justify-self: start;
  }

  .result-panel {
    padding: 42px;
  }

  .site-footer__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .site-footer p {
    margin: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
