/* ShopCtrl site. Tokens first; dark mode swaps them, components never hard-code colors. */
:root {
  color-scheme: light dark;
  --bg: #fbfcfc;
  --surface: #ffffff;
  --tint: #e6f4f1;
  --ink: #111a19;
  --muted: #56615f;
  --line: #dde5e3;
  --accent: #0f766e; /* 5.4:1 against white, the button fill */
  --accent-hover: #0b5f58;
  --accent-ink: #ffffff;
  --link: #0f766e;
  --shadow: 0 18px 50px rgb(15 60 55 / 0.14);
  --radius: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1211;
    --surface: #141c1b;
    --tint: #102623;
    --ink: #e8eeed;
    --muted: #9aa8a5;
    --line: #25302e;
    --accent: #2dd4bf;
    --accent-hover: #5eead4;
    --accent-ink: #062b27;
    --link: #5eead4;
    --shadow: 0 18px 50px rgb(0 0 0 / 0.45);
  }
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--link);
  text-underline-offset: 3px;
}
a:hover {
  text-decoration-thickness: 2px;
}

a,
button {
  touch-action: manipulation;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

h1,
h2,
h3 {
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

.skip {
  position: absolute;
  left: 16px;
  top: -60px;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 999px;
  z-index: 10;
}
.skip:focus {
  top: 12px;
}

/* Header */
header.site {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 24px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 18px 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--ink);
  text-decoration: none;
}

.brand img {
  border-radius: 8px;
}

nav.site {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
}

nav.site a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 6px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
nav.site a:hover {
  color: var(--ink);
  background: var(--tint);
}
nav.site a[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
}
nav.site a.lang {
  color: var(--link);
  font-weight: 600;
}

main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 8px 24px 96px;
}

/* Narrow reading column for text pages */
main.page {
  max-width: 720px;
}

/* Buttons */
.cta {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 14px 26px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
  transition:
    background-color 0.2s ease,
    transform 0.15s ease;
}
.cta:hover {
  background: var(--accent-hover);
  text-decoration: none;
}
.cta:active {
  transform: scale(0.98);
}

.link-arrow {
  font-weight: 600;
  text-decoration: none;
}
.link-arrow:hover {
  text-decoration: underline;
}

/* Apple's App Store badge, unaltered (black on light, white on dark) */
.store-badge {
  display: inline-block;
  line-height: 0;
  border-radius: 9px;
}
.store-badge img {
  height: 48px;
  width: auto;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 22px;
}

/* Hero: copy left, the app on the right */
.hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 48px;
  padding: 32px 0 56px;
}

.hero h1 {
  font-size: clamp(2.2rem, 4.6vw, 3.5rem);
  margin: 0 0 18px;
}

.hero .lead {
  color: var(--muted);
  font-size: 1.2rem;
  max-width: 34ch;
  margin: 0 0 30px;
}

.hero figure {
  margin: 0;
  justify-self: center;
}

/* Device frames: the screenshot sits in the frame PNG's see-through screen. The insets are
   that hole measured from the PNGs (a hair wider, so no gap shows at the bezel's soft edge). */
.device {
  position: relative;
  aspect-ratio: 389 / 800;
  filter: drop-shadow(var(--shadow));
}
.device::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("img/iphone.png") center / 100% 100% no-repeat;
  pointer-events: none;
}
.device img {
  position: absolute;
  left: 4.2%;
  top: 1.6%;
  width: 91.8%;
  height: 96.9%;
  object-fit: cover;
  border-radius: 14.8% / 6.8%;
}
.device.ipad {
  aspect-ratio: 578 / 800;
}
.device.ipad::after {
  background-image: url("img/ipad.png");
}
.device.ipad img {
  left: 5.05%;
  top: 3.75%;
  width: 89.75%;
  height: 92.75%;
  border-radius: 1.6% / 1.1%;
}

.hero .device {
  width: min(300px, 100%);
}

/* Screenshot strip */
.gallery h2,
.features h2,
.steps-section h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin: 0 0 20px;
}

.screens-track {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 24px;
  padding: 8px 24px 28px;
  margin: 0 -24px;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.screens-track::-webkit-scrollbar {
  display: none;
}

.screens-track .device {
  flex: 0 0 auto;
  width: 230px;
  scroll-snap-align: start;
  /* The scroller clips: a shadow small enough to fit in its padding */
  filter: drop-shadow(0 8px 10px rgb(0 0 0 / 0.14));
}

/* A card around a section (the gallery) */
.box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 40px;
  text-align: center;
  box-shadow: var(--shadow);
}

/* Quick sale: two overlapping phones beside the copy */
.sell {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  align-items: center;
  gap: 56px;
  margin: 72px 0;
  padding: 48px;
  background: var(--tint);
  border-radius: 28px;
}

.sell-shots {
  position: relative;
  min-height: 560px; /* a 240px-wide phone is ~494px tall, plus the second one's 60px drop */
}

.sell-shots .device {
  position: absolute;
  width: 240px;
}
.sell-shots .device:first-child {
  left: 0;
  top: 0;
}
.sell-shots .device:last-child {
  left: 150px;
  top: 60px;
}

