/* ==========================================================================
   Buchi Inc — shared stylesheet
   Single source of truth for tokens, layout, and components across
   index.html, 404.html, About.html, Contact.html.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  color-scheme: dark;

  /* Type */
  --font-sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    system-ui, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas,
    "Liberation Mono", monospace;

  --step--1: clamp(0.8125rem, 0.79rem + 0.11vw, 0.875rem);
  --step-0: clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);
  --step-1: clamp(1.125rem, 1.06rem + 0.32vw, 1.3125rem);
  --step-2: clamp(1.375rem, 1.24rem + 0.66vw, 1.75rem);
  --step-3: clamp(1.75rem, 1.5rem + 1.2vw, 2.5rem);
  --step-4: clamp(2.25rem, 1.75rem + 2.4vw, 3.75rem);
  --display: clamp(3rem, 1.1rem + 11.2vw, 9.5rem);

  /* Space — 8pt grid */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;
  --sp-9: 96px;
  --sp-10: 128px;

  --gutter: clamp(20px, 4vw, 48px);
  --measure: 68ch;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 18px;

  --header-h: 64px;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 140ms;
  --dur: 220ms;
  --dur-slow: 420ms;

  /* Colour — dark, unconditionally. This site ships one theme. */
  --bg: #0a0a0b;
  --bg-alt: #111113;
  --surface: #151518;
  --ink: #f4f2ee;
  --ink-2: #a6a6ac;
  --ink-3: #83838a;
  --line: #26262b;
  --line-strong: #3a3a41;
  --accent: #ff7550;
  --accent-hover: #ff9375;
  --accent-ink: #14100e;
  --accent-wash: rgba(255, 117, 80, 0.1);
  --danger: #ff8a80;
  --ok: #5ddb8b;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.6), 0 12px 32px -16px rgba(0, 0, 0, 0.8);
  --focus: #f4f2ee;
  /* Accent tuned for use on the inverted band. */
  --accent-on-ink: #ff7550;
}

/* --------------------------------------------------------------------------
   2. Reset / base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  font-synthesis-weight: none;
}

h1,
h2,
h3,
h4,
p,
figure,
blockquote,
ul,
ol,
dl,
dd {
  margin: 0;
}

ul[class],
ol[class] {
  list-style: none;
  padding: 0;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

:where(a, button, input, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.skip-link {
  position: absolute;
  left: var(--sp-4);
  top: var(--sp-4);
  z-index: 100;
  transform: translateY(-200%);
  background: var(--ink);
  color: var(--bg);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: var(--step--1);
  font-weight: 600;
  text-decoration: none;
  transition: transform var(--dur) var(--ease-out);
}

.skip-link:focus-visible {
  transform: translateY(0);
  outline-color: var(--accent);
}

/* --------------------------------------------------------------------------
   3. Layout primitives
   -------------------------------------------------------------------------- */
.container {
  width: min(100% - (var(--gutter) * 2), 1240px);
  margin-inline: auto;
}

.section {
  padding-block: clamp(64px, 9vw, 128px);
  position: relative;
}

.section--alt {
  background: var(--bg-alt);
  border-block: 1px solid var(--line);
}

.section-head {
  display: grid;
  gap: var(--sp-4);
  margin-bottom: clamp(40px, 5vw, 72px);
  max-width: var(--measure);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--accent);
  flex: none;
}

.h2 {
  font-size: var(--step-4);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.h3 {
  font-size: var(--step-2);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.lede {
  font-size: var(--step-1);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 60ch;
  text-wrap: pretty;
}

.prose p + p {
  margin-top: var(--sp-5);
}

/* --------------------------------------------------------------------------
   4. Brand lockup (shared: header, hero, footer, 404)
   -------------------------------------------------------------------------- */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.36em;
  text-decoration: none;
  color: var(--ink);
  font-size: 20px; /* lockup scales from here */
  line-height: 1;
}

/* Square mark. Sized just over cap height: the ink sits low-left and the
   detached block rides above the cap line, which reads as intentional. */
.logo__mark {
  width: 1.02em;
  height: 1.02em;
  fill: currentColor;
  flex: none;
  transition: color var(--dur) var(--ease-out);
}

.logo__word {
  font-weight: 800;
  letter-spacing: -0.035em;
  font-size: 1em;
  white-space: nowrap;
}

.logo__word span {
  color: var(--ink-3);
  font-weight: 600;
  margin-left: 0.02em; /* a real space already sits before this (WCAG 2.5.3) */
  letter-spacing: -0.01em;
}

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

.logo--lg {
  font-size: clamp(44px, 8vw, 76px);
}

/* --------------------------------------------------------------------------
   5. Header
   -------------------------------------------------------------------------- */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur) var(--ease-out),
    background-color var(--dur) var(--ease-out);
}

