/* ============================================================
   CV — GitHub-inspired dark theme
   ============================================================ */

:root {
  --bg: #0d1117;
  --bg-2: #010409;
  --surface: #161b22;
  --surface-2: #1c2128;
  --surface-hover: #21262d;
  --border: #30363d;
  --border-muted: #21262d;
  --text: #e6edf3;
  --text-muted: #7d8590;
  --text-dim: #484f58;
  --accent: #2f81f7;
  --accent-hover: #58a6ff;
  --success: #3fb950;
  --success-bg: rgba(63, 185, 80, 0.15);
  --warning: #d29922;
  --danger: #f85149;
  --purple: #a371f7;
  --pink: #f778ba;

  --border-hover: #8b949e;
  --accent-soft: var(--accent-soft);

  --radius: 6px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 0 rgba(0,0,0,0.04);
  --shadow: 0 8px 24px rgba(0,0,0,0.4);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans",
               Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono",
               Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  caret-color: var(--accent);
}

::selection {
  background: rgba(47, 129, 247, 0.3);
  color: var(--text);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s cubic-bezier(0.33, 1, 0.68, 1);
}
a:hover { color: var(--accent-hover); text-decoration: underline; }
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

button { font-family: inherit; cursor: pointer; }
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ============================================================
   TOP BAR — GitHub-style header
   ============================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 16px;
  backdrop-filter: blur(8px);
  background: rgba(1, 4, 9, 0.85);
}
.topbar .brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 600; font-size: 14px;
  color: var(--text);
}
.topbar .brand .logo {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}
.topbar .brand .path {
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-weight: 400;
}
.topbar .brand .path .sep { margin: 0 4px; color: var(--text-dim); }
.topbar .brand .path .repo { color: var(--accent); font-weight: 500; }
.topbar .brand .badge {
  margin-left: 6px;
  padding: 1px 7px;
  font-size: 11px;
  font-family: var(--font-mono);
  border: 1px solid var(--border);
  border-radius: 2em;
  color: var(--text-muted);
}

.topbar-right {
  margin-left: auto;
  display: flex; align-items: center; gap: 8px;
}
.topbar-right .kbd {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--text-muted);
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  white-space: nowrap;
}
@media (max-width: 700px) {
  .topbar-right .kbd { display: none; }
}

/* ============================================================
   TABS — GitHub repo tabs (Code / Issues / PRs)
   ============================================================ */
.tabs {
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  display: flex;
  gap: 2px;
  overflow-x: auto;
  overflow-y: hidden;
}
.tab {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 12px 10px;
  margin-bottom: -1px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text-muted);
  border-radius: 6px 6px 0 0;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  text-decoration: none;
  transition: color 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}
.tab:hover {
  color: var(--text);
  background: var(--surface);
  text-decoration: none;
}
.tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-radius: 6px 6px 0 0;
}
.tab.active {
  border-bottom-color: var(--warning);
  color: var(--text);
  font-weight: 600;
  background: transparent;
}
.tab .count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  background: var(--surface-2);
  border-radius: 2em;
  color: var(--text-muted);
  font-family: var(--font-mono);
  transition: background 0.12s ease, color 0.12s ease;
}
.tab.active .count {
  background: var(--surface-hover);
  color: var(--text);
}
.tab svg {
  width: 15px; height: 15px;
  opacity: 0.7;
  flex-shrink: 0;
  transition: opacity 0.12s ease;
}
.tab.active svg,
.tab:hover svg { opacity: 1; }

/* ============================================================
   LAYOUT — sidebar + main
   ============================================================ */
.page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  grid-template-columns: 296px 1fr;
  gap: 32px;
  align-items: start;
}

@media (max-width: 900px) {
  .page { grid-template-columns: 1fr; }
}

.sidebar {
  position: sticky;
  top: 80px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: calc(100vh - 96px);
  overflow-y: auto;
  /* Hide scrollbar by default, show on hover */
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
  padding-right: 6px;
  margin-right: -6px;
  transition: scrollbar-color 0.2s cubic-bezier(0.33, 1, 0.68, 1);
}
.sidebar:hover {
  scrollbar-color: var(--border) transparent;
}
.sidebar::-webkit-scrollbar {
  width: 6px;
}
.sidebar::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 3px;
  transition: background 0.2s cubic-bezier(0.33, 1, 0.68, 1);
}
.sidebar:hover::-webkit-scrollbar-thumb {
  background: var(--border);
}
.sidebar:hover::-webkit-scrollbar-thumb:hover {
  background: var(--border-hover);
}
.sidebar::-webkit-scrollbar-button {
  display: none;
}

@media (max-width: 900px) {
  .sidebar {
    position: static;
    max-height: none;
    overflow-y: visible;
    padding-right: 0;
    margin-right: 0;
  }
}

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* ============================================================
   PROFILE CARD
   ============================================================ */
