/* The Abroad Co — brand system, taken from the proposal deck.
 * Display: Romie (fallback Instrument Serif). Body: ABC Diatype Light (fallback Inter).
 * Light pages are white with near-black ink; the cover palette is near-black with cream.
 */

/* Brand fonts are self-hosted: see public/fonts/fonts.css. */

/* Dark by default (the deck's cover palette). Add data-theme="light" to <html> for the white version. */
:root {
  --bg: #16150f;
  --surface: #1d1c15;
  --ink: #f7f1e7;
  --logo: #f7f1e7;
  --text: #a8a49b;
  --label: #8e8a82;
  --line: #32302a;
  --line-strong: #f7f1e7;
  --cream: #f7f1e7;
  --success: #9bbf9f;
  --danger: #e0918a;
  --danger-soft: #2a1d1a;
  --radius-lg: 16px;
  --radius-md: 10px;
  --display: "Romie", "Instrument Serif", "Times New Roman", serif;
  --body: "ABC Diatype", "Inter", system-ui, -apple-system, sans-serif;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #ffffff;
  --surface: #faf8f4;
  --ink: #16150f;
  --logo: #2b241b;
  --text: #6e6759;
  --label: #787265;
  --line: #e4dfd6;
  --line-strong: #16150f;
  --cream: #f7f1e7;
  --success: #4b6b4f;
  --danger: #a4463a;
  --danger-soft: #faf0ee;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
[hidden] { display: none !important; }

body {
  font-family: var(--body);
  font-weight: 300;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

.mobile-only { display: none; }
html.touch .mobile-only { display: inline; }
html.touch .desktop-only { display: none; }

a { color: inherit; text-decoration: none; }

/* Spaced uppercase labels are the deck's secondary voice. */
.eyebrow, .meta-line, .field-label, .dropzone-meta, .footer, .item-size, .item-status, .summary {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--label);
}

/* ---------------------------------------------------------------- header */

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: calc(36px + env(safe-area-inset-top)) clamp(16px, 6vw, 60px) 0;
}
.wordmark { display: block; color: var(--logo); width: 88px; line-height: 0; }
.wordmark svg { width: 100%; height: auto; display: block; }
.meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }
.signed-in #signed-in-email { color: var(--ink); }

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

.page {
  flex: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(56px, 10vh, 120px) 16px 80px;
}

.intro { margin-bottom: 48px; }
.eyebrow { margin: 0 0 18px; }
.intro h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(44px, 7vw, 64px);
  line-height: 1;
  letter-spacing: -0.01em;
  margin: 0 0 20px;
}
.intro h1 em { font-style: italic; }
.lede { color: var(--text); margin: 0; max-width: 52ch; font-size: 15px; }

/* ------------------------------------------------------------------ form */

.form { display: flex; flex-direction: column; gap: 32px; }

.fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
@media (min-width: 640px) {
  .fields { grid-template-columns: 1fr 1fr; gap: 28px 32px; }
  .field-wide { grid-column: 1 / -1; }
}

.field { display: flex; flex-direction: column; gap: 10px; }
.field-hint { font-size: 12px; color: var(--text); letter-spacing: 0; text-transform: none; }
.field input {
  font: inherit;
  font-family: var(--display);
  font-size: 22px;
  line-height: 1.2;
  padding: 6px 0 10px;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  outline: none;
}
.field input::placeholder { color: var(--label); opacity: 0.6; }
.field input:focus { border-bottom-width: 2px; padding-bottom: 9px; }
.field input.invalid { border-bottom-color: var(--danger); }
.field input:disabled { opacity: 0.5; }

