/* ==========================================================================
   Vladyslav Kobzunenko – portfolio
   Dark tech theme with red and blue accent lines (same look as the CV)
   ========================================================================== */

:root {
  --bg: #0B0F14;
  --bg-2: #11161D;
  --bg-3: #161D26;
  --line: #243040;
  --text: #E6EDF3;
  --text-2: #C9D3DD;
  --muted: #8B98A7;
  --heading: #F4F7FA;
  --red: #FF4D5E;
  --blue: #3D9BFF;
  --blue-soft: #7AB8FF;
  --radius: 14px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Space Grotesk", var(--font);
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --container: 1140px;
  --header-h: 68px;
}

*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { font-family: var(--font-display); color: var(--heading); line-height: 1.1; margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; }
a { color: var(--blue-soft); text-underline-offset: 3px; }
a:hover { color: #A9D1FF; }

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
  border-radius: 6px;
}

.container { width: min(100% - 40px, var(--container)); margin-inline: auto; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--blue); color: #06111F;
  padding: 10px 16px; border-radius: 8px; font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 16px; }

/* ---------- Space background (parallax canvas) ---------- */
.space { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -2; pointer-events: none; display: block; }

/* ---------- Signature stripe ---------- */
.stripe { position: fixed; inset: 0 0 auto 0; z-index: 60; display: grid; gap: 2px; pointer-events: none; }
.stripe span { display: block; }
.stripe span:first-child { height: 3px; background: var(--red); }
.stripe span:last-child { height: 2px; background: var(--blue); }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: rgba(11, 15, 20, .82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.logo { text-decoration: none; }
.logo-mark { font-family: var(--font-mono); font-weight: 500; font-size: .95rem; color: var(--heading); }
.logo:hover .logo-mark { color: var(--blue-soft); }

.site-nav ul { list-style: none; display: flex; gap: 4px; align-items: center; }
.site-nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px;
  color: var(--text-2); text-decoration: none; font-size: .93rem; font-weight: 500; border-radius: 8px;
}
.site-nav a:hover, .site-nav a[aria-current="true"] { color: var(--heading); background: var(--bg-3); }
.site-nav .nav-cta { color: var(--heading); border: 1px solid var(--blue); margin-left: 6px; }
.site-nav .nav-cta:hover { background: var(--blue); color: #06111F; }

.nav-toggle {
  display: none; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg-2); color: var(--heading); cursor: pointer; align-items: center; justify-content: center;
}
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
  content: ""; display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; transition: transform .2s;
}
.nav-toggle-bars { position: relative; }
.nav-toggle-bars::before { position: absolute; top: -6px; }
.nav-toggle-bars::after { position: absolute; top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 10px;
  font: 600 .98rem/1 var(--font); text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: background .2s, color .2s, border-color .2s, transform .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--blue); color: #06111F; }
.btn-primary:hover { background: var(--blue-soft); color: #06111F; }
.btn-ghost { background: transparent; color: var(--heading); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--red); color: var(--heading); }
.btn-lg { min-height: 56px; padding: 0 28px; font-size: 1.05rem; }
.link-btn { background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; min-height: 44px; }
.link-btn:hover { color: var(--heading); }

/* ---------- Hero ---------- */
.hero { padding: clamp(48px, 9vw, 110px) 0 56px; position: relative; overflow: hidden; }
.hero::before {
  /* subtle tech grid */
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .18;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 70% 40%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 70% 40%, #000 20%, transparent 75%);
}
.hero-inner { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: .82rem; color: var(--text-2); margin-bottom: 22px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #3DDC84; box-shadow: 0 0 0 4px rgba(61, 220, 132, .18); }
.hero h1 { font-size: clamp(2.6rem, 6.5vw, 4.8rem); font-weight: 700; letter-spacing: -.03em; }
.hero-role { font-family: var(--font-mono); font-size: clamp(1.05rem, 2vw, 1.35rem); font-weight: 500; color: var(--blue); margin-top: 14px; }
.lines { display: flex; gap: 6px; margin: 22px 0 24px; }
.lines span { height: 3px; border-radius: 2px; }
.lines span:nth-child(1) { width: 64px; background: var(--red); }
.lines span:nth-child(2) { width: 160px; background: var(--blue); }
.lines span:nth-child(3) { width: 20px; background: var(--line); }
.hero-lead { font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: var(--text-2); max-width: 56ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

.hero-photo { position: relative; margin: 0; justify-self: center; width: min(100%, 360px); aspect-ratio: 1; }
.hero-photo img { position: relative; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; border: 4px solid var(--blue); }
.ring { position: absolute; inset: 0; border-radius: 50%; }
.ring-red { border: 2px solid var(--red); transform: translate(14px, 14px); }

.stats {
  list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px;
  margin-top: 64px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.stats li { background: rgba(17, 22, 29, .9); padding: 22px 24px; display: flex; flex-direction: column; gap: 4px; }
.stat-num { font-family: var(--font-display); font-size: 2.2rem; font-weight: 700; color: var(--heading); line-height: 1; }
.stats li span { color: var(--muted); font-size: .9rem; }

/* ---------- Sections ---------- */
.section { padding: clamp(64px, 9vw, 112px) 0; border-top: 1px solid rgba(36, 48, 64, .6); }
.section-head { margin-bottom: 40px; display: grid; gap: 10px; }
.section-num { font-family: var(--font-mono); font-size: .85rem; color: var(--red); }
.section-head h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); letter-spacing: -.02em; }
.section-sub { color: var(--muted); max-width: 60ch; }

/* About */
.about-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 48px; }
.about-text { display: grid; align-content: start; gap: 18px; font-size: 1.08rem; color: var(--text-2); }
.about-text strong { color: var(--heading); }
.facts { margin: 0; display: grid; gap: 0; border-left: 2px solid var(--blue); }
.facts div { padding: 12px 0 12px 20px; border-bottom: 1px solid var(--line); }
.facts div:last-child { border-bottom: 0; }
.facts dt { font-family: var(--font-mono); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--blue); }
.facts dd { margin: 4px 0 0; color: var(--text); }

