/* =========================================================
   Haag & Höfer — Design System
   Signature: "Blueprint → Built" — technical drawing lines
   that resolve into solid, finished interface blocks.
   ========================================================= */

:root {
  /* Color — light & minimal, single blue accent (also used by the
     blueprint illustration: real technical drawings are blue-on-paper) */
  --ink: #f7f5ef;          /* page background — warm paper */
  --panel: #ffffff;        /* card / surface */
  --panel-raised: #f0ede3; /* nav bg, frame bar, slightly deeper than page */
  --line: #e0ddd2;         /* hairline rules, grid */
  --line-soft: #ece9de;
  --paper: #1c2430;        /* primary text — deep ink blue */
  --mist: #5b6472;         /* muted text */
  --mist-dim: #78808f;
  --signal: #2451c4;       /* single accent — blue */
  --signal-dim: #17337d;
  --blueprint: var(--signal);
  --blueprint-dim: var(--signal-dim);

  /* Type */
  --f-display: "Space Grotesk", "Arial Narrow", sans-serif;
  --f-body: "IBM Plex Sans", "Segoe UI", sans-serif;
  --f-mono: "IBM Plex Mono", "Courier New", monospace;

  /* Scale */
  --step--1: clamp(0.78rem, 0.75rem + 0.15vw, 0.86rem);
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.08rem);
  --step-1: clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem);
  --step-2: clamp(1.7rem, 1.5rem + 1vw, 2.2rem);
  --step-3: clamp(2.3rem, 1.9rem + 2vw, 3.4rem);
  --step-4: clamp(3rem, 2.3rem + 3.5vw, 5rem);

  --rail: 96px;           /* left coordinate rail width, desktop */
  --maxw: 1180px;
  --radius: 4px;
}

*, *::before, *::after { box-sizing: border-box; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--f-body);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--f-display);
  font-weight: 600;
  line-height: 1.05;
  margin: 0;
  letter-spacing: -0.01em;
}

p { margin: 0 0 1em; color: var(--mist); max-width: 60ch; }
a { color: inherit; }

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

.mono {
  font-family: var(--f-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: var(--step--1);
}

.eyebrow {
  font-family: var(--f-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: var(--step--1);
  color: var(--signal);
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  margin-bottom: 1rem;
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--signal);
  display: inline-block;
}

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

.shell {
  display: grid;
  grid-template-columns: var(--rail) 1fr;
  min-height: 100vh;
}

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 0;
}

.rail-ticks {
  flex: 1;
  width: 100%;
  background-image: repeating-linear-gradient(
    to bottom,
    var(--line) 0,
    var(--line) 1px,
    transparent 1px,
    transparent 32px
  );
  position: relative;
}

.rail-mark {
  writing-mode: vertical-rl;
  font-family: var(--f-mono);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: var(--mist-dim);
  text-transform: uppercase;
}

.main { min-width: 0; }

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 3rem);
}

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .rail { display: none; }
}

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

header.site {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(247, 245, 239, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem clamp(1.25rem, 4vw, 3rem);
}

.brand {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 1.15rem;
  text-decoration: none;
  color: var(--paper);
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}
.brand .brand-mark { color: var(--signal); }

.nav-links {
  display: flex;
  gap: clamp(1.2rem, 2.5vw, 2.4rem);
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--f-mono);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nav-links a {
  text-decoration: none;
  color: var(--mist);
  position: relative;
  padding-bottom: 4px;
  transition: color 0.2s ease;
}
.nav-links a:hover { color: var(--paper); }
.nav-links a.active { color: var(--paper); }
.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--signal);
}

.nav-cta {
  font-family: var(--f-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  background: var(--paper);
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius);
  transition: background 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
}
.nav-cta:hover { background: var(--signal); transform: translateY(-1px); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  color: var(--paper);
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: var(--f-mono);
}

@media (max-width: 760px) {
  .nav-links { position: fixed; inset: 62px 0 0 0; background: var(--ink); flex-direction: column; padding: 2rem 1.5rem; gap: 1.5rem; font-size: 1rem; transform: translateY(-8px); opacity: 0; pointer-events: none; transition: all 0.25s ease; }
  .nav-links.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .nav-cta { display: none; }
  .nav-toggle { display: block; }
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--f-mono);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.btn-primary { background: var(--signal); color: #ffffff; }
.btn-primary:hover { transform: translateY(-2px); background: var(--signal-dim); }
.btn-ghost { border-color: var(--line); color: var(--paper); background: transparent; }
.btn-ghost:hover { border-color: var(--mist); transform: translateY(-2px); }

/* ---------- Hero ---------- */

.hero {
  padding: clamp(3rem, 8vw, 6.5rem) 0 clamp(2.5rem, 6vw, 4rem);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
}

.hero h1 { font-size: var(--step-4); }
.hero h1 .accent { color: var(--signal); }
.hero .lede { font-size: var(--step-1); color: var(--mist); max-width: 46ch; margin-top: 1.1rem; }
.hero .actions { display: flex; gap: 1rem; margin-top: 2.2rem; flex-wrap: wrap; }

.hero-stats {
  display: flex;
  gap: clamp(1.5rem, 4vw, 3rem);
  margin-top: 3rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--line);
}
.hero-stats .stat b {
  font-family: var(--f-display);
  font-size: var(--step-2);
  display: block;
  color: var(--paper);
}
.hero-stats .stat span {
  font-family: var(--f-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mist-dim);
}

