/* Helwecja Bridge — Swiss International Typographic Style.
   One red accent, a strict left grid, Helvetica-family type, sharp edges,
   hairline dividers instead of soft-shadow cards. */

:root {
  --paper: #fbfbf9;
  --paper-2: #f2f0ea;
  --ink: #14110f;
  --muted: #6b675f;
  --red: #d8232a;
  --red-ink: #b71d24;
  --slate: #1c262b;
  --hairline: #e3e0d8;
  --hairline-dark: #37424a;
  --on-dark: #f4f2ee;
  --on-dark-muted: #c2c6c9;

  --sans: "Helvetica Neue", Helvetica, Arial, "Segoe UI", system-ui, sans-serif;
  --measure: 66ch;
  --gap: clamp(1rem, 3vw, 2rem);
  --pad-y: clamp(3.5rem, 8vw, 6.5rem);
}

:root[data-theme="dark"] {
  --paper: #14171c;
  --paper-2: #1b1f26;
  --ink: #ecebe6;
  --muted: #9ea3a9;
  --hairline: #2b303a;
  --red: #e6403f;
  --red-ink: #ef5a58;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: clamp(1rem, 0.55vw + 0.9rem, 1.125rem);
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.08; letter-spacing: -0.02em; font-weight: 700; }
h1 { font-size: clamp(2.1rem, 5vw, 3.3rem); margin: 0 0 0.5em; }
h2 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); margin: 0 0 0.6em; }
h3 { font-size: 1.2rem; margin: 0 0 0.4em; }
p { margin: 0 0 1em; }
a { color: var(--red-ink); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--red); }
strong { font-weight: 700; }

.container { width: min(100% - 2.5rem, 1140px); margin-inline: auto; }
.measure { max-width: var(--measure); }
.lead { font-size: 1.2rem; color: var(--muted); line-height: 1.5; }

/* Red-rule motif */
.rule { display: block; width: 54px; height: 6px; background: var(--red); margin-bottom: 1.4rem; }
.rule-lg { width: 76px; height: 8px; }

/* Accessibility */
.skip-link {
  position: absolute; left: -9999px; top: 0; background: var(--ink); color: var(--paper);
  padding: 0.6rem 1rem; z-index: 100;
}
.skip-link:focus { left: 0; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }

/* Header */
.site-header { border-bottom: 1px solid var(--hairline); position: sticky; top: 0; background: var(--paper); z-index: 20; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--ink); font-weight: 700; }
.brand:hover { color: var(--ink); }
.brand-name { letter-spacing: -0.01em; font-size: 1.05rem; }
.brand-mark {
  width: 20px; height: 20px; background: var(--red); position: relative; flex: none;
}
.brand-mark::before, .brand-mark::after { content: ""; position: absolute; background: var(--on-dark); }
.brand-mark::before { left: 8px; top: 4px; width: 4px; height: 12px; }
.brand-mark::after { left: 4px; top: 8px; width: 12px; height: 4px; }

/* Primary menu bar: always visible, prominent, its own full-width row */
.site-nav { border-top: 1px solid var(--hairline); background: var(--paper); }
.nav-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; align-items: stretch;
  gap: clamp(0.4rem, 2.4vw, 2rem);
}
.nav-spacer { flex: 1 1 auto; }
.nav-link {
  display: inline-flex; align-items: center; text-decoration: none; color: var(--ink);
  font-size: 1.02rem; font-weight: 600; letter-spacing: -0.01em;
  padding: 0.95rem 0; box-shadow: inset 0 0 0 var(--red); transition: box-shadow 0.15s ease, color 0.15s ease;
}
.nav-link:hover { color: var(--red-ink); box-shadow: inset 0 -3px 0 var(--red); }
.nav-link[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--red); }
.nav-cta { color: #fff; background: var(--red); padding: 0.55rem 1.1rem; align-self: center; }
.nav-cta:hover { color: #fff; background: var(--red-ink); box-shadow: none; }
.nav-cta[aria-current="page"] { box-shadow: none; }

/* Theme toggle */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 40px; height: 40px; padding: 0;
  background: transparent; border: 1px solid var(--hairline); color: var(--ink); cursor: pointer;
}
.theme-toggle:hover { border-color: var(--red); color: var(--red-ink); }
.theme-toggle .icon { display: block; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }

/* Hero */
.hero { padding: var(--pad-y) 0 calc(var(--pad-y) * 0.6); }
.hero-kicker { color: var(--muted); margin: 0 0 1.2rem; font-size: 1rem; }
.hero-title { font-size: clamp(2.4rem, 6.2vw, 4.4rem); max-width: 18ch; }
.hero-lead { margin-top: 1.4rem; font-size: clamp(1.15rem, 1.4vw, 1.4rem); color: var(--muted); }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 2rem; }

/* Buttons and links */
.btn {
  display: inline-block; padding: 0.85rem 1.5rem; font-weight: 700; text-decoration: none;
  border: 2px solid var(--red); transition: background-color 0.15s ease, color 0.15s ease;
}
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-ink); border-color: var(--red-ink); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }

