/* ═══════════════════════════════════════════════════════════
   Vjaceslavs Marmiss — Portfolio CSS
   Dark theme: purple / violet / blue / green accent
   ═══════════════════════════════════════════════════════════ */

/* ── Design tokens ───────────────────────────────────────── */

/* ── CUSTOM PROPERTIES ───────────────────────────────────── */

:root {
  --bg: #07070f;
  --bg-elevated: #111120;
  --bg-card: rgb(255, 255, 255, 0.03);
  --bg-card-hov: rgb(255, 255, 255, 0.055);
  --border: rgb(255, 255, 255, 0.07);
  --border-hov: rgb(182, 95, 255, 0.45);

  --purple: #b65fff;
  --violet: #7b6cff;
  --blue: #53a8ff;
  --green: #22efaa;
  --amber: #ffc83c;
  --yellow: #ffd96a;
  --danger: #ff6b6b;
  --gradient-blue: #2664ff;
  --gradient-pink: #db66ff;
  --gradient-indigo: #7d7dff;
  --logo-teal-a: #28e1ff;
  --logo-teal-b: #21e9f1;
  --logo-teal-c: #25ffd7;

  /* Post gradient placeholder colours */
  --post-gradient-a: #1a0533;
  --post-gradient-b: #0d1a3d;
  --post-gradient-c: #071a2e;
  --post-orb-purple: #b339ff;
  --post-orb-cyan: #18b9f8;

  /* Hero section — macOS chrome dot colours */
  --chrome-red: #ff5f57;
  --chrome-yellow: #febc2e;
  --chrome-green: #28c840;

  /* Hero section — code block background colours */
  --cb-bg-a: #0a081a;
  --cb-bg-b: #07050f;
  --cb-shadow-a: #08050f;
  --cb-shadow-b: #05030a;

  /* Hero section — code block syntax token colours */
  --code-kw: #c792ea;
  --code-attr: #82aaff;
  --code-bracket: #89ddff;
  --code-prop: #b2ccd6;
  --code-str: #c3e88d;
  --code-lang: #43d5ff;

  /* Bring card theme icon colours */
  --bring-blue-icon: #27ecae;
  --bring-green-icon: #b55dff;
  --bring-purple-icon: #cf63ff;

  /* Journey section — SVG milestone colours */
  --journey-dot-bg: #11191e;
  --journey-icon-default: #d8e5ec;
  --journey-logo-v: #9fb6c3;
  --journey-passed-dot: #49e3a6;
  --journey-passed-icon-bg: #07110c;
  --journey-passed-logo-v: #0d6f93;
  --journey-active-dot: #49e3a6;
  --journey-active-icon-bg: #04110a;
  --journey-active-logo-v: #34cfff;
  --journey-now-dot-bg: #07110c;
  --journey-now-dot-stroke: #58efb5;
  --journey-now-logo: #e9fff8;

  /* Experience card colours */
  --exp-company: #f7f8fc;
  --exp-now-badge: #9cf8d8;
  --exp-initial-a: #d6c3ff;
  --exp-initial-b: #9ba4ff;
  --exp-initial-c: #79ffd2;

  /* Badge text tints — light contrast colours for dark backgrounds */
  --badge-green: #b7ef8d;
  --badge-violet: #d6a4ff;
  --badge-blue: #98ccff;
  --badge-emerald: #9dffd8;
  --badge-purple: #f0e0ff;
  --badge-warn: #febc2e;

  /* Project card theme icon colours */
  --icon-plant: #8bd65d;
  --icon-carbon: #caa3ff;
  --icon-travel: #83beff;
  --icon-platform: #b39dff;

  --text: #fff;
  --muted: #8080a0;

  --nav-h: 64px;
  --radius: 14px;
  --radius-sm: 8px;
  --font: 'Inter', sans-serif;
  --mono: 'JetBrains Mono', monospace;
}

/* ── SELF-HOSTED FONTS ───────────────────────────────────── */

