/* segs.si — single-page site styles. Mobile-first; breakpoints at 40em and 60em. */

/* ---------- Design tokens ----------
   --accent is used as a BACKGROUND (buttons, logo, active language) and is
   always paired with white text; --accent-text is the accent used as a
   FOREGROUND (links, icons, eyebrow) and is tuned per theme for contrast. */
:root {
  color-scheme: light;
  --bg: #ffffff;
  --bg-alt: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --text-2: #475569;
  --accent: #1d4ed8;
  --accent-hover: #1e40af;
  --accent-text: #1d4ed8;
  --accent-text-hover: #1e40af;
  --accent-tint: #edf1fc;
  --border: #e2e8f0;
  --header-bg: rgb(255 255 255 / 0.85);
  --shadow-sm: 0 1px 2px rgb(15 23 42 / 0.06);
  --shadow-md: 0 4px 12px rgb(15 23 42 / 0.08);
  --radius: 12px;
  --radius-sm: 8px;
}

/* Dark mode follows the system preference. */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0f172a;
    --bg-alt: #0b1220;
    --surface: #1e293b;
    --text: #e2e8f0;
    --text-2: #94a3b8;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-text: #60a5fa;
    --accent-text-hover: #93c5fd;
    --accent-tint: rgb(96 165 250 / 0.12);
    --border: #2e3a52;
    --header-bg: rgb(15 23 42 / 0.85);
  }
}

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

/* Keep anchored sections clear of the sticky header. */
html { scroll-padding-top: 5rem; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -0.01em; }

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

:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }

.container {
  max-width: 68rem;
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.lede {
  margin: 0 0 1.5rem;
  font-size: 1.125rem;
  line-height: 1.65;
  color: var(--text-2);
  max-width: 44rem;
}

/* Visible only when focused — first tab stop of the page. */
.skip-link {
  position: absolute;
  top: 0;
  left: -100vw;
  z-index: 100;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

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

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  min-height: 4rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-right: auto;
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}
.logo:hover { color: var(--text); }
.logo-mark { width: 2rem; height: 2rem; }
.logo-mark rect { fill: var(--accent); }
.logo-mark text { fill: #fff; font: 700 28px/1 "Inter", system-ui, sans-serif; }

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav a {
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
}
.site-nav a:hover { color: var(--accent-text); }

.lang-switch {
  display: flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
/* The buttons only work with JS — hide the whole switch without it. */
html:not(.js) .lang-switch { display: none; }
.lang-switch button {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1;
  color: var(--text-2);
  padding: 0.4375rem 0.625rem;
  min-width: 2.25rem;
  border-radius: 5px;
}
.lang-switch button[aria-pressed="true"] {
  background: var(--accent);
  color: #fff;
}
.lang-switch button[aria-pressed="false"]:hover {
  background: var(--bg-alt);
  color: var(--text);
}

/* Hamburger: three lines that form an X when open. Hidden by default —
   it is only shown in the mobile media block below, and only when JS runs
   (without JS it would do nothing and the links render inline instead). */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0.625rem;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.nav-toggle span {
  height: 2px;
  width: 100%;
  background: var(--text);
  border-radius: 1px;
}

@media (prefers-reduced-motion: no-preference) {
  .nav-toggle span { transition: transform 0.2s ease, opacity 0.2s ease; }
}
.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile: the menu is a dropdown under the header (JS only — without JS the
   links simply render inside the header, always reachable). */
@media (max-width: 39.9375em) {
  html.js .nav-toggle { display: flex; }
  html.js .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.25rem 1.25rem;
    box-shadow: var(--shadow-md);
  }
  html.js .site-nav ul { flex-direction: column; gap: 1rem; }
  html.js .site-header:not(.nav-open) .site-nav { display: none; }
}

@media (min-width: 40em) {
  /* The nav sits before the language switch visually (DOM keeps the menu
     right after its toggle for keyboard/screen-reader order). */
  .lang-switch { order: 3; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding-block: 5rem;
}
/* Faint blueprint grid, fading out radially — pure CSS, no images. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, #000 40%, transparent 100%);
  mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, #000 40%, transparent 100%);
}
.hero .container { position: relative; }

.eyebrow {
  margin: 0 0 1rem;
  color: var(--accent-text);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.hero h1 {
  font-size: clamp(2.25rem, 1.5rem + 3.5vw, 3.25rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  max-width: 50rem;
}
.hero .lede { margin: 1.25rem 0 2rem; }

/* ---------- Buttons ---------- */
.button {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: var(--accent);
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}
@media (prefers-reduced-motion: no-preference) {
  .button { transition: background-color 0.15s ease; }
}
.button:hover {
  background: var(--accent-hover);
  color: #fff;
}

/* ---------- Sections ---------- */
.section { padding-block: 4rem; }
.section.alt { background: var(--bg-alt); }
.section h2 {
  margin: 0 0 2rem;
  font-size: clamp(1.5rem, 1.3rem + 1vw, 1.875rem);
}

.about-text {
  margin: 0;
  max-width: 44rem;
}

/* ---------- Service cards ---------- */
.card-grid {
  display: grid;
  gap: 1.5rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}
@media (prefers-reduced-motion: no-preference) {
  .card { transition: transform 0.2s ease, box-shadow 0.2s ease; }
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.card-icon {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-bottom: 1rem;
  background: var(--accent-tint);
  color: var(--accent-text);
  border-radius: var(--radius-sm);
}
.card h3 { margin: 0 0 0.5rem; font-size: 1.125rem; }
.card p { margin: 0; color: var(--text-2); }

/* ---------- Footer (impressum) ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 2.5rem;
  font-size: 0.875rem;
  color: var(--text-2);
}
.site-footer p { margin: 0.25rem 0; }
.site-footer a { color: inherit; }
.footer-name { font-weight: 600; color: var(--text); }
.site-footer .footer-copy { margin-top: 1.5rem; }

/* ---------- Fade-in on scroll ----------
   Content is only ever hidden when script.js actually runs (it owns the
   html.js class, so a failed script load degrades to everything visible),
   on screens only (never in print), for visitors who allow motion. The
   `translate` property is used so it composes with the cards' hover
   `transform`. :focus-within reveals a block the moment keyboard focus
   lands inside it, so focus is never on an invisible control. */
@media screen and (prefers-reduced-motion: no-preference) {
  html.js .fade-in {
    opacity: 0;
    translate: 0 12px;
    transition: opacity 0.5s ease, translate 0.5s ease;
  }
  html.js .fade-in.visible {
    opacity: 1;
    translate: none;
  }
  html.js .fade-in:focus-within {
    opacity: 1;
    translate: none;
    transition: none;
  }
}

/* ---------- Wider screens ---------- */
@media (min-width: 40em) {
  .container { padding-inline: 2rem; }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 60em) {
  .section { padding-block: 6rem; }
  .hero { padding-block: 8rem; }
  .card-grid { grid-template-columns: repeat(3, 1fr); }
}
