/*
  AESTHETIC — Matrix / Tech · Personal Card
  Palette  — Deep green-black · Matrix green · Cyan
  Type     — JetBrains Mono (code) · Outfit (body)
*/

/* ═══════════════════════════════════════════
   TOKENS — DARK (default)
═══════════════════════════════════════════ */
:root {
  --bg:          #000714;
  --surface:     rgba(8,28,54,0.45);
  --surface-hi:  rgba(12,42,82,0.80);
  --surface-2:   rgba(4,18,38,0.92);

  --border:       rgba(0,163,255,0.15);
  --border-hover: rgba(0,163,255,0.50);
  --rule:         rgba(0,163,255,0.10);

  --text:   #E0F4FF;
  --text-2: rgba(224,244,255,0.60);
  --text-3: rgba(224,244,255,0.30);

  --accent:       #00A3FF;
  --accent-dim:   #008CE0;
  --accent-glow:  rgba(0,163,255,0.16);
  --accent-shine: rgba(0,163,255,0.08);

  --cyan: #00D4FF;

  --font-code: 'JetBrains Mono', 'Courier New', monospace;
  --font-body: 'Outfit', system-ui, sans-serif;

  --ease:     cubic-bezier(0.4,0,0.2,1);
  --ease-out: cubic-bezier(0,0,0.2,1);
  --dur:      0.28s;

  --radius-sm: 10px;
  --radius:    16px;
  --radius-lg: 20px;

  --footer-h: 34px;
  --container: 1400px;
  --tile-sz: clamp(110px, 13vmin, 160px);
  --card-sz: clamp(190px, 24vmin, 280px);
}

/* ═══════════════════════════════════════════
   TOKENS — LIGHT
═══════════════════════════════════════════ */
[data-theme="light"] {
  --bg:          #F4F9FC;
  --surface:     rgba(180,210,240,0.22);
  --surface-hi:  rgba(160,200,235,0.48);
  --surface-2:   rgba(200,225,248,0.90);

  --border:       rgba(8,63,105,0.18);
  --border-hover: rgba(8,63,105,0.50);
  --rule:         rgba(8,63,105,0.10);

  --text:   #051524;
  --text-2: rgba(5,21,36,0.64);
  --text-3: rgba(5,21,36,0.30);

  --accent:       #083F69;
  --accent-dim:   #2C6E9F;
  --accent-glow:  rgba(8,63,105,0.18);
  --accent-shine: rgba(8,63,105,0.08);

  --cyan: #005A8C;
}

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

html, body {
  height: 100%;
  overflow: hidden;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  cursor: none;
  transition: background 0.35s var(--ease), color 0.35s var(--ease);
}
@media (hover: none) { body { cursor: auto; } }

img { max-width: 100%; display: block; }
a   { text-decoration: none; color: inherit; }
button { cursor: none; border: none; background: none; font-family: inherit; }
@media (hover: none) { button { cursor: auto; } }

/* ═══════════════════════════════════════════
   MATRIX CANVAS
═══════════════════════════════════════════ */
#matrixBg {
  position: fixed;
  inset: 0;
  z-index: -1;
  display: block;
  transition: opacity 0.4s;
}

/* ═══════════════════════════════════════════
   GRAIN
═══════════════════════════════════════════ */
.grain {
  position: fixed;
  inset: 0;
  z-index: 9990;
  pointer-events: none;
  opacity: 0.022;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px;
}

/* ═══════════════════════════════════════════
   CUSTOM CURSOR
═══════════════════════════════════════════ */
.cursor-dot, .cursor-ring {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 9999;
  will-change: transform;
  transform: translate(-50%,-50%);
}
.cursor-dot {
  width: 5px; height: 5px;
  background: var(--accent);
  border-radius: 50%;
}
.cursor-ring {
  width: 24px; height: 24px;
  border: 1px solid rgba(0,163,255,0.60);
  border-radius: 50%;
  transition: width 0.18s var(--ease), height 0.18s var(--ease), border-color 0.18s;
}
body.cursor-hover .cursor-ring {
  width: 42px; height: 42px;
  border-color: var(--accent);
}
@media (hover: none) { .cursor-dot, .cursor-ring { display: none; } }

/* ═══════════════════════════════════════════
   CONTAINER
═══════════════════════════════════════════ */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 28px;
}

