/* =========================================================
   Saulius Stankevicius – portfolio
   Spalvų žetonai, šviesi ir tamsi temos, išdėstymas, spausdinimas
   ========================================================= */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/inter-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/inter-latin-ext-wght-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-latin-wght-normal.woff2') format('woff2');
}

/* ---------- Spalvų žetonai ---------- */
:root {
  --bg: #f5f7fb;
  --bg-glow: rgba(43, 89, 255, 0.12);
  --surface: #ffffff;
  --surface-2: #eef2f8;
  --text: #0c1324;
  --text-soft: #2c3548;
  --muted: #5b6579;
  --border: #e1e6ef;
  --border-strong: #cdd5e3;
  --accent: #2149e8;
  --accent-soft: rgba(33, 73, 232, 0.09);
  --accent-text: #ffffff;
  --signal: #e8590c;
  --ok: #15803d;
  --ok-soft: rgba(21, 128, 61, 0.1);
  --grid-line: rgba(12, 19, 36, 0.045);
  --term-bg: #0d1322;
  --term-text: #d7def0;
  --term-muted: #8a95ad;
  --term-accent: #7dd3a8;
  --shadow: 0 1px 2px rgba(12, 19, 36, 0.04), 0 8px 24px -12px rgba(12, 19, 36, 0.12);
  --shadow-lg: 0 2px 4px rgba(12, 19, 36, 0.04), 0 24px 48px -20px rgba(12, 19, 36, 0.25);

  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;
  --radius: 16px;
  --radius-sm: 10px;
  --wrap: 1160px;
  --gutter: 16px;
  --topbar-h: 64px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #090e1a;
    --bg-glow: rgba(94, 128, 255, 0.16);
    --surface: #10172a;
    --surface-2: #0c1222;
    --text: #e9edf6;
    --text-soft: #c5cddd;
    --muted: #94a0b8;
    --border: #1d2741;
    --border-strong: #2a3657;
    --accent: #7b96ff;
    --accent-soft: rgba(123, 150, 255, 0.12);
    --accent-text: #08102a;
    --signal: #ff8a4c;
    --ok: #4ade80;
    --ok-soft: rgba(74, 222, 128, 0.12);
    --grid-line: rgba(233, 237, 246, 0.04);
    --term-bg: #060a14;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.3), 0 24px 48px -20px rgba(0, 0, 0, 0.8);
    color-scheme: dark;
  }
}

:root[data-theme='dark'] {
  --bg: #090e1a;
  --bg-glow: rgba(94, 128, 255, 0.16);
  --surface: #10172a;
  --surface-2: #0c1222;
  --text: #e9edf6;
  --text-soft: #c5cddd;
  --muted: #94a0b8;
  --border: #1d2741;
  --border-strong: #2a3657;
  --accent: #7b96ff;
  --accent-soft: rgba(123, 150, 255, 0.12);
  --accent-text: #08102a;
  --signal: #ff8a4c;
  --ok: #4ade80;
  --ok-soft: rgba(74, 222, 128, 0.12);
  --grid-line: rgba(233, 237, 246, 0.04);
  --term-bg: #060a14;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.3), 0 24px 48px -20px rgba(0, 0, 0, 0.8);
  color-scheme: dark;
}

@media (min-width: 640px) {
  :root { --gutter: 24px; }
}

/* ---------- Bazė ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar-h) + 16px);
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; letter-spacing: -0.02em; font-weight: 700; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }
dl, dd { margin: 0; }
button { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.muted { color: var(--muted); }

.icon { width: 20px; height: 20px; flex: none; }
.icon-sm { width: 18px; height: 18px; }
.icon-xs { width: 14px; height: 14px; }
.icon-badge {
  width: 40px;
  height: 40px;
  padding: 9px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
}

.skip {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
  text-decoration: none;
}
.skip:focus { top: 12px; }

.kicker {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.kicker::before { content: '// '; opacity: 0.6; }

/* ---------- Viršutinė juosta ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--topbar-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.topbar.is-scrolled { border-bottom-color: var(--border); }

.topbar-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.brand-mark {
  width: 36px;
  height: 36px;
  padding: 2px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #ffffff;
}

/* Kalbų perjungiklis mobiliajame meniu (kompiuteryje jis yra viršutinėje juostoje) */
.nav .nav-langs { display: none; }

