/* Bitwise Technology Group — site styles
   No external requests: fonts are self-hosted, no inline styles or scripts (CSP-friendly). */

@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-var.woff2") format("woff2");
  font-weight: 300 800;
  font-stretch: 100% 125%;
  font-style: normal;
  font-display: swap;
}

:root {
  --navy: #1B2B52;
  --navy-deep: #121D3A;
  --ink: #151B28;
  --text-2: #465066;
  --paper: #F4F5F7;
  --paper-2: #E8EBF0;
  --rule: #C9CFDA;
  --brass: #D4A73A;
  --brass-ink: #7F5C0E;
  --on-navy: #F4F5F7;
  --on-navy-2: #B6C0D4;

  --wide: 125%;
  --measure: 66ch;
  --page: 75rem;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --radius: 6px;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3125rem;
  --step-2: 1.625rem;
  --step-3: clamp(1.875rem, 3.2vw, 2.5rem);
  --step-4: clamp(2.375rem, 5.4vw, 4.25rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: var(--step-0);
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  font-kerning: normal;
  font-variant-numeric: tabular-nums;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--navy); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--brass); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3 {
  font-stretch: var(--wide);
  font-weight: 640;
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0 0 0.6em;
  text-wrap: balance;
}
h1 { font-size: var(--step-4); letter-spacing: -0.025em; }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); line-height: 1.2; }
p { margin: 0 0 1em; max-width: var(--measure); text-wrap: pretty; }
ul, ol { padding-left: 1.2em; }

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 10;
  background: var(--brass); color: var(--ink); padding: 0.6rem 1rem; border-radius: var(--radius);
  font-weight: 600; text-decoration: none;
}
.skip:focus { top: 1rem; }

.wrap { max-width: var(--page); margin: 0 auto; padding: 0 var(--gutter); }
.lede { font-size: var(--step-1); line-height: 1.5; color: var(--text-2); }

