/* Repair It With Garrett. Colours come from the badge in /art/badge-master.png. */

:root {
  color-scheme: light dark;

  --navy: #2a2f4b;
  --navy-badge: #383c5b;
  --blue: #aad1db;
  --orange: #fd9120;
  --brown: #38210f;
  --cream: #f6f1e7;

  --page: var(--cream);
  --text: var(--navy);
  --muted: #4a4f6a;
  --surface: #ffffff;
  --surface-edge: #c9c3b6;
  --link: #24407a;
  --focus: var(--navy);

  --target-size: 2.75rem;
  --radius: 0.75rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #161929;
    --text: var(--cream);
    --muted: #c9cbd8;
    --surface: #22263c;
    --surface-edge: #4a4f6a;
    --link: var(--blue);
    --focus: var(--orange);
  }
}

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

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

img {
  max-inline-size: 100%;
  block-size: auto;
}

h1,
h2,
h3 {
  line-height: 1.15;
  text-wrap: balance;
}

h1,
h2 {
  font-weight: 900;
  font-style: italic;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(2rem, 1.4rem + 2.5vw, 3.25rem);
  margin-block: 0 1rem;
}

h2 {
  font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.25rem);
  margin-block: 0 1rem;
}

/* An orange bar under section headings, like the stripe on the badge. */
h2::after {
  content: "";
  display: block;
  inline-size: 3.5rem;
  block-size: 0.3rem;
  margin-block-start: 0.5rem;
  border-radius: 0.15rem;
  background: var(--orange);
}

h3 {
  font-size: 1.25rem;
  margin-block: 0 0.35rem;
}

p,
li {
  text-wrap: pretty;
}

p {
  margin-block: 0 1rem;
  max-inline-size: 65ch;
}

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

:where(a, button):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.wrap {
  max-inline-size: 68rem;
  margin-inline: auto;
  padding-inline: 1.25rem;
}

/* Buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-block-size: var(--target-size);
  min-inline-size: var(--target-size);
  padding: 0.5rem 1.25rem;
  border: 2px solid transparent;
  border-radius: 999px;
  font-weight: 800;
  font-size: 1.0625rem;
  text-decoration: none;
  line-height: 1.2;
  text-align: center;
  overflow-wrap: normal;
}

/* The header Call button keeps its size; the name beside it wraps instead. */
.site-header .button {
  flex: none;
}

.button-primary {
  background: var(--orange);
  color: var(--navy);
}

.button-primary:hover {
  background: #ffa646;
}

.button-secondary {
  border-color: currentColor;
  color: var(--text);
}

.button-secondary:hover {
  background: color-mix(in oklab, currentColor 10%, transparent);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-block: 1.5rem 0;
}

/* Header */

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 1.25rem;
  background: var(--navy);
  color: #ffffff;
}

/* Keep Call in reach while scrolling, but not when zoom or large text leaves little height. */
@media (min-height: 32em) {
  /* Links to #contact and other anchors land below the sticky header, not under it. */
  :root {
    scroll-padding-block-start: 5rem;
  }

  .site-header {
    position: sticky;
    inset-block-start: 0;
    z-index: 1;
  }
}

.site-header :focus-visible {
  outline-color: var(--orange);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-block-size: var(--target-size);
  color: inherit;
  font-weight: 900;
  font-style: italic;
  font-size: 1.125rem;
  line-height: 1.15;
  text-decoration: none;
}

/* The name wraps between words, never inside one; when even its longest word
   won't fit beside the Call button, the button moves to its own line. */
.brand {
  flex: 1 1 0;
}

.brand span {
  overflow-wrap: normal;
}

.brand img {
  flex: none;
  inline-size: 3rem;
  block-size: 3rem;
}

/* Hero */

.hero {
  padding-block: 2rem 2.5rem;
  border-block-end: 0.75rem solid var(--blue);
}

.hero-inner {
  display: grid;
  gap: 1.5rem;
  justify-items: center;
  text-align: center;
}

.hero-badge {
  inline-size: min(80vw, 20rem);
}

.hero .actions {
  justify-content: center;
}

.lede {
  font-size: 1.1875rem;
  margin-inline: auto;
}

@media (min-width: 48em) {
  .hero {
    padding-block: 3.5rem;
  }

  .hero-inner {
    grid-template-columns: 22rem 1fr;
    align-items: center;
    justify-items: start;
    gap: 3rem;
    text-align: start;
  }

  .hero-badge {
    inline-size: 22rem;
  }

  .hero .actions {
    justify-content: start;
  }

  .lede {
    margin-inline: 0;
  }
}

