/* ===================================================================
   Apple-style website — shared stylesheet for all 4 pages
   Responsive: desktop = horizontal layout, phone = stacked layout
   =================================================================== */

/* ---------- 1. Reset & base ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg:        #000000;
  --bg-soft:   #101010;
  --bg-card:   #1a1a1a;
  --bg-light:  #fbfbfd;
  --card-light:#f5f5f7;
  --text:      #f5f5f7;
  --text-dim:  #a1a1a6;
  --text-dark: #1d1d1f;
  --text-dark-dim:#6e6e73;
  --blue:      #2997ff;
  --blue-btn:  #0071e3;
  --radius:    18px;
  --maxw:      1024px;
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display",
               "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a   { text-decoration: none; color: inherit; }
ul  { list-style: none; }

/* a centered content wrapper used everywhere */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 22px;
}

/* link that looks like Apple's blue "Learn more >" */
.link {
  color: var(--blue);
  font-size: 17px;
}
.link::after { content: " \203A"; }
.link:hover { text-decoration: underline; }

/* ---------- 2. Buttons ---------- */
.btn {
  display: inline-block;
  border: none;
  cursor: pointer;
  font-size: 17px;
  padding: 8px 18px;
  border-radius: 980px;
  font-family: inherit;
}
.btn-blue  { background: var(--blue-btn); color: #fff; }
.btn-blue:hover { background: #0077ED; }
.btn-white { background: #fff; color: #000; }
.btn-white:hover { opacity: .9; }

/* ---------- 3. Header / navigation ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(0,0,0,.8);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  height: 48px;
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo svg { width: 16px; height: 18px; fill: var(--text); }
.nav-links {
  display: flex;
  gap: 34px;
  flex: 1;
  justify-content: center;
}
.nav-links a {
  font-size: 13px;
  color: var(--text);
  opacity: .85;
  padding: 4px 0;
}
.nav-links a:hover { opacity: 1; }
.nav-links a.active {
  opacity: 1;
  border-bottom: 1px solid var(--text);
}
.nav-icons { display: flex; gap: 22px; }
.nav-icons svg { width: 15px; height: 18px; fill: var(--text); opacity: .85; }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; }
.nav-toggle span {
  display: block; width: 18px; height: 1.5px;
  background: var(--text); margin: 4px 0;
}

/* ---------- 4. Generic section helpers ---------- */
.section        { padding: 70px 0; text-align: center; }
.section-light  { background: var(--bg-light); color: var(--text-dark); }
h1.hero-title   { font-size: 48px; font-weight: 600; letter-spacing: -.5px; }
.section h2 {
  font-size: 40px; font-weight: 600; letter-spacing: -.5px; margin-bottom: 6px;
}
.section .sub { font-size: 19px; color: var(--text-dim); margin-bottom: 30px; }
.section-light .sub { color: var(--text-dark-dim); }

/* placeholder image block (used until real photos are added) */
.ph {
  background: linear-gradient(135deg, #2a2a2c 0%, #3a3a3c 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #86868b;
  font-size: 13px;
  min-height: 120px;
  width: 100%;
}
.section-light .ph {
  background: linear-gradient(135deg, #e8e8ed 0%, #d2d2d7 100%);
  color: #86868b;
}

/* ---------- 5. HERO (Home) ---------- */
.hero {
  text-align: center;
  padding: 60px 0 90px;
  background: radial-gradient(circle at 50% 30%, #1c1c22 0%, #000 60%);
}
.hero-logo.animate {
  animation: heroLogoReveal 1.6s cubic-bezier(.2,.7,.2,1) .2s both;
}
@keyframes heroLogoReveal {
  from { opacity: 0; transform: scale(.85); }
  to   { opacity: 1; transform: scale(1); }
}
.hero .glow {
  width: 180px; height: 200px; margin: 0 auto 10px;
  background: radial-gradient(circle at 50% 45%, #ff9d5c, #b14cff 55%, transparent 70%);
  -webkit-mask: var(--apple-mask) center/contain no-repeat;
          mask: var(--apple-mask) center/contain no-repeat;
}
.hero .wwdc { font-size: 60px; font-weight: 700; letter-spacing: -1px;
  background: linear-gradient(180deg,#fff,#999); -webkit-background-clip: text;
  background-clip: text; color: transparent; margin-bottom: 16px; }
.hero p { font-size: 21px; color: var(--text); margin-bottom: 22px; line-height: 1.4; }
.hero .actions { display: flex; gap: 22px; justify-content: center; align-items: center; }

/* ---------- 6. Feature columns (Connect / Learn / Be inspired) ---------- */
.cols {
  display: flex;
  gap: 30px;
  justify-content: center;
  margin-top: 40px;
  flex-wrap: wrap;
}
.col { flex: 1; min-width: 200px; max-width: 280px; }
.col .ico {
  width: 28px; height: 28px; margin: 0 auto 14px; fill: currentColor;
}
.col h3 { font-size: 19px; margin-bottom: 6px; }
.col p  { font-size: 15px; color: var(--text-dim); }
.section-light .col p { color: var(--text-dark-dim); }

/* ---------- 7. Two-column promo band ---------- */
.band {
  display: flex; align-items: center; gap: 40px;
  background: var(--bg-soft);
  border-radius: var(--radius);
  padding: 50px; text-align: left;
  flex-wrap: wrap;
}
.band .copy { flex: 1; min-width: 260px; }
.band .copy h2 { font-size: 34px; margin-bottom: 16px; }
.band .copy p  { font-size: 16px; color: var(--text-dim); margin-bottom: 14px; }
.band .media { flex: 1; min-width: 260px; }
.band .media .ph { min-height: 240px; }

/* Band / banner with a full-bleed apple photo as the background */
.band-photo {
  position: relative;
  overflow: hidden;
  min-height: 360px;
}
.band-photo .copy {
  position: relative;
  z-index: 2;
  flex: 0 1 50%;
  max-width: 480px;
}
.band-photo .photo-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: right center;
  z-index: 1;
  pointer-events: none;
}

/* ---------- 8. Card grids (products / shows / topics) ---------- */
.grid {
  display: grid;
  gap: 20px;
  margin-top: 36px;
}
.grid-2 { grid-template-columns: repeat(2,1fr); }
.grid-3 { grid-template-columns: repeat(3,1fr); }
.grid-4 { grid-template-columns: repeat(4,1fr); }
.grid-5 { grid-template-columns: repeat(5,1fr); }
/* streaming-service logo row: 8 across on wide screens, degrades gracefully */
.grid-logos { grid-template-columns: repeat(8,1fr); }
@media (max-width: 1024px) { .grid-logos { grid-template-columns: repeat(4,1fr); } }
@media (max-width: 560px)  { .grid-logos { grid-template-columns: repeat(2,1fr); } }

.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 22px;
  text-align: left;
  display: flex;
  flex-direction: column;
  height: 330px;
}
.section-light .card { background: var(--card-light); }
.card .tag { color: #f56300; font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.card h3 { font-size: 20px; margin-bottom: 4px; }
.card .price, .card .desc { font-size: 13px; color: var(--text-dim); margin-bottom: 10px; }
.section-light .card .price,
.section-light .card .desc { color: var(--text-dark-dim); }
.card .ph { min-height: 150px; margin-top: auto; }
.card-img {
  width: 100%;
  flex: 1;
  min-height: 0;
  width: 100%;
  object-fit: contain;
  object-position: center;
  margin-top: 18px;
  display: block;
}
.card-img-wide {
  width: calc(100% + 44px);
  margin-left: -22px;
  margin-right: -22px;
}
.card .row { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }

/* category icon strip (Store / Support) */
.cats {
  display: flex; justify-content: center; gap: 38px;
  flex-wrap: wrap; margin-top: 30px;
}
.cat { text-align: center; font-size: 12px; color: inherit; }
.cat .ph { width: 40px; height: 40px; min-height: 40px; border-radius: 8px;
  margin: 0 auto 8px; }

/* service icons (Entertainment) */
.services {
  display: flex; justify-content: center; gap: 24px; flex-wrap: wrap;
  margin-top: 34px;
}
.service { width: 110px; }
.service .ph { width: 60px; height: 60px; min-height: 60px; border-radius: 14px;
  margin: 0 auto 10px; }
.service h4 { font-size: 14px; margin-bottom: 2px; }
.service p  { font-size: 12px; color: var(--text-dim); margin-bottom: 4px; }
.service img { transition: transform .4s cubic-bezier(.2,.8,.25,1); cursor: pointer; }
.service img:hover { transform: scale(1.18); }
.show-card { height: auto; }

/* full-width banner card */
.banner {
  background: var(--bg-soft);
  border-radius: var(--radius);
  padding: 44px; margin-top: 30px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 30px; text-align: left; flex-wrap: wrap;
}
.section-light .banner { background: var(--card-light); }
.banner .copy { flex: 1; min-width: 240px; }
.banner h3 { font-size: 26px; margin-bottom: 10px; }
.banner p  { font-size: 15px; color: var(--text-dim); margin-bottom: 12px; }
.section-light .banner p { color: var(--text-dark-dim); }
.banner .media { flex: 1; min-width: 220px; }

/* search box (Support hero) */
.search-box {
  display: flex; align-items: center; gap: 10px;
  background: #1d1d1f; border: 1px solid #424245;
  border-radius: 12px; padding: 14px 18px; max-width: 480px;
  margin: 26px 0;
}
.search-box input {
  background: none; border: none; outline: none;
  color: var(--text); font-size: 17px; width: 100%;
}
.search-box svg { width: 18px; height: 18px; fill: var(--text-dim); flex: none; }

/* ---------- 9. Footer ---------- */
.footer {
  background: #000;
  color: var(--text-dim);
  font-size: 12px;
  padding: 40px 0;
  border-top: 1px solid rgba(255,255,255,.08);
}
.footer-cols {
  display: grid;
  grid-template-columns: repeat(5,1fr);
  gap: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.footer-cols h5 { color: var(--text); font-size: 12px; margin-bottom: 10px; }
.footer-cols a { display: block; margin-bottom: 7px; color: var(--text-dim); }
.footer-cols a:hover { color: var(--text); }
.footer .legal { padding-top: 18px; line-height: 1.8; }

/* ===================================================================
   10. RESPONSIVE  — phone & tablet
   This is what keeps everything from "跑位" (breaking) on small screens.
   =================================================================== */
@media (max-width: 833px) {
  /* hamburger menu */
  .nav-links {
    position: fixed;
    top: 48px; left: 0; right: 0;
    background: rgba(0,0,0,.95);
    backdrop-filter: blur(20px);
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height .35s ease;
  }
  .nav-links.open { max-height: 340px; }
  .nav-links a { padding: 16px 0; width: 100%; text-align: center; font-size: 17px; }
  .nav-toggle { display: block; }

  /* shrink headings */
  h1.hero-title { font-size: 34px; }
  .hero .wwdc   { font-size: 40px; }
  .hero p       { font-size: 17px; }
  .section h2   { font-size: 28px; }
  .section .sub { font-size: 16px; }
  .section      { padding: 48px 0; }

  /* every multi-column grid collapses to a single column */
  .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }

  /* two-up where it still looks fine on phones */
  .cats { gap: 22px; }

  /* stack the side-by-side bands/banners */
  .band, .banner { flex-direction: column; padding: 30px; text-align: left; }
  .cols { flex-direction: column; align-items: center; }
  .col  { max-width: 100%; }

  /* footer columns stack into two */
  .footer-cols { grid-template-columns: 1fr 1fr; }

  .hero .actions { flex-direction: column; gap: 14px; }
}

/* mid screen: 4 & 5 column grids become 2 columns */
@media (min-width: 834px) and (max-width: 1024px) {
  .grid-5 { grid-template-columns: repeat(3,1fr); }
  .grid-4 { grid-template-columns: repeat(2,1fr); }
}

/* ===================================================================
   11. Scroll fade-in animation
   Elements start invisible + slightly lower, then fade up into place
   when they scroll into view (class .visible is added by JS).
   =================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .7s ease, transform .7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* stagger cards inside a grid so they appear one after another */
.grid .reveal:nth-child(2) { transition-delay: .08s; }
.grid .reveal:nth-child(3) { transition-delay: .16s; }
.grid .reveal:nth-child(4) { transition-delay: .24s; }
.grid .reveal:nth-child(5) { transition-delay: .32s; }

/* respect users who prefer no motion */
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ===== Video popup (modal) ===== */
.video-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.video-modal.open { display: flex; }
.video-modal-inner {
  position: relative;
  width: 100%;
  max-width: 960px;
}
.video-modal-inner video {
  width: 100%;
  height: auto;
  max-height: 80vh;
  border-radius: 18px;
  background: #000;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  display: block;
}
.video-modal-close {
  position: absolute;
  top: -46px;
  right: 0;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s;
}
.video-modal-close:hover { background: rgba(255, 255, 255, 0.3); }

/* ===== "More to explore" cards with background image ===== */
.explore-card {
  position: relative;
  min-height: 130px;
  border-radius: 18px;
  overflow: hidden;
  background-size: cover;
  background-position: right center;
  background-repeat: no-repeat;
  background-color: #0b0f1a;
  display: flex;
  align-items: center;
}
/* subtle left-to-right dark gradient so the text stays readable */
.explore-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(0,0,0,.82) 0%, rgba(0,0,0,.45) 42%, rgba(0,0,0,0) 70%);
  z-index: 1;
}
.explore-card .explore-copy {
  position: relative;
  z-index: 2;
  padding: 18px 22px;
  max-width: 58%;
}
.explore-card .explore-copy h3 {
  font-size: 18px;
  color: #fff;
  margin-bottom: 6px;
}
.explore-card .explore-copy .desc {
  font-size: 13px;
  color: rgba(255,255,255,.72);
  margin-bottom: 0;
}
.explore-card .explore-copy .link { color: #2997ff; }

@media (max-width: 700px) {
  .explore-card .explore-copy { max-width: 75%; }
}

/* ===== TV & Home — two full-bleed hero panels ===== */
.tvhome-hero {
  display: flex;
  gap: 20px;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 22px;
}
.tvhome-panel {
  position: relative;
  flex: 1;
  min-height: 600px;
  border-radius: var(--radius);
  overflow: hidden;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-color: #000;
  display: flex;
  align-items: flex-start;
}
/* left panel (Apple TV 4K): show the FULL photo (box + remote) anchored to the
   right. The photo's black background blends with the panel, so the copy sits
   on the black left area and the product stays fully visible on the right. */
.tvhome-hero .tvhome-panel:first-child {
  background-size: contain;
  background-position: right center;
}
/* subtle left-to-right dark scrim so overlaid text stays readable */
.tvhome-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(0,0,0,.5) 0%, rgba(0,0,0,.15) 35%, rgba(0,0,0,0) 55%);
  z-index: 1;
}
.tvhome-panel .tvhome-copy {
  position: relative;
  z-index: 2;
  padding: 12px 48px 60px;
  max-width: 440px;
  color: #fff;
}
.tvhome-panel .tvhome-copy .tvhome-eyebrow {
  min-height: 112px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.tvhome-panel .tvhome-copy h2 {
  font-size: 32px;
  line-height: 1.1;
  margin-bottom: 16px;
  color: #fff;
}
.tvhome-panel .tvhome-copy .tvhome-desc {
  font-size: 15px;
  line-height: 1.5;
  color: rgba(255,255,255,.72);
  max-width: 220px;
  margin-bottom: 0;
}

@media (max-width: 800px) {
  .tvhome-hero { flex-direction: column; }
  .tvhome-panel { min-height: 560px; }
  .tvhome-panel .tvhome-copy { padding: 40px 24px; }
}
