/* ==========================================================
   Käser Ingenieure GmbH + Co. KG
   Design tokens
   ========================================================== */
:root {
  --paper: #ECE8DF;
  --paper-deep: #E2DCCF;
  --ink: #26231F;
  --muted: #6E695F;
  --line: #CDC6B8;
  --accent: #1F4D3A;
  --accent-dark: #17382A;
  --copper: #B8733A;

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: 7rem;

  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --max: 1280px;
  --header-h: 76px;
  --ease: cubic-bezier(.2, .6, .2, 1);
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }
p { margin: 0 0 1.1em; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; margin: 0; line-height: 1.08; letter-spacing: -0.01em; }
address { font-style: normal; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.skip-link {
  position: absolute; left: var(--space-2); top: -4rem; z-index: 100;
  background: var(--ink); color: var(--paper); padding: .6rem 1rem; text-decoration: none;
}
.skip-link:focus { top: var(--space-2); }

/* ---------- Buttons and links ---------- */
.btn {
  display: inline-block;
  background: var(--accent); color: var(--paper);
  padding: .95rem 1.7rem;
  font: 600 .95rem/1 var(--font-body);
  text-decoration: none; border: 1px solid var(--accent); border-radius: 2px;
  cursor: pointer;
  transition: background .25s var(--ease), color .25s var(--ease), transform .25s var(--ease);
}
.btn:hover { background: var(--accent-dark); transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-small { padding: .65rem 1.1rem; font-size: .88rem; }

.text-link {
  font-weight: 600; text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
  padding-bottom: 3px;
  transition: background-size .3s var(--ease), color .25s;
}
.text-link:hover { color: var(--accent); background-size: 100% 3px; }

/* ==========================================================
   Header
   ========================================================== */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--header-h);
  transition: height .3s var(--ease), background .3s, border-color .3s;
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  height: 62px;
  background: rgba(236, 232, 223, .96);
  border-bottom-color: var(--line);
}
.header-inner {
  max-width: var(--max); height: 100%; margin: 0 auto; padding: 0 var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
}
.logo { text-decoration: none; display: flex; flex-direction: column; line-height: 1.15; }
.logo-name { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; letter-spacing: -.01em; }
.logo-sub { font-size: .78rem; color: var(--muted); }

.main-nav { display: flex; align-items: center; gap: var(--space-4); }
.main-nav ul { display: flex; gap: var(--space-3); }
.main-nav ul a {
  text-decoration: none; font-size: .95rem; font-weight: 500; padding: .3rem 0;
  background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 2px no-repeat;
  transition: background-size .3s var(--ease);
}
.main-nav ul a:hover { background-size: 100% 2px; }

