/* ==========================================
   TOKENS (спільні для всіх тем)
========================================== */
:root {
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Plus Jakarta Sans', system-ui, sans-serif;
  --radius-card: 20px;
  --radius-img: 20px;
  --radius-pill: 999px;

  /* Розміри плаваючих кнопок (використовуються для позиціонування) */
  --fab-size: 46px;
  --fab-offset: 28px;
  --fab-gap: 16px;

  /* Спільний перехід кольорів при зміні теми */
  --t-colors: background-color .4s ease, border-color .4s ease, color .4s ease,
              box-shadow .4s ease, filter .4s ease;
}

/* ============ CLASSIC THEME ============ */
[data-theme="classic"] {
  color-scheme: light;

  --bg-canvas: #FAF7F2;
  --bg-surface: #FFFFFF;
  --bg-surface-hover: #f0fdf4;
  --bg-contrast: #071912;
  --bg-contrast-hover: #0A2218;

  --text-primary: #1C2823;
  --text-secondary: #52665A;
  --text-accent: #15803D;

  --text-nav-up-m: #0A2218;

  --text-primary-c: #F0F7F4;
  --text-secondary-c: #A3BFB2;
  --text-accent-c: #4ADE80;

  --brand: #16A34A;
  --brand-hover: #15803D;
  --brand-text: #FFFFFF;

  --border: #E2ECE6;
  --border-c: #153326;
  --border-focus: #15803D;

  --shadow: 0 1px 2px rgba(28, 40, 35, .05), 0 8px 24px rgba(28, 40, 35, .04);
  --box-shadow: 0 8px 20px -4px rgba(28, 40, 35, .3), 0 6px 12px -6px rgba(28, 40, 35, .3);
}

/* ============ CYBER THEME ============ */
[data-theme="cyber"] {
  color-scheme: dark;

  --bg-canvas: #0D0E12;
  --bg-surface: #101218;
  --bg-surface-hover: #22262f;
  --bg-surface-hover_c: #13130c;
  --bg-contrast: #12120f;
  --bg-contrast-hover: #0a0a0d;

  --text-primary: #EAF6F8;
  --text-secondary: #8FA3AC;
  --text-accent: #00F0FF;

  --text-nav-up-m: #e9d605;
  --text-primary-c: #EAF6F8;
  --text-secondary-c: #8FA3AC;
  --text-accent-c: #FCEE09;

  --brand: #FCEE09;
  --brand-hover: #00F0FF;
  --brand-text: #0D0E12;

  --border: #00949d;
  --border-c: #F0FF33;
  --border-focus: #00F0FF;

  --shadow: 0 0 0 1px rgba(0, 240, 255, .08), 0 0 24px rgba(0, 240, 255, .05);
  --box-shadow: 0 0 22px rgba(0, 240, 255, .25);
  --font-display: 'JetBrains Mono', ui-monospace, monospace;
  --radius-img: 0; /* без заокруглень на зображеннях карток */
}

/* ============ GOLDEN THEME ============ */
[data-theme="golden"] {
  color-scheme: dark;

  --bg-canvas: #0F0E13;
  --bg-surface: #17151d;
  --bg-surface-hover: #26221b;
  --bg-contrast: #0A0910;
  --bg-contrast-hover: #100e17;

  --text-primary: #F5EFDD;
  --text-secondary: #B3A98F;
  --text-accent: #FDE047;

  --text-nav-up-m: #ca8a04;
  --text-primary-c: #F5EFDD;
  --text-secondary-c: #B3A98F;
  --text-accent-c: #EAB308;

  --brand: #EAB308;
  --brand-hover: #FACC15;
  --brand-text: #1a1408;

  --border: #2a2620;
  --border-c: #713f12;
  --border-focus: #EAB308;

  --shadow: 0 1px 1px rgba(0, 0, 0, .4), 0 12px 32px rgba(0, 0, 0, .35);
  --box-shadow: 0 12px 32px rgba(234, 179, 8, .2);

  /* Повторювані золоті акценти — в одному місці */
  --brand-gradient: linear-gradient(135deg, #FACC15, #B45309);
  --brand-edge: 1px solid rgba(255, 255, 255, .15);
}

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

html {
  scroll-behavior: smooth;
  /* Стандартна смуга прокручування (Chrome 121+, Firefox, Safari 18.2+) */
  scrollbar-color: var(--brand) var(--bg-canvas);
  scrollbar-width: thin;
}

/* Fallback лише для старих Webkit: у нових браузерах ::-webkit-scrollbar
   ігнорується, якщо задано scrollbar-color/width */
@supports not (scrollbar-color: auto) {
  ::-webkit-scrollbar { width: 10px; }
  ::-webkit-scrollbar-track { background: var(--bg-canvas); }
  ::-webkit-scrollbar-thumb {
    background: var(--brand);
    border-radius: var(--radius-pill);
    border: 2px solid var(--bg-canvas);
  }
  ::-webkit-scrollbar-thumb:hover { background: var(--brand-hover); }
}

body {
  margin: 0;
  background: var(--bg-canvas);
  color: var(--text-secondary);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, .font-display {
  font-family: var(--font-display);
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

/* Плавний перехід кольорів для всіх UI-компонентів при зміні тем */
.card, .card_s, .btn, .tag, section, header, footer, body {
  transition: var(--t-colors);
}

:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

::selection { background: var(--brand); color: var(--brand-text); }

/* Cyber: суцільний фон-підкладка (fixed).
   z-index: -1, щоб не перекривати контент без власного z-index */
[data-theme="cyber"] body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}

/* ==========================================
   LAYOUT
========================================== */
.wrap { max-width: 1152px; margin: 0 auto; padding: 0 24px; }
section { padding: 88px 0; position: relative; z-index: 1; }
@media (max-width: 768px) { section { padding: 60px 0; } }

/* Fade-up: анімація появи + збереження переходу кольорів */
.fade-up {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .6s ease, transform .6s ease, var(--t-colors);
}
.fade-up.visible { opacity: 1; transform: translateY(0); }

/* ==========================================
   CARDS
========================================== */
.card, .card_s {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
}

.card_s { transition: var(--t-colors), transform .25s ease; }

.card_s:hover {
  transform: translateY(-4px);
  border-color: var(--brand);
  background: var(--bg-surface-hover_c);
  box-shadow: var(--box-shadow);
}

/* Картки з fade-up: швидші hover-переходи, повільна поява */
.card_s.fade-up {
  transition: opacity .6s ease, transform .25s ease, border-color .25s ease,
              background-color .25s ease, box-shadow .25s ease;
}
/* .fade-up.visible має таку ж специфічність, як .card_s:hover — повторюємо hover */
.card_s.fade-up.visible:hover { transform: translateY(-4px); }

/* Зображення: зум залишається всередині заокругленої рамки */
.card_s picture,
.card_s .img {
  display: block;
  overflow: hidden;
  border-radius: var(--radius-img);
}

.card_s img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background-color: var(--bg-surface-hover);
  border-radius: var(--radius-img);
  transition: transform .25s ease, filter .25s ease;
}

.card_s .img img { height: 100%; }

.card_s:hover img { transform: scale(1.03); }

.card-contrast {
  background: var(--bg-contrast);
  border: 1px solid var(--border-c);
  color: var(--text-secondary-c);
  --text-primary: var(--text-primary-c);
  --text-secondary: var(--text-secondary-c);
  --text-accent: var(--text-accent-c);
}
.card-contrast :is(h1, h2, h3) { color: var(--text-primary-c); }

/* Golden: скляні панелі */
[data-theme="golden"] .card {
  background: linear-gradient(160deg, rgba(255,255,255,.045), rgba(255,255,255,.01));
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  border: 1px solid var(--border-c);
}

[data-theme="golden"] .card_s {
   border: 1px solid var(--border-c);
}
[data-theme="golden"] .card-contrast {
  background: linear-gradient(160deg, rgba(234,179,8,.08), rgba(15,14,19,.6));
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

/* ==========================================
   BUTTONS & TAGS
========================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 12px;
  font-weight: 600;
  font-size: .94rem;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  transition: var(--t-colors), transform .15s ease;
}
.btn:active { transform: scale(.97); }

.btn-primary { background: var(--brand); color: var(--brand-text); }
.btn-primary:hover { background: var(--brand-hover); }

.btn-outline {
  background: transparent;
  border: 1px solid var(--brand);
  color: var(--text-primary) !important;
}
.btn-outline:hover { background: var(--bg-surface-hover); border-color: var(--brand-hover); }

.btn-small { padding: 9px 16px; font-size: .85rem; border-radius: 9px; }

[data-theme="cyber"] .btn-primary {
  font-family: var(--font-display);
  box-shadow: 0 0 18px color-mix(in srgb, var(--brand) 45%, transparent);
}
[data-theme="golden"] .btn-primary {
  background: var(--brand-gradient);
  box-shadow: 0 0 0 1px rgba(255,255,255,.15) inset, 0 8px 20px rgba(234,179,8,.25);
}
[data-theme="golden"] .btn-primary:hover { filter: brightness(1.08); }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .78rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  color: var(--text-accent);
  background: var(--bg-surface);
}

.status-dot {
  position: relative;
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand);
}
.status-dot::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--brand);
  opacity: .5;
  animation: pulse-ring 2.2s ease-out infinite;
}
@keyframes pulse-ring {
  0%   { transform: scale(.6); opacity: .6; }
  100% { transform: scale(1.8); opacity: 0; }
}

/* ==========================================
   CYBER: augmented-ui
========================================== */
[data-theme="cyber"] [data-augmented-ui] {
  border: 0 !important;
  border-radius: 0 !important;
  --aug-border-all: 1px;
  --aug-border-bg: var(--border);
  --aug-tl: 12px;
  --aug-br: 12px;
}

/* Теги та зображення: менший зріз */
[data-theme="cyber"] .tag[data-augmented-ui], [data-theme="cyber"] .tag,
[data-theme="cyber"] .img[data-augmented-ui] { --aug-tl: 8px; --aug-br: 8px; }

[data-theme="cyber"] .btn-primary[data-augmented-ui] { --aug-border-bg: var(--brand-hover); }
[data-theme="cyber"] .btn-primary[data-augmented-ui]:hover { --aug-border-bg: var(--brand); }
[data-theme="cyber"] .btn-outline[data-augmented-ui] { --aug-border-bg: var(--brand); }
[data-theme="cyber"] .btn-outline[data-augmented-ui]:hover { --aug-border-bg: var(--brand-hover); }

[data-theme="cyber"] .card-contrast[data-augmented-ui] 
{ background: var(--bg-contrast);
   --aug-border-bg: var(--border-c);
}

/* clip-path (augmented-ui) обрізає зовнішні тіні — вимикаємо їх на картках,
   а світіння при hover робимо внутрішнім */
[data-theme="cyber"] .card[data-augmented-ui],
[data-theme="cyber"] .card_s[data-augmented-ui] {
  box-shadow: none !important;
}
[data-theme="cyber"] .card_s[data-augmented-ui]:hover {
  --aug-border-bg: var(--brand);
  box-shadow: inset 0 0 22px color-mix(in srgb, var(--brand) 45%, transparent) !important;
}

/* Hover: світіння навколо зображення + легке підсвічування */
[data-theme="cyber"] .card_s picture { transition: filter .25s ease; }
[data-theme="cyber"] .card_s:hover picture {
  filter: drop-shadow(0 0 8px color-mix(in srgb, var(--brand) 55%, transparent));
}
[data-theme="cyber"] .card_s:hover img { filter: brightness(1.08) saturate(1.1); }

/* ==========================================
   UI: theme menu, language switch, toast
========================================== */
.theme-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 60;
  display: none;
  min-width: 120px;
  padding: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.theme-menu.open { display: block; }

.theme-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: .88rem;
  text-align: left;
  cursor: pointer;
}
.theme-option:hover { background: var(--bg-surface-hover); }

.theme-swatch {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, .1);
}

