/* ==========================================================================
   Impromptoo — hi-fi design mockups, shared styles
   Design tokens mirror mobile/src/global.css (the single source of truth).
   No frameworks, no build step. Light + dark via CSS variables.
   ========================================================================== */

/* ---------- Tokens ---------- */

:root {
  /* App tokens (light) — keep in sync with mobile/src/global.css */
  --bg: #ffffff;
  --surface: #f8fafc;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --primary: #208aef;
  --primary-fg: #ffffff;
  --danger: #ef4444;

  /* Derived tints */
  --primary-10: color-mix(in srgb, var(--primary) 10%, transparent);
  --primary-15: color-mix(in srgb, var(--primary) 15%, transparent);
  --primary-40: color-mix(in srgb, var(--primary) 40%, transparent);
  --text-80: color-mix(in srgb, var(--text) 80%, transparent);
  --text-70: color-mix(in srgb, var(--text) 70%, transparent);

  /* Page chrome (outside the phone) */
  --page-bg: #e9edf3;
  --page-bg-2: #f4f6fa;
  --page-text: #0f172a;
  --page-muted: #64748b;
  --page-card: #ffffff;
  --page-border: #dde3ec;
  --bezel: #101014;
  --shadow-device: 0 40px 80px -24px rgba(15, 23, 42, 0.45), 0 12px 28px rgba(15, 23, 42, 0.22);

  /* Event-template cover colors (mobile/src/lib/event-templates.ts) */
  --tpl-coffee: #c77d33;
  --tpl-dinner: #c2542a;
  --tpl-drinks: #6e63c9;
  --tpl-food: #c2662a;
  --tpl-sports: #5e8c2e;
  --tpl-walk: #1f8a72;
  --tpl-games: #8e4a9e;
  --tpl-movie: #8c3041;
  --tpl-music: #b03a5b;
  --tpl-study: #574fb0;
  --tpl-custom: #2b7fcb;

  /* Scarcity chip — mirrors the app's amber-500 "Almost full" state */
  --almost-full: rgba(245, 158, 11, 0.92);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --font-serif: Georgia, "Times New Roman", serif;
}

[data-theme="dark"] {
  --bg: #09090b;
  --surface: #18181b;
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --border: #27272a;
  --primary: #3898ff;
  --primary-fg: #ffffff;

  --page-bg: #0b0c0f;
  --page-bg-2: #131419;
  --page-text: #f4f4f5;
  --page-muted: #a1a1aa;
  --page-card: #17181d;
  --page-border: #26272e;
  --bezel: #26262c;
  --shadow-device: 0 40px 80px -24px rgba(0, 0, 0, 0.8), 0 12px 28px rgba(0, 0, 0, 0.5);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #09090b;
    --surface: #18181b;
    --text: #f4f4f5;
    --muted: #a1a1aa;
    --border: #27272a;
    --primary: #3898ff;
    --primary-fg: #ffffff;

    --page-bg: #0b0c0f;
    --page-bg-2: #131419;
    --page-text: #f4f4f5;
    --page-muted: #a1a1aa;
    --page-card: #17181d;
    --page-border: #26272e;
    --bezel: #26262c;
    --shadow-device: 0 40px 80px -24px rgba(0, 0, 0, 0.8), 0 12px 28px rgba(0, 0, 0, 0.5);
  }
}

/* ---------- Page scaffold (outside the phone) ---------- */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-font-smoothing: antialiased;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: radial-gradient(1200px 700px at 50% -10%, var(--page-bg-2), var(--page-bg));
  background-attachment: fixed;
  color: var(--page-text);
  min-height: 100vh;
}

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

.mock-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  padding: 20px 24px 72px;
}

.page-nav {
  width: 100%;
  max-width: 760px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--page-border);
  background: color-mix(in srgb, var(--page-card) 78%, transparent);
  backdrop-filter: blur(14px);
  border-radius: 20px;
  position: sticky;
  top: 16px;
  z-index: 40;
}

.nav-side {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.nav-side.right {
  justify-content: flex-end;
}

.nav-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--page-muted);
  padding: 8px 12px;
  border-radius: 12px;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-link:hover {
  background: color-mix(in srgb, var(--page-text) 7%, transparent);
  color: var(--page-text);
}

.nav-link.disabled {
  opacity: 0.35;
  pointer-events: none;
}

.nav-title {
  text-align: center;
  min-width: 0;
}

.nav-title strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.nav-title span {
  display: block;
  font-size: 11px;
  color: var(--page-muted);
  margin-top: 1px;
}

.theme-btn {
  appearance: none;
  border: 1px solid var(--page-border);
  background: var(--page-card);
  color: var(--page-text);
  width: 34px;
  height: 34px;
  border-radius: 12px;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease;
}

.theme-btn:hover {
  transform: scale(1.06);
}

