/* Case studies – Tomáš Zúbrik. Layout system mirrors Figma auto-layout. */
:root {
  --ink: #081534;
  --muted: #6b7385;
  --blue: #1e51c0;
  --blue-dark: #173f97;
  --line: #ced0d6;
  --bg-soft: #f3f7fe;
  --gutter: 16px;
  --radius: 8px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}
@media (min-width: 768px) { :root { --gutter: 32px; } }
@media (min-width: 1280px) { :root { --gutter: 40px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 20px;
  line-height: 1.6;
  color: var(--ink);
  background: #fff;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
@media (max-width: 767px) { body { font-size: 18px; } }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--blue); }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
:focus-visible { outline: 3px solid #7897d9; outline-offset: 3px; border-radius: 2px; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: #fff; padding: 8px 16px; }
.skip:focus { left: 8px; }

/* ---------- navigation ---------- */
.nav { position: sticky; top: 0; z-index: 50; background: rgb(255 255 255 / .92); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); transition: box-shadow .3s var(--ease); }
.nav.scrolled { box-shadow: 0 6px 24px -12px rgb(8 21 52 / .25); }
.nav-in { display: flex; align-items: center; justify-content: space-between; gap: 24px; width: min(100% - 2 * var(--gutter), 1216px); margin: 0 auto; height: 80px; }
.logo { font-weight: 800; font-size: 28px; line-height: 1; letter-spacing: -.01em; color: var(--ink); text-decoration: none; }
.nav-menu { display: flex; align-items: center; gap: 32px; }
.nav-menu a:not(.btn) { position: relative; font-weight: 800; font-size: 18px; line-height: 20px; color: var(--ink); text-decoration: none; padding: 8px; }
.nav-menu a:not(.btn)::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: 2px; height: 2px; background: var(--blue); transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease); }
.nav-menu a:not(.btn):hover::after, .nav-menu a[aria-current="page"]::after { transform: scaleX(1); }
.nav-toggle { display: none; width: 44px; height: 44px; border: 0; background: none; padding: 10px; cursor: pointer; flex-direction: column; justify-content: center; gap: 6px; }
.nav-toggle span { display: block; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .3s var(--ease); }
@media (max-width: 860px) {
  .nav-in { height: 64px; }
  .logo { font-size: 24px; }
  .nav-toggle { display: flex; }
  .nav-menu { position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; padding: 8px var(--gutter) 20px; background: #fff; border-bottom: 1px solid var(--line); box-shadow: 0 16px 32px -20px rgb(8 21 52 / .35); opacity: 0; visibility: hidden; transform: translateY(-8px); transition: opacity .25s var(--ease), transform .25s var(--ease), visibility 0s .25s; }
  .nav-menu a:not(.btn) { padding: 14px 0; border-bottom: 1px solid #eef0f3; }
  .nav-menu a:not(.btn)::after { display: none; }
  .nav-menu .btn { margin-top: 16px; }
  .nav.open .nav-menu { opacity: 1; visibility: visible; transform: none; transition: opacity .25s var(--ease), transform .25s var(--ease); }
  .nav.open .nav-toggle span:first-child { transform: translateY(4px) rotate(45deg); }
  .nav.open .nav-toggle span:last-child { transform: translateY(-4px) rotate(-45deg); }
}

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 56px; min-width: 240px; padding: 18px 24px; border-radius: 4px; background: var(--blue); color: #fff; font-weight: 800; font-size: 18px; line-height: 20px; text-decoration: none; transition: transform .25s var(--ease), box-shadow .25s var(--ease), background-color .25s; }
.btn:hover { background: var(--blue-dark); transform: translateY(-2px); box-shadow: 0 10px 24px -10px rgb(30 81 192 / .7); }
.btn:active { transform: none; }
.btn-light { background: #fff; color: var(--blue); }
.btn-light:hover { background: #fff; box-shadow: 0 10px 24px -10px rgb(0 0 0 / .45); }
.btn-sm { min-height: 44px; min-width: 156px; padding: 12px 20px; font-size: 16px; line-height: 20px; }
@media (max-width: 767px) { .btn { min-width: 0; width: 100%; } .nav-menu .btn { width: 100%; } }

/* ---------- auto-layout primitives ---------- */
/* reset so layout vars never inherit into nested boxes (inline values still win) */
.bx { --g: 0px; --pt: 0px; --pr: 0px; --pb: 0px; --pl: 0px; }
.bx { display: flex; gap: var(--g, 0px); padding: var(--pt, 0px) var(--pr, 0px) var(--pb, 0px) var(--pl, 0px); min-width: 0; max-width: 100%; }
.row { flex-direction: row; }
.col { flex-direction: column; }
.t { min-width: 0; overflow-wrap: break-word; }
.t p + p { margin-top: .8em; }
.t p.sp + p, .t p + p.sp { margin-top: 0; }
.t p.sp { height: 1em; }
.t ul, .t ol { padding-left: 1.4em; }
.t li::marker { color: currentColor; }
.t a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.card { overflow: hidden; }
.im { margin: 0; min-width: 0; }
.im img { width: 100%; height: auto; }
.grp > .bx > div > * { max-width: 100%; }

@media (max-width: 1023px) {
  .bx { gap: min(var(--g, 0px), 48px); padding: min(var(--pt, 0px), 64px) min(var(--pr, 0px), 32px) min(var(--pb, 0px), 64px) min(var(--pl, 0px), 32px); }
  .row.wrap, .row.grid { flex-wrap: wrap; }
}
@media (max-width: 860px) {
  .row.stack { flex-direction: column; align-items: stretch !important; }
  .row.stack > * { flex: none !important; width: 100% !important; max-width: 100% !important; }
  .row.grid { justify-content: center !important; row-gap: 24px; }
  .row.grid > * { flex: 1 1 calc(33.333% - var(--g, 0px)) !important; }
}
@media (max-width: 767px) {
  .bx { gap: min(var(--g, 0px), 32px); padding: min(var(--pt, 0px), 40px) min(var(--pr, 0px), 20px) min(var(--pb, 0px), 40px) min(var(--pl, 0px), 20px); }
  .row.grid > * { flex: 1 1 calc(50% - var(--g, 0px)) !important; }
  .circle { width: 112px !important; height: 112px !important; }
}

/* ---------- sections ---------- */
.sec { margin-top: var(--mt, 0px); width: min(100% - 2 * var(--gutter), var(--w, 1216px)); margin-inline: auto; }
.sec.full { width: 100%; }
.sec.full > .bx { padding-left: max(var(--pl, 0px), var(--gutter)); padding-right: max(var(--pr, 0px), var(--gutter)); }
.sec.full > .bx > *, .sec.full > .grp > * { max-width: 100%; }
.sec.full > .im.bleed { width: 100%; }
@media (max-width: 1023px) { .sec { margin-top: calc(var(--mt, 0px) * .75); } }
@media (max-width: 767px) { .sec { margin-top: calc(var(--mt, 0px) * .55); } }

/* ---------- hero ---------- */
.hero { color: #fff; overflow: hidden; position: relative; }
.hero-in { width: min(100% - 2 * var(--gutter), 1216px); margin: 0 auto; padding: 64px 0; min-height: 530px; display: flex; flex-direction: column; justify-content: center; }
.hero-in > .bx { width: 100%; }
.hero h1 { letter-spacing: -.01em; }
.hero-media { position: relative; }
.hero-media img { position: absolute; max-width: none; height: auto; filter: drop-shadow(0 30px 40px rgb(0 0 0 / .2)); }
.hero .card { overflow: visible; }
@media (max-width: 860px) {
  .hero-in { min-height: 0; padding: 48px 0 56px; }
  .hero-media { width: 100% !important; max-width: 560px; margin: 8px auto 0; }
}

/* intro animation for hero */
.hero .hero-in > .bx > .bx:first-child > * { animation: rise .8s var(--ease) both; }
.hero .hero-in > .bx > .bx:first-child > *:nth-child(2) { animation-delay: .08s; }
.hero-media { animation: float-in 1s var(--ease) .15s both; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes float-in { from { opacity: 0; transform: translateY(28px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- scroll reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--ease) var(--d, 0ms), transform .8s var(--ease) var(--d, 0ms); }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .hero *, .hero-media { animation: none !important; }
}

/* ---------- pager ---------- */
.pager { width: min(100% - 2 * var(--gutter), 1216px); margin: 120px auto 80px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; border-top: 1px solid var(--line); padding-top: 40px; }
.pager-link { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--ink); }
.pager-link.next { text-align: right; }
.pager-label { font-weight: 800; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pager-title { font-weight: 800; font-size: 22px; line-height: 1.3; transition: color .25s; }
.pager-link:hover .pager-title { color: var(--blue); }
.pager-all { font-weight: 800; font-size: 16px; color: var(--ink); text-decoration: none; border: 1px solid var(--line); border-radius: 999px; padding: 10px 20px; transition: border-color .25s, color .25s; }
.pager-all:hover { border-color: var(--blue); color: var(--blue); }
@media (max-width: 767px) {
  .pager { grid-template-columns: 1fr 1fr; margin: 72px auto 56px; }
  .pager-all { grid-column: 1 / -1; grid-row: 2; justify-self: center; }
  .pager-title { font-size: 18px; }
}

/* ---------- footer CTA ---------- */
.cta { background: var(--blue); color: #fff; }
.cta-in { width: min(100% - 2 * var(--gutter), 1218px); margin: 0 auto; padding: 80px 0; display: flex; align-items: center; gap: 32px; }
.cta-text { flex: 1 1 593px; display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.cta .eyebrow { font-weight: 800; font-size: 16px; line-height: 2; text-transform: uppercase; color: #7897d9; }
.cta h2 { font-weight: 800; font-size: 36px; line-height: 40px; margin-top: -16px; }
.cta p:not(.eyebrow) { font-size: 20px; line-height: 32px; }
.cta-media { flex: 1 1 593px; }
.foot { width: min(100% - 2 * var(--gutter), 1216px); margin: 0 auto; padding: 24px 0 32px; display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid rgb(255 255 255 / .2); font-size: 15px; color: rgb(255 255 255 / .75); }
.foot a { color: inherit; text-decoration: none; }
.foot a:hover { color: #fff; }
@media (max-width: 860px) {
  .cta-in { flex-direction: column; align-items: stretch; padding: 56px 0; }
  .cta-media { max-width: 420px; align-self: center; }
  .cta h2 { font-size: 28px; line-height: 34px; }
  .cta p:not(.eyebrow) { font-size: 18px; line-height: 28px; }
}

/* ---------- index ---------- */
.hero-index { background: radial-gradient(ellipse 80% 140% at 85% 20%, #2f63d6 0%, #0b2a74 60%), #0b2a74; }
.hero-index .hero-in { min-height: 420px; }
.eyebrow-light { font-weight: 800; font-size: 16px; line-height: 2; letter-spacing: .04em; text-transform: uppercase; color: #a9c0f0; }
.idx-title { font-weight: 800; font-size: 64px; line-height: 1.1; letter-spacing: -.02em; }
.idx-lead { font-size: 20px; line-height: 1.6; color: rgb(255 255 255 / .85); max-width: 640px; }
@media (max-width: 767px) { .idx-title { font-size: 40px; } .idx-lead { font-size: 18px; } .hero-index .hero-in { min-height: 0; } }

.cases { width: min(100% - 2 * var(--gutter), 1216px); margin: 80px auto 120px; }
.cases-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px 32px; }
@media (max-width: 767px) { .cases { margin: 48px auto 72px; } .cases-grid { grid-template-columns: 1fr; gap: 40px; } }
.card-cs a { display: flex; flex-direction: column; gap: 20px; color: var(--ink); text-decoration: none; height: 100%; }
.card-media { aspect-ratio: 592 / 400; border-radius: 12px; overflow: hidden; display: grid; place-items: center; padding: 6% 8%; transition: box-shadow .4s var(--ease); }
.card-media img { width: 100%; height: 100%; object-fit: contain; transition: transform .6s var(--ease); }
.card-cs a:hover .card-media { box-shadow: 0 24px 48px -24px rgb(8 21 52 / .55); }
.card-cs a:hover .card-media img { transform: scale(1.04) translateY(-4px); }
.card-body { display: flex; flex-direction: column; gap: 8px; }
.card-client { font-weight: 800; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.card-title { font-weight: 800; font-size: 28px; line-height: 1.25; transition: color .25s; }
.card-cs a:hover .card-title { color: var(--blue); }
.tags { list-style: none; padding: 0; margin: 4px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { font-weight: 600; font-size: 14px; line-height: 16px; padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; color: #3c4459; }
.card-more { margin-top: 8px; font-weight: 800; font-size: 16px; color: var(--blue); }
.card-more span { display: inline-block; transition: transform .25s var(--ease); }
.card-cs a:hover .card-more span { transform: translateX(4px); }
@media (max-width: 767px) { .card-title { font-size: 22px; } }