/* Timeline */
.timeline { list-style: none; display: grid; gap: 0; }
.tl-item { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 28px; padding: 26px 0; border-bottom: 1px solid var(--line); }
.tl-item:last-child { border-bottom: 0; }
.tl-meta { font-family: var(--font-mono); font-size: .88rem; color: var(--blue); padding-top: 4px; }
.tl-body { position: relative; padding-left: 22px; border-left: 2px solid var(--line); }
.tl-item:first-child .tl-body { border-left-color: var(--red); }
.tl-body h3 { font-size: 1.3rem; }
.tl-body .at { color: var(--blue-soft); font-weight: 500; }
.tl-body > ul:not(.tags) { margin-top: 12px; padding-left: 18px; display: grid; gap: 6px; color: var(--text-2); }
.tl-body > ul:not(.tags) li::marker { color: var(--red); }

.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.tags li {
  font-family: var(--font-mono); font-size: .8rem; line-height: 1; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--bg-3); color: var(--text);
}

/* Education */
.edu { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.edu-item {
  display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 20px; align-items: start;
  padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(17, 22, 29, .88);
}
.edu-badge {
  display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%;
  font-family: var(--font-mono); font-weight: 500; font-size: .95rem; color: var(--heading);
  border: 2px solid var(--line); background: var(--bg-3);
}
.edu-it .edu-badge { border-color: var(--blue); box-shadow: 4px 4px 0 -1px var(--bg), 4px 4px 0 1px var(--red); }
.edu-body { display: grid; gap: 4px; }
.edu-years { font-family: var(--font-mono); font-size: .82rem; color: var(--blue); }
.edu-body h3 { font-size: 1.25rem; }
.edu-school { color: var(--text-2); }
.edu-level { color: var(--muted); font-size: .9rem; }
@media (max-width: 760px) { .edu { grid-template-columns: 1fr; } }
@media (max-width: 420px) { .edu-item { grid-template-columns: 1fr; } }

/* Cards */
.cards { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.card > a {
  position: relative; height: 100%; display: flex; flex-direction: column; gap: 8px;
  padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(17, 22, 29, .88);
  color: inherit; text-decoration: none; overflow: hidden; transition: border-color .2s, transform .2s, background .2s;
}
.card > a::before {
  content: ""; position: absolute; inset: 0 auto auto 0; height: 3px; width: 0;
  background: linear-gradient(90deg, var(--red) 0 30%, var(--blue) 30% 100%); transition: width .35s ease;
}
.card > a:hover, .card > a:focus-visible { border-color: #34465B; background: var(--bg-3); transform: translateY(-3px); }
.card > a:hover::before, .card > a:focus-visible::before { width: 100%; }
.card-tag { font-family: var(--font-mono); font-size: .76rem; color: var(--blue); }
.card h3 { font-size: 1.3rem; }
.card p { color: var(--text-2); font-size: .95rem; flex-grow: 1; }
.card-link { font-weight: 600; color: var(--heading); font-size: .92rem; display: inline-flex; gap: 6px; align-items: center; }
.card-link::after { content: "→"; color: var(--red); transition: transform .2s; }
.card > a:hover .card-link::after { transform: translateX(4px); }
.cards-small { margin-top: 16px; }

/* "Also worked on" list */
.also { margin-top: 40px; padding-top: 28px; border-top: 1px dashed var(--line); }
.also-title { font-size: 1.15rem; }
.also-groups { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 28px; margin-top: 18px; }
.also-label { font-family: var(--font-mono); font-size: .8rem; color: var(--blue); }
.also .tags { margin-top: 10px; }
.also .tags li { color: var(--text-2); background: transparent; }
@media (max-width: 960px) { .also-groups { grid-template-columns: 1fr; gap: 20px; } }

/* Card with several links (mBank PL / CZ / SK) */
.card-box {
  position: relative; height: 100%; display: flex; flex-direction: column; gap: 8px;
  padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(17, 22, 29, .88);
}
.card-box p { flex-grow: 1; }
.card-links { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.card-links a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 8px;
  border: 1px solid var(--line); color: var(--heading); font-weight: 600; font-size: .9rem; text-decoration: none;
}
.card-links a::after { content: "→"; color: var(--red); margin-left: 6px; }
.card-links a:hover, .card-links a:focus-visible { border-color: var(--blue); background: var(--bg-3); }

/* Featured lab items */
.featured { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.feature {
  display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 24px; align-items: center;
  padding: 26px; border-radius: var(--radius); border: 1px solid var(--line); background: rgba(17, 22, 29, .88);
  color: inherit; text-decoration: none; transition: border-color .2s, transform .2s;
}
.feature:hover, .feature:focus-visible { transform: translateY(-3px); }
.feature-clock:hover, .feature-clock:focus-visible { border-color: var(--blue); }
.feature-game:hover, .feature-game:focus-visible { border-color: var(--red); }
.feature-visual { aspect-ratio: 1; border-radius: 12px; display: grid; place-items: center; background: var(--bg-3); border: 1px solid var(--line); }
.feature-game .feature-visual { color: var(--red); }
.feature-text { display: grid; gap: 8px; }
.feature-text h3 { font-size: 1.45rem; }
.feature-text p { color: var(--text-2); }
.mini-clock { display: grid; gap: 4px; text-align: center; }
.mini-clock-time { font-family: var(--font-mono); font-size: 1.05rem; font-weight: 500; color: var(--blue); font-variant-numeric: tabular-nums; }
.mini-clock-label { font-size: .72rem; color: var(--muted); }

/* Skills */
.skills { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.skill-group { padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(17, 22, 29, .88); }
.skill-group h3 { font-size: 1.05rem; font-family: var(--font-mono); font-weight: 500; color: var(--blue); }
.skill-group .tags { margin-top: 16px; }

/* Contact */
.contact { text-align: center; background: radial-gradient(ellipse 60% 80% at 50% 120%, rgba(61, 155, 255, .12), transparent 70%); }
.contact .section-head { justify-items: center; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.social { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 32px; }
.social a {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border-radius: 999px; border: 1px solid var(--line); color: var(--text); text-decoration: none; font-weight: 500;
}
.social a:hover { border-color: var(--blue); color: var(--heading); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 20px 0; color: var(--muted); font-size: .9rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }

/* Consent banner */
.consent {
  position: fixed; z-index: 80; right: 20px; bottom: 20px; width: min(420px, calc(100% - 40px));
  background: var(--bg-2); border: 1px solid var(--line); border-top: 3px solid var(--red);
  border-radius: var(--radius); padding: 20px; box-shadow: 0 20px 50px rgba(0, 0, 0, .45);
  display: grid; gap: 10px;
}
.consent[hidden] { display: none; }
.consent-title { font-family: var(--font-display); font-weight: 600; color: var(--heading); font-size: 1.1rem; }
.consent p:not(.consent-title) { color: var(--text-2); font-size: .94rem; }
.consent-actions { display: flex; gap: 10px; margin-top: 6px; }

/* Scroll reveal (only when JS + motion allowed) */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-inner, .about-grid { grid-template-columns: 1fr; }
  .hero-photo { order: -1; width: min(70%, 260px); justify-self: start; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cards, .skills { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .featured { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    position: absolute; inset: var(--header-h) 0 auto 0;
    background: var(--bg); border-bottom: 1px solid var(--line); padding: 12px 20px 20px;
    display: none;
  }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; align-items: stretch; }
  .site-nav .nav-cta { margin: 8px 0 0; justify-content: center; }
  .tl-item { grid-template-columns: 1fr; gap: 10px; }
}

@media (max-width: 560px) {
  .cards, .skills { grid-template-columns: 1fr; }
  .feature { grid-template-columns: 96px minmax(0, 1fr); gap: 16px; padding: 20px; }
  .stats li { padding: 18px; }
  .stat-num { font-size: 1.8rem; }
  .btn-lg { width: 100%; }
}

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

@media print {
  .space, .stripe, .site-header, .consent, .hero::before, .hero-actions, .site-footer button { display: none !important; }
  body { background: #fff; color: #000; }
}
