/* ============================================================
   Matej Delić — Rijeka ↔ svijet
   Vlastiti dizajn: tamno "duboko more", cijan akcent podmorskog
   kabela, Fraunces (display) + Space Grotesk (tijelo) + IBM Plex
   Mono (tehnički detalji). Mobile-first, bez vanjskih biblioteka.
   ============================================================ */

:root {
  --bg: #05080f;
  --bg-soft: #0a1120;
  --surface: #0c1526;
  --surface-2: #0e1930;
  --line: rgba(146, 178, 226, 0.14);
  --line-strong: rgba(146, 178, 226, 0.26);
  --text: #e9f0fb;
  --muted: #93a6c2;
  --muted-2: #6d81a0;
  --accent: #3ee6c5;
  --accent-soft: rgba(62, 230, 197, 0.13);
  --accent-2: #4c8dff;
  --danger: #ff7a8a;

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Space Grotesk", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --radius: 18px;
  --radius-s: 12px;
  --header-h: 72px;
  --container: 1180px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 14px);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: rgba(62, 230, 197, 0.28); color: #fff; }

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

.mono { font-family: var(--font-mono); }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 20px;
}

/* ---------- Skip link + progress ---------- */
.skip-link {
  position: fixed;
  top: -60px;
  left: 16px;
  z-index: 200;
  background: var(--accent);
  color: #04121a;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 10px;
  transition: top 0.25s var(--ease);
}
.skip-link:focus { top: 12px; }

.scroll-progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  z-index: 120;
  opacity: 0.9;
}

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: rgba(5, 8, 15, 0.86);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--header-h);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 1.02rem;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.wordmark-mark { width: 30px; height: 30px; color: var(--accent); flex: none; }
.wordmark-text em { font-style: italic; font-weight: 400; color: var(--muted); }

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}
.site-nav a {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--muted);
  padding: 9px 14px;
  border-radius: 10px;
  transition: color 0.2s ease, background 0.2s ease;
}
.site-nav a:hover { color: var(--text); background: rgba(146, 178, 226, 0.08); }
.site-nav a[aria-current="true"] { color: var(--accent); }
.site-nav .nav-cta {
  color: var(--bg);
  background: var(--accent);
  font-weight: 600;
  margin-left: 6px;
}
.site-nav .nav-cta:hover { background: #5cf0d3; color: var(--bg); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  border-radius: 10px;
}
.nav-toggle span {
  height: 2px;
  width: 100%;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: 1rem;
  padding: 15px 30px;
  border-radius: 999px;
  transition: transform 0.25s var(--ease), box-shadow 0.25s ease, background 0.25s ease, border-color 0.25s ease;
  will-change: transform;
}
.btn-primary {
  background: var(--accent);
  color: #04121a;
  box-shadow: 0 8px 30px rgba(62, 230, 197, 0.22);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 40px rgba(62, 230, 197, 0.32);
}
.btn-ghost {
  border: 1px solid var(--line-strong);
  color: var(--text);
  background: rgba(10, 17, 32, 0.55);
}
.btn-ghost:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: calc(var(--header-h) + 40px) 0 96px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.55;
}
.hero-shade {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 90% at 50% 10%, rgba(5, 8, 15, 0.35) 0%, rgba(5, 8, 15, 0.72) 55%, var(--bg) 100%),
    linear-gradient(180deg, rgba(5, 8, 15, 0.55) 0%, rgba(5, 8, 15, 0.25) 40%, var(--bg) 96%);
}
.hero-cable {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.85;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 2;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 26px;
  padding: 9px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(10, 17, 32, 0.55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.hero-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(62, 230, 197, 0.55);
  animation: hero-dot 2.4s ease-out infinite;
}
@keyframes hero-dot {
  0% { box-shadow: 0 0 0 0 rgba(62, 230, 197, 0.5); }
  70% { box-shadow: 0 0 0 10px rgba(62, 230, 197, 0); }
  100% { box-shadow: 0 0 0 0 rgba(62, 230, 197, 0); }
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 560;
  font-variation-settings: "opsz" 60;
  font-size: clamp(2.7rem, 8.5vw, 5.2rem);
  line-height: 1.03;
  letter-spacing: -0.02em;
  text-wrap: balance;
  margin-bottom: 24px;
}
.hero-title em {
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}

.hero-sub {
  max-width: 62ch;
  font-size: clamp(1.02rem, 2.1vw, 1.16rem);
  color: var(--muted);
  margin-bottom: 36px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

.hero-tags {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 30px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  color: var(--muted-2);
}
.hero-tag-sep {
  width: 26px;
  height: 1px;
  background: var(--line-strong);
}

/* ---------- Sekcije ---------- */
.section {
  padding-block: clamp(4.5rem, 10vw, 7.5rem);
  position: relative;
}

.section-head {
  max-width: 760px;
  margin-bottom: clamp(2.2rem, 5vw, 3.4rem);
}
.section-head h2 {
  font-family: var(--font-display);
  font-weight: 560;
  font-variation-settings: "opsz" 60;
  font-size: clamp(1.9rem, 4.6vw, 3rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.section-head h2 em { font-style: italic; font-weight: 400; color: var(--accent); }
.section-eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}
.section-lede {
  color: var(--muted);
  margin-top: 18px;
  max-width: 58ch;
  font-size: 1.02rem;
}

/* ---------- Kartice "Što radim" ---------- */
.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}
.card {
  background: linear-gradient(180deg, var(--surface), var(--bg-soft));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 26px;
  display: flex;
  flex-direction: column;
  transition: transform 0.35s var(--ease), border-color 0.35s ease, box-shadow 0.35s ease;
  position: relative;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.35s ease;
}
.card:hover {
  transform: translateY(-5px);
  border-color: rgba(62, 230, 197, 0.4);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(62, 230, 197, 0.08);
}
.card:hover::before { opacity: 1; }

.card-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  margin-bottom: 20px;
}
.card-icon svg { width: 30px; height: 30px; }

.card h3 {
  font-family: var(--font-display);
  font-weight: 560;
  font-size: 1.32rem;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}
.card > p {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 18px;
}
.card ul {
  margin-top: auto;
  display: grid;
  gap: 9px;
  border-top: 1px dashed var(--line);
  padding-top: 16px;
}
.card ul li {
  font-size: 0.9rem;
  color: var(--text);
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.card ul li::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--accent);
  opacity: 0.85;
  transform: translateY(-1px);
}

