/* ==========================================================================
   Sarthak Panda Portfolio: Obsidian / Crimson / Electric Cyan Theme
   Anti-thin typography: minimum weight 500 everywhere
   ========================================================================== */

:root {
  color-scheme: dark;
  --bg: #07080d;
  --ink-rgb: 255, 255, 255;      /* foreground tint used for borders / hover fills */
  --panel-rgb: 16, 19, 27;       /* glass panel base colour */
  --shadow-rgb: 0, 0, 0;
  --shadow-k: 1;
  --glass-blur: 5px;
  --text-strong: #ffffff;
  --avatar-bg: #10141e;
  --lv-0: #161c26;
  --lv-1: #0e4a3d;
  --lv-2: #167a5e;
  --glow-opacity: 1;
  --tk-inc: #f472b6;
  --tk-str: #fb923c;
  --tk-fn: #fde047;
  --tk-num: #a78bfa;
  --surface: rgba(var(--panel-rgb), 0.78);
  --surface-strong: rgba(var(--panel-rgb), 0.96);
  --border: rgba(var(--ink-rgb), 0.09);
  --border-hover: rgba(110, 231, 255, 0.34);

  --text-primary: #f5f7fb;
  --text-secondary: #bcc5d6;
  --text-muted: #8a95aa;

  --crimson: #e14258;
  --crimson-soft: rgba(225, 66, 88, 0.16);
  --cyan: #38e2d8;
  --cyan-soft: rgba(56, 226, 216, 0.15);
  --emerald: #34d399;
  --emerald-soft: rgba(52, 211, 153, 0.16);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-pill: 999px;
}

/* ---------------- Light theme ---------------- */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eef1f7;
  --ink-rgb: 15, 23, 42;
  --panel-rgb: 255, 255, 255;
  --shadow-rgb: 30, 41, 59;
  --shadow-k: 0.28;
  --border-hover: rgba(13, 148, 136, 0.5);

  --surface: rgba(255, 255, 255, 0.42);
  --surface-strong: rgba(255, 255, 255, 0.96);

  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #5b6678;
  --text-strong: #020617;

  --crimson: #c81e3a;
  --crimson-soft: rgba(200, 30, 58, 0.12);
  --cyan: #0d9488;
  --cyan-soft: rgba(13, 148, 136, 0.13);
  --emerald: #059669;
  --emerald-soft: rgba(5, 150, 105, 0.14);

  --avatar-bg: #e2e8f0;
  --lv-0: #dbe3ee;
  --lv-1: #a7e3cc;
  --lv-2: #52c79e;
  --glow-opacity: 0.55;
  --tk-inc: #be185d;
  --tk-str: #c2410c;
  --tk-fn: #a16207;
  --tk-num: #6d28d9;
}

:root[data-theme="light"] .brand,
:root[data-theme="light"] .btn-primary { color: var(--text-strong); }

.ambient-glow { opacity: var(--glow-opacity); }

/* ---------------- Theme toggle ---------------- */
.theme-toggle {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: rgba(var(--panel-rgb), 0.4);
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.theme-toggle:hover { border-color: var(--border-hover); transform: rotate(14deg); }
.theme-toggle:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: none; }


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

html {
  scroll-behavior: smooth;
  background-color: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  background-color: var(--bg);
  overflow-x: hidden;
  line-height: 1.5;
  position: relative;
}

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

/* ---------------- Background Layers ---------------- */
#bg-graph {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.dot-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(var(--ink-rgb), 0.075) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(ellipse 85% 75% at 50% 35%, #000 45%, transparent 100%);
}

.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(110px);
  pointer-events: none;
  z-index: 0;
}

.glow-crimson {
  width: 520px;
  height: 420px;
  top: -120px;
  left: -100px;
  background: radial-gradient(circle, rgba(196, 36, 62, 0.28), transparent 70%);
}

.glow-cyan {
  width: 560px;
  height: 460px;
  top: 12%;
  right: -120px;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.17), transparent 70%);
}

/* ---------------- Container & Nav ---------------- */
.container {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(var(--panel-rgb), 0.5);
  border-bottom: 1px solid rgba(var(--ink-rgb), 0.06);
}

.nav-inner {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text-strong);
}

