/*
 * Cataloc on the web. Palette and type lifted from src/theme/tokens.ts and the
 * app's own Nunito, so the site and the product look like one thing.
 *
 * No build step: GitHub Pages serves these files as they are.
 */

:root {
  --bg: #F6F4F0;
  --surface: #FFFFFF;
  --surface2: #EFEBE4;
  --ink: #1B1A18;
  --ink2: #56514C;
  --ink3: #6F6861;
  --rule: rgba(27, 26, 24, 0.10);
  --accent: #256B65;
  --accent-ink: #FFFFFF;
  --accent-soft: #E4F0EE;
  --shadow: 0 1px 3px rgba(27, 26, 24, 0.06);

  --display: "Nunito", ui-rounded, "Segoe UI", system-ui, sans-serif;
  --body: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
}

/*
 * Dark follows the phone unless the switch in the masthead (theme.js) has
 * picked one: data-theme="light" opts out of the media query, and
 * data-theme="dark" applies the same tokens regardless of it.
 */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131412;
    --surface: #1E211E;
    --surface2: #282C28;
    --ink: #F1EFEA;
    --ink2: #C2BDB8;
    --ink3: #97938C;
    --rule: rgba(241, 239, 234, 0.13);
    --accent: #7BC8BF;
    --accent-ink: #0E1F1D;
    --accent-soft: #22332F;
    --shadow: none;
  }
}

:root[data-theme="dark"] {
  --bg: #131412;
  --surface: #1E211E;
  --surface2: #282C28;
  --ink: #F1EFEA;
  --ink2: #C2BDB8;
  --ink3: #97938C;
  --rule: rgba(241, 239, 234, 0.13);
  --accent: #7BC8BF;
  --accent-ink: #0E1F1D;
  --accent-soft: #22332F;
  --shadow: none;
}

:root { color-scheme: light; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { color-scheme: dark; } }
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding-inline: 22px;
}

a { color: var(--accent); text-underline-offset: 3px; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }

h1, h2, h3 { font-family: var(--display); letter-spacing: -0.015em; text-wrap: balance; }

h1 { font-weight: 800; font-size: clamp(34px, 7vw, 52px); line-height: 1.05; margin: 0 0 14px; }
h2 { font-weight: 800; font-size: 25px; line-height: 1.2; margin: 0 0 6px; }
h3 { font-weight: 700; font-size: 18px; margin: 0 0 4px; }

/* ---------- masthead ---------- */

header.top {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px;
  padding-block: 22px;
}
/*
 * The icon ships on an opaque white square. Rounding it turns that into the
 * app tile it already is, which reads as deliberate on both grounds — blending
 * it away works on paper but leaves the artwork nearly invisible on the dark
 * one, where white and brown both multiply down to the background.
 */
header.top img { width: 38px; height: 38px; border-radius: 22.5%; }
header.top b { font-family: var(--display); font-weight: 800; font-size: 19px; }
header.top b a { color: inherit; text-decoration: none; }
header.top nav { margin-left: auto; display: flex; align-items: center; gap: 18px; font-size: 15px; }
/* On a narrow phone the nav drops under the wordmark rather than overflowing. */
@media (max-width: 420px) {
  header.top nav { gap: 12px; }
  .lang a { padding-inline: 11px; }
}

.lang { display: inline-flex; border: 1px solid var(--rule); border-radius: 999px; overflow: hidden; }
.lang a {
  padding: 5px 13px; text-decoration: none; color: var(--ink3);
  font-family: var(--display); font-weight: 700; font-size: 13px; line-height: 1.4;
}
.lang a[aria-current="page"] { background: var(--accent); color: var(--accent-ink); }

.theme-toggle {
  -webkit-appearance: none; appearance: none;
  display: inline-grid; place-items: center;
  width: 34px; height: 34px; padding: 0;
  border: 1px solid var(--rule); border-radius: 999px;
  background: transparent; color: var(--ink2); cursor: pointer;
}
.theme-toggle:hover { color: var(--ink); background: var(--surface2); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.theme-toggle svg { width: 17px; height: 17px; }
/* Show the moon while light (tap for dark), the sun while dark. */
.theme-toggle .sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: none; }
}
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }

/* ---------- hero ---------- */

.hero { padding-block: 26px 52px; }
.hero-icon { width: 128px; height: 128px; border-radius: 22.5%; margin-bottom: 20px; }
.lede { font-size: 20px; color: var(--ink2); margin: 0 0 26px; max-width: 34em; }

.badges { display: flex; flex-wrap: wrap; gap: 12px; }
.badge {
  display: inline-block;
  background: var(--accent); color: var(--accent-ink);
  font-family: var(--display); font-weight: 700; font-size: 16px;
  padding: 12px 22px; border-radius: 999px; text-decoration: none;
}
.soon { font-size: 14px; color: var(--ink3); margin-top: 12px; }

/* ---------- sections ---------- */

section { padding-block: 40px; border-top: 1px solid var(--rule); }
section > p { color: var(--ink2); max-width: 36em; }

.features { display: grid; gap: 26px; margin-top: 28px; }
@media (min-width: 620px) { .features { grid-template-columns: 1fr 1fr; gap: 26px 34px; } }
.feature p { margin: 0; color: var(--ink2); font-size: 16px; }

/*
 * Screenshots: one horizontal strip that snaps a phone at a time. It bleeds
 * past .wrap's gutter to the viewport edge so the next shot peeks in, which
 * is what tells a visitor the strip scrolls.
 */
.shots {
  display: flex; gap: 18px; align-items: flex-start;
  margin: 28px -22px 0; padding: 4px 22px 18px;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 22px;
  list-style: none;
}
/*
 * A scrollbar that reads on both themes and does not fade away. Chrome and
 * Safari get the ::-webkit-scrollbar version, which stays visible even with
 * macOS overlay scrollbars; setting scrollbar-color there would switch Chrome
 * back to the standard one, which hides when idle, so Firefox alone gets that.
 */
