/* ==========================================================================
   Swiss Hosted Solutions — swisshostedsolutions.ch
   Mobile-first · Light & Dark themes · No external dependencies
   Brand: red #ce3126 / indigo #51479c / cream #f1f1e1
   ========================================================================== */

/* ---------- Local fonts (variable, latin subset, OFL-licensed) ---------- */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/inter-var-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("/assets/fonts/space-grotesk-var-latin.woff2") format("woff2");
}

/* ---------- Design tokens ---------- */
:root {
  /* Brand constants (theme-independent) */
  --brand-red: #ce3126;
  --brand-indigo: #51479c;
  --brand-cream: #f1f1e1;

  /* Light theme (Swiss editorial: paper & ink) */
  --bg: #f3f2e7;
  --surface: #fbfaf3;
  --surface-2: #e9e7d6;
  --ink: #211d3a;
  --muted: #5f5b76;
  --line: #d9d6c2;
  --accent: #ce3126;
  --accent-ink: #ffffff;
  --link: #51479c;
  --header-bg: rgba(243, 242, 231, 0.88);
  --shadow: 0 2px 16px rgba(33, 29, 58, 0.08);

  --radius: 14px;
  --radius-sm: 8px;
  --container: 72rem;
  --font-display: "Space Grotesk", "Segoe UI", -apple-system, sans-serif;
  --font-body: "Inter", "Segoe UI", -apple-system, sans-serif;

  color-scheme: light dark;
}

/* Dark theme: follows the OS preference unless the user chose light manually.
   Keep this block in sync with the [data-theme="dark"] block below. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15131f;
    --surface: #1e1b2d;
    --surface-2: #292540;
    --ink: #f1f1e1;
    --muted: #a8a4c2;
    --line: #322e4a;
    --accent: #e04a3d;
    --accent-ink: #ffffff;
    --link: #a49bea;
    --header-bg: rgba(21, 19, 31, 0.88);
    --shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
  }
}

/* Manual override via the theme toggle (persisted in localStorage) */
[data-theme="dark"] {
  --bg: #15131f;
  --surface: #1e1b2d;
  --surface-2: #292540;
  --ink: #f1f1e1;
  --muted: #a8a4c2;
  --line: #322e4a;
  --accent: #e04a3d;
  --accent-ink: #ffffff;
  --link: #a49bea;
  --header-bg: rgba(21, 19, 31, 0.88);
  --shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
}

[data-theme="light"] { color-scheme: light; }
[data-theme="dark"] { color-scheme: dark; }

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.015em;
}

h1 { font-size: clamp(2.1rem, 6vw + 0.5rem, 3.6rem); }
h2 { font-size: clamp(1.55rem, 3.5vw + 0.5rem, 2.3rem); }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1em; }

a {
  color: var(--link);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--brand-indigo);
  outline-offset: 2px;
}

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

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.section {
  padding-block: 3.5rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}
.eyebrow::before {
  content: "";
  width: 1.5rem;
  height: 2px;
  background: var(--accent);
}

.lead {
  font-size: 1.125rem;
  color: var(--muted);
  max-width: 38rem;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink);
  text-decoration: none;
}
.brand:hover { text-decoration: none; }