.nav-toggle {
  display: none; width: 44px; height: 44px; background: none; border: 0; cursor: pointer; position: relative;
}
.nav-toggle span {
  position: absolute; left: 10px; right: 10px; height: 2px; background: var(--ink);
  transition: transform .3s var(--ease), top .3s var(--ease);
}
.nav-toggle span:first-child { top: 17px; }
.nav-toggle span:last-child { top: 25px; }
.nav-toggle[aria-expanded="true"] span:first-child { top: 21px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { top: 21px; transform: rotate(-45deg); }

/* ==========================================================
   Hero
   ========================================================== */
.hero {
  max-width: var(--max); margin: 0 auto;
  padding: calc(var(--header-h) + var(--space-5)) var(--gutter) var(--space-6);
  display: grid; grid-template-columns: 7fr 5fr; gap: var(--space-5); align-items: center;
}
.tag {
  display: inline-block; margin-bottom: var(--space-3);
  padding: .35rem .8rem; border: 1px solid var(--ink); font-size: .85rem; font-weight: 500;
}
.hero h1 { font-size: clamp(2.6rem, 6.4vw, 5.6rem); font-weight: 600; max-width: 14ch; margin-bottom: var(--space-3); }
.lead { font-size: 1.2rem; max-width: 52ch; color: var(--muted); margin-bottom: var(--space-4); }
.hero-actions { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }

.hero-art { position: relative; aspect-ratio: 4 / 5; }
.art-block { position: absolute; }
.art-green { inset: 0 12% 18% 0; background: var(--accent); }
.art-paper {
  inset: 22% 0 0 24%; background: var(--paper-deep); border: 1px solid var(--ink);
  color: var(--ink); display: grid; place-items: center; padding: 8%;
}
.art-paper svg { width: 100%; height: auto; }
.art-paper .trace-accent { stroke: var(--copper); stroke-width: 2.5; }
.art-ring {
  width: 34%; aspect-ratio: 1; border-radius: 50%; border: 1px solid var(--paper);
  left: 6%; top: 8%;
}
.art-caption {
  position: absolute; left: 0; bottom: 0; margin: 0; max-width: 40%;
  font-size: .85rem; color: var(--muted); line-height: 1.4;
}

/* ==========================================================
   About
   ========================================================== */
.about {
  max-width: var(--max); margin: 0 auto; padding: var(--space-5) var(--gutter) var(--space-6);
  border-top: 1px solid var(--line);
}
.section-head h2, .services-intro h2, .contact-info h2, .approach h2 {
  font-size: clamp(2rem, 4.4vw, 3.6rem); font-weight: 600;
}
.about .section-head { max-width: 18ch; margin-bottom: var(--space-5); }

.about-grid {
  display: grid; gap: var(--space-4) var(--space-5);
  grid-template-columns: 5fr 4fr; grid-template-areas: "copy visual" "facts visual";
  align-items: start;
}
.about-copy { grid-area: copy; max-width: 58ch; }
.about-copy p:first-child { font-size: 1.25rem; }
.about-visual { grid-area: visual; margin: 0; margin-top: calc(var(--space-5) * -1.2); }
.about-visual svg { width: 100%; height: auto; }
.about-visual figcaption { font-size: .8rem; color: var(--muted); padding-top: .6rem; }
.about-facts { grid-area: facts; }
.about-facts blockquote {
  margin: 0 0 var(--space-3); padding-left: var(--space-3); border-left: 3px solid var(--copper);
  font-family: var(--font-display); font-size: 1.6rem; line-height: 1.25;
}
.about-facts dl { margin: 0; border-top: 1px solid var(--line); }
.about-facts dl div { display: grid; grid-template-columns: 8rem 1fr; gap: var(--space-2); padding: .8rem 0; border-bottom: 1px solid var(--line); }
.about-facts dt { color: var(--muted); font-size: .92rem; }
.about-facts dd { margin: 0; font-weight: 500; }

/* ==========================================================
   Services
   ========================================================== */
.services {
  max-width: var(--max); margin: 0 auto; padding: var(--space-5) var(--gutter) var(--space-6);
  border-top: 1px solid var(--line);
  display: grid; grid-template-columns: 4fr 8fr; gap: var(--space-5); align-items: start;
}
.services-intro { position: sticky; top: calc(var(--header-h) + var(--space-3)); }
.services-intro h2 { margin-bottom: var(--space-3); }
.services-intro p { color: var(--muted); max-width: 40ch; }

.service-list { border-top: 1px solid var(--ink); }
.service {
  display: grid; grid-template-columns: 2.5rem 3rem 1fr; gap: var(--space-3); align-items: start;
  padding: var(--space-3) var(--space-2); border-bottom: 1px solid var(--line);
  transition: background .3s var(--ease), padding-left .3s var(--ease);
}
.service:hover { background: var(--paper-deep); padding-left: var(--space-3); }
.service-no { font-family: var(--font-display); color: var(--muted); font-size: 1.1rem; padding-top: .35rem; }
.icon { width: 40px; height: 40px; fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; margin-top: .2rem; }
.service h3 { font-size: 1.55rem; font-weight: 600; margin-bottom: .4rem; }
.service p { margin: 0; color: var(--muted); max-width: 56ch; }
/* One featured entry gets more room, so the list is not uniform */
.service:first-child { padding-top: var(--space-4); padding-bottom: var(--space-4); }
.service:first-child h3 { font-size: 2.1rem; }

/* ==========================================================
   Approach (contrast section)
   ========================================================== */
.approach { background: var(--accent-dark); color: var(--paper); }
.approach-inner { max-width: var(--max); margin: 0 auto; padding: var(--space-6) var(--gutter); }
.approach h2 { max-width: 20ch; margin-bottom: var(--space-5); }
.benefits { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid rgba(236, 232, 223, .35); }
.benefit { padding: var(--space-3) var(--space-3) 0 0; }
.benefit + .benefit { padding-left: var(--space-3); border-left: 1px solid rgba(236, 232, 223, .2); }
.benefit:nth-child(even) { margin-top: var(--space-4); }
.big-no { display: block; font-family: var(--font-display); font-size: clamp(3.4rem, 6vw, 5.5rem); line-height: 1; color: var(--copper); margin-bottom: var(--space-2); }
.benefit h3 { font-size: 1.45rem; font-weight: 600; margin-bottom: .6rem; }
.benefit p { color: rgba(236, 232, 223, .8); font-size: 1rem; margin: 0; }

/* ==========================================================
   Contact
   ========================================================== */
.contact {
  max-width: var(--max); margin: 0 auto; padding: var(--space-6) var(--gutter);
  display: grid; grid-template-columns: 5fr 6fr; gap: var(--space-5); align-items: start;
}
.contact-info h2 { margin-bottom: var(--space-3); }
.contact-info > p { color: var(--muted); max-width: 40ch; margin-bottom: var(--space-4); }
.contact address { border-top: 1px solid var(--ink); padding-top: var(--space-3); }
.addr-label { font-weight: 600; margin-bottom: .4rem; }
.addr-mail a { font-weight: 600; color: var(--accent); text-underline-offset: 4px; }
.addr-mail a:hover { text-decoration-thickness: 2px; }

.contact-form { background: var(--paper-deep); border: 1px solid var(--line); padding: var(--space-4); }
.field { margin-bottom: var(--space-3); }
.field label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: .4rem; }
.optional { font-weight: 400; color: var(--muted); }
.field input, .field textarea {
  width: 100%; font: inherit; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line); border-radius: 2px;
  padding: .8rem .9rem; transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 8rem; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(31, 77, 58, .18); }
