/* Brand look shared with the screen request app: near-black with a warm tint, ember orange, spaced uppercase captions,
   outlined panels with corner marks. The page editor saves some colours inside the page itself (white buttons, black fields,
   an orange that is slightly different), so a few rules below use !important to keep every page on the same palette. */
:root {
  --bg: #0a0503;
  --panel: #120907;
  --line: #3b1d10;
  --ink: #e9e1d8;
  --soft: #cfc4b8;
  --muted: #8b7b6e;
  --ember: #ff7a2f;
  --hot: #ffd27a;
  --cyan: #38e8ff;
  --field: #0a0503;
  --accent: #ff7a2f;
  --accent-ink: #0a0503;
  --error: #ff6b5e;
  --ok: #8ee6a0;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

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

html, body { background: var(--bg); }

body {
  margin: 0;
  color: var(--ink);
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(255,122,47,.10), transparent 60%),
    linear-gradient(rgba(255,122,47,.035) 1px, transparent 1px) 0 0 / 100% 48px,
    linear-gradient(90deg, rgba(255,122,47,.035) 1px, transparent 1px) 0 0 / 48px 100%,
    var(--bg);
}

.page {
  max-width: 640px;
  margin: 0 auto;
  padding: 40px 16px 80px;
}

.hero { text-align: center; margin-bottom: 32px; }
.logo { display: block; width: min(420px, 80%); margin: 0 auto 32px; filter: drop-shadow(0 0 24px rgba(255,122,47,.25)); }

/* The credit line above the logo ("A film by ..."): a small spaced caption in ember, like the screen request app's eyebrow. */
.hero h2 {
  margin: 36px 0 12px !important;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ember);
  text-align: center;
}

h1 {
  font-size: clamp(34px, 8vw, 52px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.02em;
  text-transform: uppercase;
  margin: 0 0 24px;
}

.intro {
  text-align: left;
  color: var(--soft);
  margin: 0;
}

/* Field labels: small, spaced, uppercase. */
h2 {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--soft);
  margin: 0 0 8px;
}

.required { color: var(--ember); margin-left: 4px; }

/* The form is one outlined panel with orange corner marks. */
#portrait-form {
  position: relative;
  padding: clamp(18px, 5vw, 36px);
  border: 1px solid var(--line);
  background: var(--panel);
}
#portrait-form::before, #portrait-form::after, #status-panel::before, #status-panel::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid var(--ember);
  pointer-events: none;
}
#portrait-form::before, #status-panel::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
#portrait-form::after, #status-panel::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

.field { margin-bottom: 28px; }

.option {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 15px;
  color: var(--ink);
  cursor: pointer;
}

.option input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  display: grid;
  place-content: center;
  width: 22px;
  height: 22px;
  margin: 2px 0 0;
  flex: none;
  background: var(--bg);
  border: 1px solid var(--ember);
  border-radius: 0;
  cursor: pointer;
}
.option input[type="checkbox"]::after { content: ""; width: 12px; height: 12px; background: var(--ember); transform: scale(0); transition: transform .12s; }
.option input[type="checkbox"]:checked::after { transform: scale(1); }
.option input[type="checkbox"]:focus-visible { box-shadow: 0 0 0 3px rgba(255,122,47,.25); outline: none; }
.option input[type="checkbox"][aria-invalid="true"] { border-color: var(--error); }

.text {
  display: block;
  width: 100%;
  padding: 13px 14px;
  font: inherit;
  color: var(--ink);
  background: var(--field) !important;
  border: 1px solid var(--line);
  border-radius: 0;
  outline: none;
}

.text::placeholder { color: var(--muted); }
.text:focus-visible, .dropzone:focus-within, .card:focus-within {
  border-color: var(--ember);
  box-shadow: 0 0 0 3px rgba(255,122,47,.2);
  outline: none;
}

.dropzone {
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 160px;
  padding: 20px;
  border: 1px dashed var(--ember);
  border-radius: 0;
  background: var(--field) !important;
  text-align: center;
  cursor: pointer;
}

.dropzone input[type="file"] { display: none; }
.dropzone img { max-height: 240px; max-width: 100%; }
#photo-hint { color: var(--muted); font-size: 14px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 14px;
}

.card {
  position: relative;
  display: block;
  margin: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--field);
  cursor: pointer;
}

.card input { position: absolute; opacity: 0; pointer-events: none; }
.card img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; display: block; }
.card span { display: block; margin-top: 8px; font-weight: 600; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }
.card:has(input:checked) { border-color: var(--ember); box-shadow: 0 0 0 1px var(--ember), 0 0 24px rgba(255,122,47,.25); }

/* Buttons: outlined in ember, uppercase and spaced, filling on hover. */
button, .gg-popwrap > a[data-gg-pop] {
  display: block;
  width: 100%;
  padding: 14px 20px;
  font: 600 13px "Space Grotesk", sans-serif;
  letter-spacing: .14em;
  text-transform: uppercase;
  text-align: center;
  text-decoration: none;
  color: var(--ink) !important;
  background: transparent !important;
  border: 1px solid var(--ember) !important;
  border-radius: 0 !important;
  cursor: pointer;
}
button:hover, .gg-popwrap > a[data-gg-pop]:hover { background: rgba(255,122,47,.14) !important; }
button:focus-visible, .gg-popwrap > a[data-gg-pop]:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
button span { color: inherit !important; }
button:disabled { opacity: 0.5; cursor: wait; }

