/* ==========================================================================
   Jose Izaac Robles Trinidad — Asymmetric Metro Tiling × Liquid Glass
   Pure Vanilla CSS · Dark & Light Themes · Responsive 6 / 4 / 2 Col Grid
   ========================================================================== */

:root {
  --font-display: "Segoe UI Variable Display", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --font-body: "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Cascadia Code", "Consolas", "SFMono-Regular", ui-monospace, Menlo, monospace;

  --radius-tile: 18px;
  --radius-chip: 9px;
  --radius-pill: 999px;

  --gap: 14px;
  --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);
  --glass-blur: 26px;
  --glass-sat: 190%;
}

/* ---------- DARK THEME (Obsidian Marine Liquid Glass) ---------- */
[data-theme="dark"] {
  --bg-base: #050d15;
  --bg-gradient:
    radial-gradient(110% 85% at 10% 8%, #0c3d4f 0%, transparent 52%),
    radial-gradient(95% 80% at 90% 15%, #0a2d4c 0%, transparent 50%),
    radial-gradient(90% 75% at 50% 95%, #0a3638 0%, transparent 55%),
    linear-gradient(155deg, #040b12 0%, #071622 52%, #040e16 100%);

  --orb-1: rgba(14, 165, 210, 0.34);
  --orb-2: rgba(16, 185, 160, 0.26);
  --orb-3: rgba(37, 99, 210, 0.26);
  --orb-4: rgba(217, 152, 68, 0.16);

  --text-primary: #f2f7fb;
  --text-secondary: #b7cadb;
  --text-muted: #7f9bb2;

  --accent: #38bdf8;
  --accent-strong: #0ea5e9;
  --accent-teal: #2dd4bf;
  --accent-amber: #fbbf24;
  --accent-soft: rgba(56, 189, 248, 0.15);

  --glass-surface: rgba(13, 27, 41, 0.52);
  --glass-surface-strong: rgba(13, 28, 44, 0.78);
  --glass-subtle: rgba(255, 255, 255, 0.055);
  --glass-hover: rgba(255, 255, 255, 0.11);

  --glass-border: rgba(255, 255, 255, 0.16);
  --glass-border-hover: rgba(255, 255, 255, 0.32);
  --glass-rim-top: rgba(255, 255, 255, 0.40);
  --glass-rim-left: rgba(255, 255, 255, 0.18);
  --glass-rim-bottom: rgba(0, 0, 0, 0.44);
  --glass-specular: rgba(255, 255, 255, 0.18);

  --tile-shadow:
    0 18px 42px rgba(0, 0, 0, 0.42),
    0 4px 12px rgba(0, 0, 0, 0.26),
    inset 0 1.5px 0 var(--glass-rim-top),
    inset 1px 0 0 var(--glass-rim-left),
    inset 0 -1px 0 var(--glass-rim-bottom);
  --tile-shadow-hover:
    0 26px 56px rgba(0, 0, 0, 0.54),
    0 8px 22px rgba(14, 165, 233, 0.14),
    inset 0 1.5px 0 rgba(255, 255, 255, 0.52),
    inset 1px 0 0 rgba(255, 255, 255, 0.25),
    inset 0 -1px 0 var(--glass-rim-bottom);

  /* Tinted Liquid Glass Metro Tiles */
  --tint-hero: linear-gradient(145deg, rgba(16, 42, 64, 0.64), rgba(10, 24, 38, 0.54));
  --tint-cyan: linear-gradient(145deg, rgba(14, 165, 233, 0.30), rgba(9, 43, 66, 0.52));
  --tint-blue: linear-gradient(145deg, rgba(37, 99, 235, 0.28), rgba(12, 32, 62, 0.54));
  --tint-teal: linear-gradient(145deg, rgba(20, 184, 166, 0.28), rgba(10, 44, 48, 0.52));
  --tint-emerald: linear-gradient(145deg, rgba(16, 185, 129, 0.26), rgba(9, 44, 38, 0.52));
  --tint-amber: linear-gradient(145deg, rgba(217, 119, 6, 0.28), rgba(48, 30, 16, 0.52));
  --tint-slate: linear-gradient(145deg, rgba(71, 95, 118, 0.30), rgba(14, 26, 39, 0.54));

  --modal-backdrop: rgba(3, 10, 17, 0.64);
}

/* ---------- LIGHT THEME (Crystal Pearl Liquid Glass) ---------- */
[data-theme="light"] {
  --bg-base: #dceaf5;
  --bg-gradient:
    radial-gradient(110% 80% at 10% 8%, #a2d7f5 0%, transparent 52%),
    radial-gradient(95% 78% at 90% 14%, #b5e6e1 0%, transparent 50%),
    radial-gradient(90% 78% at 52% 96%, #f9e1c4 0%, transparent 55%),
    linear-gradient(155deg, #ecf4fb 0%, #dae9f5 50%, #e7f2f6 100%);

  --orb-1: rgba(56, 189, 248, 0.42);
  --orb-2: rgba(45, 212, 191, 0.36);
  --orb-3: rgba(96, 165, 250, 0.32);
  --orb-4: rgba(251, 191, 36, 0.26);

  --text-primary: #0b1b2b;
  --text-secondary: #2a445d;
  --text-muted: #526e87;

  --accent: #0284c7;
  --accent-strong: #0369a1;
  --accent-teal: #0d9488;
  --accent-amber: #b45309;
  --accent-soft: rgba(2, 132, 199, 0.12);

  --glass-surface: rgba(255, 255, 255, 0.58);
  --glass-surface-strong: rgba(255, 255, 255, 0.84);
  --glass-subtle: rgba(14, 42, 71, 0.045);
  --glass-hover: rgba(14, 42, 71, 0.09);

  --glass-border: rgba(255, 255, 255, 0.78);
  --glass-border-hover: rgba(255, 255, 255, 0.98);
  --glass-rim-top: rgba(255, 255, 255, 0.98);
  --glass-rim-left: rgba(255, 255, 255, 0.74);
  --glass-rim-bottom: rgba(14, 42, 71, 0.11);
  --glass-specular: rgba(255, 255, 255, 0.72);

  --tile-shadow:
    0 14px 36px rgba(14, 42, 71, 0.11),
    0 3px 10px rgba(14, 42, 71, 0.06),
    inset 0 1.5px 0 var(--glass-rim-top),
    inset 1px 0 0 var(--glass-rim-left),
    inset 0 -1px 0 var(--glass-rim-bottom);
  --tile-shadow-hover:
    0 22px 48px rgba(14, 42, 71, 0.16),
    0 6px 18px rgba(2, 132, 199, 0.10),
    inset 0 2px 0 #ffffff,
    inset 1px 0 0 rgba(255, 255, 255, 0.90),
    inset 0 -1px 0 rgba(14, 42, 71, 0.14);

  /* Tinted Liquid Glass Metro Tiles (Crystal Pearl) */
  --tint-hero: linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(240, 249, 255, 0.56));
  --tint-cyan: linear-gradient(145deg, rgba(56, 189, 248, 0.24), rgba(255, 255, 255, 0.64));
  --tint-blue: linear-gradient(145deg, rgba(59, 130, 246, 0.20), rgba(255, 255, 255, 0.66));
  --tint-teal: linear-gradient(145deg, rgba(20, 184, 166, 0.22), rgba(255, 255, 255, 0.64));
  --tint-emerald: linear-gradient(145deg, rgba(16, 185, 129, 0.20), rgba(255, 255, 255, 0.66));
  --tint-amber: linear-gradient(145deg, rgba(245, 158, 11, 0.22), rgba(255, 255, 255, 0.66));
  --tint-slate: linear-gradient(145deg, rgba(100, 116, 139, 0.16), rgba(255, 255, 255, 0.68));

  --modal-backdrop: rgba(15, 36, 56, 0.34);
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-primary);
  background: var(--bg-base);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: color 0.35s var(--ease-spring), background-color 0.35s var(--ease-spring);
}

button, input {
  font-family: inherit;
  color: inherit;
}

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

/* ---------- Organic Fluid Backdrop ---------- */
.liquid-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: var(--bg-gradient);
  overflow: hidden;
  pointer-events: none;
  transition: background 0.5s var(--ease-spring);
}

.liquid-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.92;
  will-change: transform;
}

.orb-1 { width: 52vmax; height: 52vmax; top: -18vmax; left: -12vmax; background: var(--orb-1); animation: floatA 24s ease-in-out infinite alternate; }
.orb-2 { width: 46vmax; height: 46vmax; bottom: -16vmax; right: -10vmax; background: var(--orb-2); animation: floatB 28s ease-in-out infinite alternate; }
.orb-3 { width: 38vmax; height: 38vmax; top: 28%; right: 14%; background: var(--orb-3); animation: floatC 22s ease-in-out infinite alternate; }
.orb-4 { width: 34vmax; height: 34vmax; bottom: 18%; left: 18%; background: var(--orb-4); animation: floatA 30s ease-in-out infinite alternate-reverse; }

@keyframes floatA { 0% { transform: translate3d(0, 0, 0) scale(1); } 100% { transform: translate3d(6vw, 4vh, 0) scale(1.08); } }
@keyframes floatB { 0% { transform: translate3d(0, 0, 0) scale(1.04); } 100% { transform: translate3d(-5vw, -5vh, 0) scale(0.95); } }
@keyframes floatC { 0% { transform: translate3d(0, 0, 0) scale(0.96); } 100% { transform: translate3d(-4vw, 5vh, 0) scale(1.08); } }

/* ---------- Page Container ---------- */
.page-shell {
  position: relative;
  z-index: 1;
  max-width: 1260px;
  margin: 0 auto;
  padding: 18px 20px 44px;
}

/* ---------- Sticky Liquid Glass Header ---------- */
.top-nav {
  position: sticky;
  top: 12px;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  margin-bottom: 18px;
  border-radius: var(--radius-pill);
  background: var(--glass-surface);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat)) contrast(1.04);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat)) contrast(1.04);
  border: 1px solid var(--glass-border);
  box-shadow: var(--tile-shadow);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-strong), var(--accent-teal));
  color: #ffffff;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.28), inset 0 1px 1px rgba(255, 255, 255, 0.55);
}

