/* Design tokens: shared colors for the plain black-on-white maker palette. */
:root {
  --ink: #050505;
  --paper: #fffdf8;
  --muted: #676767;
  --line: #161616;
  --pink: #ff2aa8;
  --yellow: #fff13d;
  --soft-yellow: #fff7a8;
}

/* Universal sizing: keeps borders and padding inside declared dimensions. */
* {
  box-sizing: border-box;
}

/* Document base: sets the plain sans-serif type and default page colors. */
html {
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
}

/* Page background: subtle grid gives the site a maker/workbench feel. */
body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(5, 5, 5, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(5, 5, 5, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 28px 28px;
}

/* Links: black text by default, with only a pink underline on hover/focus. */
a {
  color: var(--ink);
  text-decoration: none;
  text-decoration-color: var(--pink);
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

a:hover,
a:focus-visible {
  text-decoration: underline;
}

/* Markdown emphasis: yellow highlight for bold and italic text. */
strong,
em {
  background: var(--yellow);
  color: var(--ink);
  padding: 0 0.12em;
}

strong {
  font-weight: 800;
}

/* Page shell: centers content with a readable maximum width. */
.site-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

/* Homepage hero: gives the opening copy breathing room without poster scale. */
.home-hero {
  min-height: 54vh;
  display: grid;
  align-content: center;
  padding: 76px 0 54px;
}

/* Page title: large but restrained heading scale. */
h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2.35rem, 6vw, 4.85rem);
  line-height: 0.96;
  letter-spacing: 0;
}

/* Lead copy: larger body text for introductory Markdown blocks. */
.intro,
.lede {
  max-width: 700px;
  margin-top: 28px;
  font-size: clamp(1.2rem, 2vw, 1.65rem);
  line-height: 1.35;
}

/* Markdown spacing: trims excess margin at content boundaries. */
.markdown-content > :first-child {
  margin-top: 0;
}

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

.markdown-content p {
  margin: 0 0 1em;
}

/* Listing section: groups service and project lists under clear subtitles. */
.listing-section {
  padding: 0 0 70px;
}

/* Section title: compact subtitle above each listing. */
.section-title {
  margin: 0 0 18px;
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
}

/* Card grid: three-up card layout for services and projects. */
.service-grid,
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

/* Service cards: bordered clickable blocks for each offer. */
.service-card {
  color: var(--ink);
  min-height: 260px;
  padding: 18px;
  background: var(--paper);
  border: 2px solid var(--line);
  text-decoration: none;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

/* Service card interaction: shadow and slight lift without changing text. */
.service-card:hover,
.service-card:focus-visible {
  background: white;
  box-shadow: 8px 8px 0 var(--line);
  transform: translate(-3px, -3px);
  text-decoration: none;
  outline: none;
}

/* Service index: small muted numeric marker inside cards. */
.service-index {
  display: inline-block;
  margin-bottom: 38px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

/* Service card title: offer name inside the large clickable boxes. */
.service-card h2 {
  margin: 0 0 14px;
  color: var(--ink);
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1;
  text-decoration: underline;
  text-decoration-color: var(--pink);
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

/* Secondary copy: muted descriptions and stub notes. */
.service-card p,
.stub-note {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.45;
}

/* Stub page layout: spacious single-column detail pages. */
.stub-page {
  min-height: calc(100vh - 154px);
  padding: 86px 0 70px;
}

/* Stub page title: keeps long service headings readable. */
.stub-page h1 {
  max-width: 760px;
}

/* Footer: minimal copyright line. */
.site-footer {
  padding: 24px 0 32px;
  border-top: 2px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

/* Mobile layout: stacks navigation and cards on narrow screens. */
@media (max-width: 760px) {
  /* Mobile shell: slightly tighter page gutters. */
  .site-shell {
    width: min(100% - 24px, 1180px);
  }

  /* Mobile hero: removes viewport-height pressure. */
  .home-hero {
    min-height: auto;
    padding: 52px 0 44px;
  }

  /* Mobile title: limits heading scale on small screens. */
  h1 {
    font-size: clamp(2.4rem, 12vw, 4rem);
  }

  /* Mobile card grids: changes cards to a single column. */
  .service-grid,
  .card-grid {
    grid-template-columns: 1fr;
  }

  /* Mobile service card: shorter cards for narrow screens. */
  .service-card {
    min-height: 210px;
  }

  /* Mobile stub page: reduces top spacing. */
  .stub-page {
    min-height: auto;
    padding-top: 54px;
  }
}