.link-arrow { display: inline-block; margin-top: 0.8rem; font-weight: 700; text-decoration: none; box-shadow: inset 0 -2px 0 var(--red); }
.link-arrow:hover { box-shadow: inset 0 -6px 0 rgba(216, 35, 42, 0.25); }
.link-arrow-light { color: var(--on-dark); box-shadow: inset 0 -2px 0 var(--on-dark); }
.link-arrow-light:hover { color: #fff; box-shadow: inset 0 -6px 0 rgba(255, 255, 255, 0.3); }
.link-back { display: inline-block; margin-bottom: 1.2rem; color: var(--muted); font-size: 0.95rem; text-decoration: none; }
.link-back:hover { color: var(--red); }

/* Proof row */
.proof { border-block: 1px solid var(--hairline); }
.proof-row { display: flex; flex-wrap: wrap; gap: var(--gap); padding: 1.6rem 0; }
.proof-item { display: flex; flex-direction: column; padding-right: var(--gap); }
.proof-item + .proof-item { border-left: 1px solid var(--hairline); padding-left: var(--gap); }
.proof-value { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; }
.proof-label { color: var(--muted); font-size: 0.95rem; }

/* Generic section */
.section { padding: var(--pad-y) 0; }
.section-head { margin-bottom: clamp(2rem, 5vw, 3rem); }
.band { background: var(--paper-2); }

/* Columns (services / qualifiers) — hairline separated, not cards */
.cols { display: grid; gap: 0; }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.col { padding: 1.8rem var(--gap) 1.8rem 0; border-top: 2px solid var(--ink); }
.cols-3 .col + .col, .cols-2 .col + .col { padding-left: var(--gap); border-left: 1px solid var(--hairline); }
.col-title { margin-bottom: 0.6rem; }
.col p { color: var(--muted); }

/* Why (inverted band) */
.section-invert { background: var(--slate); color: var(--on-dark); }
.section-invert .lead { color: var(--on-dark-muted); }
.why-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.why-points { list-style: none; margin: 0; padding: 0; }
.why-points li { padding: 1.1rem 0; border-top: 1px solid var(--hairline-dark); display: grid; gap: 0.2rem; }
.why-points li:first-child { border-top: 0; }
.why-points strong { font-size: 1.1rem; }
.why-points span { color: var(--on-dark-muted); }

/* Steps — a real sequence, so numbers are earned */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.step { display: grid; grid-template-columns: auto 1fr; gap: clamp(1rem, 3vw, 2.5rem); padding: 1.6rem 0; border-top: 1px solid var(--hairline); }
.step:first-child { border-top: 0; }
.step-n { font-size: 1.4rem; font-weight: 700; color: var(--red); font-variant-numeric: tabular-nums; }
.step-body h3 { margin-bottom: 0.3rem; }
.step-body p { margin: 0; color: var(--muted); }

/* Qualifiers (for whom) */
.qualifier { border-top-color: var(--ink); }
.ticks, .crosses { list-style: none; margin: 0.4rem 0 0; padding: 0; }
.ticks li, .crosses li { position: relative; padding-left: 1.8rem; margin-bottom: 0.7rem; }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: 0.45em; width: 12px; height: 12px;
  background:
    linear-gradient(var(--red), var(--red)) center / 12px 3px no-repeat,
    linear-gradient(var(--red), var(--red)) center / 3px 12px no-repeat;
}
.crosses li::before {
  content: ""; position: absolute; left: 0; top: 0.72em; width: 12px; height: 3px; background: var(--muted);
}

/* Final CTA */
.cta-final h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); }

/* Prose (Markdown pages / posts) */
.page { padding: var(--pad-y) 0; }
.page-head { margin-bottom: 2.4rem; }
.prose { max-width: var(--measure); }
.prose h2 { margin-top: 2.2rem; }
.prose h3 { margin-top: 1.6rem; }
.prose ul, .prose ol { padding-left: 1.2rem; }
.prose li { margin-bottom: 0.5rem; }
.prose blockquote {
  margin: 1.6rem 0; padding: 0.8rem 1.2rem; border-left: 4px solid var(--red);
  background: var(--paper-2); color: var(--muted);
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose table { border-collapse: collapse; width: 100%; margin: 1.4rem 0; font-size: 0.98rem; }
.prose th, .prose td { text-align: left; padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--hairline); vertical-align: top; }
.prose th { border-bottom: 2px solid var(--ink); }
.prose a { text-decoration: underline; }
.prose hr { border: 0; border-top: 1px solid var(--hairline); margin: 2rem 0; }

/* Blog index */
.post-list { list-style: none; margin: 0; padding: 0; }
.post-item { border-top: 1px solid var(--hairline); }
.post-item:last-child { border-bottom: 1px solid var(--hairline); }
.post-link { display: block; padding: 1.8rem 0; text-decoration: none; color: var(--ink); }
.post-link:hover { color: var(--ink); }
.post-link time { color: var(--muted); font-size: 0.9rem; }
.post-title { margin: 0.3rem 0 0.4rem; font-size: 1.5rem; }
.post-link:hover .post-title { color: var(--red-ink); }
.post-summary { color: var(--muted); max-width: var(--measure); }
.post-meta { color: var(--muted); font-size: 0.95rem; }
.post-meta .sep { margin: 0 0.5rem; }
.post-foot { margin-top: 2.4rem; padding-top: 1.4rem; border-top: 1px solid var(--hairline); }

