/* 66 Bytes — shared styles. Mobile-first; no build step. */

:root {
  /* Brand palette carried over from the 2017 66 Bytes site: charcoal
     backgrounds, blue as the accent on light, olive-yellow as the accent on
     dark, blue-grey for the cogs and muted text on dark. */
  --navy: #252f34;
  --navy-soft: #3d4547;
  --ink: #20282b;
  --slate: #505b5f;
  --bg: #f6f6f3;
  --surface: #ffffff;
  --line: #d8dcdc;
  --accent: #1171bd;
  --accent-dark: #0a5895;
  --on-navy: #f4f5f3;
  --on-navy-muted: #b6ced4;
  --accent-on-navy: #c4b61b;
  --cog: #9cb1b6;

  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-heading: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --wrap: 68rem;
  --measure: 40rem;
  --radius: 6px;
}

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

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  overflow-wrap: break-word;
}

h1,
h2,
h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
  color: var(--navy);
  margin: 0 0 0.6em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2rem, 5.5vw, 3.1rem);
  letter-spacing: -0.01em;
}

h2 {
  font-size: clamp(1.5rem, 3.5vw, 2rem);
}

h3 {
  font-size: 1.2rem;
}

p,
ul,
ol {
  margin: 0 0 1.1em;
}

a {
  color: var(--accent-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent);
}

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

img,
svg {
  max-width: 100%;
  height: auto;
}

/* --- Layout --------------------------------------------------------------- */

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

.section {
  padding-block: clamp(2.75rem, 7vw, 5rem);
}

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

.section-alt {
  background: var(--surface);
}

.measure {
  max-width: var(--measure);
}

.lead {
  font-size: 1.2rem;
  color: var(--slate);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.9rem;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  background: var(--navy);
  color: var(--on-navy);
  border-radius: var(--radius);
}

.skip-link:focus {
  top: 1rem;
  color: var(--on-navy);
}

/* --- Header --------------------------------------------------------------- */

.site-header {
  background: var(--navy-soft);
}

.site-header :focus-visible {
  outline-color: var(--accent-on-navy);
}

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

.wordmark {
  display: inline-block;
  line-height: 0;
}

/* The logo is white and olive-yellow, so it only sits on the dark bands. */
.wordmark img {
  display: block;
  height: 2.1rem;
  width: auto;
}

.nav-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-list a:not(.btn) {
  display: inline-block;
  padding-block: 0.5rem;
  color: var(--on-navy);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 2px solid transparent;
}

.nav-list a:not(.btn):hover,
.nav-list a:not(.btn)[aria-current="page"] {
  border-bottom-color: var(--accent-on-navy);
}

/* --- Buttons -------------------------------------------------------------- */

.btn {
  display: inline-block;
  padding: 0.8rem 1.4rem;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  line-height: 1.2;
}

.btn:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  color: #fff;
}

.btn-small {
  padding: 0.5rem 1rem;
}

.btn-ghost {
  background: transparent;
  color: var(--on-navy);
  border-color: var(--on-navy-muted);
}

.btn-ghost:hover {
  background: var(--on-navy);
  border-color: var(--on-navy);
  color: var(--navy);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.6rem;
}

/* --- Hero and dark bands -------------------------------------------------- */

.hero,
.band {
  background: var(--navy);
  color: var(--on-navy);
}

.hero {
  padding-block: clamp(3.25rem, 9vw, 6.5rem);
}

.hero h1,
.band h2 {
  color: var(--on-navy);
}

.hero .eyebrow,
.band .eyebrow {
  color: var(--accent-on-navy);
}

.hero .lead,
.band p {
  color: var(--on-navy-muted);
}

.hero .tagline {
  font-family: var(--font-heading);
  font-size: clamp(1.25rem, 3vw, 1.6rem);
  color: var(--on-navy);
  margin-bottom: 0.8rem;
}

.hero :focus-visible,
.band :focus-visible {
  outline-color: var(--accent-on-navy);
}

.band a:not(.btn) {
  color: var(--accent-on-navy);
}

/* Home hero: circuit photo, mirrored so its detail sits on the right, under a
   charcoal wash that keeps the text side almost solid. On narrow screens the
   text covers the whole image, so the wash is heavier and even. */
.hero-home {
  --wash: linear-gradient(rgba(37, 47, 52, 0.86), rgba(37, 47, 52, 0.86));
  background-color: var(--navy);
  background-image: var(--wash), url("../images/hero-circuit.jpg");
  background-image: var(--wash), image-set(
    url("../images/hero-circuit.webp") type("image/webp"),
    url("../images/hero-circuit.jpg") type("image/jpeg")
  );
  background-size: cover;
  background-position: right center;
  background-repeat: no-repeat;
}

@media (min-width: 56rem) {
  .hero-home {
    --wash: linear-gradient(
      90deg,
      rgba(37, 47, 52, 0.96) 0%,
      rgba(37, 47, 52, 0.88) 40%,
      rgba(37, 47, 52, 0.45) 100%
    );
  }
}

