:root {
  color-scheme: light;
  --page: #f8fbfa;
  --surface: #fff;
  --tinted: #eaf4f2;
  --text: #172c2c;
  --muted: #405957;
  --accent: #12605a;
  --border: #cbdeda;
  --header-offset: 5.5rem;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #122120;
  --surface: #1a2e2d;
  --tinted: #162827;
  --text: #eff9f7;
  --muted: #b8cfcb;
  --accent: #a1e3d8;
  --border: #36514d;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  scroll-padding-top: var(--header-offset);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 1rem/1.6 "Segoe UI", system-ui, sans-serif;
}

img { display: block; max-width: 100%; }
button { font: inherit; }
a { color: var(--accent); text-underline-offset: 0.18em; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.15; }
h2 { font-size: clamp(1.85rem, 4vw, 2.5rem); margin-bottom: 1rem; }
h3 { font-size: 1.2rem; margin-bottom: 0.55rem; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

.wrap { width: min(72rem, calc(100% - 2rem)); margin-inline: auto; }

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 1rem;
  z-index: 3;
  transform: translateY(-200%);
  padding: 0.65rem 1rem;
  background: var(--surface);
}
.skip-link:focus { transform: none; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(0.4rem, 2vw, 1.5rem);
  min-height: 4.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-right: auto;
  color: var(--text);
  font-weight: 750;
  line-height: 1.2;
  text-decoration: none;
}
.brand img { border-radius: 50%; flex: none; }

.nav-links {
  display: flex;
  gap: clamp(0.25rem, 2vw, 1.5rem);
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav-links a {
  display: block;
  padding: 0.65rem 0.3rem;
  color: var(--text);
  text-decoration: none;
}
.nav-links a:hover { color: var(--accent); text-decoration: underline; }

.menu-toggle, .theme-toggle {
  flex: none;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0.35rem 0.65rem;
  color: var(--text);
  background: var(--tinted);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  cursor: pointer;
}

.menu-toggle, .sun, [data-theme="dark"] .moon { display: none; }
.theme-toggle { font-size: 1.35rem; line-height: 1; }
[data-theme="dark"] .sun { display: inline; }

.hero {
  display: grid;
  place-items: center;
  min-height: clamp(24rem, 58vw, 36rem);
  padding: clamp(3rem, 9vw, 7rem) 1rem;
  background: #233a39 url("valjak.jpg") center / cover no-repeat;
  text-align: center;
  color: #fff;
}
.hero-content {
  width: min(100%, 41rem);
  padding: clamp(1.35rem, 5vw, 3.5rem);
  border-radius: 1.25rem;
  background: rgba(13, 29, 30, 0.86);
}
.hero h1 { font-size: clamp(2.25rem, 7vw, 4.5rem); }
.hero p { margin-top: 0.75rem; font-size: clamp(1.05rem, 3vw, 1.35rem); }
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.75rem;
}
.button {
  padding: 0.65rem 1.1rem;
  border: 1px solid #b8e5e4;
  border-radius: 2rem;
  background: #b8e5e4;
  color: #173331;
  font-weight: 700;
  text-decoration: none;
}
.button-outline { background: transparent; color: #fff; }
.button:hover { background: #e0f5f2; color: #173331; }
.button:focus-visible { outline-color: #b8e5e4; }

.section { padding: clamp(3rem, 7vw, 5rem) 0; }
.section-tinted { background: var(--tinted); }
.section p, footer { color: var(--muted); }

.services-grid, .contact-grid, .gallery-grid {
  display: grid;
  gap: clamp(0.9rem, 2.5vw, 1.5rem);
  margin-top: 1.5rem;
}
.services-grid, .contact-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
}
.gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card {
  padding: clamp(1.1rem, 3vw, 1.75rem);
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--surface);
}
.card a { font-weight: 650; overflow-wrap: anywhere; }
.service-icon { display: block; margin-bottom: 0.75rem; font-size: 1.75rem; }

.comparison {
  --split: 50%;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  aspect-ratio: 4 / 3;
  border-radius: 1rem;
  background: var(--surface);
}
.comparison img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.comparison .before { clip-path: inset(0 calc(100% - var(--split)) 0 0); }
.comparison .label {
  position: absolute;
  top: 0.75rem;
  padding: 0.25rem 0.65rem;
  border-radius: 0.4rem;
  background: #152827;
  color: #fff;
  font-size: 0.875rem;
}
.label-before { left: 0.75rem; }
.label-after { right: 0.75rem; }

.divider {
  position: absolute;
  inset-block: 0;
  left: var(--split);
  width: 2px;
  transform: translateX(-50%);
  background: #fff;
  box-shadow: 0 0 4px #172c2c;
  pointer-events: none;
}
.js .divider::after {
  content: "↔";
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  transform: translate(-50%, -50%);
  border: 2px solid #fff;
  border-radius: 50%;
  background: #153d39;
  color: #fff;
  font-size: 1.25rem;
}
.comparison input {
  appearance: none;
  position: absolute;
  top: 50%;
  left: -1.375rem;
  width: calc(100% + 2.75rem);
  height: 2.75rem;
  margin: 0;
  transform: translateY(-50%);
  opacity: 0;
  cursor: ew-resize;
  touch-action: pan-y;
}
.comparison input::-webkit-slider-thumb { appearance: none; width: 2.75rem; height: 2.75rem; }
.comparison input::-moz-range-thumb { width: 2.75rem; height: 2.75rem; border: 0; }
.comparison:focus-within { outline: 3px solid var(--accent); outline-offset: 4px; }
html:not(.js) .gallery-help { display: none; }

.about-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(8rem, 15rem);
  align-items: center;
  gap: 2rem;
}
.about-content p + p { margin-top: 0.8rem; }
.about-logo { width: 100%; height: auto; border-radius: 1rem; }

footer {
  padding: 1.75rem 1rem;
  border-top: 1px solid var(--border);
  text-align: center;
}

@media (max-width: 44rem) {
  .nav { flex-wrap: wrap; }
  .brand img { width: 2rem; height: 2rem; }
  .js .menu-toggle { display: block; }
  .nav-links {
    order: 1;
    flex-basis: 100%;
    flex-wrap: wrap;
    padding-bottom: 0.5rem;
  }
  .js .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    max-height: calc(100dvh - 4.5rem);
    overflow: auto;
    padding: 0.4rem 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
  }
  .js .menu-toggle[aria-expanded="true"] + .nav-links { display: block; }
  .js .nav-links a { padding-inline: 0.75rem; }
  html:not(.js) .site-header { position: static; }
  .gallery-grid, .about-content { grid-template-columns: 1fr; }
  .about-logo { max-width: 10rem; }
}

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