.avatar {
  width: 100%;
  aspect-ratio: 1;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  position: relative;
  display: grid; place-items: center;
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}
.avatar .status-dot {
  position: absolute;
  /* bottom-right of the circle, computed: 50% + cos(45)*50% - half_dot = ~83% */
  bottom: 7%;
  right: 7%;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--success);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 1px var(--border);
}
.avatar .placeholder {
  font-family: var(--font-mono);
  font-size: 72px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -2px;
}
.profile-name {
  font-size: 26px;
  font-weight: 600;
  margin: 4px 0 0;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.profile-handle {
  font-size: 18px;
  color: var(--text-muted);
  font-weight: 300;
  margin: 0;
  font-family: var(--font-mono);
}
.profile-bio {
  color: var(--text);
  margin: 8px 0 0;
  font-size: 15px;
  line-height: 1.55;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 2em;
  background: var(--success-bg);
  border: 1px solid rgba(63, 185, 80, 0.4);
  color: var(--success);
  font-size: 12px;
  font-family: var(--font-mono);
  width: fit-content;
}
.status-pill::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.33, 1, 0.68, 1);
  text-decoration: none;
}
.btn:hover { background: var(--surface-hover); border-color: var(--border-hover); text-decoration: none; }
.btn:active { background: var(--surface-2); border-color: var(--border); transform: translateY(1px); }
.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}
.btn.primary {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg-2);
}
.btn.primary:hover {
  background: #fff;
  border-color: #fff;
  color: var(--bg-2);
}
.btn.primary:active { background: var(--text-muted); border-color: var(--text-muted); }
.btn svg { width: 14px; height: 14px; }

.contacts {
  display: flex; flex-direction: column; gap: 10px;
  font-size: 14.5px;
}
.contacts .item {
  display: flex; align-items: center; gap: 10px;
  color: var(--text);
}
.contacts .item svg { width: 16px; height: 16px; color: var(--text-muted); flex-shrink: 0; }
.contacts .item a { color: var(--text); }
.contacts .item a:hover { color: var(--accent); }
.contacts .item .label { color: var(--text-muted); }

.sidebar-section-title {
  font-size: 14px;
  font-weight: 600;
  margin: 8px 0 4px;
  color: var(--text);
  display: flex; align-items: center; justify-content: space-between;
}
.sidebar-section-title .count {
  color: var(--text-muted);
  font-weight: 400;
  font-family: var(--font-mono);
  font-size: 12px;
}

.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 0 8px;
  height: 22px;
  border-radius: 2em;
  background: rgba(56, 139, 253, 0.15);
  color: var(--accent-soft);
  font-size: 12px;
  font-family: var(--font-mono);
  border: 1px solid rgba(56, 139, 253, 0.25);
  white-space: nowrap;
}
.tag.gray { background: var(--surface); border-color: var(--border); color: var(--text-muted); }
.tag.green { background: rgba(63, 185, 80, 0.15); border-color: rgba(63, 185, 80, 0.3); color: var(--success); }
.tag.purple { background: rgba(163, 113, 247, 0.15); border-color: rgba(163, 113, 247, 0.3); color: var(--purple); }
.tag.pink { background: rgba(247, 120, 186, 0.12); border-color: rgba(247, 120, 186, 0.25); color: var(--pink); }
.tag.warning { background: rgba(210, 153, 34, 0.15); border-color: rgba(210, 153, 34, 0.3); color: var(--warning); }

/* Languages — minimal */
.lang-list { display: flex; flex-direction: column; gap: 10px; }
.lang-row {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 10px;
  align-items: start;
}
.lang-flag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  padding-top: 3px;
  line-height: 1.4;
}
.lang-info { min-width: 0; }
.lang-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
}
.lang-name .lang-native {
  color: var(--text-muted);
  font-weight: 400;
}
.lang-note {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.45;
  margin-top: 2px;
}
.lang-skills {
  display: flex; flex-wrap: wrap; gap: 4px;
  margin-top: 6px;
}
.lang-skills span {
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 2em;
  white-space: nowrap;
  line-height: 1.4;
}
.lang-skills .ok {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(63, 185, 80, 0.25);
}
.lang-skills .weak {
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border-muted);
  text-decoration: line-through;
  text-decoration-color: rgba(248, 81, 73, 0.5);
  text-decoration-thickness: 1px;
}

/* Languages — read/speak with dot levels */
.lang-levels {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
}
.lvl-row {
  display: grid;
  grid-template-columns: 56px 1fr;
  align-items: center;
  gap: 8px;
}
.lvl-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}
.lvl-dots {
  display: inline-flex;
  gap: 3px;
}
.lvl-dots i {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border-muted);
}
.lvl-dots[data-level="5"] i:nth-child(-n+5),
.lvl-dots[data-level="4"] i:nth-child(-n+4),
.lvl-dots[data-level="3"] i:nth-child(-n+3),
.lvl-dots[data-level="2"] i:nth-child(-n+2),
.lvl-dots[data-level="1"] i:nth-child(-n+1) {
  background: var(--success);
  border-color: var(--success);
}

