/* ArhiMAX portfolio — minimalist / clean */
:root {
  --bg: #ffffff;
  --ink: #111111;
  --muted: #6b6b6b;
  --line: #ececec;
  --accent: #e30613; /* ArhiMAX red */
  --max-w: 1200px;
  --gap: 20px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; text-decoration: none; }

.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.brand img { height: 30px; width: auto; }

.nav {
  display: flex;
  gap: 34px;
  align-items: center;
}
.nav a {
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  position: relative;
  padding: 6px 0;
  transition: color 0.2s ease;
}
.nav a:hover { color: var(--ink); }
.nav a.active { color: var(--ink); }
.nav a.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--accent);
}

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  gap: 5px;
}
.nav-toggle span {
  width: 24px; height: 2px; background: var(--ink);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* ---------- Hero / page intro ---------- */
.page-intro {
  text-align: center;
  padding: 72px 0 40px;
}
.page-intro .eyebrow {
  font-size: 13px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  max-width: none;
  margin: 0 0 14px;
}
.page-intro h1 {
  font-size: clamp(30px, 5vw, 48px);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
}
.page-intro p {
  max-width: 620px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 17px;
}

/* ---------- Gallery grid ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
  padding: 20px 0 80px;
}

.card {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: #f4f4f4;
  border-radius: 2px;
  margin: 0;
}
.card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.2, 0.6, 0.2, 1),
              filter 0.5s ease, opacity 0.5s ease;
}

/* before/after: show "poslije" by default, reveal "prije" on hover / tap */
.card .img-before { opacity: 0; }
.card.has-compare:hover .img-before,
.card.has-compare:focus-within .img-before,
.card.has-compare.active .img-before { opacity: 1; }
.card-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px;
  background: rgba(17, 17, 17, 0);
  opacity: 0;
  transition: background 0.4s ease, opacity 0.4s ease;
}
.card-overlay .title {
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transform: translateY(8px);
  transition: transform 0.4s ease;
}
.card-overlay .loc {
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-top: 6px;
  transform: translateY(8px);
  transition: transform 0.4s ease 0.04s;
}

/* hover / tap: slight zoom + minimal blur + title pop-up */
.card:hover img,
.card:focus-visible img,
.card.active img {
  transform: scale(1.06);
  filter: blur(1.5px) brightness(0.85);
}
.card:hover .card-overlay,
.card:focus-visible .card-overlay,
.card.active .card-overlay {
  opacity: 1;
  background: rgba(17, 17, 17, 0.28);
}
.card:hover .card-overlay .title,
.card:hover .card-overlay .loc,
.card:focus-visible .card-overlay .title,
.card:focus-visible .card-overlay .loc,
.card.active .card-overlay .title,
.card.active .card-overlay .loc {
  transform: translateY(0);
}

.badge {
  position: absolute;
  top: 12px; left: 12px;
  z-index: 2;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 5px 9px;
  border-radius: 2px;
}

/* ---------- Reference list ---------- */
.ref-controls {
  display: flex;
  justify-content: center;
  margin: 10px 0 26px;
}
.ref-search {
  width: 100%;
  max-width: 420px;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 12px 16px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease;
}
.ref-search:focus { border-color: var(--accent); }

.ref-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 80px;
  font-size: 15px;
}
.ref-table thead th {
  text-align: left;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  padding: 12px 14px;
  border-bottom: 2px solid var(--ink);
}
.ref-table tbody td {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.ref-table tbody tr:hover { background: #fafafa; }
.ref-table .year { font-weight: 600; white-space: nowrap; width: 64px; }
.ref-table .place { color: var(--muted); white-space: nowrap; }
.ref-table .size { white-space: nowrap; color: var(--muted); }
.ref-table .status {
  white-space: nowrap;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}

/* ---------- Contact ---------- */
.contact-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  padding: 20px 0 90px;
}
.contact-portrait img {
  width: 100%;
  max-width: 380px;
  border-radius: 2px;
  margin: 0 auto;
}
.contact-info h2 {
  font-size: 26px;
  font-weight: 600;
  margin: 0 0 4px;
}
.contact-info .role {
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin: 0 0 28px;
}
.contact-list { list-style: none; padding: 0; margin: 0; }
.contact-list li {
  display: flex;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.contact-list .label {
  width: 90px;
  flex: none;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 2px;
}
.contact-list .value { font-size: 17px; }
.contact-list a:hover { color: var(--accent); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 40px 0;
  color: var(--muted);
  font-size: 13px;
}
.site-footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.site-footer a:hover { color: var(--accent); }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .nav {
    position: fixed;
    top: 72px; left: 0; right: 0;
    background: #fff;
    flex-direction: column;
    gap: 0;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
    transform: translateY(-140%);
    transition: transform 0.3s ease;
  }
  .nav.open { transform: translateY(0); }
  .nav a { padding: 14px 24px; width: 100%; text-align: center; }
  .nav a.active::after { display: none; }
  .nav-toggle { display: flex; }

  .contact-wrap { grid-template-columns: 1fr; gap: 34px; text-align: center; }
  .contact-portrait img { max-width: 260px; }
  .contact-list li { justify-content: center; }
  .contact-list .label { width: auto; }
}

@media (max-width: 640px) {
  /* mobile: single column with more breathing room */
  .gallery { grid-template-columns: 1fr; gap: 24px; padding: 30px 18px 70px; }
  .container { padding: 0 22px; }
  .page-intro { padding: 48px 0 28px; }
  .card { aspect-ratio: 3 / 2; }
  .card-overlay .title { font-size: 18px; }
  .card-overlay .loc { font-size: 12px; }

  .ref-table .size, .ref-table thead th.col-size { display: none; }
}
