/* style.css */

/* ================= RESET ================= */
*{ margin:0; padding:0; box-sizing:border-box; }

html{ scroll-behavior:smooth; }

body{
  font-family:'JetBrains Mono', monospace;
  color:#111;
  cursor:none; /* custom cursor */
}

/* ================= BACKGROUND ================= */
.background{
  position:fixed;
  inset:0;
  background:url("pozadina.webp") center center / cover no-repeat;
  z-index:-2;
}
.background::after{
  content:"";
  position:absolute;
  inset:0;
  background:rgba(0,0,0,0.10);
}

/* ================= CUSTOM CURSOR ================= */
.cursor-dot{
  position:fixed;
  left:0; top:0;
  width:10px; height:10px;
  border-radius:50%;
  background:#000;
  z-index:2000;
  pointer-events:none;
  transform:translate(-50%,-50%);
}
.cursor-trail{
  position:fixed;
  inset:0;
  pointer-events:none;
  z-index:1999;
}
.spark{
  position:absolute;
  width:6px; height:6px;
  border-radius:50%;
  background:#A32424;
  opacity:0.9;
  transform:translate(-50%,-50%);
  animation:spark 520ms ease-out forwards;
}
@keyframes spark{
  0%{
    opacity:0.95;
    transform:translate(-50%,-50%) scale(var(--s,1));
    filter:blur(0px);
  }
  100%{
    opacity:0;
    transform:translate(calc(-50% + var(--dx,0px)), calc(-50% + var(--dy,0px))) scale(0.2);
    filter:blur(1px);
  }
}

/* ================= HERO ================= */
.hero{
  height:100vh;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  gap:34px;
}
.logo{
  width:560px;               /* povećano */
  max-width:min(85vw, 620px);
}

/* ================= BUTTONS ================= */
.buttons{
  display:flex;
  gap:22px;
  flex-wrap:wrap;
  justify-content:center;
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:16px 42px;         /* povećano */
  font-size:15px;
  letter-spacing:1px;
  text-decoration:none;
  border-radius:10px;
  transition:transform .22s ease, background .22s ease, border-color .22s ease, box-shadow .22s ease;
  border:1px solid transparent;
  user-select:none;
  cursor:none;
}

.btn:active{ transform:translateY(0px) scale(0.99); }

.btn-ghost{
  background:rgba(255,255,255,0.25);
  backdrop-filter:blur(8px);
  border-color:rgba(0,0,0,0.20);
  color:#111;
}
.btn-ghost:hover{
  background:rgba(255,255,255,0.45);
  transform:translateY(-2px);
  box-shadow:0 12px 30px rgba(0,0,0,0.12);
}

.btn-primary{
  background:#A32424;
  color:#fff;
  border-color:#A32424;
}
.btn-primary:hover{
  background:#7F1B1B;
  border-color:#7F1B1B;
  transform:translateY(-2px);
  box-shadow:0 12px 30px rgba(0,0,0,0.12);
}

/* ================= SECTIONS ================= */
.section{
  min-height:auto;            /* malo manje od 100vh */
  padding:70px 80px;          /* manji razmak između blokova */
  display:flex;
  flex-direction:column;
  align-items:center;
  text-align:center;
}
.section h2{
  font-size:34px;
  margin-bottom:30px;         /* malo manje */
  letter-spacing:1px;
}

