:root {
  --app-icon-size: 72px;
  --app-icon-radius: 18px;
  --phone-width: 270px;
  --phone-margin: 40px;
  --logo-size: 96px;
  --gap-size: 16px;
  --header-comment-margin: 32px;
  --title-size: 42px;
  --subtitle-margin: 28px;
  --card-width: 410px;
  --card-avatar-size: 132px;
}

@media (max-height: 850px) {
  :root {
    --app-icon-size: 64px;
    --app-icon-radius: 16px;
    --phone-width: 250px;
    --phone-margin: 24px;
    --logo-size: 80px;
    --gap-size: 14px;
    --header-comment-margin: 20px;
    --title-size: 36px;
    --subtitle-margin: 20px;
  }
}

@media (max-height: 720px) {
  :root {
    --app-icon-size: 52px;
    --app-icon-radius: 12px;
    --phone-width: 220px;
    --phone-margin: 16px;
    --logo-size: 64px;
    --gap-size: 10px;
    --header-comment-margin: 12px;
    --title-size: 30px;
    --subtitle-margin: 12px;
  }
}

@media (max-width: 1200px) {
  :root {
    --card-width: 356px;
    --card-avatar-size: 112px;
  }
}

@media (max-width: 1024px) {
  :root {
    --card-width: 310px;
    --card-avatar-size: 95px;
  }
}

/* ── Reset & Base ───────────────────────────────── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Roboto', sans-serif;
  background: #f5f5f0;
  color: #111;
  min-height: 100vh;
  margin: 0;
  padding: 48px 0;
  /* Space for the fixed warning tapes */
  overflow-x: hidden;
  /* Disable horizontal scroll */
  overflow-y: auto;
  /* Enable vertical scroll */
  display: flex;
  justify-content: center;
  align-items: center;
}

/* ── Construction Tape ─────────────────────────── */
.tape {
  position: fixed;
  left: 0;
  width: 100%;
  height: 32px;
  z-index: 1000;
  background: repeating-linear-gradient(45deg,
      #fff 0 22px,
      #111 22px 44px);
  background-size: 62.23px 62.23px;
  /* 44px * √2 for seamless diagonal tile */
  flex-shrink: 0;
}

.tape-top {
  top: 0;
  animation: tape-scroll-left 1.5s linear infinite;
}

.tape-bottom {
  bottom: 0;
  animation: tape-scroll-right 1.5s linear infinite;
}

/* ── Section Containers ──────────────── */
.scroll-container {
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  width: 100%;
}

/* ── Header Comment ────────────────────────────── */
.header-comment {
  font-family: 'Roboto Mono', monospace;
  font-size: 13px;
  color: #888;
  margin-bottom: var(--header-comment-margin);
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

/* ── Android Logo ──────────────────────────────── */
.android-logo {
  width: var(--logo-size);
  height: var(--logo-size);
  background: #111;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--gap-size);
  overflow: hidden;
  /* Crop the square SVG background */
  flex-shrink: 0;
}

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

/* ── Phone Frame ───────────────────────────────── */
.phone {
  width: var(--phone-width);
  border: 10px solid #111;
  border-radius: 40px;
  padding: 20px 18px 24px;
  background: #fff;
  position: relative;
  margin-bottom: var(--phone-margin);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.1),
    inset 0 0 0 1.5px rgba(0, 0, 0, 0.05);
  flex-shrink: 0;
}

/* Notch: speaker pill (base element) + camera lens punch-hole (box shadow) */
.phone::before {
  content: '';
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 4px;
  background: #111;
  border-radius: 2px;
  box-shadow: 0 8px 0 -1.5px #111;
  /* Adds the camera dot below the speaker */
  z-index: 10;
}

/* ── Status Bar ────────────────────────────────── */
.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 4px 12px;
  font-family: 'Roboto Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  color: #111;
}

.battery {
  width: 20px;
  height: 10px;
  border: 1.5px solid #111;
  border-radius: 2px;
  position: relative;
}

.battery::after {
  content: '';
  position: absolute;
  right: -4px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 5px;
  background: #111;
  border-radius: 0 1px 1px 0;
}

.battery-fill {
  position: absolute;
  left: 1px;
  top: 1px;
  bottom: 1px;
  width: 100%;
  background: #111;
  border-radius: 1px;
  transition: width 0.5s ease;
}

/* ── App Grid ──────────────────────────────────── */
.app-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap-size);
  justify-items: center;
}

/* Center the first icon across both columns */
.app-grid .app-icon:first-child {
  grid-column: 1 / -1;
  justify-self: center;
}

/* ── App Icon ──────────────────────────────────── */
.app-icon {
  width: var(--app-icon-size);
  height: var(--app-icon-size);
  border-radius: var(--app-icon-radius);
  background: #1a1a1a;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: transform 0.2s ease;
  text-decoration: none;
  color: inherit;
  display: block;
}

.app-icon:hover,
.app-icon.pinned {
  transform: scale(1.08);
  outline: 1.5px solid #111;
}

/* Profile image — greyscale + darkened by default */
.app-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) brightness(0.35);
  transition: filter 0.35s ease;
  display: block;
}

.app-icon:hover img,
.app-icon.pinned img {
  filter: grayscale(0) brightness(1);
}

/* Fallback person silhouette (shown when img fails to load or as overlay) */
.app-icon .fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.app-icon .fallback svg {
  width: 32px;
  height: 32px;
  fill: #666;
}

/* Fallback hidden via JS when image loads successfully */
.app-icon--empty .fallback {
  opacity: 1;
}

