/* =====================================================================
   ADNICAKE — Design system
   Pravac: "tehnički crtež / blueprint" — inspirisano CAD viewportom,
   title-blokovima inženjerskih crteža i mjernim linijama.
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Sans+Condensed:wght@600;700&display=swap');

:root {
  /* Boje */
  --bg:          #0b1220;
  --bg-panel:    #111a2d;
  --bg-panel-2:  #16223a;
  --line:        #263957;
  --line-soft:   #1a2740;
  --ink:         #eef2f8;
  --ink-dim:     #9fb0c9;
  --ink-faint:   #64789a;
  --blue:        #5b9bd8;
  --blue-dim:    #2c4a6e;
  --accent:      #f2a900;
  --accent-ink:  #1a1200;
  --danger:      #e5636a;
  --ok:          #4fbf8a;

  /* Tipografija */
  --f-display: 'IBM Plex Sans Condensed', sans-serif;
  --f-body:    'IBM Plex Sans', sans-serif;
  --f-mono:    'IBM Plex Mono', monospace;

  --radius: 3px;
  --container: 1180px;
}

/* --------------------------- Reset --------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--accent); }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 700; margin: 0; color: var(--ink); }
p { margin: 0 0 1em; }
button { font-family: inherit; }

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

/* --------------------- Blueprint grid background --------------------- */
.blueprint-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.35;
  pointer-events: none;
}

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