/* On the souvenir page, Download is the main button (filled); Share is the quiet one. */
.gg-popwrap > a[data-gg-pop] { display: inline-block; width: auto; min-width: 200px; }
.gg-popwrap:not([data-url]) > a[data-gg-pop] { background: var(--ember) !important; color: var(--accent-ink) !important; }
.gg-popwrap:not([data-url]) > a[data-gg-pop]:hover { background: var(--hot) !important; }
.gg-popwrap[data-url] > a[data-gg-pop] { border-color: var(--line) !important; color: var(--muted) !important; }
.gg-popwrap[data-url] > a[data-gg-pop]:hover { border-color: var(--ember) !important; color: var(--ink) !important; }

#message { min-height: 1.5em; text-align: center; margin: 16px 0 0; }
#message.error { color: var(--error); }
#message.ok { color: var(--ok); }

#status-panel {
  position: relative;
  margin-top: 32px;
  padding: 20px;
  border: 1px solid var(--ember);
  background: var(--panel);
  box-shadow: 0 0 60px rgba(255,122,47,.12);
}

#status-panel h2 { margin-bottom: 8px; color: var(--ember); font-family: var(--mono); }
#status-panel p { margin: 0; }

.muted { color: var(--muted); }

@media (max-width: 480px) {
  h2 { font-size: 11px; }
}

/* Conditional blocks hidden until their condition is met (see conditions.js). */
.gg-hidden { display: none !important; }

/* Validation: red text under a field that needs attention (see app.js). */
.field-error { margin: 8px 0 0; color: var(--error); font-size: 14px; font-weight: 500; }
.field-error[hidden] { display: none; }
.text[aria-invalid="true"] { border-color: var(--error); }
.dropzone:has([aria-invalid="true"]) { border-color: var(--error); }
.card:has([aria-invalid="true"]) { border-color: var(--error); }

/* The two pages of the site: the registration form, and the confirmation shown after Submit. */
[data-gg-page][hidden] { display: none; }
.status-line { color: var(--hot); font-family: var(--mono); font-size: 13px; letter-spacing: .06em; }
.confirmation a { color: var(--ember) !important; }
.confirmation, .souvenir { text-align: center; }
.confirmation h1 { color: var(--ember) !important; font-size: clamp(40px, 9vw, 64px) !important; text-shadow: 0 0 28px rgba(255,122,47,.55); }
.souvenir h1 { font-size: clamp(28px, 7vw, 40px) !important; margin-bottom: 8px !important; }
.confirmation p, .souvenir p { color: var(--soft); }
.souvenir strong { color: var(--hot); letter-spacing: .12em; font-family: var(--mono); font-weight: 500; }

/* In the page editor, the confirmation page is shown on the live page's background. */
body[data-gg-editing="confirmation"], body[data-gg-editing="video"] { background: var(--bg); }

/* Layout grid from the page editor: a row of columns. Columns share the row by size (1 to 4) and stack on phones. */
.gg-row { display: flex; flex-wrap: wrap; gap: 24px; margin: 16px 0; }
.gg-col { flex: 1 1 0; min-width: 0; }
.gg-col[data-size="2"] { flex-grow: 2; }
.gg-col[data-size="3"] { flex-grow: 3; }
.gg-col[data-size="4"] { flex-grow: 4; }
@media (max-width: 640px) {
  .gg-row { flex-direction: column; gap: 16px; }
  .gg-col { flex: 1 1 auto; width: 100%; }
}

/* The souvenir video on the video page (the block marked data-gg-video). */
/* The player hugs the video's own shape (no black bars): it is as large as it can be within the page width and 70% of
   the screen height. Set a width on the block in the editor to make it smaller. */
.gg-video { display: block; width: 100%; max-width: 100%; max-height: 70vh; margin: 20px auto 16px; border: 1px solid var(--ember); border-radius: 0; background: #000; box-shadow: 0 0 60px rgba(255,122,47,.18); }
video.gg-video, img.gg-video { width: auto; height: auto; aspect-ratio: auto 9 / 16; object-fit: contain; }

/* Menus on the video page (Download and Share): a button that opens a small list of choices. */
.gg-popwrap { position: relative; display: inline-block; }
.gg-pop { position: absolute; left: 50%; top: calc(100% + 8px); z-index: 20; display: flex; flex-direction: column; min-width: 220px; padding: 6px; text-align: left; background: var(--bg); border: 1px solid var(--ember); border-radius: 0; box-shadow: 0 12px 30px rgba(0,0,0,.6), 0 0 18px rgba(255,122,47,.2); transform: translateX(-50%); }
.gg-pop[hidden] { display: none; }
.gg-pop--up { top: auto; bottom: calc(100% + 8px); }
.gg-pop a, .gg-pop button { display: block; width: 100%; padding: 11px 12px; font: inherit; font-size: 15px; font-weight: 500; letter-spacing: 0; text-transform: none; text-align: left; text-decoration: none; color: var(--ink) !important; background: transparent !important; border: 0 !important; border-radius: 0 !important; cursor: pointer; }
.gg-pop a:hover, .gg-pop button:hover, .gg-pop a:focus-visible, .gg-pop button:focus-visible { background: rgba(255,122,47,.18) !important; outline: none; }
.gg-toast { position: fixed; left: 50%; bottom: 20px; z-index: 30; max-width: min(92vw, 420px); margin: 0; padding: 12px 16px; transform: translateX(-50%); color: var(--ink); background: var(--bg); border: 1px solid var(--ember); border-radius: 0; font-weight: 600; text-align: center; box-shadow: 0 8px 24px rgba(0,0,0,.5), 0 0 18px rgba(255,122,47,.25); }
.gg-toast[hidden] { display: none; }
