/* ============================================================
   TOKENS
   ============================================================ */
:root {
  --color-bg: #f7f5f2;
  --color-surface: #ffffff;
  --color-surface-2: #f0ede8;
  --color-border: #b6b8ba;
  --color-border-dark: #b6b8ba;

  --color-brand: #f78f1e;
  --color-brand-dark: #f78f1e;
  --color-brand-light: #ffeedb;
  --color-brand-transparent: #f78f1e29;

  --color-text: #231f20;
  --color-text-mid: #4a4540;
  --color-muted: #807870;

  --font-base: 'Inter', system-ui, sans-serif;
  --line-height: 1.65;

  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 7rem;

  --max-width: 1100px;
  --max-width-narrow: 720px;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-base);
  font-size: 1rem;
  line-height: var(--line-height);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

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

/* ============================================================
   LAYOUT
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-md);
}

.container--narrow {
  max-width: var(--max-width-narrow);
}

.section {
  padding-block: var(--space-xl);
}

.section--tinted {
  background: var(--color-surface-2);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.section--white {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.section--brand {
  background: var(--color-brand);
  color: #fff;
}

.section--dark {
  background: var(--color-text);
  color: var(--color-bg);
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(247, 245, 242, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 1rem;
}

.brand {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--color-text);
}

.brand span {
  color: var(--color-brand);
}

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

.nav a {
  font-size: 1.1rem;
  color: var(--color-muted);
  transition: color 0.15s;
}

.nav a:hover {
  color: var(--color-text);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-block;
  padding: 0.65rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  letter-spacing: 0.01em;
  width: fit-content;
}

.btn--primary {
  background: var(--color-brand);
  color: #fff !important;
  border-color: var(--color-brand);
}

.btn--primary:hover {
  background: var(--color-brand-dark);
  border-color: var(--color-brand-dark);
}

.btn--outline {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border-dark);
}

.btn--outline:hover {
  border-color: var(--color-text);
}

.btn--outline-invert {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.5);
}

.btn--outline-invert:hover {
  border-color: #fff;
}

.btn--large {
  padding: 0.9rem 2.2rem;
  font-size: 1rem;
}

/* ============================================================
   LABELS
   ============================================================ */
.label {
  display: inline-block;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--color-brand);
  margin-bottom: var(--space-sm);
  text-transform: uppercase;
}

.label--muted {
  color: var(--color-muted);
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  padding-block-start: calc(var(--space-xl) + 4rem);
  padding-block-end: var(--space-xl);
  overflow: hidden;
  position: relative;
}

/* triangle decoration — echoes the endurit logo */
.hero::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 480px;
  height: 480px;
  background: var(--color-brand-light);
  clip-path: polygon(100% 0, 0 0, 100% 100%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 240px;
  height: 240px;
  background: rgba(232, 92, 26, 0.12);
  clip-path: polygon(100% 0, 0 0, 100% 100%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 680px;
}

.hero-headline {
  font-size: clamp(2.4rem, 5.5vw, 4rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.04em;
  margin-bottom: var(--space-sm);
}

.hero-headline em {
  font-style: normal;
  color: var(--color-brand);
}

.hero-sub {
  font-size: 1.15rem;
  color: var(--color-text-mid);
  max-width: 520px;
  margin-bottom: var(--space-md);
}

.hero-actions {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-bottom: var(--space-lg);
}

.hero-inner {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-lg);
  align-items: center;
}

.hero-graphic {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  height: 420px;
}

.tri {
  position: absolute;
  width: 0;
  height: 0;
  transition: transform 0.12s ease-out;
  filter: drop-shadow(0 20px 40px rgba(232, 92, 26, 0.25));
}

/* Float Keyframes */
@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-50px); /* Adjust distance as needed */
  }
}

.float-wrapper {
  position: absolute;
  width: 0;
  height: 0;
}

/* Base position offset moves to wrappers */
.float-wrapper--up {
  top: 60px;
  left: 50%;
  animation: float 3s ease-in-out infinite;
}

.float-wrapper--down {
  bottom: 60px;
  left: 50%;
  /* Slightly faster with a delay for organic movement */
  animation: float 5s ease-in-out infinite 1s;
}

/* Triangle tweaks: remove absolute top/bottom/left so wrappers manage layout */
.tri--up {
  border-left: 120px solid transparent;
  border-right: 120px solid transparent;
  border-bottom: 208px solid var(--color-brand);
  transform: translateX(-70%);
  opacity: 0.9;
}

.tri--down {
  border-left: 90px solid transparent;
  border-right: 90px solid transparent;
  border-top: 156px solid var(--color-brand);
  transform: translateX(-30%);
  opacity: 0.35;
}

/* STATS BAR */
.stat-bar {
  display: flex;
  gap: var(--space-lg);
  flex-wrap: wrap;
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border);
}

.stat-number {
  display: block;
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: -0.05em;
  color: var(--color-text);
  line-height: 1;
}

