/* ---- Self-hosted display font: Telegraf (licensed weights we ship) ------ */
@font-face {
  font-family: 'Telegraf';
  src: url('/fonts/PPTelegraf-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Telegraf';
  src: url('/fonts/PPTelegraf-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ---- Self-hosted body font: Inter (the licensed TTF weights we ship) ---- */
@font-face {
  font-family: 'Inter';
  src: url('/fonts/Inter-Regular.ttf') format('truetype');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('/fonts/Inter-SemiBold.ttf') format('truetype');
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('/fonts/Inter-Bold.ttf') format('truetype');
  font-weight: 700; font-style: normal; font-display: swap;
}

/* ---- Design tokens (Artemis fleet-standard) ------------------------------ */
:root {
  --cobalt: #050E3D;
  --coral: #FF557E;
  --seaglass: #BFDDDB;

  --ink: #1c2333;
  --ink-soft: #5a6275;
  --ink-faint: #9aa1b1;
  --line: #e6e8ef;
  --line-soft: #f0f1f6;
  --surface: #ffffff;
  --surface-tint: #f7f8fb;
  --seaglass-tint: #eef6f5;
  --danger: #c53030;
  --danger-tint: #fdecec;

  --font-display: 'Telegraf', system-ui, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    Helvetica, Arial, sans-serif;

  --radius: 12px;
  --radius-sm: 9px;
  --shadow-card: 0 1px 2px rgba(5, 14, 61, 0.04), 0 8px 24px rgba(5, 14, 61, 0.06);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--surface-tint);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
h1, h2, h3 { font-family: var(--font-display); color: var(--cobalt); margin: 0; }
p { margin: 0; }
a { color: var(--cobalt); }
button { font-family: var(--font-body); cursor: pointer; }

.logo-chip { display: inline-flex; align-items: center; justify-content: center; background: var(--cobalt); border-radius: 999px; padding: 10px 18px; }
.logo-img { height: 22px; display: block; }

/* ---- Page shell ---- */
.page { max-width: 640px; margin: 0 auto; padding: 48px 20px 80px; }
.page-header { text-align: center; margin-bottom: 32px; }
.page-header h1 { font-size: 30px; line-height: 1.15; margin-top: 18px; }
.page-header p { color: var(--ink-soft); margin-top: 10px; font-size: 15px; }

/* ---- Cards ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 24px;
}
.card + .card { margin-top: 16px; }

/* ---- Address form ---- */
.address-form { display: flex; flex-direction: column; gap: 12px; }
.address-form label { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.address-form input[type="text"] {
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--surface);
}
.address-form input[type="text"]:focus {
  outline: none;
  border-color: var(--cobalt);
}
.form-hint {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-faint);
  margin: -2px 0 2px;
}
.btn-primary {
  background: var(--coral);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 600;
  transition: filter 0.15s ease;
}
.btn-primary:hover { filter: brightness(0.94); }
.btn-primary:disabled { background: var(--ink-faint); cursor: not-allowed; }
.btn-secondary {
  background: var(--seaglass-tint);
  color: var(--cobalt);
  border: 1px solid var(--seaglass);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
}
.btn-secondary:hover { filter: brightness(0.97); }

/* ---- Status / progress card ---- */
.status-card { display: none; }
.status-card.visible { display: block; }
.status-row { display: flex; align-items: flex-start; gap: 12px; }
.status-dot {
  flex: none; width: 10px; height: 10px; border-radius: 50%;
  margin-top: 6px; background: var(--ink-faint);
}
.status-dot.processing { background: var(--coral); animation: pulse 1.4s ease-in-out infinite; }
.status-dot.active { background: #2f9e6e; animation: none; }
.status-dot.error { background: var(--danger); animation: none; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.status-title { font-weight: 600; font-size: 15px; color: var(--ink); }
.status-detail { font-size: 14px; color: var(--ink-soft); margin-top: 4px; line-height: 1.5; }
.status-meta { font-size: 12.5px; color: var(--ink-faint); margin-top: 10px; }
.status-actions { margin-top: 14px; }

.banner-error {
  background: var(--danger-tint);
  border: 1px solid #f3c6c6;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--danger);
  font-size: 14px;
}

/* ---- Video result card ---- */
.result-card { display: none; }
.result-card.visible { display: block; }
.video-wrap {
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #000;
  aspect-ratio: 16 / 9;
}
.video-wrap.portrait { aspect-ratio: 9 / 16; max-width: 320px; margin: 0 auto; }
.video-wrap video { width: 100%; height: 100%; display: block; }

.orientation-toggle { display: flex; gap: 8px; margin-top: 14px; }
.orientation-toggle button {
  flex: 1; padding: 9px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface);
  font-size: 13px; font-weight: 600; color: var(--ink-soft);
}
.orientation-toggle button.active { border-color: var(--cobalt); color: var(--cobalt); background: var(--seaglass-tint); }

.download-row { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.download-row a, .download-row button {
  flex: 1; min-width: 140px; text-align: center; text-decoration: none;
  padding: 12px 16px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600;
}
.download-row a { background: var(--cobalt); color: #fff; }
.download-row a:hover { filter: brightness(1.1); }

.attribution { margin-top: 12px; font-size: 11.5px; color: var(--ink-faint); text-align: center; }

/* ---- Access gate ---- */
.gate-overlay {
  position: fixed; inset: 0; background: rgba(5, 14, 61, 0.72);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  z-index: 100;
}
.gate-overlay.hidden { display: none; }
.gate-box {
  background: var(--surface); border-radius: var(--radius); padding: 32px 28px;
  max-width: 340px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  text-align: center;
}
.gate-box h2 { font-size: 20px; margin-bottom: 6px; }
.gate-box p { color: var(--ink-soft); font-size: 13.5px; margin-bottom: 18px; }
.gate-box input {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--line);
  border-radius: var(--radius-sm); font-size: 15px; margin-bottom: 12px; text-align: center;
}
.gate-error { color: var(--danger); font-size: 13px; margin-top: 10px; min-height: 18px; }

.footer { text-align: center; margin-top: 40px; color: var(--ink-faint); font-size: 12.5px; }

@media (max-width: 480px) {
  .page { padding: 32px 16px 60px; }
  .page-header h1 { font-size: 24px; }
  .card { padding: 18px; }
}
