/* Stackwerk — alpine workshop + brand navy/red */

:root {
  --navy: #0b1f3a;
  --navy-deep: #061427;
  --navy-soft: #143056;
  --red: #e11d2e;
  --red-deep: #b81422;
  --ink: #121a24;
  --muted: #5a6675;
  --line: #d8dee6;
  --paper: #f3f5f8;
  --white: #ffffff;
  --teal: #0f8f86;
  --teal-deep: #0a5c56;
  --teal-soft: #e6f6f4;
  --shadow: 0 24px 60px rgba(6, 20, 39, 0.18);
  --radius: 2px;
  --font-display: "Syne", "Segoe UI", sans-serif;
  --font-body: "Manrope", "Segoe UI", sans-serif;
  --header-h: 4.25rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(225, 29, 46, 0.06), transparent 55%),
    radial-gradient(900px 500px at 0% 20%, rgba(11, 31, 58, 0.06), transparent 50%),
    linear-gradient(180deg, #eef1f5 0%, var(--paper) 40%, #e9edf2 100%);
  min-height: 100vh;
}

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

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

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

h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--navy);
  margin: 0 0 0.75rem;
}

h1 { font-size: clamp(2.4rem, 5vw, 3.75rem); font-weight: 800; }
h2 { font-size: clamp(1.75rem, 3vw, 2.35rem); font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 700; }

p { margin: 0 0 1rem; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  background: var(--navy);
  color: var(--white);
  padding: 0.6rem 1rem;
  z-index: 100;
}

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

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: rgba(243, 245, 248, 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
  background: rgba(255, 255, 255, 0.92);
}

.site-header__inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.25rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: inherit;
}

.brand:hover { color: inherit; }

.brand__mark {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.brand__text {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  line-height: 1;
}

.brand__stack { color: var(--navy); }
.brand__werk { color: var(--red); }

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.35rem;
}

.site-nav__link {
  text-decoration: none;
  color: var(--navy-soft);
  font-weight: 600;
  font-size: 0.95rem;
}

.site-nav__link:hover,
.site-nav__link.is-active {
  color: var(--navy);
}

.site-nav__cta {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 1rem;
  background: var(--navy);
  color: var(--white);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: var(--radius);
  transition: background 0.25s var(--ease), transform 0.25s var(--ease);
}

.site-nav__cta:hover {
  background: var(--red);
  color: var(--white);
  transform: translateY(-1px);
}

.nav-toggle {
  display: none;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.nav-toggle__bar {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--navy);
  transition: transform 0.25s var(--ease), opacity 0.25s;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:first-child {
  transform: translateY(4px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:last-of-type {
  transform: translateY(-4px) rotate(-45deg);
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.35rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease);
}

.btn:hover { transform: translateY(-2px); }

.btn--primary {
  background: var(--red);
  color: var(--white);
}

.btn--primary:hover {
  background: var(--red-deep);
  color: var(--white);
}

.btn--ghost {
  background: transparent;
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.45);
}

.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
}

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

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

.btn--teal {
  background: var(--teal);
  color: var(--white);
}

.btn--teal:hover {
  background: var(--teal-deep);
  color: var(--white);
}

.text-link {
  font-weight: 700;
  text-decoration: none;
  color: var(--red);
  border-bottom: 1px solid currentColor;
}

.text-link:hover { color: var(--red-deep); }

/* Hero — full-bleed first viewport */

.hero {
  position: relative;
  min-height: calc(100vh - var(--header-h));
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--white);
  background: var(--navy-deep);
}

.hero__backdrop {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, var(--navy-deep) 0%, var(--navy) 48%, #12325a 100%);
}

.hero__backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 40%, rgba(6, 20, 39, 0.55) 100%),
    radial-gradient(ellipse 80% 50% at 70% 30%, rgba(225, 29, 46, 0.18), transparent 60%);
}

.hero__grain {
  position: absolute;
  inset: 0;
  opacity: 0.18;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
  pointer-events: none;
}

.hero__stack-visual {
  position: absolute;
  right: -4%;
  top: 18%;
  width: min(42vw, 420px);
  height: min(52vw, 480px);
  display: grid;
  gap: 1.1rem;
  transform: rotate(-18deg) skewY(4deg);
  opacity: 0.55;
}

.hero__layer {
  display: block;
  height: 18%;
  border-radius: 4px;
  box-shadow: var(--shadow);
  transform: translateX(40px);
  opacity: 0;
  animation: stackIn 1s var(--ease) forwards;
}

