/* Tallydice Landing Page — Deep Focus theme */

:root {
  --bg: #0F1923;
  --card: #1A2B3C;
  --surface: #2D4356;
  --text-1: #E8ECF1;
  --text-2: #8B9DAF;
  --accent: #3EDBBE;
  --alert: #FF6B4A;
  --divider: rgba(255,255,255,0.08);
}

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

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text-1);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.landing {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Hero ─────────────────────────────────── */

.hero {
  padding: 80px 24px 60px;
  text-align: center;
  background: linear-gradient(180deg, #0F1923 0%, #152233 100%);
}

.hero-content {
  max-width: 640px;
  margin: 0 auto;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
}

.logo-icon {
  font-size: 36px;
}

.logo-text {
  font-size: 28px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.5px;
}

h1 {
  font-size: 42px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 20px;
  letter-spacing: -1px;
}

.accent {
  color: var(--accent);
}

.subtitle {
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-2);
  margin-bottom: 36px;
}

.cta-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.btn-primary {
  display: inline-block;
  padding: 14px 36px;
  background: var(--accent);
  color: var(--bg);
  font-size: 16px;
  font-weight: 700;
  border-radius: 12px;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 20px rgba(62, 219, 190, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(62, 219, 190, 0.45);
}

.cta-hint {
  font-size: 13px;
  color: var(--text-2);
}

/* ── Features ─────────────────────────────── */

.features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  max-width: 960px;
  margin: 0 auto;
  padding: 60px 24px;
}

.feature {
  background: var(--card);
  border: 1px solid var(--divider);
  border-radius: 16px;
  padding: 28px;
  text-align: center;
}

.feature-icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.feature h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.feature p {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.5;
}

/* ── Screenshots Section ─────────────────── */

.screenshots-section {
  padding: 60px 0;
  text-align: center;
}

.screenshots-section h2 {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 40px;
}

.screenshots-wrapper {
  position: relative;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 56px;
}

.screenshots-track {
  display: flex;
  gap: 32px;
  justify-content: center;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 0 4px 8px;
}

.screenshots-track::-webkit-scrollbar {
  display: none;
}

.screenshot-card {
  flex-shrink: 0;
  scroll-snap-align: center;
  text-align: center;
  max-width: 240px;
}

.screenshot-frame {
  background: #000;
  border-radius: 28px;
  border: 3px solid #2a2a2a;
  box-shadow:
    0 0 0 1px #1a1a1a,
    0 12px 40px rgba(0,0,0,0.5);
  overflow: hidden;
  margin-bottom: 16px;
}

.screenshot-frame img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 25px;
}

.screenshot-card h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}

.screenshot-card p {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.4;
}

/* Arrow buttons */
.screenshots-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card);
  color: var(--text-2);
  border: 1px solid var(--divider);
  border-radius: 50%;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  z-index: 2;
}

.screenshots-arrow:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.screenshots-arrow--left {
  left: 8px;
}

.screenshots-arrow--right {
  right: 8px;
}

/* ── Auth Section ────────────────────────── */

.auth-section {
  padding: 0 24px 24px;
  text-align: center;
}

.auth-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.btn-auth {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: var(--card);
  color: var(--text-1);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  border: 1px solid var(--divider);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.btn-auth:hover {
  background: var(--surface);
  border-color: var(--accent);
}

.btn-save {
  padding: 12px 28px;
  font-size: 15px;
}

.btn-sign-out {
  background: none;
  border: none;
  color: var(--text-2);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.btn-sign-out:hover {
  color: var(--text-1);
}

.auth-status {
  margin-top: 12px;
  font-size: 14px;
  color: var(--text-2);
  min-height: 20px;
}

/* ── Demo Section ─────────────────────────── */

.demo-section {
  padding: 60px 24px 80px;
  text-align: center;
  background: linear-gradient(180deg, var(--bg) 0%, #0a1018 100%);
}

.demo-section h2 {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 8px;
}

.demo-hint {
  font-size: 14px;
  color: var(--text-2);
  margin-bottom: 40px;
}

/* Phone frame */
.phone-frame {
  position: relative;
  width: 390px;
  height: 844px;
  margin: 0 auto;
  background: #000;
  border-radius: 50px;
  border: 4px solid #2a2a2a;
  box-shadow:
    0 0 0 2px #1a1a1a,
    0 20px 60px rgba(0,0,0,0.6),
    inset 0 0 0 2px #333;
  overflow: hidden;
}

.phone-notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 160px;
  height: 34px;
  background: #000;
  border-radius: 0 0 24px 24px;
  z-index: 10;
}

.phone-frame iframe {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 46px;
  background: var(--bg);
}

/* ── Fullscreen Button ────────────────────── */

.btn-fullscreen {
  position: absolute;
  bottom: 16px;
  right: 16px;
  z-index: 20;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 25, 35, 0.85);
  color: var(--text-2);
  border: 1px solid var(--divider);
  border-radius: 10px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.btn-fullscreen:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(15, 25, 35, 0.95);
}

/* ── Fullscreen Overlay ──────────────────── */

.fullscreen-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  /* Use dvh so the overlay never extends behind browser / OS chrome */
  height: 100vh; /* fallback */
  height: 100dvh;
  z-index: 9999;
  background: var(--bg);
  flex-direction: column;
  /* Cover safe area notch/home indicator */
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  /* Prevent touch-through to page underneath */
  touch-action: none;
  overscroll-behavior: none;
}

