/* Tractor Playground website: one stylesheet, system fonts only, no JavaScript.
   Colors are tokens on :root, redefined for dark mode. Every text/background pair is at least 5.6:1 (WCAG AA). */

:root {
  color-scheme: light dark;

  --bg: #fbf8f0;            /* cream, like the tractor's wheels */
  --surface: #ffffff;
  --surface-2: #f3efe3;     /* empty screenshot frames */
  --sky: #e4f0fa;           /* top of the hero */
  --text: #18241b;
  --muted: #4a574d;
  --accent: #2c6e36;        /* tractor green (green + cream, never green + yellow) */
  --accent-text: #2a6a33;
  --link: #1b5ea6;
  --border: #d9d1bd;
  --tag-bg: #e3efe1;
  --tag-text: #1f5428;
  --pack-bg: #e2edf9;
  --pack-text: #17487f;
  --todo-bg: #fff1b8;
  --todo-text: #3d2f00;
  --focus: #1b5ea6;
  --shadow: 0 1px 2px rgb(24 36 27 / 0.06), 0 10px 30px rgb(24 36 27 / 0.08);

  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --radius: 1.25rem;
  --gutter: clamp(1rem, 4vw, 2rem);   /* 16px on a phone */
  --measure: 68rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101612;
    --surface: #172019;
    --surface-2: #1e2a21;
    --sky: #13202b;
    --text: #ecf1e9;
    --muted: #b3c0b4;
    --accent: #86d391;
    --accent-text: #8fd89a;
    --link: #93c5ff;
    --border: #2f3e33;
    --tag-bg: #213426;
    --tag-text: #b5e8bb;
    --pack-bg: #1c2c40;
    --pack-text: #b9d8ff;
    --todo-bg: #4a3b00;
    --todo-text: #ffe9a3;
    --focus: #93c5ff;
    --shadow: none;
  }
}

/* Base */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.6 var(--font);
  overflow-wrap: break-word;
}

img,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--link);
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  line-height: 1.2;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.25rem, 6vw, 3.5rem);
  letter-spacing: -0.01em;
}

h2 {
  font-size: clamp(1.6rem, 4vw, 2.25rem);
}

h3 {
  font-size: 1.3rem;
  margin-top: 1.75em;
}

h4 {
  font-size: 1.15rem;
}

p,
ul,
ol,
dl {
  margin: 0 0 1em;
}

li + li {
  margin-top: 0.35em;
}

/* Visible placeholders the owner must fill (search the files for TODO(owner)). */
.todo {
  background: var(--todo-bg);
  color: var(--todo-text);
  border: 1px dashed currentColor;
  border-radius: 0.3em;
  padding: 0 0.3em;
}

/* Layout */

.wrap {
  width: 100%;
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  z-index: 10;
  background: var(--surface);
  color: var(--text);
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  box-shadow: var(--shadow);
}

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

.header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-block: 0.75rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
}