/* ---------- Rijeka ↔ svijet ---------- */
.section-cable {
  border-block: 1px solid var(--line);
  background:
    radial-gradient(70% 60% at 20% 40%, rgba(62, 230, 197, 0.05), transparent 70%),
    linear-gradient(180deg, #070d1a, var(--bg));
}

.cable-map {
  position: relative;
  max-width: 960px;
  margin: 0 auto clamp(2.4rem, 6vw, 3.6rem);
  user-select: none;
}
.cable-map svg { width: 100%; height: auto; }

.map-contour { fill: none; stroke: rgba(122, 166, 232, 0.12); stroke-width: 1.5; }
.hero-contour { fill: none; stroke: rgba(122, 166, 232, 0.10); stroke-width: 1.5; }
.map-node {
  fill: var(--accent);
  stroke: rgba(62, 230, 197, 0.4);
  stroke-width: 2;
}

.map-label {
  position: absolute;
  transform: translate(-50%, -50%);
  font-size: clamp(0.58rem, 1.7vw, 0.8rem);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  text-align: center;
}
.map-label b { display: block; color: var(--text); font-weight: 600; font-size: 1.05em; }
.map-label i { display: block; font-style: normal; font-size: 0.82em; color: var(--muted-2); letter-spacing: 0.08em; }
.map-label-home { left: 8%; top: 66%; transform: translate(0, -50%); text-align: left; }
.map-label-eu { left: 83.3%; top: 15%; }
.map-label-na { left: 86%; top: 56%; }
.map-label-az { left: 83%; top: 85%; }

.cable-copy { max-width: 680px; }

.cable-facts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 26px;
}
.cable-facts li {
  font-size: 0.92rem;
  color: var(--muted);
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: rgba(10, 17, 32, 0.5);
}
.cable-facts .mono { color: var(--accent); }

/* ---------- "Zašto ja" ---------- */
.reasons {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  counter-reset: reason;
}
.reason {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
  padding: 28px 26px;
  position: relative;
  transition: border-color 0.3s ease, transform 0.3s var(--ease);
}
.reason:hover {
  border-color: rgba(62, 230, 197, 0.35);
  transform: translateY(-4px);
}
.reason-num {
  display: inline-block;
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  color: var(--accent);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
  margin-bottom: 18px;
}
.reason h3 {
  font-family: var(--font-display);
  font-weight: 560;
  font-size: 1.28rem;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}
.reason p { color: var(--muted); font-size: 0.95rem; }

/* ---------- Kontakt ---------- */
.section-contact {
  border-top: 1px solid var(--line);
  background:
    radial-gradient(80% 70% at 80% 20%, rgba(76, 141, 255, 0.06), transparent 70%),
    var(--bg);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2.2rem, 6vw, 4rem);
}

.contact-card {
  background: linear-gradient(180deg, var(--surface), var(--bg-soft));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(26px, 4vw, 40px);
  align-self: start;
}

.contact-label {
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.contact-email {
  font-family: var(--font-display);
  font-weight: 560;
  font-size: clamp(1.35rem, 4vw, 2rem);
  letter-spacing: -0.01em;
  color: var(--text);
  overflow-wrap: anywhere;
  transition: color 0.25s ease;
}
.contact-email:hover { color: var(--accent); }
.contact-note {
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: 14px;
  max-width: 40ch;
}

.contact-meta {
  margin-top: 30px;
  display: grid;
  gap: 0;
  border-top: 1px dashed var(--line);
}
.contact-meta > div {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px;
  padding-block: 14px;
  border-bottom: 1px dashed var(--line);
}
.contact-meta dt {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-2);
  padding-top: 3px;
}
.contact-meta dd { color: var(--text); font-size: 0.95rem; }