/* QR kodas rodomas tik spausdinant */
.print-qr { display: none; }
.brand-name { display: none; }
@media (min-width: 420px) { .brand-name { display: inline; } }

.nav { margin-inline-start: auto; }
.nav ul { display: flex; gap: 4px; }
.nav a {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s, background-color 0.15s;
}
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a.is-active { color: var(--text); background: var(--accent-soft); }

.tools { display: flex; align-items: center; gap: 8px; }

.langs {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}
.lang-link {
  padding: 4px 8px;
  border-radius: 7px;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
}
.lang-link:hover { color: var(--text); }
.lang-link.is-current { background: var(--text); color: var(--bg); }

.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s;
}
.icon-btn:hover { border-color: var(--border-strong); }
.i-moon { display: none; }
:root[data-theme='dark'] .i-sun { display: none; }
:root[data-theme='dark'] .i-moon { display: block; }
.menu-btn { display: none; }

@media (max-width: 960px) {
  .menu-btn { display: grid; }
  .topbar .langs:not(.nav-langs) { display: none; }
  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 60;
    padding: 8px var(--gutter) 20px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  }
  .nav.is-open { opacity: 1; transform: none; visibility: visible; }
  .nav ul { flex-direction: column; }
  .topbar .nav-langs { display: flex; width: fit-content; margin: 12px 12px 0; }
  .nav-langs .lang-link { padding: 10px 16px; font-size: 0.85rem; }
  .icon-btn { width: 44px; height: 44px; }
  .nav a { padding: 12px; font-size: 1rem; }
  .tools { margin-inline-start: auto; }
}

/* ---------- Mygtukai ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 20px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s, background-color 0.15s, border-color 0.15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--accent);
  color: var(--accent-text);
  box-shadow: 0 8px 20px -10px var(--accent);
}
.btn-primary:hover { box-shadow: 0 12px 26px -10px var(--accent); }
.btn-ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--border-strong); }

.cta { display: flex; flex-wrap: wrap; gap: 12px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-soft);
}
.pill-live .dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
}
.pill-live .dot::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: var(--ok);
  opacity: 0.35;
  animation: pulse 2s ease-out infinite;
}
@keyframes pulse {
  from { transform: scale(0.6); opacity: 0.5; }
  to { transform: scale(1.8); opacity: 0; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding-block: 48px 40px;
  isolation: isolate;
}
.hero::before {
  content: '';
  position: absolute;
  inset: calc(var(--topbar-h) * -1) 0 0;
  z-index: -1;
  background:
    radial-gradient(60% 50% at 75% 10%, var(--bg-glow), transparent 70%),
    linear-gradient(var(--grid-line) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px) 0 0 / 48px 48px;
  mask-image: linear-gradient(to bottom, #000 55%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent);
}

.hero-grid {
  display: grid;
  gap: 40px;
  align-items: center;
}
@media (min-width: 960px) {
  .hero { padding-block: 72px 56px; }
  .hero-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr); gap: 56px; }
}

.hero-copy { display: grid; gap: 22px; justify-items: start; }

.hero h1 {
  font-size: clamp(2.4rem, 6.4vw, 4.4rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.02;
}
.hello {
  display: block;
  margin-bottom: 10px;
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--muted);
}

.role {
  font-size: clamp(1.15rem, 2.4vw, 1.45rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-soft);
  line-height: 1.35;
}
.role .accent { color: var(--accent); }

.lead {
  max-width: 60ch;
  font-size: 1.06rem;
  color: var(--muted);
}

.seeking { display: grid; gap: 10px; }
.roles { display: flex; flex-wrap: wrap; gap: 8px; }
.roles li {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.9rem;
  font-weight: 500;
}

.hero-side {
  position: relative;
  display: grid;
  justify-items: center;
}

.portrait {
  position: relative;
  margin: 0;
  width: min(100%, 360px);
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface-2);
  box-shadow: var(--shadow-lg);
  outline: 1px solid var(--border);
  outline-offset: 8px;
}
/* Originali nuotrauka turi apskritą rėmelį – jį apkerpame mastelio didinimu */
.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.27);
  transform-origin: 50% 50%;
}