.dropzone {
  position: relative;
  border: 1px dashed var(--label);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 56px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 120ms, background 120ms;
  outline: none;
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--ink); }
.dropzone.active { border-color: var(--ink); border-style: solid; }
.dropzone input[type="file"] {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; cursor: pointer;
}
.dropzone-inner { pointer-events: none; }
.dropzone-title {
  margin: 0;
  font-family: var(--display);
  font-size: 26px;
  line-height: 1.1;
}
.dropzone-sub { margin: 8px 0 0; color: var(--text); }
.dropzone-sub .link { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.dropzone-meta { margin: 22px 0 0; }

/* ----------------------------------------------------------------- queue */

.queue { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.queue:empty { display: none; }

.item {
  display: grid;
  grid-template-columns: 64px 1fr 32px;
  gap: 18px;
  align-items: center;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.item:last-child { border-bottom: 1px solid var(--line); }

.thumb {
  width: 64px; height: 64px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
  display: grid; place-items: center;
  color: var(--label);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-ext { font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; }

.item-body { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.item-row { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.item-name {
  font-family: var(--display);
  font-size: 19px;
  line-height: 1.1;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.item-size { white-space: nowrap; }

.progress { height: 1px; background: var(--line); overflow: hidden; }
.progress-bar { height: 100%; width: 0%; background: var(--ink); transition: width 160ms linear; }
.item.done .progress-bar { background: var(--success); }
.item.error .progress-bar { background: var(--danger); }

.item-status { min-height: 1.2em; letter-spacing: 0.12em; }
.item.done .item-status { color: var(--success); }
.item.error .item-status { color: var(--danger); letter-spacing: 0; text-transform: none; font-size: 13px; }

.remove {
  width: 32px; height: 32px;
  border: 1px solid transparent; border-radius: 50%;
  background: transparent; color: var(--label);
  display: grid; place-items: center;
  cursor: pointer;
}
.remove svg { width: 14px; height: 14px; }
.remove:hover { border-color: var(--ink); color: var(--ink); }
.remove:disabled { visibility: hidden; }

/* --------------------------------------------------------------- actions */

.actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.summary { margin: 0; }
.buttons { display: flex; gap: 10px; }

/* Pill buttons, as in "View full gallery →" */
.btn {
  font-family: var(--body);
  font-weight: 400;
  font-size: 14px;
  padding: 10px 22px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background 120ms, color 120ms, opacity 120ms;
}
.btn:disabled { opacity: 0.35; cursor: default; }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:not(:disabled):hover { opacity: 0.85; }
.btn-ghost:not(:disabled):hover { background: var(--ink); color: var(--bg); }

/* Done state: everything but the confirmation leaves the page. */
body.is-done .intro,
body.is-done .fields,
body.is-done .dropzone,
body.is-done .queue,
body.is-done .actions,
body.is-done .turnstile,
body.is-done .banner { display: none !important; }

.success {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  padding: 8px 0 24px;
  animation: rise 420ms ease-out both;
}
.success h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(44px, 7vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0;
  text-wrap: balance;
}
.success h2 em { font-style: italic; }
.success-text { margin: 0; color: var(--text); max-width: 52ch; font-size: 16px; }
.success .btn { margin-top: 12px; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .success { animation: none; } }

.turnstile:empty { display: none; }
.turnstile { display: flex; justify-content: flex-end; min-height: 65px; }

.banner {
  margin: 28px 0 0;
  padding: 16px 0 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--text);
}
.banner.error { color: var(--danger); }

/* ---------------------------------------------------------------- footer */

.footer {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 24px clamp(16px, 6vw, 60px) calc(32px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}

@media (max-width: 520px) {
  .topbar { flex-direction: row; align-items: center; padding-top: calc(22px + env(safe-area-inset-top)); }
  .wordmark { width: 76px; }
  .meta { gap: 2px; }
  .meta-line { font-size: 10px; letter-spacing: 0.14em; }
  .page { padding-top: 44px; padding-bottom: 56px; }
  .intro { margin-bottom: 36px; }
  .intro h1 { font-size: 46px; }
  .fields { gap: 22px; padding-top: 24px; }
  .field input { font-size: 20px; }
  .dropzone { padding: 40px 16px; }
  .dropzone-title { font-size: 24px; }
  .item { grid-template-columns: 52px 1fr 40px; gap: 12px; padding: 12px 0; }
  .thumb { width: 52px; height: 52px; }
  .item-name { font-size: 17px; }
  .remove { width: 40px; height: 40px; }
  .actions { flex-direction: column; align-items: stretch; gap: 14px; }
  .buttons { display: grid; grid-template-columns: 1fr 2fr; }
  .btn { padding: 14px 18px; font-size: 15px; }
  .turnstile { justify-content: center; }
}
