:root {
  --ap-blue: #0071e3;
  --ap-blue-dk: #0058b0;
  --ap-black: #1d1d1f;
  --ap-gray: #f5f5f7;
  --ap-text: #6e6e73;
  --ap-border: rgba(0, 0, 0, .08);
  --ap-radius: 20px;
}

.apple-page {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
  color: var(--ap-text);
  overflow-wrap: break-word;
}

.apple-page section {
  scroll-margin-top: 90px;
}

html {
  scroll-behavior: smooth;
}

/* ── BUTTONS ── */
.btn-apple,
.btn-apple:visited {
  display: inline-block;
  padding: .6rem 1.5rem;
  border: 2px solid var(--ap-blue);
  border-radius: 980px;
  background: var(--ap-blue);
  color: #fff;
  font-size: .95rem;
  font-weight: 500;
  transition: background .2s, border-color .2s, transform .15s;
}

.btn-apple:hover,
.btn-apple:focus {
  border-color: var(--ap-blue-dk);
  background: var(--ap-blue-dk);
  color: #fff;
  transform: translateY(-1px);
}

.btn-apple-sm {
  padding: .45rem 1.15rem;
  font-size: .875rem;
}

.btn-apple-outline,
.btn-apple-outline:visited {
  display: inline-block;
  padding: .6rem 1.5rem;
  border: 2px solid var(--ap-blue);
  border-radius: 980px;
  background: transparent;
  color: var(--ap-blue);
  font-size: .95rem;
  font-weight: 500;
  text-decoration: none;
  transition: background .2s, color .2s, transform .15s;
}

.btn-apple-outline:hover,
.btn-apple-outline:focus {
  background: var(--ap-blue);
  color: #fff;
  transform: translateY(-1px);
}

/* ── HERO ── */
.ap-hero {
  padding: 3.5rem 0;
  background: var(--ap-gray);
  overflow: hidden;
}

.ap-hero-logo {
  width: 44px;
  margin-bottom: 1.25rem;
  opacity: .85;
}

.ap-hero h1 {
  margin-bottom: .5rem;
  color: var(--ap-black);
  font-size: clamp(2.6rem, 6vw, 4rem);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.05;
}

.ap-hero-lead {
  margin-bottom: .75rem;
  color: var(--ap-black);
  font-size: clamp(1.15rem, 2.2vw, 1.5rem);
  font-weight: 600;
  letter-spacing: -.01em;
}

.ap-hero-text {
  max-width: 460px;
  margin: 0 auto 1.75rem;
  font-size: 1.05rem;
  line-height: 1.6;
}

.ap-hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .75rem;
}

.ap-hero-visual {
  position: relative;
  max-width: 560px;
  min-height: 300px;
  margin: 0 auto;
}

.ap-hero-img {
  position: absolute;
  height: auto;
}

.ap-hero-img-main {
  top: 0;
  left: 18%;
  width: 62%;
}

.ap-hero-img-ipad {
  right: 0;
  bottom: 0;
  width: 34%;
}

.ap-hero-img-imac {
  bottom: 0;
  left: 0;
  width: 36%;
}

@media (min-width: 992px) {
  .ap-hero-text {
    margin-left: 0;
  }

  .ap-hero-actions {
    justify-content: flex-start;
  }

  .ap-hero-visual {
    min-height: 380px;
  }
}

/* ── QUICK NAV ── */
.ap-quicknav {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: .75rem 0;
  background: rgba(255, 255, 255, .85);
  border-bottom: 1px solid var(--ap-border);
  backdrop-filter: saturate(180%) blur(14px);
}

.ap-quicknav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .25rem .5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ap-quicknav a {
  display: inline-block;
  padding: .3rem .85rem;
  border-radius: 980px;
  color: var(--ap-black);
  font-size: .875rem;
  font-weight: 500;
  text-decoration: none;
  transition: background .2s, color .2s;
}

.ap-quicknav a:hover,
.ap-quicknav a:focus-visible {
  background: var(--ap-black);
  color: #fff;
}

/* ── SECTIONS / HEADINGS ── */
.ap-section {
  padding: 3.5rem 0;
  background: #fff;
}

.ap-section-alt {
  background: var(--ap-gray);
}

.ap-heading {
  margin-bottom: 2rem;
  text-align: center;
}

.ap-heading h2 {
  margin: 0;
  color: var(--ap-black);
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -.02em;
}

.ap-heading-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin-bottom: .9rem;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .08);
  color: var(--ap-blue);
  font-size: 1.3rem;
}

.ap-section-alt .ap-heading-icon {
  background: #fff;
}

/* ── LATEST ── */
.ap-new {
  padding: 3.5rem 0;
  background: var(--ap-black);
}

.ap-heading-light h2 {
  color: #fff;
}

.ap-new-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  height: 100%;
  padding: 1.5rem 1.4rem;
  background: #2a2a2d;
  border-radius: var(--ap-radius);
  transition: transform .25s ease, background .25s ease;
}

.ap-new-card:hover {
  transform: translateY(-4px);
  background: #323236;
}

.ap-new-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  margin-bottom: 1rem;
  border-radius: 12px;
  background: rgba(41, 151, 255, .16);
  color: #2997ff;
  font-size: 1.15rem;
}