/* ── Coming Soon Text ──────────────────────────── */
.coming-soon {
  font-family: 'Roboto', sans-serif;
  font-size: var(--title-size);
  font-weight: 900;
  letter-spacing: -0.02em;
  text-align: center;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.subtitle {
  font-size: 15px;
  color: #555;
  text-align: center;
  line-height: 1.6;
  max-width: 420px;
  margin-bottom: var(--subtitle-margin);
  flex-shrink: 0;
}

/* ── Tags ──────────────────────────────────────── */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  flex-shrink: 0;
}

.tag {
  font-family: 'Roboto Mono', monospace;
  font-size: 13px;
  padding: 6px 14px;
  border: 1.5px solid #111;
  border-radius: 2px;
  background: transparent;
  color: #111;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}

a.tag:hover {
  background-color: #111;
  color: #fff;
}

/* ── Member Card ───────────────────────────────── */
.member-card {
  position: absolute;
  width: var(--card-width);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.member-card.active {
  opacity: 1;
  pointer-events: auto;
}

/* ── Connector (Stepped SVGs populated via JS) ── */
.card-connector {
  position: absolute;
  pointer-events: none;
}

/* Card content */
.card-content {
  display: flex;
  gap: 14px;
  padding: 16px;
  border: 1.5px solid #111;
  background: #fff;
}

.card-avatar {
  width: var(--card-avatar-size);
  height: var(--card-avatar-size);
  border-radius: 14px;
  background: #1a1a1a;
  overflow: hidden;
  flex-shrink: 0;
}

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

.card-avatar .fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-avatar .fallback svg {
  width: 36px;
  height: 36px;
  fill: #666;
}

.card-info {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.card-name {
  font-weight: 900;
  font-size: 22px;
  margin-bottom: 4px;
  line-height: 1.2;
}

.card-role {
  font-family: 'Roboto Mono', monospace;
  font-size: 15px;
  color: #666;
  margin-bottom: 14px;
}

.card-socials {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.card-socials a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Roboto Mono', monospace;
  font-size: 13px;
  color: #111;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.card-socials a:hover {
  opacity: 0.6;
}

.card-socials svg {
  width: 16px;
  height: 16px;
  fill: #111;
}

/* Modal Backdrop for Mobile Popup */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

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

/* Show cards as centered popups on mobile */
@media (max-width: 900px) {
  .member-card {
    position: fixed;
    top: 50% !important;
    left: 50% !important;
    right: auto !important;
    transform: translate(-50%, -50%) scale(0.9) !important;
    width: 90% !important;
    max-width: 320px !important;
    z-index: 2000 !important;
    transition: opacity 0.3s ease, transform 0.3s ease !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3) !important;
  }

  .member-card.active {
    opacity: 1 !important;
    transform: translate(-50%, -50%) scale(1) !important;
    pointer-events: auto !important;
  }

  .member-card .card-connector {
    display: none !important;
  }
}

/* Tablet / small desktop */
@media (max-width: 768px) {
  .content {
    padding: 20px 16px 40px;
  }

  .coming-soon {
    font-size: 36px;
  }

  .subtitle {
    font-size: 14px;
    max-width: 360px;
  }
}

/* Mobile */
@media (max-width: 480px) {
  .tape {
    height: 24px;
  }

  .header-comment {
    font-size: 11px;
    margin-bottom: 24px;
    text-align: center;
    padding: 0 8px;
  }

  .android-logo {
    width: 52px;
    height: 52px;
    margin-bottom: 20px;
  }

  .android-logo svg {
    width: 28px;
    height: 28px;
  }

  .phone {
    width: 230px;
    border: 8px solid #111;
    border-radius: 32px;
    padding: 16px 14px 20px;
    margin-bottom: 32px;
  }

  .phone::before {
    width: 28px;
    height: 3px;
    top: 5px;
    box-shadow: 0 6px 0 -1px #111;
  }



  .app-grid {
    gap: 12px;
  }

  .app-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
  }

  .app-icon .fallback svg {
    width: 28px;
    height: 28px;
  }

  .coming-soon {
    font-size: 30px;
    margin-bottom: 10px;
  }

  .subtitle {
    font-size: 13px;
    max-width: 300px;
    margin-bottom: 22px;
    padding: 0 8px;
  }

  .tags {
    gap: 8px;
  }

  .tag {
    font-size: 11px;
    padding: 5px 10px;
  }
}

/* Small mobile */
@media (max-width: 360px) {
  .content {
    padding: 16px 12px 32px;
  }

  .header-comment {
    font-size: 10px;
    margin-bottom: 20px;
  }

  .android-logo {
    width: 44px;
    height: 44px;
    margin-bottom: 16px;
  }

  .android-logo svg {
    width: 24px;
    height: 24px;
  }

  .phone {
    width: 200px;
    border: 6px solid #111;
    border-radius: 26px;
    padding: 12px 10px 16px;
    margin-bottom: 28px;
  }

  .phone::before {
    width: 22px;
    height: 2.5px;
    top: 4px;
    box-shadow: 0 5px 0 -1px #111;
  }



  .app-grid {
    gap: 10px;
  }

  .app-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
  }

  .app-icon .fallback svg {
    width: 24px;
    height: 24px;
  }

  .status-bar {
    font-size: 10px;
    padding: 6px 2px 10px;
  }

  .coming-soon {
    font-size: 24px;
  }

  .subtitle {
    font-size: 12px;
    max-width: 260px;
    line-height: 1.5;
  }

  .tag {
    font-size: 10px;
    padding: 4px 8px;
  }
}

/* ── Tape Animations ───────────────────────────── */
@keyframes tape-scroll-left {
  from {
    background-position: 0 0;
  }

  to {
    background-position: -62.23px 0;
  }
}

@keyframes tape-scroll-right {
  from {
    background-position: 0 0;
  }

  to {
    background-position: 62.23px 0;
  }
}