/* ------------------------------ Top nav ------------------------------ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 18, 32, 0.9);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 68px;
  padding-top: 10px;
  padding-bottom: 10px;
  gap: 20px;
}

.brand {
  font-family: var(--f-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}
.brand em { color: var(--accent); font-style: italic; }

.main-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
  flex: 1;
  justify-content: flex-end;
}
.main-nav a {
  color: var(--ink-dim);
  font-size: 13.5px;
  font-family: var(--f-mono);
  padding: 8px 10px;
  border-radius: var(--radius);
  white-space: nowrap;
}
.main-nav a:hover, .main-nav a.active { color: var(--ink); background: var(--bg-panel-2); }
.main-nav a.active { color: var(--accent); }

.lang-menu {
  position: relative;
  flex: none;
  margin-left: auto;
  font-family: var(--f-mono);
  font-size: 13px;
}
.lang-menu-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  background: none;
  border: 1px solid var(--line);
  color: var(--ink-dim);
  padding: 0 12px;
  border-radius: var(--radius);
  cursor: pointer;
}
.lang-menu-toggle span:first-child { font-size: 13px; }
.lang-menu-current { font-weight: 600; color: var(--ink); }
.lang-menu-caret { font-size: 10px; color: var(--ink-faint); transition: transform 0.15s ease; }
.lang-menu-toggle:hover { border-color: var(--accent); }
.lang-menu.open .lang-menu-toggle { border-color: var(--accent); background: var(--bg-panel-2); }
.lang-menu.open .lang-menu-caret { transform: rotate(180deg); }

.lang-menu-list {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 160px;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  z-index: 60;
}
.lang-menu.open .lang-menu-list { display: block; }
.lang-menu-list a {
  display: block;
  padding: 11px 14px;
  color: var(--ink-dim);
  font-size: 13.5px;
  border-bottom: 1px solid var(--line-soft);
}
.lang-menu-list a:last-child { border-bottom: none; }
.lang-menu-list a:hover { background: var(--bg-panel-2); color: var(--ink); }
.lang-menu-list a[aria-current="true"] { color: var(--accent); }
.lang-menu-code { color: var(--ink-faint); margin-right: 4px; }
.lang-menu-list a[aria-current="true"] .lang-menu-code { color: var(--accent); }

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
}
.nav-toggle[aria-expanded="true"] {
  border-color: var(--accent);
  background: var(--bg-panel-2);
}
/* Hamburger -> X, nacrtan sa dvije CSS linije da se lakše animira */
.nav-toggle-icon,
.nav-toggle-icon::before,
.nav-toggle-icon::after {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  position: relative;
  transition: transform 0.18s ease, opacity 0.18s ease, background 0.18s ease;
}
.nav-toggle-icon::before, .nav-toggle-icon::after { content: ''; position: absolute; left: 0; }
.nav-toggle-icon::before { top: -6px; }
.nav-toggle-icon::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-icon { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-icon::before { top: 0; transform: rotate(45deg); background: var(--accent); }
.nav-toggle[aria-expanded="true"] .nav-toggle-icon::after { top: 0; transform: rotate(-45deg); background: var(--accent); }

/* -------------------------------- Hero -------------------------------- */
.hero {
  position: relative;
  padding: 90px 0 70px;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  cursor: crosshair;
}

.hero .container { position: relative; }

.hero-eyebrow {
  font-family: var(--f-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.hero-eyebrow::before,
.hero-eyebrow::after {
  content: '';
  display: inline-block;
  width: 28px;
  height: 1px;
  background: var(--blue-dim);
}

.hero h1 {
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.08;
  max-width: 16ch;
  letter-spacing: -0.01em;
}

.hero-lead {
  margin-top: 22px;
  max-width: 56ch;
  font-size: 18px;
  color: var(--ink-dim);
}

.hero-actions {
  display: flex;
  gap: 14px;
  margin-top: 32px;
  flex-wrap: wrap;
}

/* corner marks — viewfinder / technical drawing frame */
.hero-frame::before, .hero-frame::after,
.hero-frame-b::before, .hero-frame-b::after {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  border: 2px solid var(--blue-dim);
  opacity: 0.8;
}
.hero-frame::before { top: 18px; left: 18px; border-right: none; border-bottom: none; }
.hero-frame::after  { top: 18px; right: 18px; border-left: none; border-bottom: none; }
.hero-frame-b::before { bottom: 18px; left: 18px; border-right: none; border-top: none; }
.hero-frame-b::after  { bottom: 18px; right: 18px; border-left: none; border-top: none; }

/* CAD-style coordinate readout, follows cursor (desktop only, JS-driven) */
.coord-readout {
  position: absolute;
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--blue);
  background: rgba(17, 26, 45, 0.85);
  border: 1px solid var(--line);
  padding: 3px 8px;
  border-radius: var(--radius);
  pointer-events: none;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 5;
}
.coord-readout.visible { opacity: 1; }
.coord-crosshair-v, .coord-crosshair-h {
  position: absolute;
  background: var(--blue-dim);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 4;
}
.coord-crosshair-v { width: 1px; top: 0; bottom: 0; }
.coord-crosshair-h { height: 1px; left: 0; right: 0; }
.coord-crosshair-v.visible, .coord-crosshair-h.visible { opacity: 0.4; }

/* -------------------------- Title block (hero) -------------------------- */
.title-block {
  margin-top: 48px;
  display: inline-flex;
  flex-wrap: wrap;
  max-width: 100%;
  border: 1px solid var(--line);
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--ink-faint);
  background: var(--bg-panel);
}
.title-block div {
  padding: 8px 16px;
  border-right: 1px solid var(--line);
  white-space: nowrap;
}
.title-block div:last-child { border-right: none; }
.title-block span { display: block; color: var(--ink-dim); font-size: 13px; margin-top: 2px; }

/* ------------------------------ Sections ------------------------------ */
.section {
  padding: 80px 0;
  border-bottom: 1px solid var(--line);
}
.section:nth-of-type(even) { background: rgba(255,255,255,0.012); }

.section-eyebrow {
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--blue);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.section-eyebrow::after {
  content: '';
  flex: 1;
  max-width: 220px;
  height: 1px;
  background: var(--line);
}

.section h2 {
  font-size: clamp(26px, 3.4vw, 38px);
}

.section-lead {
  margin-top: 14px;
  max-width: 68ch;
  color: var(--ink-dim);
  font-size: 17px;
}

/* --------------------------- Sub-service cards --------------------------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 40px;
}

.spec-card {
  border: 1px solid var(--line);
  background: var(--bg-panel);
  padding: 22px;
  border-radius: var(--radius);
  position: relative;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.spec-card:hover { border-color: var(--blue-dim); transform: translateY(-2px); }

.spec-card .tag {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.06em;
  display: block;
  margin-bottom: 10px;
}
.spec-card h3 { font-size: 17px; margin-bottom: 8px; }
.spec-card p { color: var(--ink-dim); font-size: 14.5px; margin: 0; }

/* ------------------------------ Portfolio ------------------------------ */
.portfolio {
  margin-top: 56px;
  border-top: 1px dashed var(--line);
  padding-top: 40px;
}

.portfolio-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.portfolio-heading h3 {
  font-family: var(--f-mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  font-weight: 500;
}

.tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0;
  margin-bottom: 28px;
}
.tab-btn {
  font-family: var(--f-mono);
  font-size: 13.5px;
  background: none;
  border: none;
  color: var(--ink-faint);
  padding: 10px 4px;
  margin-right: 22px;
  cursor: pointer;
  position: relative;
  top: 1px;
}
.tab-btn .count {
  color: var(--ink-faint);
  font-size: 11px;
}
.tab-btn[aria-selected="true"] {
  color: var(--ink);
  border-bottom: 2px solid var(--accent);
}
.tab-btn:hover { color: var(--ink); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
}

.project-card {
  border: 1px solid var(--line);
  background: var(--bg-panel);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.project-card:hover { border-color: var(--accent); transform: translateY(-3px); }

.project-card .thumb {
  aspect-ratio: 16/10;
  background: var(--bg-panel-2)
    linear-gradient(135deg, transparent 0%, transparent 48%, var(--line) 48%, var(--line) 52%, transparent 52%);
  background-size: cover;
  background-position: center;
  border-bottom: 1px solid var(--line);
}

.project-card .body { padding: 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.project-card .featured-tag {
  font-family: var(--f-mono);
  font-size: 10.5px;
  color: var(--accent-ink);
  background: var(--accent);
  align-self: flex-start;
  padding: 2px 7px;
  border-radius: 2px;
  letter-spacing: 0.04em;
}
.project-card h4 { font-size: 17px; }
.project-card .summary { color: var(--ink-dim); font-size: 14px; flex: 1; }
.project-card .meta {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--ink-faint);
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--line-soft);
  padding-top: 10px;
  margin-top: 4px;
}
.project-card .more { font-family: var(--f-mono); font-size: 13px; color: var(--blue); }
.project-card .more:hover { color: var(--accent); }

.empty-state {
  border: 1px dashed var(--line);
  padding: 30px 22px;
  border-radius: var(--radius);
  color: var(--ink-faint);
  font-family: var(--f-mono);
  font-size: 13.5px;
  text-align: center;
}
.empty-state strong { color: var(--ink-dim); display: block; margin-bottom: 6px; font-family: var(--f-body); font-size: 15px; }

/* -------------------------------- Buttons -------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--f-mono);
  font-size: 14px;
  padding: 12px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn-primary:hover { background: #ffb821; color: var(--accent-ink); }
.btn-outline { background: transparent; color: var(--ink); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 7px 12px; font-size: 12.5px; }
.btn-danger { border-color: var(--danger); color: var(--danger); background: transparent; }
.btn-danger:hover { background: var(--danger); color: #1a0000; }

/* -------------------------------- Contact -------------------------------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-top: 32px;
}
.contact-block {
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--ink-faint);
}
.contact-block strong { display: block; color: var(--ink); font-family: var(--f-body); font-size: 16px; margin-bottom: 6px; }

/* -------------------------------- Footer -------------------------------- */
.site-footer {
  padding: 30px 0;
  font-family: var(--f-mono);
  font-size: 12.5px;
  color: var(--ink-faint);
}
.site-footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

/* ============================ Project detail ============================ */
.breadcrumb {
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--ink-faint);
  padding: 24px 0 0;
}
.breadcrumb a { color: var(--blue); }