.header[data-scrolled="true"] {
  border-bottom-color: var(--line);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
}

.header .logo {
  font-size: 21px;
  min-height: 44px;
}

@media (max-width: 400px) {
  .header .logo {
    font-size: 19px;
  }
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(4px, 2.2vw, 28px);
}

.nav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: var(--step--1);
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
  padding: 10px 8px;
  border-radius: var(--radius-sm);
  transition: color var(--dur-fast) var(--ease-out);
}

.nav__link::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 4px;
  height: 1.5px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur) var(--ease-out);
}

.nav__link:hover {
  color: var(--ink);
}

.nav__link[aria-current="true"] {
  color: var(--ink);
}

.nav__link[aria-current="true"]::after {
  transform: scaleX(1);
}

/* Scoped so it beats the later `.btn { display: inline-flex }` rule. */
.header .header__cta {
  display: none;
}

@media (min-width: 800px) {
  .header .header__cta {
    display: inline-flex;
  }
}

/* --------------------------------------------------------------------------
   6. Buttons
   -------------------------------------------------------------------------- */
.btn {
  --btn-bg: var(--ink);
  --btn-fg: var(--bg);
  --btn-border: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 48px;
  padding: 12px 22px;
  border: 1px solid var(--btn-border);
  border-radius: var(--radius);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: -0.005em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}

.btn:hover {
  --btn-bg: var(--accent);
  --btn-border: var(--accent);
  --btn-fg: var(--accent-ink);
}

.btn:active {
  transform: translateY(1px);
}

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--ink);
  --btn-border: var(--line-strong);
}

.btn--ghost:hover {
  --btn-bg: transparent;
  --btn-fg: var(--accent);
  --btn-border: var(--accent);
}

.btn--sm {
  min-height: 40px;
  padding: 8px 16px;
}

.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn__icon {
  width: 16px;
  height: 16px;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* --------------------------------------------------------------------------
   7. Hero
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  padding-top: clamp(56px, 9vw, 104px);
  padding-bottom: clamp(56px, 8vw, 104px);
  overflow: hidden;
}

.hero__grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(
      to right,
      color-mix(in srgb, var(--ink) 7%, transparent) 1px,
      transparent 1px
    );
  background-size: calc(100% / 6) 100%;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 92%);
  mask-image: linear-gradient(to bottom, #000 0%, transparent 92%);
  opacity: 0.9;
}

/* Filled, not outlined. Hairline strokes at this size read as stray UI rules
   cutting through the headline; a faint solid sits behind the type as mass.
   Kept fully on-canvas — the detached block is the whole idea, so bleeding it
   off the right edge destroys the read. */
.hero__watermark {
  position: absolute;
  right: 1.5%;
  top: 52%;
  translate: 0 -50%;
  width: min(38vw, 470px);
  height: auto;
  fill: color-mix(in srgb, var(--ink) 6%, transparent);
  stroke: none;
  pointer-events: none;
  display: none;
}

@media (min-width: 900px) {
  .hero__watermark {
    display: block;
  }
}

.hero__inner {
  position: relative;
}

.hero__title {
  font-size: var(--display);
  font-weight: 800;
  line-height: 0.88;
  letter-spacing: -0.05em;
  margin-block: clamp(20px, 3vw, 32px) clamp(24px, 3vw, 36px);
  max-width: 12ch;
}

.hero__title .dot {
  color: var(--accent);
}

.hero__lede {
  font-size: var(--step-1);
  color: var(--ink-2);
  max-width: 46ch;
  line-height: 1.5;
  text-wrap: pretty;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-top: clamp(28px, 4vw, 44px);
}

.hero__meta {
  margin-top: clamp(48px, 7vw, 88px);
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-5) var(--sp-8);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--line);
}

.hero__meta div {
  display: grid;
  gap: 2px;
}