.fullscreen-overlay.active {
  display: flex;
}

/* Lock the body when fullscreen is active */
body.fullscreen-active {
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: 100%;
}

.fullscreen-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: var(--card);
  border-bottom: 1px solid var(--divider);
  flex-shrink: 0;
  gap: 8px;
}

.fullscreen-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.fullscreen-actions .btn-auth {
  padding: 6px 14px;
  font-size: 13px;
  white-space: nowrap;
}

.fullscreen-actions .btn-save {
  padding: 6px 14px;
  font-size: 13px;
  white-space: nowrap;
}

.fullscreen-actions .btn-sign-out {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 160px;
}

.fullscreen-overlay .auth-status {
  text-align: center;
  padding: 4px 16px;
  font-size: 13px;
  flex-shrink: 0;
  min-height: 0;
}

.fullscreen-overlay .auth-status:empty {
  display: none;
}

.btn-exit-fullscreen {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  color: var(--text-2);
  border: 1px solid var(--divider);
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.btn-exit-fullscreen:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.fullscreen-iframe {
  flex: 1;
  width: 100%;
  border: none;
  background: var(--bg);
}

/* ── Footer ───────────────────────────────── */

.footer {
  padding: 32px 24px;
  text-align: center;
  border-top: 1px solid var(--divider);
}

.footer p {
  font-size: 13px;
  color: var(--text-2);
}

/* ── Responsive ───────────────────────────── */

/* Tablet */
@media (max-width: 960px) {
  .features {
    grid-template-columns: repeat(2, 1fr);
    max-width: 560px;
  }
}

/* Large phones / small tablets */
@media (max-width: 768px) {
  .screenshots-section {
    padding: 40px 0;
  }

  .screenshots-section h2 {
    font-size: 26px;
    margin-bottom: 28px;
  }

  .screenshots-wrapper {
    padding: 0 16px;
  }

  .screenshots-track {
    justify-content: flex-start;
    gap: 20px;
    padding: 0 4px 8px;
  }

  .screenshot-card {
    min-width: 200px;
    max-width: 200px;
  }

  /* Hide arrows on mobile — swipe instead */
  .screenshots-arrow {
    display: none;
  }
  .hero {
    padding: 60px 20px 48px;
  }

  h1 {
    font-size: 32px;
    letter-spacing: -0.5px;
  }

  h1 br {
    display: none;
  }

  .subtitle {
    font-size: 16px;
  }

  .subtitle br {
    display: none;
  }

  .features {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 40px 20px;
  }

  .feature {
    padding: 20px 16px;
  }

  .feature h3 {
    font-size: 16px;
  }

  .feature p {
    font-size: 13px;
  }

  .demo-section {
    padding: 40px 20px 60px;
  }

  .demo-section h2 {
    font-size: 26px;
  }

  .demo-hint {
    margin-bottom: 28px;
  }

  .phone-frame {
    width: 320px;
    height: 693px;
    border-radius: 42px;
  }

  .phone-frame iframe {
    border-radius: 38px;
  }

  .phone-notch {
    width: 130px;
    height: 28px;
  }
}

/* Small phones */
@media (max-width: 440px) {
  .screenshots-section {
    padding: 32px 0;
  }

  .screenshots-section h2 {
    font-size: 22px;
    margin-bottom: 20px;
  }

  .screenshots-wrapper {
    padding: 0 12px;
  }

  .screenshots-track {
    gap: 16px;
  }

  .screenshot-card {
    min-width: 180px;
    max-width: 180px;
  }

  .hero {
    padding: 48px 16px 36px;
  }

  .logo {
    margin-bottom: 24px;
  }

  .logo-icon {
    font-size: 28px;
  }

  .logo-text {
    font-size: 24px;
  }

  h1 {
    font-size: 26px;
  }

  .subtitle {
    font-size: 15px;
    margin-bottom: 28px;
  }

  .btn-primary {
    padding: 12px 28px;
    font-size: 15px;
    width: 100%;
    text-align: center;
  }

  .features {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 32px 16px;
  }

  .feature {
    display: flex;
    align-items: center;
    gap: 16px;
    text-align: left;
    padding: 16px 20px;
  }

  .feature-icon {
    font-size: 28px;
    margin-bottom: 0;
    flex-shrink: 0;
  }

  .feature-text {
    flex: 1;
  }

  .feature h3 {
    margin-bottom: 4px;
  }

  .demo-section {
    padding: 32px 16px 48px;
  }

  .demo-section h2 {
    font-size: 22px;
  }

  .demo-hint {
    font-size: 13px;
    margin-bottom: 24px;
  }

  .phone-frame {
    width: calc(100vw - 32px);
    max-width: 360px;
    height: calc(min(100vw - 32px, 360px) * 2.164);
    border-radius: 36px;
    border-width: 3px;
  }

  .phone-frame iframe {
    border-radius: 33px;
  }

  .phone-notch {
    width: 110px;
    height: 24px;
    border-radius: 0 0 18px 18px;
  }

  .footer {
    padding: 24px 16px;
  }
}