.contact-form {
  display: grid;
  gap: 18px;
  align-content: start;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}
.form-field { display: grid; gap: 8px; }
.form-field label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
}
.form-field input,
.form-field textarea {
  width: 100%;
  font: inherit;
  font-size: 0.98rem;
  color: var(--text);
  background: rgba(10, 17, 32, 0.75);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  padding: 14px 16px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  resize: vertical;
}
.form-field input::placeholder,
.form-field textarea::placeholder { color: var(--muted-2); }
.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(62, 230, 197, 0.12);
}
.form-field input:user-invalid,
.form-field textarea:user-invalid { border-color: var(--danger); }

.contact-form .btn { justify-self: start; }
.form-hint {
  font-size: 0.82rem;
  color: var(--muted-2);
}
.form-hint.sent { color: var(--accent); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 26px 0;
  background: #04070d;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
  font-size: 0.85rem;
  color: var(--muted-2);
}
.footer-inner .mono { letter-spacing: 0.1em; }
.footer-inner a:hover { color: var(--accent); }

/* ---------- Reveal animacije ---------- */
.js .reveal { opacity: 0; }
.js .reveal.in-view {
  animation: reveal-up 0.75s var(--ease) both;
  animation-delay: var(--d, 0s);
}
@keyframes reveal-up {
  from { opacity: 0; transform: translateY(26px); }
  to { opacity: 1; transform: none; }
}

/* ---------- SVG animacije kabela ---------- */
.cable-glow { fill: none; stroke: rgba(62, 230, 197, 0.10); stroke-width: 13; stroke-linecap: round; }
.cable-core { fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linecap: round; }
.cable-flow {
  fill: none;
  stroke: rgba(6, 20, 26, 0.9);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-dasharray: 4 15;
  animation: flow 2.6s linear infinite;
}
.flow-slow { animation-duration: 5.2s; stroke-width: 1.1; stroke-dasharray: 1 24; }
.cable-branch {
  fill: none;
  stroke: rgba(62, 230, 197, 0.45);
  stroke-width: 1.2;
  stroke-dasharray: 2 12;
  stroke-linecap: round;
  animation: flow 4.5s linear infinite;
}
@keyframes flow { to { stroke-dashoffset: -120; } }

.node-pulse {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  transform-origin: center;
  transform-box: fill-box;
  animation: node-pulse 2.8s ease-out infinite;
}
@keyframes node-pulse {
  0% { transform: scale(0.55); opacity: 0.9; }
  70% { transform: scale(1.6); opacity: 0.25; }
  100% { transform: scale(1.9); opacity: 0; }
}
.node-halo { fill: none; stroke: rgba(62, 230, 197, 0.35); stroke-width: 1; }
.node-core { fill: var(--accent); }

/* ---------- Veći ekrani ---------- */
@media (min-width: 640px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .cards .card:last-child { grid-column: 1 / -1; }
  .form-row { grid-template-columns: 1fr 1fr; }
  .cable-facts { grid-template-columns: repeat(3, 1fr); }
  .footer-inner { flex-direction: row; justify-content: space-between; align-items: center; }
}

@media (min-width: 900px) {
  .cards { grid-template-columns: repeat(3, 1fr); }
  .cards .card:last-child { grid-column: auto; }
  .reasons { grid-template-columns: repeat(3, 1fr); }
  .contact-grid { grid-template-columns: 1fr 1.1fr; }
  .section-cable .container {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: clamp(2rem, 5vw, 4rem);
    align-items: center;
  }
  .cable-map { margin: 0; }
}

/* ---------- Mobilni izbornik ---------- */
@media (max-width: 560px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: fixed;
    top: var(--header-h);
    right: 0;
    bottom: 0;
    width: min(78vw, 320px);
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 26px 20px;
    background: rgba(6, 10, 18, 0.97);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border-left: 1px solid var(--line);
    transform: translateX(105%);
    transition: transform 0.35s var(--ease);
  }
  .site-nav.nav-open { transform: translateX(0); }
  .site-nav a {
    font-size: 1.15rem;
    padding: 16px 12px;
    border-radius: 12px;
  }
  .site-nav .nav-cta { margin: 14px 0 0; text-align: center; }
  .hero-tags { bottom: 20px; gap: 8px; }
  .hero-tag-sep { width: 14px; }
}

@media (max-width: 480px) {
  .hero-eyebrow {
    font-size: 0.66rem;
    letter-spacing: 0.12em;
    padding: 8px 14px;
    max-width: 100%;
  }
  .hero-tags { font-size: 0.6rem; letter-spacing: 0.16em; }
}

@media (max-height: 620px) and (orientation: landscape) {
  .hero {
    min-height: auto;
    padding-top: calc(var(--header-h) + 20px);
    padding-bottom: 110px;
  }
  .hero-title { font-size: clamp(2.2rem, 6.5vw, 3.4rem); }
}

/* ---------- Smanjeno kretanje ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
}