.lang-switch {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
}
[data-theme="cyber"] .lang-switch { border-radius: 2px; }
.lang-switch .lang-icon { margin-left: 8px; color: var(--text-secondary); }

/* Посилання-кнопки для мультимовності */
.lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 11px;
  border: none;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-secondary);
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .02em;
  cursor: pointer;
  text-decoration: none !important;
}
[data-theme="cyber"] .lang-btn { border-radius: 1px; font-family: var(--font-display); }
.lang-btn[aria-pressed="true"] { background: var(--brand); color: var(--brand-text); }

#toast {
  position: fixed;
  bottom: var(--fab-offset);
  left: 50%;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--bg-contrast);
  color: var(--text-primary-c);
  border: 1px solid var(--border-c);
  border-radius: 12px;
  font-size: .88rem;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 20px);
  transition: opacity .25s ease, transform .25s ease;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ==========================================
   TIMELINE & ACCORDION
========================================== */
.timeline { position: relative; padding-left: 30px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: var(--border);
}
.timeline-item { position: relative; padding-bottom: 32px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: '';
  position: absolute;
  left: -30px;
  top: 22px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--bg-canvas);
  border: 2px solid var(--brand);
}

.accordion-trigger { cursor: pointer; background: transparent; border: none; font: inherit; }
.accordion-body { max-height: 0; overflow: hidden; transition: max-height .35s ease; }
.accordion.open .accordion-body { max-height: 400px; }

/* Іконка плюс/мінус */
.accordion-icon { position: relative; width: 18px; height: 18px; flex-shrink: 0; }
.accordion-icon .bar { position: absolute; background: currentColor; border-radius: 2px; }
.accordion-icon .bar-h { top: 50%; left: 0; width: 100%; height: 2px; transform: translateY(-50%); }
.accordion-icon .bar-v {
  left: 50%;
  top: 0;
  width: 2px;
  height: 100%;
  transform: translateX(-50%);
  transition: transform .3s ease;
}
.accordion.open .accordion-icon .bar-v { transform: translateX(-50%) scaleY(0); }

/* ==========================================
   HERO PHOTO — адаптація під теми
========================================== */
.photo-card {
  --photo-cut: 15.2px;
  --photo-clip: polygon(0 var(--photo-cut), var(--photo-cut) 0, 100% 0,
                        100% calc(100% - var(--photo-cut)), calc(100% - var(--photo-cut)) 100%, 0 100%);
  position: relative;
  flex-shrink: 0;
  width: 256px;
  height: 256px;
  transition: background-color .4s ease, border-color .4s ease, box-shadow .4s ease, padding .3s ease;
}
.photo-img { display: block; width: 100%; height: 100%; object-fit: cover; }
.photo-frame { position: relative; width: 100%; height: 100%; }
.photo-scan,
.hud-corner,
.hud-caption { display: none; }
.photo-badge-row { display: flex; align-items: center; gap: 8px; }

/* Classic */
[data-theme="classic"] .photo-card {
  border-radius: 24px;
  background: linear-gradient(160deg, #0B2417 0%, var(--bg-canvas) 100%);
  box-shadow: var(--shadow);
}
[data-theme="classic"] .photo-img {
  border-radius: 24px;
  border: 2px solid rgba(21, 128, 61, .3);
}

/* Cyber */
[data-theme="cyber"] .photo-card { border-radius: 2px; background: transparent; }
[data-theme="cyber"] .photo-frame {
  padding: 2px;
  background: var(--bg-surface);
  --aug-tl: 18px;
  --aug-br: 18px;
  --aug-border-all: 2px;
  --aug-border-bg: var(--border);
}
[data-theme="cyber"] .photo-img { clip-path: var(--photo-clip); }

[data-theme="cyber"] .photo-scan {
  display: block;
  position: absolute;
  inset: 2px;
  z-index: 2;
  pointer-events: none;
  clip-path: var(--photo-clip);
  background-image: repeating-linear-gradient(0deg, rgba(0,240,255,.09) 0 1px, transparent 2px 6px);
  mix-blend-mode: screen;
}

[data-theme="cyber"] .hud-corner {
  display: block;
  position: absolute;
  z-index: 3;
  width: 14px;
  height: 14px;
  border: 0 solid var(--brand);
}
[data-theme="cyber"] .hud-corner.tr { top: 8px; right: 8px; border-top-width: 2px; border-right-width: 2px; }
[data-theme="cyber"] .hud-corner.bl { bottom: 8px; left: 8px; border-bottom-width: 2px; border-left-width: 2px; }

[data-theme="cyber"] .hud-caption {
  display: block;
  position: absolute;
  bottom: -24px;
  left: 1px;
  white-space: nowrap;
  font-family: var(--font-display);
  font-size: .64rem;
  letter-spacing: .04em;
  color: var(--brand-hover);
}

/* Golden */
[data-theme="golden"] .photo-card {
  border-radius: 24px;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  background: rgba(255, 255, 255, .08);
  border: 2px solid rgba(251, 191, 36, .4);
  box-shadow: 0 0 25px rgba(234, 179, 8, .25);
}
[data-theme="golden"] .photo-img {
  border-radius: 24px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
}
[data-theme="golden"] .photo-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 24px;
  pointer-events: none;
  background: linear-gradient(155deg, rgba(255,255,255,.18), rgba(255,255,255,0) 40%);
}

