/* ==========================================================================
   DuoGear — Apple-style redesign
   Language: apple.com product pages — SF type scale, #f5f5f7 surfaces,
   pill CTAs, frosted nav, hairline separators, black product hero.
   ========================================================================== */

:root {
  /* palette (Apple canonical) */
  --bg:          #ffffff;
  --surface:     #f5f5f7;
  --fg:          #1d1d1f;
  --muted:       #6e6e73;
  --faint:       #86868b;
  --border:      #d2d2d7;
  --hairline:    rgba(0, 0, 0, 0.08);
  --link:        #0066cc;
  --btn:         #0071e3;
  --btn-hover:   #0077ed;

  /* dark surfaces */
  --dark-bg:     #000000;
  --dark-surface:#161617;
  --dark-fg:     #f5f5f7;
  --dark-muted:  #a1a1a6;
  --dark-link:   #2997ff;
  --dark-hairline: rgba(255, 255, 255, 0.14);

  /* warn (kept restrained — amber wash, no left-bar callout) */
  --warn-bg:     #fdf3e0;
  --warn-fg:     #7a4d00;

  /* the one decorative accent — Apple's "New" copper, dark-hero only */
  --copper:      #ff9f0c;

  /* type — Apple is single-family sans; SF Pro via system stack */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
          "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;

  /* scale */
  --fs-hero:  clamp(44px, 6.4vw, 80px);
  --fs-h1:    clamp(36px, 5vw, 56px);
  --fs-h2:    clamp(28px, 3.6vw, 44px);
  --fs-h3:    21px;
  --fs-lead:  clamp(19px, 2vw, 24px);
  --fs-body:  17px;
  --fs-small: 14px;
  --fs-meta:  12px;

  --container: 1080px;
  --measure:   720px;
  --gutter:    24px;
  --radius:    18px;
  --radius-sm: 12px;
}

