#websites {
  padding: 48px 24px 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.header {
  text-align: center;
  margin-bottom: 12px;
}

#websites .header {
  margin-bottom: 6px;
}

.header h2 {
  font-size: 2.5rem;
  color: #333;
  margin: 0;
}

#websites h2::after {
  content: "";
  display: inline-block;
  width: 70%;
  max-width: 150px;
  min-width: 50px;
  height: 4px;
  background: var(--primary-color);
  margin: 4px auto 0;
  border-radius: 5px;
}

/* === Desktop Content Layout === */
.content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 1200px;
  width: 100%;
}

.left-text {
  flex: 1.3;
  display: flex;
  align-items: center;
  height: 100%;
  padding-left: clamp(24px, 4vw, 64px);
}

.left-text h3 {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 2.5rem;
  color: #333;
  text-transform: uppercase;
  white-space: normal;
  word-break: keep-all;
  line-height: 1.15;
  text-align: center;
  padding: 0 clamp(20px, 3vw, 44px);
}

.left-text .line-one {
  white-space: nowrap;
}

.cards-wrapper {
  flex: 0.7;
  display: flex;
  align-items: stretch;
  justify-content: center;
  width: 100%;
  position: relative;
  overflow: visible;
}

/* ============================================
   DESKTOP: LANDSCAPE PHONE FRAME (original)
   ============================================ */

.phone-frame {
  width: clamp(600px, 78vw, 860px);
  height: clamp(360px, 55vh, 520px);
  border: 12px solid #0f141c;
  border-radius: 44px;
  background: #0f141c;
  box-sizing: border-box;
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.55),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    inset 0 12px 26px rgba(0, 0, 0, 0.08),
    inset 0 -12px 24px rgba(0, 0, 0, 0.05),
    0 0 0 1px rgba(0, 0, 0, 0.85);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 0;
  overflow: visible;
  isolation: isolate;
  transform: translateX(clamp(16px, 6vw, 96px));
  transform-origin: center;
}

.phone-frame::selection {
  background: transparent;
}

/* Desktop bottom buttons */
.phone-frame::before,
.phone-frame::after {
  content: "";
  position: absolute;
  background: #d4d5d6;
  border-radius: 10px;
  height: 14px;
  clip-path: inset(8px 0 0 0);
  z-index: 3;
}

.phone-frame::before {
  width: 60px;
  left: 35%;
  bottom: -19px;
}

.phone-frame::after {
  width: 64px;
  right: 35%;
  bottom: -19px;
}

/* Desktop notch (left side, landscape) */
.phone-notch {
  position: absolute;
  top: 50%;
  left: 10px;
  transform: translateY(-50%);
  width: 30px;
  height: 130px;
  background: #0f141c;
  border-radius: 18px;
  box-shadow: inset 0 -2px 6px rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 12px 0;
  z-index: 3;
  overflow: hidden;
}

.phone-notch::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 58px;
  transform: translateX(-50%);
  width: 6px;
  height: 42px;
  background: #2a2f38;
  border-radius: 4px;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.12);
}

.phone-notch::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 20px;
  transform: translateX(-50%);
  width: 10px;
  height: 10px;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.4), rgba(0, 0, 0, 0.2) 70%);
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.6);
}

.phone-screen {
  width: 100%;
  height: 100%;
  background: #fff;
  border-radius: 32px;
  overflow: hidden;
  padding: 0;
  border: none;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  z-index: 2;
}

.phone-screen::before,
.phone-screen::after {
  display: none;
}

/* Hide side buttons, home bar, dots, phone-heading on desktop */
.phone-btn { display: none; }
.phone-home-bar { display: none; }
.card-dots { display: none; }
.phone-heading { display: none; }

/* === Desktop: horizontal scroll cards === */
.card-container {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  padding: 18px 16px 22px 16px;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-padding-left: 16px;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}

.card-container::-webkit-scrollbar {
  display: none;
}

.web-card {
  position: relative;
  display: grid;
  gap: 12px;
  align-content: center;
  justify-items: center;
  text-decoration: none;
  color: inherit;
  background: linear-gradient(150deg, #ffffff 0%, #f5f6fa 100%);
  border-radius: 0px;
  padding: 18px 16px 16px 16px;
  border: 1px solid #e8e9ed;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.14);
  scroll-snap-align: start;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  width: clamp(200px, 60vw, 220px);
  min-width: clamp(200px, 60vw, 220px);
  max-width: clamp(200px, 60vw, 220px);
  aspect-ratio: 3 / 4;
  height: auto;
  flex-shrink: 0;
}

.web-card:hover {
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.18);
  border-color: #dfe2e8;
}