/* ---- Blueprint drawing (signature element) ---- */

.blueprint {
  position: relative;
  aspect-ratio: 4 / 3.2;
  border: 1px solid var(--line);
  border-radius: 6px;
  background:
    linear-gradient(var(--line-soft) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px) 0 0 / 24px 24px,
    var(--panel);
  overflow: hidden;
}
.blueprint svg { position: absolute; inset: 0; width: 100%; height: 100%; }

.bp-line {
  fill: none;
  stroke: var(--blueprint);
  stroke-width: 1.4;
  stroke-dasharray: 1600;
  stroke-dashoffset: 1600;
  animation: draw 2.6s ease forwards;
}
.bp-fill {
  opacity: 0;
  transform-origin: center;
  animation: solidify 0.8s ease forwards;
  animation-delay: 2.3s;
}
.bp-tag {
  font-family: var(--f-mono);
  font-size: 9px;
  fill: var(--mist-dim);
  opacity: 0;
  animation: fadein 0.6s ease forwards;
  animation-delay: 2.6s;
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes solidify { to { opacity: 1; } }
@keyframes fadein { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .bp-line { stroke-dashoffset: 0; animation: none; }
  .bp-fill, .bp-tag { opacity: 1; animation: none; }
}

.blueprint-caption {
  position: absolute;
  left: 12px; bottom: 10px;
  font-family: var(--f-mono);
  font-size: 0.68rem;
  color: var(--mist-dim);
  letter-spacing: 0.08em;
}

/* ---------- Sections ---------- */

section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.section-border-top { border-top: 1px solid var(--line); }

.section-head {
  max-width: 60ch;
  margin-bottom: clamp(2rem, 5vw, 3rem);
}
.section-head h2 { font-size: var(--step-3); }
.section-head p { font-size: var(--step-0); margin-top: 0.9rem; }

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

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}
@media (max-width: 860px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.8rem;
  position: relative;
  overflow: hidden;
  transition: border-color 0.25s ease, transform 0.25s ease;
}
.card:hover { border-color: var(--mist-dim); transform: translateY(-3px); }
.card::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 16px 16px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.card:hover::before { opacity: 0.5; }

.mini-bp {
  width: 40px;
  height: 32px;
  margin-bottom: 1.1rem;
}
.mini-bp-svg { width: 100%; height: 100%; overflow: visible; }
.mini-bp-svg .ln {
  fill: none;
  stroke: var(--signal);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 140;
  stroke-dashoffset: 140;
  transition: stroke-dashoffset 1.1s cubic-bezier(.4,0,.2,1);
}
html.js .reveal.is-visible .mini-bp-svg .ln { stroke-dashoffset: 0; }
html.js .reveal:not(.is-visible) .mini-bp-svg .ln { stroke-dashoffset: 140; }
@media (prefers-reduced-motion: reduce) {
  .mini-bp-svg .ln { stroke-dashoffset: 0 !important; transition: none; }
}

.card .tag {
  font-family: var(--f-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mist);
  margin-bottom: 0.9rem;
  display: block;
}
.card h3 { font-size: var(--step-1); margin-bottom: 0.6rem; }
.card p { margin-bottom: 0; font-size: 0.94rem; }

/* ---------- Process steps ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.step {
  padding: 2rem 1.8rem;
  border-right: 1px solid var(--line);
  position: relative;
}
.step:last-child { border-right: none; }
.step .num {
  font-family: var(--f-mono);
  color: var(--signal);
  font-size: 0.8rem;
  display: block;
  margin-bottom: 1rem;
}
.step h3 { font-size: 1.15rem; margin-bottom: 0.5rem; }
.step p { font-size: 0.92rem; margin: 0; }
@media (max-width: 760px) {
  .steps { grid-template-columns: 1fr; }
  .step { border-right: none; border-bottom: 1px solid var(--line); }
  .step:last-child { border-bottom: none; }
}

/* ---------- CTA band ---------- */