@font-face {
  font-family: Inter;
  src: url('/assets/fonts/inter/InterVariable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('/assets/fonts/jetbrains-mono/JetBrainsMono-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ── Global base ─────────────────────────────────────────── */

/* ── SCROLL BEHAVIOUR ────────────────────────────────────── */

/* WCAG 2.2 SC 2.4.11 — Focus Not Obscured: offset scroll targets by the
   fixed navbar height so keyboard-focused elements are not hidden behind it. */

/* ── ACCESSIBILITY UTILITIES ─────────────────────────────── */

/* Visually hidden but fully accessible to screen readers */

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

/* ── RESET ───────────────────────────────────────────────── */

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

h1,
h2,
h3,
h4,
h5,
h6,
button,
a,
label,
li[class],
.nav-link,
.lang-toggle__btn,
.btn-primary,
.btn-ghost,
.btn-resume,
.stack-chip,
.project-badge,
.exp-date,
.hero-badge,
.section-tag,
.footer-headline {
  hyphens: none;
}

html {
  scroll-padding-top: var(--nav-h, 64px);
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  overflow-x: clip;
  overflow-wrap: break-word;
  hyphens: none;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

svg {
  display: block;
}

.svg-defs {
  position: absolute;
}

img {
  max-width: 100%;
  display: block;
}

/* ── SCROLLBAR ───────────────────────────────────────────── */

:root {
  scrollbar-color: var(--purple) transparent;
  scrollbar-width: thin;
}

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--purple);
  border-radius: 3px;
}

/* ── CURSOR ──────────────────────────────────────────────── */

html,
body {
  cursor: default;
}

a,
button,
[role='button'],
.btn-primary,
.btn-ghost,
.nav-link,
.lang-toggle__btn,
.bring-card,
.project-card,
.how-card,
.stack-chip,
.exp-card {
  cursor: pointer;
}

/* ── HOVER / FOCUS TRANSITIONS ───────────────────────────── */

a,
button,
.btn-primary,
.btn-ghost,
.nav-link,
.lang-toggle__btn,
.bring-card,
.project-card,
.how-card,
.stack-chip,
.exp-card {
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background-color 0.18s ease,
    box-shadow 0.18s ease,
    color 0.18s ease,
    opacity 0.18s ease;
}

a:hover,
button:hover,
.btn-primary:hover,
.btn-ghost:hover,
.nav-link:hover,
.lang-toggle__btn:hover {
  transform: translateY(-1px);
}

.bring-card:hover,
.project-card:hover,
.how-card:hover,
.exp-card:hover {
  transform: translateY(-2px);
  box-shadow:
    0 10px 30px rgb(0, 0, 0, 0.22),
    0 0 0 1px color-mix(in srgb, var(--text) 3%, transparent) inset;
}

.stack-chip:hover {
  transform: translateY(-1px);
}

/* Focus ring */

a:focus-visible,
button:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--violet) 60%, transparent);
  outline-offset: 3px;
  border-radius: 10px;
}

/* ── PAGE TRANSITIONS ────────────────────────────────────── */

/* Switching language replaces the words in place and hands the swap to the
   browser, which cross-fades a photograph of the page before and after. These
   two rules add a soft blur to that fade. Note the selectors: the transition
   pseudo-elements belong to the root element itself, so there is no space
   before them — with one they would simply never match. */

::view-transition-old(root) {
  animation: lang-blur-out 0.32s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

::view-transition-new(root) {
  animation: lang-blur-in 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes lang-blur-out {
  to {
    opacity: 0;
    filter: blur(6px);
  }
}

@keyframes lang-blur-in {
  from {
    opacity: 0;
    filter: blur(6px);
  }
}

/* Set by lang-transition.js for the length of the transition. Safari deforms
   elements with a backdrop-filter while it photographs the page, and running
   animations can be caught mid-frame; both are decorative here, so they hold
   still for the third of a second the swap takes. */

:root[data-swapping] .float-card,
:root[data-swapping] .navbar {
  backdrop-filter: none;
}

:root[data-swapping] .float-card,
:root[data-swapping] .badge-pulse,
:root[data-swapping] .orbit-ring-1,
:root[data-swapping] .orbit-ring-2,
:root[data-swapping] .particle,
:root[data-swapping] .scan-line,
:root[data-swapping] .cursor-blink,
:root[data-swapping] .fc-dot-live,
:root[data-swapping] .code-block-wrapper {
  animation-play-state: paused;
}

/* Following the link without JavaScript lands on the other page as a real
   navigation, which browsers with cross-document transitions animate the same
   way. */

@view-transition {
  navigation: auto;
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none;
  }
}

/* ── LOGO GRADIENT STOPS ─────────────────────────────────── */

/* The stops of the two logo gradients. They live here rather than in style
   attributes on the <stop> elements so the page never needs
   style-src 'unsafe-inline' in its Content-Security-Policy. */

.logo-stop-pink {
  stop-color: var(--gradient-pink);
}

.logo-stop-purple {
  stop-color: var(--post-orb-purple);
}

.logo-stop-blue {
  stop-color: var(--gradient-blue);
}

.logo-stop-cyan {
  stop-color: var(--post-orb-cyan);
}

.logo-stop-mint {
  stop-color: #3cf7db;
}

.logo-stop-teal-a {
  stop-color: var(--logo-teal-a);
}

.logo-stop-teal-b {
  stop-color: var(--logo-teal-b);
}

.logo-stop-teal-c {
  stop-color: var(--logo-teal-c);
}

/* ── LAYOUT ──────────────────────────────────────────────── */

.container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 40px;
}

/* ── TYPOGRAPHY HELPERS ──────────────────────────────────── */

.text-grad {
  background: linear-gradient(90deg, var(--purple), var(--violet));
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-tag-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: 25px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: #fff;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-tag::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--green);
  box-shadow:
    0 0 8px var(--green),
    0 0 18px color-mix(in srgb, var(--green) 60%, transparent);
  -webkit-text-fill-color: initial;
}

.section-sub {
  color: var(--muted);
  font-size: 16px;
  margin-bottom: 48px;
  text-wrap: pretty;
}

