/* Amag-Rapid — main stylesheet */

:root {
  /* Palette: #707068, #91918f, black — mostly white, neutral (no tinted “dirty” base) */
  --color-white: #ffffff;
  --color-bg: #f6f6f6;
  --color-surface: #ffffff;
  --color-text: #707068;
  --color-text-muted: #91918f;
  --color-black: #0a0a0a;
  --color-accent: #707068;
  --color-accent-hover: #5a5a52;
  --color-on-accent: #ffffff;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
  --header-h: 5.5rem;
  --footer-h: 2.75rem;
  --max-w: 72rem;
  --radius: 0.5rem;
  --shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
  --border-subtle: rgba(0, 0, 0, 0.09);
}

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

html {
  scroll-behavior: smooth;
  color-scheme: light;
  scroll-padding-top: var(--header-h);
}

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

  html.about-page {
    scroll-snap-type: none;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  display: flex;
  flex-direction: column;
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
}

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

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

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

img {
  max-width: 100%;
  height: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: grid;
  /* Equal side columns so the auto (nav) column sits on the true viewport center */
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem 1rem;
  min-height: var(--header-h);
  padding: 0.35rem 1.25rem;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}

.site-logo {
  grid-column: 1;
  justify-self: start;
  display: flex;
  align-items: center;
  line-height: 0;
  text-decoration: none;
  color: inherit;
}



.site-nav {
  grid-column: 2;
  justify-self: center;
}

.site-logo:hover {
  text-decoration: none;
  opacity: 0.85;
}

.site-logo:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
  border-radius: 0.25rem;
}

.site-logo__img {
  display: block;
  height: 4.5rem;
  width: auto;
  max-width: min(22rem, 88vw);
  object-fit: contain;
  object-position: center;
}

@media (max-width: 420px) {
  .site-logo__img {
    height: 3.5rem;
    max-width: min(17rem, 78vw);
  }
}

.nav-toggle {
  grid-column: 3;
  justify-self: end;
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  background: var(--color-white);
  color: var(--color-black);
  cursor: pointer;
}

.nav-toggle:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.nav-toggle-icon {
  display: block;
  width: 1.25rem;
  height: 2px;
  background: currentColor;
  box-shadow: 0 -6px 0 currentColor, 0 6px 0 currentColor;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  font-weight: 600;
  color: var(--color-text-muted);
  text-decoration: none;
}

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

.site-nav a[aria-current="page"] {
  color: var(--color-black);
}

@media (max-width: 640px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .site-logo {
    grid-column: 1;
  }

  .nav-toggle {
    grid-column: 2;
    display: flex;
  }

  .site-nav {
    grid-column: 1 / -1;
    justify-self: stretch;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    padding: 1rem 1.25rem 1.25rem;
    background: var(--color-white);
    border-bottom: 1px solid var(--border-subtle);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
    visibility: hidden;
    opacity: 0;
    transform: translateY(-0.5rem);
    transition: opacity 0.2s ease, visibility 0.2s, transform 0.2s ease;
  }

  .site-nav.is-open {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
  }

  .site-nav ul {
    flex-direction: column;
    gap: 0.75rem;
  }
}

main {
  flex: 1 0 auto;
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

main.main--landing {
  max-width: none;
  margin: 0;
  padding: 0;
}

main.main--subpage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  max-width: none;
  margin: 0;
  padding: 0;
  width: 100%;
}

.main__constrain {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
  width: 100%;
}

/* Usluge / Kontakt: one viewport band, content in left white column */
.home-hero--subpage {
  flex: 1 1 auto;
  min-height: 0;
  height: calc(100dvh - var(--header-h) - var(--footer-h));
  max-height: calc(100dvh - var(--header-h) - var(--footer-h));
}

.home-hero__content--dense {
  justify-content: flex-start;
  align-items: stretch;
  gap: 0.1rem;
  padding: 0.55rem clamp(0.85rem, 2.5vw, 1.35rem) 0.65rem;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.home-hero__content .page-hero--in-split {
  margin-bottom: 0;
}

.page-hero--compact .lead {
  max-width: none;
}

.home-hero__content--dense .page-hero--compact h1 {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  margin: 0 0 0.04rem;
}

.home-hero__content--dense .page-hero--compact .lead {
  font-size: 1.05rem;
  line-height: 1.34;
}

.service-grid--split {
  margin-top: 0.04rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.16rem 0.22rem;
  align-content: start;
}

.home-hero__content--dense .service-card {
  padding: 0.85rem 1rem;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.06),
    0 6px 20px rgba(0, 0, 0, 0.1);
}