/* ═══════════════════════════════════════════
   LANG BUTTON (базовые стили, используются в плашке)
═══════════════════════════════════════════ */
.lang-btn {
  font-family: var(--font-code);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--text-3);
  border-radius: 6px;
  min-height: 28px;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.lang-btn.active { background: var(--accent); color: var(--bg); }

/* ═══════════════════════════════════════════
   COMPOSITION (без шапки — 100dvh)
═══════════════════════════════════════════ */
.bento {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2vw;
  padding: calc(2vw + var(--footer-h)) 2vw;
  height: 100dvh;
  overflow: hidden;
  position: relative;
}

.bento-connector-bg   { fill: none; stroke: var(--border); stroke-width: 1; }
.bento-connector-glow { fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-linecap: round; opacity: 0.65; }

.bento-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 2vw;
}
.bento-row:nth-of-type(1),
.bento-row:nth-of-type(3) {
  gap: 4vw;
}

/* ═══════════════════════════════════════════
   TILE BASE
═══════════════════════════════════════════ */
.tile {
  background: var(--surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  width: 25vw;
  height: var(--tile-sz);
  flex-shrink: 0;
  box-shadow:
    0 0 0 1px rgba(0,163,255,0.05),
    0 8px 32px rgba(0,0,0,0.40);
  transition:
    background var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}

/* Clickable tile */
.tile--clickable { cursor: none; }
@media (hover: none) { .tile--clickable { cursor: pointer; } }

.tile--clickable::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(0,163,255,0.14) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.35s var(--ease);
  pointer-events: none;
  z-index: 0;
}
.tile--clickable:hover::before { opacity: 1; }
.tile--clickable:hover {
  background: var(--surface-hi);
  border-color: rgba(0,163,255,0.40);
  box-shadow:
    0 0 0 1px rgba(0,163,255,0.10),
    0 12px 40px rgba(0,0,0,0.50),
    0 0 32px rgba(0,163,255,0.08);
}
.tile--clickable:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: -1px;
}

/* ── TILE INNER ── */
.tile__inner {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  padding: 18px 20px;
  position: relative;
  z-index: 1;
  height: 100%;
}

/* ── TILE NUMBER ── */
.tile__num {
  font-family: var(--font-code);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.2em;
  color: var(--text-3);
  display: block;
  flex-shrink: 0;
}

/* ── TILE LABEL ── */
.tile__label {
  font-family: var(--font-code);
  font-size: clamp(13px, 1.4vw, 20px);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text);
  transition: color var(--dur) var(--ease);
  flex-shrink: 0;
}
.tile--clickable:hover .tile__label { color: var(--accent); }

/* ── THEME TILE — подчёркивание активной темы ── */
.theme-day-group   { white-space: nowrap; }
.theme-word        { white-space: nowrap; text-decoration: none; }
.theme-word--night { text-decoration: underline; text-underline-offset: 4px; }
[data-theme="light"] .theme-word--night { text-decoration: none; }
[data-theme="light"] .theme-word--day   { text-decoration: underline; text-underline-offset: 4px; }

/* Английский: "Light Mode /" длиннее — шрифт мельче, чтобы строка влезала */
:lang(en) .tile--theme .tile__label { font-size: clamp(7px, 2.2vw, 15px); }

/* ── LANGUAGE PANEL ── */
.panel--lang { width: min(500px, 100%); }
.lang-panel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}
.lang-panel-btn {
  font-family: var(--font-code);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--text-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(4,14,34,0.60);
  padding: 18px 20px;
  text-align: center;
  cursor: pointer;
  min-height: 70px;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.lang-panel-btn:hover {
  background: var(--accent-shine);
  border-color: var(--border-hover);
  color: var(--accent);
}
.lang-panel-btn.active {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
}

/* ═══════════════════════════════════════════
   PROFILE CENTER CARD
═══════════════════════════════════════════ */
.profile-card {
  background: var(--surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(0,163,255,0.22);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  position: relative;
  height: min(18vw, calc(100dvh - 2 * var(--tile-sz) - 8vw - 2 * var(--footer-h)));
  width: auto;
  aspect-ratio: 2 / 1;
  flex-shrink: 0;
  box-shadow:
    0 0 0 1px rgba(0,163,255,0.07),
    0 16px 56px rgba(0,0,0,0.60),
    0 0 120px rgba(0,163,255,0.05);
}
.profile-card > .tile__num {
  position: absolute;
  top: 18px;
  left: 20px;
  z-index: 2;
}
.profile-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px, transparent 3px,
    rgba(0,163,255,0.012) 3px, rgba(0,163,255,0.012) 4px
  );
  pointer-events: none;
  z-index: 4;
}