.screen-note {
  max-width: 415px;
  text-align: center;
  font-size: 13px;
  line-height: 1.55;
  color: var(--page-muted);
}

.screen-note strong {
  color: var(--page-text);
  font-weight: 650;
}

/* Thumbnail mode — the gallery embeds screens with #thumb to hide page chrome */
html.thumb body {
  background: transparent;
  overflow: hidden;
}

html.thumb .mock-page {
  padding: 8px;
  gap: 0;
}

html.thumb .page-nav,
html.thumb .screen-note {
  display: none;
}

/* ---------- iPhone 15 device frame ---------- */

.device {
  background: var(--bezel);
  padding: 11px;
  border-radius: 62px;
  box-shadow: var(--shadow-device), inset 0 0 0 2px rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.screen {
  position: relative;
  width: 393px;
  height: 852px;
  border-radius: 51px;
  overflow: hidden;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  color: var(--text);
  font-size: 15px;
  line-height: 1.35;
}

.screen--surface {
  background: var(--surface);
}

/* Status bar + Dynamic Island */
.statusbar {
  position: relative;
  height: 56px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 32px 0;
  z-index: 30;
  pointer-events: none;
}

.statusbar.on-photo {
  color: #ffffff;
}

.sb-time {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0.01em;
  min-width: 46px;
}

.sb-icons {
  display: flex;
  align-items: center;
  gap: 7px;
}

.island {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 125px;
  height: 36px;
  background: #000;
  border-radius: 20px;
}

/* Home indicator */
.home-indicator {
  position: absolute;
  bottom: 9px;
  left: 50%;
  transform: translateX(-50%);
  width: 140px;
  height: 5px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--text) 32%, transparent);
  z-index: 40;
  pointer-events: none;
}

.home-indicator.on-photo {
  background: rgba(255, 255, 255, 0.65);
}

/* Scrollable content */
.screen-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  display: flex;
  flex-direction: column;
}

.screen-body::-webkit-scrollbar {
  display: none;
}

/* ---------- In-app typography & layout helpers ---------- */

.wordmark {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-transform: lowercase;
  color: var(--text);
}

.screen-header {
  padding: 8px 20px 8px;
}

.screen-header h1 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.screen-header p {
  margin-top: 2px;
  font-size: 14px;
  color: var(--muted);
}

.section-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.row {
  display: flex;
  align-items: center;
}

.spacer {
  flex: 1;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 16px;
  height: 50px;
  padding: 0 20px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.btn:active {
  transform: scale(0.98);
  opacity: 0.85;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-fg);
  font-weight: 700;
}

.btn-primary.disabled {
  background: var(--primary-40);
  pointer-events: none;
}

.btn-quiet {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
}

.btn-outline-primary {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
  font-weight: 700;
}

.btn-frost {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
}

.btn-danger-quiet {
  background: color-mix(in srgb, var(--danger) 8%, transparent);
  color: var(--danger);
  font-weight: 650;
}

.btn-sm {
  height: 44px;
  border-radius: 12px;
  font-size: 14px;
  padding: 0 16px;
}

.btn-pill {
  height: 40px;
  border-radius: 999px;
  font-size: 14px;
  padding: 0 24px;
}

/* ---------- Chips, pills, badges ---------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-70);
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.chip.selected {
  border-color: var(--primary);
  background: var(--primary-10);
  color: var(--primary);
}

.tag {
  display: inline-flex;
  border-radius: 999px;
  background: var(--primary-10);
  color: var(--primary);
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
}

.tag-neutral {
  background: var(--surface);
  color: var(--text-70);
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  display: inline-flex;
}

.pill-dark {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
}

.badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--primary-fg);
  font-size: 11px;
  font-weight: 700;
}

.badge-ai {
  display: inline-flex;
  border-radius: 999px;
  background: var(--primary-10);
  color: var(--primary);
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 550;
}

/* ---------- Avatars ---------- */

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
  user-select: none;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- Cards & list rows ---------- */

.card {
  background: var(--bg);
  border-radius: 16px;
  padding: 12px;
}

.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg);
  border-radius: 16px;
  padding: 12px;
  margin-top: 6px;
  cursor: pointer;
}

.chevron {
  color: var(--muted);
  font-size: 17px;
}

/* ---------- Inputs ---------- */

.field label {
  display: block;
  font-size: 12px;
  font-weight: 550;
  color: var(--muted);
  margin-bottom: 6px;
}

.input,
.textarea {
  width: 100%;
  font-family: inherit;
  font-size: 16px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px;
  outline: none;
}

.input:focus,
.textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-15);
}

.textarea {
  min-height: 88px;
  resize: none;
  line-height: 1.5;
}

.input::placeholder,
.textarea::placeholder {
  color: color-mix(in srgb, var(--muted) 75%, transparent);
}