.brand span {
  color: var(--crimson);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-links a {
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: var(--text-strong);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-github {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 9px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  background: linear-gradient(135deg, rgba(225, 66, 88, 0.18), rgba(56, 226, 216, 0.14));
  border: 1px solid rgba(56, 226, 216, 0.32);
  box-shadow: 0 0 18px rgba(225, 66, 88, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.btn-github:hover {
  transform: translateY(-1px);
  border-color: rgba(56, 226, 216, 0.65);
  box-shadow: 0 0 24px rgba(56, 226, 216, 0.25);
}

.icon-gh {
  width: 17px;
  height: 17px;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  padding: 8px;
  border-radius: 8px;
  background: rgba(var(--ink-rgb), 0.05);
  border: 1px solid var(--border);
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
}

/* ---------------- Hero Section + Profile Photo ---------------- */
.main-content {
  padding-top: 34px;
  padding-bottom: 52px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  align-items: center;
  gap: 36px;
  padding: 18px 0 36px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  background: rgba(var(--panel-rgb), 0.5);
  border: 1px solid rgba(var(--ink-rgb), 0.11);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 18px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
  animation: pulseDot 2.4s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.86); }
}

.hero-identity {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
}

.avatar-ring {
  flex-shrink: 0;
  width: 82px;
  height: 82px;
  padding: 2.5px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--crimson), var(--cyan));
  box-shadow: 0 0 24px rgba(225, 66, 88, 0.28), 0 0 18px rgba(56, 226, 216, 0.2);
}

.hero-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 20%;
  display: block;
  background: var(--avatar-bg);
  border: 2px solid var(--bg);
}

.hero-title {
  font-size: clamp(2.35rem, 4.7vw, 3.65rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.06;
  color: var(--text-strong);
  margin-bottom: 8px;
}

.hero-subtitle {
  font-size: clamp(0.98rem, 1.55vw, 1.18rem);
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: -0.01em;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn-primary,
.btn-secondary,
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 20px;
  border-radius: 10px;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.btn-primary {
  color: var(--text-strong);
  background: linear-gradient(135deg, rgba(190, 38, 62, 0.42), rgba(20, 48, 58, 0.62));
  border: 1px solid rgba(225, 66, 88, 0.55);
  box-shadow: 0 8px 26px rgba(225, 66, 88, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.btn-primary:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 226, 216, 0.7);
  box-shadow: 0 10px 30px rgba(225, 66, 88, 0.34);
}

.btn-secondary {
  color: var(--text-primary);
  background: rgba(var(--panel-rgb), 0.85);
  border: 1px solid rgba(var(--ink-rgb), 0.14);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  background: rgba(var(--panel-rgb), 0.95);
  border-color: rgba(var(--ink-rgb), 0.28);
}

.btn-danger {
  color: var(--text-strong);
  background: rgba(225, 66, 88, 0.2);
  border: 1px solid rgba(225, 66, 88, 0.5);
}

.btn-danger:hover {
  background: rgba(225, 66, 88, 0.34);
  border-color: rgba(225, 66, 88, 0.8);
}

.btn-sm {
  padding: 7px 14px;
  font-size: 0.84rem;
}

/* ---------------- Terminal Window ---------------- */
.terminal-window {
  background: rgba(var(--panel-rgb), 0.5);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(56, 226, 216, 0.34);
  box-shadow:
    0 20px 55px rgba(var(--shadow-rgb), calc(0.55 * var(--shadow-k))),
    0 0 32px rgba(56, 226, 216, 0.11),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  overflow: hidden;
  backdrop-filter: blur(var(--glass-blur));
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  background: rgba(var(--panel-rgb), 0.9);
  border-bottom: 1px solid rgba(var(--ink-rgb), 0.07);
}

.traffic-lights {
  display: flex;
  gap: 7px;
}

.traffic-lights .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27c93f; }

.terminal-tabs {
  display: flex;
  gap: 6px;
}

.term-tab {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  padding: 3px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.term-tab.active,
.term-tab:hover {
  color: var(--text-primary);
  background: rgba(var(--ink-rgb), 0.08);
  border-color: rgba(var(--ink-rgb), 0.12);
}

.terminal-body {
  display: grid;
  grid-template-columns: 1.38fr 0.92fr;
  min-height: 215px;
}

.code-pane {
  padding: 14px 14px;
  border-right: 1px solid rgba(var(--ink-rgb), 0.07);
  overflow-x: auto;
}

.code-pane pre {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 500;
  line-height: 1.56;
  color: var(--text-secondary);
}

.tk-inc { color: var(--tk-inc); font-weight: 600; }
.tk-str { color: var(--tk-str); }
.tk-kw  { color: var(--cyan); font-weight: 600; }
.tk-fn  { color: var(--tk-fn); font-weight: 600; }
.tk-num { color: var(--tk-num); font-weight: 600; }

.stats-pane {
  padding: 14px 13px;
  font-family: var(--font-mono);
  font-size: 0.73rem;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: rgba(var(--panel-rgb), 0.45);
}

.stats-header,
.stats-row {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr 0.7fr;
  gap: 6px;
  align-items: center;
}

.stats-header {
  color: var(--cyan);
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(var(--ink-rgb), 0.08);
  margin-bottom: 4px;
}

.stats-row {
  color: var(--text-secondary);
  padding: 2px 0;
}

.stats-row span:nth-child(2),
.stats-row span:nth-child(3),
.stats-header span:nth-child(2),
.stats-header span:nth-child(3) {
  text-align: right;
}

.stats-row span:nth-child(3) {
  color: var(--emerald);
}

.terminal-shell {
  padding: 14px 16px;
  min-height: 215px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
}

.shell-output {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 158px;
  overflow-y: auto;
  margin-bottom: 10px;
}

.sh-prompt { color: var(--cyan); font-weight: 700; }
.sh-cmd { color: var(--text-strong); font-weight: 600; }
.sh-res { color: var(--text-secondary); line-height: 1.45; }
.sh-hint { color: var(--text-muted); font-size: 0.74rem; }
.sh-key { color: var(--crimson); font-weight: 700; }

.shell-form {
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px solid rgba(var(--ink-rgb), 0.08);
  padding-top: 8px;
}

.shell-form input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-strong);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
}