.stat-number span {
  color: var(--color-brand);
}

.stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-muted);
  margin-top: 0.25rem;
}

/* ============================================================
   SECTION HEADINGS
   ============================================================ */
.section-title {
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  margin-bottom: var(--space-xs);
  line-height: 1.1;
}

.section-sub {
  color: var(--color-muted);
  margin-bottom: var(--space-lg);
  font-size: 1.05rem;
  max-width: 540px;
}

/* ============================================================
   PLACEHOLDER IMAGE
   ============================================================ */
.placeholder-img {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-muted);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  position: relative;
  overflow: hidden;
}

.placeholder-img::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 40%;
  height: 40%;
  background: var(--color-border);
  clip-path: polygon(100% 0, 0 100%, 100% 100%);
}

/* ============================================================
   SERVICES SECTION
   ============================================================ */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
}

.service-card {
  padding: var(--space-md) var(--space-md) calc(var(--space-md) * 1.5);
  position: relative;
  border: 1px solid var(--color-border);
}

.service-icon {
  width: 36px;
  height: 36px;
  margin-bottom: var(--space-sm);
}

.service-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-xs);
}

.service-text {
  color: var(--color-muted);
  font-size: 1rem;
}

/* ============================================================
   REFERENCES (grid cards)
   ============================================================ */
.ref-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 15px;
}

.ref-card {
  display: block;
  padding: var(--space-md);
  border: 1px solid var(--color-border);
  transition: background 0.15s;
  position: relative;
}

.ref-card--no-link:hover {
  background: transparent;
  cursor: default;
}

.ref-card {
  cursor: default;
}

.ref-card:hover {
  background: transparent;
}

.ref-actions {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-top: var(--space-sm);
}

.ref-cta--visit {
  color: var(--color-muted);
  border-bottom: 1px solid var(--color-border);
}

.ref-cta--visit:hover {
  color: var(--color-text);
  border-color: var(--color-text);
}

.ref-year {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-brand);
  display: block;
  margin-bottom: var(--space-xs);
}

.ref-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-xs);
}

.ref-teaser {
  color: var(--color-muted);
  font-size: 1rem;
  line-height: 1.55;
  margin-bottom: var(--space-sm);
}

.ref-cta {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-brand);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ref-card--has-img {
  padding: 0;
  display: flex;
  flex-direction: column;
}

.ref-screenshot {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-bottom: 1px solid var(--color-border);
}

.ref-screenshot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  transition: transform 0.3s ease;
  display: block;
}

.ref-body {
  padding: var(--space-md);
}

.ref-all-link {
  text-align: center;
  margin-top: var(--space-md);
}

/* ============================================================
   PRODUCTS (polit2go & CIRS)
   ============================================================ */
.product-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid var(--color-border);
  margin-bottom: var(--space-md);
}

.product-block:last-child {
  margin-bottom: 0;
}

.product-text {
  padding: var(--space-md) calc(var(--space-md) * 1.5);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.product-eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-brand);
  margin-bottom: var(--space-xs);
}

.product-name {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  margin-bottom: var(--space-xs);
}

.product-desc {
  color: var(--color-muted);
  font-size: 1rem;
  line-height: 1.65;
  margin-bottom: var(--space-md);
}

.product-image {
  border-left: 1px solid var(--color-border);
}

.product-image img {
  object-fit: cover;
  width: 100%;
  height: 100%;
}

.product-block--reversed .product-text {
  order: 2;
  border-left: 1px solid var(--color-border);
}

.product-block--reversed .product-image {
  order: 1;
  border-left: none;
}

/* ============================================================
   OPEN SOURCE STRIP
   ============================================================ */
.oss-strip {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.oss-badge {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  flex-shrink: 0;
}

.oss-badge img {
  background: var(--color-brand-transparent);
  border-radius: 5px;
  padding: 10px;
  max-width: 60px;
}

.oss-badge svg {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.oss-badge-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.oss-badge-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
}

.oss-divider {
  width: 1px;
  height: 40px;
  background: var(--color-border);
  flex-shrink: 0;
}

.oss-headline {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.oss-sub {
  color: var(--color-muted);
  font-size: 1rem;
  margin-top: 0.25rem;
}

/* ============================================================
   SUPPORT CALLOUT
   ============================================================ */
.support-callout {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--space-lg);
  align-items: center;
}

.support-triangle {
  width: 0;
  height: 0;
  border-left: 32px solid transparent;
  border-right: 32px solid transparent;
  border-bottom: 56px solid #fff;
  opacity: 1;
  flex-shrink: 0;
}

.support-title {
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #fff;
  margin-bottom: 0.35rem;
}

.support-sub {
  color: white;
  font-size: 1rem;
}

/* ============================================================
   PROCESS
   ============================================================ */
.process-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--color-border);
}

.process-step {
  padding: var(--space-md);
  border-right: 1px solid var(--color-border);
  position: relative;
}

.process-step:last-child {
  border-right: none;
}

