/* =============================================
   Apple-Inspired Landing Page
   Design system: Apple's minimal, typographic, generous whitespace
   ============================================= */

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', sans-serif;
  font-size: 17px;
  line-height: 1.47059;
  font-weight: 400;
  letter-spacing: -0.022em;
  color: #1d1d1f;
  background: #f5f5f7;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: #06c;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  display: block;
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  transition: background 0.3s ease;
  height: 44px;
}

.nav-container {
  max-width: 1024px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 22px;
}

.nav-logo {
  color: #f5f5f7;
  display: flex;
  align-items: center;
  opacity: 0.8;
  transition: opacity 0.2s;
  flex-shrink: 0;
}

.nav-logo:hover {
  opacity: 1;
  text-decoration: none;
}

.nav-logo svg {
  display: block;
  width: 14px;
  height: 18px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
}

.nav-links a {
  color: #f5f5f7;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: -.01em;
  opacity: 0.8;
  padding: 0 20px;
  transition: opacity 0.2s;
  line-height: 44px;
}

.nav-links a:hover {
  opacity: 1;
  text-decoration: none;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-shrink: 0;
}

.nav-icon {
  background: none;
  border: none;
  color: #f5f5f7;
  opacity: 0.8;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  transition: opacity 0.2s;
}

.nav-icon:hover {
  opacity: 1;
}

.nav-menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}

.nav-menu-toggle span {
  display: block;
  width: 16px;
  height: 1px;
  background: #f5f5f7;
  transition: transform 0.3s;
}

/* --- Hero Section --- */
.hero {
  position: relative;
  background: #000;
  color: #f5f5f7;
  text-align: center;
  padding: 120px 20px 60px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
}

.hero-eyebrow {
  display: block;
  font-size: 21px;
  font-weight: 400;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #86868b;
  margin-bottom: 12px;
}

.hero-title {
  font-size: 64px;
  font-weight: 700;
  letter-spacing: -0.005em;
  line-height: 1.0625;
  margin-bottom: 8px;
  background: linear-gradient(180deg, #fff 0%, #a6a6a6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 28px;
  font-weight: 400;
  letter-spacing: 0.004em;
  line-height: 1.10722;
  margin-bottom: 14px;
  color: #f5f5f7;
}

.hero-tagline {
  font-size: 17px;
  color: #86868b;
  margin-bottom: 24px;
}

.hero-cta {
  display: flex;
  gap: 18px;
  justify-content: center;
  flex-wrap: wrap;
}

/* --- Buttons --- */
.btn {
  display: inline-block;
  font-size: 17px;
  line-height: 1.17648;
  font-weight: 400;
  letter-spacing: -0.022em;
  padding: 12px 22px;
  border-radius: 980px;
  transition: all 0.2s;
  cursor: pointer;
  text-decoration: none;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: #0071e3;
  color: #fff;
  border: none;
}

.btn-primary:hover {
  background: #0077ed;
}

.btn-secondary {
  background: transparent;
  color: #2997ff;
  border: 1px solid #2997ff;
}

.btn-secondary:hover {
  background: #2997ff;
  color: #fff;
}

.btn-small {
  font-size: 14px;
  padding: 8px 16px;
}

/* --- Hero Image --- */
.hero-image-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1200px;
  margin: 40px auto 0;
}

.hero-image {
  width: 100%;
  height: 550px;
  background: radial-gradient(ellipse at center, #1a1a2e 0%, #000 100%);
  border-radius: 24px;
  position: relative;
  overflow: hidden;
}

.hero-image::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(0, 113, 227, 0.15) 0%, transparent 50%),
    linear-gradient(225deg, rgba(255, 45, 85, 0.1) 0%, transparent 50%);
  z-index: 1;
}

.hero-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 80% 30%, rgba(0, 113, 227, 0.08) 0%, transparent 50%);
  z-index: 2;
}

