/* AdHoc DM — site stylesheet (Jaspr port).
 *
 * Ported 1:1 from the Flutter site's ColorScheme.fromSeed(#004BE3) themes
 * and widget styling in lib/main.dart. Light is the default palette; dark
 * follows prefers-color-scheme, matching ThemeMode.system.
 *
 * primary / outlineVariant are the exact M3 tonal values Flutter derives
 * from the seed (computed with material_color_utilities 0.11.1).
 */

:root {
  /* Light ColorScheme overrides + M3 derived */
  --surface: #F3FAFF;
  --on-surface: #131D22;
  --surface-container-low: #EBF5FC;
  --surface-container-highest: #D9E4EA;
  --primary-container: #3366FF;
  --on-primary-container: #FDFBFF;
  --primary: #4D5C92;
  --outline-variant: #C6C5D0;

  /* Screenshot-card grey tiers: Colors.grey[100/200/300] */
  --shade-a: #F5F5F5;
  --shade-b: #EEEEEE;
  --shade-c: #E0E0E0;

  /* Responsive tokens: horizontalPadding / spacing from the Flutter page */
  --hp: 16px;
  --gap: 16px;
}

@media (min-width: 601px) {
  :root { --hp: 24px; --gap: 32px; }
}

@media (min-width: 901px) {
  :root { --hp: 64px; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --surface: #131D22;
    --on-surface: #F3FAFF;
    --surface-container-low: #1C252B;
    --surface-container-highest: #283237;
    --primary-container: #0039B4;
    --on-primary-container: #FFFFFF;
    --primary: #B6C4FF;
    --outline-variant: #45464F;

    /* Colors.grey[900/850/800] */
    --shade-a: #212121;
    --shade-b: #303030;
    --shade-c: #424242;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--surface);
  color: var(--on-surface);
  /* The Flutter theme names Manrope but bundles no font, so the build
   * falls back to Roboto — load and use Roboto for a faithful match. */
  font-family: 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

img { display: block; }
button { font-family: inherit; }

/* ---------- Icons ---------- */

.mi {
  font-family: 'Material Icons';
  font-weight: normal;
  font-style: normal;
  display: inline-block;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

.mi.outlined { font-family: 'Material Icons Outlined'; }

.bicon {
  display: inline-block;
  width: 1em;
  height: 1em;
  line-height: 0;
  flex: none;
}

.bicon svg { width: 100%; height: 100%; }

/* ---------- Hero ---------- */

.hero { background: var(--primary-container); }

.hero-inner {
  padding: 48px var(--hp);
  display: flex;
  align-items: center;
  gap: 64px;
}

.hero-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

.hero-media {
  flex: 1;
  min-width: 0;
  display: flex;
  justify-content: center;
}

/* Mobile (<600px): stack branding → phone → actions, 48px apart, matching
 * the Flutter isMobile column. display:contents lifts the copy's children
 * into the flex column so they can interleave with the phone. */
@media (max-width: 599px) {
  .hero-inner { flex-direction: column; gap: 48px; }
  .hero-copy { display: contents; }
  .hero-branding { order: 1; }
  .hero-media { order: 2; width: 100%; }
  .hero-action { order: 3; }
}

.hero-branding {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.logo-wrap {
  border-radius: 50%;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  line-height: 0;
}

.hero-logo { height: 80px; width: auto; }

@media (max-width: 599px) and (orientation: portrait) {
  .hero-branding { gap: 8px; }
  .hero-logo { height: 100px; }
}

@media (min-width: 601px) {
  .hero-logo { height: 120px; }
}

.hero-title {
  margin: 0;
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.64px;
  line-height: 1.25;
  color: #fff;
  text-align: center;
  text-shadow: 0 4px 8px rgba(0, 0, 0, 0.54);
}

@media (min-width: 601px) {
  .hero-title { font-size: 64px; }
}

.hero-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 48px;
}

.hero-subtitle {
  margin: 0;
  max-width: 900px;
  text-align: center;
  color: #fff;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.5px;
}

@media (min-width: 601px) {
  .hero-subtitle { font-size: 20px; }
}

.hero-subtitle .adhoc {
  font-weight: 700;
  font-style: italic;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.45);
}

.hero-subtitle .dm { font-weight: 700; }

.hero-subtitle .desc {
  font-style: italic;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  line-height: 1.43;
  letter-spacing: 0.25px;
}

.hero-subtitle .calling {
  font-weight: 700;
  font-size: 14px;
  line-height: 1.43;
  letter-spacing: 0.25px;
}

@media (min-width: 601px) {
  .hero-subtitle .desc, .hero-subtitle .calling { font-size: 18px; }
}

.store-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  column-gap: 24px;
  row-gap: 32px;
}

.store-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  max-width: 280px;
  padding: 16px 24px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.2);
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.store-btn span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.store-btn .mi { font-size: 24px; }
.store-btn .bicon { width: 24px; height: 24px; }

/* ---------- Phone frame (hero demo video) ---------- */