/* ---------- Tab bar ---------- */

.tabbar {
  flex-shrink: 0;
  display: flex;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(18px);
  padding: 8px 8px 26px;
}

.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  padding-top: 4px;
  position: relative;
}

.tab svg {
  width: 25px;
  height: 25px;
}

.tab.active {
  color: var(--primary);
}

.tab .tab-badge {
  position: absolute;
  top: 0;
  left: calc(50% + 6px);
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--primary-fg);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg);
}

/* ---------- Bottom sheets ---------- */

.sheet-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.44);
  z-index: 20;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.sheet {
  background: var(--bg);
  border-top: 1px solid var(--border);
  border-radius: 28px 28px 0 0;
  padding: 20px 20px 44px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sheet-grabber {
  width: 40px;
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  align-self: center;
}

.sheet h2 {
  font-size: 20px;
  font-weight: 700;
}

/* ---------- Progress (onboarding) ---------- */

.progress-track {
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  overflow: hidden;
  flex: 1;
}

.progress-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--primary);
}

/* ---------- Stars (rating) ---------- */

.stars {
  display: flex;
  gap: 6px;
}

.star {
  width: 32px;
  height: 32px;
  color: var(--border);
}

.star.filled {
  color: #f5a623;
}

.star svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

/* ---------- OTP boxes ---------- */

.otp-row {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.otp-box {
  width: 48px;
  height: 58px;
  border-radius: 16px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
}

.otp-box.focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-15);
}

.otp-caret {
  width: 2px;
  height: 26px;
  background: var(--primary);
  border-radius: 1px;
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* ---------- Chat bubbles ---------- */

.bubble-me {
  max-width: 80%;
  align-self: flex-end;
  background: var(--primary);
  color: var(--primary-fg);
  border-radius: 22px;
  border-bottom-right-radius: 8px;
  padding: 10px 16px;
  font-size: 15px;
  line-height: 1.4;
}

.bubble-them {
  max-width: 78%;
  background: var(--surface);
  color: var(--text);
  border-radius: 22px;
  border-bottom-left-radius: 8px;
  padding: 10px 16px;
  font-size: 15px;
  line-height: 1.4;
}

.msg-meta {
  font-size: 10px;
  color: var(--muted);
  margin-top: 4px;
}

.system-pill {
  align-self: center;
  background: var(--surface);
  color: var(--muted);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 11px;
}

/* ---------- Capacity meter ---------- */

.meter-track {
  height: 10px;
  border-radius: 5px;
  background: var(--border);
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--primary), color-mix(in srgb, var(--primary) 70%, #7dd3fc));
}

/* ---------- Gallery (index.html) ---------- */

.gallery {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px 28px 96px;
}

.gallery-hero {
  text-align: center;
  margin: 24px auto 12px;
  max-width: 620px;
}

.gallery-hero .mark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--page-text);
}

.gallery-hero .mark .dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 6px var(--primary-15);
}

.gallery-hero p {
  margin-top: 14px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--page-muted);
}

.gallery-hero .meta {
  margin-top: 18px;
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.gallery-hero .meta span {
  font-size: 12px;
  font-weight: 600;
  color: var(--page-muted);
  border: 1px solid var(--page-border);
  background: var(--page-card);
  border-radius: 999px;
  padding: 6px 14px;
}

.gallery h2 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--page-muted);
  margin: 48px 4px 16px;
}

.shot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 224px);
  justify-content: center;
  gap: 20px;
}

.shot-card {
  display: block;
  background: var(--page-card);
  border: 1px solid var(--page-border);
  border-radius: 24px;
  padding: 14px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.shot-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 48px -20px rgba(15, 23, 42, 0.35);
}

.shot-thumb {
  width: 100%;
  aspect-ratio: 431 / 890;
  border-radius: 16px;
  overflow: hidden;
  background: var(--page-bg);
  position: relative;
}

.shot-thumb iframe {
  width: 431px;
  height: 890px;
  border: 0;
  transform: scale(0.45);
  transform-origin: top left;
  pointer-events: none;
  position: absolute;
  top: 0;
  left: 0;
}

.shot-card h3 {
  margin: 12px 4px 2px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.shot-card p {
  margin: 0 4px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--page-muted);
}

.shot-num {
  float: right;
  font-size: 11px;
  font-weight: 700;
  color: var(--page-muted);
  background: color-mix(in srgb, var(--page-text) 6%, transparent);
  border-radius: 999px;
  padding: 2px 8px;
  margin-top: 12px;
}

.gallery-footer {
  margin-top: 64px;
  text-align: center;
  font-size: 12.5px;
  color: var(--page-muted);
  line-height: 1.7;
}

.gallery-footer code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  background: color-mix(in srgb, var(--page-text) 7%, transparent);
  border-radius: 6px;
  padding: 2px 6px;
}