/* ── BUTTONS ─────────────────────────────────────────────── */

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 26px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1.5px solid var(--purple);
  color: var(--purple);
  font-size: 14px;
  font-weight: 600;
  transition:
    background 0.2s,
    color 0.2s,
    box-shadow 0.2s;
}

.btn-primary:hover {
  background: var(--purple);
  color: #fff;
  box-shadow: 0 0 24px color-mix(in srgb, var(--purple) 40%, transparent);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 26px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  transition:
    border-color 0.2s,
    color 0.2s;
}

.btn-ghost:hover {
  border-color: color-mix(in srgb, var(--text) 25%, transparent);
  color: var(--text);
}

/* ── Stack chip — design primitive shared by SkillsSection and ExperienceSection ── */

.stack-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 13px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 650;
  color: color-mix(in srgb, var(--text) 60%, transparent);
  background: color-mix(in srgb, var(--text) 3.5%, transparent);
  border: 1px solid color-mix(in srgb, var(--text) 8%, transparent);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--text) 2%, transparent);
}

@media (width <= 640px) {
  .stack-chip {
    min-height: 26px;
    padding: 4px 10px;
    font-size: 11.5px;
    font-weight: 600;
  }
}

.stack-chip--green {
  color: #dffff4;
  background: color-mix(in srgb, var(--green) 11%, transparent);
  border-color: color-mix(in srgb, var(--green) 24%, transparent);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, var(--text) 2%, transparent),
    0 0 18px color-mix(in srgb, var(--green) 8%, transparent);
}

.stack-chip--purple {
  color: #f0e0ff;
  background: color-mix(in srgb, var(--purple) 11%, transparent);
  border-color: color-mix(in srgb, var(--purple) 22%, transparent);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, var(--text) 2%, transparent),
    0 0 18px color-mix(in srgb, var(--purple) 8%, transparent);
}

.stack-chip--blue {
  color: #dfe9ff;
  background: color-mix(in srgb, var(--blue) 10%, transparent);
  border-color: color-mix(in srgb, var(--blue) 22%, transparent);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, var(--text) 2%, transparent),
    0 0 18px color-mix(in srgb, var(--blue) 7%, transparent);
}

.stack-chip--neutral {
  color: color-mix(in srgb, var(--text) 72%, transparent);
  background: color-mix(in srgb, var(--text) 3.5%, transparent);
  border-color: color-mix(in srgb, var(--text) 8%, transparent);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--text) 3%, transparent);
}

/* ── PRINT ───────────────────────────────────────────────── */

@media print {
  /* Page setup */

  body {
    background: #fff !important;
    color: #000 !important;
  }

  /* Hide navigation, decorative blobs, animations, and interactive UI */

  .navbar,
  nav,
  .skip-link,
  .lang-toggle,
  .hero-blob,
  .blob,
  [class*='blob'],
  [class*='glow'],
  [class*='float'],
  [class*='orbit'],
  [class*='particle'],
  .footer-bg,
  .footer-glow,
  .section-tag::before,
  .btn-primary,
  .btn-ghost,
  .btn-resume {
    display: none !important;
  }

  /* Make gradient/clip text visible on paper — browsers do not print
     -webkit-text-fill-color and background-clip: text correctly */

  .text-grad,
  .hero-title,
  [class*='title'],
  h1,
  h2,
  h3 {
    -webkit-text-fill-color: #000 !important;
    background: none !important;
    color: #000 !important;
  }

  /* Section tags (white text on dark bg is invisible on paper) */

  .section-tag {
    -webkit-text-fill-color: #000 !important;
    background: none !important;
    color: #000 !important;
  }

  /* Suppress all animations */

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  /* Ensure cards and containers are legible */

  .bring-card,
  .project-card,
  .how-card,
  .exp-card,
  .stack-chip {
    background: #f5f5f5 !important;
    border-color: #ccc !important;
    box-shadow: none !important;
    color: #000 !important;
  }

  /* Links: show href for reference */

  a[href]::after {
    content: ' (' attr(href) ')';
    font-size: 0.8em;
    color: #555;
  }

  /* Avoid page breaks inside key content blocks */

  .exp-card,
  .project-card,
  .bring-card {
    break-inside: avoid;
  }
}

/* ── Keyframes + accessibility ───────────────────────────── */

/* ════════════════════════════════════════════════════════════
   REDUCED MOTION
════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .badge-pulse,
  .code-block-wrapper,
  .orbit-ring-1,
  .orbit-ring-2,
  .particle,
  .scan-line,
  .float-card,
  .cursor-blink,
  .exp-line-flow::after,
  .fc-dot-live {
    animation: none;
  }

  .journey-panel {
    transition: none;
  }

  .hero-badge,
  .hero-title,
  .hero-subtitle,
  .hero-stats,
  .hero-cta,
  .hero-right {
    animation: none;
    opacity: 1;
  }

  .exp-entry {
    opacity: 1;
    transform: none;
  }
}