/* iPhone shape */
.hero-image .iphone-shape {
  position: absolute;
  bottom: -40px;
  left: 50%;
  transform: translateX(-50%);
  width: 340px;
  height: 600px;
  background: linear-gradient(180deg, #2c2c3a 0%, #1a1a2e 50%, #0d0d1a 100%);
  border-radius: 50px;
  z-index: 3;
  box-shadow:
    0 0 80px rgba(0, 113, 227, 0.3),
    0 0 200px rgba(0, 113, 227, 0.1),
    inset 0 0 30px rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.hero-image .iphone-shape::before {
  content: '';
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 140px;
  height: 28px;
  background: #000;
  border-radius: 14px;
  box-shadow: inset 0 0 4px rgba(255, 255, 255, 0.1);
}

.hero-image .iphone-shape::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 110px;
  height: 22px;
  background: #1a1a2e;
  border-radius: 0 0 11px 11px;
}

/* Screen glow */
.hero-image .screen-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 240px;
  height: 420px;
  background: radial-gradient(ellipse at center, rgba(0, 113, 227, 0.2) 0%, transparent 70%);
  border-radius: 30px;
  z-index: 4;
  animation: pulseGlow 3s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% { opacity: 0.6; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.03); }
}

/* Floating decorative elements */
.hero-image .float-dot {
  position: absolute;
  border-radius: 50%;
  z-index: 1;
  animation: float 6s ease-in-out infinite;
}

.hero-image .float-dot:nth-child(1) {
  width: 6px;
  height: 6px;
  background: #2997ff;
  top: 20%;
  left: 15%;
  opacity: 0.4;
  animation-delay: 0s;
}

.hero-image .float-dot:nth-child(2) {
  width: 4px;
  height: 4px;
  background: #ff2d55;
  top: 60%;
  right: 20%;
  opacity: 0.3;
  animation-delay: 1s;
}