.home-hero__content--dense .service-card h2 {
  font-size: 1.02rem;
  margin: 0 0 0.06rem;
  line-height: 1.22;
}

.home-hero__content--dense .service-card p {
  font-size: 0.92rem;
  line-height: 1.32;
}

.home-hero__content--dense .contact-block {
  padding: 0.9rem 1.05rem;
}

.home-hero__content--dense .contact-block h2 {
  font-size: 1.08rem;
  margin: 0 0 0.12rem;
}

.contact-list--compact li {
  margin-bottom: 0.1rem;
  font-size: 0.92rem;
  line-height: 1.34;
}

.contact-list--compact li:last-child {
  margin-bottom: 0;
}

.map-embed--compact {
  min-height: 0;
  margin-top: 0.04rem;
}

.map-embed--compact iframe {
  height: 9.5rem;
  min-height: 8rem;
}

.map-external-link--compact {
  margin: 0.1rem 0 0;
  font-size: 0.92rem;
}

@media (max-width: 768px) {
  .home-hero--subpage {
    height: auto;
    max-height: none;
    min-height: 0;
    flex: none;
  }

  main.main--subpage {
    flex: none;
    min-height: auto;
  }

  .home-hero__content--dense {
    overflow-y: visible;
  }

  .home-hero--subpage .home-hero__visual {
    min-height: 32vh;
  }

  .service-grid--split {
    grid-template-columns: 1fr;
  }

  .home-hero__content--dense .service-card p {
    font-size: 0.96rem;
  }
}

.page-hero {
  margin-bottom: 2.5rem;
}

.page-hero h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--color-black);
}

.page-hero .lead {
  margin: 0;
  font-size: 1.125rem;
  color: var(--color-text-muted);
  max-width: 42ch;
}

.prose {
  max-width: 65ch;
}

.prose h2 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  font-size: 1.35rem;
  color: var(--color-black);
}

.prose p {
  margin: 0 0 1rem;
  color: var(--color-text-muted);
}

.prose p:last-child {
  margin-bottom: 0;
}

/* ——— Timeline (About) ——— viewport scroll-snap on html.about-page ——— */
html.about-page {
  scroll-snap-type: y mandatory;
}

.timeline-panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  padding: calc(var(--header-h) + 1rem) 1.25rem 2rem;
  background-color: #707068;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

/* Na užim ekranima (telefon) pomeri kadar ulevo za ove fotke */
@media (max-width: 768px) {
  .timeline-panel--bg-left-phone {
    background-position: left center;
  }
}

/* Jedna sekcija, dve diplome kao pozadina (podela ekrana / složeno na mobilnom) */
.timeline-panel.timeline-panel--diplomas-bg {
  background-color: #4a4845;
  background-image:
    url("../images/history/diplomas_1.jpeg"),
    url("../images/history/diplomas_2.jpeg");
  background-size: 50% 100%, 50% 100%;
  background-position: left center, right center;
  background-repeat: no-repeat, no-repeat;
}

@media (max-width: 768px) {
  .timeline-panel.timeline-panel--diplomas-bg {
    background-size: 100% 50%, 100% 50%;
    background-position: center top, center bottom;
  }
}

.timeline-year--range {
  font-size: clamp(2rem, 9vw, 4.5rem);
  letter-spacing: -0.03em;
}

.timeline-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  /* Black + brand gray for readable white type on photos */
  background: radial-gradient(
    ellipse 85% 75% at 50% 45%,
    rgba(112, 112, 104, 0.45) 0%,
    rgba(10, 10, 10, 0.65) 55%,
    rgba(10, 10, 10, 0.82) 100%
  );
  pointer-events: none;
}

.timeline-panel__inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
}

.timeline-year {
  display: block;
  margin-bottom: 0.5rem;
  font-size: clamp(3rem, 12vw, 6rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--color-white);
}

/* Scroll-driven fade-in only where supported; base state stays visible (fixes file:// and older browsers). */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .timeline-year {
      opacity: 0;
      transform: translateY(1.5rem);
      animation: timeline-year-in linear both;
      animation-timeline: view();
      animation-range: entry 10% cover 40%;
    }

    .timeline-body {
      opacity: 0;
      transform: translateY(0.75rem);
      animation: timeline-body-in linear both;
      animation-timeline: view();
      animation-range: entry 15% cover 45%;
    }
  }
}

