/* Device pages extend the product page's paper, type and show-poster palette. */
.device-links-section {
  padding-block: clamp(40px, 6vw, 78px);
  background: #eee6dc;
  border-block: 1px solid var(--line);
}

.device-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(12px, 2vw, 22px);
}

.device-entry {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(90px, .82fr);
  align-items: center;
  gap: 10px;
  min-height: 180px;
  padding: 24px 54px 24px 24px;
  overflow: hidden;
  border: 1.5px solid var(--ink);
  border-radius: 13px;
  background: #eaf1ec;
  color: var(--ink);
  text-decoration: none;
  box-shadow: 4px 4px 0 var(--ink);
}

.device-entry + .device-entry { background: #efe8f6; }

.device-entry h2,
.device-page .device-name {
  font-family: "LivePocket Condensed", "LivePocket Sans", sans-serif;
  font-weight: 900;
  text-transform: uppercase;
  line-height: .95;
}

.device-entry h2 { margin: 0 0 8px; font-size: clamp(32px, 4.6vw, 60px); }
.device-entry p { margin: 0; font-size: 14px; line-height: 1.5; }

.device-entry img {
  width: 100%;
  max-height: 150px;
  object-fit: contain;
  filter: drop-shadow(4px 6px 7px #30223433);
}

.device-entry-arrow {
  position: absolute;
  top: 17px;
  right: 17px;
  display: grid;
  place-items: center;
  width: 28px;
  aspect-ratio: 1;
  border: 1px solid currentColor;
  border-radius: 50%;
}

.device-page {
  --device-accent: #8f2937;
  --device-hero-ink: #24211f;
  --device-paper: #e9f0ea;
  --device-grid: #52776118;
  --device-work: #e9f0ea;
  --device-surface: #fffaf5;
}

.iphone-duo-page {
  --device-accent: #fbd4cf;
  --device-hero-ink: #fff7ed;
  --device-paper: #342746;
  --device-grid: #eee2ff18;
  --device-work: #efe8f6;
}

.device-page .device-header {
  position: sticky;
  top: 0;
  height: auto;
  z-index: 20;
  background: #fffaf5;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}

.device-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(10px, 2vw, 24px);
  min-height: 72px;
}

.device-nav .brand,
.device-nav select.language { color: var(--ink); }

.device-nav .brand-dot { color: var(--red); }
.device-nav select.language { border-color: currentColor; }

.device-navigation {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 24px);
}

.device-navigation a {
  font-size: 14px;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

.device-navigation a[aria-current="page"] {
  color: var(--red-dark);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

.device-navigation a:hover { color: var(--red-dark); }

.device-hero {
  padding-block: clamp(54px, 8vw, 115px);
  background-color: var(--device-paper);
  background-image:
    linear-gradient(var(--device-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--device-grid) 1px, transparent 1px);
  background-size: 44px 44px;
  color: var(--device-hero-ink);
}

.device-hero-layout {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.65fr);
  align-items: center;
  gap: clamp(24px, 4.4vw, 72px);
}

.device-page h1 { margin: 0; }

.device-name {
  display: block;
  margin-bottom: clamp(18px, 2.5vw, 30px);
  font-size: clamp(64px, 8vw, 120px);
  letter-spacing: -.015em;
}

.iphone-duo-page .device-name { font-size: clamp(53px, 6vw, 104px); }

.device-hero-title {
  display: block;
  font-size: clamp(25px, 3.3vw, 48px);
  font-weight: 850;
  line-height: 1.18;
  letter-spacing: -.02em;
}

.device-hero-title em { color: var(--device-accent); font-style: normal; }
.device-intro-body { margin: 19px 0 24px; font-size: var(--type-body); line-height: 1.7; }
.device-page .device-views { align-items: center; }
.iphone-duo-page .device-hero-views {
  grid-template-columns: minmax(0, .718fr) minmax(0, 1.377fr);
  align-items: start;
  max-width: 790px;
  margin-inline: auto;
}
.device-page .device-views .mockup { width: 100%; }

.device-page .device-views .mockup .screen-button {
  border: 0;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  overflow: visible;
}

.device-page .mockup img { filter: drop-shadow(5px 12px 13px #231b3655); }
.device-page .mockup .screen-button::after { inset: auto 9px 9px auto; }
.iphone-duo-page .device-hero .mockup figcaption { color: #fff2e4; }

.device-facts {
  padding-block: clamp(40px, 6.4vw, 80px);
  color: var(--ink);
  background: var(--device-surface);
}

.device-facts-layout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(15px, 3.8vw, 48px);
}

.device-facts h2, .device-facts h3 { margin: 0; font-size: clamp(18px, 2vw, 27px); line-height: 1.27; }
.device-facts h2 { grid-column: 1 / -1; color: var(--red-dark); }
.device-facts-layout > div { border-inline-start: 1px solid #aa978b85; padding-inline-start: 20px; }
.device-facts p { margin: 8px 0 0; font-size: 15px; line-height: 1.65; }

.device-work {
  background: var(--device-work);
  padding-block: clamp(52px, 7vw, 94px);
  border-block: 1px solid var(--line);
}

.device-work-layout {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  gap: clamp(22px, 5vw, 76px);
  align-items: center;
}

.device-work h2 {
  margin: 0 0 14px;
  font: 850 clamp(28px, 4vw, 55px)/1.18 "LivePocket Sans", sans-serif;
  letter-spacing: -.025em;
}

.device-demo-return {
  display: block;
  margin-block: 20px 14px;
  font-weight: 750;
  text-underline-offset: 4px;
}

.device-footer-links { padding-block: 28px; background: #efe2d6; }
.device-footer-actions, .device-footer .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.device-next { display: inline-flex; flex-direction: column; gap: 5px; text-decoration: none; }
.device-next strong { font-size: 20px; color: var(--red-dark); }
.device-next > span { font-size: 14px; }
.device-footer { background: var(--ink); color: #fffaf5; padding-block: 24px; }
.device-footer nav { display: flex; gap: 18px; font-size: 13px; }

@media (prefers-reduced-motion: no-preference) {
  @keyframes device-mockup-in {
    from { opacity: .42; transform: translateY(18px) scale(.97); }
  }

  .device-hero-views .mockup {
    animation: device-mockup-in 560ms var(--ui-ease) both;
  }

  .device-hero-views .mockup + .mockup { animation-delay: 75ms; }
  .device-hero-views:focus-within .mockup { animation: none; }

  .device-entry, .device-entry img, .device-entry-arrow {
    transition: transform 240ms var(--ui-ease);
  }
  .device-entry:active { transform: translate(2px, 2px); }
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .device-entry:hover img { transform: translateY(-4px); }
  .device-entry:hover .device-entry-arrow { transform: rotate(8deg); }
}

@media (max-width: 850px) {
  .device-hero-layout, .device-work-layout { grid-template-columns: minmax(0, 1fr); }
  .device-intro-body { max-width: 52ch; }
  .device-hero-layout, .device-work-layout { gap: 28px; }
}

@media (max-width: 620px) {
  .device-links { grid-template-columns: minmax(0, 1fr); }
  .device-entry { min-height: 130px; padding: 16px 48px 16px 17px; }
  .device-entry img { max-height: 108px; }
  .device-nav { display: grid; grid-template-columns: 1fr auto; padding-block: 8px; gap: 5px 12px; }
  .device-nav .brand { grid-row: 1; grid-column: 1; }
  .device-nav select.language { grid-column: 2; grid-row: 1; }
  .device-navigation { grid-row: 2; grid-column: 1 / -1; justify-content: space-between; gap: 10px; }
  .device-navigation a { display: flex; align-items: center; min-height: 39px; font-size: 13px; }
  .device-page section[id] { scroll-margin-top: 42px; }
  .device-demo { scroll-margin-top: 42px; }
  .device-facts-layout { grid-template-columns: 1fr; gap: 19px; }
  .device-facts-layout > div { padding-inline-start: 12px; }
  .device-footer-actions, .device-footer .wrap { flex-wrap: wrap; }
}

/* One fixed stage lets visitors compare the same task without shifting the page. */
.device-demo { min-width: 0; }

.device-demo-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: center;
  gap: 12px 18px;
  margin-bottom: 18px;
}

.demo-control {
  min-inline-size: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0;
  padding: 4px;
  border: 1px solid currentColor;
  border-radius: 10px;
  background: #fffaf5;
  color: #24211f;
}

.demo-control legend {
  padding: 1px 5px;
  border-radius: 4px;
  background: #fffaf5;
  color: #24211f;
  font-size: 12px;
  font-weight: 750;
}

.demo-control button {
  min-height: 44px;
  padding: 7px 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: 750 14px/1.25 "LivePocket Sans", sans-serif;
}

.demo-control button[aria-pressed="true"] {
  background: #30262a;
  color: #fffaf5;
}

.demo-control button:focus-visible {
  outline: 2px solid #a32940;
  outline-offset: 2px;
}

.device-demo.is-interactive .device-demo-stage:not(.device-compare-stage) {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  --demo-height: clamp(265px, 35vw, 470px);
  block-size: var(--demo-height);
  align-items: center;
}

.device-demo.is-interactive .device-demo-stage:not(.device-compare-stage) .mockup {
  display: grid;
  grid-area: 1 / 1;
  grid-template-rows: minmax(0, 1fr) minmax(37px, auto);
  justify-items: center;
  width: 100%;
  height: 100%;
  min-height: 0;
  animation: none;
}

.device-demo.is-interactive .device-demo-stage:not(.device-compare-stage) .mockup button {
  position: relative;
  justify-self: center;
  width: min(100%, calc((var(--demo-height) - 49px) * var(--shot-ratio)));
  min-height: 0;
}

.ipad-page .mockup[data-shape="landscape"] { --shot-ratio: 1.304; }
.ipad-page .mockup[data-shape="portrait"] { --shot-ratio: .767; }

.device-demo.is-interactive .device-demo-stage:not(.device-compare-stage) .mockup img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.device-demo.is-interactive .device-demo-stage:not(.device-compare-stage) .mockup .screen-button::after {
  inset: auto 5px 5px auto;
}

.device-compare-stage .screen-button { display: block; }

.device-compare-stage .mockup img {
  display: block;
  width: 100%;
  height: auto;
}

.device-compare-stage .mockup figcaption { min-height: 3em; }
.device-demo.is-interactive .device-compare-stage .mockup { animation: none; }

.device-demo-stage .mockup[inert] { pointer-events: none; }

.demo-status {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.device-work-notes {
  padding: clamp(18px, 3vw, 35px);
  background: #fffaf5;
  border: 1px solid #ae9b8d;
  border-radius: 12px;
  box-shadow: 4px 5px 0 #22201f22;
}

.device-work-notes > div + div {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #ae9b8d66;
}

.device-work-notes h3 { margin: 0; font-size: 17px; line-height: 1.45; }
.device-work-notes p { margin: 6px 0 0; font-size: 15px; line-height: 1.65; }

@media (max-width: 620px) {
  .device-demo-controls { gap: 7px 12px; }
  .demo-control button { padding-inline: 8px; font-size: 13px; }
  .device-compare-stage .mockup .screen-button::after {
    inset: auto -3px -3px auto;
    width: 24px;
    height: 24px;
  }
}