/* ── PHOTO WRAP — левая часть карточки (квадрат) ── */
.profile__photo-wrap {
  position: relative;
  flex: 0 0 auto;
  height: 100%;
  width: auto;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 0;
  margin: 0;
}
.profile__photo-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, transparent 60%, rgba(0,7,20,0.88) 100%);
  pointer-events: none;
  z-index: 1;
}
.profile__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  filter: grayscale(22%) contrast(1.06) brightness(0.86);
}

/* ── INFO COLUMN ── */
.profile__info-col {
  flex: 1;
  position: relative;
  z-index: 2;
  padding: 28px 18px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.profile__eyebrow { display: none; }
.profile__name {
  font-family: var(--font-code);
  font-size: clamp(16px, 2vw, 28px);
  font-weight: 700;
  line-height: 1.0;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 5px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
}
.name-first { display: block; }
.name-last  { display: block; color: rgba(224,244,255,0.75); }
.profile__role { display: none; }
.fn-name   { color: var(--accent); }
.fn-parens { color: var(--text-3); }
.profile__rule {
  width: 28px;
  height: 1px;
  background: var(--accent-dim);
  opacity: 0.45;
  margin: 6px 0;
  flex-shrink: 0;
}
.profile__slogan {
  font-family: var(--font-body);
  font-size: clamp(9px, 0.85vw, 13px);
  font-weight: 300;
  color: var(--text-2);
  line-height: 1.5;
  flex-shrink: 0;
}
.profile__logo-wrap {
  margin-top: 6px;
  padding-top: 0;
  border-top: none;
  flex-shrink: 0;
}
.jnp-logo {
  font-family: var(--font-code);
  font-size: clamp(9px, 1vmin, 12px);
  font-weight: 500;
  letter-spacing: 0.06em;
}
.logo-accent { color: var(--accent); }
.logo-dim    { color: var(--text-3); }

/* ═══════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════ */
.site-footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--footer-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 200;
  background: transparent;
}
.footer__logo {
  height: 15px; width: auto;
  opacity: 0.75;
}
.footer__copy {
  font-family: var(--font-code);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: rgba(0, 163, 255, 0.52);
}
[data-theme="light"] .footer__copy {
  color: rgba(8, 63, 105, 0.60);
}

/* ═══════════════════════════════════════════
   PANEL OVERLAY
═══════════════════════════════════════════ */
.panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,4,12,0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(2vw + var(--footer-h));
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s var(--ease);
}
.panel-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.panel {
  background: rgba(8,28,54,0.85);
  border: 1px solid rgba(0,163,255,0.22);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-radius: var(--radius);
  width: min(680px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  transform: scale(0.96) translateY(16px);
  transition: transform 0.28s var(--ease-out);
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(0,163,255,0.07),
    0 24px 80px rgba(0,0,0,0.60),
    0 0 50px rgba(0,163,255,0.06);
}
.panel--wide { width: min(960px, 100%); }
.panel--qr   { width: min(420px, 100%); }

.panel-overlay.is-open .panel { transform: scale(1) translateY(0); }

.panel__close {
  position: absolute;
  top: 14px; right: 14px;
  width: 44px; height: 44px;
  min-width: 44px; min-height: 44px;
  border-radius: 50%;
  background: rgba(8,22,50,0.90);
  border: 1px solid var(--border);
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  cursor: pointer;
  transition: background var(--dur), color var(--dur), border-color var(--dur), box-shadow var(--dur);
  flex-shrink: 0;
}
@media (hover: none) { .panel__close { cursor: auto; } }
.panel__close svg {
  width: 16px; height: 16px;
  stroke: currentColor; fill: none; stroke-width: 2;
  pointer-events: none;
}
.panel__close:hover {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(0,163,255,0.45);
}

.panel__content {
  overflow-y: auto;
  flex: 1;
  padding: 32px;
}
.panel__content::-webkit-scrollbar { width: 2px; }
.panel__content::-webkit-scrollbar-track { background: transparent; }
.panel__content::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 1px; }