@supports not selector(::-webkit-scrollbar) {
  .shots { scrollbar-width: thin; scrollbar-color: var(--ink3) var(--surface2); }
}
.shots::-webkit-scrollbar { height: 8px; }
.shots::-webkit-scrollbar-track { background: var(--surface2); border-radius: 999px; margin-inline: 22px; }
.shots::-webkit-scrollbar-thumb { background: var(--ink3); border-radius: 999px; }
.shots li { flex: 0 0 210px; scroll-snap-align: start; margin: 0; }
.shots img {
  display: block; width: 100%; height: auto;
  border-radius: 22px; border: 1px solid var(--rule); box-shadow: var(--shadow);
  background: var(--surface);
}
.shots li.page img { border-radius: 6px; }
/* Apple's own iPhone Duo bezel, drawn whole: no card, border or shadow around
   a product image, which Apple's marketing guidelines rule out. */
.shots li.device { flex-basis: 420px; }
.shots li.device img { border: 0; border-radius: 0; box-shadow: none; background: none; }
.shots li.device a.zoom { border-radius: 0; }
@media (max-width: 520px) { .shots li.device { flex-basis: 300px; } }
.shots p { margin: 10px 2px 0; font-size: 15px; line-height: 1.45; color: var(--ink2); }
.shots p b { color: var(--ink); font-weight: 500; }
.shots-head { display: flex; align-items: center; gap: 12px; }
.shots-head h2 { margin-right: auto; }
.shots-nav {
  -webkit-appearance: none; appearance: none;
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; padding: 0;
  border: 1px solid var(--rule); border-radius: 999px;
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow);
  font: 400 24px/1 var(--body); cursor: pointer;
}
.shots-nav:hover:not(:disabled) { background: var(--surface2); }
.shots-nav:disabled { opacity: 0.35; cursor: default; }
.shots-nav:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.shots a.zoom { display: block; cursor: zoom-in; border-radius: 22px; }
.shots li.page a.zoom { border-radius: 6px; }

/* The viewer that shots.js opens over the page. */
.viewer {
  width: 100vw; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: rgba(10, 10, 9, 0.94); color: #F1EFEA;
}
.viewer::backdrop { background: transparent; }
.viewer-stage {
  position: absolute; inset: 0 0 76px;
  display: flex; overflow: auto;
}
.viewer-stage img {
  margin: auto; display: block;
  max-width: calc(100% - 32px); max-height: calc(100% - 32px);
  border-radius: 14px; cursor: zoom-in; touch-action: pinch-zoom;
}
.viewer.zoomed .viewer-stage img { max-width: none; max-height: none; cursor: zoom-out; }
.viewer-caption {
  position: absolute; left: 0; right: 0; bottom: 0; height: 76px;
  margin: 0; padding: 10px 72px; text-align: center;
  font-size: 15px; line-height: 1.4; color: #C2BDB8;
}
.viewer-caption b { color: #F1EFEA; font-weight: 500; }
.viewer button {
  -webkit-appearance: none; appearance: none;
  position: absolute; width: 44px; height: 44px; border: 0; border-radius: 999px;
  background: rgba(30, 30, 28, 0.82); color: #fff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
  font: 400 28px/1 var(--body); cursor: pointer;
}
.viewer button:hover { background: rgba(60, 60, 56, 0.92); }
.viewer button:focus-visible { outline: 2px solid #7BC8BF; outline-offset: 2px; }
.viewer-close { top: 14px; right: 14px; }
.viewer-prev { left: 14px; bottom: 16px; }
.viewer-next { right: 14px; bottom: 16px; }

.plans { display: grid; gap: 14px; margin-top: 24px; }
@media (min-width: 620px) { .plans { grid-template-columns: repeat(3, 1fr); } }
.plan {
  background: var(--surface); border: 1px solid var(--rule); border-radius: 14px;
  padding: 18px; box-shadow: var(--shadow);
}
.plan .price { font-family: var(--display); font-weight: 800; font-size: 26px; display: block; }
.plan .per { color: var(--ink3); font-size: 14px; }
.plan.free { background: var(--accent-soft); border-color: transparent; }

.note {
  background: var(--surface2); border-radius: 14px; padding: 18px 20px;
  color: var(--ink2); font-size: 16px; margin-top: 26px;
}
.note strong { color: var(--ink); }

/* ---------- support ---------- */

.faq { margin-top: 26px; display: grid; gap: 22px; }
.faq h3 { margin-bottom: 2px; }
.faq p { margin: 0; color: var(--ink2); }
.faq p + p { margin-top: 8px; }

/* ---------- footer ---------- */

footer {
  border-top: 1px solid var(--rule);
  padding-block: 28px 56px;
  color: var(--ink3); font-size: 15px;
}
footer nav { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 10px; }
footer .credit-link { color: inherit; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- portfolio bar ---------- */
/*
 * Cataloc is one app in a larger portfolio. This strip says so and lets
 * visitors jump to the rest of the site without hunting for the domain root.
 */

.portfolio-bar {
  background: #020617;
  color: #bfdbfe;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 13px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 20px;
  padding: 10px clamp(20px, 5vw, 56px);
}
.portfolio-bar a { color: #bfdbfe; text-decoration: none; }
.portfolio-bar a:hover, .portfolio-bar a:focus-visible { color: #fff; }
.portfolio-bar .brand { color: #fff; font-weight: 700; margin-right: auto; }
.portfolio-bar nav { display: flex; flex-wrap: wrap; gap: 16px; }