/* ============================================================
   MAIN — section headers
   ============================================================ */
.section-title {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-muted);
  display: flex; align-items: center; gap: 10px;
  letter-spacing: -0.01em;
}
.section-title .hash {
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-weight: 400;
}

/* README-card (about) */
.readme {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.readme-header {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-muted);
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.readme-header .file { color: var(--text); }
.readme-body { padding: 24px; }
.readme-body h1 {
  font-size: 30px; font-weight: 600; margin: 0 0 14px; letter-spacing: -0.02em;
}
.readme-body h1 .wave { display: inline-block; animation: wave 2s ease-in-out infinite; transform-origin: 70% 70%; }
@keyframes wave {
  0%, 60%, 100% { transform: rotate(0); }
  10% { transform: rotate(14deg); }
  20% { transform: rotate(-8deg); }
  30% { transform: rotate(14deg); }
  40% { transform: rotate(-4deg); }
  50% { transform: rotate(10deg); }
}
.readme-body p { color: var(--text); margin: 0 0 14px; font-size: 16px; line-height: 1.65; }
.readme-body p:last-child { margin-bottom: 0; }
.readme-body .rotating {
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 500;
}

/* --- README: expandable full bio --- */
.readme-more {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.readme-more > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  list-style: none;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.readme-more > summary::-webkit-details-marker { display: none; }
.readme-more > summary:hover {
  background: var(--surface-hover, var(--surface-2));
  border-color: var(--border-muted, var(--border));
}
.readme-more > summary .chev {
  width: 14px; height: 14px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.readme-more[open] > summary .chev { transform: rotate(-180deg); }
.readme-more > summary .hint {
  margin-left: auto;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
}
.readme-more > summary .label-less { display: none; }
.readme-more[open] > summary .label-more { display: none; }
.readme-more[open] > summary .label-less { display: inline; }
@media (max-width: 560px) {
  .readme-more > summary .hint { display: none; }
}

.readme-more-body {
  padding: 24px 4px 4px;
  animation: readme-more-in 0.25s ease;
}
@keyframes readme-more-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.readme-more-body h2 {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 24px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.readme-more-body h2:first-child { margin-top: 0; }
.readme-more-body h2 .hash {
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-weight: 400;
}
.readme-more-body h3 {
  font-size: 14px;
  font-weight: 600;
  margin: 14px 0 6px;
  color: var(--text);
}
.readme-more-body p {
  font-size: 15px;
  line-height: 1.6;
  margin: 0 0 12px;
  color: var(--text);
}
.readme-more-body strong { color: var(--text); font-weight: 600; }
.readme-list {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
}
.readme-list li {
  position: relative;
  padding: 4px 0 4px 18px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
}
.readme-list li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--text-dim);
}

/* ============================================================
   STATS GRID
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
@media (max-width: 700px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  transition: all 0.2s cubic-bezier(0.33, 1, 0.68, 1);
}
.stat-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}
.stat-card .num {
  font-size: 28px; font-weight: 600;
  font-family: var(--font-mono);
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1;
}
.stat-card .label {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.stat-card .num .small {
  font-size: 16px; color: var(--text-muted);
}

/* ============================================================
   EXPERIENCE — timeline
   ============================================================ */
.timeline { display: flex; flex-direction: column; gap: 0; position: relative; }
.timeline::before {
  content: ""; position: absolute;
  left: 11px; top: 12px; bottom: 12px;
  width: 2px; background: var(--border);
}
.exp-item {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 16px;
  padding: 8px 0 20px;
  position: relative;
}
.exp-item .dot {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 2px solid var(--border);
  display: grid; place-items: center;
  position: relative; z-index: 1;
  margin-top: 4px;
}
.exp-item .dot::after {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-muted);
}
.exp-item.current .dot { border-color: var(--success); background: var(--bg); }
.exp-item.current .dot::after { background: var(--success); box-shadow: 0 0 6px var(--success); }

.exp-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  transition: border-color 0.2s cubic-bezier(0.33, 1, 0.68, 1);
}
.exp-card:hover { border-color: var(--border-hover); }
.exp-meta {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px;
  font-family: var(--font-mono); font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.exp-meta .year { color: var(--warning); }
.exp-meta .sep { color: var(--text-dim); }
.exp-title {
  font-size: 17px; font-weight: 600; color: var(--text);
  margin: 0 0 4px;
}
.exp-company {
  font-size: 14px; color: var(--accent); margin: 0 0 10px;
}
.exp-desc { color: var(--text); font-size: 14.5px; line-height: 1.65; }
.exp-desc ul { margin: 6px 0 0; padding-left: 18px; }
.exp-desc li { margin: 4px 0; color: var(--text-muted); }
.exp-desc li::marker { color: var(--text-dim); }
.exp-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.exp-links .exp-case-link { margin-top: 0; }

.exp-case-link,
.case-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 12px;
  text-decoration: none;
  transition: all 0.15s cubic-bezier(0.33, 1, 0.68, 1);
}
.exp-case-link svg,
.case-live svg { transition: transform 0.15s cubic-bezier(0.33, 1, 0.68, 1); }
.exp-case-link:hover,
.case-live:hover {
  border-color: var(--accent);
  background: var(--surface-hover);
  color: var(--accent);
  text-decoration: none;
}
.exp-case-link:hover svg,
.case-live:hover svg { transform: translateX(2px); }
.exp-case-link:focus-visible,
.case-live:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Live project link — external, opens in a new tab */
.exp-case-link.is-live,
.case-live {
  border-color: rgba(47, 129, 247, 0.4);
  color: var(--accent);
}
.case-live { margin-top: 18px; }