.brand-meta {
  min-width: 0;
}

.brand-title {
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Filter Pills in Center */
.nav-filters {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-filters::-webkit-scrollbar {
  display: none;
}

.nav-filter-btn {
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  background: transparent;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.nav-filter-btn:hover {
  background: var(--glass-hover);
  color: var(--text-primary);
}

.nav-filter-btn.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

/* Right Controls (Lang + Theme + Print) */
.nav-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.ctrl-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--glass-border);
  background: var(--glass-subtle);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-primary);
  box-shadow: inset 0 1px 0 var(--glass-rim-top);
  transition: background 0.18s ease, transform 0.15s ease, border-color 0.18s ease;
}

.ctrl-btn:hover {
  background: var(--glass-hover);
  border-color: var(--glass-border-hover);
  transform: translateY(-1px);
}

.ctrl-btn:active {
  transform: scale(0.96);
}

.ctrl-btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

/* ==========================================================================
   ASYMMETRIC METRO TILE GRID (6 cols Desktop · 4 cols Tablet · 2 cols Mobile)
   ========================================================================== */
.metro-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-auto-rows: minmax(158px, auto);
  grid-auto-flow: dense;
  gap: var(--gap);
}

/* Tile Base with Liquid Glass Material */
.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px 22px;
  border-radius: var(--radius-tile);
  background: var(--glass-surface);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat)) contrast(1.04);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat)) contrast(1.04);
  border: 1px solid var(--glass-border);
  box-shadow: var(--tile-shadow);
  overflow: hidden;
  transition:
    transform 0.28s var(--ease-spring),
    box-shadow 0.28s ease,
    border-color 0.24s ease,
    opacity 0.25s ease;
}