.panel__content--center {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.panel__eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-code);
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-dim);
  margin-bottom: 12px;
  padding-right: 54px;
}
.panel__content--center .panel__eyebrow {
  align-self: stretch;
  justify-content: flex-start;
  padding-right: 54px;
}

.panel__title {
  font-family: var(--font-code);
  font-size: clamp(22px, 3vw, 38px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.02em;
  color: var(--text);
  margin-bottom: 20px;
  padding-right: 60px;
}
.panel__body {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 300;
  color: var(--text-2);
  line-height: 1.85;
  max-width: 560px;
}
.panel__sub {
  font-family: var(--font-code);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--text-3);
  margin-bottom: 20px;
}
.panel__divider {
  width: 100%;
  height: 1px;
  background: var(--rule);
  margin: 24px 0;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════
   QR PANEL
═══════════════════════════════════════════ */
.qr-wrap {
  background: #ffffff;
  border-radius: var(--radius-sm);
  padding: 20px;
  margin: 16px 0;
  width: 100%;
  max-width: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qr-img {
  width: 100%;
  height: auto;
  display: block;
}
.qr-hint {
  font-family: var(--font-code);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}

/* ═══════════════════════════════════════════
   FEATURES GRID (в панели About)
═══════════════════════════════════════════ */
.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-top: 8px;
}
.feature {
  padding: 24px 22px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  transition: background var(--dur) var(--ease);
}
.feature:nth-child(2n) { border-right: none; }
.feature:nth-child(3), .feature:nth-child(4) { border-bottom: none; }
.feature:hover { background: var(--accent-shine); }
.feature__num {
  display: block;
  font-family: var(--font-code);
  font-size: 9px;
  color: var(--text-3);
  letter-spacing: 0.12em;
  margin-bottom: 14px;
}
.feature__title {
  font-family: var(--font-code);
  font-size: 15px;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 8px;
  line-height: 1.2;
}
.feature__text {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 300;
  color: var(--text-2);
  line-height: 1.70;
}

/* ═══════════════════════════════════════════
   APPS GRID (в портфолио)
═══════════════════════════════════════════ */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.app-card {
  background: rgba(4,14,34,0.72);
  padding: 22px;
  position: relative;
  --mx: 50%; --my: 50%;
  transition: background var(--dur) var(--ease);
}
.app-card::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at var(--mx) var(--my), rgba(0,163,255,0.14) 0%, transparent 65%);
  opacity: 0;
  transition: opacity 0.35s var(--ease);
  pointer-events: none;
}
.app-card > * { position: relative; z-index: 1; }
.app-card:hover { background: rgba(4,18,42,0.85); box-shadow: inset 0 0 0 1px rgba(0,163,255,0.20); }
.app-card:hover::before { opacity: 1; }
.app-card__header {
  display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px;
}
.app-card__icon-wrap {
  width: 48px; height: 48px;
  border-radius: 10px; overflow: hidden; flex-shrink: 0;
  border: 1px solid var(--border); background: var(--surface-2);
}
.app-card__icon { width: 100%; height: 100%; object-fit: cover; }
.app-card__meta { flex: 1; min-width: 0; }
.app-card__name {
  font-family: var(--font-code); font-size: 14px; font-weight: 500;
  color: var(--text); margin-bottom: 6px; line-height: 1.2;
}
.app-card__badges { display: flex; gap: 5px; flex-wrap: wrap; }

.store-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 8px;
  background: rgba(4,16,40,0.80); border: 1px solid var(--border); border-radius: 4px;
  font-family: var(--font-code); font-size: 9px; letter-spacing: 0.06em; color: var(--text-2);
  transition: border-color var(--dur), color var(--dur);
}
.store-badge:hover { border-color: var(--accent); color: var(--accent); }
.store-badge svg   { width: 11px; height: 11px; fill: currentColor; }
.badge-text { display: flex; flex-direction: column; line-height: 1.2; }
.badge-text small  { font-size: 7px; opacity: 0.55; }
.badge-text strong { font-size: 9px; font-weight: 500; }

.app-card__desc-wrap { margin-bottom: 12px; }
.app-card__desc {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  font-family: var(--font-body); font-size: 12px; font-weight: 300;
  color: var(--text-2); line-height: 1.75;
}
.app-card__toggle {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-code); font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent-dim); border: 1px solid var(--border); border-radius: 4px;
  padding: 5px 10px; min-height: 30px;
  transition: background var(--dur), border-color var(--dur), color var(--dur);
}
.app-card__toggle:hover { background: var(--accent); border-color: var(--accent); color: var(--bg); }

