/* jack7 marketing site — clean-pixel skin.
 *
 * Design tokens are ported verbatim from the shipped iOS design system
 * (ios/jack7/jack7/DesignSystem/J7PixelTheme.swift). If a colour changes there,
 * change it here too — the site and the App Store screenshots sit side by side,
 * so drift is immediately visible.
 *
 * Pixel Operator is public domain (CC0), which is why it can be self-hosted.
 */

@font-face {
  font-family: "Pixel Operator 8";
  src: url("/static/fonts/PixelOperator8.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Pixel Operator 8";
  src: url("/static/fonts/PixelOperator8-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: light;

  --paper: #fafaf8;
  --surface: #ffffff;
  --surface-alt: #f1f2f0;
  --border: #d8dce3;
  --ink: #111827;
  --muted: #6b7280;
  --navy: #172033;
  --gold: #e1b84b;
  --red: #c83232;
  --green: #31b86b;
  --blue: #2f8dd8;

  --grid: rgba(23, 32, 51, 0.055);
  --shadow: rgba(23, 32, 51, 0.16);

  /* Pixel Operator is drawn on an 8px grid — keeping sizes at integer
     multiples of 8 stops the glyphs blurring between pixels. */
  --pixel: "Pixel Operator 8", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --body: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  /* Graph-paper background, matching the app's drifting-grid surface. */
  background-color: var(--paper);
  background-image:
    linear-gradient(to right, var(--grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: 64px 64px;
  color: var(--ink);
  font: 17px/1.7 var(--body);
  -webkit-text-size-adjust: 100%;
}

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

a:hover {
  text-decoration-color: var(--red);
}

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

.wrap {
  width: min(960px, calc(100% - 32px));
  margin: 0 auto;
}

/* ---------- header ---------- */

.site-header {
  border-bottom: 2px solid var(--navy);
  background: var(--surface);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--pixel);
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--navy);
  text-decoration: none;
}

.brand img {
  width: 32px;
  height: 32px;
  border: 2px solid var(--navy);
}

.links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: flex-end;
  font-family: var(--pixel);
  font-size: 16px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.links a {
  color: var(--muted);
  text-decoration: none;
}

.links a:hover {
  color: var(--navy);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--red);
}

/* ---------- page shell ---------- */

main {
  padding: 40px 0 64px;
}

.page {
  border: 2px solid var(--navy);
  border-radius: 0;
  background: var(--surface);
  /* Hard, un-blurred offset shadow — the signature of the pixel system. */
  box-shadow: 6px 6px 0 var(--shadow);
  padding: clamp(24px, 5vw, 52px);
}

.suits {
  font-family: var(--pixel);
  font-size: 16px;
  letter-spacing: 0.5em;
  color: var(--muted);
  margin: 0 0 24px;
}

/* ---------- typography ---------- */

h1,
h2,
h3 {
  font-family: var(--pixel);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.1;
  color: var(--navy);
}

h1 {
  font-size: clamp(40px, 8vw, 64px);
  margin: 0 0 16px;
}

h2 {
  font-size: 32px;
  margin: 48px 0 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
}

h3 {
  font-size: 24px;
  margin: 32px 0 10px;
}

p,
ul,
ol {
  max-width: 68ch;
}

p {
  margin: 0 0 18px;
}

ul,
ol {
  padding-left: 22px;
}

li {
  margin: 8px 0;
}

strong {
  color: var(--navy);
}

code {
  font-family: var(--pixel);
  font-size: 16px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  padding: 1px 5px;
}

hr {
  height: 2px;
  border: 0;
  background: var(--border);
  margin: 40px 0;
}

.lead {
  font-size: 20px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 62ch;
}

blockquote {
  margin: 24px 0;
  padding: 4px 0 4px 20px;
  border-left: 4px solid var(--gold);
  color: var(--muted);
}

table {
  border-collapse: collapse;
  width: 100%;
  margin: 24px 0;
}

th,
td {
  border: 2px solid var(--border);
  padding: 8px 12px;
  text-align: left;
}

th {
  font-family: var(--pixel);
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--surface-alt);
}

/* ---------- call to action ---------- */

.cta-row a {
  display: inline-block;
  font-family: var(--pixel);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--surface);
  background: var(--navy);
  border: 2px solid var(--navy);
  padding: 14px 28px;
  box-shadow: 5px 5px 0 var(--shadow);
  transition: transform 80ms steps(2), box-shadow 80ms steps(2);
}

.cta-row a:hover {
  color: var(--surface);
  text-decoration: none;
}

/* Presses "into" the page, like the app's buttons. */
.cta-row a:active {
  transform: translate(5px, 5px);
  box-shadow: 0 0 0 var(--shadow);
}

/* ---------- screenshot gallery ---------- */

.shots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
  max-width: none;
  margin: 28px 0 32px;
}

.shots figure {
  margin: 0;
}

.shots img {
  display: block;
  width: 100%;
  height: auto;
  border: 2px solid var(--navy);
  box-shadow: 5px 5px 0 var(--shadow);
  /* NOTE: no `image-rendering: pixelated` here on purpose. These are 1320px
     wide sources shown at ~280px, i.e. downscaled — nearest-neighbour would
     alias the pixel art badly. Smooth downscaling is correct. */
}

.shots figcaption {
  font-family: var(--pixel);
  font-size: 16px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 10px;
  text-align: center;
}

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

.site-footer {
  border-top: 2px solid var(--border);
  padding: 24px 0 36px;
  color: var(--muted);
  font-family: var(--pixel);
  font-size: 16px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.footer-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* ---------- responsive ---------- */

@media (max-width: 640px) {
  body {
    background-size: 40px 40px;
  }

  .nav {
    flex-direction: column;
    align-items: flex-start;
  }

  .links {
    justify-content: flex-start;
    gap: 14px;
  }

  main {
    padding: 24px 0 40px;
  }

  .page {
    box-shadow: 4px 4px 0 var(--shadow);
  }

  h2 {
    font-size: 24px;
    margin-top: 36px;
  }

  h3 {
    font-size: 20px;
  }

  .cta-row a {
    font-size: 20px;
    display: block;
    text-align: center;
  }

  .footer-row {
    flex-direction: column;
    gap: 6px;
  }
}

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