/* Footer */
.site-footer { margin-top: auto; border-top: 4px solid var(--red); background: var(--slate); color: var(--on-dark); padding: var(--pad-y) 0 2.5rem; }
.site-footer .brand, .site-footer .brand:hover { color: var(--on-dark); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: var(--gap); }
.footer-tagline { max-width: 24ch; margin-top: 1rem; }
.footer-heading { font-size: 0.95rem; letter-spacing: 0; color: var(--on-dark-muted); font-weight: 700; margin-bottom: 0.8rem; }
.footer-nav ul, .footer-contact ul { list-style: none; margin: 0; padding: 0; }
.footer-nav li, .footer-contact li { margin-bottom: 0.5rem; }
.footer-nav a, .footer-contact a { color: var(--on-dark); text-decoration: none; }
.footer-nav a:hover, .footer-contact a:hover { color: var(--on-dark); box-shadow: inset 0 -2px 0 var(--red); }
.footer-social { margin-top: 1rem; }

/* Social icon links (LinkedIn) */
.social-links { display: inline-flex; align-items: center; gap: 0.7rem; }
.social-link { display: inline-flex; color: var(--ink); }
.social-link svg { display: block; }
.social-link:hover { color: var(--red-ink); }
.site-footer .social-link { color: var(--on-dark); }
.site-footer .social-link:hover { color: var(--red-ink); }
.footer-legal { margin-top: 2.5rem; padding-top: 1.6rem; border-top: 1px solid var(--hairline-dark); }
.disclaimer { color: var(--on-dark-muted); font-size: 0.85rem; max-width: 80ch; }
.copyright { color: var(--on-dark-muted); font-size: 0.85rem; margin: 0; }

/* Responsive */
@media (max-width: 860px) {
  .cols-3 { grid-template-columns: 1fr; }
  .cols-2 { grid-template-columns: 1fr; }
  .cols-3 .col + .col, .cols-2 .col + .col { padding-left: 0; border-left: 0; }
  .col { border-top: 1px solid var(--hairline); }
  .col:first-child { border-top: 2px solid var(--ink); }
  .why-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
}

@media (max-width: 620px) {
  /* Header is not pinned on mobile, so the stacked menu never covers content */
  .site-header { position: static; }

  /* Main menu: a clean vertical stack, every item full width */
  .nav-spacer { display: none; }
  .nav-list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav-link { width: 100%; padding: 0.9rem 0; font-size: 1.05rem; border-top: 1px solid var(--hairline); box-shadow: none; }
  .nav-list > li:first-child .nav-link { border-top: 0; }
  .nav-link[aria-current="page"] { box-shadow: inset 3px 0 0 var(--red); padding-left: 0.7rem; }
  .nav-cta { width: auto; border-top: 0; align-self: flex-start; margin: 1rem 0 0.3rem; padding: 0.7rem 1.3rem; }
  .nav-cta[aria-current="page"] { box-shadow: none; padding-left: 1.3rem; }

  /* Proof row: stack vertically with top dividers instead of left borders */
  .proof-row { flex-direction: column; gap: 0; }
  .proof-item { padding: 1rem 0; padding-right: 0; }
  .proof-item + .proof-item { border-left: 0; padding-left: 0; border-top: 1px solid var(--hairline); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* Post body (Skryba XSLT output) */
.post-body { margin-top: 2rem; }
.post-body h2 { margin-top: 2.2rem; }
.post-body dl {
  margin: 1.4rem 0; border-top: 2px solid var(--ink);
}
.post-body dt {
  font-weight: 700; padding: 0.8rem 0 0.2rem; border-bottom: 0;
}
.post-body dd {
  margin: 0 0 0.2rem; padding: 0 0 0.8rem; color: var(--muted);
  border-bottom: 1px solid var(--hairline);
}
.post-body .disclaimer {
  margin: 1.8rem 0 0; padding: 0.9rem 1.2rem; border-left: 4px solid var(--red);
  background: var(--paper-2); color: var(--muted); font-size: 0.98rem; max-width: none;
}
.post-meta .sep { margin: 0 0.5rem; }
.post-tags { margin-top: 2rem; color: var(--muted); font-size: 0.95rem; }

/* Tag list (Skryba Tag_list macro) */
.skryba-tag-list { list-style: none; display: inline-flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.4rem 0 0; padding: 0; }
.skryba-tag-list li { margin: 0; }
.skryba-tag-list a {
  display: inline-block; padding: 0.2rem 0.7rem; background: var(--paper-2);
  border: 1px solid var(--hairline); text-decoration: none; color: var(--ink); font-size: 0.9rem;
}
.skryba-tag-list a:hover { border-color: var(--red); color: var(--red-ink); }

/* Email obfuscation (no-JS fallback separators) */
.js-email .obf { color: var(--muted); }