/* ==========================================
   НАВІГАЦІЯ: hover-ефекти по темах
========================================== */
[data-theme="classic"], .classic { --btn-hover-bg: #15803D; --btn-hover-text: #ffffff; }
[data-theme="golden"],  .golden  { --btn-hover-bg: #eab308; --btn-hover-text: #1a1408; }
[data-theme="cyber"],   .cyber   { --btn-hover-bg: var(--brand-hover); --btn-hover-text: #000000; }

.btn-theme-target {
  display: inline-block;
  padding: 6px 8px;
  border-radius: 8px;
  color: inherit;
  white-space: nowrap;
  text-decoration: none;
}
[data-theme="cyber"] .btn-theme-target,
.cyber .btn-theme-target { border-radius: 0 !important; }

.btn-theme-target:hover {
  background-color: var(--btn-hover-bg) !important;
  color: var(--btn-hover-text) !important;
  text-decoration: none !important;
  text-shadow: .5px 0 0 currentColor, -.5px 0 0 currentColor !important;
}

/* ==========================================
   КНОПКА «ВГОРУ» (адаптивна під 3 теми)
========================================== */
.btn-to-top {
  position: fixed;
  right: var(--fab-offset);
  bottom: var(--fab-offset);
  z-index: 99;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--fab-size);
  height: var(--fab-size);
  border: none;
  cursor: pointer;
  font-size: 1.3rem;
  font-weight: bold;
  background: var(--brand);
  color: var(--brand-text);
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(15px);
  transition: opacity .3s ease, transform .3s ease, visibility .3s ease,
              background-color .25s ease, color .25s ease;
}
.btn-to-top:hover { background: var(--brand-hover); }

/* Клас, який додає скрипт при прокручуванні сторінки */
.btn-to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.btn-to-top.show:hover { transform: translateY(-3px); }

[data-theme="classic"] .btn-to-top,
[data-theme="golden"] .btn-to-top { border-radius: var(--radius-card); }

[data-theme="golden"] .btn-to-top {
  background: var(--brand-gradient);
}
[data-theme="golden"] .btn-to-top:hover { background: var(--brand-hover); }

[data-theme="cyber"] .btn-to-top {
  border-radius: 0;
  --aug-tl: 9px;
  --aug-br: 9px;
  --aug-border-all: 2px;
  --aug-border-bg: var(--brand-hover);
}
[data-theme="cyber"] .btn-to-top:hover { --aug-border-bg: var(--brand); }

/* augmented-ui виставляє position: relative — не даємо зламати fixed */
.btn-to-top[data-augmented-ui] { position: fixed; }
.tg-fab__btn[data-augmented-ui] { position: relative; }

/* ==========================================
   TELEGRAM-БОТ: ПЛАВАЮЧА КНОПКА З GLOW
========================================== */
.tg-fab {
  --tg-glow: var(--brand);
  position: fixed;
  right: var(--fab-offset);
  bottom: calc(var(--fab-offset) + var(--fab-size) + var(--fab-gap));
  z-index: 99;
  filter:
    drop-shadow(0 0 5px color-mix(in srgb, var(--tg-glow) 75%, transparent))
    drop-shadow(0 0 16px color-mix(in srgb, var(--tg-glow) 45%, transparent));
  animation: tg-glow 3.2s ease-in-out infinite;
}
.tg-fab:hover,
.tg-fab:focus-within { animation-play-state: paused; }

@keyframes tg-glow {
  0%, 100% {
    filter:
      drop-shadow(0 0 4px color-mix(in srgb, var(--tg-glow) 65%, transparent))
      drop-shadow(0 0 12px color-mix(in srgb, var(--tg-glow) 35%, transparent));
  }
  50% {
    filter:
      drop-shadow(0 0 7px color-mix(in srgb, var(--tg-glow) 90%, transparent))
      drop-shadow(0 0 24px color-mix(in srgb, var(--tg-glow) 60%, transparent));
  }
}

.tg-fab__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: var(--fab-size);
  min-width: var(--fab-size);
  padding: 0 14px;
  border-radius: var(--radius-card);
  background: var(--brand);
  color: var(--brand-text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .86rem;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .25s ease, transform .15s ease;
}
.tg-fab__btn:hover { background: var(--brand-hover); transform: translateY(-2px); }
.tg-fab__btn:active { transform: scale(.97); }
.tg-fab__label { display: none; }

@media (min-width: 640px) {
  .tg-fab__btn { padding: 0 18px 0 16px; }
  .tg-fab__label { display: inline; }
}

[data-theme="golden"] .tg-fab { --tg-glow: #EAB308; }
[data-theme="golden"] .tg-fab__btn { background: var(--brand-gradient); }
[data-theme="golden"] .tg-fab__btn:hover { background: linear-gradient(135deg, #FDE047, #CA8A04); }

[data-theme="cyber"] .tg-fab__btn {
  border-radius: 0;
  --aug-tl: 10px;
  --aug-br: 10px;
  --aug-border-all: 2px;
  --aug-border-bg: transparent;
}
[data-theme="cyber"] .tg-fab__btn:hover { --aug-border-bg: var(--brand); }

/* ==========================================
   АНІМОВАНІ ІКОНКИ (animateicons.in)
   Резервуємо контейнери для запобігання CLS
========================================== */
animate-icons { display: inline-flex; flex: none; width: 18px; height: 18px; line-height: 0; }
animate-icons[size="16"] { width: 16px; height: 16px; }
animate-icons[size="20"] { width: 20px; height: 20px; }
animate-icons[size="22"] { width: 22px; height: 22px; }

/* Стабільне масштабування SVG всередині кастомних тегів */
animate-icons svg,
animate-icons i { display: block; width: 100%; height: 100%; }

.icon-accent { color: var(--text-accent); }
.hl-icon { color: var(--text-accent-c); }

/* ==========================================
   REDUCED MOTION (в кінці, щоб мати пріоритет)
========================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .tg-fab { animation: none; }
}

/* ==========================================================================
   V2 — DESIGN SYSTEM EXTENSIONS
   Tokens → layout → components. Everything below uses theme tokens above,
   so Classic (light), Cyber (dark) and Golden (dark) all work unchanged.
   ========================================================================== */

/* ---------- Extra tokens ---------- */
:root {
  /* spacing scale (4px base) */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 72px;
  /* fluid type scale */
  --fs-hero: clamp(2.3rem, 1.2rem + 3.4vw, 3.9rem);
  --fs-h2: clamp(1.85rem, 1.3rem + 2vw, 3rem);
  --fs-h3: clamp(1.15rem, 1.05rem + .4vw, 1.4rem);
  --fs-lead: clamp(1.05rem, .98rem + .35vw, 1.25rem);
  --fs-sm: .9rem;
  --fs-xs: .78rem;
  /* layout */
  --wrap: 1152px; --wrap-wide: 1320px; --header-h: 68px;
  /* motion */
  --ease: cubic-bezier(.2, .7, .2, 1);
  --dur-1: .18s; --dur-2: .35s; --dur-3: .6s;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}
[data-theme="classic"] {
  --bg-surface-hover_c: #F4FBF6;
  --accent-soft: color-mix(in srgb, var(--brand) 10%, transparent);
  --grid-dot: rgba(28, 40, 35, .14);
  --device-bg: #14201A;
}
[data-theme="cyber"] {
  --accent-soft: color-mix(in srgb, var(--brand) 12%, transparent);
  --grid-dot: rgba(0, 240, 255, .22);
  --device-bg: #050608;
}
[data-theme="golden"] {
  --bg-surface-hover_c: #1d1a14;
  --accent-soft: color-mix(in srgb, var(--brand) 12%, transparent);
  --grid-dot: rgba(234, 179, 8, .22);
  --device-bg: #050408;
}

/* ---------- Base additions ---------- */
html { -webkit-text-size-adjust: 100%; }
body { overflow-x: hidden; line-height: 1.6; }
img, picture, svg { max-width: 100%; }
a { color: inherit; }
h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
section[id], [id].anchor { scroll-margin-top: calc(var(--header-h) + 12px); }
.wrap { max-width: var(--wrap); padding-inline: clamp(16px, 4vw, 32px); }
.wrap-wide { max-width: var(--wrap-wide); margin-inline: auto; padding-inline: clamp(16px, 4vw, 32px); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: fixed; left: 12px; top: -60px; z-index: 200; padding: 10px 16px; border-radius: 10px; background: var(--brand); color: var(--brand-text); font-weight: 600; text-decoration: none; transition: top var(--dur-1) ease; }
.skip-link:focus { top: 12px; }
.h2 { font-size: var(--fs-h2); font-weight: 700; line-height: 1.1; letter-spacing: -.02em; }
.h3 { font-size: var(--fs-h3); font-weight: 700; line-height: 1.25; }
.lead { font-size: var(--fs-lead); color: var(--text-secondary); max-width: 62ch; }
.muted { color: var(--text-secondary); }
.sec-head { max-width: 46rem; margin-bottom: clamp(28px, 5vw, 56px); }
.sec-head .tag { margin-bottom: var(--sp-4); }
.sec-head p.lead { margin-top: var(--sp-3); }
section { padding: clamp(56px, 8vw, 104px) 0; }
.icon-btn-fix animate-icons { pointer-events: none; }

/* Theme-switch animation: only while the class is set (JS adds it for ~450ms) */
html.theme-anim *, html.theme-anim *::before, html.theme-anim *::after {
  transition: background-color .4s ease, border-color .4s ease, color .4s ease, fill .4s ease, stroke .4s ease, box-shadow .4s ease !important;
}

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; border-bottom: 1px solid var(--border);
  background-color: color-mix(in srgb, var(--bg-canvas) 82%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.site-header__row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); min-height: var(--header-h); }
.brand { display: flex; align-items: center; gap: var(--sp-3); text-decoration: none; min-width: 0; }
.brand__mono { display: none; width: 38px; height: 38px; border-radius: 11px; align-items: center; justify-content: center; background: var(--brand); color: var(--brand-text); font: 800 .9rem var(--font-display); }
.brand__text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand__name { font: 600 1rem var(--font-display); color: var(--text-primary); white-space: nowrap; }
.brand__status { display: flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--text-secondary); margin-top: 2px; }
.nav-primary { display: none; align-items: center; gap: 4px; font-size: .9rem; font-weight: 500; }
.nav-primary a { padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--text-nav-up-m); white-space: nowrap; }
.nav-primary a:hover { background: var(--btn-hover-bg); color: var(--btn-hover-text); }
.nav-primary a[aria-current="true"] { box-shadow: inset 0 -2px 0 var(--brand); }
.header-tools { display: flex; align-items: center; gap: var(--sp-2); flex-shrink: 0; }
.cta-desktop { display: none; }
.burger { width: 40px; height: 40px; padding: 0; justify-content: center; }
.mobile-menu { display: none; flex-direction: column; border-top: 1px solid var(--border); }
.mobile-menu.open { display: flex; }
.mobile-menu a { display: block; padding: 16px clamp(16px, 4vw, 32px); border-bottom: 1px solid var(--border); font-size: 1.1rem; font-weight: 500; color: var(--text-nav-up-m); text-decoration: none; min-height: 52px; }
.mobile-menu a:last-child { border-bottom: 0; }
@media (min-width: 480px) { .brand__status { display: flex; } }
@media (max-width: 479px) { .brand__mono { display: inline-flex; } .brand__text { display: none; } }
@media (min-width: 640px) { .cta-desktop { display: inline-flex; } }
@media (min-width: 1100px) { .nav-primary { display: flex; } .burger, .mobile-menu { display: none !important; } }

/* Light / Dark segmented switch (language-independent, icon only) */
.theme-seg { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--bg-surface); }
.theme-seg__btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: var(--radius-pill); background: transparent; color: var(--text-secondary); cursor: pointer; transition: background-color var(--dur-2) ease, color var(--dur-2) ease, transform var(--dur-2) var(--ease); }
.theme-seg__btn svg { width: 18px; height: 18px; transition: transform var(--dur-3) var(--ease); }
.theme-seg__btn:hover { color: var(--text-primary); }
.theme-seg__btn[aria-pressed="true"] { background: var(--brand); color: var(--brand-text); }
.theme-seg__btn[aria-pressed="true"] svg { transform: rotate(360deg) scale(1.05); }
.theme-seg__btn[data-mode="dark"][aria-pressed="true"] svg { transform: rotate(-20deg) scale(1.05); }
[data-theme="cyber"] .theme-seg, [data-theme="cyber"] .theme-seg__btn { border-radius: 2px; }
.palette-dot { display: none; width: 34px; height: 34px; padding: 0; border: 1px solid var(--border); border-radius: 50%; background: var(--bg-surface); cursor: pointer; align-items: center; justify-content: center; }
.palette-dot span { width: 16px; height: 16px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 2px var(--bg-surface), 0 0 0 3px var(--border); }
html[data-theme="cyber"] .palette-dot, html[data-theme="golden"] .palette-dot { display: inline-flex; }
html[data-theme="golden"] .palette-dot span { background: var(--brand-gradient); }