.ap-new-card h3 {
  margin-bottom: .35rem;
  color: #f5f5f7;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -.01em;
}

.ap-new-line {
  margin-bottom: .6rem;
  color: #d2d2d7;
  font-size: .95rem;
  line-height: 1.5;
}

.ap-new-avail {
  margin-bottom: .9rem;
  color: #a1a1a6;
  font-size: .8rem;
  line-height: 1.45;
}

.ap-new-card .btn {
  margin-top: auto;
}

/* ── PRODUCT CARDS ── */
.ap-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1.75rem 1.5rem 1.5rem;
  background: var(--ap-gray);
  border-radius: var(--ap-radius);
  transition: transform .25s ease, box-shadow .25s ease;
}

.ap-section-alt .ap-card {
  background: #fff;
}

.ap-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, .1);
}

.ap-card-img {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 210px;
  margin-bottom: 1.25rem;
  padding: 1rem;
  overflow: hidden;
  border-radius: 14px;
  background: #fff;
}

.ap-section-alt .ap-card-img {
  background: var(--ap-gray);
}

.ap-card-img img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.ap-card h3 {
  margin-bottom: .2rem;
  color: var(--ap-black);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -.01em;
}

.ap-card-sub {
  margin-bottom: .4rem;
  color: var(--ap-text);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.ap-card-tag {
  margin-bottom: .75rem;
  color: var(--ap-black);
  font-size: 1rem;
  line-height: 1.45;
}

.ap-card-specs {
  flex-grow: 1;
  margin: 0 0 1.25rem;
  padding-left: 1.1rem;
  color: var(--ap-text);
  font-size: .875rem;
  line-height: 1.65;
}

.ap-card-specs li {
  margin-bottom: .2rem;
}

.ap-card .btn {
  align-self: flex-start;
}

/* ── SEGMENTS ── */
.ap-segment {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  height: 100%;
  padding: 1.5rem 1.4rem;
  background: var(--ap-gray);
  border-radius: var(--ap-radius);
  transition: transform .25s ease, box-shadow .25s ease;
}

.ap-segment:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, .1);
}

.ap-segment .ap-new-icon {
  background: #fff;
  color: var(--ap-blue);
}

.ap-segment h3 {
  margin-bottom: 1rem;
  color: var(--ap-black);
  font-size: 1.2rem;
  font-weight: 600;
}

/* ── CTA ── */
.ap-cta {
  padding: 3rem 0;
  background: var(--ap-black);
}

.ap-cta h2 {
  margin-bottom: .5rem;
  color: #fff;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 600;
  letter-spacing: -.02em;
}

.ap-cta p {
  margin: 0;
  color: #a1a1a6;
}

.ap-cta .btn-apple {
  border-color: #fff;
  background: #fff;
  color: var(--ap-black);
}

.ap-cta .btn-apple:hover {
  border-color: var(--ap-gray);
  background: var(--ap-gray);
  color: var(--ap-black);
}

/* ── COMPACT PRODUCT CARDS ── */
.ap-section .row.justify-content-center {
  max-width: 1080px;
  margin-right: auto;
  margin-left: auto;
}

.ap-card {
  padding: 1.25rem 1.2rem 1.15rem;
}

.ap-card-img {
  height: 150px;
  margin-bottom: .9rem;
  padding: .6rem;
}

.ap-card h3 {
  font-size: 1.15rem;
}

.ap-card-sub {
  margin-bottom: .3rem;
  font-size: .72rem;
}

.ap-card-tag {
  margin-bottom: .5rem;
  font-size: .9rem;
}

.ap-card-specs {
  margin-bottom: 1rem;
  font-size: .8rem;
  line-height: 1.55;
}

.ap-card-specs li {
  margin-bottom: .1rem;
}

/* wide two-up cards (Apple TV, HomePod): image beside the text, button pinned to the bottom */
.ap-card-h {
  position: relative;
}

@media (min-width: 768px) {
  .ap-card-h {
    display: grid;
    grid-template-columns: 190px 1fr;
    grid-template-rows: auto;
    column-gap: 1.25rem;
    align-items: center;
    align-content: center;
    min-height: 320px;
    padding-bottom: 4.25rem;
  }

  .ap-card-h .ap-card-img {
    grid-row: 1 / span 4;
    grid-column: 1;
    align-self: center;
    height: 190px;
    margin-bottom: 0;
  }

  .ap-card-h > :not(.ap-card-img):not(.btn) {
    grid-column: 2;
  }

  .ap-card-h .ap-card-specs {
    flex-grow: 0;
    margin-bottom: 0;
  }

  .ap-card-h .btn {
    position: absolute;
    bottom: 1.15rem;
    left: calc(1.2rem + 190px + 1.25rem);
  }
}

@media (max-width: 767.98px) {
  .ap-card-h .btn {
    position: static;
  }
}

@media (min-width: 1200px) {
  .ap-section .row.justify-content-center:has(.ap-card-h) {
    max-width: 1140px;
  }
}

/* ── LATEST: product images ── */
.ap-new-img {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 190px;
  margin-bottom: 1rem;
  padding: .75rem;
  border-radius: 14px;
  background: #f5f5f7;
}

.ap-new-img img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.ap-new-card h3 {
  font-size: 1.1rem;
}