/* ============================================================
   SKILLS — progress bars
   ============================================================ */
.skills-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.skill-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}
.skill-row + .skill-row { border-top: 1px solid var(--border-muted); }
.skill-name { font-size: 14.5px; color: var(--text); display: flex; align-items: center; gap: 8px; }
.skill-name .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent);
}
.skill-row[data-color="green"] .dot { background: var(--success); }
.skill-row[data-color="purple"] .dot { background: var(--purple); }
.skill-row[data-color="warning"] .dot { background: var(--warning); }
.skill-row[data-color="pink"] .dot { background: var(--pink); }
.skill-bar {
  width: 220px;
  height: 6px;
  background: var(--surface-2);
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid var(--border-muted);
}
@media (max-width: 700px) { .skill-bar { width: 140px; } }
.skill-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 1.2s cubic-bezier(0.22, 1, 0.36, 1);
  width: 0;
}
.skill-row[data-color="green"] .skill-fill { background: var(--success); }
.skill-row[data-color="purple"] .skill-fill { background: var(--purple); }
.skill-row[data-color="warning"] .skill-fill { background: var(--warning); }
.skill-row[data-color="pink"] .skill-fill { background: var(--pink); }

.skill-pct {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  min-width: 36px;
  text-align: right;
}

/* ============================================================
   ACTIVITY HEATMAP (GitHub contributions)
   ============================================================ */