.field.invalid input, .field.invalid textarea { border-color: #9B2C2C; }
.error { display: block; min-height: 1.2em; margin-top: .3rem; font-size: .85rem; color: #9B2C2C; }
.form-status { margin: var(--space-3) 0 0; font-weight: 500; }
.form-status.ok { color: var(--accent); }
.form-status.fail { color: #9B2C2C; }

/* ==========================================================
   Footer
   ========================================================== */
.site-footer { border-top: 1px solid var(--ink); background: var(--paper); }
.footer-grid, .footer-bottom { max-width: var(--max); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.footer-grid { display: grid; grid-template-columns: 5fr 3fr 4fr; gap: var(--space-4); padding-top: var(--space-5); padding-bottom: var(--space-5); }
.footer-name { font-family: var(--font-display); font-size: 1.4rem; font-weight: 600; margin-bottom: .5rem; }
.footer-about p:last-child { color: var(--muted); max-width: 42ch; }
.footer-title { font-weight: 600; margin-bottom: .6rem; }
.site-footer li { margin-bottom: .3rem; }
.site-footer a { text-underline-offset: 3px; text-decoration-color: var(--line); transition: color .2s, text-decoration-color .2s; }
.site-footer a:hover { color: var(--accent); text-decoration-color: var(--accent); }
.footer-bottom {
  display: flex; justify-content: space-between; gap: var(--space-2); flex-wrap: wrap;
  padding-top: var(--space-3); padding-bottom: var(--space-3);
  border-top: 1px solid var(--line); font-size: .88rem; color: var(--muted);
}
.footer-bottom p { margin: 0; }
.footer-bottom ul { display: flex; gap: var(--space-3); }
.footer-bottom li { margin: 0; }

/* ==========================================================
   Reveal on scroll (only when JS is available)
   ========================================================== */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.js .reveal.visible { opacity: 1; transform: none; }

/* ==========================================================
   Responsive
   ========================================================== */
@media (max-width: 1024px) {
  .hero { grid-template-columns: 1fr; padding-bottom: var(--space-5); }
  .hero-art { max-width: 520px; width: 100%; aspect-ratio: 5 / 4; margin-left: auto; }
  .about-grid { grid-template-columns: 1fr; grid-template-areas: "copy" "visual" "facts"; }
  .about-visual { margin-top: 0; max-width: 420px; }
  .services { grid-template-columns: 1fr; }
  .services-intro { position: static; }
  .benefits { grid-template-columns: repeat(2, 1fr); }
  .benefit { padding-bottom: var(--space-3); }
  .benefit:nth-child(odd) { padding-left: 0; border-left: 0; }
  .benefit:nth-child(even) { margin-top: 0; }
  .benefit:nth-child(n+3) { border-top: 1px solid rgba(236, 232, 223, .2); }
  .contact { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-about { grid-column: 1 / -1; }
}

@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .main-nav {
    position: fixed; inset: 0 0 auto 0; top: 0;
    padding: calc(var(--header-h) + var(--space-2)) var(--gutter) var(--space-4);
    background: var(--paper); border-bottom: 1px solid var(--ink);
    flex-direction: column; align-items: flex-start; gap: var(--space-3);
    transform: translateY(-110%); visibility: hidden;
    transition: transform .35s var(--ease), visibility .35s;
    z-index: -1;
  }
  .main-nav.open { transform: none; visibility: visible; }
  .main-nav ul { flex-direction: column; gap: var(--space-2); width: 100%; }
  .main-nav ul a { font-family: var(--font-display); font-size: 1.8rem; }
  .site-header { background: var(--paper); }
}

@media (max-width: 560px) {
  .service { grid-template-columns: 2rem 1fr; }
  .service .icon { display: none; }
  .service:first-child h3 { font-size: 1.7rem; }
  .benefits { grid-template-columns: 1fr; }
  .benefit + .benefit { padding-left: 0; border-left: 0; border-top: 1px solid rgba(236, 232, 223, .2); }
  .about-facts dl div { grid-template-columns: 1fr; gap: 0; }
  .contact-form { padding: var(--space-3); }
  .footer-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}