/* ═══════════════════════════════════════════
   APP MODAL
═══════════════════════════════════════════ */
.app-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,4,12,0.88);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  z-index: 700;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.22s var(--ease);
}
.app-modal-overlay.is-open { opacity: 1; pointer-events: auto; }

.app-modal {
  background: rgba(8,28,54,0.92);
  border: 1px solid rgba(0,163,255,0.22);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-radius: var(--radius-lg);
  width: min(680px, 100%); max-height: 80vh;
  display: flex; flex-direction: column; position: relative;
  transform: scale(0.96) translateY(12px);
  transition: transform 0.28s var(--ease-out);
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(0,163,255,0.07),
    0 24px 80px rgba(0,0,0,0.65),
    0 0 50px rgba(0,163,255,0.06);
}
.app-modal-overlay.is-open .app-modal { transform: scale(1) translateY(0); }

.app-modal__close {
  position: absolute; top: 12px; right: 12px;
  width: 44px; height: 44px; min-width: 44px; min-height: 44px;
  border-radius: 50%; background: rgba(8,22,50,0.90); border: 1px solid var(--border);
  color: var(--text-2); display: flex; align-items: center; justify-content: center;
  transition: background var(--dur), color var(--dur), border-color var(--dur);
  z-index: 1; cursor: pointer;
}
@media (hover: none) { .app-modal__close { cursor: auto; } }
.app-modal__close svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; pointer-events: none; }
.app-modal__close:hover { background: var(--accent); color: var(--bg); border-color: var(--accent); }

.app-modal__header {
  display: flex; align-items: flex-start; gap: 16px;
  padding: 22px 22px 16px; border-bottom: 1px solid var(--rule); flex-shrink: 0;
}
.app-modal__icon-wrap { width: 56px; height: 56px; border-radius: 12px; overflow: hidden; flex-shrink: 0; border: 1px solid var(--border); background: var(--surface-2); }
.app-modal__icon  { width: 100%; height: 100%; object-fit: cover; }
.app-modal__meta  { flex: 1; min-width: 0; padding-right: 52px; }
.app-modal__name  { font-family: var(--font-code); font-size: 20px; font-weight: 500; color: var(--text); margin-bottom: 8px; line-height: 1.1; }
.app-modal__badges { display: flex; gap: 5px; flex-wrap: wrap; }

.app-modal__body { overflow-y: auto; padding: 18px 22px 22px; flex: 1; }
.app-modal__body::-webkit-scrollbar { width: 2px; }
.app-modal__body::-webkit-scrollbar-track { background: transparent; }
.app-modal__body::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 1px; }
.app-modal__desc { font-family: var(--font-body); font-size: 14px; font-weight: 300; color: var(--text-2); line-height: 1.9; white-space: pre-line; }