.terminal {
  width: min(100%, 360px);
  margin-top: -64px;
  margin-inline-start: 0;
  justify-self: center;
  transform: translateX(-12%);
  position: relative;
  border-radius: 14px;
  background: var(--term-bg);
  color: var(--term-text);
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.55;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
@media (min-width: 960px) {
  .hero-side { justify-items: end; }
  .terminal { justify-self: start; transform: translateX(-24px); }
}
@media (max-width: 520px) {
  .terminal { margin-top: -40px; width: calc(100% - 16px); transform: none; }
}
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.terminal-bar span { width: 9px; height: 9px; border-radius: 50%; background: #3a4560; }
.terminal-bar span:first-child { background: #ff5f57; }
.terminal-bar span:nth-child(2) { background: #febc2e; }
.terminal-bar span:nth-child(3) { background: #28c840; }
.terminal-bar em { margin-inline-start: 8px; font-style: normal; color: var(--term-muted); font-size: 0.72rem; }
.terminal-body { padding: 12px 14px 14px; }
.terminal-body p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-prompt { color: var(--term-accent); }
.t-out { color: var(--term-muted); margin-bottom: 4px; }
.caret {
  display: inline-block;
  width: 8px;
  height: 1em;
  vertical-align: -2px;
  background: var(--term-text);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* Statistika */
.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 48px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.stat {
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-end;
  gap: 4px;
  padding: 20px;
  border-bottom: 1px solid var(--border);
}
.stat:nth-child(odd) { border-inline-end: 1px solid var(--border); }
.stat:nth-last-child(-n + 2) { border-bottom: 0; }
.stat dd {
  font-size: clamp(1.7rem, 3.4vw, 2.3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}
.stat dt { font-size: 0.88rem; color: var(--muted); line-height: 1.4; }
@media (min-width: 860px) {
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stat { border-bottom: 0; border-inline-end: 1px solid var(--border); padding: 24px 28px; }
  .stat:last-child { border-inline-end: 0; }
}

/* ---------- Skyriai ---------- */
.section { padding-block: 72px; }
@media (min-width: 960px) { .section { padding-block: 104px; } }
.section-alt {
  background: var(--surface-2);
  border-block: 1px solid var(--border);
}

.section-head {
  display: grid;
  gap: 14px;
  max-width: 760px;
  margin-bottom: 40px;
}
.section-head h2 {
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}
.section-intro { color: var(--muted); font-size: 1.04rem; }

.sub-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 18px;
}

.grid-3 {
  display: grid;
  gap: 16px;
}
@media (min-width: 700px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1020px) { .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; } }

.card {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.card h3 { font-size: 1.12rem; }
.card > p { color: var(--muted); }

.skill h3 {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ticks { display: grid; gap: 8px; }
.ticks li {
  position: relative;
  padding-inline-start: 22px;
  color: var(--text-soft);
  font-size: 0.95rem;
  line-height: 1.5;
}
.ticks li::before {
  content: '';
  position: absolute;
  inset-inline-start: 2px;
  top: 0.55em;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--accent);
  opacity: 0.75;
  transform: rotate(45deg);
}

.facts {
  display: grid;
  gap: 1px;
  margin-top: 20px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--border);
}
.facts > div { padding: 16px 20px; background: var(--surface); }
.facts dt { font-size: 0.8rem; color: var(--muted); font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.05em; }
.facts dd { font-weight: 600; margin-top: 2px; }
@media (min-width: 700px) { .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1020px) { .facts { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---------- Projektai ---------- */
.projects {
  display: grid;
  gap: 20px;
}
@media (min-width: 1020px) {
  .projects { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
  .project-main { grid-row: span 2; }
}

.project {
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 28px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.project-main {
  position: relative;
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
  background:
    radial-gradient(80% 60% at 100% 0%, var(--accent-soft), transparent 70%),
    var(--surface);
}
.project-head { display: grid; gap: 10px; justify-items: start; }
.project h3 { font-size: clamp(1.3rem, 2.4vw, 1.6rem); letter-spacing: -0.025em; }
.project-head > p:last-child { color: var(--muted); }
.project-tag {
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--signal);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.shows {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px dashed var(--border-strong);
  font-size: 0.93rem;
  color: var(--text-soft);
}

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags li {
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
}

.sub-title.reveal { margin-top: 56px; }
.labs {
  display: grid;
  gap: 16px;
}
@media (min-width: 700px) { .labs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1020px) { .labs { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.lab {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color 0.2s, transform 0.2s;
}
.lab:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.lab h4 { font-size: 1rem; }
.lab p { color: var(--muted); font-size: 0.93rem; }
.lab-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-self: start;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}
.lab-link:hover { text-decoration: underline; }

/* ---------- Patirtis ---------- */
.journey { display: grid; gap: 40px; }
@media (min-width: 1020px) { .journey { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 48px; } }

.timeline {
  position: relative;
  display: grid;
  gap: 28px;
  padding-inline-start: 28px;
}
.timeline::before {
  content: '';
  position: absolute;
  inset-inline-start: 6px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(var(--accent), var(--border));
  border-radius: 2px;
}
.tl-item { position: relative; display: grid; gap: 6px; }
.tl-item::before {
  content: '';
  position: absolute;
  inset-inline-start: -28px;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--accent);
}
.section-alt .tl-item::before { background: var(--surface-2); }
.tl-period {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
}
.tl-item h4 { font-size: 1.15rem; }
.tl-org { color: var(--muted); font-size: 0.93rem; margin-bottom: 6px; }

.missions {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}
.missions li {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.93rem;
  color: var(--muted);
}
.mission-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2px 12px;
  margin-bottom: 2px;
  color: var(--text);
}

.journey-side { display: grid; gap: 20px; align-content: start; }
.edu { display: grid; gap: 18px; }
.edu li { display: grid; gap: 3px; }
.edu h4 { font-size: 1rem; }
.edu .tl-org a { color: inherit; text-decoration-color: var(--border-strong); }
.edu .tl-org a:hover { color: var(--accent); }
.edu-note { font-size: 0.88rem; color: var(--muted); margin-top: 4px; }

.lang-list { display: grid; gap: 16px; }
.lang-row { display: flex; justify-content: space-between; gap: 12px; font-weight: 600; margin-bottom: 6px; }
.lang-row .muted { font-weight: 500; font-size: 0.88rem; }
.meter { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.meter .w-85 { width: 85%; }
.meter .w-95 { width: 95%; }
.meter .w-100 { width: 100%; }

/* ---------- Sertifikatai ---------- */
.certs { display: grid; gap: 20px; }
@media (min-width: 860px) { .certs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cert-group header { display: grid; gap: 2px; }
.cert-group h3 { display: flex; align-items: center; gap: 12px; }
.cert-group header .muted { font-size: 0.88rem; padding-inline-start: 52px; }
.cert-highlight {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
}
.cert-highlight .cert-name { font-weight: 700; }
.cert-highlight .muted { font-size: 0.85rem; }
.cert-list { display: grid; }
.cert-list li,
.cert-highlight {
  font-size: 0.93rem;
}
.cert-list li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px 16px;
  padding-block: 10px;
  border-bottom: 1px solid var(--border);
}
.cert-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.cert-name { color: var(--text-soft); }
.cert-meta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}
.cert-meta a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.cert-meta a:hover { text-decoration: underline; }

/* ---------- Kontaktai ---------- */
.contact { padding-top: 0; }
.contact-box {
  display: grid;
  gap: 32px;
  padding: 32px 20px;
  border-radius: 24px;
  border: 1px solid var(--border);
  background:
    radial-gradient(70% 90% at 0% 0%, var(--accent-soft), transparent 70%),
    var(--surface);
  box-shadow: var(--shadow-lg);
}
@media (min-width: 640px) { .contact-box { padding: 48px; } }
@media (min-width: 1020px) { .contact-box { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: center; padding: 56px; } }
.contact-copy { display: grid; gap: 16px; justify-items: start; }
.contact-copy h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; letter-spacing: -0.03em; }
.contact .btn-primary { word-break: break-all; }

.contact-list { display: grid; gap: 10px; }
.contact-list li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg);
}
.contact-list li > div { display: grid; min-width: 0; flex: 1; }
.contact-list .muted { font-size: 0.78rem; font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.05em; }
.contact-list a { font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.contact-list a:hover { color: var(--accent); }

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
.copy-btn:hover { border-color: var(--border-strong); }
.copy-btn.is-done { color: var(--ok); border-color: var(--ok); }
@media (max-width: 420px) { .copy-btn span { display: none; } }

/* ---------- Poraštė ---------- */
.footer {
  padding-block: 32px 40px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.88rem;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.footer-tools { display: flex; align-items: center; gap: 12px; }
.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.link-btn:hover { color: var(--text); background: var(--surface-2); }

/* ---------- Atsiradimo animacija (tik su JS ir be „reduce motion“) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
  }
  .js .reveal.is-visible { opacity: 1; transform: none; }
}

/* ---------- Spausdinimas: tvarkingas CV ---------- */
@media print {
  @page { margin: 14mm 14mm; }
  :root {
    --bg: #fff; --surface: #fff; --surface-2: #fff; --text: #000; --text-soft: #111;
    --muted: #444; --border: #ccc; --accent: #1d3fc4; --accent-soft: transparent;
    color-scheme: light;
  }
  body { font-size: 10pt; line-height: 1.45; }
  .topbar, .skip, .terminal, .cta, .footer-tools, .copy-btn, .hero::before, .icon-badge, .pill-live .dot::after { display: none !important; }
  .js .reveal { opacity: 1 !important; transform: none !important; }
  .hero, .section { padding-block: 10pt; }
  .section-alt { border: 0; }
  .stats, .card, .project, .lab, .contact-box { box-shadow: none; }
  /* Tinklelius spausdinant paverčiame blokais: tada naršyklė gali tvarkingai skaidyti puslapius */
  .grid-3, .projects, .labs, .certs, .journey, .contact-box, .hero-grid { display: block !important; }
  .grid-3 > *, .projects > *, .labs > *, .certs > *, .journey-side > * { margin-bottom: 8pt; }
  .card, .project, .lab, .tl-item, .cert-group, .edu li, .missions li, .stat, .facts > div, .contact-list li {
    break-inside: avoid; page-break-inside: avoid;
  }
  h2, h3, h4, .section-head { break-after: avoid; page-break-after: avoid; }
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .hero-side, .footer, .section-intro { display: none !important; }
  .hero-copy { position: relative; padding-right: 30mm; }
  .print-qr { display: block; position: absolute; top: 0; right: 0; width: 26mm; text-align: center; font-size: 7pt; color: var(--muted); }
  .print-qr img { width: 26mm; height: 26mm; }
  .section { break-before: auto; }
  .section-head { margin-bottom: 10pt; }
  .section-head h2 { font-size: 15pt; }
  .hero h1 { font-size: 24pt; }
  .stats { margin-top: 12pt; }
  .contact-box { padding: 12pt; }
  .lab:hover { transform: none; }
  a { text-decoration: none; }
}


/* =========================================================
   Judesys ir interaktyvumas (papildoma; išjungiama su „sumažinti judesį“)
   ========================================================= */
:root { --glow: rgba(33, 73, 232, 0.10); }
:root[data-theme='dark'] { --glow: rgba(123, 150, 255, 0.16); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) { --glow: rgba(123, 150, 255, 0.16); }
}

/* Slinkties eigos juosta po viršutine juosta */
.progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--signal));
  transform: scaleX(var(--p, 0));
  transform-origin: left;
  pointer-events: none;
}

/* Mygtukas „į viršų“ */
.to-top {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 40;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.25s, transform 0.25s, visibility 0.25s, border-color 0.15s;
}
.to-top .icon { transform: rotate(-90deg); }
.to-top.is-shown { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { border-color: var(--accent); }

/* Tinklo „grafas“ pradžios fone */
.net {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent);
  mask-image: linear-gradient(to bottom, #000 55%, transparent);
}

/* Laiko juostos pildymas slenkant + taškai */
.timeline::before { background: var(--border); }
.timeline::after {
  content: '';
  position: absolute;
  inset-inline-start: 6px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(var(--accent), color-mix(in srgb, var(--accent) 45%, transparent));
  transform-origin: top;
  transform: scaleY(var(--tl, 1));
}
.js .timeline::after { transform: scaleY(var(--tl, 0)); }
.tl-item::before { transition: background-color 0.4s; }
.tl-item.is-visible::before { background: var(--accent); }

/* Vaidmenų žymos paeiliui įsižiebia */
.roles li { transition: border-color 0.3s, background-color 0.3s, transform 0.3s; }
.roles li.is-lit { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-2px); }

/* Pagrindinio mygtuko blizgesys */
.btn-primary { position: relative; overflow: hidden; }
.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.35) 50%, transparent 70%);
  transform: translateX(-120%);
  pointer-events: none;
}
.btn-primary:hover::after { transform: translateX(120%); transition: transform 0.7s ease; }

