/* Full device gallery — centred snap cards with visible neighbouring pages. */
.device-gallery { display: none; }
#gallery.gallery-enhanced .device-gallery { display: block; }
#gallery.gallery-enhanced .gallery-source { display: none; }

.device-gallery {
  --gallery-card: clamp(300px, 32vw, 380px);
  --gallery-gap: clamp(20px, 2.4vw, 30px);
  margin-top: clamp(-24px, -2vw, -8px);
}

.device-gallery[data-active-device="watch"] { --gallery-card: clamp(270px, 27vw, 320px); }
.device-gallery[data-active-device="ipad"] { --gallery-card: min(72vw, 720px); }

.device-gallery-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.device-gallery-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: color-mix(in srgb, var(--paper-deep) 72%, transparent);
  box-shadow: inset 0 1px rgba(255,255,255,.42);
}

.device-gallery-tab {
  min-height: 44px;
  padding: 0 17px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font: 600 .86rem/1 "Inter Tight", sans-serif;
  white-space: nowrap;
  transition: color .2s ease, background .2s ease, box-shadow .2s ease;
}

.device-gallery-tab:hover { color: var(--ink); }
.device-gallery-tab[aria-pressed="true"] {
  background: var(--cream-hi);
  color: var(--ink);
  box-shadow: 0 5px 18px rgba(68,41,30,.1), inset 0 0 0 1px rgba(255,255,255,.45);
}

.device-gallery-tab span {
  margin-left: 4px;
  color: var(--ink-light);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: .64rem;
  font-weight: 500;
}

.device-gallery-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex: 0 0 auto;
}

.device-gallery-status {
  min-width: 124px;
  margin-right: 4px;
  color: var(--ink-light);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: .67rem;
  letter-spacing: .08em;
  text-align: right;
  text-transform: uppercase;
}

.device-gallery-arrow {
  width: 46px;
  height: 46px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--hairline);
  border-radius: 50%;
  background: color-mix(in srgb, var(--cream-hi) 78%, transparent);
  color: var(--ink);
  box-shadow: 0 7px 22px rgba(68,41,30,.07);
  cursor: pointer;
  font: 500 1.18rem/1 "Inter Tight", sans-serif;
  transition: transform .2s ease, background .2s ease, opacity .2s ease;
}

.device-gallery-arrow:hover:not(:disabled) {
  transform: translateY(-2px);
  background: var(--cream-hi);
}

.device-gallery-arrow:disabled { opacity: .28; cursor: default; }

.device-gallery-stage {
  position: relative;
  width: 100vw;
  max-width: 100vw;
  margin-left: 50%;
  transform: translateX(-50%);
  overflow: hidden;
  border-block: 1px solid rgba(255,255,255,.5);
  background:
    radial-gradient(circle at 50% 12%, rgba(255,255,255,.58), transparent 32rem),
    color-mix(in srgb, var(--rose) 7%, var(--paper-deep));
  box-shadow: inset 0 1px rgba(255,255,255,.4), 0 30px 90px rgba(69,40,28,.07);
}

.device-gallery-track {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: var(--gallery-gap);
  overflow-x: auto;
  overflow-y: hidden;
  padding-block: clamp(28px, 4vw, 48px) clamp(38px, 5vw, 58px);
  padding-inline: calc((100% - var(--gallery-card)) / 2);
  scroll-padding-inline: calc((100% - var(--gallery-card)) / 2);
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  overscroll-behavior-inline: contain;
  touch-action: pan-x pan-y pinch-zoom;
  cursor: grab;
  user-select: none;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--rose) 52%, transparent) rgba(58,46,37,.07);
}

.device-gallery-track::-webkit-scrollbar { height: 7px; }
.device-gallery-track::-webkit-scrollbar-track { background: rgba(58,46,37,.07); border-radius: 999px; }
.device-gallery-track::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--rose) 52%, transparent); border-radius: 999px; }
.device-gallery-track.is-dragging { cursor: grabbing; scroll-snap-type: none; scroll-behavior: auto; }

.device-gallery-slide {
  position: relative;
  isolation: isolate;
  flex: 0 0 var(--gallery-card);
  display: flex;
  flex-direction: column;
  scroll-snap-align: center;
  padding: clamp(22px, 2.7vw, 30px);
  border: 1px solid rgba(88,63,49,.14);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.62), transparent 34%),
    color-mix(in srgb, var(--cream-hi) 91%, var(--paper-deep));
  box-shadow: 0 20px 58px rgba(66,39,28,.1), 0 4px 14px rgba(66,39,28,.055);
  opacity: .62;
  transform: scale(.94);
  transition: opacity .28s ease, transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s ease;
}

.device-gallery-slide::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 9px -7px -8px 8px;
  border: 1px solid rgba(88,63,49,.1);
  border-radius: 15px;
  background: color-mix(in srgb, var(--paper-deep) 82%, var(--cream-hi));
  transform: rotate(.65deg);
}

