/* The casting form, set in the tommyvandyke.com house style (CoyoteBloc design system, Night).
   Values are copied from the site's design-system/tokens.json and site.css; if the site's tokens
   change, update them here too. The fonts are the site's own files, bundled in talent/fonts/. */

@font-face {
  font-family: "Newsreader";
  src: url("/talent/fonts/Newsreader-opsz.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("/talent/fonts/Newsreader-opsz-italic.woff2") format("woff2");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Hanken Grotesk";
  src: url("/talent/fonts/HankenGrotesk-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* color: Night, the theme the site ships */
  --surface: #1b1815;
  --surface-raised: #24201c;
  --line: #3a332c;
  --line-strong: #7a6e62;
  --ink: #ede6da;
  --ink-muted: #b3a797;
  --on-ink: #1b1815;
  --wingate: #d4715e;
  --focus-ring: 0 0 0 2px #1b1815, 0 0 0 4px #ede6da;
  color-scheme: dark;

  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;

  --type-title: 300 34px/42px var(--serif);
  --type-heading: 400 22px/30px var(--serif);
  --type-lede: 300 20px/32px var(--serif);
  --type-body: 400 17px/28px var(--serif);
  --type-eyebrow: 500 11px/16px var(--sans);
  --type-ui: 500 14px/20px var(--sans);
  --rail-name: 500 12px/28px var(--sans);
  --small-print: 400 12px/28px var(--sans);

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-7: 28px;
  --space-8: 32px;
  --space-12: 48px;
  --space-14: 56px;
  --space-16: 64px;
  --gutter: var(--space-8);
  --top-h: 60px;
  --page-max: 1320px;
}

@media (max-width: 640px) {
  :root {
    --gutter: var(--space-4);
    --type-title: 300 28px/36px var(--serif);
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--surface);
  /* Focus and jumps land clear of the sticky top bar (WCAG 2.4.11), as on the site under 1024px. */
  scroll-padding-top: calc(var(--top-h) + var(--space-4));
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font: var(--type-body);
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, p { margin: 0; }
h1, h2 { text-wrap: balance; }
p { text-wrap: pretty; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Keyboard focus: a gap in the ground, then solid ink. */
a:focus-visible,
button:focus-visible,
.btn:focus-within {
  outline: 2px solid transparent;
  outline-offset: 2px;
  box-shadow: var(--focus-ring);
}

/* ---------- the top bar: TVD and the name, as on the site under 1024px ---------- */

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  height: var(--top-h);
  padding-inline: max(var(--gutter), env(safe-area-inset-left, 0px)) max(var(--gutter), env(safe-area-inset-right, 0px));
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.rail-id {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--ink);
  text-decoration: none;
}

.tvd {
  display: block;
  height: 32px;
  width: auto;
  aspect-ratio: 277 / 320;
  color: var(--ink);
}

.rail-name {
  font: var(--rail-name);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ---------- the page ---------- */

.main {
  padding: var(--space-12) var(--gutter) var(--space-12);
  padding-inline: max(var(--gutter), env(safe-area-inset-left, 0px)) max(var(--gutter), env(safe-area-inset-right, 0px));
}

/* Full width up to the site's page-max, on a two-column grid: a section's name and note on the
   left, its fields on the right (like About: the portrait beside the words). Stacks on a phone. */
.page {
  max-width: var(--page-max);
  display: flex;
  flex-direction: column;
  gap: var(--space-14);
}

.page-head,
.group {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: var(--space-6) var(--space-12);
  align-items: start;
}

.page-head { align-items: end; }

.head-main {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

@media (max-width: 900px) {
  .page-head,
  .group {
    grid-template-columns: minmax(0, 1fr);
  }
  .page-head { gap: var(--space-4); }
  .group-send .group-side { display: none; }
}

.eyebrow {
  font: var(--type-eyebrow);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

h1 {
  font: var(--type-title);
  letter-spacing: -0.005em;
}

/* "Project | Role", colored like "Client | Title" on the site */
h1 .bar { color: var(--line-strong); }
h1 .t { color: var(--ink-muted); }

.lede {
  font: var(--type-lede);
  color: var(--ink);
  max-width: 58ch;
}

.page-head .actions { margin-top: var(--space-6); }

form {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}

/* A group: its name as a small serif heading, like the sections on About. No boxes. */
.group {
  padding-top: var(--space-8);
  border-top: 1px solid var(--line);
}

.group-side {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.group-side .field-note { max-width: 36ch; font-size: 13px; line-height: 20px; }

.group-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  min-width: 0;
}

.group-head {
  font: var(--type-heading);
}

/* ---------- Field: an underline, a small caps label above, a note below ---------- */

.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
}

.field-label {
  font: 500 12px/16px var(--sans);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.opt {
  margin-left: var(--space-2);
  text-transform: none;
  letter-spacing: 0.02em;
  color: var(--ink-muted);
}

.field input,
.field select,
.field textarea {
  appearance: none;
  width: 100%;
  margin: 0;
  padding: var(--space-2) 0;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: 400 19px/28px var(--serif);
  resize: vertical;
}

.field select {
  min-height: 45px;
  padding-right: var(--space-6);
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-muted) 50%),
    linear-gradient(135deg, var(--ink-muted) 50%, transparent 50%);
  background-position: calc(100% - 9px) 50%, calc(100% - 4px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

.field select option { background: var(--surface-raised); color: var(--ink); }

.field input::placeholder,
.field textarea::placeholder { color: var(--ink-muted); }

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid transparent; /* high contrast mode drops the shadow and draws this instead */
  border-bottom-color: var(--ink);
  box-shadow: 0 1px 0 0 var(--ink);
}

.field[data-error] input,
.field[data-error] textarea { border-bottom-color: var(--wingate); }
.field-error { color: var(--wingate); }

.field-note {
  font: 400 12px/16px var(--sans);
  letter-spacing: 0.02em;
  color: var(--ink-muted);
}

.row-2,
.row-3 {
  display: grid;
  gap: var(--space-6);
}
.row-2 { grid-template-columns: 1fr 1fr; }


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

@media (max-width: 560px) {
  .row-2 { grid-template-columns: 1fr; }
  .row-3 { grid-template-columns: 1fr 1fr; }
  .row-3 > :last-child { grid-column: 1 / -1; }
}

/* ---------- Dropdown: "Submitting for". Drawn by the page, since a native select ignores the
   page's type. Closed it's a field; open, a panel of rows grouped under each project. ---------- */

.dropdown { position: relative; }

.dropdown-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  width: 100%;
  min-height: 45px;
  padding: var(--space-2) 0;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: 400 19px/28px var(--serif);
  text-align: left;
  cursor: pointer;
}
.dropdown-button:focus-visible,
.dropdown-button[aria-expanded="true"] {
  outline: 2px solid transparent;
  border-bottom-color: var(--ink);
  box-shadow: 0 1px 0 0 var(--ink);
}
.field[data-error] .dropdown-button { border-bottom-color: var(--wingate); }
.dropdown-value { min-width: 0; overflow-wrap: anywhere; }
.dropdown-value.is-placeholder { color: var(--ink-muted); }

/* A 1px chevron, square ends. */
.dropdown-caret {
  flex: none;
  width: 8px;
  height: 8px;
  margin: 0 4px 4px 0;
  border-right: 1px solid var(--ink-muted);
  border-bottom: 1px solid var(--ink-muted);
  transform: rotate(45deg);
  transition: transform 0.2s ease-out;
}
.dropdown-button[aria-expanded="true"] .dropdown-caret { transform: translateY(4px) rotate(225deg); }

.dropdown-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + var(--space-1));
  z-index: 20;
  border: 1px solid var(--line-strong);
  background: var(--surface-raised);
}

.field .dropdown-search {
  display: block;
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font: var(--type-ui);
  font-size: 16px; /* under 16px, iOS zooms the page in when the box takes focus */
  letter-spacing: 0.02em;
}
/* iOS zooms into any field under 16px when it's tapped; every field here is 16px or more on a phone. */
@media (max-width: 900px), (pointer: coarse) {
  .field .dropdown-search { font-size: 16px; line-height: 22px; }
}
.field .dropdown-search:focus { outline: none; border-bottom-color: var(--line); box-shadow: inset 0 -1px 0 0 var(--ink); }
.dropdown-search::placeholder { color: var(--ink-muted); }

.dropdown-list {
  max-height: min(360px, 50vh);
  margin: 0;
  padding: var(--space-2) 0;
  overflow-y: auto;
  list-style: none;
  outline: none;
}

.dropdown-group {
  padding: var(--space-4) var(--space-4) var(--space-1);
  font: var(--type-eyebrow);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.dropdown-group:first-child { padding-top: var(--space-2); }

.dropdown-option {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: var(--space-2) var(--space-12) var(--space-2) var(--space-4);
  font: 400 17px/24px var(--serif);
  color: var(--ink);
  cursor: pointer;
}
.dropdown-option.is-active { background: var(--line); }

/* The chosen one carries a 1px check on the right. */
.dropdown-option[aria-selected="true"]::after {
  content: "";
  position: absolute;
  right: var(--space-4);
  top: 50%;
  width: 10px;
  height: 5px;
  border-left: 1.5px solid var(--ink);
  border-bottom: 1.5px solid var(--ink);
  transform: translateY(-70%) rotate(-45deg);
}

.dropdown-empty {
  padding: var(--space-3) var(--space-4);
  font: var(--type-ui);
  color: var(--ink-muted);
}

/* ---------- Pick: a short set of square buttons (gender) ---------- */

.pick { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.pick input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}
.pick label { position: relative; cursor: pointer; }
.pick span {
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 var(--space-4);
  border: 1px solid var(--line-strong);
  font: var(--type-ui);
  letter-spacing: 0.02em;
  color: var(--ink);
  transition: background-color 0.25s ease-out, color 0.25s ease-out, border-color 0.25s ease-out;
}
.pick label:hover span { border-color: var(--ink); }
.pick input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.pick input:focus-visible + span { outline: 2px solid transparent; outline-offset: 2px; box-shadow: var(--focus-ring); }

/* ---------- Toggle: a slim pill, outlined off, ink on ---------- */

.toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 44px;
  cursor: pointer;
  font: var(--type-ui);
  letter-spacing: 0.02em;
}

.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }

.toggle-track {
  position: relative;
  flex: none;
  width: 40px;
  height: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 9999px;
  transition: background-color 0.2s ease-out, border-color 0.2s ease-out;
}

.toggle-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 9999px;
  background: var(--line-strong);
  transition: transform 0.2s ease-out, background-color 0.2s ease-out;
}

