/* Shared layout + form styling for both giveaway pages.
   Targets Safari 16 (5th-gen iPad ceiling): no CSS nesting, vh fallbacks for dvh.
   Everything is sized in rem and the root font-size tracks viewport height,
   so the whole page scales to fit the tablet without scrolling. */

@font-face { font-family: "Anton"; src: url(fonts/Anton-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Barlow"; src: url(fonts/Barlow-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Barlow"; src: url(fonts/Barlow-500.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Barlow"; src: url(fonts/Barlow-600.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url(fonts/BarlowCondensed-600.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url(fonts/BarlowCondensed-700.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url(fonts/BarlowCondensed-800.woff2) format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Kaushan Script"; src: url(fonts/KaushanScript-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }

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

:root {
  color-scheme: dark;
  --bg: #050505;
  --text: #f4f4f4;
  --muted: #b9b9b9;
  --field-bg: #f7f7f8;
  --field-text: #141414;
  --field-placeholder: #8a8a8f;
  --error: #ff6b5e;
  --on-accent: #fff;   /* text/icons drawn on top of the accent color */
  --radius: 0.5rem;
  /* Height left over once the root font-size stops tracking the viewport (bigger tablets,
     desktops). ~0 on the 5th-gen iPad; spacing below grows with it. */
  --slack: max(0px, 100vh - 61.7rem);
  --gap: calc(0.85rem + min(var(--slack) * 0.05, 0.6rem));
  --field-h: max(44px, 2.95rem);
}

/* Root size follows viewport height (portrait) so the iPad fits exactly. */
html {
  font-size: clamp(13px, min(1.62vh, 2.12vw), 19px);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--text);
  font-family: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 500;
  line-height: 1.3;
  background-color: var(--bg);
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center top;
  -webkit-tap-highlight-color: transparent;
}

.page {
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  max-width: 52rem;
  margin: 0 auto;
  padding: 1.1rem 1.5rem 1.2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: calc(1rem + min(var(--slack) * 0.3, 4rem));
}

.hero { text-align: center; }
.hero h1 { margin: 0; }

/* ---- form ---- */
form { display: flex; flex-direction: column; gap: var(--gap); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.field { position: relative; display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }

.label {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 700;
  font-size: 1.12rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.1;
}
.label .req { color: var(--accent); margin-left: 0.15em; }
.label .opt { font-family: "Barlow", sans-serif; font-weight: 500; font-size: 0.8em; letter-spacing: 0.05em; color: var(--muted); }
.hint { font-size: 0.95rem; color: var(--muted); margin-top: -0.15rem; }

input[type="text"], input[type="email"], input[type="tel"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: var(--field-h);
  padding: 0 0.95rem;
  border: 2px solid transparent;
  border-radius: var(--radius);
  background: var(--field-bg);
  color: var(--field-text);
  /* >= 16px stops iOS Safari from zooming when a field gets focus */
  font: 500 max(16px, 1.1rem) / 1 "Barlow", system-ui, sans-serif;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input::placeholder { color: var(--field-placeholder); opacity: 1; }
input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow), 0 2px 10px rgba(0, 0, 0, 0.35); }
.invalid input[type="text"], .invalid input[type="email"], .invalid input[type="tel"] { border-color: var(--error); }

/* errors sit at the right end of the label row so they never change the page height */
.error { position: absolute; top: 0.05rem; right: 0; max-width: 60%; text-align: right; color: var(--error); font-size: 0.92rem; font-weight: 600; line-height: 1.1; }
.error:empty { display: none; }

/* ---- checkboxes ---- */
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; margin-bottom: 0.35rem; }
/* fill down the first column, then the second; one column on phones keeps the same order */
.choices { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: repeat(4, auto); grid-auto-flow: column; gap: 0.15rem 1.2rem; margin-top: 0.4rem; }

.check {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: max(40px, 2.55rem);
  cursor: pointer;
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.15;
  -webkit-user-select: none;
  user-select: none;
}
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.box {
  flex: none;
  width: 1.6rem;
  height: 1.6rem;
  min-width: 24px;
  min-height: 24px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 0.3rem;
  background: rgba(0, 0, 0, 0.45);
  display: grid;
  place-items: center;
  transition: background 0.12s, border-color 0.12s;
}
.box svg { stroke: var(--on-accent); width: 72%; height: 72%; opacity: 0; transform: scale(0.6); transition: opacity 0.12s, transform 0.12s; }
.check input:checked + .box { background: var(--accent); border-color: var(--accent); }
.check input:checked + .box svg { opacity: 1; transform: none; }
.check input:focus-visible + .box { box-shadow: 0 0 0 3px var(--accent-glow); }
.invalid .box { border-color: var(--error); }

/* ---- submit ---- */
.submit {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  border: 0;
  cursor: pointer;
  color: var(--on-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 0.2rem;
}
.submit:disabled { opacity: 0.7; cursor: progress; }
.submit .chev { width: 0.75em; height: 0.75em; flex: none; }

/* consent line: set apart from the interest checkboxes by a hairline and quieter type */
.optin {
  min-height: 2rem;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  gap: 0.6rem;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--muted);
}
.optin .box { width: 1.2rem; height: 1.2rem; min-width: 20px; min-height: 20px; border-width: 1.5px; }

.form-error { text-align: center; color: var(--error); font-weight: 600; }
.form-error:empty { display: none; }

.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* ---- confirmation ---- */
.done { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 1rem; padding: 1.5rem 0.5rem; }
.done[hidden], form[hidden] { display: none; }
.done .tick {
  width: 5.5rem; height: 5.5rem; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); box-shadow: 0 0 0 0.5rem var(--accent-glow);
}
.done .tick svg { stroke: var(--on-accent); width: 55%; height: 55%; }
.done h2 { margin: 0.4rem 0 0; }
.done p { margin: 0; font-size: 1.25rem; max-width: 32rem; color: #e6e6e6; }
.done .email { color: #fff; font-weight: 600; display: inline-block; max-width: 100%; overflow-wrap: anywhere; }
.again {
  margin-top: 0.6rem;
  -webkit-appearance: none; appearance: none;
  font: 700 1.1rem "Barlow Condensed", sans-serif; letter-spacing: 0.08em; text-transform: uppercase;
  color: #fff; background: transparent; border: 2px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius); padding: 0.8rem 1.6rem; min-height: 44px; cursor: pointer;
}
.countdown { font-size: 0.95rem; color: var(--muted); }
.countdown:empty { display: none; }
.dup-only { display: none; }
.is-dup .dup-only { display: block; }
.is-dup .new-only { display: none; }

/* ---- landscape tablet: hero left, form right ---- */
@media (orientation: landscape) and (min-width: 820px) {
  html { font-size: clamp(12px, min(2.2vh, 1.6vw), 19px); }
  :root { --slack: max(0px, 100vh - 45.4rem); }
  .page {
    max-width: 82rem;
    flex-direction: row;
    align-items: center;
    gap: 2.2rem;
    padding: 1.2rem 2rem;
  }
  .hero { flex: 0 0 37%; }
  .main { flex: 1 1 auto; min-width: 0; }
}

/* ---- phones: single column, normal scrolling ---- */
@media (max-width: 600px) {
  html { font-size: 15px; }
  :root { --slack: 0px; }
  .page { padding: 1rem 1rem 1.5rem; justify-content: flex-start; }
  .row { grid-template-columns: 1fr; }
  .choices { grid-template-columns: 1fr; grid-template-rows: none; grid-auto-flow: row; }
}
@media (max-width: 600px) and (min-width: 380px) {
  .row.keep { grid-template-columns: 1fr 1fr; }
}