.step-num {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-brand);
  margin-bottom: var(--space-sm);
  display: block;
}

.step-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 0.4rem;
}

.step-text {
  color: var(--color-muted);
  font-size: 0.95rem;
}

.process-cta {
  text-align: center;
  margin-top: var(--space-md);
}

/* ============================================================
   CONTACT
   ============================================================ */
.contact-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  align-items: start;
}

.contact-intro p {
  color: rgba(247, 245, 242, 0.65);
  margin-top: var(--space-xs);
  margin-bottom: var(--space-md);
  font-size: 1.05rem;
}

.contact-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: rgba(247, 245, 242, 0.65);
}

.contact-meta a {
  color: #fff;
}

.contact-meta a:hover {
  color: var(--color-brand-light);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.contact-form input,
.contact-form textarea {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0.75rem 1rem;
  color: #fff;
  font-family: var(--font-base);
  font-size: 0.9rem;
  width: 100%;
  transition: border-color 0.15s;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--color-brand);
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

/* ============================================================
   DETAIL PAGE
   ============================================================ */
.section--detail {
  padding-block-start: calc(var(--space-xl) + 3rem);
}

.back-link {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-bottom: var(--space-md);
  transition: color 0.15s;
}

.back-link:hover {
  color: var(--color-brand);
}

.page-title {
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  margin-bottom: var(--space-xs);
}

.page-teaser {
  font-size: 1.15rem;
  color: var(--color-muted);
  margin-bottom: var(--space-lg);
}

.prose {
  color: var(--color-text-mid);
  font-size: 1rem;
  line-height: 1.8;
}

.prose p {
  margin-bottom: var(--space-sm);
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--color-text);
  color: var(--color-bg);
  border-top: 1px solid var(--color-border);
  padding-block: var(--space-lg);
}

.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--space-md);
  align-items: start;
}

.footer-brand .brand {
  color: #fff;
  display: block;
  margin-bottom: 0.5rem;
}

.footer-brand .brand span {
  color: var(--color-brand);
}

.footer-brand p {
  color: rgba(247, 245, 242, 0.45);
  font-size: 1rem;
  max-width: 450px;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: rgba(247, 245, 242, 0.45);
}

.footer-col a:hover {
  color: #fff;
}

.footer-col-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(247, 245, 242, 0.3);
  margin-bottom: 0.4rem;
}

.footer-bottom {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid rgba(247, 245, 242, 0.1);
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: rgba(247, 245, 242, 0.3);
}

.footer-bottom a:hover {
  color: rgba(247, 245, 242, 0.6);
}

footer .brand {
  background: white;
  width: fit-content;
  padding: 30px;
}

header .brand img {
  max-width: 250px;
}

.backup-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  align-items: center;
}

.backup-body {
  color: var(--color-muted);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: var(--space-md);
}

.backup-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.backup-list li {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text-mid);
  padding-left: 1.25rem;
  position: relative;
}

.backup-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid var(--color-brand);
}

.backup-visual img {
  background: var(--color-brand-transparent);
  border-radius: 100%;
}

.section-title span {
  color: var(--color-brand);
}

.label span {
  display: inline-block;
}

.section-sub a {
  color: var(--color-brand);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }

  .hero-graphic {
    display: none;
  }

  .backup-wrap {
    grid-template-columns: 1fr;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .process-list {
    grid-template-columns: 1fr 1fr;
  }

  .process-step:nth-child(2) {
    border-right: none;
  }

  .product-block {
    grid-template-columns: 1fr;
  }

  .product-block--reversed .product-text {
    order: 1;
    border-left: none;
    border-top: 1px solid var(--color-border);
  }

  .product-block--reversed .product-image {
    order: 2;
  }

  .product-image {
    border-left: none;
    border-top: 1px solid var(--color-border);
    height: 200px;
  }

  .contact-wrap {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 0.5rem;
  }

  .oss-strip {
    flex-wrap: wrap;
  }

  .oss-divider {
    display: none;
  }

  .support-callout {
    grid-template-columns: 1fr;
  }

  .support-triangle {
    display: none;
  }

  header .brand img {
    max-width: 160px;
  }

  .nav {
    gap: 1.3rem;
  }

  .nav a {
    font-size: 0.9rem;
  }
}

@media (max-width: 600px) {
  header .brand img {
    max-width: 120px;
  }


  .nav {
    gap: 1rem;
  }

  .nav a:not(.btn, .mobile-visible) {
    display: none;
  }

  .nav a.btn {
    padding: 5px 10px;
  }

  .hero::before,
  .hero::after {
    width: 220px;
    height: 220px;
  }

  .process-list {
    grid-template-columns: 1fr;
  }

  .process-step {
    border-right: none;
    border-bottom: 1px solid var(--color-border);
  }

  .process-step:last-child {
    border-bottom: none;
  }

  .ref-grid {
    grid-template-columns: 1fr;
  }

  .stat-bar {
    gap: var(--space-md);
  }
}