.hero-inner {
  display: grid;
  gap: 2rem;
  align-items: center;
}

/* Decorative cogs from the original site; hidden where there is no room. */
.hero-cogs {
  display: none;
}

@media (min-width: 56rem) {
  .hero-inner {
    grid-template-columns: minmax(0, 1fr) minmax(0, 22rem);
    gap: 3rem;
  }

  .hero-cogs {
    display: block;
    width: 100%;
    height: auto;
  }
}

.page-head {
  padding-block: clamp(2.5rem, 7vw, 4.5rem) clamp(2rem, 5vw, 3rem);
  border-bottom: 1px solid var(--line);
}

.page-head .lead {
  margin-bottom: 0;
}

/* --- Cards and grids ------------------------------------------------------ */

.grid {
  display: grid;
  gap: 1.25rem;
  list-style: none;
  margin: 1.8rem 0 0;
  padding: 0;
}

@media (min-width: 40rem) {
  .grid-2,
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

  .grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

.card {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--navy);
  border-radius: var(--radius);
}

.section-alt .card {
  background: var(--bg);
}

.card h3 {
  margin-bottom: 0.5rem;
}

/* The service icons are olive-yellow, so they sit on a charcoal tile. */
.card-icon {
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  margin-bottom: 1.1rem;
  background: var(--navy-soft);
  border-radius: var(--radius);
}

.card-icon img {
  width: 2.1rem;
  height: 2.1rem;
  object-fit: contain;
}

.card p {
  color: var(--slate);
  font-size: 1rem;
}

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

.card .card-link {
  margin-top: auto;
  padding-top: 0.4rem;
  font-weight: 600;
}

.card-featured {
  border-top-color: var(--accent);
}

.point h3 {
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.point p {
  color: var(--slate);
  margin-bottom: 0;
}

/* --- Split layout --------------------------------------------------------- */

.split {
  display: grid;
  gap: 2rem;
}

@media (min-width: 52rem) {
  .split {
    grid-template-columns: 1fr 1fr;
    gap: 3.5rem;
    align-items: start;
  }

  .split-narrow {
    grid-template-columns: 1fr 2fr;
  }
}

/* --- Lists ---------------------------------------------------------------- */

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

.checks li {
  position: relative;
  padding-left: 1.6rem;
  margin-bottom: 0.55rem;
}

.checks li::before {
  content: "";
  position: absolute;
  left: 0.15rem;
  top: 0.62em;
  width: 0.55rem;
  height: 0.55rem;
  background: var(--accent);
  border-radius: 1px;
}

.band .checks li::before {
  background: var(--accent-on-navy);
}

.deflist {
  margin: 1.5rem 0 0;
}

.deflist div {
  padding-block: 1rem;
  border-top: 1px solid var(--line);
}

.deflist dt {
  font-weight: 700;
  color: var(--navy);
}

.deflist dd {
  margin: 0.2rem 0 0;
  color: var(--slate);
}

@media (min-width: 46rem) {
  .deflist div {
    display: grid;
    grid-template-columns: 14rem 1fr;
    gap: 1.5rem;
  }

  .deflist dd {
    margin: 0;
  }
}

.steps {
  list-style: none;
  counter-reset: step;
  margin: 1.8rem 0 0;
  padding: 0;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding: 0 0 1.6rem 3.4rem;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 2.2rem;
  height: 2.2rem;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--navy);
  background: var(--bg);
  border: 2px solid var(--navy);
  border-radius: 50%;
}

.steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: calc(1.1rem - 1px);
  top: 2.5rem;
  bottom: 0.3rem;
  width: 2px;
  background: var(--line);
}

.steps h3 {
  font-family: var(--font-body);
  font-size: 1.08rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  padding-top: 0.25rem;
}

.steps p {
  color: var(--slate);
  margin-bottom: 0;
  max-width: var(--measure);
}

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

.tags li {
  padding: 0.3rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--navy);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.section-alt .tags li {
  background: var(--bg);
}

.note {
  padding: 1.25rem 1.4rem;
  background: var(--surface);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.section-alt .note {
  background: var(--bg);
}

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

.contact-email {
  font-family: var(--font-heading);
  font-size: clamp(1.3rem, 4vw, 1.8rem);
  font-weight: 600;
}

/* --- Footer --------------------------------------------------------------- */

.site-footer {
  background: var(--navy);
  color: var(--on-navy-muted);
  padding-block: 2.75rem 2rem;
  font-size: 0.98rem;
}

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

.site-footer :focus-visible {
  outline-color: var(--accent-on-navy);
}

.footer-grid {
  display: grid;
  gap: 2rem;
}

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


.footer-heading {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--on-navy-muted);
  margin: 0 0 0.7rem;
}

.footer-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-list li {
  margin-bottom: 0.4rem;
}

.footer-legal {
  margin: 2.25rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--navy-soft);
  font-size: 0.9rem;
  color: var(--on-navy-muted);
}