.heatmap-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  overflow-x: auto;
}
.heatmap-title {
  font-size: 13px;
  color: var(--text);
  margin: 0 0 14px;
  display: flex; align-items: center; justify-content: space-between;
}
.heatmap-title .subtitle { color: var(--text-muted); font-family: var(--font-mono); font-size: 12px; }
.heatmap {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 4px;
}
.heatmap-years-row {
  grid-column: 2;
  display: grid;
  grid-template-columns: repeat(16, 1fr);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.heatmap-months {
  display: flex; flex-direction: column; justify-content: space-around;
  font-family: var(--font-mono); font-size: 10px; color: var(--text-muted);
  padding-top: 4px;
}
.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(16, 1fr);
  grid-template-rows: repeat(12, 1fr);
  gap: 3px;
  min-width: 600px;
}
.cell {
  aspect-ratio: 1;
  border-radius: 2px;
  background: #161b22;
  border: 1px solid rgba(255,255,255,0.03);
}
.cell.l1 { background: #0e4429; }
.cell.l2 { background: #006d32; }
.cell.l3 { background: #26a641; }
.cell.l4 { background: #39d353; }
.heatmap-legend {
  display: flex; align-items: center; gap: 4px;
  font-family: var(--font-mono); font-size: 11px; color: var(--text-muted);
  justify-content: flex-end;
  margin-top: 10px;
}
.heatmap-legend .cell { width: 10px; height: 10px; aspect-ratio: auto; }

/* ============================================================
   REVIEWS / Issues-style cards
   ============================================================ */
.reviews { display: flex; flex-direction: column; gap: 10px; }
.review {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  transition: all 0.2s cubic-bezier(0.33, 1, 0.68, 1);
}
.review:hover { border-color: var(--border-hover); }
.review-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px;
}
.review-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-size: 12px; font-weight: 600;
  color: var(--text);
  overflow: hidden;
  flex-shrink: 0;
}
.review-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.review-name { font-weight: 600; font-size: 15px; }
.review-role { font-size: 13px; color: var(--text-muted); }
.review-badge {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px;
  border-radius: 2em;
  background: var(--success-bg);
  border: 1px solid rgba(63, 185, 80, 0.3);
  color: var(--success);
  font-size: 11px;
  font-family: var(--font-mono);
}
.review-quote {
  color: var(--text);
  font-size: 15px;
  line-height: 1.65;
  margin: 0;
  padding-left: 14px;
  font-style: italic;
}

/* Audio testimonial */
.review-audio {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(100%, 320px);
  padding: 8px 12px 8px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg);
}
.review-audio-btn {
  width: 32px; height: 32px;
  flex-shrink: 0;
  padding: 0;
  display: grid; place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.review-audio-btn:hover {
  background: var(--surface);
  border-color: var(--border-hover);
}
.review-audio-btn:active { transform: scale(0.94); }
.review-audio-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.review-audio-btn svg {
  grid-area: 1 / 1;
  width: 10px; height: 12px;
  display: block;
}
.review-audio-btn svg[hidden] { display: none; }
/* optical centering of the triangle */
.review-audio-btn .icon-play { margin-left: 1px; }
.review-audio-body { flex: 1; min-width: 0; }
.review-audio-label {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-bottom: 5px;
}
.review-audio-bar {
  height: 4px;
  border-radius: 2px;
  background: var(--surface-2);
  overflow: hidden;
  cursor: pointer;
}
.review-audio-fill {
  height: 100%;
  width: 0;
  background: var(--text-muted);
  border-radius: 2px;
  transition: background 0.15s ease;
}
.review-audio.is-playing .review-audio-fill { background: var(--accent); }
.review-audio-time {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ============================================================
   SERVICES
   ============================================================ */
.services {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (max-width: 700px) { .services { grid-template-columns: 1fr; } }
.service {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex; gap: 12px;
  transition: all 0.2s cubic-bezier(0.33, 1, 0.68, 1);
}
.service:hover { border-color: var(--border-hover); }
.service .icon {
  width: 36px; height: 36px;
  flex-shrink: 0;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border-muted);
  display: grid; place-items: center;
  color: var(--accent);
}
.service .icon svg { width: 18px; height: 18px; }
.service-title { font-size: 15px; font-weight: 600; margin: 0 0 4px; }
.service-text { font-size: 14px; color: var(--text-muted); margin: 0; line-height: 1.6; }

/* ============================================================
   PROJECTS — repository-style cards
   ============================================================ */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  align-items: center;
}
.filter-bar .search {
  flex: 1;
  min-width: 200px;
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
}
.filter-bar .search input {
  background: transparent;
  border: 0; outline: 0;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 13px;
  width: 100%;
}
.filter-bar .search svg { width: 14px; height: 14px; }
.filter-chip {
  padding: 4px 10px;
  font-size: 12px;
  font-family: var(--font-mono);
  border-radius: 2em;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.33, 1, 0.68, 1);
}
.filter-chip:hover { color: var(--text); border-color: var(--border-hover); }
.filter-chip:active { background: var(--surface-2); }
.filter-chip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2em;
}
.filter-chip.active {
  background: rgba(56, 139, 253, 0.15);
  color: var(--accent-soft);
  border-color: rgba(56, 139, 253, 0.5);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
@media (max-width: 800px) { .projects-grid { grid-template-columns: 1fr; } }

.project {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: all 0.2s cubic-bezier(0.33, 1, 0.68, 1);
  cursor: pointer;
}
.project:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.project:active { transform: translateY(0); box-shadow: none; }
.project:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-lg);
}
.project-thumb {
  aspect-ratio: 16/9;
  background:
    repeating-linear-gradient(
      45deg,
      rgba(255,255,255,0.02) 0,
      rgba(255,255,255,0.02) 8px,
      transparent 8px,
      transparent 16px
    ),
    var(--surface-2);
  border-bottom: 1px solid var(--border-muted);
  position: relative;
  display: grid; place-items: center;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 12px;
  overflow: hidden;
}
.project-thumb-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  z-index: 1;
}
.featured-project .project-thumb-img { object-position: top; }
.project-thumb .icon {
  font-size: 36px;
  opacity: 0.5;
  letter-spacing: -2px;
  font-weight: 600;
}
.project-thumb .badge {
  position: absolute; top: 10px; right: 10px;
  padding: 2px 8px;
  background: rgba(13,17,23,0.85);
  border: 1px solid var(--border);
  border-radius: 2em;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  backdrop-filter: blur(4px);
  z-index: 2;
}
.featured-project .featured-badge[style*="position:absolute"] { z-index: 2; }
.project-body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.project-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 16px; font-weight: 600; margin: 0 0 6px;
  color: var(--accent);
}
.project-title svg { width: 16px; height: 16px; color: var(--text-muted); }
.project-desc {
  font-size: 14px; color: var(--text-muted); margin: 0 0 12px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.project-meta {
  display: flex; align-items: center; gap: 14px;
  margin-top: auto;
  padding-top: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}
.project-meta .stat { display: inline-flex; align-items: center; gap: 4px; }
.project-meta .stat svg { width: 14px; height: 14px; }
.project-meta .lang { display: inline-flex; align-items: center; gap: 4px; }
.project-meta .lang .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--warning);
}
.project-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