@media (prefers-reduced-motion: no-preference) {
  /* Pradžios elementai pasirodo paeiliui */
  .hero-copy > * { animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .hero-copy > :nth-child(1) { animation-delay: 0.05s; }
  .hero-copy > :nth-child(2) { animation-delay: 0.14s; }
  .hero-copy > :nth-child(3) { animation-delay: 0.23s; }
  .hero-copy > :nth-child(4) { animation-delay: 0.32s; }
  .hero-copy > :nth-child(5) { animation-delay: 0.41s; }
  .hero-copy > :nth-child(7) { animation-delay: 0.5s; }
  .hero-side { animation: rise 0.9s 0.25s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  @keyframes rise { from { opacity: 0; transform: translateY(18px); } }

  /* Nuotrauka „plūduriuoja“, o nuotrauka ir terminalas švelniai seka pelę */
  .portrait {
    animation: float 7s ease-in-out infinite;
    translate: calc(var(--px, 0) * -10px) calc(var(--py, 0) * -8px);
    transition: translate 0.25s ease-out;
  }
  .terminal {
    translate: calc(var(--px, 0) * 14px) calc(var(--py, 0) * 10px);
    transition: translate 0.25s ease-out;
  }
  @keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

  /* Kortelių atsiradimo eilė (--d nustato fx.js) */
  .js .reveal { transition-delay: var(--d, 0s); }

  /* Kalbų lygio juostos „užsipildo“ */
  .js .meter span { transform: scaleX(0); transform-origin: left; transition: transform 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) 0.3s; }
  .js .reveal.is-visible .meter span { transform: none; }
}

/* Švytėjimas, sekantis pelę virš kortelių */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .card, .project, .lab { position: relative; }
  .card::before, .project::before, .lab::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: inherit;
    pointer-events: none;
    opacity: 0;
    background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 50%), var(--glow), transparent 70%);
    transition: opacity 0.3s;
  }
  .card:hover::before, .project:hover::before, .lab:hover::before { opacity: 1; }
  .card > *, .project > *, .lab > * { position: relative; z-index: 1; }
}

@media print {
  .net, .progress, .to-top { display: none !important; }
  .hero-copy > *, .hero-side, .portrait { animation: none !important; translate: none !important; }
  .meter span { transform: none !important; }
  .timeline::after { display: none; }
}