.hero-image .float-dot:nth-child(3) {
  width: 8px;
  height: 8px;
  background: #ffd60a;
  top: 30%;
  right: 25%;
  opacity: 0.2;
  animation-delay: 2s;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

/* --- Generic Sections --- */
.section {
  position: relative;
  text-align: center;
  padding: 90px 20px 80px;
  background: #fff;
}

.section-dark {
  background: #000;
  color: #f5f5f7;
}

.section-dark .section-subtitle {
  color: #86868b;
}

.section-content {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.section-title {
  font-size: 56px;
  font-weight: 700;
  letter-spacing: -0.005em;
  line-height: 1.07143;
  margin-bottom: 8px;
}

.section-dark .section-title {
  background: linear-gradient(180deg, #fff 0%, #a6a6a6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-subtitle {
  font-size: 28px;
  font-weight: 400;
  letter-spacing: 0.004em;
  line-height: 1.10722;
  color: #6e6e73;
  margin-bottom: 18px;
}

.section-cta {
  display: flex;
  gap: 18px;
  justify-content: center;
  flex-wrap: wrap;
}

.section-image-wrapper {
  max-width: 900px;
  margin: 50px auto 0;
  position: relative;
  z-index: 1;
}

/* --- MacBook Section --- */
.macbook-section {
  overflow: hidden;
}

.macbook-image {
  height: 420px;
  background: linear-gradient(135deg, #1a1a2e 0%, #0d0d1a 100%);
  border-radius: 20px;
  position: relative;
  overflow: hidden;
}

/* MacBook shape */
.macbook-image::before {
  content: '';
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 520px;
  height: 340px;
  background: linear-gradient(135deg, #2c2c3a 0%, #3a3a4a 100%);
  border-radius: 16px;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Laptop screen */
.macbook-image::after {
  content: '';
  position: absolute;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%);
  width: 460px;
  height: 290px;
  background: linear-gradient(180deg, #1a1a3e 0%, #0d0d2a 100%);
  border-radius: 8px;
  box-shadow: inset 0 0 40px rgba(0, 113, 227, 0.15);
}

/* Keyboard area */
.macbook-keyboard {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  width: 340px;
  height: 12px;
  display: flex;
  gap: 4px;
  justify-content: center;
  flex-wrap: wrap;
  z-index: 2;
}

.macbook-keyboard span {
  width: 8px;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 1px;
}

/* Screen content */
.macbook-screen-content {
  position: absolute;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  text-align: center;
}

.macbook-screen-content .code-line {
  display: block;
  font-family: 'SF Mono', 'Courier New', monospace;
  font-size: 12px;
  color: rgba(0, 200, 100, 0.4);
  margin-bottom: 4px;
  letter-spacing: 0;
}

.macbook-screen-content .code-line:nth-child(2) { color: rgba(0, 150, 255, 0.4); margin-left: 15px; }
.macbook-screen-content .code-line:nth-child(3) { color: rgba(255, 200, 0, 0.3); margin-left: 30px; }
.macbook-screen-content .code-line:nth-child(4) { color: rgba(255, 100, 100, 0.3); margin-left: 15px; }

/* --- iPad Section --- */
.ipad-section {
  background: #fafafa;
}

.ipad-image {
  height: 420px;
  background: linear-gradient(135deg, #f0f0f5 0%, #e8e8ed 100%);
  border-radius: 20px;
  position: relative;
  overflow: hidden;
}

/* iPad shape */
.ipad-image::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 300px;
  height: 400px;
  background: linear-gradient(135deg, #fff 0%, #e0e0e5 100%);
  border-radius: 28px;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(0, 0, 0, 0.05);
}

/* iPad screen */
.ipad-image::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 260px;
  height: 360px;
  background: linear-gradient(180deg, #1a1a3e 0%, #0d0d2a 50%, #1a1a3e 100%);
  border-radius: 16px;
  box-shadow: inset 0 0 40px rgba(0, 113, 227, 0.1);
}

/* iPad camera dot */
.ipad-camera {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.05);
  z-index: 3;
  margin-top: -195px;
  margin-left: -100px;
}

.ipad-camera::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.08);
}

/* --- Grid Section --- */
.grid-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  max-width: 1200px;
  margin: 16px auto;
  padding: 0 16px;
}

.grid-item {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  min-height: 520px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 50px 30px 30px;
  background: #fff;
  transition: transform 0.3s ease;
}

.grid-item:hover {
  transform: scale(1.01);
}

.grid-item-content {
  position: relative;
  z-index: 2;
}

.watch-logo svg {
  width: 80px;
  height: auto;
  fill: #1d1d1f;
}

.grid-item-series {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: #bf4800;
  margin-top: 8px;
  margin-bottom: 6px;
}

.grid-item-title {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.003em;
  margin-bottom: 4px;
}

.grid-item-desc {
  font-size: 19px;
  font-weight: 400;
  color: #6e6e73;
  margin-bottom: 16px;
}

.grid-item-cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.grid-item-image {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60%;
  z-index: 1;
}

/* Watch grid image */
.watch-image {
  background: radial-gradient(ellipse at 50% 100%, #f0ead6 0%, transparent 70%);
}

.watch-image::before {
  content: '';
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 160px;
  background: linear-gradient(180deg, #e8e0c8 0%, #d4cbb0 100%);
  border-radius: 30px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.watch-image::after {
  content: '';
  position: absolute;
  bottom: 45px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 130px;
  background: linear-gradient(180deg, #1a1a3e 0%, #0d0d2a 100%);
  border-radius: 24px;
  box-shadow: inset 0 0 20px rgba(0, 113, 227, 0.1);
}

/* AirPods grid image */
.airpods-image {
  background: radial-gradient(ellipse at 50% 100%, #f0f0f5 0%, transparent 70%);
}

.airpods-image::before {
  content: '';
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 120px;
  background: linear-gradient(180deg, #fff 0%, #e0e0e5 100%);
  border-radius: 20px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.airpods-image::after {
  content: '';
  position: absolute;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 100px;
  background: linear-gradient(180deg, #f5f5f7 0%, #e0e0e5 100%);
  border-radius: 16px;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.05);
}

/* Mac mini grid image */
.macmini-image {
  background: radial-gradient(ellipse at 50% 100%, #e8e8ed 0%, transparent 70%);
}

.macmini-image::before {
  content: '';
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  width: 130px;
  height: 90px;
  background: linear-gradient(180deg, #3a3a4a 0%, #2c2c3a 100%);
  border-radius: 8px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.macmini-image::after {
  content: '';
  position: absolute;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #30d158;
  box-shadow: 0 0 8px rgba(48, 209, 88, 0.5);
}

/* Trade-in grid image */
.tradein-image {
  background: radial-gradient(ellipse at 50% 100%, #f0f0f5 0%, transparent 70%);
}

/* Grid item dark variant */
.grid-item-watch .grid-item-title,
.grid-item-watch .grid-item-desc {
  color: #1d1d1f;
}

.grid-item-airpods .grid-item-title {
  color: #1d1d1f;
}

/* Dark grid items */
.grid-item-watch,
.grid-item-airpods,
.grid-item-macmini,
.grid-item-tradein {
  background: #fff;
}

/* --- Footer --- */
.footer {
  background: #f5f5f7;
  border-top: 1px solid #d2d2d7;
  padding: 20px 0;
  font-size: 12px;
  color: #6e6e73;
}

.footer-content {
  max-width: 1024px;
  margin: 0 auto;
  padding: 0 22px;
}

.footer-notes {
  padding-bottom: 12px;
  border-bottom: 1px solid #d2d2d7;
  margin-bottom: 16px;
}

.footer-notes p {
  line-height: 1.33337;
  margin-bottom: 8px;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid #d2d2d7;
  margin-bottom: 16px;
}

.footer-col h4 {
  font-size: 12px;
  font-weight: 600;
  color: #1d1d1f;
  margin-bottom: 6px;
}

.footer-col a {
  display: block;
  color: #515154;
  line-height: 1.66667;
  font-size: 12px;
}

.footer-col a:hover {
  color: #1d1d1f;
  text-decoration: none;
}

.footer-col h4 + h4 {
  margin-top: 16px;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-bottom p {
  color: #6e6e73;
}

.footer-bottom-links {
  display: flex;
  gap: 16px;
}

.footer-bottom-links a {
  color: #515154;
}

.footer-bottom-links a:hover {
  color: #1d1d1f;
  text-decoration: none;
}

.footer-bottom-links a + a {
  padding-left: 16px;
  border-left: 1px solid #d2d2d7;
}

/* --- Scroll Animations --- */
.fade-in-up {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.2, 0.9, 0.3, 1),
              transform 0.8s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-in-up:nth-child(2) { transition-delay: 0.1s; }
.fade-in-up:nth-child(3) { transition-delay: 0.2s; }
.fade-in-up:nth-child(4) { transition-delay: 0.3s; }
.fade-in-up:nth-child(5) { transition-delay: 0.4s; }

/* --- Responsive --- */
@media (max-width: 1024px) {
  .nav-links a {
    padding: 0 12px;
  }
}

@media (max-width: 834px) {
  .nav-links {
    display: none;
  }

  .nav-menu-toggle {
    display: flex;
  }

  .hero-title {
    font-size: 48px;
  }

  .hero-subtitle {
    font-size: 24px;
  }

  .section-title {
    font-size: 40px;
  }

  .section-subtitle {
    font-size: 21px;
  }

  .grid-section {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 0 12px;
  }

  .grid-item {
    min-height: 440px;
  }

  .footer-links {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-image {
    height: 400px;
  }

  .hero-image .iphone-shape {
    width: 240px;
    height: 420px;
    border-radius: 36px;
  }

  .hero-image .screen-glow {
    width: 180px;
    height: 320px;
  }

  .macbook-image::before {
    width: 400px;
    height: 260px;
  }

  .macbook-image::after {
    width: 350px;
    height: 220px;
  }

  .macbook-image {
    height: 320px;
  }

  .ipad-image {
    height: 320px;
  }

  .ipad-image::before {
    width: 220px;
    height: 300px;
  }

  .ipad-image::after {
    width: 190px;
    height: 270px;
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 100px 16px 40px;
  }

  .hero-title {
    font-size: 36px;
  }

  .hero-subtitle {
    font-size: 20px;
  }

  .hero-tagline {
    font-size: 15px;
  }

  .section-title {
    font-size: 32px;
  }

  .section-subtitle {
    font-size: 18px;
  }

  .section {
    padding: 60px 16px 50px;
  }

  .grid-item {
    min-height: 380px;
    padding: 30px 20px 20px;
  }

  .grid-item-title {
    font-size: 26px;
  }

  .grid-item-desc {
    font-size: 16px;
  }

  .footer-links {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .footer-bottom-links {
    flex-wrap: wrap;
    justify-content: center;
  }

  .hero-image {
    height: 300px;
  }

  .hero-image .iphone-shape {
    width: 180px;
    height: 320px;
    border-radius: 28px;
  }

  .hero-image .screen-glow {
    width: 140px;
    height: 240px;
  }

  .macbook-image::before {
    width: 300px;
    height: 200px;
  }

  .macbook-image::after {
    width: 260px;
    height: 170px;
  }

  .macbook-image {
    height: 260px;
  }

  .ipad-image::before {
    width: 180px;
    height: 240px;
  }

  .ipad-image::after {
    width: 155px;
    height: 215px;
  }

  .ipad-image {
    height: 260px;
  }

  .btn {
    font-size: 15px;
    padding: 10px 18px;
  }

  .hero-eyebrow {
    font-size: 16px;
  }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .fade-in-up {
    opacity: 1;
    transform: none;
  }

  html {
    scroll-behavior: auto;
  }
}