.cta-band {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel), var(--ink));
  text-align: left;
}
.cta-band .container { display: flex; align-items: center; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.cta-band h2 { font-size: var(--step-2); max-width: 20ch; }

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

footer.site {
  border-top: 1px solid var(--line);
  padding: 3rem 0 2rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
  padding-bottom: 2rem;
}
@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr; }
}
.footer-grid h4 {
  font-family: var(--f-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mist-dim);
  margin-bottom: 1rem;
}
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 0.55rem; }
.footer-grid a { text-decoration: none; color: var(--mist); font-size: 0.92rem; }
.footer-grid a:hover { color: var(--paper); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-family: var(--f-mono);
  font-size: 0.72rem;
  color: var(--mist-dim);
  flex-wrap: wrap;
  gap: 0.8rem;
}

/* ---------- Reveal on scroll ---------- */

/* Progressive enhancement: content is fully visible without JS.
   Only once html.js is set (see inline script in <head>) do sections
   start hidden and reveal on scroll. */
.reveal { opacity: 1; transform: none; }
html.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
html.js .reveal.is-visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  html.js .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Page hero (inner pages) ---------- */

.page-hero {
  padding: clamp(2.5rem, 6vw, 4rem) 0 2.5rem;
  border-bottom: 1px solid var(--line);
}
.page-hero h1 { font-size: var(--step-3); }
.page-hero p.lede { color: var(--mist); font-size: var(--step-1); max-width: 55ch; margin-top: 1rem; }

/* ---------- Forms ---------- */

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 0.5rem; grid-column: span 1; }
.field.full { grid-column: 1 / -1; }
.field label {
  font-family: var(--f-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mist);
}
.field input, .field select, .field textarea {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  color: var(--paper);
  font-family: var(--f-body);
  font-size: 0.95rem;
  resize: vertical;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--signal);
  outline-offset: 1px;
  border-color: var(--signal-dim);
}
.form-note { font-size: 0.82rem; color: var(--mist-dim); margin-top: 1rem; }

/* ---------- Contact info list ---------- */

.info-list { list-style: none; margin: 0; padding: 0; }
.info-list li {
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}
.info-list .k {
  font-family: var(--f-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--mist-dim);
  width: 90px;
  flex-shrink: 0;
  padding-top: 0.15rem;
}
.info-list a { color: var(--paper); text-decoration: none; }
.info-list a:hover { color: var(--signal); }

/* ---------- Reference / browser-frame mockup ---------- */

.frame {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel);
}
.frame-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--line);
  background: var(--panel-raised);
}
.frame-bar .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.frame-bar .url {
  font-family: var(--f-mono);
  font-size: 0.7rem;
  color: var(--mist-dim);
  margin-left: 0.6rem;
}
.frame-body { padding: 2.2rem clamp(1.4rem, 4vw, 3rem); }

/* ---------- Legal pages ---------- */

.legal h2 { font-size: var(--step-1); margin-top: 2.4rem; margin-bottom: 0.8rem; }
.legal h2:first-child { margin-top: 0; }
.legal p, .legal li { color: var(--mist); font-size: 0.95rem; }
.legal .placeholder {
  background: rgba(36, 81, 196, 0.08);
  border: 1px dashed var(--signal-dim);
  color: var(--signal);
  padding: 0.05em 0.4em;
  border-radius: 3px;
  font-family: var(--f-mono);
  font-size: 0.85em;
}
.legal-note {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 1rem 1.3rem;
  border-radius: var(--radius);
  font-size: 0.88rem;
  margin-bottom: 2.5rem;
}
.legal-note strong { color: var(--paper); }

/* ---------- Team ---------- */

.team-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}
@media (max-width: 760px) { .team-grid { grid-template-columns: 1fr; } }
.team-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
  transition: border-color 0.25s ease;
}
.team-card:hover { border-color: var(--mist-dim); }

.team-photo-wrap {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--panel-raised);
  border-bottom: 1px solid var(--line);
}
.team-photo {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: top center;
  filter: grayscale(85%) contrast(1.02);
  transform: scale(1.01);
  transition: filter 0.5s ease, transform 0.6s ease;
}
.team-card:hover .team-photo { filter: grayscale(0%); transform: scale(1.04); }

.team-card-body { padding: 1.8rem; }
.team-card h3 { font-size: var(--step-1); margin-bottom: 0.2rem; }
.team-role { font-family: var(--f-mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--signal); margin-bottom: 1rem; display: block; }

.timeline {
  list-style: none;
  margin: 1.2rem 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.timeline li {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}
.timeline .when {
  font-family: var(--f-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--mist-dim);
  padding-top: 0.15rem;
}
.timeline .what b { color: var(--paper); font-weight: 500; display: block; font-size: 0.92rem; }
.timeline .what span { font-size: 0.84rem; color: var(--mist); }

.duo-photos {
  display: flex;
  gap: 0.85rem;
  max-width: 440px;
}
.duo-photos .duo-item {
  flex: 1;
  aspect-ratio: 3 / 4;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: var(--panel-raised);
}
.duo-photos img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }

/* ---------- utility ---------- */
.mt-0 { margin-top: 0; }
.center { text-align: center; }
.small { font-size: 0.85rem; }