/* Cursor-reactive specular highlight */
.tile::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(
    420px circle at var(--mx, 22%) var(--my, 8%),
    var(--glass-specular),
    transparent 62%
  );
  opacity: 0.68;
  transition: opacity 0.25s ease;
  z-index: 0;
}

/* Optical top Fresnel edge */
.tile::after {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  top: 0;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--glass-rim-top), transparent);
  z-index: 2;
}

.tile > * {
  position: relative;
  z-index: 1;
}

.tile:hover {
  border-color: var(--glass-border-hover);
  box-shadow: var(--tile-shadow-hover);
}

.tile.interactive {
  cursor: pointer;
}

.tile.interactive:active {
  transform: scale(0.985) !important;
}

.tile.dimmed {
  opacity: 0.24;
  transform: scale(0.985);
}

.tile.hidden-by-filter {
  display: none;
}

.tile {
  scroll-margin-top: 96px;
}

.tile.tile-reveal {
  animation: tileReveal 0.42s var(--ease-spring) both;
}

@keyframes tileReveal {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.tile.tile-spotlight {
  animation: tileSpotlight 1.1s var(--ease-spring);
}

@keyframes tileSpotlight {
  0% {
    box-shadow: var(--tile-shadow);
    border-color: var(--glass-border);
  }
  35% {
    box-shadow: 0 0 0 2px var(--accent), var(--tile-shadow-hover);
    border-color: var(--accent);
  }
  100% {
    box-shadow: var(--tile-shadow);
    border-color: var(--glass-border);
  }
}

.metro-grid[data-active-filter="projects"] .t-project {
  grid-column: 1 / -1;
}

/* Liquid Glass Metro Tints */
.tint-hero    { background: var(--tint-hero); }
.tint-cyan    { background: var(--tint-cyan); }
.tint-blue    { background: var(--tint-blue); }
.tint-teal    { background: var(--tint-teal); }
.tint-emerald { background: var(--tint-emerald); }
.tint-amber   { background: var(--tint-amber); }
.tint-slate   { background: var(--tint-slate); }

/* ---------- Explicit Asymmetric Tile Sizes (Desktop 6-Column Grid) ---------- */
.t-hero        { grid-column: span 4; grid-row: span 2; }
.t-live        { grid-column: span 2; grid-row: span 1; }
.t-edu         { grid-column: span 1; grid-row: span 1; }
.t-lang        { grid-column: span 1; grid-row: span 1; }

.t-exp-main    { grid-column: span 3; grid-row: span 2; }
.t-exp-sub     { grid-column: span 3; grid-row: span 1; }

.t-project     { grid-column: span 3; grid-row: span 2; }
.t-sk-lang     { grid-column: span 2; grid-row: span 1; }
.t-sk-docker   { grid-column: span 1; grid-row: span 1; }
.t-sk-ai       { grid-column: span 3; grid-row: span 1; }

.t-sk-fw       { grid-column: span 4; grid-row: span 1; }
.t-sk-comp     { grid-column: span 2; grid-row: span 1; }

.t-c-email     { grid-column: span 2; grid-row: span 1; }
.t-c-compact   { grid-column: span 1; grid-row: span 1; }

/* ---------- Tile Internal Typography & Components ---------- */
.tile-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 8px;
  margin-bottom: 12px;
}

