/* =========================================================================
   Vietnam Talent Casting VTA — design tokens
   Concept: a casting call sheet for a stop-motion film. Kraft-paper stock,
   clapperboard "slate" numbering, sprocket-hole film perforations as the
   one recurring signature motif. Costume palette borrowed from the actual
   characters: denim overalls, rust-red scarf, brass buttons.
   ========================================================================= */

:root {
  --ink: #23201b;
  --ink-soft: #55503f;
  --paper: #efe9dc;
  --paper-deep: #e4dcc7;
  --card: #fffdf8;
  --line: #d9d0b9;
  --denim: #3b5773;
  --denim-dark: #263e51;
  --rust: #b54a34;
  --rust-dark: #8f3a29;
  --brass: #c9932e;
  --brass-soft: #f1e0b8;
  --green-open: #4b7a52;

  --font-display: "Fraunces", "Times New Roman", serif;
  --font-body: "Be Vietnam Pro", "Segoe UI", system-ui, sans-serif;
  --font-mono: "Space Mono", "SFMono-Regular", Menlo, monospace;

  --radius: 10px;
  --shadow-card: 0 1px 0 var(--line), 0 8px 20px -12px rgba(35, 32, 27, 0.35);
  --container: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--paper);
  background-image:
    radial-gradient(circle at 1px 1px, rgba(35,32,27,0.05) 1px, transparent 0);
  background-size: 22px 22px;
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
button { font-family: inherit; }

a { color: var(--denim-dark); }

.wrap {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

/* focus visibility (accessibility floor) */
:focus-visible {
  outline: 3px solid var(--brass);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* -------------------------------------------------------------------------
   Signature motif: sprocket-hole film perforation strip
   ------------------------------------------------------------------------- */
.sprocket-strip {
  height: 14px;
  background-image: radial-gradient(circle, var(--paper) 3.5px, transparent 3.6px);
  background-size: 26px 14px;
  background-position: 13px 0;
  background-color: var(--ink);
}
.sprocket-strip.on-paper { background-color: var(--denim-dark); }

/* -------------------------------------------------------------------------
   Header / slate
   ------------------------------------------------------------------------- */
.site-header {
  background: var(--ink);
  color: var(--paper);
  padding-left: 10px;
  padding-right: 10px;
}

.slate-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  flex-wrap: wrap;
}
@media (max-width: 600px) {
  .slate-bar { justify-content: center; text-align: center; }
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.brand .mark {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--brass);
  border: 1px solid var(--brass);
  padding: 3px 7px;
  border-radius: 4px;
  text-transform: uppercase;
}

.brand h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(20px, 3vw, 28px);
  margin: 0;
  letter-spacing: 0.01em;
}

.brand small {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: #b8ad93;
  text-transform: uppercase;
  margin-top: 2px;
}

.lang-toggle {
  display: inline-flex;
  background: #33302a;
  border-radius: 999px;
  padding: 4px;
  gap: 2px;
}

.lang-toggle button {
  border: none;
  background: transparent;
  color: #cfc7b3;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s ease, color 0.15s ease;
}

.lang-toggle button.active {
  background: var(--brass);
  color: var(--ink);
}

.lang-toggle button:hover:not(.active) { color: var(--paper); }

/* -------------------------------------------------------------------------
   Projects list
   ------------------------------------------------------------------------- */
.projects-heading {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 24px 0 10px;
}

.proj-table-head {
  display: flex;
  gap: 4px;
  padding: 0 4px 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}
.proj-table-head button {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-radius: 6px;
}
.proj-table-head button:hover { background: var(--paper-deep); color: var(--ink); }
.proj-table-head button.active { color: var(--denim-dark); font-weight: 700; }
.proj-table-head .sort-caret { font-size: 9px; }

.proj-list { display: flex; flex-direction: column; gap: 18px; padding-bottom: 60px; }