.hero__layer--navy { background: linear-gradient(90deg, #1a3d6d, #0b1f3a); }
.hero__layer--red { background: linear-gradient(90deg, #ff4a58, var(--red)); }
.hero__layer:nth-child(1) { animation-delay: 0.15s; width: 78%; }
.hero__layer:nth-child(2) { animation-delay: 0.3s; width: 92%; margin-left: 8%; }
.hero__layer:nth-child(3) { animation-delay: 0.45s; width: 70%; margin-left: 4%; }
.hero__layer:nth-child(4) { animation-delay: 0.6s; width: 86%; margin-left: 12%; }

@keyframes stackIn {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 4rem 1.25rem 5rem;
  text-align: center;
}

.hero__logo-wrap {
  display: inline-flex;
  margin: 0 auto 1.75rem;
  padding: 1.1rem 1.25rem 0.85rem;
  background: var(--white);
  border-radius: 6px;
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: translateY(18px) scale(0.98);
  animation: heroRise 0.9s var(--ease) 0.1s forwards;
}

.hero__logo {
  width: min(220px, 52vw);
  margin: 0 auto;
}

.hero__claim {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.55rem, 3.2vw, 2.15rem);
  letter-spacing: -0.02em;
  margin: 0 0 0.85rem;
  color: var(--white);
}

.hero__lead {
  color: rgba(255, 255, 255, 0.82);
  max-width: 34rem;
  margin: 0 auto 1.75rem;
  font-size: 1.08rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  justify-content: center;
}

.hero [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  animation: heroRise 0.85s var(--ease) forwards;
}

.hero .hero__claim { animation-delay: 0.35s; }
.hero .hero__lead { animation-delay: 0.5s; }
.hero .hero__actions { animation-delay: 0.65s; }

@keyframes heroRise {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Sections */

.section {
  padding: 5.5rem 0;
}

.section__inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.section__inner--narrow { max-width: 720px; }

.section__inner--split {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3rem;
  align-items: center;
}

.section__lead {
  color: var(--muted);
  font-size: 1.125rem;
  max-width: 40rem;
  margin-bottom: 2rem;
}

.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red);
  margin: 0 0 0.75rem;
}

.eyebrow--teal { color: var(--teal-deep); }

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

.service-rows {
  display: grid;
  gap: 0;
}

.service-row {
  padding: 1.75rem 0;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(12rem, 0.4fr) 1fr;
  gap: 1.5rem;
  align-items: baseline;
}

.service-row:last-child { border-bottom: 1px solid var(--line); }

.service-row h3 { margin: 0; }
.service-row p { margin: 0; color: var(--muted); }

.section__cta { margin-top: 2rem; }

.section--flowbix {
  background:
    linear-gradient(180deg, var(--teal-soft), #f7fbfa);
}

.flowbix-visual {
  position: relative;
  display: grid;
  place-items: center;
}

.flowbix-visual img,
.flowbix-hero-mark img {
  position: relative;
  z-index: 1;
  width: min(320px, 100%);
}

.flow-nodes {
  position: absolute;
  inset: 10% 12%;
  pointer-events: none;
}

.flow-nodes span {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--teal);
  opacity: 0.55;
  animation: floatNode 4s ease-in-out infinite;
}

.flow-nodes span:nth-child(1) { top: 8%; left: 18%; animation-delay: 0s; }
.flow-nodes span:nth-child(2) { top: 22%; right: 12%; animation-delay: 0.7s; background: var(--teal-deep); }
.flow-nodes span:nth-child(3) { bottom: 18%; left: 10%; animation-delay: 1.2s; }
.flow-nodes span:nth-child(4) { bottom: 8%; right: 22%; animation-delay: 1.8s; background: #2bb5ab; }

.flow-nodes--large { inset: 5% 8%; }
.flow-nodes--large span { width: 12px; height: 12px; }

@keyframes floatNode {
  0%, 100% { transform: translateY(0); opacity: 0.45; }
  50% { transform: translateY(-10px); opacity: 0.9; }
}

.section--place {
  background: var(--navy);
  color: rgba(255, 255, 255, 0.86);
}

.section--place h2,
.section--place .eyebrow { color: var(--white); }
.section--place .section__lead { color: rgba(255, 255, 255, 0.72); }
.section--place .eyebrow { color: #ff8a93; }

.section--cta-band {
  background: var(--navy);
  color: var(--white);
  text-align: center;
}

.section--cta-band h2 { color: var(--white); }
.section--cta-band .section__lead {
  margin-left: auto;
  margin-right: auto;
  color: rgba(255, 255, 255, 0.75);
}

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

/* Inner pages */

.page-hero {
  padding: 4rem 0 2.5rem;
}

.page-hero__inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.page-hero__inner--split {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2rem;
  align-items: center;
}

.page-hero__lead {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 38rem;
}

.page-hero--flowbix {
  background: linear-gradient(180deg, var(--teal-soft), transparent);
  padding-bottom: 1rem;
}

.flowbix-hero-mark {
  position: relative;
  display: grid;
  place-items: center;
}

.stack-blocks {
  display: grid;
  gap: 2.5rem;
}

.stack-block {
  padding-top: 2rem;
  border-top: 2px solid var(--navy);
}

.stack-block__index {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--red);
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
}

.plain-list {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.4rem;
}

.plain-list li {
  padding-left: 1rem;
  position: relative;
  color: var(--muted);
}

.plain-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 0.45rem;
  height: 0.45rem;
  background: var(--red);
}

.benefit-rows {
  display: grid;
  gap: 2rem;
  margin-top: 2rem;
}

.benefit-rows article {
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}

.benefit-rows article:last-child { border-bottom: 0; }

.about-place {
  margin: 2.5rem 0;
  padding: 1.75rem 0;
  border-block: 1px solid var(--line);
}

/* Contact */

.contact-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 3rem;
  align-items: start;
}

.contact-form {
  display: grid;
  gap: 1.1rem;
  background: var(--white);
  padding: 1.75rem;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.field {
  display: grid;
  gap: 0.4rem;
  font-weight: 600;
  color: var(--navy);
}

.field em {
  font-style: normal;
  font-weight: 500;
  color: var(--muted);
  font-size: 0.9em;
}

.field input,
.field textarea {
  font: inherit;
  font-weight: 500;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fafbfc;
  color: var(--ink);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(11, 31, 58, 0.12);
  background: var(--white);
}

.hp {
  position: absolute;
  left: -9999px;
  height: 0;
  overflow: hidden;
}

.contact-aside {
  padding-top: 0.5rem;
}

.contact-aside h2 { font-size: 1.35rem; }

.contact-aside__note {
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.alert {
  padding: 0.95rem 1.1rem;
  margin-bottom: 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
}

.alert--success {
  background: #e8f7ef;
  color: #0f5c36;
  border: 1px solid #b7e0c8;
}

.alert--error {
  background: #fdebec;
  color: #8f1520;
  border: 1px solid #f3c0c5;
}

/* Footer */

.site-footer {
  background: var(--navy-deep);
  color: rgba(255, 255, 255, 0.72);
  padding: 3rem 0 2rem;
  margin-top: auto;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
}

.site-footer a:hover { color: #ff8a93; }

.site-footer__inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: grid;
  gap: 1.75rem;
}

.site-footer__brand {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
}

.site-footer__brand img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  background: var(--white);
  border-radius: 4px;
}

.site-footer__brand strong {
  display: block;
  color: var(--white);
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.site-footer__brand p { margin: 0; }

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-weight: 600;
}

.site-footer__copy {
  margin: 0;
  font-size: 0.88rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 1.25rem;
}

/* Reveal on scroll */

[data-reveal],
[data-reveal-section] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

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

.hero [data-reveal].is-visible {
  /* hero uses its own animation */
}

/* Responsive */

@media (max-width: 860px) {
  .nav-toggle { display: flex; }

  .site-nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: stretch;
    padding: 1rem 1.25rem 1.25rem;
    gap: 0.35rem;
    transform: translateY(-120%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.35s var(--ease), opacity 0.35s var(--ease);
  }

  .site-nav.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .site-nav__link,
  .site-nav__cta {
    padding: 0.75rem 0.25rem;
  }

  .site-nav__cta { justify-content: center; }

  .hero__stack-visual {
    opacity: 0.28;
    right: -20%;
    top: 8%;
  }

  .section__inner--split,
  .page-hero__inner--split,
  .contact-layout,
  .service-row {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .service-row { padding: 1.35rem 0; }

  .section { padding: 4rem 0; }

  .contact-form { padding: 1.25rem; }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  [data-reveal],
  [data-reveal-section] {
    opacity: 1;
    transform: none;
  }
}