.featured-project {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 0;
}
@media (max-width: 800px) { .featured-project { grid-template-columns: 1fr; } }
.featured-project .project-thumb { aspect-ratio: auto; min-height: 280px; border-bottom: 0; border-right: 1px solid var(--border-muted); }
@media (max-width: 800px) {
  .featured-project .project-thumb { border-right: 0; border-bottom: 1px solid var(--border-muted); aspect-ratio: 16/9; min-height: 0; }
}
.featured-project .project-body { padding: 24px; }
.featured-project .project-title { font-size: 20px; }
.featured-project .project-desc { -webkit-line-clamp: unset; font-size: 15px; }
.featured-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 2em;
  background: rgba(210, 153, 34, 0.15);
  border: 1px solid rgba(210, 153, 34, 0.3);
  color: var(--warning);
  font-size: 11px;
  font-family: var(--font-mono);
  margin-bottom: 8px;
  width: fit-content;
}

/* ============================================================
   TERMINAL block
   ============================================================ */
.terminal {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 14px;
}
.terminal-header {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-muted);
}
.terminal-header .dot {
  width: 12px; height: 12px; border-radius: 50%;
}
.terminal-header .dot.red { background: #ff5f56; }
.terminal-header .dot.yellow { background: #ffbd2e; }
.terminal-header .dot.green { background: #27c93f; }
.terminal-header .title {
  margin-left: 10px;
  color: var(--text-muted);
  font-size: 12px;
}
.terminal-body {
  padding: 16px 18px;
  line-height: 1.7;
}
.terminal-body .prompt { color: var(--success); }
.terminal-body .cmd { color: var(--text); }
.terminal-body .out { color: var(--text-muted); }
.terminal-body .key { color: var(--purple); }
.terminal-body .val { color: var(--warning); }
.terminal-body .str { color: #a5d6ff; }
.terminal-body .cursor {
  display: inline-block;
  width: 8px; height: 14px;
  background: var(--success);
  vertical-align: middle;
  animation: blink 1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ============================================================
   EDUCATION
   ============================================================ */
.edu-list { display: flex; flex-direction: column; gap: 10px; }
.edu-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  transition: border-color 0.2s cubic-bezier(0.33, 1, 0.68, 1);
}
.edu-item:hover { border-color: var(--border-hover); }
.edu-title { font-weight: 600; font-size: 15px; margin: 0; }
.edu-place { font-size: 14px; color: var(--text-muted); margin: 2px 0 0; }
.edu-year {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  background: var(--surface-2);
  padding: 4px 10px;
  border-radius: 2em;
  border: 1px solid var(--border-muted);
}

/* ============================================================
   CERTIFICATIONS — brand-colored cards
   ============================================================ */
.certs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
@media (max-width: 1100px) {
  .certs { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .certs { grid-template-columns: 1fr; }
}
.cert {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 18px 16px;
  overflow: hidden;
  transition: all 0.2s cubic-bezier(0.33, 1, 0.68, 1);
  isolation: isolate;
}
.cert::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--brand-glow, transparent);
  opacity: 0.5;
  z-index: -1;
  pointer-events: none;
  transition: opacity 0.2s cubic-bezier(0.33, 1, 0.68, 1);
}
.cert:hover {
  border-color: var(--brand, var(--border-hover));
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.cert:hover::before { opacity: 1; }
.cert-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}
.cert-logo {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border-muted);
  display: grid; place-items: center;
  font-weight: 700;
  font-family: var(--font-mono);
  position: relative;
  overflow: hidden;
}
.cert-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 2em;
  background: var(--success-bg);
  border: 1px solid rgba(63, 185, 80, 0.3);
  color: var(--success);
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 500;
}
.cert-status::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 5px var(--success);
}
.cert-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 4px;
  letter-spacing: -0.005em;
}
.cert-issuer {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 14px;
}
.cert-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border-muted);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}
.cert-meta .pill {
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border-muted);
  color: var(--text);
}
.cert-meta .id {
  margin-left: auto;
  font-size: 11px;
  opacity: 0.6;
}