.card-number {
  font-size: 13px;
  color: #747a88;
  position: absolute;
  top: 14px;
  left: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.card-icon,
.card-image {
  width: 100%;
  max-height: 180px;
  object-fit: contain;
  border-radius: 12px;
  background: transparent;
  padding: 8px;
  box-shadow: none;
}

.card-icon {
  margin: 10px 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.card-icon img {
  max-width: 100%;
  max-height: 100%;
}

.card-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.web-card h3 {
  font-size: 1.1rem;
  color: #1f242d;
  font-weight: 500;
}

.web-card p {
  font-size: 0.95rem;
  color: #555;
}

/* ============================================
   RESPONSIVE - tablet
   ============================================ */

@media (max-width: 1200px) {
  .content {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  .left-text {
    justify-content: center;
    text-align: center;
  }

  .left-text h3 {
    font-size: 2.1rem;
    line-height: 1.1;
  }

  .phone-frame {
    width: clamp(560px, 90vw, 820px);
    height: clamp(340px, 52vh, 480px);
    transform: none;
  }

  .card-container {
    padding: 16px 14px 20px 14px;
  }
}

@media (max-width: 768px) {
  .content {
    flex-direction: column;
  }

  .left-text {
    justify-content: center;
  }

  .left-text h3 {
    text-align: center;
    font-size: 2rem;
    line-height: 1.1;
  }

  .phone-frame {
    width: clamp(480px, 90vw, 720px);
    height: clamp(320px, 50vh, 440px);
    transform: none;
  }

  .card-container {
    gap: 14px;
    padding: 14px 14px 16px 14px;
    scroll-padding-left: 14px;
  }

  .web-card {
    width: clamp(180px, 70vw, 210px);
    min-width: clamp(180px, 70vw, 210px);
    max-width: clamp(180px, 70vw, 210px);
  }
}

/* ============================================
   MOBILE <=600px: PORTRAIT PHONE (like spottedonshorts.com)
   ============================================ */
@media (max-width: 600px) {
  #websites {
    padding: 36px 12px 48px;
  }

  .content {
    gap: 20px;
  }

  .cards-wrapper {
    overflow: visible;
    width: 100%;
    justify-content: center;
  }

  /* --- Switch to portrait iPhone-style frame --- */
  .phone-frame {
    width: min(320px, 82vw);
    height: min(720px, 90vh);
    border: 10px solid #1c1c1e;
    border-radius: 46px;
    background: linear-gradient(160deg, #3a3a3c 0%, #2c2c2e 30%, #1c1c1e 100%);
    padding: 0;
    transform: none;
    box-shadow:
      0 30px 60px -10px rgba(0, 0, 0, 0.4),
      0 0 0 1px rgba(255, 255, 255, 0.06),
      inset 0 1px 0 rgba(255, 255, 255, 0.05);
  }

  /* Hide desktop bottom buttons */
  .phone-frame::before,
  .phone-frame::after {
    display: none;
  }

  /* Show side buttons: 2 left (vol) + 1 right (power) */
  .phone-btn {
    display: block;
    position: absolute;
    z-index: 5;
  }

  .phone-btn-silent { display: none; }

  .phone-btn-vol-up {
    left: -14px;
    top: 130px;
    width: 4px;
    height: 40px;
    border-radius: 3px 0 0 3px;
    background: #cccccc;
    box-shadow: -1px 0 3px rgba(0, 0, 0, 0.4);
  }

  .phone-btn-vol-down {
    left: -14px;
    top: 182px;
    width: 4px;
    height: 40px;
    border-radius: 3px 0 0 3px;
    background: #cccccc;
    box-shadow: -1px 0 3px rgba(0, 0, 0, 0.4);
  }

  .phone-btn-power {
    right: -14px;
    top: 150px;
    width: 4px;
    height: 54px;
    border-radius: 0 3px 3px 0;
    background: #cccccc;
    box-shadow: 1px 0 3px rgba(0, 0, 0, 0.4);
  }

  /* Dynamic Island at top center */
  .phone-notch {
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    width: 86px;
    height: 24px;
    border-radius: 20px;
    background: #000;
    box-shadow: none;
    padding: 0;
    z-index: 10;
  }

  .phone-notch::before {
    left: auto;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, rgba(40, 60, 130, 0.6), #0a0a1a 65%);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
  }

  .phone-notch::after {
    display: none;
  }

  .phone-screen {
    border-radius: 36px;
    background: #f8f9ff;
  }

  /* Show home bar */
  .phone-home-bar {
    display: block;
    position: absolute;
    bottom: 7px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    z-index: 10;
  }

  /* --- Horizontal scrolling cards inside portrait phone --- */
  .card-container {
    flex-direction: row;
    align-items: center;
    gap: 14px;
    padding: 0px 14px 20px 14px; /* Removed top padding */
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-padding-left: 14px;
    flex: 1;
    height: auto;
    margin-top: 5px; /* Reduced margin top */
    margin-bottom: 40px; /* space for dots */
  }

  .web-card {
    width: min(240px, 68vw);
    min-width: min(240px, 68vw);
    max-width: min(240px, 68vw);
    height: auto;
    max-height: 90%;
    aspect-ratio: auto;
    padding: 16px;
    border-radius: 20px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
    scroll-snap-align: center;
    background: linear-gradient(160deg, #ffffff 0%, #f2f4fb 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .web-card .card-image {
    max-height: 220px;
    flex: 1;
    object-fit: contain;
  }

  .web-card h3 {
    font-size: 1.2rem;
    margin-top: 10px;
  }

  .web-card p {
    font-size: 0.95rem;
  }

  .card-number {
    font-size: 12px;
  }

  .left-text {
    display: none;
  }
  
  .phone-heading {
    display: block;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #1f242d;
    letter-spacing: 0.04em;
    line-height: 1.2;
    padding: 85px 12px 0; /* Positioned a little lower */
    margin-bottom: 0;
    z-index: 5;
    position: relative;
  }

  .card-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    position: absolute;
    bottom: 24px;
    left: 0;
    right: 0;
    z-index: 5;
  }

  .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.15);
    transition: background 0.3s ease, width 0.3s ease;
  }

  .dot.active {
    background: var(--primary-color);
    width: 18px;
    border-radius: 4px;
  }
}

@media (max-width: 480px) {
  .header h2 {
    font-size: 2rem;
  }

  .phone-frame {
    width: min(300px, 80vw);
    height: min(680px, 85vh);
    border-width: 9px;
    border-radius: 42px;
  }

  .phone-heading {
    font-size: 1.2rem;
    padding-top: 70px;
  }

  .phone-screen { border-radius: 33px; }

  .phone-notch { width: 78px; height: 22px; top: 12px; }
  .phone-home-bar { width: 88px; }

  .phone-btn-vol-up { top: 118px; height: 36px; left: -13px; }
  .phone-btn-vol-down { top: 164px; height: 36px; left: -13px; }
  .phone-btn-power { top: 136px; height: 48px; right: -13px; }

  .card-container {
    padding: 0px 14px 16px 14px;
    gap: 12px;
    flex: 1;
    height: auto;
    margin-top: 0px;
    margin-bottom: 30px;
  }

  .web-card {
    width: min(220px, 66vw);
    min-width: min(220px, 66vw);
    max-width: min(220px, 66vw);
    height: auto;
    max-height: 90%;
    padding: 14px 12px;
    border-radius: 16px;
  }

  .web-card .card-image {
    max-height: 180px;
  }

  .web-card h3 { font-size: 1.1rem; }
  .web-card p { font-size: 0.9rem; }

  .left-text h3 {
    font-size: 1.6rem;
    font-weight: 600;
  }
}

@media (max-width: 360px) {
  .phone-frame {
    width: min(270px, 78vw);
    height: min(600px, 85vh);
    border-width: 8px;
    border-radius: 38px;
  }

  .phone-heading {
    font-size: 1.1rem;
    padding-top: 60px;
  }

  .phone-screen { border-radius: 30px; }

  .phone-notch { width: 70px; height: 20px; top: 10px; }
  .phone-home-bar { width: 76px; bottom: 6px; }

  .phone-btn-vol-up { top: 108px; height: 32px; left: -12px; }
  .phone-btn-vol-down { top: 148px; height: 32px; left: -12px; }
  .phone-btn-power { top: 124px; height: 42px; right: -12px; }

  .card-container {
    padding: 0px 12px 12px 12px;
    gap: 10px;
    flex: 1;
    height: auto;
    margin-top: 0px;
    margin-bottom: 24px;
  }

  .web-card {
    width: min(200px, 64vw);
    min-width: min(200px, 64vw);
    max-width: min(200px, 64vw);
    height: auto;
    max-height: 90%;
    padding: 12px 10px;
    border-radius: 14px;
  }

  .web-card .card-image {
    max-height: 140px;
    padding: 4px;
  }

  .web-card h3 { font-size: 0.95rem; }
  .web-card p { font-size: 0.8rem; }
  .left-text h3 { font-size: 1.4rem; }
}