.edu-date-pill {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: var(--glass-subtle);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 var(--glass-rim-top);
  color: var(--text-secondary);
  text-align: center;
}

.kicker-tag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--accent);
}

.kicker-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: var(--glass-subtle);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  white-space: nowrap;
}

.tile-icon-box {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--glass-subtle);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 var(--glass-rim-top);
  flex-shrink: 0;
}

.tile-icon-box svg {
  width: 18px;
  height: 18px;
  color: var(--accent);
}

/* Hero Tile */
.hero-name {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.3vw, 42px);
  font-weight: 300;
  letter-spacing: -0.025em;
  line-height: 1.08;
  margin-bottom: 10px;
}

.hero-role {
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 12px;
}

.hero-bio {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.62;
  max-width: 60ch;
  margin-bottom: 18px;
}

.hero-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--glass-border);
}

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

.glass-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: 11px;
  border: 1px solid var(--glass-border);
  background: var(--glass-subtle);
  color: var(--text-primary);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: inset 0 1px 0 var(--glass-rim-top);
  transition: background 0.18s ease, transform 0.15s ease, border-color 0.18s ease;
}

.glass-btn:hover {
  background: var(--glass-hover);
  border-color: var(--glass-border-hover);
  transform: translateY(-1px);
}

.glass-btn.primary {
  background: linear-gradient(135deg, var(--accent-strong), var(--accent-teal));
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.35);
}