/* ---------------- Primary Bento Section ---------------- */
.bento-section {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.15fr);
  gap: 18px;
  margin-bottom: 18px;
  align-items: stretch;
}

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  overflow: hidden;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
  background: radial-gradient(
    360px circle at var(--mx, 50%) var(--my, 50%),
    rgba(56, 226, 216, 0.13),
    transparent 65%
  );
}

.card:hover::before {
  opacity: 1;
}

.card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 14px 36px rgba(var(--shadow-rgb), calc(0.42 * var(--shadow-k)));
}

/* Live GitHub Activity Card */
.activity-card {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
}

.activity-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.activity-header h2 {
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-strong);
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.3);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--emerald);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 8px var(--emerald);
  animation: pulseDot 2s infinite;
}

.heatmap-wrapper {
  width: 100%;
  overflow-x: auto;
  padding-bottom: 2px;
}

.heatmap-months {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(10px, 1fr);
  gap: 3px;
  margin-left: 30px;
  margin-bottom: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
}

.heatmap-body {
  display: flex;
  align-items: stretch;
  gap: 6px;
}

.heatmap-days {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 8px 0;
  width: 24px;
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
}

.heatmap-grid {
  flex: 1;
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, 11px);
  grid-auto-columns: minmax(10px, 1fr);
  gap: 3px;
  min-width: 360px;
}

.cell {
  width: 100%;
  height: 11px;
  border-radius: 2.5px;
  transition: transform 0.12s ease, filter 0.12s ease;
}

.heatmap-grid .cell:hover {
  transform: scale(1.25);
  filter: brightness(1.25);
  cursor: pointer;
}

.lv-0 { background: var(--lv-0); }
.lv-1 { background: var(--lv-1); }
.lv-2 { background: var(--lv-2); }
.lv-3 { background: #22b585; box-shadow: 0 0 6px rgba(34, 181, 133, 0.35); }
.lv-4 { background: #4bf2b5; box-shadow: 0 0 9px rgba(75, 242, 181, 0.55); }

.heatmap-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 9px;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted);
}

.heatmap-legend {
  display: flex;
  align-items: center;
  gap: 4px;
}

.heatmap-legend .cell {
  width: 10px;
  height: 10px;
}

.commit-feed-block {
  border-top: 1px solid rgba(var(--ink-rgb), 0.07);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.feed-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.feed-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
}

.commit-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.commit-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.commit-item a {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  flex: 1;
}

.commit-item a:hover .commit-msg {
  color: var(--cyan);
}

.commit-repo {
  color: var(--cyan);
  font-weight: 700;
  flex-shrink: 0;
}

.commit-msg {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-secondary);
  transition: color 0.15s ease;
}

.commit-time {
  color: var(--text-muted);
  font-size: 0.7rem;
  flex-shrink: 0;
}

.gh-profile-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-primary);
  transition: color 0.18s ease;
}

.gh-profile-link:hover {
  color: var(--cyan);
}

.icon-gh-sm {
  width: 15px;
  height: 15px;
}

.gh-repo-count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* ---------------- 2x2 Project Cards ---------------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.project-card {
  padding: 22px 22px 20px;
  min-height: 162px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
}

.project-card:hover {
  transform: translateY(-3px);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.project-card h3 {
  font-size: 1.24rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--text-strong);
}