.sell h2 {
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
  margin: 0 0 14px;
}

.sell > div > p {
  color: var(--muted);
  font-size: 1.1rem;
  max-width: 42ch;
  margin: 0 0 22px;
}

.ticks {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}

.ticks li {
  position: relative;
  padding-left: 30px;
}

.ticks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.35em;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M8.2 13.6 4.6 10l1.4-1.4 2.2 2.2 5.8-5.8 1.4 1.4z' fill='%23000'/%3E%3Ccircle cx='10' cy='10' r='10' fill='%23000' fill-opacity='.18'/%3E%3C/svg%3E")
    center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M8.2 13.6 4.6 10l1.4-1.4 2.2 2.2 5.8-5.8 1.4 1.4z' fill='%23000'/%3E%3Ccircle cx='10' cy='10' r='10' fill='%23000' fill-opacity='.18'/%3E%3C/svg%3E")
    center / contain no-repeat;
}

/* iPad till: one wide shot, copy on top */
.tablet {
  text-align: center;
  margin: 88px 0;
}

.tablet h2 {
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
  margin: 0 0 12px;
}

.tablet p {
  color: var(--muted);
  font-size: 1.1rem;
  max-width: 46ch;
  margin: 0 auto 32px;
}

.tablet .device {
  width: min(560px, 100%);
  margin: 0 auto;
}

/* Feature bento: 6 cells, 3 columns, rows of 2+1 / 1+1+1 / 3 */
.bento {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.cell {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
}

.cell.wide {
  grid-column: span 2;
}
.cell.full {
  grid-column: 1 / -1;
}
.cell.tinted {
  background: var(--tint);
  border-color: transparent;
}

.cell h3 {
  font-size: 1.15rem;
  margin: 0 0 8px;
}
.cell p {
  color: var(--muted);
  margin: 0;
}

/* Setup steps */
.steps-section {
  margin-top: 88px;
}

.steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 0 0 28px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}

.steps li {
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-bottom: 12px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.steps h3 {
  font-size: 1.05rem;
  margin: 0 0 6px;
}
.steps p {
  color: var(--muted);
  margin: 0;
}

.note {
  color: var(--muted);
  max-width: 60ch;
}

/* Text pages */
.page h1 {
  font-size: clamp(2rem, 4vw, 2.6rem);
  margin: 24px 0 16px;
}
.page h2 {
  font-size: 1.35rem;
  margin: 36px 0 10px;
}
.page h3 {
  font-size: 1.05rem;
  margin: 24px 0 6px;
}
.page ol.list {
  padding-left: 22px;
}
.page ol.list li {
  margin-bottom: 10px;
}
.page .meta {
  color: var(--muted);
}

footer.site {
  border-top: 1px solid var(--line);
  padding: 28px 24px 36px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

footer.site nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 8px;
}
footer.site a {
  color: var(--muted);
  padding: 6px 8px;
}
footer.site a:hover {
  color: var(--ink);
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92em;
  background: var(--tint);
  padding: 2px 6px;
  border-radius: 6px;
}

/* Tablet */
@media (max-width: 900px) {
  .sell {
    grid-template-columns: 1fr;
    padding: 32px;
    gap: 32px;
  }
  .sell-shots {
    max-width: 390px;
  }
  .bento {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .cell.wide,
  .cell.full {
    grid-column: 1 / -1;
  }
}

/* Phone: everything single column */
@media (max-width: 700px) {
  header.site {
    padding: 14px 16px;
  }
  main {
    padding: 0 16px 72px;
  }
  .hero {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 16px 0 40px;
  }
  .hero .lead {
    font-size: 1.1rem;
  }
  .hero .device {
    width: min(260px, 80vw);
  }
  .screens-track {
    margin: 0 -16px;
    padding-inline: 16px;
    scroll-padding-inline: 16px;
  }
  .screens-track .device {
    width: 60vw;
  }
  .sell {
    margin: 48px -16px;
    border-radius: 0;
    padding: 32px 16px;
  }
  /* Side by side instead of overlapping: no fixed height to overflow. */
  .sell-shots {
    min-height: 0;
    display: flex;
    gap: 12px;
  }
  .sell-shots .device {
    position: relative;
    width: calc(50% - 6px);
  }
  .sell-shots .device:last-child {
    left: 0;
    top: 0;
    margin-top: 32px;
  }
  .box {
    margin-inline: -16px;
    padding: 28px 16px;
    border-radius: 0;
  }
  .bento {
    grid-template-columns: 1fr;
  }
  .steps {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

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

.spacer {
  height: 20vh; /* room to scroll before the gallery comes in */
}

/* Scroll reveal: hidden only where scripts run (index.html adds .active as a section comes into view). */
@media (scripting: enabled) {
  .reveal {
    opacity: 0;
    transform: translateY(50px);
    transition:
      opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1),
      transform 1.2s cubic-bezier(0.16, 1, 0.3, 1); /* Apple-like soft stop */
  }
  .reveal.active {
    opacity: 1;
    transform: none;
  }
}