.glass-btn.primary:hover {
  filter: brightness(1.08);
}

.glass-btn svg {
  width: 15px;
  height: 15px;
}

.hero-loc {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Live Cycling Tile */
.live-stat {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 5px;
}

.live-copy {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.live-dots {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
}

.live-dot {
  width: 18px;
  height: 4px;
  border-radius: 99px;
  border: none;
  background: var(--glass-hover);
  cursor: pointer;
  transition: background 0.2s ease, width 0.25s var(--ease-spring);
}

.live-dot.active {
  width: 30px;
  background: var(--accent);
}

/* Compact 1x1 Education & Languages Tiles */
.compact-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 4px;
}

.compact-sub {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.lang-mini-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
}

.lang-mini-head {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
}

.lang-mini-level {
  color: var(--text-muted);
  font-weight: 500;
}

.lang-track {
  height: 5px;
  border-radius: 99px;
  background: var(--glass-hover);
  overflow: hidden;
}

.lang-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent-strong), var(--accent-teal));
}

/* Experience Tiles */
.tile-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.2;
  margin-bottom: 4px;
}

.tile-org {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.tile-org span {
  font-weight: 400;
  color: var(--text-muted);
}

.bullet-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 14px;
}

.bullet-list li {
  position: relative;
  padding-left: 14px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.48;
}

.bullet-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 5px;
  height: 5px;
  border-radius: 2px;
  background: var(--accent);
}

.tile-footer-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  font-size: 11.5px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-chip);
  background: var(--glass-subtle);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 var(--glass-rim-top);
  color: var(--text-primary);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.chip:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
}

.expand-hint {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

/* Project Architecture Flow */
.arch-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 6px 0 14px;
}

.arch-box {
  padding: 9px 6px;
  border-radius: 10px;
  background: var(--glass-subtle);
  border: 1px solid var(--glass-border);
  text-align: center;
  box-shadow: inset 0 1px 0 var(--glass-rim-top);
}

.arch-step {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}

.arch-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  margin-top: 1px;
}

.arch-desc {
  font-size: 10.5px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Contact Tiles */
.contact-tile-inner {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  gap: 10px;
}

.contact-val {
  font-size: 14px;
  font-weight: 600;
  word-break: break-word;
  line-height: 1.3;
}

.contact-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 3px;
}