.hero__meta dt {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.hero__meta dd {
  font-size: var(--step-1);
  font-weight: 650;
  letter-spacing: -0.02em;
}

/* --------------------------------------------------------------------------
   8. Statement band
   -------------------------------------------------------------------------- */
.band {
  background: var(--ink);
  color: var(--bg);
  padding-block: clamp(44px, 6vw, 76px);
}

.band p {
  font-size: var(--step-3);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.03em;
  max-width: 22ch;
  text-wrap: balance;
}

.band .mark {
  color: var(--accent-on-ink);
}

.band {
  background: var(--surface);
  color: var(--ink);
  border-block: 1px solid var(--line);
}

/* --------------------------------------------------------------------------
   9. Services
   -------------------------------------------------------------------------- */
.services {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

/* 3-up only when each column can still hold a comfortable measure. */
@media (min-width: 880px) {
  .services {
    grid-template-columns: repeat(3, 1fr);
  }
}

.service {
  background: var(--bg);
  padding: clamp(28px, 3.4vw, 44px);
  display: grid;
  align-content: start;
  gap: var(--sp-4);
  transition: background-color var(--dur) var(--ease-out);
}

.service:hover {
  background: var(--surface);
}

.service__num {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.1em;
  color: var(--accent);
}

.service p {
  color: var(--ink-2);
  text-wrap: pretty;
}

.feature {
  margin-top: var(--sp-5);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(28px, 3.4vw, 44px);
  background: var(--surface);
  display: grid;
  gap: var(--sp-4);
  align-items: start;
}

@media (min-width: 860px) {
  .feature {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    gap: var(--sp-7);
  }
}

.feature p {
  color: var(--ink-2);
  text-wrap: pretty;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-top: var(--sp-4);
}

.tag {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
  background: var(--bg);
}

/* --------------------------------------------------------------------------
   10. About
   -------------------------------------------------------------------------- */
.about {
  display: grid;
  gap: clamp(32px, 5vw, 72px);
}

@media (min-width: 900px) {
  .about {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
  }
}

.about__body p {
  font-size: var(--step-1);
  color: var(--ink-2);
  line-height: 1.6;
  text-wrap: pretty;
}

.facts {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.facts > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--sp-1);
  padding-block: var(--sp-5);
  border-bottom: 1px solid var(--line);
}

@media (min-width: 560px) {
  .facts > div {
    grid-template-columns: 150px minmax(0, 1fr);
    gap: var(--sp-5);
    align-items: baseline;
  }
}

.facts dt {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.facts dd {
  font-size: var(--step-1);
  font-weight: 600;
  letter-spacing: -0.015em;
}

/* --------------------------------------------------------------------------
   11. Contact (phone-led closing section)
   -------------------------------------------------------------------------- */
.contact {
  display: grid;
  gap: clamp(36px, 5vw, 72px);
  align-items: start;
}

@media (min-width: 900px) {
  .contact {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

.contact__pitch p {
  font-size: var(--step-1);
  color: var(--ink-2);
  line-height: 1.55;
  max-width: 42ch;
  text-wrap: pretty;
}

.call {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: clamp(24px, 3.2vw, 40px);
  display: grid;
  gap: var(--sp-4);
  box-shadow: var(--shadow);
}

.call__label {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.call__label::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}

.call__number {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  font-size: clamp(1.9rem, 1.1rem + 3.4vw, 3.1rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1;
  text-decoration: none;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  min-height: 48px;
  transition: color var(--dur-fast) var(--ease-out);
  overflow-wrap: anywhere;
}

.call__number:hover {
  color: var(--accent);
}

.call__number svg {
  width: 0.62em;
  height: 0.62em;
  flex: none;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  translate: -6px 0;
  transition: opacity var(--dur) var(--ease-out),
    translate var(--dur) var(--ease-out);
}

.call__number:hover svg,
.call__number:focus-visible svg {
  opacity: 1;
  translate: 0 0;
}

.call__hours {
  font-size: var(--step--1);
  color: var(--ink-3);
  border-top: 1px solid var(--line);
  padding-top: var(--sp-4);
  margin: 0;
}

.call__cta {
  justify-self: start;
}

@media (min-width: 600px) {
  .call__cta {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   12. Footer
   -------------------------------------------------------------------------- */
.footer {
  border-top: 1px solid var(--line);
  padding-block: clamp(48px, 6vw, 80px) var(--sp-7);
  background: var(--bg);
}

.footer__top {
  display: grid;
  gap: var(--sp-7);
  padding-bottom: var(--sp-7);
}

@media (min-width: 760px) {
  .footer__top {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
  }
}

.footer__tag {
  color: var(--ink-3);
  font-size: var(--step--1);
  margin-top: var(--sp-3);
  max-width: 48ch;
}

.footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-5);
}

.footer__nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: var(--step--1);
  color: var(--ink-2);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}

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

.footer__bottom {
  border-top: 1px solid var(--line);
  padding-top: var(--sp-3);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-3) var(--sp-5);
  justify-content: space-between;
  font-size: var(--step--1);
  color: var(--ink-3);
}

.footer__bottom a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
  font-variant-numeric: tabular-nums;
}

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

/* --------------------------------------------------------------------------
   13. Utility page (404 / redirect stubs)
   -------------------------------------------------------------------------- */
.util {
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.util__main {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: var(--sp-5);
  padding-block: var(--sp-9);
}

.util__code {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.14em;
  color: var(--accent);
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   14. Scroll reveal
   -------------------------------------------------------------------------- */
/* Gated on .js so content is never hidden when scripting is unavailable. */
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity var(--dur-slow) var(--ease-out),
      transform var(--dur-slow) var(--ease-out);
  }

  .js [data-reveal].is-visible {
    opacity: 1;
    transform: none;
  }
}