/* Google AdWords — 4 brand-color dots */
.cert.gaw {
  --brand: #4285F4;
  --brand-glow: rgba(66, 133, 244, 0.12);
}
.cert.gaw .cert-logo {
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 8px;
  overflow: hidden;
}
.cert.gaw .cert-logo .dot {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
}
.cert.gaw .cert-logo .dot:nth-child(1) { background: #4285F4; }
.cert.gaw .cert-logo .dot:nth-child(2) { background: #EA4335; }
.cert.gaw .cert-logo .dot:nth-child(3) { background: #FBBC04; }
.cert.gaw .cert-logo .dot:nth-child(4) { background: #34A853; }

/* Yandex Metrika — Yandex red with chart icon vibe */
.cert.metrika {
  --brand: #FFCC00;
  --brand-glow: rgba(255, 204, 0, 0.15);
}
.cert.metrika .cert-logo {
  background: #1a1a1a;
  color: #FFCC00;
  border: 1px solid #FFCC00;
  font-size: 20px;
  font-weight: 700;
  position: relative;
}
.cert.metrika .cert-logo::after {
  content: "";
  position: absolute;
  bottom: 6px; left: 6px; right: 6px;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, #FFCC00 30%, #FC3F1D 70%, transparent 100%);
  opacity: 0.7;
}
.cert.mytarget {
  --brand: #168DE2;
  --brand-glow: rgba(22, 141, 226, 0.15);
}
.cert.mytarget .cert-logo {
  background: linear-gradient(135deg, #168DE2 0%, #0077C2 100%);
  color: #fff;
  border: 0;
  font-size: 20px;
  letter-spacing: -1px;
}

/* Яндекс Метрика — yellow with chart bars */
.cert.metrica {
  --brand: #FFCC00;
  --brand-glow: rgba(255, 204, 0, 0.18);
}
.cert.metrica .cert-logo {
  background: #FFCC00;
  border: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: end;
  gap: 3px;
  padding: 8px 7px;
  overflow: hidden;
}
.cert.metrica .cert-logo .bar {
  display: block;
  width: 100%;
  background: #1a1a1a;
  border-radius: 1px;
}
.cert.metrica .cert-logo .bar:nth-child(1) { height: 35%; }
.cert.metrica .cert-logo .bar:nth-child(2) { height: 60%; }
.cert.metrica .cert-logo .bar:nth-child(3) { height: 45%; background: #FC3F1D; }
.cert.metrica .cert-logo .bar:nth-child(4) { height: 85%; }

/* Yandex Direct — red */
.cert.yandex {
  --brand: #FC3F1D;
  --brand-glow: rgba(252, 63, 29, 0.15);
}
.cert.yandex .cert-logo {
  background: #FC3F1D;
  color: #fff;
  border: 0;
  font-size: 22px;
  letter-spacing: -1px;
}

/* Google Analytics — orange */
.cert.analytics {
  --brand: #F9AB00;
  --brand-glow: rgba(249, 171, 0, 0.15);
}
.cert.analytics .cert-logo {
  background: linear-gradient(135deg, #F9AB00 0%, #E37400 100%);
  color: #fff;
  border: 0;
  font-size: 18px;
}

/* Generic accents */
.cert.facebook { --brand: #1877F2; --brand-glow: rgba(24, 119, 242, 0.15); }
.cert.facebook .cert-logo { background: #1877F2; color: #fff; border: 0; font-size: 22px; }

.cert-brand-bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--brand, var(--accent));
  opacity: 0.8;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  margin-top: 48px;
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  font-family: var(--font-mono);
  border-top: 1px solid var(--border-muted);
}
.footer a { color: var(--text-muted); }
.footer a:hover { color: var(--accent); }

/* Smooth section reveal */
.reveal { opacity: 0; transform: translateY(8px); transition: all 0.6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ============================================================
   ACCESSIBILITY — reduce motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .skill-fill { transition: none; }
  .stat-card:hover { transform: none; }
  .project:hover { transform: none; }
  .cert:hover { transform: none; }
  .case-shot:hover { transform: none; }
  .edu-item:hover { transform: none; }
  .service:hover { transform: none; }
  .review:hover { transform: none; }
  .exp-card:hover { transform: none; }
  .terminal-body .cursor {
    animation: none;
    opacity: 1;
  }
  @keyframes blink { 50% { opacity: 1; } }
}

/* ============================================================
   CASE PAGE
   ============================================================ */
.case-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 24px 64px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.case-back {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--text-muted);
  font-size: 13px;
  text-decoration: none;
  width: fit-content;
}
.case-back:hover {
  color: var(--accent);
  text-decoration: none;
}
.case-back svg { width: 14px; height: 14px; }

.case-hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 28px 24px;
}
.case-meta-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.case-badge {
  padding: 2px 10px;
  border-radius: 2em;
  background: rgba(210, 153, 34, 0.15);
  border: 1px solid rgba(210, 153, 34, 0.3);
  color: var(--warning);
}
.case-period { color: var(--text-muted); }
.case-period::before { content: "·"; margin-right: 10px; color: var(--text-dim); }
.case-category { color: var(--text-muted); }
.case-category::before { content: "·"; margin-right: 10px; color: var(--text-dim); }

.case-title {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
  line-height: 1.15;
}
.case-company {
  font-family: var(--font-mono);
  color: var(--accent);
  margin: 0 0 16px;
  font-size: 14px;
}
.case-summary {
  font-size: 16px;
  color: var(--text);
  line-height: 1.65;
  margin: 0;
}

.case-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--border-muted);
}
.case-metric {
  text-align: left;
}
.case-metric-value {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 600;
  color: var(--success);
  letter-spacing: -0.02em;
  line-height: 1;
}
.case-metric-label {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.case-block {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.case-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.case-sections {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.case-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  position: relative;
}
.case-section h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 12px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.case-section h3::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}
.case-section p {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  margin: 0 0 10px;
}
.case-section p:last-child { margin-bottom: 0; }
.case-section ul {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}
.case-section li {
  position: relative;
  padding: 7px 0 7px 14px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  border-top: 1px solid var(--border-muted);
}
.case-section li:first-child { border-top: 0; padding-top: 4px; }
.case-section li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 16px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-dim);
}

/* Tasks — what I did: neutral, no header icon */
.case-section.kind-tasks h3::before { display: none; }

/* Results — green accent, no header icon, subtle green dot */
.case-section.kind-results {
  background: var(--success-bg);
  padding-left: 20px;
}
.case-section.kind-results h3 { color: var(--success); }
.case-section.kind-results h3::before { display: none; }
.case-section.kind-results li::before {
  background: var(--success);
}

/* Narrative — quote-style, darker bg */
.case-section.kind-narrative {
  background: var(--surface-2);
}
.case-section.kind-narrative h3 { color: var(--warning); }
.case-section.kind-narrative h3::before { display: none; }
.case-section.kind-narrative p {
  font-size: 15.5px;
  color: var(--text);
}
.case-section.kind-narrative li::before {
  background: var(--warning);
}

.case-shots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.case-shot {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16/10;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: zoom-in;
  padding: 0;
  transition: all 0.2s cubic-bezier(0.33, 1, 0.68, 1);
}
.case-shot:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.case-shot:active { transform: translateY(0); box-shadow: none; }
.case-shot:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius);
}
.case-shot img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.case-shot-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  pointer-events: none;
  z-index: 0;
}
.case-shot.broken {
  background:
    repeating-linear-gradient(
      45deg,
      rgba(255,255,255,0.02) 0,
      rgba(255,255,255,0.02) 8px,
      transparent 8px,
      transparent 16px
    ),
    var(--surface-2);
}