.brand img {
  width: 2rem;
  height: 2rem;
  border-radius: 22.5%;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav li + li {
  margin-top: 0;
}

.site-nav a {
  display: inline-block;
  padding-block: 0.35rem;
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

.section {
  padding-block: clamp(2.5rem, 6vw, 4.5rem);
}

.section + .section {
  border-top: 1px solid var(--border);
}

.section-intro {
  max-width: 44rem;
  color: var(--muted);
  font-size: 1.1rem;
}

/* Hero */

.hero-band {
  background: linear-gradient(to bottom, var(--sky), var(--bg));
}

.hero {
  display: grid;
  gap: 1.5rem 2.5rem;
  align-items: center;
  padding-block: clamp(2.5rem, 7vw, 5rem);
}

@media (min-width: 46rem) {
  .hero {
    grid-template-columns: auto 1fr;
  }
}

.hero-icon {
  width: 9rem;
  height: 9rem;
  border-radius: 22.5%;
  box-shadow: var(--shadow);
}

.hero h1 {
  margin-bottom: 0.2em;
}

.tagline {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 3vw, 1.6rem);
  font-weight: 600;
  color: var(--accent-text);
  margin-bottom: 0.75em;
}

.lede {
  font-size: 1.15rem;
  max-width: 42rem;
}

.get {
  margin-top: 1.5rem;
}

/* Placeholder until Apple's official badge goes in. Deliberately plain: it must not look like the badge. */
.store-placeholder {
  display: inline-flex;
  align-items: center;
  min-height: 3rem;
  padding: 0.7rem 1.4rem;
  margin-bottom: 0.75rem;
  border: 2px dashed var(--muted);
  border-radius: 999px;
  background: var(--surface);
  font-weight: 700;
}

.fine {
  color: var(--muted);
  font-size: 0.95rem;
}

/* Screenshots and the preview video */

.shots {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: minmax(0, 1fr);
  margin-bottom: 1rem;
}

/* Four shots per device: two by two once there's room. */
@media (min-width: 40rem) {
  .shots {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.shot {
  margin: 0;
}

.shot img,
.video video {
  width: 100%;
  border-radius: 0.9rem;
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.shot img {
  height: auto;
  object-fit: cover;
}

.shot--iphone img {
  aspect-ratio: 2868 / 1320;
}

.shot--ipad img {
  aspect-ratio: 3 / 4;   /* upright, as the iPad App Store screenshots */
}

/* The upright iPad shots: two across on a phone, all four once there's room. */
.shots--ipad {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 56rem) {
  .shots--ipad {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.shot figcaption,
.video figcaption {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.video {
  margin: 0;
  max-width: 56rem;
}

.video video {
  aspect-ratio: 1920 / 886;
  object-fit: contain;
}

/* Vehicles */

/* Column counts are explicit so a row never ends with one card on its own:
   three items go 1 → 3 columns, four go 1 → 2, six go 1 → 2 → 3. */
.cards,
.points {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr);
  list-style: none;
  padding: 0;
}

@media (min-width: 40rem) {
  .cards--four,
  .points {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 46rem) {
  .cards--three,
  .points--three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 60rem) {
  .points {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.cards {
  margin: 0 0 1rem;
}

.cards > li {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.cards h4 {
  margin-bottom: 0.35rem;
}

.cards p {
  margin: 0;
  color: var(--muted);
}

.tag {
  display: inline-block;
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.5;
  padding: 0.1rem 0.65rem;
  border-radius: 999px;
  background: var(--tag-bg);
  color: var(--tag-text);
  vertical-align: middle;
}

.tag--pack {
  background: var(--pack-bg);
  color: var(--pack-text);
}

/* Lists of points (principles, devices, grown-ups) */

.points {
  margin: 0 0 1rem;
}

.points > li {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
}

.points strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.points span {
  color: var(--muted);
}

.dots {
  list-style: none;
  padding: 0;
}

.dots > li {
  position: relative;
  padding-left: 1.5rem;
}

.dots > li::before {
  content: "";
  position: absolute;
  left: 0.3rem;
  top: 0.62em;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--accent);
}

/* Text pages (privacy, support) */

.page-head {
  padding-block: clamp(2rem, 6vw, 3.5rem) 0.5rem;
}

.prose {
  max-width: 44rem;
  padding-bottom: clamp(2.5rem, 6vw, 4.5rem);
}

.prose h2 {
  font-size: clamp(1.35rem, 3vw, 1.6rem);
  margin-top: 2em;
  scroll-margin-top: 1rem;
}

.prose ul,
.prose ol {
  padding-left: 1.4rem;
}

.prose dt {
  font-weight: 700;
}

.prose dd {
  margin: 0 0 0.75em;
}

.callout {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 6px solid var(--accent);
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  margin-block: 1.5rem;
}

.callout > :last-child {
  margin-bottom: 0;
}

.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1rem 1.25rem 1rem 2.6rem;
}

.path {
  font-weight: 600;
}

kbd {
  font: inherit;
  font-weight: 600;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 0.35rem;
  padding: 0 0.35em;
  background: var(--surface);
}

/* Footer */

.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.95rem;
  padding-block: 2rem 2.5rem;
}

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  list-style: none;
  padding: 0;
}

.site-footer li + li {
  margin-top: 0;
}

.site-footer a {
  font-weight: 600;
}

.legal {
  font-size: 0.85rem;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

@media print {
  .site-header nav,
  .skip-link,
  .get {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }
}