/* ═══════════════════════════════════════════
   CONTACT ITEMS
═══════════════════════════════════════════ */
#ctaContactLinks {
  display: flex; flex-direction: column; gap: 1px;
  background: var(--rule); border: 1px solid var(--rule);
  border-radius: var(--radius-sm); overflow: hidden; margin-top: 8px;
}
.contact-item {
  appearance: none; -webkit-appearance: none; border: none; cursor: pointer;
  text-align: left; display: flex; align-items: center; gap: 14px;
  padding: 18px 22px; background: rgba(4,14,34,0.65);
  font-family: var(--font-code); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-2); transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
  min-height: 44px; width: 100%;
}
.contact-item:hover { background: var(--accent-shine); color: var(--accent); }
.contact-item svg   { width: 20px; height: 20px; flex-shrink: 0; }
.contact-item--tg   svg { fill: #229ED9; }
.contact-item--wa   svg { fill: #25D366; }
.contact-item--email svg { fill: none; stroke: var(--accent-dim); stroke-width: 1.5; }
.contact-item.is-copied { color: var(--accent); }
.contact-item.is-copied .contact-item__label { letter-spacing: 0; text-transform: none; }

/* ═══════════════════════════════════════════
   LIGHT THEME — переопределения хардкода
   (токенные переменные работают автоматически,
    здесь только те элементы с rgba-хардкодом)
═══════════════════════════════════════════ */

/* Тайлы */
[data-theme="light"] .tile {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow:
    0 0 0 1px rgba(8,63,105,0.06),
    0 8px 32px rgba(8,40,80,0.10);
}
[data-theme="light"] .tile--clickable:hover {
  border-color: rgba(8,63,105,0.40);
  box-shadow:
    0 0 0 1px rgba(8,63,105,0.10),
    0 12px 40px rgba(8,40,80,0.16),
    0 0 32px rgba(8,63,105,0.06);
}

/* Profile card */
[data-theme="light"] .profile-card {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow:
    0 0 0 1px rgba(8,63,105,0.10),
    0 16px 56px rgba(8,40,80,0.14),
    0 0 80px rgba(8,63,105,0.05);
}
[data-theme="light"] .profile__photo-wrap::after {
  background: linear-gradient(to right, transparent 60%, rgba(220,235,250,0.90) 100%);
}
[data-theme="light"] .name-last {
  color: rgba(5,21,36,0.55);
}

/* Затемнение за панелью */
[data-theme="light"] .panel-overlay {
  background: rgba(160,200,235,0.55);
}

/* Панели — светлый frosted glass */
[data-theme="light"] .panel {
  background: rgba(238,247,255,0.78);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow:
    0 0 0 1px rgba(8,63,105,0.08),
    0 24px 80px rgba(8,40,80,0.16),
    0 0 40px rgba(8,63,105,0.04);
}
[data-theme="light"] .panel__close {
  background: rgba(210,232,252,0.95);
}

/* Кнопки выбора языка */
[data-theme="light"] .lang-panel-btn {
  background: rgba(210,232,252,0.80);
}
[data-theme="light"] .lang-panel-btn.active {
  background: var(--accent);
  color: #ffffff;
}

/* App-карточки */
[data-theme="light"] .app-card {
  background: rgba(215,233,252,0.75);
}
[data-theme="light"] .app-card:hover {
  background: rgba(200,222,248,0.92);
  box-shadow: inset 0 0 0 1px rgba(8,63,105,0.22);
}

/* Store badges */
[data-theme="light"] .store-badge {
  background: rgba(210,232,252,0.90);
}

/* App modal */
[data-theme="light"] .app-modal-overlay {
  background: rgba(160,200,235,0.65);
}
[data-theme="light"] .app-modal {
  background: rgba(238,247,255,0.78);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow:
    0 0 0 1px rgba(8,63,105,0.08),
    0 24px 80px rgba(8,40,80,0.18),
    0 0 40px rgba(8,63,105,0.04);
}
[data-theme="light"] .app-modal__close {
  background: rgba(210,232,252,0.95);
}

/* Контактные пункты */
[data-theme="light"] .contact-item {
  background: rgba(215,233,252,0.75);
}

/* Mobile: градиент фото идёт вниз — цвет должен совпадать с bg */
@media (max-width: 767px) {
  [data-theme="light"] .profile__photo-wrap::after {
    background: linear-gradient(to bottom, transparent 60%, rgba(220,235,250,0.90) 100%);
  }
}

/* Бордеры хардкоженных блоков (не использующих var(--border)) */
[data-theme="light"] .profile-card {
  border-color: rgba(8,63,105,0.20);
}
[data-theme="light"] .panel {
  border-color: rgba(8,63,105,0.20);
}
[data-theme="light"] .app-modal {
  border-color: rgba(8,63,105,0.20);
}

/* Радиальные hover-эффекты — мягче под светлый фон */
[data-theme="light"] .tile--clickable::before {
  background: radial-gradient(circle at 50% 50%, rgba(8,63,105,0.08) 0%, transparent 70%);
}
[data-theme="light"] .app-card::before {
  background: radial-gradient(circle at var(--mx) var(--my), rgba(8,63,105,0.10) 0%, transparent 65%);
}

/* Glow кнопки закрытия панели */
[data-theme="light"] .panel__close:hover {
  box-shadow: 0 0 16px rgba(8,63,105,0.30);
}

/* ═══════════════════════════════════════════
   RESPONSIVE — TABLET  768–1023px
═══════════════════════════════════════════ */
@media (max-width: 1023px) {
  .tile__inner   { padding: 16px; }
  .tile__label   { font-size: clamp(12px, 1.5vw, 17px); }
  .profile__name { font-size: clamp(18px, 2.4vw, 34px); }
  .apps-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ═══════════════════════════════════════════
   RESPONSIVE — MOBILE  ≤ 767px
═══════════════════════════════════════════ */
@media (max-width: 767px) {
  :root { --footer-h: 30px; }

  .bento {
    gap: 10px;
    padding: calc(10px + var(--footer-h)) 10px;
  }

  /* profile card — вертикальный прямоугольник */
  .profile-card {
    height: min(60vw, calc(100dvh - 2 * var(--tile-sz) - 40px - 2 * var(--footer-h)));
    width: auto;
    aspect-ratio: 1 / 2;
    flex-direction: column;
  }
  .profile__photo-wrap {
    flex: 0 0 auto;
    height: auto;
    width: 100%;
    aspect-ratio: 1 / 1;
  }
  .profile__photo-wrap::after {
    background: linear-gradient(to bottom, transparent 60%, rgba(0,7,20,0.88) 100%);
  }
  .profile__info-col {
    padding: 10px 12px 12px;
    justify-content: center;
  }

  .tile__inner { padding: 12px 14px; gap: 8px; }
  .tile__label { font-size: clamp(11px, 3.5vw, 15px); }

  /* Панели — bottom sheets */
  .panel-overlay { padding: calc(10px + var(--footer-h)); }
  .panel, .panel--wide, .panel--qr { width: 100%; max-height: 100%; }
  .panel__content { padding: 36px 16px 24px; }
  .panel__close   { top: 10px; right: 10px; }
  .panel__title   { font-size: clamp(18px, 5vw, 30px); padding-right: 54px; }

  .features-grid { grid-template-columns: 1fr; }
  .feature { border-right: none; border-bottom: 1px solid var(--rule); }
  .feature:last-child { border-bottom: none; }
  .feature:nth-child(3) { border-bottom: 1px solid var(--rule); }

  .apps-grid { grid-template-columns: 1fr; }

  /* App modal — мобильные правила */
  .app-modal-overlay { padding: 12px; padding-bottom: calc(12px + var(--footer-h)); }
  .app-modal__header { padding: 16px 16px 12px; }
  .app-modal__body   { padding: 14px 16px 18px; }
  .app-modal__name   { font-size: 16px; }
}

/* ═══════════════════════════════════════════
   RESPONSIVE — XSMALL  ≤ 470px
   Шрифт тайлов переходит на чистый vw — чтобы
   всегда вмещаться в 25vw-широкий тайл.
═══════════════════════════════════════════ */
@media (max-width: 470px) {
  .tile__inner { padding: 10px; gap: 6px; }
  .tile__label { font-size: clamp(9px, 3vw, 14px); letter-spacing: 0.03em; }

  .profile-card > .tile__num { top: 9px; left: 10px; }

  .profile__name     { margin-bottom: 2px; gap: 1px; }
  .profile__rule     { margin: 3px 0; }
  .profile__logo-wrap { margin-top: 3px; }
}

/* ═══════════════════════════════════════════
   RESPONSIVE — SMALL  ≤ 420px
═══════════════════════════════════════════ */
@media (max-width: 420px) {
  .profile__name { font-size: clamp(10px, 3.4vw, 18px); }
  .bento { gap: 8px; padding: calc(8px + var(--footer-h)) 8px; }

  /* Панели — максимизируем ширину: убираем боковые поля оверлея */
  .panel-overlay  { padding: calc(10px + var(--footer-h)) 8px; }
  .panel__content { padding: 36px 12px 20px; }
  .panel__eyebrow { padding-right: 48px; }
  .panel__title   { font-size: clamp(16px, 5vw, 28px); }
  .panel__divider { margin: 14px 0; }

  /* About: уменьшаем padding ячеек */
  .feature { padding: 18px 14px; }

  /* Portfolio: уменьшаем padding карточек */
  .app-card { padding: 14px; }

  /* Контакты: текст чуть мельче — длинные строки на ru/es не переносятся */
  .contact-item { font-size: 10px; letter-spacing: 0.05em; padding: 14px 14px; }

  /* App modal */
  .app-modal-overlay { padding: 8px; padding-bottom: calc(8px + var(--footer-h)); }
}

/* ═══════════════════════════════════════════
   REDUCED MOTION
═══════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