.card-icon,
.card-arrow {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: color 0.18s ease, transform 0.18s ease;
  flex-shrink: 0;
}

.project-card:hover .card-icon,
.project-card:hover .card-arrow {
  color: var(--cyan);
  transform: translate(2px, -1px);
}

.card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 18px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.tag-crimson {
  background: var(--crimson-soft);
  color: var(--crimson);
  border: 1px solid rgba(225, 66, 88, 0.35);
}

.tag-emerald {
  background: var(--emerald-soft);
  color: var(--emerald);
  border: 1px solid rgba(52, 211, 153, 0.35);
}

.tag-cyan {
  background: var(--cyan-soft);
  color: var(--cyan);
  border: 1px solid rgba(56, 226, 216, 0.35);
}

.tag-slate {
  background: rgba(148, 163, 184, 0.14);
  color: var(--text-secondary);
  border: 1px solid rgba(var(--ink-rgb), 0.12);
}

.card-meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* ---------------- Compact Experience / Education Strip ---------------- */
.compact-strip {
  margin-bottom: 24px;
}

.strip-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.mini-card {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mini-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mini-kicker {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted);
}

.mini-card h3 {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text-strong);
}

.mini-line {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ---------------- Blog Subsection ---------------- */
.blog-section {
  margin-bottom: 26px;
}

.blog-heading-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.blog-count-pill {
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: rgba(var(--ink-rgb), 0.06);
  border: 1px solid rgba(var(--ink-rgb), 0.1);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}

.blog-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-admin-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(var(--ink-rgb), 0.05);
  border: 1px solid rgba(var(--ink-rgb), 0.12);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn-admin-ghost:hover {
  color: var(--text-strong);
  border-color: rgba(56, 226, 216, 0.45);
  background: rgba(56, 226, 216, 0.1);
}

.icon-lock {
  width: 13px;
  height: 13px;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.blog-card {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}

.blog-card:hover {
  transform: translateY(-2px);
}

.blog-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted);
}

.blog-card h3 {
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text-strong);
  line-height: 1.3;
}

.blog-card-summary {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.48;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
}

.blog-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-tiny {
  padding: 4px 9px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  border: 1px solid rgba(var(--ink-rgb), 0.14);
  background: rgba(var(--ink-rgb), 0.06);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-tiny:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

.btn-tiny.del:hover {
  border-color: var(--crimson);
  color: var(--crimson);
}

.blog-empty {
  grid-column: 1 / -1;
  padding: 28px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 600;
}

/* ---------------- Live GitHub Repos Strip ---------------- */
.repos-strip {
  margin-bottom: 26px;
}

.strip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.strip-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-strong);
  letter-spacing: -0.02em;
}

.view-all-link {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--cyan);
}

.view-all-link:hover {
  text-decoration: underline;
}