/* ─── reset / base ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.55;
  color: var(--fg);
  background: var(--bg);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
figure { margin: 0; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; border-radius: 4px; }

/* ─── layout ───────────────────────────────────────────────────────── */
.container { max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.measure   { max-width: var(--measure); margin-inline: auto; }
.section   { padding-block: clamp(64px, 9vw, 120px); }
.section-alt { background: var(--surface); }
.section + .section { border-top: 1px solid var(--hairline); }
.section-alt + .section-alt { border-top: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 920px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ─── type ─────────────────────────────────────────────────────────── */
.h-hero {
  font-size: var(--fs-hero); font-weight: 700;
  letter-spacing: -0.032em; line-height: 1.05; margin: 0;
}
h1, .h1 { font-size: var(--fs-h1); font-weight: 700; letter-spacing: -0.026em; line-height: 1.08; margin: 0; }
h2, .h2 { font-size: var(--fs-h2); font-weight: 600; letter-spacing: -0.022em; line-height: 1.12; margin: 0; }
h3, .h3 { font-size: var(--fs-h3); font-weight: 600; letter-spacing: -0.012em; line-height: 1.25; margin: 0; }
.lead { font-size: var(--fs-lead); line-height: 1.42; color: var(--muted); font-weight: 400; letter-spacing: -0.01em; margin: 0; max-width: 60ch; }
.eyebrow {
  font-size: 15px; font-weight: 600; letter-spacing: -0.005em;
  color: var(--muted); margin: 0 0 14px;
}
.meta  { font-size: var(--fs-meta); color: var(--muted); letter-spacing: 0.01em; }
.num   { font-variant-numeric: tabular-nums; }

/* chevron text link — the apple.com "Learn more >" pattern */
.tlink { color: var(--link); font-size: 17px; font-weight: 400; }
.tlink::after { content: " ›"; text-decoration: none; display: inline-block; }
.tlink:hover { text-decoration: underline; }

/* ─── global nav (frosted, 48px) ───────────────────────────────────── */
.gnav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251, 251, 253, 0.82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--hairline);
}
.gnav-inner { display: flex; align-items: center; justify-content: space-between; height: 52px; }
.gnav .logo {
  font-size: 19px; font-weight: 600; letter-spacing: -0.02em;
  color: var(--fg); display: inline-flex; align-items: center; gap: 9px;
}
.gnav .logo:hover { text-decoration: none; }
.gnav .logo svg { width: 20px; height: 20px; border-radius: 5px; }
.gnav nav { display: flex; gap: 34px; }
.gnav nav a {
  font-size: 13px; color: rgba(0, 0, 0, 0.78); font-weight: 400;
  letter-spacing: -0.005em;
}
.gnav nav a:hover { color: #000; text-decoration: none; }
.gnav nav a.active { color: #000; font-weight: 600; }
@media (max-width: 720px) {
  .gnav-inner { gap: 16px; }
  .gnav nav { gap: 18px; overflow-x: auto; scrollbar-width: none; }
  .gnav nav::-webkit-scrollbar { display: none; }
  .gnav nav a { font-size: 12px; white-space: nowrap; }
}

/* ─── buttons — pill only ──────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 12px 26px;
  border-radius: 980px; border: 0;
  background: var(--btn); color: #fff;
  font-size: 17px; font-weight: 400; letter-spacing: -0.01em;
  cursor: pointer; transition: background 0.2s ease, transform 0.05s ease;
}
.btn:hover { background: var(--btn-hover); text-decoration: none; }
.btn:active { transform: scale(0.98); }
.btn.small { min-height: 36px; padding: 8px 18px; font-size: 14px; }
.btn.secondary {
  background: transparent; color: var(--link);
  box-shadow: inset 0 0 0 1px var(--link);
}
.btn.secondary:hover { background: var(--link); color: #fff; box-shadow: none; }
.section-dark .btn.secondary { color: var(--dark-link); box-shadow: inset 0 0 0 1px var(--dark-link); }
.section-dark .btn.secondary:hover { background: var(--dark-link); color: #000; }
.section-dark :focus-visible, .hero-dark :focus-visible { outline-color: var(--dark-link); }

/* ─── cards ────────────────────────────────────────────────────────── */
.card {
  display: block; background: var(--surface); color: var(--fg);
  border-radius: var(--radius); padding: 30px 28px;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.card:hover {
  text-decoration: none;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}
.card h3 { margin: 0 0 8px; }
.card p { margin: 0; font-size: 15px; color: var(--muted); line-height: 1.5; }
.card .card-go { display: inline-block; margin-top: 14px; font-size: 14px; color: var(--link); }
.card .card-go::after { content: " ›"; }

/* ─── spec highlight tiles (apple.com/iphone/specs pattern) ────────── */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.tile {
  background: var(--surface); border-radius: var(--radius);
  padding: 28px 24px; text-align: center;
}
.tile .tile-val {
  font-size: clamp(30px, 3.4vw, 44px); font-weight: 700;
  letter-spacing: -0.025em; line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.tile .tile-val .tile-unit { font-size: 0.5em; font-weight: 600; letter-spacing: 0; }
.tile .tile-label { font-size: 13px; color: var(--muted); margin-top: 8px; line-height: 1.4; }
@media (max-width: 920px) { .tiles { grid-template-columns: repeat(2, 1fr); } }

/* ─── hero (dark product stage) ────────────────────────────────────── */
.hero-dark {
  background: var(--dark-bg); color: var(--dark-fg);
  text-align: center; overflow: clip;
  padding-block: clamp(72px, 10vw, 130px) 0;
}
.hero-dark .eyebrow { color: var(--copper); }
.hero-dark .lead { color: var(--dark-muted); margin-top: 18px; }
.hero-dark .tlink { color: var(--dark-link); }
.hero-cta { display: inline-flex; align-items: center; gap: 26px; margin-top: 30px; flex-wrap: wrap; justify-content: center; }
.hero-stage { margin-top: clamp(48px, 6vw, 84px); }

/* ─── the Duo device render (pure CSS, two poses) ──────────────────── */
.duo-stage {
  display: flex; align-items: flex-end; justify-content: center;
  gap: clamp(28px, 5vw, 72px);
  padding-bottom: clamp(48px, 6vw, 90px);
}
.duo {
  --w: clamp(200px, 24vw, 320px);
  width: var(--w);
  border-radius: calc(var(--w) * 0.125);
  padding: calc(var(--w) * 0.026);
  background: linear-gradient(160deg, #63656b 0%, #2b2c30 38%, #101114 60%, #4b4d53 100%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 30px 70px rgba(0, 0, 0, 0.55),
    0 8px 22px rgba(0, 0, 0, 0.5);
  position: relative;
}
.duo .duo-screen {
  position: relative; overflow: hidden;
  border-radius: calc(var(--w) * 0.10);
  background: #000;
}
.duo .duo-screen img { width: 100%; height: 100%; object-fit: cover; }
.duo .duo-screen::before {           /* glass sheen */
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(115deg, rgba(255,255,255,0.14) 0%, rgba(255,255,255,0.02) 28%, transparent 45%);
}
.duo.open .duo-screen { aspect-ratio: 1878 / 2670; }
.duo.open .duo-screen::after {       /* the crease — a hairline of light */
  content: ""; position: absolute; top: 0; bottom: 0; left: 50%; z-index: 3;
  width: 3px; transform: translateX(-50%);
  background: linear-gradient(90deg,
    transparent, rgba(255,255,255,0.22) 45%,
    rgba(0,0,0,0.28) 55%, transparent);
}
.duo.closed { --w: clamp(150px, 17vw, 232px); }
.duo.closed .duo-screen { aspect-ratio: 1398 / 2034; }
.duo.closed .duo-screen .island {    /* Dynamic Island on the outer display */
  position: absolute; top: 3.2%; left: 50%; transform: translateX(-50%);
  width: 32%; height: 3.1%; background: #000; border-radius: 999px; z-index: 3;
}
.duo-cap { text-align: center; margin-top: 18px; font-size: 13px; color: var(--dark-muted); }
@media (max-width: 560px) { .duo { --w: 46vw; } .duo.closed { --w: 33vw; } }

/* ─── article ──────────────────────────────────────────────────────── */
.crumbs { font-size: var(--fs-meta); color: var(--muted); margin: 22px 0 4px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--fg); }
.crumb-sep { margin: 0 7px; color: var(--border); }

.article-head { padding: clamp(48px, 7vw, 84px) 0 clamp(28px, 4vw, 44px); text-align: center; }
.article-head h1 { margin: 0 0 16px; }
.article-head .lead { margin-inline: auto; max-width: 56ch; }
.article-head .meta { margin-top: 20px; display: block; }

.content { font-size: var(--fs-body); }
.content h2 {
  font-size: clamp(24px, 2.6vw, 32px); font-weight: 600; letter-spacing: -0.018em;
  margin: 56px 0 16px;
}
.content h3 { font-size: 19px; font-weight: 600; letter-spacing: -0.01em; margin: 36px 0 10px; }
.content p { margin: 14px 0; }
.content ul, .content ol { padding-left: 1.4em; margin: 14px 0; }
.content li { margin: 8px 0; }
.content li::marker { color: var(--faint); }

/* answer / note boxes — rounded gray fill, Apple style (no left bar) */
.answer-box {
  background: var(--surface); border-radius: var(--radius);
  padding: 26px 30px; margin: 28px 0;
}
.answer-box p { margin: 8px 0; }
.answer-box p:first-child { margin-top: 0; }
.answer-box p:last-child { margin-bottom: 0; }
.warn-box {
  background: var(--warn-bg); color: var(--warn-fg);
  border-radius: var(--radius); padding: 22px 26px;
  margin: 28px 0; font-size: 15px; line-height: 1.55;
}
.warn-box a { color: var(--warn-fg); text-decoration: underline; }

/* spec table — hairline rows, muted labels */
.spec-table { width: 100%; border-collapse: collapse; margin: 20px 0 8px; font-size: 15px; }
.spec-table th, .spec-table td {
  text-align: left; padding: 13px 4px; vertical-align: top;
  border-bottom: 1px solid var(--hairline);
}
.spec-table th { color: var(--muted); font-weight: 400; width: 38%; padding-right: 20px; }
.spec-table tr:last-child th, .spec-table tr:last-child td { border-bottom: 0; }

/* faq */
.faq-item { border-top: 1px solid var(--hairline); padding: 22px 0; }
.faq-item:last-child { border-bottom: 1px solid var(--hairline); }
.faq-item h3 { margin: 0 0 8px; font-size: 17px; }
.faq-item p { margin: 0; color: var(--muted); font-size: 15px; }

/* buy row — one primary pill + quiet context */
.buy-row { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin: 18px 0 8px; }
.price-tag { font-size: 13px; color: var(--muted); }
.aff-note { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* link list — hairline editorial rows (an alternative rhythm to cards) */
.link-list { border-top: 1px solid var(--hairline); }
.link-row {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr) auto;
  gap: 24px; align-items: baseline;
  padding: 22px 4px; border-bottom: 1px solid var(--hairline);
  color: var(--fg);
}
.link-row:hover { text-decoration: none; background: var(--surface); }
.link-row h3 { margin: 0; font-size: 19px; }
.link-row p { margin: 0; font-size: 15px; color: var(--muted); }
.link-row .go { font-size: 14px; color: var(--link); white-space: nowrap; }
.link-row .go::after { content: " ›"; }
@media (max-width: 640px) {
  .link-row { grid-template-columns: 1fr; gap: 4px; }
  .link-row .go { margin-top: 4px; }
}

/* ranked product card (buying guides) */
.pick {
  background: var(--surface); border-radius: var(--radius);
  padding: 30px 32px; margin: 20px 0;
  display: grid; grid-template-columns: auto 1fr; gap: 26px; align-items: start;
}
.pick .rank {
  font-size: 44px; font-weight: 700; letter-spacing: -0.03em;
  color: var(--faint); line-height: 1; min-width: 44px;
}
.pick h3 { margin: 0 0 4px; font-size: 20px; }
.pick .pick-tag { font-size: 13px; color: var(--link); font-weight: 600; margin-bottom: 10px; display: block; }
.pick p { margin: 0 0 6px; font-size: 15px; color: var(--muted); }
.pick .buy-row { margin-top: 14px; }
@media (max-width: 560px) { .pick { grid-template-columns: 1fr; gap: 10px; } .pick .rank { font-size: 32px; } }

/* related */
.related { margin-top: 64px; }
.related h2 { font-size: 24px; margin-bottom: 18px; }
.related .grid-3 { gap: 14px; }
.rel-card {
  display: block; background: var(--surface); border-radius: var(--radius-sm);
  padding: 18px 20px; color: var(--fg); font-size: 15px; font-weight: 500;
  transition: box-shadow 0.2s ease;
}
.rel-card:hover { text-decoration: none; box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
.rel-card span { display: block; margin-top: 4px; font-size: 13px; color: var(--muted); font-weight: 400; }

/* wallpaper gallery */
.wall-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin: 26px 0 8px; }
.wall-grid.two { grid-template-columns: repeat(2, minmax(0, 240px)); }
.wall { text-align: center; }
.wall .wall-frame {
  border-radius: 30px; overflow: hidden; position: relative;
  border: 1px solid var(--hairline);
  box-shadow: 0 12px 32px rgba(0,0,0,0.12);
  background: #000;
}
.wall .wall-frame img { width: 100%; height: auto; }
.wall a.dl { display: inline-block; margin-top: 12px; font-size: 14px; color: var(--link); }
.wall a.dl.alt { margin-left: 10px; color: var(--muted); }
.wall a.dl::after { content: " ›"; }
.wall .wall-name { font-size: 13px; color: var(--muted); margin-top: 2px; }
@media (max-width: 920px) { .wall-grid { grid-template-columns: repeat(2, 1fr); } .wall-grid.two { grid-template-columns: repeat(2, minmax(0,1fr)); } }

/* steps (numbered how-to, Apple support style) */
.steps { counter-reset: step; margin: 22px 0; padding: 0; list-style: none; }
.steps li {
  counter-increment: step; position: relative;
  padding: 4px 0 18px 58px; margin: 0;
}
.steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--surface); color: var(--fg);
  display: grid; place-items: center;
  font-size: 16px; font-weight: 600;
}
.steps li + li { border-top: 0; }

/* ─── section headers ──────────────────────────────────────────────── */
.sec-head { margin-bottom: clamp(32px, 4.5vw, 56px); }
.sec-head.center { text-align: center; }
.sec-head .lead { margin-top: 14px; }
.sec-head.center .lead { margin-inline: auto; max-width: 58ch; }
.sec-head .head-link { margin-top: 12px; display: inline-block; }

/* ─── footer ───────────────────────────────────────────────────────── */
.site-footer {
  background: var(--surface); border-top: 1px solid var(--hairline);
  padding: 40px 0 56px; font-size: 12px; color: var(--muted);
}
.site-footer .foot-links { display: flex; flex-wrap: wrap; gap: 4px 0; margin: 0 0 14px; }
.site-footer .foot-links a {
  color: #424245; padding: 0 10px; border-right: 1px solid var(--border);
}
.site-footer .foot-links a:first-child { padding-left: 0; }
.site-footer .foot-links a:last-child { border-right: 0; }
.site-footer .foot-links a:hover { color: #000; text-decoration: underline; }
.site-footer p { margin: 8px 0; line-height: 1.6; }
.foot-legal { color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