.proj-card {
  background: var(--rust);
  color: #fbf1e8;
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 18px 20px;
}
.proj-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 0;
  text-align: left;
  font-family: var(--font-body);
}
.proj-meta {
  font-size: 14.5px;
  font-weight: 600;
  flex-wrap: wrap;
}
.proj-chevron { width: 20px; height: 20px; flex-shrink: 0; transition: transform 0.2s ease; }
.proj-chevron.open { transform: rotate(180deg); }
.proj-desc {
  font-size: 14px;
  margin: 10px 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.proj-characters { margin-top: 16px; padding-top: 16px; border-top: 1px solid rgba(251, 241, 232, 0.25); }
.proj-characters .empty-row { color: #fbf1e8; }

/* -------------------------------------------------------------------------
   Character accordion
   ------------------------------------------------------------------------- */
.accordion {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.acc-row {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.acc-header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 5px 16px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-body);
  color: var(--ink);
}

.acc-thumb {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--paper-deep);
  display: flex;
  align-items: center;
  justify-content: center;
}
.acc-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.acc-thumb .photo-placeholder svg { width: 26px; height: 26px; }
.acc-thumb .photo-placeholder span { display: none; }

.acc-heading { flex: 0 1 220px; min-width: 0; }
.acc-heading h3 {
  font-family: var(--font-display);
  font-size: 19px;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.acc-heading .age-gender {
  font-size: 12.5px;
  color: var(--ink-soft);
  font-style: italic;
}

.acc-header-notes {
  flex: 1 1 220px;
  min-width: 180px;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}
.acc-header-notes span:not(.label) {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
@media (max-width: 850px) {
  .acc-header { flex-wrap: wrap; }
  .acc-header-notes { align-self: auto; flex-basis: 100%; order: 1; margin-left: 0; }
}

/* Smaller (but still readable) text on phones; thumb + name stay side by side. */
@media (max-width: 480px) {
  .acc-heading h3 { font-size: 16px; }
  .acc-heading .age-gender { font-size: 11px; }
  .slate-no { font-size: 9.5px; }
  .vo-notes { font-size: 12px; }
  .vo-notes .label, .role-desc .label { font-size: 9px; }
  .description { font-size: 12.5px; }
}

.acc-summary { padding: 0 16px 4px; }

.show-more-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
  margin: 10px auto 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--denim-dark);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.show-more-btn svg { width: 14px; height: 14px; transition: transform 0.2s ease; }
.show-more-btn svg.open { transform: rotate(180deg); }

.acc-more {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px solid var(--line);
}

.slate-no {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.photo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: #9a927a;
}
.photo-placeholder svg { width: 46px; height: 46px; opacity: 0.6; }
.photo-placeholder span {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.vo-notes {
  background: var(--brass-soft);
  border: 1px solid #e2ca8d;
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 13px;
  color: #5c4a15;
}
.vo-notes .label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 3px;
  color: #8a6c17;
}
.vo-notes.empty {
  background: var(--paper-deep);
  border-color: var(--line);
  color: var(--ink-soft);
  font-style: italic;
}

.role-desc {
  background: var(--paper-deep);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
}
.role-desc .label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 3px;
  color: var(--ink-soft);
}

.description {
  font-size: 13.5px;
  color: var(--ink-soft);
  margin: 0;
}

.sample-player {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--ink);
  border-radius: 999px;
  padding: 6px 6px 6px 14px;
}
.sample-player .play-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--brass);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sample-player .play-btn svg { width: 14px; height: 14px; fill: var(--ink); }
.sample-player .track-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--paper);
  letter-spacing: 0.04em;
  flex: 1;
}
.video-ref .label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 6px;
  color: var(--ink-soft);
}
.video-embed { aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; }
.video-embed iframe { width: 100%; height: 100%; border: none; }

.card-actions { margin-top: auto; display: flex; justify-content: center; gap: 8px; padding-top: 4px; }