.phone {
  width: 100%;
  max-width: 278px;
  aspect-ratio: 9 / 21;
  background: #1A1A1A;
  border: 2px solid #333333;
  border-radius: 48px;
  padding: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.phone-screen {
  width: 100%;
  height: 100%;
  border-radius: 36px;
  overflow: hidden;
  background: #1A1A1A;
  display: flex;
  flex-direction: column;
}

.status-bar {
  height: 32px;
  flex: none;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
}

.status-time { font-size: 12px; font-weight: 600; }

.status-icons { display: flex; align-items: center; gap: 4px; }
.status-icons .mi { font-size: 12px; }

.phone-video { flex: 1; position: relative; min-height: 0; }

.phone-video .phone-poster,
.phone-video video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- Section titles ---------- */

.section-title {
  margin: 0;
  padding: 64px var(--hp) 48px;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.28px;
  line-height: 1.29;
  color: var(--on-surface);
}

@media (min-width: 601px) {
  .section-title { font-size: 48px; }
}

/* ---------- Reels ---------- */

.reels {
  background: var(--surface-container-highest);
  padding-bottom: 80px;
}

.reels-grid {
  padding: 0 var(--hp);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap);
}

@media (min-width: 700px) {
  .reels-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1200px) {
  .reels-grid { grid-template-columns: repeat(6, 1fr); }
}

.reel {
  position: relative;
  aspect-ratio: 9 / 16;
  border-radius: 24px;
  background: #000;
  border: 1px solid rgba(0, 0, 0, 0.12);
  overflow: hidden;
}

.reel .reel-placeholder,
.reel video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.fit-cover { object-fit: cover; }
.fit-contain { object-fit: contain; }

.reel-hidden { opacity: 0; }

.reel-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.24);
  border: none;
  padding: 0;
  color: #fff;
  cursor: pointer;
  z-index: 2;
}

.reel-play-icon { font-size: 52px; }

.reel-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  z-index: 2;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 4px solid transparent;
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.reel-controls {
  position: absolute;
  right: 16px;
  bottom: 16px;
  display: flex;
  gap: 8px;
  z-index: 3;
}

.ctrl-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.54);
  border: none;
  padding: 0;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.ctrl-btn .mi { font-size: 20px; }

/* ---------- Look Inside (screenshots) ---------- */

.features {
  background: var(--surface-container-low);
  padding-bottom: 64px;
}

.features-grid {
  padding: 0 var(--hp);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap);
}

@media (min-width: 1200px) {
  .features-grid { grid-template-columns: repeat(4, 1fr); }
}

.shot-card {
  background: var(--surface);
  border: 1px solid var(--outline-variant);
  border-radius: 24px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.shot-area {
  display: block;
  width: 100%;
  border: none;
  padding: 16px 12px;
  border-radius: 24px 24px 0 0;
  cursor: pointer;
}

@media (min-width: 601px) {
  .shot-area { padding: 64px 24px; }
}

.shade-a { background: var(--shade-a); }
.shade-b { background: var(--shade-b); }
.shade-c { background: var(--shade-c); }

.shot-frame {
  aspect-ratio: 9 / 16;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shot-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.shot-title {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.43;
  letter-spacing: 0.25px;
  color: var(--on-surface);
}

/* Fullscreen viewer (Dialog.fullscreen + InteractiveViewer) */

.shot-viewer {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 1000;
  overflow: hidden;
  touch-action: none;
  outline: none;
  cursor: grab;
}

.viewer-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  will-change: transform;
  user-select: none;
  pointer-events: none;
}

.viewer-close {
  position: absolute;
  top: 40px;
  right: 20px;
  background: none;
  border: none;
  padding: 8px;
  color: #fff;
  cursor: pointer;
  z-index: 2;
}

.viewer-close .mi { font-size: 32px; }

/* ---------- Impact ---------- */

.impact {
  background: var(--primary-container);
  padding: 96px 24px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  column-gap: 64px;
  row-gap: 48px;
}

.impact-text {
  color: #fff;
  font-size: 32px;
  font-weight: 700;
  line-height: 1.43;
  letter-spacing: 0.25px;
  text-align: center;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--outline-variant);
  padding: 48px var(--hp);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.copyright {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.43;
  letter-spacing: 0.25px;
  text-align: center;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  column-gap: 16px;
  row-gap: 8px;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--primary);
  font-size: 12px;
  line-height: 1.33;
  letter-spacing: 0.4px;
  text-decoration: none;
}

.footer-link span:not(.mi):not(.bicon) { text-decoration: underline; }

.footer-link .mi { font-size: 14px; }
.footer-link .bicon { width: 14px; height: 14px; }

/* ---------- Back to top ---------- */

.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 100;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--primary-container) 50%, transparent);
  color: var(--on-primary-container);
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.back-to-top.show {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.back-to-top:hover { filter: brightness(1.15); }

.back-to-top .mi { font-size: 24px; }