.toggle input:checked + .toggle-track { background: var(--ink); border-color: var(--ink); }
.toggle input:checked + .toggle-track .toggle-knob { transform: translateX(16px); background: var(--on-ink); }
.toggle input:focus-visible + .toggle-track { outline: 2px solid transparent; outline-offset: 2px; box-shadow: var(--focus-ring); }

/* ---------- Photos: portrait frames, no boxes ---------- */

.photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(140px, 28%), 1fr));
  gap: var(--space-4) var(--space-2);
}
.photos:empty { display: none; }

.photo { display: flex; flex-direction: column; gap: var(--space-2); }

.photo-frame {
  aspect-ratio: 4 / 5;
  background: var(--surface-raised);
  overflow: hidden;
}

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

.remove {
  align-self: flex-start;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  font: 400 12px/28px var(--sans);
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  text-decoration-color: var(--line-strong);
}
.remove:hover { color: var(--wingate); text-decoration-color: currentColor; }

/* ---------- Button: ink rectangle, inverts on hover. Quiet is an outline. ---------- */

.btn {
  appearance: none;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 var(--space-6);
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--ink);
  color: var(--on-ink);
  font: var(--type-ui);
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.25s ease-out, color 0.25s ease-out, border-color 0.25s ease-out;
}
.btn:hover { background: transparent; color: var(--ink); }
.btn-quiet { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-quiet:hover { border-color: var(--ink); }
.btn[disabled] { opacity: 0.45; cursor: progress; }
.btn[disabled]:hover { background: var(--ink); color: var(--on-ink); }

.add-photos { align-self: flex-start; }
.add-photos input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }

/* ---------- consent, errors, the end ---------- */

.consent {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  font: 400 15px/24px var(--serif);
  color: var(--ink-muted);
  max-width: 58ch;
  cursor: pointer;
}

.consent input {
  appearance: none;
  flex: none;
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: transparent;
  display: grid;
  place-content: center;
  cursor: pointer;
}
.consent input::after {
  content: "";
  width: 10px;
  height: 6px;
  border-left: 1.5px solid var(--on-ink);
  border-bottom: 1.5px solid var(--on-ink);
  transform: translateY(-1px) rotate(-45deg);
  opacity: 0;
}
.consent input:checked { background: var(--ink); border-color: var(--ink); }
.consent input:checked::after { opacity: 1; }
.consent input:focus-visible { outline: 2px solid transparent; box-shadow: var(--focus-ring); }

.error {
  font: 500 13px/20px var(--sans);
  letter-spacing: 0.02em;
  color: var(--wingate);
}
.error:empty { display: none; }

.actions { display: flex; gap: var(--space-4); }

/* The spam-catcher: off screen and invisible, so neither people nor autofill fill it in. */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; visibility: hidden; }

/* A photo the browser couldn't open: marked where it sits, with what to do. */
.photo.is-bad .photo-frame { outline: 1px solid var(--wingate); outline-offset: -1px; }
.photo-status { font: 400 12px/16px var(--sans); letter-spacing: 0.02em; color: var(--ink-muted); }
.photo.is-bad .photo-status { color: var(--wingate); }
.photo-frame.is-loading { animation: photo-wait 1.2s ease-in-out infinite alternate; }
@keyframes photo-wait { from { opacity: 0.5; } to { opacity: 1; } }

/* Why the "under 18" switch came on by itself. */
.minor-why { color: var(--ink); }

.small-print {
  max-width: var(--page-max);
  margin-top: var(--space-16);
  padding-top: var(--space-4);
  border-top: 1px solid var(--line);
  font: var(--small-print);
  letter-spacing: 0.04em;
  color: var(--ink-muted);
}

.small-print a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  text-decoration-color: var(--line-strong);
  transition: color 0.25s ease-out, text-decoration-color 0.25s ease-out;
}
.small-print a:hover { color: var(--wingate); text-decoration-color: currentColor; }

@media (prefers-reduced-motion: reduce) {
  .btn, .toggle-track, .toggle-knob, .small-print a, .remove { transition: none; }
  .photo-frame.is-loading { animation: none; }
}