.btn {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 13.5px;
  border-radius: 8px;
  padding: 10px 16px;
  border: 2px solid transparent;
  cursor: pointer;
  text-align: center;
  transition: transform 0.08s ease, box-shadow 0.15s ease;
}
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--rust); color: #fff; flex: 1; }
.btn-primary:hover { background: var(--rust-dark); }
.btn-primary:disabled { background: #c9c2ac; cursor: not-allowed; }
.btn-primary:disabled .submit-cta-icon { animation: none; opacity: 1; }

.submit-cta { display: flex; align-items: center; justify-content: center; gap: 8px; flex: none; width: 100%; max-width: 350px; margin: 0 auto; }
.submit-cta-icon { width: 17px; height: 17px; flex-shrink: 0; animation: cta-flash 1.8s ease-in-out infinite; }
@keyframes cta-flash {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

.btn-ghost { background: transparent; color: var(--denim-dark); border-color: var(--denim); }
.btn-ghost:hover { background: var(--denim); color: #fff; }

/* -------------------------------------------------------------------------
   Inline submit panel
   ------------------------------------------------------------------------- */
.submit-panel {
  margin-top: 14px;
  background: var(--card);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(20, 18, 14, 0.12);
}

.submit-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  background: var(--denim-dark);
  color: var(--paper);
}
.submit-panel-header h3 { font-family: var(--font-display); margin: 0; font-size: 19px; }
.submit-panel-header .sub { font-family: var(--font-mono); font-size: 11px; color: var(--brass-soft); }
.submit-panel-close {
  background: none; border: none; color: var(--paper);
  font-size: 22px; cursor: pointer; line-height: 1; padding: 4px 8px;
}

.submit-panel-body { padding: 20px; }

.submit-panel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.submit-panel-col { display: flex; flex-direction: column; gap: 14px; }

.submit-panel-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  margin-top: 4px;
}
.submit-panel-actions .btn-ghost { flex: 1; }
.submit-panel-actions .btn-primary { flex: 2; }

@media (max-width: 640px) {
  .submit-panel-grid { grid-template-columns: 1fr; }
}
@media (max-width: 380px) {
  .submit-panel-actions { flex-direction: column-reverse; }
  .submit-panel-actions .btn-ghost, .submit-panel-actions .btn-primary { flex: 1; }
}

.media-downloads { display: flex; flex-wrap: wrap; gap: 8px; }
.download-btn {
  flex: 1 1 140px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  text-align: center;
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
  color: var(--ink);
  background: #fff;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.download-btn:hover { border-color: var(--denim); background: var(--paper-deep); }

.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  margin-bottom: 5px;
  color: var(--ink-soft);
}
.field input[type=text],
.field input[type=email],
.field input[type=tel],
.field textarea {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: var(--font-body);
  font-size: 14.5px;
  background: #fff;
}
.field textarea { resize: vertical; min-height: 70px; }
.field input:focus, .field textarea:focus { border-color: var(--denim); }

.audio-source-toggle { display: flex; gap: 8px; }
.audio-source-toggle button {
  flex: 1;
  padding: 9px;
  border-radius: 8px;
  border: 1.5px solid var(--line);
  background: #fff;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}
.audio-source-toggle button.active { border-color: var(--denim); background: var(--denim); color: #fff; }

@media (max-width: 380px) {
  .audio-source-toggle { flex-direction: column; }
}

.recorder-box {
  border: 1.5px dashed var(--line);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
}
.record-btn {
  width: 58px; height: 58px;
  border-radius: 50%;
  border: none;
  background: var(--rust);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}
.record-btn.recording { animation: pulse 1.1s infinite; }
.record-btn svg { width: 22px; height: 22px; }
.record-btn svg.mic-icon { color: #fff; }
.record-btn svg.stop-icon { fill: #fff; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(181,74,52,0.45); }
  50% { box-shadow: 0 0 0 10px rgba(181,74,52,0); }
}
.rec-status { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-soft); }

.file-drop {
  border: 1.5px dashed var(--line);
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--ink-soft);
}
.file-drop input { margin-top: 8px; }

.audio-preview {
  background: var(--paper-deep);
  border-radius: 10px;
  padding: 10px 12px;
}
.audio-preview .label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 6px;
  color: var(--ink-soft);
}
.audio-preview audio { width: 100%; display: block; }

.form-msg { font-size: 13px; padding: 10px 12px; border-radius: 8px; }
.form-msg.error { background: #fbe4de; color: var(--rust-dark); }
.form-msg.success { background: #e2f0e0; color: var(--green-open); }

/* -------------------------------------------------------------------------
   Footer
   ------------------------------------------------------------------------- */
footer {
  background: var(--ink);
  color: #b8ad93;
  padding: 26px 0;
  font-size: 13px;
}
footer a { color: var(--brass-soft); }
footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

/* -------------------------------------------------------------------------
   Utility / states
   ------------------------------------------------------------------------- */
.loading-row, .empty-row {
  padding: 60px 20px;
  text-align: center;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 13px;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap;
}

[x-cloak] { display: none !important; }