/* ---------- Header ---------- */
.site-header { background: var(--paper); border-bottom: 1px solid var(--rule); }
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem 2rem; flex-wrap: wrap; padding-top: 1rem; padding-bottom: 1rem;
}
.brand img { width: 11.5rem; }
.nav { display: flex; align-items: center; gap: 0.25rem 1.75rem; flex-wrap: wrap; }
.nav a { text-decoration: none; font-weight: 500; color: var(--ink); padding: 0.35rem 0; }
.nav a:hover { color: var(--navy); text-decoration: underline; }
.nav a[aria-current="page"] { color: var(--navy); box-shadow: inset 0 -2px 0 var(--brass); }
.nav .btn { margin-left: 0.5rem; padding: 0.6rem 1.05rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; font: inherit; font-weight: 600; line-height: 1.2;
  padding: 0.8rem 1.25rem; border-radius: var(--radius); text-decoration: none;
  border: 2px solid transparent; cursor: pointer;
}
.btn-primary { background: var(--brass); color: var(--ink); }
.btn-primary:hover { background: #E2B84E; text-decoration: none; }
.btn-ghost { border-color: currentColor; color: var(--on-navy); }
.btn-ghost:hover { background: rgba(244,245,247,0.08); text-decoration: none; }
.btn-dark { background: var(--navy); color: var(--on-navy); }
.btn-dark:hover { background: var(--navy-deep); text-decoration: none; }
.nav .btn-dark, .nav .btn-dark:hover { color: var(--on-navy); text-decoration: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }

/* ---------- Hero (navy) ---------- */
.hero { background: var(--navy); color: var(--on-navy); padding: clamp(3.5rem, 8vw, 6.5rem) 0 clamp(3rem, 6vw, 5rem); }
.hero h1 { max-width: 16ch; }
.hero .lede { color: var(--on-navy-2); max-width: 58ch; }
.hero a:not(.btn) { color: var(--on-navy); }
.hero-sub { padding-bottom: clamp(2.5rem, 5vw, 4rem); }
.hero-sub h1 { max-width: 20ch; }

/* The register: the company's age as one byte */
.register { margin-top: clamp(3rem, 7vw, 5rem); }
.register-row { display: flex; align-items: flex-end; gap: clamp(1rem, 3vw, 2.5rem); flex-wrap: wrap; }
.bits { display: grid; grid-template-columns: repeat(8, var(--cell)); gap: calc(var(--cell) * 0.16); --cell: clamp(2.1rem, 8.2vw, 5.25rem); }
.bit { display: grid; grid-template-rows: auto var(--cell); gap: 0.4rem; text-align: center; }
.bit-index { font-size: var(--step--1); color: var(--on-navy-2); }
.bit-cell {
  border: 1.5px solid rgba(244,245,247,0.35); border-radius: calc(var(--cell) * 0.14);
  display: grid; place-items: center; font-weight: 600; font-size: calc(var(--cell) * 0.34);
  color: rgba(244,245,247,0.45);
}
.bit.on .bit-cell { background: var(--brass); border-color: var(--brass); color: var(--ink); }
.register-value { font-stretch: var(--wide); font-weight: 700; font-size: calc(var(--step-4) * 1.15); line-height: 0.9; }
.register-value span { color: var(--on-navy-2); font-weight: 400; }
.register-caption { margin: 1rem 0 0; color: var(--on-navy-2); font-size: var(--step--1); }

@media (prefers-reduced-motion: no-preference) {
  .bit-cell { transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease; }
}

/* ---------- Sections ---------- */
.section { padding: clamp(3.5rem, 8vw, 6rem) 0; }
.section-alt { background: var(--paper-2); }
.section-head { margin-bottom: clamp(2rem, 4vw, 3rem); }
.section-head p { color: var(--text-2); }

.split { display: grid; gap: 2rem 4rem; grid-template-columns: 1fr; }
@media (min-width: 56rem) { .split { grid-template-columns: 5fr 7fr; } }

/* Service rows */
.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.row { display: grid; gap: 0.5rem 3rem; padding: 2rem 0; border-bottom: 1px solid var(--rule); grid-template-columns: 1fr; }
@media (min-width: 52rem) { .row { grid-template-columns: 5fr 7fr; } }
.row h3 { font-size: var(--step-2); margin: 0; }
.row h3 a { color: var(--ink); text-decoration: none; }
.row h3 a:hover { color: var(--navy); text-decoration: underline; }
.row p { color: var(--text-2); margin-bottom: 0.6rem; }
.more { font-weight: 600; }

/* Principles with a bit marker */
.grid-2 { display: grid; gap: 2.5rem 4rem; grid-template-columns: 1fr; }
@media (min-width: 48rem) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.marked h3 { display: flex; gap: 0.75rem; align-items: baseline; }
.marked h3::before {
  content: ""; flex: none; width: 0.7em; height: 0.7em; border-radius: 2px;
  background: var(--brass); transform: translateY(0.05em);
}
.marked p { color: var(--text-2); }

/* Definition-style offering list */
.offerings { display: grid; gap: 0 4rem; grid-template-columns: 1fr; margin: 0; }
@media (min-width: 48rem) { .offerings { grid-template-columns: 1fr 1fr; } }
.offerings div { border-top: 1px solid var(--rule); padding: 1.25rem 0 1.5rem; }
.offerings dt { font-weight: 640; font-stretch: 112%; font-size: var(--step-1); margin-bottom: 0.35rem; line-height: 1.25; }
.offerings dd { margin: 0; color: var(--text-2); max-width: 52ch; }

.situations { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.situations li {
  position: relative; padding-left: 1.75rem; font-size: var(--step-1); line-height: 1.45; max-width: 44ch;
}
.situations li::before {
  content: ""; position: absolute; left: 0; top: 0.5em; width: 0.6em; height: 0.6em;
  background: var(--navy); border-radius: 2px;
}

/* Sequenced steps (a real sequence, so numbered) */
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 2rem; counter-reset: step; grid-template-columns: 1fr; }
@media (min-width: 52rem) { .steps { grid-template-columns: repeat(4, 1fr); } }
.steps li { counter-increment: step; border-top: 3px solid var(--navy); padding-top: 1rem; }
.steps li::before {
  content: counter(step); display: block; font-stretch: var(--wide); font-weight: 700;
  font-size: var(--step-2); color: var(--brass-ink); margin-bottom: 0.5rem;
}
.steps h3 { margin-bottom: 0.4rem; }
.steps p { color: var(--text-2); font-size: 1rem; }

/* Service detail blocks on overview page */
.svc { padding: 2.5rem 0; border-top: 1px solid var(--rule); }
.svc:first-child { border-top: 0; padding-top: 0; }
.svc ul { columns: 2 16rem; column-gap: 3rem; color: var(--text-2); margin: 0 0 1rem; }
.svc li { margin-bottom: 0.35rem; break-inside: avoid; }

/* Person */
.person { display: grid; gap: 1.5rem 3rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 48rem) { .person { grid-template-columns: 14rem 1fr; } }
.monogram {
  width: 14rem; max-width: 100%; aspect-ratio: 1; background: var(--navy); border-radius: var(--radius);
  display: grid; place-items: center; color: var(--on-navy); font-stretch: var(--wide); font-weight: 700; font-size: 4rem;
}
.role { color: var(--text-2); margin-top: -0.4rem; }

/* CTA band */
.cta { background: var(--navy); color: var(--on-navy); padding: clamp(3.5rem, 7vw, 5.5rem) 0; }
.cta h2 { max-width: 18ch; }
.cta p { color: var(--on-navy-2); }
.cta .email-big {
  display: inline-block; color: var(--on-navy); font-stretch: 112%; font-weight: 600;
  font-size: clamp(1.25rem, 3.4vw, 2.25rem); word-break: break-word; margin-top: 0.5rem;
  text-decoration-color: var(--brass); text-decoration-thickness: 2px;
}
.cta .email-big:hover { text-decoration-thickness: 3px; }

/* Related services */
.related { display: flex; flex-wrap: wrap; gap: 0.75rem 2rem; list-style: none; padding: 0; margin: 0; }
.related a { font-weight: 600; }

/* Contact form */
.form { display: grid; gap: 1.25rem; max-width: 40rem; }
.field { display: grid; gap: 0.4rem; }
.field label { font-weight: 600; }
.field .hint { font-size: var(--step--1); color: var(--text-2); margin: 0; }
.field input, .field select, .field textarea {
  font: inherit; color: var(--ink); background: #fff; border: 1.5px solid #7A859B;
  border-radius: var(--radius); padding: 0.7rem 0.85rem; width: 100%;
}
.field textarea { min-height: 10rem; resize: vertical; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { border-color: var(--navy); }
.field [aria-invalid="true"] { border-color: #A3361F; }
.error { color: #A3361F; font-size: var(--step--1); margin: 0; }
.form-note { font-size: var(--step--1); color: var(--text-2); }
.form-status { font-weight: 600; color: var(--navy); min-height: 1.5em; margin: 0; }
.contact-aside { border-left: 3px solid var(--brass); padding-left: 1.5rem; align-self: start; }
.contact-aside h2, .form h2 { font-size: var(--step-2); }
.contact-aside p { max-width: 36ch; }

/* Prose pages */
.prose h2 { font-size: var(--step-2); margin-top: 2.5rem; }
.prose ul { max-width: var(--measure); }
.prose li { margin-bottom: 0.4rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-deep); color: var(--on-navy-2); padding: 3.5rem 0 2rem; font-size: 0.975rem; }
.site-footer a { color: var(--on-navy); }
.footer-grid { display: grid; gap: 2rem 3rem; grid-template-columns: 1fr; }
@media (min-width: 52rem) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
.site-footer img { width: 12rem; margin-bottom: 1rem; }
.site-footer h2 { font-size: 1rem; font-stretch: 100%; font-weight: 600; color: var(--on-navy); letter-spacing: 0; margin-bottom: 0.75rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.4rem; }
.footer-base { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid rgba(244,245,247,0.15); display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; justify-content: space-between; }
.footer-base p { margin: 0; }

@media (max-width: 30rem) {
  .brand img { width: 9.5rem; }
  .nav { gap: 0.25rem 1.1rem; }
  .nav .btn { margin-left: 0; padding: 0.55rem 0.9rem; }
}

@media print {
  .site-header nav, .cta, .skip { display: none; }
  .hero { background: none; color: var(--ink); }
}