.project-hero {
  padding: 24px 0 40px;
  border-bottom: 1px solid var(--line);
}
.project-hero h1 { font-size: clamp(28px, 4vw, 42px); max-width: 24ch; }
.project-hero .summary { margin-top: 16px; max-width: 62ch; color: var(--ink-dim); font-size: 17px; }

.info-block {
  margin-top: 30px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  border: 1px solid var(--line);
}
.info-block div {
  padding: 14px 18px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.info-block div:last-child { border-right: none; }
.info-block .k {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: block;
  margin-bottom: 4px;
}
.info-block .v { font-size: 14.5px; color: var(--ink); }

.tag-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-pill {
  font-family: var(--f-mono);
  font-size: 11.5px;
  border: 1px solid var(--blue-dim);
  color: var(--blue);
  padding: 2px 9px;
  border-radius: 20px;
}

.project-cover {
  margin-top: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.project-cover img { width: 100%; }

.project-body {
  max-width: 74ch;
  margin-top: 40px;
  font-size: 16.5px;
  color: var(--ink-dim);
}
.project-body p { margin-bottom: 1.3em; }

.gallery {
  margin-top: 44px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.gallery button {
  padding: 0; border: 1px solid var(--line); border-radius: var(--radius);
  background: none; cursor: zoom-in; overflow: hidden; aspect-ratio: 4/3;
}
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.2s ease; }
.gallery button:hover img { transform: scale(1.05); }

.lightbox {
  position: fixed; inset: 0; background: rgba(6,10,18,0.92);
  display: none; align-items: center; justify-content: center; z-index: 100; padding: 30px;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 90vw; max-height: 85vh; border: 1px solid var(--line); }
.lightbox-close {
  position: absolute; top: 24px; right: 28px; background: none; border: 1px solid var(--line);
  color: var(--ink); font-family: var(--f-mono); padding: 8px 14px; cursor: pointer; border-radius: var(--radius);
}

.related { padding: 60px 0 90px; }

.back-link { display: inline-block; margin-top: 40px; font-family: var(--f-mono); font-size: 14px; }

.not-found { padding: 100px 0; text-align: center; }
.not-found .code { font-family: var(--f-mono); color: var(--accent); font-size: 14px; letter-spacing: 0.1em; }
.not-found h1 { margin-top: 14px; }

/* -------------------------------- Responsive -------------------------------- */
html, body { overflow-x: hidden; }

@media (max-width: 860px) {
  .contact-grid { grid-template-columns: 1fr; }
}

/* Tableti i manji laptopi ulaze u hamburger meni ranije, prije nego se
   navigacija+prekidač jezika stisnu/prelome u jednom redu. */
@media (max-width: 1180px) {
  .main-nav {
    display: none;
  }
  .nav-toggle { display: inline-flex; }

  .site-header.nav-open .main-nav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    max-height: calc(100vh - 68px);
    overflow-y: auto;
    background: var(--bg-panel);
    padding: 8px 24px 20px;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
  }

  .site-header.nav-open .main-nav a {
    padding: 14px 6px;
    border-bottom: 1px solid var(--line-soft);
    border-radius: 0;
  }
}

@media (max-width: 640px) {
  .hero { padding: 56px 0 44px; }
  .hero-frame::before, .hero-frame::after,
  .hero-frame-b::before, .hero-frame-b::after { width: 16px; height: 16px; }
  .section { padding: 52px 0; }
  .title-block { flex-wrap: wrap; }
  .title-block div { flex: 1 1 50%; border-bottom: 1px solid var(--line); }
  .title-block div:nth-child(2n) { border-right: none; }
  .portfolio { margin-top: 40px; padding-top: 30px; }
  .tab-btn { padding: 12px 4px; }
}