.case-footer-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border-muted);
}

.case-404 {
  text-align: center;
  padding: 80px 20px;
}
.case-404-glyph {
  font-family: var(--font-mono);
  font-size: 96px;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: -0.04em;
  line-height: 1;
}
.case-404 h2 {
  font-size: 22px;
  margin: 18px 0 8px;
}
.case-404 p {
  color: var(--text-muted);
  margin: 0 0 20px;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(1, 4, 9, 0.95);
  display: grid;
  place-items: center;
  backdrop-filter: blur(4px);
}
.lightbox[hidden] { display: none; }
.lightbox img {
  max-width: 92vw;
  max-height: 88vh;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.lightbox-close, .lightbox-nav {
  position: absolute;
  background: rgba(48, 54, 61, 0.7);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 50%;
  cursor: pointer;
  display: grid; place-items: center;
  backdrop-filter: blur(8px);
  transition: all 0.15s cubic-bezier(0.33, 1, 0.68, 1);
}
.lightbox-close:hover, .lightbox-nav:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
}
.lightbox-close {
  top: 20px; right: 20px;
  width: 40px; height: 40px;
  font-size: 22px;
  line-height: 1;
}
.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 48px; height: 48px;
  font-size: 28px;
  line-height: 1;
}
.lightbox-nav.prev { left: 20px; }
.lightbox-nav.next { right: 20px; }
.lightbox-counter {
  position: absolute;
  bottom: 20px; left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  background: rgba(48, 54, 61, 0.7);
  padding: 4px 12px;
  border-radius: 2em;
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

@media (max-width: 600px) {
  .case-title { font-size: 24px; }
  .case-hero { padding: 22px 20px 20px; }
  .case-metric-value { font-size: 22px; }
}

/* Environment — sidebar card, slightly lifted off the plain sections */
.env-card {
  background: var(--surface);
  border: 1px solid var(--border-muted);
  border-left: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 10px 12px 12px;
}
.env-card .sidebar-section-title { margin: 0 0 8px; }
.env-card .sidebar-section-title .count { text-transform: lowercase; }
.env-list { display: flex; flex-direction: column; gap: 8px; }
.env-row {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 10px;
  align-items: baseline;
}
.env-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}
.env-value {
  font-size: 12.5px;
  line-height: 1.5;
  color: #c9d1d9;
}
.env-value strong { color: inherit; font-weight: 500; }
.env-stack { display: flex; flex-direction: column; gap: 4px; }
.env-item { display: block; }
.env-sub {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.45;
}