/* ================= EDITOR WINDOW ================= */
.editor-window{
  width:100%;
  max-width:1100px;
  margin:44px auto 0 auto;    /* manje */
  border-radius:16px;
  background:rgba(255,255,255,0.62);
  border:1px solid rgba(0,0,0,0.10);
  backdrop-filter:blur(14px);
  box-shadow:0 25px 60px rgba(0,0,0,0.15);
  overflow:hidden;
}
.editor-header{
  display:flex;
  align-items:center;
  gap:8px;
  padding:14px 18px;
  background:rgba(255,255,255,0.82);
  border-bottom:1px solid rgba(0,0,0,0.08);
}
.dot{ width:10px; height:10px; border-radius:50%; }
.dot.red{ background:#ff5f57; }
.dot.yellow{ background:#febc2e; }
.dot.green{ background:#28c840; }

.file-name{
  margin-left:12px;
  font-size:13px;
  color:rgba(0,0,0,0.60);
}

.editor-body{
  padding:38px 56px;
  font-size:18px;
  line-height:2;
  color:#1a1a1a;
  text-align:left;
}

.code-pre{
  margin:0;
  white-space:pre-wrap;
}

/* ================= CODE COLORS (syntax highlight) ================= */
.code{ display:inline; }
.tok.kw{ color:#8b5cf6; font-weight:700; }
.tok.str{ color:#0f766e; }
.tok.num{ color:#b45309; }
.tok.id{ color:#111; }
.tok.op{ color:#374151; }
.ws{ white-space:pre-wrap; }

/* ================= CURSOR BLINK ================= */
.cursor{
  display:inline-block;
  margin-left:4px;
  animation:blink 1s infinite;
}
@keyframes blink{
  0%,50%,100%{ opacity:1; }
  25%,75%{ opacity:0; }
}

/* ================= BACK TO TOP ================= */
#backToTop{
  position:fixed;
  bottom:30px;
  right:30px;
  width:56px;
  height:56px;
  border-radius:50%;
  border:none;
  background:#A32424;
  color:white;
  font-size:22px;
  display:flex;
  align-items:center;
  justify-content:center;
  opacity:0;
  visibility:hidden;
  transition:.25s ease;
  box-shadow:0 10px 26px rgba(0,0,0,0.18);
  z-index:1200;
  cursor:none;
}
#backToTop.show{
  opacity:1;
  visibility:visible;
}

/* ================= MAIL BUTTON ================= */
.mail-float{
  position:fixed;
  left:auto;
  width:56px;
  height:56px;
  border-radius:50%;
  background:#A32424;
  color:white;
  font-size:22px;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:0 10px 26px rgba(0,0,0,0.18);
  transition:.22s ease;
  z-index:1200;
  cursor:none;
}
.mail-float:hover{
  transform:scale(1.06);
  background:#7F1B1B;
}

/* ================= POPUP ================= */
.mail-popup{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,0.22);
  backdrop-filter:blur(7px);
  display:flex;
  align-items:center;
  justify-content:center;
  opacity:0;
  visibility:hidden;
  transition:.22s ease;
  z-index:1300;
}
.mail-popup.show{
  opacity:1;
  visibility:visible;
}
.popup-window{
  width:100%;
  max-width:620px;
  border-radius:16px;
  background:rgba(255,255,255,0.92);
  border:1px solid rgba(0,0,0,0.10);
  backdrop-filter:blur(16px);
  box-shadow:0 30px 80px rgba(0,0,0,0.22);
  overflow:hidden;
}
.popup-close{
  margin-left:auto;
  background:transparent;
  border:none;
  font-size:24px;
  line-height:1;
  color:rgba(0,0,0,0.55);
  cursor:none;
  padding:0 8px;
}
.popup-close:hover{ color:rgba(0,0,0,0.85); }

.copy-btn{
  margin-top:18px;
  padding:14px 42px;          /* isti osjećaj kao sekundarni */
}

/* ================= CARDS GRID (references + analyses) ================= */
.cards-grid{
  width:100%;
  max-width:1400px;
  margin-top:54px;
  display:grid;
  gap:34px;
}
.cards-grid--4{
  grid-template-columns:repeat(4, 1fr);
}
.cards-grid--small{
  max-width:1250px;
  gap:26px;
}

/* Base card */
.card{
  border:none;
  width:100%;
  border-radius:18px;
  background:rgba(255,255,255,0.55);
  border:1px solid rgba(0,0,0,0.10);
  backdrop-filter:blur(14px);
  box-shadow:0 22px 55px rgba(0,0,0,0.14);
  transition:transform .22s ease, box-shadow .22s ease, background .22s ease, border-color .22s ease;
  cursor:none;
  padding:0;
  text-align:left;
}
.card:hover{
  transform:translateY(-4px);
  background:rgba(255,255,255,0.70);
  border-color:rgba(0,0,0,0.14);
  box-shadow:0 28px 70px rgba(0,0,0,0.16);
}

/* Media card (reference) */
.card--media{
  display:flex;
  flex-direction:column;
  align-items:center;
  padding:22px 18px 18px 18px;
}
.card--media img{
  width:100%;
  height:220px;
  object-fit:contain;
  filter:grayscale(100%);
  transition:filter .22s ease, transform .22s ease;
}
.card--media:hover img{
  filter:grayscale(0%);
  transform:scale(1.03);
}
.card-label{
  margin-top:14px;
  font-size:14px;
  height:20px;
  color:#111;
  opacity:0.95;
}

/* Pill card (analyses) */
.card--pill{
  padding:22px 22px 20px 22px;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.pill-title{
  font-size:16px;
  font-weight:700;
  letter-spacing:0.5px;
  min-height:22px;
}
.pill-sub{
  font-size:13px;
  color:rgba(0,0,0,0.62);
}

/* ================= TOOLS GRID ================= */
.tools-row{
  display:grid;
  grid-template-columns:repeat(8, 1fr);
  gap:56px;
  margin-top:56px;
  max-width:1300px;
  width:100%;
}
.tool{
  display:flex;
  flex-direction:column;
  align-items:center;
  cursor:none;
}
.tool img{
  height:88px;
  max-width:120px;
  object-fit:contain;
  transition:.22s ease;
  filter:grayscale(100%);
}
.tool:hover img{
  transform:scale(1.14);
  filter:grayscale(0%);
}
.tool-name{
  margin-top:16px;
  font-size:14px;
  height:20px;
}

/* ================= LIGHTBOX ================= */
.lightbox{
  position:fixed;
  inset:0;
  background:rgba(254, 254, 254, 0.92);
  display:flex;
  align-items:center;
  justify-content:center;
  opacity:0;
  visibility:hidden;
  transition:.25s ease;
  z-index:2000;
}

.lightbox.show{
  opacity:1;
  visibility:visible;
}

.lightbox-inner{
  width:100vw;
  height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
}

.lightbox img{
  max-width:95vw;
  max-height:95vh;
  width:auto;
  height:auto;
  padding:0;
  border-radius:0;
  background:transparent;
  box-shadow:none;
}
.lightbox-close{
  position:absolute;
  top:30px;
  right:40px;
  width:50px;
  height:50px;
  border-radius:50%;
  background:rgba(0,0,0,0.08);
  backdrop-filter:blur(6px);
  border:1px solid rgba(0,0,0,0.2);
  color:#111;                 /* ← promjena */
  font-size:28px;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:none;
  z-index:2100;
  transition:transform .2s ease, opacity .2s ease;
}

.lightbox-close:hover{
  transform:scale(1.15);
  opacity:0.7;
}

/* ================= RESPONSIVE ================= */
@media (max-width:1200px){
  .cards-grid--4{ grid-template-columns:repeat(2, 1fr); }
  .tools-row{ grid-template-columns:repeat(4, 1fr); }
  .editor-body{ padding:34px 40px; }
  .section{ padding:84px 42px; }
}

@media (max-width:680px){
  .logo{ width:min(88vw, 520px); }
  .cards-grid--4{ grid-template-columns:1fr; }
  .tools-row{ grid-template-columns:repeat(2, 1fr); gap:34px; }
  .editor-body{ padding:28px 22px; font-size:16px; }
  .btn{ padding:14px 28px; }
}
/* ===== FLOAT BUTTONS CLEAN ===== */

.mail-float{
  position: fixed;
  left: 30px;     /* lijeva strana */
  right: auto;
  z-index: 1200;
}

/* jednak razmak 80px */
#mailBtn  { bottom: 30px; }
#instaBtn { bottom: 110px; }
#fbBtn    { bottom: 190px; }
#infoBtn  { bottom: 270px; }

#matrixCanvas{
  position:fixed;
  inset:0;
  z-index:-1;       /* MORA biti -1 */
  pointer-events:none;
  opacity:0.12;
  filter:blur(0.2px);
}
/* ===== SCROLL PROGRESS ===== */

#scrollProgress{
  position:fixed;
  top:0;
  left:0;
  height:6px;
  width:0%;
  background:#A32424;
  z-index:9999;
}