/* Sections */

.section {
  padding-block: 3rem;
}

.section-dark {
  background: var(--navy);
  color: var(--cream);
}

.section-tint {
  background: color-mix(in oklab, var(--blue) 30%, var(--page));
}

.section-stripe {
  background: var(--blue);
  color: var(--navy);
}

.section-stripe a:not(.button) {
  color: var(--navy);
}

.section-stripe .button-secondary {
  color: var(--navy);
}

.section-stripe :focus-visible {
  outline-color: var(--navy);
}

.note {
  margin-block-start: 1.5rem;
  color: var(--muted);
}

/* What I fix */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 11.5rem), 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.card {
  padding: 1.25rem;
  border: 1px solid var(--surface-edge);
  border-block-start: 0.4rem solid var(--navy-badge);
  border-radius: var(--radius);
  background: var(--surface);
}

@media (prefers-color-scheme: dark) {
  .card {
    border-block-start-color: var(--blue);
  }
}

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

/* How it works */

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 1rem;
}

.steps li::before {
  content: counter(step);
  grid-row: span 2;
  display: grid;
  place-items: center;
  inline-size: 2.75rem;
  block-size: 2.75rem;
  border-radius: 50%;
  background: var(--orange);
  color: var(--navy);
  font-weight: 900;
  font-size: 1.25rem;
}

.steps p {
  margin: 0;
}

/* Where I work */

.towns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.towns li {
  padding: 0.35rem 0.9rem;
  border: 1px solid var(--surface-edge);
  border-radius: 999px;
  background: var(--surface);
  font-weight: 600;
}

/* About and mowers */

.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  gap: 2rem 3rem;
}

/* For sale */

.listing {
  display: grid;
  gap: 1.25rem 2rem;
  padding: 1.25rem;
  border: 1px solid var(--surface-edge);
  border-radius: var(--radius);
  background: var(--surface);
}

@media (min-width: 56em) {
  .listing {
    grid-template-columns: 30rem 1fr;
    align-items: start;
  }

  .gallery {
    grid-column: 1 / -1;
  }
}

.listing-photo,
.gallery a {
  display: block;
}

.listing-photo img,
.gallery img {
  display: block;
  inline-size: 100%;
  border-radius: calc(var(--radius) / 2);
}

.gallery img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.status {
  font-size: 1.125rem;
}

.specs {
  margin: 0;
  padding-inline-start: 1.25rem;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 9rem), 1fr));
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Contact */

.phone {
  margin-block: 0.5rem 0;
  font-size: clamp(2rem, 1.5rem + 2vw, 3rem);
  font-weight: 900;
  font-style: italic;
}

.phone a {
  text-decoration: none;
}

.phone a:hover {
  text-decoration: underline;
}

.section-stripe .actions {
  margin-block: 1rem 1.5rem;
}

/* Service pages */

.page-hero .lede {
  margin-inline: 0;
}

.page-hero .actions {
  justify-content: start;
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
  color: var(--muted);
}

.crumbs li + li::before {
  content: "›" / "";
  margin-inline-end: 0.5rem;
}

.prose > :first-child {
  margin-block-start: 0;
}

.prose h2 {
  margin-block-start: 2.5rem;
}

.prose ul {
  max-inline-size: 65ch;
  margin-block: 0 1rem;
  padding-inline-start: 1.25rem;
}

.prose li + li {
  margin-block-start: 0.4rem;
}

.card h3 a {
  color: inherit;
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pills a {
  display: inline-flex;
  align-items: center;
  min-block-size: var(--target-size);
  padding: 0.35rem 1rem;
  border: 1px solid var(--surface-edge);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.pills a:hover {
  border-color: currentColor;
}

/* Footer */

.site-footer {
  padding-block: 1.5rem;
  background: var(--navy);
  color: var(--cream);
}

.site-footer a {
  color: var(--cream);
}

.site-footer :focus-visible {
  outline-color: var(--orange);
}

.site-footer p {
  margin: 0;
}

/* Windows High Contrast and other forced-colour modes keep the bars visible. */
@media (forced-colors: active) {
  h2::after {
    background: CanvasText;
  }

  .steps li::before {
    border: 2px solid CanvasText;
  }
}