/* Language switch links (kept from v1) */
.lang-btn { min-height: 34px; }

/* ---------- Hero ---------- */
.hero { padding-top: clamp(24px, 4vw, 48px); padding-bottom: clamp(8px, 2vw, 24px); }
.hero__grid { display: grid; gap: clamp(28px, 5vw, 56px); align-items: center; }
@media (min-width: 960px) { .hero__grid { grid-template-columns: minmax(0, 1fr) auto; } }
.hero__title { font-size: var(--fs-hero); font-weight: 700; line-height: 1.03; letter-spacing: -.035em; max-width: 19ch; }
.hero__title em { font-style: normal; color: var(--text-accent); }
.hero__sub { margin-top: var(--sp-5); font-size: var(--fs-lead); max-width: 52ch; }
.hero__value { margin-top: var(--sp-3); font-size: var(--fs-sm); max-width: 60ch; }
.chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-5); }
.chip { display: inline-flex; align-items: center; padding: 7px 14px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--bg-surface); color: var(--text-primary); font: 600 .84rem var(--font-body); }
[data-theme="cyber"] .chip { border-radius: 2px; font-family: var(--font-display); }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: var(--sp-5); }
.hero__aside { display: flex; flex-direction: column; align-items: center; gap: var(--sp-3); justify-self: center; }
@media (min-width: 960px) { .hero__aside { justify-self: end; } }
.hero__highlights { display: grid; gap: var(--sp-4); margin-top: clamp(32px, 5vw, 56px); padding: var(--sp-5); }
@media (min-width: 760px) { .hero__highlights { grid-template-columns: repeat(3, 1fr); gap: var(--sp-5); } }
.hl { display: flex; gap: var(--sp-3); align-items: flex-start; font-size: var(--fs-sm); color: var(--text-secondary-c); }
.hero__loc { grid-column: 1 / -1; padding-top: var(--sp-4); border-top: 1px solid var(--border-c); font-size: var(--fs-xs); color: var(--text-secondary-c); }
.btn { min-height: 44px; }
@media (max-width: 639px) { .hero__actions .btn { width: 100%; justify-content: center; } }