@keyframes timeline-year-in {
  from {
    opacity: 0;
    transform: translateY(1.5rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes timeline-body-in {
  from {
    opacity: 0;
    transform: translateY(0.75rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.timeline-body {
  max-width: 40rem;
  margin: 0;
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.95);
}

@media (prefers-reduced-motion: reduce) {
  .timeline-year,
  .timeline-body {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }
}

.about-intro {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.about-intro h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  color: var(--color-black);
}

.about-intro .lead {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 1.1rem;
}

/* ——— Services ——— */
.service-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  margin-top: 2rem;
}

.service-card {
  padding: 1.5rem;
  background: var(--color-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.service-card h2 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  color: var(--color-black);
}

.service-card p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--color-text-muted);
}

/* ——— Contact ——— */
.contact-layout {
  display: grid;
  gap: 2rem;
  margin-top: 2rem;
}

@media (min-width: 768px) {
  .contact-layout {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

/* Override two-column .contact-layout on Kontakt split hero: single column, full-width cards */
.contact-layout.contact-layout--split {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.1rem;
  margin-top: 0.06rem;
  width: 100%;
}

.contact-layout.contact-layout--split > .contact-block {
  width: 100%;
  max-width: 100%;
}

@media (min-width: 769px) {
  .contact-layout.contact-layout--split .map-embed--compact iframe {
    height: 14.5rem;
    min-height: 13rem;
  }
}

.contact-block {
  padding: 1.5rem;
  background: var(--color-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
}

.contact-block h2 {
  margin: 0 0 1rem;
  font-size: 1.15rem;
  color: var(--color-black);
}

.contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.contact-list li {
  margin-bottom: 0.75rem;
  color: var(--color-text-muted);
}

.contact-list strong {
  color: var(--color-black);
}

.contact-list a {
  font-weight: 600;
}

.contact-block--map .map-embed {
  margin-top: 0.25rem;
}

.map-external-link {
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
}

.map-external-link a {
  font-weight: 600;
}

.btn {
  display: inline-block;
  padding: 0.65rem 1.25rem;
  font: inherit;
  font-weight: 700;
  color: var(--color-on-accent);
  background: var(--color-accent);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
}

.btn:hover {
  background: var(--color-accent-hover);
  color: var(--color-on-accent);
}

.btn:focus-visible {
  outline: 2px solid var(--color-accent-hover);
  outline-offset: 2px;
}

.map-embed {
  position: relative;
  width: 100%;
  min-height: 14rem;
  margin-top: 0.5rem;
  border: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--color-bg);
}

.map-embed iframe {
  display: block;
  width: 100%;
  height: min(22rem, 50vh);
  min-height: 16rem;
  border: 0;
}

/* ——— Home / landing ———
   ~1/3 solid white (copy), ~2/3 photo with fade from white at the join ——— */
.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  min-height: calc(100dvh - var(--header-h));
  margin: 0;
  padding: 0;
  align-items: stretch;
}

.home-hero__content {
  background: var(--color-white);
  padding: 2rem clamp(1.25rem, 4vw, 2.75rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  min-width: 0;
}

.home-hero__visual {
  position: relative;
  min-height: 100%;
  background-color: #cfcfcc;
  background-image: url("../images/landing_background.jpeg");
  background-size: cover;
  background-position: center left;
}

.home-hero__visual::before {
  content: "";
  position: absolute;
  inset: 0;
  /* White at the seam → image visible toward the right */
  background: linear-gradient(
    90deg,
    #ffffff 0%,
    rgba(255, 255, 255, 0.88) 8%,
    rgba(255, 255, 255, 0.4) 28%,
    rgba(255, 255, 255, 0.08) 52%,
    rgba(255, 255, 255, 0) 72%
  );
  pointer-events: none;
}

@media (max-width: 768px) {
  .home-hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .home-hero__content {
    padding: 2rem 1.25rem 2.5rem;
    order: 1;
  }

  .home-hero__visual {
    order: 2;
    min-height: 42vh;
    background-position: center 35%;
  }

  .home-hero__visual::before {
    background: linear-gradient(
      180deg,
      #ffffff 0%,
      rgba(255, 255, 255, 0.75) 18%,
      rgba(255, 255, 255, 0.12) 45%,
      rgba(255, 255, 255, 0) 70%
    );
  }
}

.home-hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 6vw, 3.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--color-black);
}

.home-hero .tagline {
  margin: 0 0 2rem;
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  font-weight: 500;
  color: var(--color-text-muted);
  max-width: 36ch;
  line-height: 1.55;
}

.home-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
}

.btn-outline {
  background: transparent;
  color: var(--color-black);
  border: 2px solid var(--color-black);
}

.btn-outline:hover {
  background: var(--color-black);
  color: var(--color-on-accent);
}

.site-footer {
  margin-top: auto;
  padding: 0.65rem 1rem 0.85rem;
  text-align: center;
  font-size: 0.7rem;
  color: #b5b5b3;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.site-footer p {
  margin: 0;
  opacity: 0.85;
}