/* ---------- Detail Modal (Liquid Glass Overlay) ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: var(--modal-backdrop);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: grid;
  place-items: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.26s ease, visibility 0.26s ease;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal-card {
  position: relative;
  width: min(680px, 100%);
  max-height: 86vh;
  overflow-y: auto;
  padding: 26px 28px;
  border-radius: 22px;
  background: var(--glass-surface-strong);
  backdrop-filter: blur(34px) saturate(195%);
  -webkit-backdrop-filter: blur(34px) saturate(195%);
  border: 1px solid var(--glass-border-hover);
  box-shadow: var(--tile-shadow-hover);
  transform: translateY(16px) scale(0.96);
  transition: transform 0.3s var(--ease-spring);
}

.modal-overlay.open .modal-card {
  transform: translateY(0) scale(1);
}

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

.modal-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--glass-subtle);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.16s ease, transform 0.15s ease;
}

.modal-close:hover {
  background: var(--glass-hover);
  transform: scale(1.06);
}

.modal-close svg {
  width: 14px;
  height: 14px;
}

/* ---------- Footer ---------- */
.page-footer {
  margin-top: 22px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

/* ---------- Toast Notification ---------- */
.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 200;
  padding: 11px 18px;
  border-radius: 14px;
  background: var(--glass-surface-strong);
  backdrop-filter: blur(26px) saturate(190%);
  -webkit-backdrop-filter: blur(26px) saturate(190%);
  border: 1px solid var(--glass-border-hover);
  box-shadow: var(--tile-shadow);
  font-size: 12.5px;
  font-weight: 600;
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.28s var(--ease-spring);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS (Zero Orphan Gaps Across Tablet & Mobile)
   ========================================================================== */

/* Tablet: 4-Column Asymmetric Metro Grid */
@media (max-width: 1099px) {
  .metro-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: minmax(150px, auto);
  }

  .t-hero        { grid-column: span 4; grid-row: span 1; }
  .t-live        { grid-column: span 2; grid-row: span 1; }
  .t-edu         { grid-column: span 1; grid-row: span 1; }
  .t-lang        { grid-column: span 1; grid-row: span 1; }

  .t-exp-main    { grid-column: span 4; grid-row: span 1; }
  .t-exp-sub     { grid-column: span 2; grid-row: span 1; }

  .t-project     { grid-column: span 4; grid-row: span 1; }
  .t-sk-lang     { grid-column: span 2; grid-row: span 1; }
  .t-sk-docker   { grid-column: span 2; grid-row: span 1; }
  .t-sk-ai       { grid-column: span 2; grid-row: span 1; }
  .t-sk-comp     { grid-column: span 2; grid-row: span 1; }
  .t-sk-fw       { grid-column: span 4; grid-row: span 1; }

  .t-c-email     { grid-column: span 2; grid-row: span 1; }
  .t-c-phone     { grid-column: span 1; grid-row: span 1; }
  .t-c-web       { grid-column: span 1; grid-row: span 1; }
  .t-c-github    { grid-column: span 2; grid-row: span 1; }
  .t-c-linkedin  { grid-column: span 2; grid-row: span 1; }
}

/* Compact Header Wrap on Medium Screens */
@media (max-width: 860px) {
  .top-nav {
    border-radius: 20px;
    flex-wrap: wrap;
    padding: 10px 12px;
  }

  .nav-filters {
    order: 3;
    width: 100%;
    padding-top: 6px;
    border-top: 1px solid var(--glass-border);
  }
}

/* Mobile: 2-Column Metro Tiling (Preserves Wide 2x1 & Compact 1x1 Rhythm!) */
@media (max-width: 699px) {
  .page-shell {
    padding: 12px 12px 32px;
  }

  .metro-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: auto;
    gap: 11px;
  }

  .tile {
    padding: 17px 16px;
    border-radius: 16px;
  }

  .t-hero,
  .t-live,
  .t-exp-main,
  .t-exp-sub,
  .t-project,
  .t-sk-lang,
  .t-sk-ai,
  .t-sk-fw,
  .t-sk-comp,
  .t-c-email {
    grid-column: span 2;
    grid-row: span 1;
  }

  .t-edu,
  .t-lang,
  .t-sk-docker {
    grid-column: span 1;
    grid-row: span 1;
  }

  /* Keep Docker full-width on 2-col so there is never an orphan cell */
  .t-sk-docker {
    grid-column: span 2;
  }

  .t-c-phone,
  .t-c-web,
  .t-c-github,
  .t-c-linkedin {
    grid-column: span 1;
    grid-row: span 1;
  }

  .arch-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .brand-sub {
    display: none;
  }

  .ctrl-btn .btn-text-hide-xs {
    display: none;
  }

  .modal-card {
    padding: 20px 18px;
  }
}

/* Ultra-narrow Mobile (<= 400px): Give Edu & Lang comfortable width */
@media (max-width: 400px) {
  .t-edu,
  .t-lang {
    grid-column: span 2;
  }
}

/* ---------- Print / PDF Styles ---------- */
@media print {
  body {
    background: #ffffff;
    color: #0f172a;
  }
  .liquid-bg, .top-nav, .modal-overlay, .toast, .expand-hint, .hero-actions {
    display: none !important;
  }
  .page-shell {
    max-width: 100%;
    padding: 0;
  }
  .metro-grid {
    display: block;
  }
  .tile {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: none !important;
    margin-bottom: 12px;
    break-inside: avoid;
    opacity: 1 !important;
  }
  .tile.hidden-by-filter {
    display: flex !important;
  }
}