/* ---------- Projects ---------- */
.projects { padding-top: clamp(24px, 4vw, 48px); }
.pgrid { display: grid; grid-template-columns: 1fr; gap: clamp(20px, 3vw, 40px); }
@media (min-width: 680px) { .pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pcard { position: relative; display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.pcard .img { margin: 10px 10px 0; aspect-ratio: 16 / 9; border-radius: calc(var(--radius-card) - 8px); background: var(--bg-surface-hover); }
.pcard .img picture, .pcard .img img { display: block; width: 100%; height: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.pcard__body { display: flex; flex-direction: column; flex: 1; gap: var(--sp-3); padding: clamp(18px, 2.4vw, 28px); }
.pcard__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.pcard__tags .tag { padding: 4px 10px; }
.pcard__title { font-size: var(--fs-h3); font-weight: 700; line-height: 1.2; }
.pcard__link { text-decoration: none; color: inherit; }
.pcard__link::after { content: ''; position: absolute; inset: 0; z-index: 1; }
.pcard__link:focus-visible { outline: none; }
.pcard:has(.pcard__link:focus-visible) { outline: 2px solid var(--border-focus); outline-offset: 3px; }
.pcard__desc { font-size: var(--fs-sm); color: var(--text-secondary); max-width: 58ch; }
.pcard__foot { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-4); margin-top: auto; padding-top: var(--sp-3); }
.pcard__metrics { display: flex; flex-wrap: wrap; gap: 4px var(--sp-5); font: 700 1rem var(--font-display); color: var(--text-primary); }
.pcard__arrow { color: var(--text-accent); transition: transform var(--dur-2) var(--ease); flex-shrink: 0; }
.pcard:hover .pcard__arrow { transform: translate(3px, -3px); }
.pcard__badge { position: absolute; z-index: 2; top: 22px; left: 22px; padding: 6px 12px; border-radius: var(--radius-pill); background: var(--brand); color: var(--brand-text); font: 700 .74rem var(--font-body); letter-spacing: .02em; box-shadow: var(--shadow); }
[data-theme="golden"] .pcard__badge { background: var(--brand-gradient); }
.pcard:hover { transform: translateY(-4px); }
.pcard:hover .img img { transform: scale(1.04); }
.pcard .img img { transition: transform .6s var(--ease), filter .25s ease; }
.pcard__extra { position: relative; z-index: 2; font-size: var(--fs-xs); font-weight: 600; color: var(--text-accent); text-decoration: none; }
.pcard__extra:hover { text-decoration: underline; }
[data-theme="cyber"] .pcard__badge { border-radius: 0; }

/* ---------- Achievements ---------- */
.metrics { background: var(--bg-contrast); border-block: 1px solid var(--border-c); color: var(--text-secondary-c); position: relative; overflow: hidden;
  --text-primary: var(--text-primary-c); --text-secondary: var(--text-secondary-c); --text-accent: var(--text-accent-c); }
.metrics::before { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background: radial-gradient(60% 80% at 100% 0%, color-mix(in srgb, var(--brand) 14%, transparent), transparent 70%); }
.metrics .h2 { color: var(--text-primary-c); }
.metrics .tag { background: transparent; border-color: var(--border-c); color: var(--text-accent-c); }
.mgrid { position: relative; display: grid; grid-template-columns: 1fr; border-top: 1px solid var(--border-c); }
@media (min-width: 640px) { .mgrid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .mgrid { grid-template-columns: repeat(4, 1fr); } }
.mcard { position: relative; display: flex; flex-direction: column; gap: var(--sp-3); padding: clamp(24px, 3vw, 40px) clamp(0px, 2vw, 28px) clamp(24px, 3vw, 40px) 0; border-bottom: 1px solid var(--border-c); }
@media (min-width: 640px) { .mcard { padding-left: clamp(16px, 2vw, 28px); border-left: 1px solid var(--border-c); } .mcard:nth-child(odd) { border-left: 0; padding-left: 0; } }
@media (min-width: 1100px) { .mcard { border-left: 1px solid var(--border-c); padding-left: 28px; } .mcard:first-child { border-left: 0; padding-left: 0; } .mcard:nth-child(odd) { border-left: 1px solid var(--border-c); padding-left: 28px; } .mcard:first-child { border-left: 0; padding-left: 0; } }
.mcard__idx { font: 500 var(--fs-xs) var(--font-mono); letter-spacing: .08em; color: var(--text-secondary-c); }
.mcard__num { font: 800 clamp(3.2rem, 2rem + 4.6vw, 5.8rem)/1 var(--font-display); letter-spacing: -.04em; color: var(--text-accent-c); font-variant-numeric: tabular-nums; }
.mcard__num small { font-size: .38em; letter-spacing: 0; margin-left: .15em; color: var(--text-primary-c); }
.mcard__desc { max-width: 24ch; color: var(--text-primary-c); font-size: var(--fs-sm); }
.mcard__bar { height: 3px; width: 44px; border-radius: 3px; background: var(--brand); transform-origin: left; transform: scaleX(0); transition: transform 1s var(--ease) .2s; }
.mcard.visible .mcard__bar { transform: scaleX(1); }
.mcard__link { margin-top: auto; padding-top: var(--sp-2); font-size: var(--fs-xs); font-weight: 600; color: var(--text-accent-c); text-decoration: none; }
.mcard__link:hover { text-decoration: underline; }

/* ---------- Design approach: interactive workflow ---------- */
.approach__split { display: grid; gap: clamp(24px, 4vw, 56px); }
.steps { margin-top: var(--sp-2); }
.steps__scroll { overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: var(--sp-3); scrollbar-width: thin; }
.steps__list { --p: 0; position: relative; display: grid; grid-template-columns: repeat(5, minmax(128px, 1fr)); min-width: 640px; }
.steps__list::before, .steps__list::after { content: ''; position: absolute; top: 23px; left: 10%; right: 10%; height: 2px; border-radius: 2px; }
.steps__list::before { background: var(--border); }
.steps__list::after { background: var(--brand); transform-origin: left; transform: scaleX(var(--p)); transition: transform .7s var(--ease); }
.step { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: var(--sp-3); padding: 0 6px; border: 0; background: transparent; text-align: center; cursor: pointer; scroll-snap-align: center; min-height: 44px; }
.step__node { display: flex; width: 48px; height: 48px; align-items: center; justify-content: center; border: 2px solid var(--border); border-radius: 50%; background: var(--bg-canvas); color: var(--text-secondary); transition: all var(--dur-2) var(--ease); }
[data-theme="cyber"] .step__node { border-radius: 0; }
.step__label { font: 600 .84rem var(--font-body); color: var(--text-secondary); transition: color var(--dur-2) ease; }
.step:hover .step__node { border-color: var(--brand); color: var(--text-primary); }
.step.is-done .step__node { border-color: var(--brand); color: var(--text-accent); }
.step[aria-selected="true"] .step__node { background: var(--brand); border-color: var(--brand); color: var(--brand-text); transform: scale(1.12); box-shadow: 0 0 0 6px var(--accent-soft); }
.step[aria-selected="true"] .step__label { color: var(--text-primary); }
.step__panel { margin-top: var(--sp-5); padding: clamp(20px, 3vw, 32px); }
.step__panel[hidden] { display: none; }
.step__panel h3 { margin-bottom: var(--sp-2); }
.step__panel p { max-width: 60ch; }
.step__panel.enter { animation: panel-in .45s var(--ease); }
.wcag-band { display: flex; align-items: center; gap: var(--sp-3); margin-top: var(--sp-4); padding: var(--sp-3) var(--sp-4); border: 1px dashed var(--brand); border-radius: 14px; background: var(--accent-soft); color: var(--text-primary); font-size: var(--fs-sm); font-weight: 500; }
.principles { display: grid; gap: var(--sp-4); margin-top: clamp(32px, 5vw, 56px); }
@media (min-width: 760px) { .principles { grid-template-columns: repeat(3, 1fr); } }
.principles__title { margin-top: clamp(32px, 5vw, 56px); font: 700 var(--fs-sm) var(--font-display); letter-spacing: .06em; text-transform: uppercase; color: var(--text-accent); }
.principles + .principles__title { margin-top: 56px; }
.pcell { display: flex; gap: var(--sp-4); padding: var(--sp-5); }
.pcell__icon, .icon-chip { display: inline-flex; flex-shrink: 0; width: 42px; height: 42px; align-items: center; justify-content: center; border-radius: 12px; border: 1px solid var(--border); background: var(--bg-canvas); color: var(--text-accent); }
.help-grid { display: grid; gap: var(--sp-4); grid-template-columns: 1fr; margin-top: var(--sp-4); }
@media (min-width: 640px) { .help-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .help-grid { grid-template-columns: repeat(4, 1fr); } }
.help-grid .card { padding: var(--sp-5); }

/* ---------- Skills ---------- */
.sgrid { display: grid; gap: var(--sp-4); grid-template-columns: 1fr; }
@media (min-width: 640px) { .sgrid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .sgrid { grid-template-columns: repeat(3, 1fr); } }
.scard { --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 0%; position: relative; padding: var(--sp-5); transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)); transition: transform .25s ease, var(--t-colors); will-change: transform; overflow: hidden; }
.scard::after { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s ease; background: radial-gradient(260px circle at var(--mx) var(--my), color-mix(in srgb, var(--brand) 16%, transparent), transparent 70%); }
.scard:hover::after, .scard:focus-within::after { opacity: 1; }
.scard:hover { border-color: var(--brand); }
.scard__head { display: flex; align-items: center; gap: var(--sp-3); font: 700 1.05rem var(--font-display); color: var(--text-primary); }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: var(--sp-4); }
.pill { padding: 6px 12px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--bg-canvas); color: var(--text-secondary); font-size: var(--fs-xs); font-weight: 500; transition: border-color var(--dur-2) ease, color var(--dur-2) ease, transform var(--dur-2) var(--ease); }
.scard:hover .pill { border-color: var(--brand); color: var(--text-primary); }
.scard:hover .pill:nth-child(odd) { transform: translateY(-2px); }
[data-theme="cyber"] .pill { border-radius: 2px; }
.langs { display: flex; flex-wrap: wrap; gap: var(--sp-6); margin-top: clamp(28px, 4vw, 48px); padding-top: var(--sp-6); border-top: 1px solid var(--border); font-size: var(--fs-sm); }
.langs strong { display: block; color: var(--text-primary); }
.langs h3 { width: 100%; }

/* ---------- About / services / contact ---------- */
.about__grid { display: grid; gap: clamp(28px, 5vw, 64px); }
@media (min-width: 960px) { .about__grid { grid-template-columns: .9fr 1.1fr; } }
.timeline__date { font: 600 var(--fs-sm) var(--font-display); color: var(--text-accent); }
.timeline h3 { margin-top: 4px; font-size: 1.1rem; font-weight: 600; }
.timeline p { margin-top: 4px; font-size: var(--fs-sm); }
.services { display: grid; gap: var(--sp-4); }
.accordion-trigger { padding: var(--sp-5); min-height: 64px; color: inherit; }
.accordion-trigger .acc-title { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; font: 600 1rem var(--font-display); color: var(--text-primary); }
.accordion-body p { padding: 0 var(--sp-5) var(--sp-5); max-width: 62ch; font-size: var(--fs-sm); }
.accordion-foot { display: flex; justify-content: center; padding-bottom: var(--sp-4); }
.contact__card { padding: clamp(28px, 6vw, 72px); text-align: center; margin-top: var(--sp-7); }
.contact__card h2 { font-size: var(--fs-h2); font-weight: 700; line-height: 1.1; max-width: 22ch; margin-inline: auto; }
.contact__card p { margin: var(--sp-4) auto 0; max-width: 46ch; }
.contact__card .contact__tag {
  position: absolute;
  top: clamp(18px, 3vw, 28px);
  left: clamp(18px, 3vw, 28px);
  z-index: 2;
  margin: 0;
  max-width: none;
  background: transparent;
  border-color: var(--border-c);
}
.contact__card--labeled .contact__body { padding-top: clamp(18px, 2.5vw, 26px); }
.btn-row { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--sp-3); margin-top: var(--sp-6); }
.btn-ghost-c { border: 1px solid var(--border-c); color: var(--text-primary-c); }
.btn-ghost-c:hover { background: color-mix(in srgb, var(--brand) 12%, transparent); }
@media (max-width: 639px) { .btn-row .btn { width: 100%; justify-content: center; } }
.social-row { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: var(--sp-5); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: clamp(40px, 6vw, 72px) 0 var(--sp-6); }
.footer__grid { display: grid; gap: var(--sp-6); }
@media (min-width: 760px) { .footer__grid { grid-template-columns: 1.3fr 1fr 1fr; } }
.footer__brand .brand__name { font-size: 1.15rem; }
.footer__brand p { margin-top: var(--sp-2); font-size: var(--fs-sm); }
.footer__h { font: 700 var(--fs-xs) var(--font-display); letter-spacing: .08em; text-transform: uppercase; color: var(--text-accent); margin-bottom: var(--sp-3); }
.footer__nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px var(--sp-4); }
.footer__nav a, .footer__list a { display: inline-flex; align-items: center; min-height: 40px; font-size: var(--fs-sm); color: var(--text-primary); text-decoration: none; }
.footer__nav a:hover, .footer__list a:hover { color: var(--text-accent); text-decoration: underline; }
.footer__list { display: flex; flex-direction: column; }
.footer__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--sp-3); margin-top: var(--sp-7); padding-top: var(--sp-5); border-top: 1px solid var(--border); font-size: var(--fs-xs); }

/* Entry animations: respect reduced motion by default CSS below */
.rise { opacity: 0; transform: translateY(16px); animation: panel-in .8s var(--ease) forwards; }
.rise:nth-child(2) { animation-delay: .08s; } .rise:nth-child(3) { animation-delay: .16s; } .rise:nth-child(4) { animation-delay: .24s; }

