/**
 * mspaint / dcus - iPhone 17 & iPad Air Device Presentation Styles
 */

/* --------------------------------------------------------------------------
   Mobile & Tablet Section
   -------------------------------------------------------------------------- */
.devices-section {
  position: relative;
  min-height: 140vh;
  padding: 100px 24px 160px;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow: hidden;
  z-index: 5;
}

/* Ambient glow removed to maintain theme unity */
.devices-glow {
  display: none;
}

/* Section Header */
.devices-header {
  position: relative;
  z-index: 5;
  text-align: center;
  max-width: 760px;
  margin-bottom: 60px;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.devices-header.active {
  opacity: 1;
  transform: translateY(0);
}

.devices-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 13px;
  font-weight: 500;
  color: #a1a1aa;
  letter-spacing: 0.01em;
  margin-bottom: 16px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.devices-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}

.devices-title {
  font-size: clamp(34px, 4.4vw, 52px);
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 16px;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
}

.devices-title span {
  color: #ffffff;
  background: none;
  -webkit-text-fill-color: initial;
}

.devices-sub {
  font-size: clamp(15px, 1.8vw, 18px);
  color: #a1a1aa;
  font-weight: 400;
  line-height: 1.6;
  max-width: 600px;
  margin: 0 auto;
}

/* --------------------------------------------------------------------------
   Devices Stage (Interactive Playground)
   -------------------------------------------------------------------------- */
.devices-stage {
  position: relative;
  width: 100%;
  max-width: 1540px;
  height: 740px;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 2000px;
  z-index: 5;
}

/* --------------------------------------------------------------------------
   iPad Air Frame (Ultra High-Res 860x600 Landscape Mode)
   -------------------------------------------------------------------------- */
.ipad-wrap {
  position: absolute;
  right: 1.5%;
  top: 48%;
  transform: translateY(-50%) translateX(360px) rotateY(-18deg) rotateX(6deg) scale(0.92);
  opacity: 0;
  z-index: 2;
  will-change: transform, opacity;
  transition: transform 1.1s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.9s ease;
}

.ipad-wrap.in-view {
  transform: translateY(-50%) translateX(0px) rotateY(-8deg) rotateX(3deg) scale(1);
  opacity: 1;
}

.ipad-frame {
  position: relative;
  width: 860px;
  height: 600px;
  border-radius: 42px;
  background: linear-gradient(145deg, #2a2a30, #141418 50%, #0c0c0e);
  padding: 13px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.16),
    0 0 0 3px #18181c,
    0 35px 95px rgba(0, 0, 0, 0.92);
}

.ipad-screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 30px;
  overflow: hidden;
  background: #000;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.ipad-camera {
  position: absolute;
  top: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #08080c;
  border: 1px solid rgba(255, 255, 255, 0.15);
  z-index: 10;
}

.ipad-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  image-rendering: auto;
  image-rendering: high-quality;
  image-rendering: -webkit-optimize-contrast;
  transform: translate3d(0, 0, 0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

/* --------------------------------------------------------------------------
   iPhone 17 Frame (Ultra High-Res 760x350 Landscape 3D Slant with Ultra-Thin 1/3 Bezel)
   -------------------------------------------------------------------------- */
.iphone-wrap {
  position: absolute;
  left: 1.5%;
  top: 56%;
  transform: translateY(-50%) translateX(-400px) rotateY(24deg) rotateX(10deg) rotateZ(-4deg) scale(0.9);
  opacity: 0;
  z-index: 6;
  will-change: transform, opacity;
  transition: transform 1.1s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.9s ease;
}

.iphone-wrap.in-view {
  transform: translateY(-50%) translateX(0px) rotateY(10deg) rotateX(4deg) rotateZ(-1.5deg) scale(1);
  opacity: 1;
}

/* Reduced bezel to 3.5px (1/3 of original size) */
.iphone-frame {
  position: relative;
  width: 250px;
  height: 520px;
  border-radius: 46px;
  background: linear-gradient(145deg, #44444e, #1a1a20 40%, #0c0c0f);
  padding: 3.5px; /* 1/3 bezel thickness */
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.25),
    0 0 0 1.5px #18181c,
    0 35px 85px rgba(0, 0, 0, 0.85);
}

/* Landscape Mode (Matches 2556x1179 wallpaper_mobile.png resolution) */
.iphone-frame.landscape {
  width: 760px;
  height: 350px;
  border-radius: 50px;
}

/* Dynamic Island Notch */
.dynamic-island {
  position: absolute;
  top: 9px;
  left: 50%;
  transform: translateX(-50%);
  width: 76px;
  height: 20px;
  background: #000000;
  border-radius: 14px;
  z-index: 20;
  box-shadow: 0 0 0 0.5px rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 11px;
  pointer-events: auto;
  cursor: pointer;
}

.iphone-frame.landscape .dynamic-island {
  top: 50%;
  left: 10px;
  width: 24px;
  height: 94px;
  transform: translateY(-50%);
  flex-direction: column;
  padding: 12px 0;
  border-radius: 16px;
}

.dynamic-lens {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #06060c;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 0 2.5px rgba(80, 130, 255, 0.7);
}

.dynamic-sensor {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #080810;
  box-shadow: inset 0 0 1px rgba(255, 255, 255, 0.15);
}

.iphone-screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 46.5px;
  overflow: hidden;
  background: #000000;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.iphone-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  image-rendering: auto;
  image-rendering: high-quality;
  image-rendering: -webkit-optimize-contrast;
  transform: translate3d(0, 0, 0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

/* --------------------------------------------------------------------------
   Feature Highlights Grid under Devices
   -------------------------------------------------------------------------- */
.devices-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 960px;
  width: 100%;
  margin-top: 48px;
  position: relative;
  z-index: 5;
}

/* --------------------------------------------------------------------------
   Script Features Section (X-Form Camera Roll Stream)
   -------------------------------------------------------------------------- */
.features-cross-section {
  position: relative;
  width: 100%;
  padding: 110px 0 150px 0;
  overflow: hidden;
  background: transparent;
}

.features-cross-header {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 60px auto;
  padding: 0 24px;
  position: relative;
  z-index: 5;
}

.features-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #a1a1aa;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.features-cross-title {
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.03em;
  margin: 0 0 14px 0;
  line-height: 1.15;
}

