/* ──────────────────────────────────────────────────────────────
   NIMBUS. Apple product page typography: the system display face,
   semibold headlines with tight tracking, 17px body, ink #1d1d1f
   and grey #6e6e73, blue pills, chevron links. The hero is the
   depth switch: one case at the front, the next waiting out of
   focus at the edge, and every colour change travels in depth.
   ────────────────────────────────────────────────────────────── */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --ink: #1d1d1f;
  --grey: #6e6e73;
  --paper: #f5f5f7;
  --blue: #0071e3;
  --link: #0066cc;
  --line: rgba(0, 0, 0, .1);
  --pad: clamp(22px, 5vw, 88px);
  --ease: cubic-bezier(.55, .05, .15, 1);
  --t: 1.5s;
  /* the colour of the moment, swapped by body[data-colour] */
  --bg: #fbe3dc; --accent: #f2634d; --aura: #ff9a7e; --deep: #5a1a10;
}
body[data-colour="cobalt"] { --bg: #dde6fb; --accent: #2456e0; --aura: #4a7cf5; --deep: #0f1f5c; }
body[data-colour="butter"] { --bg: #fbf2cf; --accent: #f0c93c; --aura: #ffdc63; --deep: #5a4408; }
body[data-colour="lilac"]  { --bg: #ebe6fb; --accent: #a99bdf; --aura: #c1b4f0; --deep: #2f2460; }

html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 17px; line-height: 1.47; letter-spacing: -.022em; color: var(--ink); background: #fff;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

h1, h2, h3 { font-weight: 600; letter-spacing: -.015em; line-height: 1.05; }
h2 { font-size: clamp(36px, 4.6vw, 64px); letter-spacing: -.009em; line-height: 1.06; }
h2 span { color: var(--grey); }
h3 { font-size: clamp(24px, 2.2vw, 32px); letter-spacing: -.01em; }
.eyebrow { font-size: 14px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--grey); }
.section-head { max-width: 780px; }
.section-head .eyebrow + h2 { margin-top: 12px; }
.section-head--row { max-width: none; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; padding: 11px 24px; border-radius: 980px;
  background: var(--blue); color: #fff; font-size: 17px; letter-spacing: -.02em; transition: background .25s, transform .25s;
}
.btn:hover { background: #0077ed; transform: translateY(-1px); }
.link { display: inline-flex; align-items: center; gap: 4px; color: var(--link); font-size: 17px; }
.link:hover { text-decoration: underline; }
.link span { font-size: 22px; line-height: 1; }

/* ══════════════ nav ══════════════ */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100; display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 0 var(--pad); height: 56px; color: var(--ink); transition: background .35s, border-color .35s; border-bottom: 1px solid transparent;
}
.nav.is-stuck { background: rgba(255, 255, 255, .8); backdrop-filter: saturate(180%) blur(20px); border-color: var(--line); }
.nav__logo { font-weight: 600; font-size: 15px; letter-spacing: .28em; }
.nav__links { display: flex; gap: clamp(18px, 3vw, 40px); font-size: 13px; letter-spacing: -.01em; color: rgba(29, 29, 31, .85); }
.nav__links a:hover { color: var(--ink); }
.nav__icons { display: flex; gap: 22px; }
.nav__icons svg { width: 18px; height: 18px; }

/* ══════════════ hero ══════════════ */
.hero {
  position: relative; min-height: 100svh; overflow: hidden; background: var(--bg);
  transition: background var(--t) var(--ease);
  display: grid; align-items: center;
}
/* the big soft shape behind the case, in the colour of the moment */
.aura {
  position: absolute; right: -8vw; top: 50%; width: 62vw; height: 62vw; max-width: 900px; max-height: 900px;
  transform: translate(var(--px, 0), calc(-50% + var(--py, 0px))); border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, var(--aura) 0%, var(--accent) 55%, transparent 72%);
  opacity: .85; filter: blur(2px); transition: background var(--t) var(--ease);
}

.scene {
  position: absolute; inset: 0; perspective: 1400px; perspective-origin: 62% 50%; pointer-events: none;
}
.case {
  position: absolute; left: 50%; top: 50%; height: min(78svh, 720px); width: auto;
  transform-origin: center; will-change: transform, filter, opacity;
  transition: transform var(--t) var(--ease), filter var(--t) var(--ease), opacity calc(var(--t) * .8) var(--ease);
  /* the ring has four slots: front, bottom right, far back, top right.
     The default pose is the far back slot, out of sight behind the aura. */
  transform: translate(-50%, -50%) translate3d(58vw, 4vh, -2400px) rotate(-2deg); opacity: 0;
  filter: blur(18px) drop-shadow(0 40px 60px rgba(0, 0, 0, .18));
}
.case.no-transition { transition: none !important; }
/* front and centre right, sharp */
.case.is-active {
  transform: translate(-50%, -50%) translate3d(calc(8vw + var(--px, 0px)), var(--py, 0px), 0) rotate(0deg);
  filter: blur(0) drop-shadow(0 50px 70px rgba(0, 0, 0, .22)); opacity: 1;
}
/* waiting at the top right edge, small and out of focus */
.case.is-next {
  transform: translate(-50%, -50%) translate3d(calc(44vw + var(--px, 0px) * .4), calc(-40vh + var(--py, 0px) * .4), -1300px) rotate(-16deg);
  filter: blur(12px) drop-shadow(0 30px 40px rgba(0, 0, 0, .15)); opacity: .9;
}
/* the one before, sinking away at the bottom right */
.case.is-prev {
  transform: translate(-50%, -50%) translate3d(calc(46vw + var(--px, 0px) * .3), calc(44vh + var(--py, 0px) * .3), -1400px) rotate(14deg);
  filter: blur(14px) drop-shadow(0 30px 40px rgba(0, 0, 0, .15)); opacity: .8;
}

.hero__copy { position: relative; z-index: 3; padding: 96px var(--pad) 80px; max-width: 560px; }
.hero__copy h1 { margin-top: 14px; font-size: clamp(52px, 6.8vw, 96px); }
.hero__product { margin-top: 22px; font-size: 21px; font-weight: 600; letter-spacing: -.01em; }
.hero__colour { color: var(--grey); font-weight: 400; margin-left: 6px; display: inline-block; transition: opacity .3s, transform .3s; }
.hero__colour.is-swapping { opacity: 0; transform: translateY(6px); }
.hero__price { margin-top: 4px; font-size: 32px; font-weight: 600; letter-spacing: -.02em; }
.hero__cta { margin-top: 18px; display: flex; align-items: center; gap: 22px; }
.swatch__label { margin-top: 36px; font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--grey); }
.swatches { margin-top: 12px; display: flex; gap: 14px; }
.swatches button {
  width: 34px; height: 34px; border-radius: 50%; background: var(--c); position: relative; transition: transform .3s var(--ease);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08);
}
.swatches button::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 1.5px solid var(--ink); opacity: 0; transition: opacity .3s, transform .3s; transform: scale(.85); }
.swatches button.is-active::after { opacity: 1; transform: scale(1); }
.swatches button:hover { transform: scale(1.08); }