.brand svg { width: 2.25rem; height: auto; flex-shrink: 0; }

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.brand-name span { color: var(--brand-indigo); }
[data-theme="dark"] .brand-name span { color: var(--link); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand-name span { color: var(--link); }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Language switch: plain links between the DE and EN version of each page */
.lang-toggle {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  font-size: 0.75rem;
  font-weight: 600;
}
.lang-toggle a {
  color: var(--muted);
  padding: 0.3rem 0.6rem;
}
.lang-toggle a:hover { text-decoration: none; color: var(--ink); }
.lang-toggle a[aria-current="true"] {
  background: var(--ink);
  color: var(--bg);
}

/* Theme toggle (progressive enhancement: hidden without JS via <noscript>) */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.theme-toggle svg { width: 1.1rem; height: 1.1rem; }
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

/* Mobile navigation — CSS-only via hidden checkbox, no JavaScript */
.nav-check {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.nav-toggle .icon-close { display: none; }

.nav-check:focus-visible ~ .header-actions .nav-toggle {
  outline: 2px solid var(--brand-indigo);
  outline-offset: 2px;
}

.site-nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.nav-check:checked ~ .site-nav { display: block; }
.nav-check:checked ~ .header-actions .nav-toggle .icon-menu { display: none; }
.nav-check:checked ~ .header-actions .nav-toggle .icon-close { display: block; }

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0.5rem 1.25rem 1rem;
}
.site-nav a {
  display: block;
  padding: 0.75rem 0.25rem;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.site-nav li:last-child a { border-bottom: 0; }
.site-nav a:hover { color: var(--accent); text-decoration: none; }
.site-nav a[aria-current="page"] {
  color: var(--accent);
}

@media (min-width: 48rem) {
  .nav-toggle { display: none; }
  .site-nav {
    display: block;
    position: static;
    background: transparent;
    border: 0;
    box-shadow: none;
  }
  .site-nav ul {
    display: flex;
    gap: 1.75rem;
    padding: 0;
  }
  .site-nav a {
    padding: 0.25rem 0;
    border-bottom: 2px solid transparent;
  }
  .site-nav a[aria-current="page"] {
    border-bottom-color: var(--accent);
  }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.5rem;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn-primary:hover { box-shadow: 0 6px 20px rgba(206, 49, 38, 0.35); }

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

.btn-light {
  background: var(--brand-cream);
  color: var(--brand-indigo);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding-block: 4rem 3.5rem;
}

.hero h1 .u-red { color: var(--accent); }
.hero h1 .u-indigo { color: var(--brand-indigo); }
[data-theme="dark"] .hero h1 .u-indigo { color: var(--link); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hero h1 .u-indigo { color: var(--link); }
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

/* Decorative Swiss-cross grid in hero corner */
.cross-grid {
  position: absolute;
  right: -2rem;
  top: -2rem;
  width: 16rem;
  height: 16rem;
  opacity: 0.07;
  pointer-events: none;
  color: var(--ink);
}

/* ---------- Stat strip ---------- */
.stats {
  border-block: 1px solid var(--line);
  background: var(--surface);
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  padding-block: 2rem;
}
.stat .num {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent);
}
.stat .label {
  font-size: 0.85rem;
  color: var(--muted);
}

@media (min-width: 48rem) {
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- Cards ---------- */
.card-grid {
  display: grid;
  gap: 1.25rem;
  margin-top: 2rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--brand-indigo);
}

.card .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  background: color-mix(in srgb, var(--brand-indigo) 12%, transparent);
  color: var(--brand-indigo);
  margin-bottom: 1rem;
}
[data-theme="dark"] .card .icon { color: var(--link); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .card .icon { color: var(--link); }
}
.card .icon svg { width: 1.5rem; height: 1.5rem; }

.card p { color: var(--muted); font-size: 0.95rem; margin-bottom: 0; }
.card p + p { margin-top: 0.75em; }

@media (min-width: 40rem) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 64rem) {
  .card-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
  .card-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
  .card-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Split section ---------- */
.split {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}
@media (min-width: 48rem) {
  .split { grid-template-columns: 1fr 1fr; }
}

.checklist {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
}
.checklist li {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding-block: 0.6rem;
}
.checklist .check {
  flex-shrink: 0;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  margin-top: 0.15rem;
}

.panel {
  background: var(--brand-indigo);
  color: var(--brand-cream);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
}
.panel h3 { color: #fff; }
.panel p {
  color: #dddbc9;
  color: color-mix(in srgb, var(--brand-cream) 85%, transparent);
}
.panel p:last-child { margin-bottom: 0; }

/* ---------- CTA banner ---------- */
.cta-banner {
  background: var(--brand-indigo);
  background: linear-gradient(135deg, var(--brand-indigo), #3a3375);
  color: var(--brand-cream);
  border-radius: var(--radius);
  padding: 2.5rem 1.75rem;
  text-align: center;
}
.cta-banner h2 { color: #fff; }
.cta-banner p {
  color: #d3d0c0;
  color: color-mix(in srgb, var(--brand-cream) 80%, transparent);
}
.cta-banner .btn { margin-top: 1rem; }

/* ---------- Project cards ---------- */
.project-card { position: relative; }

/* Stretched Link: macht die ganze Kachel klickbar, ohne JS */
.card-link {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--link);
  text-decoration: none;
}
.card-link::after {
  content: "";
  position: absolute;
  inset: 0;
}
.project-card:hover .card-link { text-decoration: underline; }

.project-card .thumb {
  height: 9rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
  background: var(--brand-indigo);
  background:
    repeating-linear-gradient(45deg, transparent 0 14px, rgba(255,255,255,0.06) 14px 28px),
    linear-gradient(135deg, var(--brand-indigo), #3a3375);
  position: relative;
  overflow: hidden;
}
.project-card .thumb.alt {
  background: var(--brand-red);
  background:
    repeating-linear-gradient(45deg, transparent 0 14px, rgba(255,255,255,0.08) 14px 28px),
    linear-gradient(135deg, var(--brand-red), #8f1f17);
}
.project-card .thumb.ki {
  background: #211d3a;
  background:
    repeating-linear-gradient(45deg, transparent 0 14px, rgba(255,255,255,0.06) 14px 28px),
    linear-gradient(135deg, #211d3a, var(--brand-indigo));
}
.project-card .thumb.uus {
  background: var(--brand-indigo);
  background:
    repeating-linear-gradient(45deg, transparent 0 14px, rgba(255,255,255,0.07) 14px 28px),
    linear-gradient(135deg, var(--brand-indigo), var(--brand-red));
}

.tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-indigo);
  background: var(--surface-2);
  background: color-mix(in srgb, var(--brand-indigo) 12%, transparent);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  margin-bottom: 0.75rem;
}
[data-theme="dark"] .tag { color: var(--link); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tag { color: var(--link); }
}
.tag.red {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

/* ---------- Values ---------- */
.value-num {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  color: #e8aca7;
  color: color-mix(in srgb, var(--accent) 35%, transparent);
  line-height: 1;
  margin-bottom: 0.75rem;
}

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  gap: 2rem;
  margin-top: 2rem;
  align-items: start;
}
@media (min-width: 48rem) {
  .contact-grid { grid-template-columns: 1fr 1fr; }
}

.info-card {
  background: var(--brand-indigo);
  color: var(--brand-cream);
  border-radius: var(--radius);
  padding: 1.75rem;
}
.info-card h3 { color: #fff; }
.info-card a { color: #fff; text-decoration: underline; }
.info-card dl { margin: 0; }
.info-card dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.7;
  margin-top: 1.1rem;
}
.info-card dd { margin: 0.15rem 0 0; }
.info-card .note { color: inherit; opacity: 0.75; }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 3rem;
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.footer-inner {
  padding-block: 2.5rem 1.5rem;
  display: grid;
  gap: 2rem;
}
.footer-inner .brand svg { width: 2rem; }
.footer-tagline {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--muted);
  max-width: 20rem;
}
.footer-col h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 0.75rem;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { padding-block: 0.25rem; }
.footer-col a { color: var(--ink); font-size: 0.95rem; }
.footer-col a:hover { color: var(--accent); }

.footer-bottom {
  border-top: 1px solid var(--line);
  padding-block: 1.25rem;
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: space-between;
}

@media (min-width: 48rem) {
  .footer-inner { grid-template-columns: 2fr 1fr 1fr 1fr; }
}

/* ---------- Utilities ---------- */
.text-center { text-align: center; }
.mt-2 { margin-top: 2rem; }
.note {
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
  html { scroll-behavior: auto; }
}