.features-cross-sub {
  font-size: 16px;
  color: #a1a1aa;
  line-height: 1.6;
  margin: 0;
}

/* X-Form Crossing Viewport */
.cross-roll-viewport {
  position: relative;
  width: 100%;
  height: 480px;
  overflow: hidden;
  padding: 0;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 14%, black 86%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0%, black 14%, black 86%, transparent 100%);
}

.cross-roll-track {
  position: absolute;
  top: 50%;
  left: -20%;
  width: 140%;
  display: flex;
  overflow: hidden;
  user-select: none;
  pointer-events: auto;
}

.cross-roll-track.track-top {
  transform: translateY(-50%) rotate(-7deg);
  z-index: 2;
}

.cross-roll-track.track-bottom {
  transform: translateY(-50%) rotate(7deg);
  z-index: 3;
}

.cross-roll-strip {
  display: flex;
  gap: 24px;
  flex-shrink: 0;
  padding-right: 24px;
  animation: rollMarquee 46s linear infinite;
  will-change: transform;
}

.cross-roll-strip.reverse {
  animation: rollMarqueeReverse 46s linear infinite;
}

.cross-roll-track:hover .cross-roll-strip {
  animation-play-state: paused;
}

@keyframes rollMarquee {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-100%, 0, 0); }
}

@keyframes rollMarqueeReverse {
  0% { transform: translate3d(-100%, 0, 0); }
  100% { transform: translate3d(0, 0, 0); }
}

/* Camera Roll Film Card Aesthetic */
.roll-card {
  width: 320px;
  flex-shrink: 0;
  background: rgba(18, 18, 22, 0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 16px 20px 20px 20px;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.roll-card:hover {
  transform: translateY(-5px) scale(1.02);
  border-color: rgba(255, 255, 255, 0.24);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 24px rgba(255, 255, 255, 0.06);
}

/* Film Perforation Bar */
.roll-film-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.12);
}

.roll-sprockets {
  display: flex;
  gap: 5px;
}

.roll-sprocket {
  width: 8px;
  height: 5px;
  border-radius: 1.5px;
  background: rgba(255, 255, 255, 0.16);
}

.roll-frame-num {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #71717a;
}

.roll-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: #d4d4d8;
}

.roll-title {
  font-size: 17px;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 6px 0;
  letter-spacing: -0.01em;
}

.roll-desc {
  font-size: 13px;
  color: #a1a1aa;
  line-height: 1.5;
  margin: 0;
}

/* --------------------------------------------------------------------------
   Responsive Layout for Mobile / Tablets
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .devices-stage {
    height: 640px;
    flex-direction: column;
  }

  .ipad-wrap {
    right: auto;
    left: 50%;
    top: 35%;
    transform: translate(-50%, -50%) scale(0.72) translateY(50px);
  }

  .ipad-wrap.in-view {
    transform: translate(-50%, -50%) scale(0.72) translateY(0);
  }

  .iphone-wrap {
    left: 50%;
    top: 72%;
    transform: translate(-50%, -50%) scale(0.85) translateY(60px);
  }

  .iphone-wrap.in-view {
    transform: translate(-50%, -50%) scale(0.85) translateY(0);
  }

  .devices-features {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 0 10px;
  }
}