/* Cyber polish for new cards */
[data-theme="cyber"] .pcard[data-augmented-ui], [data-theme="cyber"] .scard[data-augmented-ui] { box-shadow: none !important; }
[data-theme="cyber"] .bcard, [data-theme="cyber"] .flow__item, [data-theme="cyber"] .swatch, [data-theme="cyber"] .placeholder { border-radius: 0; }
[data-theme="cyber"] .step__panel[data-augmented-ui] { border: 0 !important; }
.fade-up { will-change: auto; }
.visible.fade-up { will-change: auto; }

@media (prefers-reduced-motion: reduce) {
  .rise, .tabpanel.enter, .step__panel.enter { animation: none; opacity: 1; transform: none; }
  .fade-up { opacity: 1; transform: none; }
  .scard, .pcard, .device { transform: none !important; }
  .mcard__bar { transform: scaleX(1); transition: none; }
}
@media (hover: none) { .scard { transform: none !important; } }

/* no-JS safety: never leave content hidden */
html:not(.js) .fade-up { opacity: 1; transform: none; }
html:not(.js) .tabpanel[hidden], html:not(.js) .step__panel[hidden] { display: block; }

.bcard .ctx li::before { display: none; }
.bcard .ctx .tag { padding: 6px 12px; }

.editor { scroll-margin-top: calc(var(--header-h) + 12px); }

/* ---------- About page ---------- */
.about-hero { padding-top: clamp(24px, 4vw, 56px); }
.about-hero__grid { display: grid; gap: clamp(24px, 5vw, 64px); align-items: center; }
@media (min-width: 900px) { .about-hero__grid { grid-template-columns: auto minmax(0, 1fr); } }
.about-hero .photo-card { justify-self: start; }
.about-title { font-size: clamp(2.2rem, 1.2rem + 3.6vw, 4rem); font-weight: 700; line-height: 1.05; letter-spacing: -.03em; max-width: 18ch; margin-top: var(--sp-4); }
.about-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4) var(--sp-5); margin-top: var(--sp-6); padding-top: var(--sp-5); border-top: 1px solid var(--border); }
@media (min-width: 760px) { .about-facts { grid-template-columns: repeat(4, 1fr); } }
.about-facts dt { font: 600 var(--fs-xs) var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--text-secondary); }
.about-facts dd { margin: 4px 0 0; font-weight: 600; color: var(--text-primary); }
.about-cols { display: grid; gap: clamp(24px, 4vw, 48px); }
@media (min-width: 960px) { .about-cols { grid-template-columns: 1.3fr 1fr; align-items: start; } }
.about-side { display: grid; gap: var(--sp-4); }
.about-side .card { padding: var(--sp-5); }
.about-side h3 { display: flex; align-items: center; gap: var(--sp-3); font: 700 1.05rem var(--font-display); color: var(--text-primary); }
.about-side p { margin-top: var(--sp-3); font-size: var(--fs-sm); }
.link-more { display: inline-flex; align-items: center; min-height: 44px; margin-top: var(--sp-4); font-weight: 600; color: var(--text-accent); text-decoration: none; }
.link-more:hover { text-decoration: underline; }
.footer__logo { display: inline-flex; width: 44px; height: 44px; margin-bottom: var(--sp-3); border-radius: 12px; align-items: center; justify-content: center; background: var(--brand); color: var(--brand-text); font: 800 1rem var(--font-display); text-decoration: none; transition: transform var(--dur-2) var(--ease); }
.footer__logo:hover { transform: rotate(-6deg) scale(1.06); }

/* OS monogram is the About-page link; always visible */
.brand__mono { display: inline-flex !important; text-decoration: none; flex-shrink: 0; transition: transform var(--dur-2) var(--ease); }
.brand__mono:hover { transform: rotate(-6deg) scale(1.05); }

/* Cyber theme: clipped top and bottom logos */
[data-theme="cyber"] .brand__mono,
[data-theme="cyber"] .footer__logo {
  border-radius: 0;
  --aug-tl: 9px;
  --aug-br: 9px;
}
.brand__text { text-decoration: none; }
@media (max-width: 479px) { .brand__text { display: none; } }

/* Shared entrance keyframes (used by .rise and the workflow panels) */
@keyframes panel-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- About page (CV) ---------- */
.value-grid { display: grid; gap: var(--sp-4); grid-template-columns: 1fr; }
@media (min-width: 860px) { .value-grid { grid-template-columns: repeat(3, 1fr); } }
.value-grid .card { padding: var(--sp-5); }
.value__n { display: block; margin-bottom: var(--sp-3); font: 500 var(--fs-xs) var(--font-mono); letter-spacing: .08em; color: var(--text-accent); }
.value-grid .h3 { margin-bottom: var(--sp-2); }
.xp-list { display: grid; gap: var(--sp-5); }
.xp { padding: clamp(20px, 3vw, 36px); }
.xp__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--sp-2) var(--sp-5); margin-bottom: var(--sp-4); }
.xp__proj + .xp__proj { margin-top: var(--sp-5); padding-top: var(--sp-5); border-top: 1px dashed var(--border); }
.xp__proj h4 { margin: 0 0 var(--sp-3); font: 700 1rem var(--font-display); color: var(--text-primary); }
.xp__rows { display: grid; gap: var(--sp-3); margin: 0; }
.xp__rows > div { display: grid; gap: 4px; }
@media (min-width: 760px) { .xp__rows > div { grid-template-columns: 120px minmax(0, 1fr); gap: var(--sp-4); } }
.xp__rows dt { font: 600 var(--fs-xs) var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--text-secondary); padding-top: 3px; }
.xp__rows dd { margin: 0; font-size: var(--fs-sm); color: var(--text-secondary); max-width: 75ch; }
.xp__res dt { color: var(--text-accent); }
.xp__res dd { color: var(--text-primary); font-weight: 500; }
.about-skills .card { padding: var(--sp-5); }
.about-skills { grid-template-columns: 1fr; }
@media (min-width: 640px) { .about-skills { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .about-skills { grid-template-columns: repeat(3, 1fr); } }
.about-skills--2 { grid-template-columns: 1fr; }
@media (min-width: 760px) { .about-skills--2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .about-skills--2 { grid-template-columns: repeat(2, 1fr); } }
.about-trio { display: grid; gap: var(--sp-4); }
@media (min-width: 960px) { .about-trio { grid-template-columns: 1.2fr 1.2fr .8fr; } }
.about-trio .card { padding: var(--sp-5); }
.lang-list { display: grid; gap: 6px; margin-top: var(--sp-3); }
.lang-list li { display: flex; justify-content: space-between; gap: var(--sp-3); font-size: var(--fs-sm); }
.lang-list strong { color: var(--text-primary); }

/* ---------- "How I work" workflow: no horizontal scrolling at any width ---------- */
.steps__scroll { overflow: visible; padding-bottom: 0; }
.steps__list { min-width: 0; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.step { min-width: 0; min-height: 44px; }
.step__label { overflow-wrap: break-word; hyphens: auto; line-height: 1.25; }
.step:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 3px; border-radius: 12px; }
.step__node, .step__label { transition: background-color var(--dur-2) ease, border-color var(--dur-2) ease, color var(--dur-2) ease, transform var(--dur-2) var(--ease), box-shadow var(--dur-2) ease; }

/* Mobile / small tablets: vertical stepper — every stage visible, connector runs top → bottom */
@media (max-width: 599px) {
  .steps__list { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .steps__list::before, .steps__list::after { left: 23px; right: auto; top: 26px; bottom: 26px; width: 2px; height: auto; }
  .steps__list::after { transform-origin: top; transform: scaleY(var(--p)); }
  .step { flex-direction: row; align-items: center; justify-content: flex-start; gap: 14px; min-height: 52px; padding: 2px 12px 2px 0; text-align: left; border-radius: 14px; transition: background-color var(--dur-2) ease; }
  .step__label { font-size: .98rem; }
  .step[aria-selected="true"] { background: var(--accent-soft); }
  .step__panel { margin-top: var(--sp-4); }
}
@media (min-width: 600px) and (max-width: 899px) { .step { padding-inline: 4px; } .step__label { font-size: .8rem; } }
@media (prefers-reduced-motion: reduce) { .steps__list::after, .step__node, .step__label { transition: none; } }
[data-theme="cyber"] .step, [data-theme="cyber"] .wcag-band { border-radius: 0; }

/* ==========================================================================
   V3 — INTERACTIVE EFFECTS (js/effects.js)
   ========================================================================== */

/* ---------- 1. Project card images: 4 / 3 for every theme ---------- */
.pcard .img { aspect-ratio: 4 / 3; }
.pcard .img picture, .pcard .img img { width: 100%; height: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: center; }

/* ---------- 2. Image lens (Light + Gold; the script never shows it in Cyber) ---------- */
.pcard .img { position: relative; }
.lens { position: absolute; top: 0; left: 0; z-index: 2; width: var(--lens-size, 128px); height: var(--lens-size, 128px); border-radius: 50%; pointer-events: none; opacity: 0; scale: .6; background-repeat: no-repeat; background-color: var(--bg-surface); transition: opacity .2s ease, scale .28s var(--ease); will-change: translate; }
.lens.is-on { opacity: 1; scale: 1; }
[data-theme="cyber"] .lens { display: none; }
[data-theme="classic"] .lens { --lens-size: 124px; border: 2px solid rgba(255, 255, 255, .95); box-shadow: 0 10px 28px rgba(28, 40, 35, .28), 0 0 0 1px rgba(22, 163, 74, .35); }
[data-theme="golden"] .lens { --lens-size: 148px; border: 2px solid #FDE047; box-shadow: 0 0 0 1px rgba(250, 204, 21, .45), 0 0 30px rgba(250, 204, 21, .38), inset 0 0 22px rgba(0, 0, 0, .4); }
[data-theme="golden"] .lens::after { content: ''; position: absolute; inset: 5px; border-radius: 50%; border: 1px solid rgba(253, 224, 71, .35); }
/* the lens replaces the zoom-on-hover while it is available */
@media (hover: hover) and (pointer: fine) { [data-theme="classic"] .pcard:hover .img img, [data-theme="golden"] .pcard:hover .img img { transform: none; } }

/* ---------- 3. Bento small cards (shared surface system, per-theme finish) ---------- */
:is(.help-grid .card, .pcell, .scard, .value-grid .card, .about-skills .card, .about-trio .card) {
  position: relative; isolation: isolate; overflow: hidden;
  background-image: linear-gradient(165deg, color-mix(in srgb, var(--bg-surface) 88%, #fff) 0%, var(--bg-surface) 55%);
  transition: transform var(--dur-2) var(--ease), border-color var(--dur-2) ease, box-shadow var(--dur-2) ease, background-color var(--dur-2) ease;
}
:is(.help-grid .card, .pcell, .scard, .value-grid .card, .about-skills .card, .about-trio .card)::before {
  content: ''; position: absolute; z-index: -1; right: -40%; top: -60%; width: 90%; aspect-ratio: 1; border-radius: 50%; pointer-events: none; opacity: .0;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--brand) 26%, transparent), transparent 72%); transition: opacity var(--dur-3) ease, transform var(--dur-3) var(--ease); transform: scale(.7);
}
:is(.help-grid .card, .pcell, .value-grid .card, .about-skills .card, .about-trio .card)::after {
  content: ''; position: absolute; z-index: -1; left: 18px; right: 18px; top: 0; height: 2px; border-radius: 0 0 2px 2px; background: linear-gradient(90deg, transparent, var(--brand), transparent); opacity: .0; transition: opacity var(--dur-2) ease;
}
:is(.help-grid .card, .pcell, .scard, .value-grid .card, .about-skills .card, .about-trio .card):hover::before { opacity: 1; transform: scale(1); }
:is(.help-grid .card, .pcell, .value-grid .card, .about-skills .card, .about-trio .card):hover::after { opacity: .9; }
:is(.help-grid .card, .pcell, .value-grid .card, .about-skills .card, .about-trio .card):hover { transform: translateY(-3px); }
.icon-chip, .pcell__icon { background: linear-gradient(145deg, var(--accent-soft), transparent), var(--bg-canvas); box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 40%, transparent); transition: transform var(--dur-2) var(--ease), border-color var(--dur-2) ease; }
:is(.help-grid .card, .pcell):hover :is(.icon-chip, .pcell__icon) { transform: translateY(-2px) rotate(-4deg); border-color: var(--brand); }
.value__n { display: inline-block; padding: 2px 8px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--accent-soft); }
/* Light: clean surfaces, soft neutral depth */
[data-theme="classic"] :is(.help-grid .card, .pcell, .scard, .value-grid .card, .about-skills .card, .about-trio .card) { box-shadow: 0 1px 0 rgba(255, 255, 255, .8) inset, 0 1px 2px rgba(28, 40, 35, .05), 0 10px 24px -14px rgba(28, 40, 35, .18); }
[data-theme="classic"] :is(.help-grid .card, .pcell, .scard, .value-grid .card, .about-skills .card, .about-trio .card):hover { border-color: color-mix(in srgb, var(--brand) 55%, var(--border)); box-shadow: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 16px 32px -16px rgba(22, 163, 74, .35); }
/* Gold: dark glass with warm hairlines */
[data-theme="golden"] :is(.help-grid .card, .pcell, .scard, .value-grid .card, .about-skills .card, .about-trio .card) { background-image: linear-gradient(160deg, rgba(253, 224, 71, .07), rgba(255, 255, 255, .01) 55%); box-shadow: inset 0 1px 0 rgba(253, 224, 71, .14), 0 14px 30px -18px rgba(0, 0, 0, .8); }
[data-theme="golden"] :is(.help-grid .card, .pcell, .scard, .value-grid .card, .about-skills .card, .about-trio .card):hover { border-color: rgba(253, 224, 71, .55); box-shadow: inset 0 1px 0 rgba(253, 224, 71, .3), 0 0 0 1px rgba(253, 224, 71, .12), 0 18px 36px -16px rgba(250, 204, 21, .3); }
/* Cyber: circuit grid + neon inner edge (augmented-ui clips outer shadows, so everything is inset) */
[data-theme="cyber"] :is(.help-grid .card, .pcell, .scard, .value-grid .card, .about-skills .card, .about-trio .card) {
  background-image: none; background-color: var(--bg-surface); box-shadow: none !important;
}
[data-theme="cyber"] :is(.help-grid .card, .pcell, .scard, .value-grid .card, .about-skills .card, .about-trio .card)::before { background: radial-gradient(closest-side, color-mix(in srgb, var(--brand) 22%, transparent), transparent 72%); }
[data-theme="cyber"] :is(.help-grid .card, .pcell, .scard, .value-grid .card, .about-skills .card, .about-trio .card):hover { --aug-border-bg: var(--brand); box-shadow: inset 0 0 20px color-mix(in srgb, var(--brand) 28%, transparent) !important; transform: translateY(-2px); }
[data-theme="cyber"] .value__n { border-radius: 0; }