.device-gallery-slide:nth-child(2n)::before { transform: rotate(-.55deg); }
.device-gallery-slide:nth-child(3n)::before { transform: rotate(.24deg); }

.device-gallery-slide.is-current {
  z-index: 2;
  opacity: 1;
  transform: scale(1);
  box-shadow: 0 32px 86px rgba(66,39,28,.16), 0 8px 24px rgba(66,39,28,.08);
}

.device-gallery-copy {
  min-height: 178px;
  padding-bottom: 24px;
}

.device-gallery-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--rose);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: .64rem;
  font-weight: 550;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.device-gallery-category {
  display: block;
  margin-top: 10px;
  color: var(--ink-light);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: .64rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.device-gallery-copy h3 {
  margin-top: 8px;
  font-size: clamp(1.4rem, 2vw, 1.82rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -.025em;
}

.device-gallery-copy p {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 11px;
  color: var(--ink-soft);
  font-size: .93rem;
  line-height: 1.46;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.device-gallery-tier {
  display: inline-block;
  margin-top: 8px;
  color: var(--rose);
  font-family: "Fraunces", Georgia, serif;
  font-size: .78rem;
  font-style: italic;
}

.device-gallery-paper {
  position: relative;
  width: 100%;
  margin-top: auto;
  display: grid;
  place-items: center;
  padding: 11px;
  border: 1px solid rgba(88,63,49,.11);
  border-radius: 12px;
  background: color-mix(in srgb, var(--paper-deep) 70%, var(--cream-hi));
  box-shadow: inset 0 1px rgba(255,255,255,.5), 0 12px 30px rgba(58,34,24,.08);
}

.device-gallery[data-active-device="iphone"] .device-gallery-paper { aspect-ratio: 1242 / 2688; }
.device-gallery[data-active-device="ipad"] .device-gallery-paper { aspect-ratio: 1548 / 2064; }
.device-gallery[data-active-device="watch"] .device-gallery-paper {
  aspect-ratio: 1 / 1.14;
  background:
    radial-gradient(circle at 50% 47%, rgba(184,97,110,.12), transparent 48%),
    color-mix(in srgb, var(--paper-deep) 68%, var(--cream-hi));
}

.device-gallery-tape {
  position: absolute;
  z-index: 2;
  top: -14px;
  left: 50%;
  width: 112px;
  height: auto;
  pointer-events: none;
  transform: translateX(-50%) rotate(-3deg);
}

.device-gallery-slide:nth-child(2n) .device-gallery-tape { transform: translateX(-50%) rotate(3deg); }
.device-gallery-slide:nth-child(3n) .device-gallery-tape { transform: translateX(-50%) rotate(-1deg); }

.device-gallery-shot {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border: 1px solid var(--hairline);
  border-radius: 27px;
  background: var(--cream-hi);
  box-shadow: 0 16px 42px rgba(51,31,23,.17);
  user-select: none;
  -webkit-user-drag: none;
}

.device-gallery[data-active-device="watch"] .device-gallery-shot {
  width: 82%;
  height: 82%;
  border: 0;
  border-radius: 22%;
  background: transparent;
}

.device-gallery[data-active-device="ipad"] .device-gallery-shot { border-radius: 22px; }

.device-gallery-help {
  max-width: 68ch;
  margin: 18px auto 0;
  color: var(--ink-light);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: .67rem;
  letter-spacing: .055em;
  text-align: center;
}

/* dark block removed: the site is light-only, see redesign.css */

@media (max-width: 760px) {
  .device-gallery {
    --gallery-card: min(78vw, 330px);
    --gallery-gap: 16px;
  }
  .device-gallery[data-active-device="watch"] { --gallery-card: min(72vw, 292px); }
  .device-gallery[data-active-device="ipad"] { --gallery-card: min(86vw, 520px); }
  .device-gallery-toolbar { display: block; margin-bottom: 20px; }
  .device-gallery-switch { width: 100%; justify-content: space-between; }
  .device-gallery-tab { flex: 1 1 auto; padding-inline: 9px; font-size: .79rem; min-width: 0; }
  .device-gallery-controls { justify-content: flex-start; margin-top: 16px; }
  .device-gallery-status { order: 3; min-width: 0; margin-left: 5px; text-align: left; }
  .device-gallery-track { padding-block: 24px 42px; }
  .device-gallery-slide { padding: 21px; }
  .device-gallery-copy { min-height: 174px; }
}

@media (prefers-reduced-motion: reduce) {
  .device-gallery-track { scroll-behavior: auto; }
  .device-gallery-slide { transition: none; }
  .device-gallery-arrow { transition: none; }
  .device-gallery-arrow:hover:not(:disabled) { transform: none; }
}

/* Below ~360px the three device tabs no longer fit on one line. */
@media (max-width: 360px) {
  .device-gallery-switch { flex-wrap: wrap; row-gap: 6px; }
  .device-gallery-tab { padding-inline: 7px; font-size: .74rem; }
  .device-gallery-tab span { display: none; }
}