.repos-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.repo-pill-card {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.repo-pill-card:hover {
  transform: translateY(-2px);
}

.repo-name {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-strong);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.repo-lang {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ---------------- Footer & Skills ---------------- */
.footer {
  border-top: 1px solid rgba(var(--ink-rgb), 0.08);
  padding-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.skills-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-chip {
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(var(--panel-rgb), 0.5);
  border: 1px solid rgba(var(--ink-rgb), 0.09);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-links a {
  color: var(--text-secondary);
  transition: color 0.18s ease;
}

.footer-links a:hover {
  color: var(--cyan);
}

/* ---------------- Modals (Project, Blog Reader, Login, Editor) ---------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(4, 6, 10, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  width: 100%;
  max-width: 540px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--surface-strong);
  border: 1px solid rgba(56, 226, 216, 0.35);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 24px 60px rgba(var(--shadow-rgb), calc(0.65 * var(--shadow-k)));
}

.modal-card-wide {
  max-width: 720px;
}

.modal-card-sm {
  max-width: 420px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.modal-meta {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--cyan);
  margin-bottom: 4px;
}

.modal-head h3 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-strong);
  line-height: 1.25;
}

.modal-close {
  background: rgba(var(--ink-rgb), 0.08);
  border: 1px solid var(--border);
  color: var(--text-strong);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}

.modal-points {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.modal-points li {
  position: relative;
  padding-left: 16px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.modal-points li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--crimson);
}

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  border-top: 1px solid rgba(var(--ink-rgb), 0.08);
  padding-top: 14px;
  margin-top: 8px;
}

/* Blog Reader Typography */
.reader-tags {
  margin-bottom: 16px;
}

.reader-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 0.94rem;
  font-weight: 500;
  line-height: 1.65;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.reader-body h2,
.reader-body h3 {
  color: var(--text-strong);
  font-weight: 700;
  margin-top: 6px;
  letter-spacing: -0.015em;
}

.reader-body h2 { font-size: 1.15rem; }
.reader-body h3 { font-size: 1.02rem; }

.reader-body ul {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.reader-body code {
  font-family: var(--font-mono);
  font-size: 0.84em;
  background: rgba(56, 226, 216, 0.12);
  color: var(--cyan);
  padding: 2px 6px;
  border-radius: 5px;
}

.reader-body pre {
  background: rgba(var(--panel-rgb), 0.7);
  border: 1px solid rgba(var(--ink-rgb), 0.1);
  border-radius: 10px;
  padding: 14px;
  overflow-x: auto;
}

.reader-body pre code {
  background: transparent;
  color: var(--text-secondary);
  padding: 0;
  font-size: 0.82rem;
  line-height: 1.55;
}

.reader-body a {
  color: var(--cyan);
  text-decoration: underline;
}

.reader-admin-actions {
  display: flex;
  gap: 8px;
}

.admin-note {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Editor Form */
.editor-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.editor-row-2 {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 12px;
}

.field-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.field-input,
.field-textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 9px;
  background: rgba(var(--panel-rgb), 0.92);
  border: 1px solid rgba(var(--ink-rgb), 0.13);
  color: var(--text-strong);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  outline: none;
  transition: border-color 0.18s ease;
}

.field-textarea {
  font-family: var(--font-mono);
  font-size: 0.83rem;
  line-height: 1.55;
  resize: vertical;
}

.field-input:focus,
.field-textarea:focus {
  border-color: var(--cyan);
}

.editor-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.preview-box {
  min-height: 210px;
  padding: 14px;
  border-radius: 9px;
  background: rgba(var(--panel-rgb), 0.92);
  border: 1px solid rgba(var(--ink-rgb), 0.12);
}

.form-error {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--crimson);
}

/* ---------------- Floating Heatmap Tooltip ---------------- */
.heatmap-tooltip {
  position: fixed;
  z-index: 80;
  pointer-events: none;
  padding: 6px 10px;
  border-radius: 7px;
  background: var(--surface-strong);
  border: 1px solid rgba(56, 226, 216, 0.4);
  font-family: var(--font-mono);
  font-size: 0.73rem;
  font-weight: 600;
  color: var(--text-strong);
  box-shadow: 0 8px 24px rgba(var(--shadow-rgb), calc(0.5 * var(--shadow-k)));
  white-space: nowrap;
}

.hidden {
  display: none !important;
}

/* ---------------- Entrance Reveal ---------------- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------------- Responsive Breakpoints ---------------- */
@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .bento-section {
    grid-template-columns: 1fr;
  }

  .strip-grid,
  .repos-row,
  .blog-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .container {
    padding: 0 16px;
  }

  .nav-links {
    position: fixed;
    top: 68px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 14px;
    padding: 18px 20px;
    background: rgba(var(--panel-rgb), 0.96);
    border-bottom: 1px solid var(--border);
    display: none;
  }

  .nav-links.open {
    display: flex;
  }

  .menu-toggle {
    display: flex;
  }

  .hero-identity {
    gap: 14px;
  }

  .avatar-ring {
    width: 66px;
    height: 66px;
  }

  .terminal-body,
  .editor-row-2 {
    grid-template-columns: 1fr;
  }

  .code-pane {
    border-right: none;
    border-bottom: 1px solid rgba(var(--ink-rgb), 0.07);
  }

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

  .project-card {
    min-height: 132px;
  }
}

:root[data-theme="light"] .btn-primary {
  background: linear-gradient(135deg, rgba(200, 30, 58, 0.16), rgba(13, 148, 136, 0.18));
  border-color: rgba(200, 30, 58, 0.45);
}


/* ---------------- Scrollbars (slim, themed, no arrow buttons) ---------------- */
:root {
  --scroll-thumb: rgba(var(--ink-rgb), 0.22);
  --scroll-thumb-hover: rgba(56, 226, 216, 0.55);
}
:root[data-theme="light"] { --scroll-thumb-hover: rgba(13, 148, 136, 0.6); }

/* Chrome / Edge / Safari: fully custom bar, no arrow buttons */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb);
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--scroll-thumb-hover); background-clip: content-box; }

/* Firefox */
@-moz-document url-prefix() {
  * { scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
}

/* keep horizontal scrollers tidy: reserve no space, scroll smoothly, don't trap the page scroll */
.heatmap-wrapper, .code-pane, .shell-output, .prose pre, .table-wrap, .math-display {
  overscroll-behavior-x: contain;
  scrollbar-gutter: auto;
}