/* ---------- 4. Cyber project-card hover: yellow "slime" rises and flows ---------- */
[data-theme="cyber"] .pcard { isolation: isolate; }
[data-theme="cyber"] .pcard::before {
  content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(to top, color-mix(in srgb, var(--brand) 18%, transparent) 0%, color-mix(in srgb, var(--brand) 7%, transparent) 62%, color-mix(in srgb, var(--brand) 3%, transparent) 100%);
  --wave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='26' viewBox='0 0 120 26'%3E%3Cpath d='M0 26V13C20 -2 40 28 60 13S100 -2 120 13V26Z'/%3E%3C/svg%3E");
  -webkit-mask: var(--wave) 0 0 / 120px 26px repeat-x, linear-gradient(#000, #000) 0 25px / 100% calc(100% - 25px) no-repeat;
          mask: var(--wave) 0 0 / 120px 26px repeat-x, linear-gradient(#000, #000) 0 25px / 100% calc(100% - 25px) no-repeat;
  transform: translateY(calc(100% - 4px)); opacity: 0;
  transition: transform .75s cubic-bezier(.2, .85, .25, 1), opacity .35s ease;
}
[data-theme="cyber"] .pcard:hover::before { transform: translateY(0); opacity: 1; animation: slime-flow 2.6s linear infinite; }
[data-theme="cyber"] .pcard .img, [data-theme="cyber"] .pcard__body { position: relative; z-index: 1; }
@keyframes slime-flow { to { -webkit-mask-position: 120px 0, 0 25px; mask-position: 120px 0, 0 25px; } }
[data-theme="cyber"] .pcard__title, [data-theme="cyber"] .pcard__arrow { transition: color var(--dur-2) ease, transform var(--dur-2) var(--ease); }
[data-theme="cyber"] .pcard:hover .pcard__title { color: var(--brand); }

/* ---------- 5. Cursors ---------- */
.fx-ripple { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 9990; pointer-events: none; }
.fx-cyber-ring, .fx-cyber-dot { position: fixed; top: 0; left: 0; z-index: 9995; pointer-events: none; opacity: 0; will-change: transform; transition: opacity .25s ease; }
.fx-cyber-ring { width: 34px; height: 34px; margin: -17px 0 0 -17px; }
.fx-cyber-ring::before { content: ''; position: absolute; inset: 0; border: 1.5px solid var(--brand, #FCEE09); box-shadow: 0 0 12px rgba(252, 238, 9, .55), inset 0 0 8px rgba(252, 238, 9, .25); transform: rotate(45deg); transition: transform .3s var(--ease), border-radius .3s ease, background-color .3s ease, inset .3s var(--ease); }
.fx-cyber-ring.is-hot::before { inset: -8px; border-radius: 50%; transform: rotate(0); background: rgba(252, 238, 9, .12); }
.fx-cyber-ring.is-down::before { inset: 6px; background: rgba(252, 238, 9, .3); }
.fx-cyber-dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; background: var(--brand, #FCEE09); box-shadow: 0 0 8px #FCEE09; }
.fx-cyber-ring.is-visible, .fx-cyber-dot.is-visible { opacity: 1; }
[data-theme="classic"] .fx-cyber-ring, [data-theme="classic"] .fx-cyber-dot, [data-theme="golden"] .fx-cyber-ring, [data-theme="golden"] .fx-cyber-dot { display: none; }
[data-theme="cyber"] .fx-ripple { display: none; }
@media (hover: none), (pointer: coarse), (prefers-reduced-motion: reduce) { .fx-ripple, .fx-cyber-ring, .fx-cyber-dot { display: none !important; } }

/* ---------- 6. Contact: theme-specific visual ---------- */
.contact__card.has-visual { position: relative; display: grid; gap: clamp(8px, 3vw, 40px); align-items: center; overflow: hidden; }
.contact__body { position: relative; z-index: 1; min-width: 0; }
.contact__visual { position: relative; z-index: 0; width: min(100%, 360px); aspect-ratio: 1; margin: 0 auto; order: -1; }
.cv { position: absolute; inset: 0; display: none; }
[data-theme="classic"] .cv--earth, [data-theme="cyber"] .cv--mesh, [data-theme="golden"] .cv--ring { display: block; }
.cv canvas { display: block; width: 100%; height: 100%; touch-action: pan-y; cursor: grab; }
.cv canvas.is-grabbing { cursor: grabbing; }
/* soft ambient glow behind each visual, in the theme's own accent */
.cv::before { content: ''; position: absolute; inset: 8%; border-radius: 50%; filter: blur(28px); opacity: .55; z-index: -1; }
.cv--earth::before { background: radial-gradient(closest-side, rgba(74, 222, 128, .28), transparent); }
.cv--mesh::before { background: radial-gradient(closest-side, rgba(252, 238, 9, .18), transparent); }
.cv--ring::before { background: radial-gradient(closest-side, rgba(245, 158, 11, .25), transparent); }
@media (min-width: 960px) {
  .contact__card.has-visual { grid-template-columns: minmax(0, 1fr) clamp(280px, 36%, 420px); }
  .contact__visual { order: 0; width: 100%; }
  .contact__card.has-visual .contact__body { padding-inline: clamp(0px, 2vw, 24px); }
}
@media (max-width: 959px) { .contact__visual { width: min(72vw, 280px); } }
@media (prefers-reduced-motion: reduce) { [data-theme="cyber"] .pcard:hover::before { animation: none; } [data-theme="cyber"] .pcard::before { transition: opacity .2s ease; transform: none; } .lens { transition: opacity .15s ease; scale: 1; } }

/* ---------- Cyber nav: Flowbite "tabs with underline" — flat, square, no rounded line ---------- */
[data-theme="cyber"] .nav-primary { align-self: stretch; align-items: stretch; gap: 2px; }
[data-theme="cyber"] .nav-primary a {
  display: inline-flex; align-items: center; padding: 0 12px; border-radius: 0; background: transparent;
  border-bottom: 2px solid transparent; box-shadow: none; transition: color var(--dur-2) ease, border-color var(--dur-2) ease;
}
[data-theme="cyber"] .nav-primary a:hover { background: transparent; color: var(--text-primary); border-bottom-color: color-mix(in srgb, var(--brand) 45%, transparent); }
[data-theme="cyber"] .nav-primary a[aria-current="true"] { color: var(--brand); border-bottom-color: var(--brand); box-shadow: none; }
[data-theme="cyber"] .nav-primary a:focus-visible { outline-offset: -3px; border-radius: 0; }

/* ---------- Fluid cursor (Light + Gold): fixed, click-through, fades in/out ---------- */
.fx-fluid { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 9990; pointer-events: none; opacity: 0; transition: opacity .45s ease; }
[data-theme="cyber"] .fx-fluid { display: none; }
@media (hover: none), (pointer: coarse), (prefers-reduced-motion: reduce) { .fx-fluid { display: none !important; } }

/* ---------- Scaling cursor (Light / Classic only) ---------- */
.fx-scale-cursor { position: fixed; inset: auto; left: 0; top: 0; width: 0; height: 0; margin: 0; padding: 0; border: 0; background: transparent; overflow: visible; pointer-events: none; z-index: 2147483647; opacity: 1; transition: opacity .25s ease; }
.fx-scale-cursor.is-away { opacity: 0; }
.fx-scale-cursor__dot, .fx-scale-cursor__ring { position: absolute; left: 0; top: 0; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%; pointer-events: none; }
.fx-scale-cursor__dot { background: #16A34A; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .85), 0 2px 10px rgba(22, 163, 74, .35); transition: transform .3s cubic-bezier(.2, .8, .2, 1), background-color .25s ease, box-shadow .25s ease; }
.fx-scale-cursor__ring { border: 1.5px solid #15803D; opacity: 0; }
.fx-scale-cursor.is-hot .fx-scale-cursor__dot { transform: scale(1.4); background: #15803D; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .9), 0 3px 14px rgba(21, 128, 61, .45); }
.fx-scale-cursor.is-hot .fx-scale-cursor__ring { animation: sc-wave 1.8s cubic-bezier(.2, .6, .3, 1) infinite; }
.fx-scale-cursor.is-hot .fx-scale-cursor__ring:nth-child(2) { animation-delay: .6s; }
.fx-scale-cursor.is-hot .fx-scale-cursor__ring:nth-child(3) { animation-delay: 1.2s; }
.fx-scale-cursor.is-down .fx-scale-cursor__dot { transform: scale(.82); }
.fx-scale-cursor.is-hot.is-down .fx-scale-cursor__dot { transform: scale(1.15); }
@keyframes sc-wave { 0% { transform: scale(1.2); opacity: .55; } 100% { transform: scale(3.6); opacity: 0; } }
[data-theme="golden"] .fx-scale-cursor, [data-theme="cyber"] .fx-scale-cursor { display: none; }
[data-theme="classic"] .fx-fluid { display: none; }
@media (hover: none), (pointer: coarse), (prefers-reduced-motion: reduce) { .fx-scale-cursor { display: none !important; } }

/* ==========================================================================
   V4 — refinements
   ========================================================================== */

/* ---------- Project cards: equal height, flush top and bottom lines ---------- */
.pgrid > li { display: flex; }
.pgrid > li > .pcard { flex: 1 1 auto; width: 100%; }

/* ---------- Mobile burger menu: larger type, comfortable rhythm, theme-coloured hover ---------- */
.mobile-menu a { display: flex; align-items: center; min-height: 68px; padding: 20px clamp(20px, 5vw, 32px); font-size: 1.3rem; font-weight: 600; letter-spacing: .005em;
  transition: color var(--dur-2) ease, background-color var(--dur-2) ease, box-shadow var(--dur-2) ease; }
.mobile-menu a:hover, .mobile-menu a:focus-visible, .mobile-menu a:active { background-color: var(--accent-soft); box-shadow: inset 4px 0 0 var(--hov, currentColor); color: var(--hov); }
[data-theme="classic"] .mobile-menu a { --hov: #15803D; }     /* Light: deep green */
[data-theme="golden"]  .mobile-menu a { --hov: #FDE047; }     /* Gold: light gold */
[data-theme="cyber"]   .mobile-menu a { --hov: #FCEE09; }     /* Cyber: yellow */
[data-theme="cyber"] .mobile-menu a:hover, [data-theme="cyber"] .mobile-menu a:focus-visible { box-shadow: inset 4px 0 0 #FCEE09; }
.mobile-menu a:focus-visible { outline-offset: -3px; }

/* ---------- Social buttons: stacked vertically on mobile, like the contact actions ---------- */
@media (max-width: 639px) {
  .social-links {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: flex-start;
    gap: var(--sp-3);
    width: 100%;
  }
  .social-links .btn {
    flex: 0 0 auto;
    min-width: 0;
    width: 100%;
    padding-inline: 16px;
    gap: 8px;
    justify-content: center;
  }
}

/* ---------- "How I work": previous / next inside the stage card ---------- */
.step__nav { display: flex; gap: var(--sp-2); margin-top: var(--sp-5); }
.step__btn { width: 48px; height: 44px; padding: 0; justify-content: center; font: 700 1.15rem var(--font-display); }
.step__btn:disabled { opacity: .4; cursor: not-allowed; pointer-events: none; }

/* ---------- About CTA: rotating fade-in headline (every 16 s) ---------- */
.rotator { display: grid; justify-items: center; }
.rotator__item { grid-area: 1 / 1; opacity: 0; visibility: hidden; transition: opacity .5s ease, visibility 0s linear .5s; }
.rotator__item.is-active { opacity: 1; visibility: visible; transition: opacity .3s ease, visibility 0s; }
.rotator .w { display: inline-block; }
html.js .rotator__item.is-active:not(.is-in) .w { opacity: 0; }
.rotator__item.is-in .w { animation: rot-in .95s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--i) * 95ms); }
@keyframes rot-in { from { opacity: 0; transform: translateY(14px); filter: blur(8px); } to { opacity: 1; transform: none; filter: blur(0); } }
@media (prefers-reduced-motion: reduce) {
  .rotator__item, .rotator__item.is-active { transition: none; }
  .rotator__item.is-in .w, html.js .rotator__item.is-active:not(.is-in) .w { animation: none; opacity: 1; transform: none; filter: none; }
}

/* ---------- Gold cursor: small golden dot (fluid effect lives in js/effects.js) ---------- */
.fx-gold-dot { position: fixed; left: 0; top: 0; width: 0; height: 0; pointer-events: none; z-index: 9995; opacity: 1; transition: opacity .25s ease; }
.fx-gold-dot::before { content: ''; position: absolute; left: 0; top: 0; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: #FACC15; box-shadow: 0 0 0 1px rgba(15, 14, 19, .45), 0 0 10px rgba(250, 204, 21, .75); transition: transform .25s cubic-bezier(.2, .8, .2, 1); }
.fx-gold-dot.is-hot::before { transform: scale(1.7); }
.fx-gold-dot.is-away { opacity: 0; }
[data-theme="classic"] .fx-gold-dot, [data-theme="cyber"] .fx-gold-dot { display: none; }
@media (hover: none), (pointer: coarse), (prefers-reduced-motion: reduce) { .fx-gold-dot { display: none !important; } }