/* ══════════════ sections ══════════════ */
section:not(.hero) { padding: clamp(80px, 10vw, 150px) var(--pad); }
.why { background: color-mix(in srgb, var(--bg) 55%, #fff); transition: background var(--t) var(--ease); }
.why .eyebrow { color: var(--accent); transition: color var(--t) var(--ease); }
.why h2 span { color: var(--deep); transition: color var(--t) var(--ease); }
.tiles { margin-top: clamp(36px, 4vw, 60px); display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.tile { position: relative; border-radius: 22px; overflow: hidden; background: var(--bg); min-height: 420px; display: grid; align-items: end; transition: background var(--t) var(--ease); }
.tile--wide { grid-column: span 2; }
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.tile:hover img { transform: scale(1.04); }
.tile__copy { position: relative; padding: 28px 30px; background: linear-gradient(to top, var(--bg), color-mix(in srgb, var(--bg) 80%, transparent) 70%, transparent); transition: background var(--t) var(--ease); }
.tile__copy h3 { color: var(--deep); transition: color var(--t) var(--ease); }
.tile__copy p { margin-top: 8px; color: var(--grey); font-size: 15px; max-width: 40ch; }
.tile__copy--light h3 { color: #fff; }
.tile__copy--light { color: #fff; background: linear-gradient(to top, rgba(0, 0, 0, .6), rgba(0, 0, 0, .3) 70%, transparent); }
.tile__copy--light p { color: rgba(255, 255, 255, .85); }
/* the wide tiles wear the colour as a wash over the photo */
.tile--wide::after { content: ""; position: absolute; inset: 0; background: var(--accent); mix-blend-mode: soft-light; opacity: .55; pointer-events: none; transition: background var(--t) var(--ease); }

.shop { background: var(--paper); }
.shop .eyebrow { color: var(--accent); transition: color var(--t) var(--ease); }
.shop__note { color: var(--grey); font-size: 15px; }
.shop__grid { margin-top: clamp(30px, 3vw, 44px); display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.product { background: #fff; border-radius: 22px; padding: 26px 22px 24px; text-align: center; animation: productIn .6s var(--ease) both; }
.product__img { height: 260px; display: grid; place-items: center; border-radius: 16px; background: var(--pbg); overflow: hidden; }
.product__img img { height: 220px; width: auto; filter: drop-shadow(0 18px 24px rgba(0, 0, 0, .18)); transition: transform .6s var(--ease); }
.product:hover .product__img img { transform: translateY(-6px) rotate(-2deg); }
.product h3 { margin-top: 18px; font-size: 19px; }
.product p { color: var(--grey); font-size: 14px; }
.product__row { margin-top: 12px; display: flex; align-items: center; justify-content: center; gap: 12px; }
.product__row strong { font-size: 17px; font-weight: 600; }
.product__row .btn { padding: 7px 16px; font-size: 14px; }
.product__pick { display: inline-block; margin-top: 10px; padding: 4px 10px; border-radius: 980px; background: var(--ink); color: #fff; font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
@keyframes productIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

.specs { background: #fff; }
.specs__table { margin-top: clamp(30px, 3vw, 44px); max-width: 860px; }
.specs__table div { display: grid; grid-template-columns: 180px 1fr; gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.specs__table dt { font-weight: 600; }
.specs__table dd { color: var(--grey); }

.foot { padding: 26px var(--pad) 30px; background: var(--paper); border-top: 1px solid var(--line); font-size: 12px; color: var(--grey); }
.foot__top { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.foot__top nav { display: flex; gap: 22px; }
.foot__bottom { margin-top: 14px; display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.foot a:hover { text-decoration: underline; }

/* ══════════════ phones ══════════════ */
@media (max-width: 900px) {
  .nav__links { display: none; }
  .hero { min-height: 100svh; align-items: start; }
  .hero__copy { padding: 84px var(--pad) 54svh; max-width: none; }
  .hero__copy h1 { font-size: 46px; }
  .hero__price { font-size: 26px; }
  .scene { perspective-origin: 50% 80%; }
  .case { height: 48svh; }
  .case.is-active { transform: translate(-50%, -50%) translate3d(0, 24svh, 0) rotate(0); }
  .case.is-next { transform: translate(-50%, -50%) translate3d(48vw, 2svh, -1300px) rotate(-16deg); }
  .case.is-prev { transform: translate(-50%, -50%) translate3d(-50vw, 40svh, -1400px) rotate(14deg); }
  .aura { right: -30vw; top: 78%; width: 120vw; height: 120vw; }
  .swatch__label { margin-top: 24px; }
  .tiles, .shop__grid { grid-template-columns: 1fr; }
  .tile--wide { grid-column: auto; }
  .tile { min-height: 340px; }
  .specs__table div { grid-template-columns: 1fr; gap: 4px; }
}
