/* GraphFactory — graphfactory.eu */
:root {
  --navy: #1f516e;
  --navy-deep: #163b51;
  --green: #2eb87c;
  --green-soft: #e3f5ec;
  --ink: #1b2a33;
  --muted: #5b6b75;
  --line: #e2e8ec;
  --bg: #f6f8f9;
  --card: #ffffff;
  --radius: 14px;
  --font: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { display: block; max-width: 100%; }

#network {
  position: fixed; inset: 0; z-index: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}

.page {
  position: relative; z-index: 1;
  min-height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  grid-template-columns: minmax(0, 1fr);
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 clamp(16px, 3vw, 40px);
}

/* ---------- Header ---------- */
.top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: var(--navy);
  font-weight: 700; font-size: 1.6rem; letter-spacing: -0.01em;
}
.brand img { width: 88px; height: auto; }
.nav { display: flex; align-items: center; gap: 6px; }
.nav a {
  text-decoration: none; color: var(--navy);
  font-size: 0.92rem; font-weight: 500;
  padding: 8px 12px; border-radius: 999px;
}
.nav a:hover { background: var(--green-soft); }
.nav a[aria-current="page"] { background: var(--navy); color: #fff; }

.lang {
  display: inline-flex; border: 1px solid var(--line);
  background: var(--card); border-radius: 999px; padding: 3px; margin-left: 8px;
}
.lang a, .lang span {
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.04em;
  padding: 5px 11px; border-radius: 999px; text-decoration: none;
}
.lang span { background: var(--green); color: #fff; }
.lang a { color: var(--muted); }
.lang a:hover { color: var(--navy); background: var(--green-soft); }

/* ---------- Main grid ---------- */
.main {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  gap: clamp(12px, 1.6vw, 20px);
  padding: 8px 0 14px;
  min-height: 0;
}

.hero { grid-column: 1; grid-row: 1; padding: 4px 0 2px; }
.eyebrow {
  display: inline-block;
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--green);
  margin-bottom: 8px;
}
.hero h1 {
  color: var(--navy);
  font-size: clamp(1.6rem, 2.9vw, 2.6rem);
  line-height: 1.15; letter-spacing: -0.02em; font-weight: 700;
  max-width: 28ch;
}
.hero h1 em { font-style: normal; color: var(--green); }
.pillars {
  list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px;
}
.pillars li {
  font-size: 0.88rem; color: var(--navy);
  background: var(--card); border: 1px solid var(--line);
  padding: 6px 12px; border-radius: 999px;
}
.pillars li::before { content: "●"; color: var(--green); margin-right: 7px; font-size: 0.7em; vertical-align: 1px; }

.cards {
  grid-column: 1; grid-row: 2;
  display: grid; grid-template-columns: 0.85fr 1.25fr; gap: clamp(12px, 1.6vw, 20px);
  min-height: 0;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(14px, 1.6vw, 22px);
  display: flex; flex-direction: column; gap: 10px;
  min-height: 0;
  box-shadow: 0 1px 2px rgba(22, 59, 81, 0.04);
}
.card h2 {
  font-size: 1.02rem; color: var(--navy); font-weight: 600; line-height: 1.3;
}
.card p { font-size: 0.9rem; color: var(--muted); }
.card .figure {
  flex: 1 1 auto; min-height: 80px;
  border-radius: 10px; overflow: hidden; background: #0d1530;
}
.card .figure img { width: 100%; height: 100%; object-fit: cover; }
.link {
  font-size: 0.9rem; font-weight: 600; color: var(--navy);
  text-decoration: none; border-bottom: 2px solid var(--green);
  align-self: flex-start;
}
.link:hover { color: var(--green); }

.skills { list-style: none; display: flex; flex-direction: column; gap: 5px; }
.skills li {
  display: grid; grid-template-columns: 20px 1fr; gap: 8px; align-items: start;
  font-size: 0.86rem; color: var(--ink); line-height: 1.35;
}
.skills li::before {
  content: ""; width: 16px; height: 16px; margin-top: 1px; border-radius: 50%;
  background: var(--green-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8.3l2.3 2.2 4.7-5' fill='none' stroke='%232eb87c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/16px no-repeat;
}

/* ---------- SOV panel ---------- */
.sov {
  grid-column: 2; grid-row: 1 / span 2;
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-deep) 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: clamp(18px, 2vw, 28px);
  display: flex; flex-direction: column; gap: 12px;
  min-height: 0; position: relative; overflow: hidden;
}
.sov .tag {
  align-self: flex-start;
  font-size: 0.74rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  background: rgba(46, 184, 124, 0.18); color: #8fe3bd;
  padding: 4px 10px; border-radius: 999px;
}
.sov h2 {
  font-size: clamp(1.3rem, 2vw, 1.75rem); line-height: 1.2; letter-spacing: -0.01em;
}
.sov h2 small { display: block; font-size: 0.55em; font-weight: 500; color: #b9cfdc; letter-spacing: 0; margin-top: 4px; }
.sov .claim {
  font-size: 1.02rem; color: #fff; font-weight: 500;
  border-left: 3px solid var(--green); padding-left: 12px;
}
.sov p { font-size: 0.9rem; color: #cfdde6; }
.sov .figure {
  flex: 1 1 auto; min-height: 90px;
  border-radius: 10px; overflow: hidden; background: #f6f4ef;
}
.sov .figure img { width: 100%; height: 100%; object-fit: cover; object-position: 20% 50%; }
.sov .actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 0.9rem; text-decoration: none;
  padding: 10px 16px; border-radius: 999px;
}
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: #27a26c; }
.btn-ghost { color: #fff; border: 1px solid rgba(255,255,255,0.35); }
.btn-ghost:hover { background: rgba(255,255,255,0.08); }
.sov .mail { font-size: 0.82rem; color: #b9cfdc; }
.sov .mail a { color: #8fe3bd; }

/* ---------- Clients strip ---------- */
.trust {
  display: flex; align-items: center; gap: 18px;
  padding: 10px 0 8px;
  border-top: 1px solid var(--line);
}
.trust h3 {
  flex: none; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted);
}
.marquee {
  flex: 1; min-width: 0; overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.marquee-track {
  display: flex; gap: 36px; width: max-content;
  animation: slide 40s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee img { height: 42px; width: auto; object-fit: contain; filter: grayscale(0.15); }
@keyframes slide { to { transform: translateX(-50%); } }

.foot {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  font-size: 0.78rem; color: var(--muted);
  padding: 4px 0 12px;
}
.foot a { color: var(--navy); }

/* ---------- SOV page ---------- */
.sov-page .main {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  grid-template-rows: auto 1fr;
}
.sov-page .hero { grid-column: 1; grid-row: 1; }
.sov-page .hero h1 { max-width: 20ch; }
.sov-page .hero p.lead { margin-top: 10px; font-size: 0.98rem; color: var(--muted); max-width: 52ch; }
.steps { grid-column: 1; grid-row: 2; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.step {
  display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px;
}
.step .num {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--green-soft); color: var(--green);
  display: grid; place-items: center; font-weight: 700; font-size: 0.95rem;
}
.step h2 { font-size: 0.98rem; color: var(--navy); line-height: 1.3; }
.step p { font-size: 0.86rem; color: var(--muted); margin-top: 2px; }
.step.result { background: var(--green-soft); border-color: #c4ead7; }
.step.result .num { background: var(--green); color: #fff; }

.graph-panel {
  grid-column: 2; grid-row: 1 / span 2;
  display: flex; flex-direction: column; gap: 12px; min-height: 0;
}
.graph-panel .shot {
  flex: 1 1 auto; min-height: 0;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 8px; display: flex; flex-direction: column;
}
.graph-panel .shot img {
  flex: 1 1 auto; min-height: 0; width: 100%; object-fit: contain; border-radius: 8px;
}
.graph-panel figcaption { font-size: 0.8rem; color: var(--muted); padding: 8px 6px 2px; }
.graph-panel .sov { grid-column: auto; grid-row: auto; flex: none; gap: 10px; }
.graph-panel .sov .row { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }

/* ---------- Single screen on large viewports, natural flow elsewhere ---------- */
@media (min-width: 1000px) and (min-height: 660px) {
  body { overflow: hidden; }
  .page { height: 100vh; height: 100dvh; }
  .main { overflow: hidden; }
}

@media (max-width: 999px), (max-height: 659px) {
  .main, .sov-page .main { grid-template-columns: 1fr; grid-template-rows: none; }
  .hero, .cards, .sov, .steps, .graph-panel,
  .sov-page .hero { grid-column: 1; grid-row: auto; }
  .card .figure, .sov .figure { min-height: 180px; flex: none; height: 200px; }
  .graph-panel .shot img { max-height: 60vh; }
  .main > .hero { order: 0; }
  .main > .sov { order: 1; }
  .main > .cards { order: 2; }
}
@media (max-width: 680px) {
  .cards { grid-template-columns: 1fr; }
  .top { flex-wrap: wrap; }
  .brand { font-size: 1.3rem; }
  .brand img { width: 62px; }
  .top { gap: 8px; padding: 10px 0 4px; }
  .nav { width: 100%; justify-content: flex-start; gap: 2px; }
  .nav a { padding: 6px 10px; font-size: 0.86rem; }
  .lang { margin-left: auto; }
  .hero h1 { font-size: 1.6rem; }
  .card .figure, .sov .figure { height: 170px; min-height: 0; }
  .graph-panel .sov .row { flex-direction: column; align-items: flex-start; gap: 10px; }
  .trust { flex-direction: column; align-items: stretch; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; flex-wrap: wrap; width: auto; }
  .marquee-track img[aria-hidden="true"] { display: none; }
}

/* ---------- Compact mode for shorter laptop screens ---------- */
@media (min-width: 1000px) and (min-height: 660px) and (max-height: 860px) {
  .top { padding: 8px 0; }
  .brand { font-size: 1.4rem; }
  .brand img { width: 72px; }
  .eyebrow { margin-bottom: 4px; font-size: 0.72rem; }
  .hero h1 { font-size: clamp(1.45rem, 2.3vw, 2rem); max-width: 32ch; }
  .pillars { margin-top: 10px; gap: 6px; }
  .pillars li { font-size: 0.8rem; padding: 4px 10px; }
  .card { gap: 8px; }
  .card h2 { font-size: 0.95rem; }
  .card p { font-size: 0.82rem; }
  .card .intro { display: none; }
  .skills { gap: 4px; }
  .skills li { font-size: 0.8rem; line-height: 1.3; }
  .sov { gap: 9px; }
  .sov h2 { font-size: 1.35rem; }
  .sov .claim { font-size: 0.92rem; }
  .sov p { font-size: 0.82rem; }
  .sov .mail { font-size: 0.76rem; }
  .btn { padding: 8px 14px; font-size: 0.84rem; }
  .trust { padding: 6px 0 4px; }
  .marquee img { height: 34px; }
  .foot { padding: 2px 0 8px; }
  .step { padding: 8px 12px; }
  .steps { gap: 8px; }
  .step h2 { font-size: 0.92rem; }
  .step p { font-size: 0.8rem; }
  .sov-page .hero p.lead { font-size: 0.88rem; margin-top: 6px; }
}
