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

::-webkit-scrollbar {
  width: 8px;
  background: transparent;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.12);
  border-radius: 9999px;
  border: 2px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.22);
  background-clip: content-box;
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.12) transparent;
}

:root {
  --bg-deep: #080404;
  --bg-base: #0c0707;
  --bg-elevated: #0000003d;
  --surface: rgba(255,255,255,0.04);
  --surface-hover: rgba(255,255,255,0.06);
  --foreground: #E9EBF0;
  --foreground-muted: #9aa0b2;
  --foreground-subtle: rgba(255,255,255,0.55);
  --accent: #ecebe7;
  --accent-bright: #ecebe7;
  --accent-glow: rgba(236,235,231,0.14);
  --border-default: rgba(255,255,255,0.04);
  --border-hover: rgba(255,255,255,0.08);
  --border-accent: rgba(236,235,231,0.20);
  --ink: 18, 10, 10; /* accent hue, sat=0, very dark */
}

html {
  scroll-behavior: auto;
}

body {
  font-family: system-ui, sans-serif;
  background-color: var(--bg-base);
  color: var(--foreground);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Background System */
.bg-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.bg-radial {
  background: radial-gradient(ellipse 60% 40% at 50% 60%, rgba(236,235,231,0.06) 0%, transparent 70%), var(--bg-base);
}

.bg-noise {
  opacity: 0.008;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

.bg-grid {
  background-image: 
    linear-gradient(rgba(255,255,255,0.01) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.01) 1px, transparent 1px);
  background-size: 64px 64px;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  animation: float 10s ease-in-out infinite;
}

.blob-1 {
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  width: 520px;
  height: 520px;
  background: var(--accent);
  opacity: 0.07;
  animation-delay: 0s;
}

.blob-2 {
  top: 25%;
  left: 5%;
  width: 320px;
  height: 320px;
  background: linear-gradient(135deg, #c43a3a, #ecebe7);
  opacity: 0.05;
  animation-delay: -3s;
}

.blob-3 {
  top: 30%;
  right: 5%;
  width: 280px;
  height: 280px;
  background: linear-gradient(135deg, #b52525, #ecebe7);
  opacity: 0.04;
  animation-delay: -5s;
}

.blob-4 {
  bottom: 15%;
  left: 35%;
  width: 240px;
  height: 240px;
  background: var(--accent);
  opacity: 0.04;
  animation: pulse 4s ease-in-out infinite;
  animation-delay: -2s;
}

@keyframes float {
  0%, 100% { transform: translateX(-50%) translateY(0) rotate(0deg); }
  50% { transform: translateX(-50%) translateY(-20px) rotate(1deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 0.1; transform: scale(1); }
  50% { opacity: 0.15; transform: scale(1.05); }
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* Navigation */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10,10,10,0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgb(31,31,31);
  opacity: 0;
  animation: navFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.1s forwards;
}

@keyframes navFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 58px;
  padding: 0 32px;
  max-width: 1280px;
  margin: 0 auto;
}

.logo {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--foreground);
  text-decoration: none;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
  align-items: center;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.nav-links a {
  font-family: 'JetBrains Mono', monospace;
  color: rgb(160,160,156);
  text-decoration: none;
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: color 0.18s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--foreground);
}

/* Dropdown */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
  color: rgb(160,160,156);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0;
  transition: color 0.18s ease;
}

.nav-dropdown-trigger:hover,
.nav-dropdown[data-open] .nav-dropdown-trigger,
.nav-dropdown:has(a.active) .nav-dropdown-trigger {
  color: var(--foreground);
}

.nav-dropdown-chevron {
  transition: transform 0.18s ease;
  flex-shrink: 0;
}

.nav-dropdown[data-open] .nav-dropdown-chevron {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  min-width: 140px;
  background: rgba(14,14,14,0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  padding: 18px 6px 6px; /* 12px invisible bridge + 6px visual padding */
  list-style: none;
  z-index: 200;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.nav-dropdown[data-open] .nav-dropdown-menu {
  display: block;
  animation: dropdownIn 0.16s cubic-bezier(0.16,1,0.3,1) forwards;
}

@keyframes dropdownIn {
  from { opacity: 0; transform: translateX(-50%) translateY(6px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.nav-dropdown-menu a {
  display: block;
  padding: 8px 12px;
  border-radius: 6px;
  white-space: nowrap;
  font-size: 0.68rem;
}

.nav-dropdown-menu a:hover,
.nav-dropdown-menu a.active {
  background: rgba(255,255,255,0.05);
  color: var(--foreground);
}

/* Mobile menu group */
.mobile-menu-group {
  border-bottom: 1px solid rgb(31,31,31);
}

.mobile-menu-group-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
  color: rgb(160,160,156);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 14px 0;
  transition: color 0.18s ease;
}

.mobile-menu-group-trigger iconify-icon {
  transition: transform 0.18s ease;
  margin-left: auto;
}

.mobile-menu-group.open .mobile-menu-group-trigger {
  color: var(--foreground);
}

.mobile-menu-group.open .mobile-menu-group-trigger iconify-icon {
  transform: rotate(180deg);
}

.mobile-menu-group-items {
  display: none;
  padding: 0 0 4px 12px;
}

.mobile-menu-group.open .mobile-menu-group-items {
  display: block;
}

.mobile-menu-group-items a {
  border-bottom: none;
  padding: 10px 0;
  font-size: 0.68rem;
}

.mobile-menu-group-items a:last-child {
  border-bottom: none;
}

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

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 24px;
  background: rgb(26,26,26);
  border: 1px solid rgb(45,45,45);
  color: var(--foreground);
  text-decoration: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.nav-cta:hover {
  background: rgb(36,36,36);
  border-color: rgb(60,60,60);
}

/* Mobile Menu */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--foreground);
  cursor: pointer;
  padding: 6px;
}

.mobile-menu {
  display: none;
  position: fixed;
  top: 58px;
  left: 0;
  right: 0;
  background: rgba(10,10,10,0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgb(31,31,31);
  padding: 8px 32px 16px;
  flex-direction: column;
  gap: 0;
  z-index: 99;
}

.mobile-menu.active {
  display: flex;
}

.mobile-menu a {
  font-family: 'JetBrains Mono', monospace;
  color: rgb(160,160,156);
  text-decoration: none;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 14px 0;
  border-bottom: 1px solid rgb(31,31,31);
  transition: color 0.18s ease;
}

.mobile-menu a:last-child {
  border-bottom: none;
}

.mobile-menu a:hover {
  color: var(--foreground);
}

@media (max-width: 768px) {
  .nav-inner { padding: 0 20px; }
  .nav-links {
    display: none;
  }
  .nav-cta { display: none; }
  .menu-toggle {
    display: block;
  }
}

/* Hero */
.hero .container {
  margin-left: 0;
  /* Scale padding with viewport so the tagline keeps clear of the 3D
     girl model regardless of resolution. ~80px on small laptops, ~320px
     on 1920+, clamped both ends so it never collapses or overshoots. */
  padding-left: clamp(80px, 18vw, 340px);
}

@media (max-width: 1024px) {
  .hero .container {
    /* Mid-range: text gets a touch more room as the model shrinks too */
    padding-left: clamp(48px, 10vw, 120px);
  }
}

@media (max-width: 768px) {
  .hero .container {
    padding-left: 24px;
  }
}

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 88px 0 80px;
}

.hero-content {
  max-width: 720px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--surface);
  border: 1px solid var(--border-default);
  border-radius: 9999px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--foreground-muted);
  margin-bottom: 24px;
}

.tag::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: blink 2s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

h1 {
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 24px;
}

.gradient-text {
  background: linear-gradient(to bottom, #fff, rgba(255,255,255,0.95), rgba(255,255,255,0.7));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.accent-text {
  background: linear-gradient(to right, var(--accent), #ecebe7, var(--accent));
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.hero-description {
  font-size: 1.125rem;
  color: var(--foreground-muted);
  max-width: 540px;
  margin-bottom: 40px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  font-size: 0.9375rem;
  font-weight: 500;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 
    0 0 0 1px rgba(236,235,231,0.5),
    0 4px 12px rgba(236,235,231,0.3),
    inset 0 1px 0 0 rgba(255,255,255,0.2);
}

.btn-primary:hover {
  background: var(--accent-bright);
  transform: translateY(-2px);
  box-shadow: 
    0 0 0 1px rgba(236,235,231,0.6),
    0 8px 24px rgba(236,235,231,0.4),
    inset 0 1px 0 0 rgba(255,255,255,0.25);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  background: var(--surface);
  color: var(--foreground);
  border: 1px solid var(--border-default);
}

.btn-secondary:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--foreground-muted);
}

.btn-ghost:hover {
  background: var(--surface);
  color: var(--foreground);
}

.btn-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Cards */
.card {
  background: linear-gradient(to bottom, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
  border: 1px solid var(--border-default);
  border-radius: 16px;
  padding: 24px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--accent-glow), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card:hover {
  background: linear-gradient(to bottom, rgba(255,255,255,0.10), rgba(255,255,255,0.04));
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: 
    0 0 0 1px rgba(255,255,255,0.1),
    0 8px 40px rgba(0,0,0,0.5),
    0 0 80px rgba(236,235,231,0.1);
}

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

.card-glass {
  background: rgba(255,255,255,0.03);
  backdrop-filter: blur(10px);
}

/* Sections */
section {
  padding: 100px 0;
  position: relative;
}

.section-header {
  margin-bottom: 48px;
}

.section-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--foreground-muted);
  margin-bottom: 12px;
}

h2 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.section-description {
  color: var(--foreground-muted);
  max-width: 540px;
  font-size: 1.0625rem;
}

/* Bento Grid */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}

@media (max-width: 1024px) {
  .bento-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

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

.bento-card {
  grid-column: span 2;
  min-height: 180px;
}

.bento-card.hero-card {
  grid-column: span 4;
  grid-row: span 2;
  min-height: 376px;
}

@media (max-width: 1024px) {
  .bento-card.hero-card {
    grid-column: span 3;
  }
}

@media (max-width: 768px) {
  .bento-card, .bento-card.hero-card {
    grid-column: span 1;
  }
}

/* Spotlight Effect */
.spotlight {
  position: relative;
}

.spotlight::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--x, 50%) var(--y, 50%), var(--accent-glow) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  border-radius: inherit;
}

.spotlight:hover::after {
  opacity: 1;
}

/* Skills Grid */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.skill-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  transition: all 0.2s ease;
}

.skill-item:hover {
  border-color: var(--border-hover);
  background: var(--surface-hover);
}

.skill-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(236,235,231,0.15);
  border: 1px solid var(--border-accent);
  border-radius: 10px;
  font-size: 1.25rem;
}

.skill-name {
  font-weight: 500;
}

/* Links */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: gap 0.2s ease;
}

.link-arrow:hover {
  gap: 10px;
}

/* Projects */
.project-card {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 24px;
  border-radius: 24px;
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(255,255,255,0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  overflow: hidden;
}

.project-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.12);
  border-color: rgba(236,235,231,0.18);
}

/* Cover layout */
.project-card--cover {
  padding: 0;
  aspect-ratio: 3/4;
  min-height: 280px;
}

.project-card-bg {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
}

.project-card-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  filter: blur(2px) brightness(0.5);
  transform: scale(1.02);
  transition: transform 0.4s ease, opacity 0.5s ease;
  display: block;
}

.project-card--contain .project-card-bg img {
  object-fit: contain;
  padding: 16px;
}

.project-card--cover:hover .project-card-bg img {
  transform: scale(1.08);
}

.project-card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 28px 24px 24px;
  background: linear-gradient(to top, rgba(var(--ink),0.92) 0%, rgba(var(--ink),0.55) 55%, transparent 100%);
  border-radius: 0 0 24px 24px;
}

.project-card--cover .project-title {
  margin-bottom: 6px;
}

.project-card--cover .project-description {
  font-size: 0.875rem;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-image {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--bg-elevated);
  border-radius: 18px;
  margin-bottom: 20px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-default);
  padding: 12px;
  position: relative;
}

.tools-section .project-image {
  background: var(--bg-elevated);
}

.project-image--full {
  padding: 0;
}

.project-image--full img {
  object-fit: cover;
  border-radius: 18px;
}

.project-detail-logo--full {
  padding: 0;
  overflow: hidden;
}

.project-detail-logo--full img {
  object-fit: cover;
  width: 100%;
  height: 100%;
  border-radius: 24px;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.5s ease;
}

.project-image iconify-icon {
  width: 36px;
  height: 36px;
}

.skill-icon iconify-icon,
.link-arrow iconify-icon,
.btn iconify-icon,
.social-links a iconify-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.social-links a iconify-icon {
  margin-right: 8px;
}

.project-card:hover .project-image img {
  transform: scale(1.05);
}

.project-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.project-description {
  color: var(--foreground-muted);
  font-size: 0.9375rem;
  margin-bottom: 12px;
}

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

.tag-badge {
  padding: 4px 10px;
  background: rgba(236,235,231,0.1);
  border: 1px solid var(--border-accent);
  border-radius: 9999px;
  font-size: 0.75rem;
  color: var(--foreground-subtle);
}

.glass-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(18px);
  border-radius: 24px;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
  transform: translateY(-5px);
  border-color: rgba(236,235,231,0.22);
  box-shadow: 0 24px 48px rgba(236,235,231,0.08);
}

.project-card {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(255,255,255,4);
  border: 1px solid rgba(255,255,255,0.06);
  transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
}

.project-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(236,235,231,0.04), transparent 35%, rgba(236,235,231,0.04));
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

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

.project-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 28px 52px rgba(236,235,231,0.08);
  border-color: rgba(236,235,231,0.18);
}

.tag-badge {
  padding: 4px 10px;
  background: rgba(236,235,231,0.1);
  border: 1px solid var(--border-accent);
  border-radius: 9999px;
  font-size: 0.75rem;
  color: var(--foreground-subtle);
  transition: transform 0.3s ease, background 0.3s ease, border-color 0.3s ease;
}

.tag-badge:hover {
  transform: translateY(-1px);
  background: rgba(236,235,231,0.15);
  border-color: rgba(236,235,231,0.25);
}

/* Floating tech icons — hero bento card */
.floating-icons {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.fi {
  position: absolute;
  opacity: 0.22;
  filter: saturate(0.7);
  transition: opacity 0.3s ease;
}

.bento-card:hover .fi { opacity: 0.38; }

@keyframes fiFloat {
  0%,100% { transform: translateY(0px) rotate(0deg); }
  50%      { transform: translateY(-10px) rotate(4deg); }
}
@keyframes fiFloatB {
  0%,100% { transform: translateY(0px) rotate(0deg); }
  40%     { transform: translateY(-14px) rotate(-5deg); }
  80%     { transform: translateY(-6px) rotate(3deg); }
}
@keyframes fiFloatC {
  0%,100% { transform: translateY(0px) rotate(0deg); }
  33%     { transform: translateY(-8px) rotate(-3deg); }
  66%     { transform: translateY(-12px) rotate(5deg); }
}

.fi-1  { top: 12%; left:  4%; animation: fiFloat  5.2s ease-in-out infinite 0.0s; }
.fi-2  { top: 40%; left: 12%; animation: fiFloatB 6.1s ease-in-out infinite 0.7s; }
.fi-3  { top:  8%; left: 24%; animation: fiFloatC 5.8s ease-in-out infinite 1.1s; }
.fi-4  { top: 52%; left: 33%; animation: fiFloat  6.5s ease-in-out infinite 0.4s; }
.fi-5  { top: 14%; left: 45%; animation: fiFloatB 5.5s ease-in-out infinite 1.5s; }
.fi-6  { top: 42%; left: 54%; animation: fiFloatC 6.8s ease-in-out infinite 0.9s; }
.fi-7  { top:  6%; left: 64%; animation: fiFloat  5.0s ease-in-out infinite 0.3s; }
.fi-8  { top: 48%; left: 73%; animation: fiFloatB 6.3s ease-in-out infinite 1.8s; }
.fi-9  { top: 18%; left: 80%; animation: fiFloatC 5.7s ease-in-out infinite 0.6s; }
.fi-10 { top: 60%; left: 88%; animation: fiFloat  6.0s ease-in-out infinite 1.3s; }
.fi-11 { top: 28%; left: 92%; animation: fiFloatB 5.4s ease-in-out infinite 2.1s; }
.fi-12 { top: 70%; left: 20%; animation: fiFloatC 6.6s ease-in-out infinite 0.2s; }

/* Bento card decorative bg icon */
.bento-bg-icon {
  position: absolute;
  bottom: -14px;
  right: -14px;
  opacity: 0.05;
  pointer-events: none;
  color: var(--foreground);
  z-index: 0;
}

.bento-card-content {
  position: relative;
  z-index: 1;
}

/* Code snippet card */
.code-card {
  padding: 0;
  overflow: hidden;
  min-height: 180px;
  display: flex;
  flex-direction: column;
}

.code-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  background: rgba(255,255,255,0.02);
  flex-shrink: 0;
}

.code-dots {
  display: flex;
  gap: 6px;
}

.code-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  opacity: 0.8;
}

.code-filename {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  color: var(--foreground-muted);
  letter-spacing: 0.04em;
}

.code-body {
  padding: 16px 18px;
  margin: 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  line-height: 1.75;
  overflow: hidden;
  flex: 1;
  white-space: pre;
}

.code-body code { font-family: inherit; }

/* Syntax colours */
.ct { color: #4b5563; }               /* comment */
.ca { color: var(--foreground-muted); } /* attribute wrapper */
.ck { color: var(--accent-bright); }   /* keyword */
.ctype { color: #7dd3fc; }             /* type */
.cs { color: #86efac; }               /* string */
.cf { color: #fde68a; }               /* function name */
.cv { color: var(--foreground); }      /* variable */
.cn { color: var(--foreground-muted); } /* punctuation */

/* Stats strip */
.about-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 20px;
  margin-bottom: 8px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 20px 12px;
  background: var(--surface);
  border: 1px solid var(--border-default);
  border-radius: 16px;
  text-align: center;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.stat-item:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
}

.stat-value {
  font-family: 'Syne', sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  background: linear-gradient(to bottom, #fff, rgba(255,255,255,0.7));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.stat-label {
  font-size: 0.72rem;
  color: var(--foreground-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: 'JetBrains Mono', monospace;
}

@media (max-width: 768px) {
  .about-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

.about-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.highlight-pill {
  padding: 8px 12px;
  border-radius: 9999px;
  border: 1px solid rgba(236,235,231,0.18);
  background: rgba(236,235,231,0.08);
  color: var(--foreground-subtle);
  font-size: 0.78rem;
}

.timeline {
  display: grid;
  gap: 24px;
  margin-top: 24px;
}

.timeline-item {
  padding: 24px;
  border-radius: 24px;
  position: relative;
  overflow: hidden;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, rgba(236,235,231,0.9), rgba(236,235,231,0.2));
  border-radius: 9999px;
}

.timeline-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.timeline-subtitle {
  color: var(--accent);
  margin-top: 4px;
  font-size: 0.95rem;
}

.timeline-badge {
  background: rgba(236,235,231,0.12);
  color: var(--accent);
  border-radius: 9999px;
  padding: 8px 14px;
  font-size: 0.8rem;
  white-space: nowrap;
}

.timeline-list {
  margin-top: 18px;
  padding-left: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.timeline-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: var(--foreground-muted);
  font-size: 0.94rem;
}

.timeline-list li::before {
  content: '';
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  margin-top: 0.5rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(236,235,231,0.2);
}

.section-enter {
  opacity: 0;
  transform: translateY(30px);
}

.section-enter.is-visible {
  animation: sectionEnter 0.8s ease-out forwards;
}

@keyframes sectionEnter {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Showcase Section ────────────────────────────────────── */
.showcase-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

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

.showcase-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  border-radius: 18px;
  height: 420px;
  overflow: hidden;
}

.showcase-grid .showcase-card:nth-child(1) { animation-delay: 0.05s; }
.showcase-grid .showcase-card:nth-child(2) { animation-delay: 0.15s; }
.showcase-grid .showcase-card:nth-child(3) { animation-delay: 0.25s; }

.showcase-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--accent-bright);
  text-transform: uppercase;
}

.showcase-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}

.showcase-caption {
  font-size: 0.72rem;
  color: var(--foreground-subtle);
  font-family: 'JetBrains Mono', monospace;
}

.showcase-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-bright);
  text-decoration: none;
  padding: 6px 12px;
  border: 1px solid rgba(236,235,231,0.25);
  border-radius: 8px;
  background: rgba(236,235,231,0.07);
  transition: background 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
  align-self: flex-start;
}

.showcase-btn:hover {
  background: rgba(236,235,231,0.14);
  border-color: rgba(236,235,231,0.4);
}

/* QSM two-phase animation */
.qsm-anim {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.qsm-phase-code,
.qsm-phase-circuit {
  transition: opacity 0.35s ease;
}

.qsm-phase-code {
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255,255,255,0.02);
}

.qsm-typing {
  flex: 1;
  min-height: 120px;
  padding: 12px 16px;
  font-size: 0.65rem;
  line-height: 1.7;
  color: var(--foreground);
  white-space: pre;
  overflow: hidden;
}

.qsm-typing::after {
  content: '▊';
  color: var(--accent-bright);
  animation: qsmBlink 0.7s step-end infinite;
}

.qsm-typing.qsm-done::after { display: none; }

@keyframes qsmBlink { 50% { opacity: 0; } }

.qsm-status {
  padding: 6px 16px 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.63rem;
  min-height: 28px;
  color: transparent;
  transition: color 0.3s ease;
}

.qsm-status.qsm-compiling { color: var(--foreground-muted); }
.qsm-status.qsm-compiled  { color: #86efac; }

/* Circuit sketch animation */
.qc-wire {
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 0.35s ease;
}

.qc-wire.qc-drawn { transform: scaleX(1); }

.qc-gate,
.qc-ctrl,
.qc-meas {
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.qc-gate.qc-drawn,
.qc-ctrl.qc-drawn,
.qc-meas.qc-drawn {
  opacity: 1;
  transform: scale(1);
}

/* QSM quantum circuit */
.qsm-circuit {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 8px 0;
}

.qsm-row {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
}

.qsm-qubit {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  color: var(--foreground-muted);
  width: 20px;
  text-align: right;
  flex-shrink: 0;
}

.qsm-wire {
  flex: 1;
  display: flex;
  align-items: center;
  position: relative;
}

.qsm-line {
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.18);
}

.qsm-line.qsm-long {
  flex: 2;
}

.qsm-gate {
  width: 28px;
  height: 24px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  font-weight: 700;
  flex-shrink: 0;
  border: 1px solid;
}

.qsm-h  { background: rgba(236,235,231,0.15); border-color: var(--accent-bright); color: var(--accent-bright); }
.qsm-x  { background: rgba(134,239,172,0.12); border-color: #86efac; color: #86efac; }
.qsm-z  { background: rgba(125,211,252,0.12); border-color: #7dd3fc; color: #7dd3fc; }
.qsm-t  { background: rgba(253,230,138,0.12); border-color: #fde68a; color: #fde68a; }

.qsm-ctrl {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-bright);
  flex-shrink: 0;
}

.qsm-measure {
  width: 28px;
  height: 24px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  color: var(--foreground-muted);
  flex-shrink: 0;
}

/* IYAI typing indicator */
.iyai-typing-indicator {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  align-self: flex-start;
}

.iyai-typing-indicator span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--foreground-muted);
  animation: iyaiDot 1.1s ease-in-out infinite;
}

.iyai-typing-indicator span:nth-child(2) { animation-delay: 0.18s; }
.iyai-typing-indicator span:nth-child(3) { animation-delay: 0.36s; }

@keyframes iyaiDot {
  0%, 60%, 100% { transform: translateY(0);    opacity: 0.35; }
  30%            { transform: translateY(-5px); opacity: 1; }
}

/* Chessist pulsing best-move square */
@keyframes bestSqPulse {
  0%, 100% { background: rgba(134,239,172,0.35); }
  50%      { background: rgba(134,239,172,0.65); }
}

.best-sq-pulse {
  animation: bestSqPulse 0.9s ease-in-out infinite !important;
}

/* IYAI chat mockup */
.iyai-chat {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 300px;
  overflow: hidden;
}

.iyai-msg {
  max-width: 85%;
  border-radius: 10px;
  padding: 8px 11px;
  font-size: 0.75rem;
  line-height: 1.4;
}

.iyai-user {
  background: rgba(236,235,231,0.15);
  border: 1px solid rgba(236,235,231,0.25);
  color: var(--foreground);
  align-self: flex-end;
}

.iyai-ai {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.iyai-tag {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.62rem;
  color: var(--accent-bright);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.iyai-tool {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.62rem;
  color: var(--foreground-muted);
  font-family: 'JetBrains Mono', monospace;
  padding: 3px 0 1px;
}

.iyai-tool-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  flex-shrink: 0;
}

.iyai-response {
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--foreground);
  margin: 0;
}

/* Chessist eval UI */
.chess-ui {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.chess-eval-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.chess-eval-bar {
  width: 16px;
  height: 160px;
  background: #1e1f26;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.chess-eval-fill {
  background: #f0ede0;
  width: 100%;
  border-radius: 0 0 6px 6px;
  transition: height 0.6s ease;
}

.chess-eval-labels {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.chess-eval-score {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  font-weight: 700;
  color: #86efac;
}

.chess-eval-engine {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.55rem;
  color: var(--foreground-muted);
  white-space: nowrap;
}

.chess-board-mini {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
}

.chess-row {
  display: flex;
}

.chess-row span {
  flex: 1;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  line-height: 1;
}

.cs-dark  { background: #3d4054; }
.cs-light { background: #5a6075; }

.cp { color: #f0ede0; user-select: none; }

.best-sq {
  background: rgba(134,239,172,0.35) !important;
  color: #f0ede0;
}

.chess-arrow-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
  z-index: 5;
}

/* Contact */
.contact-cta {
  text-align: center;
  padding: 80px 40px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  border: 1px solid var(--border-default);
  border-radius: 24px;
  position: relative;
  overflow: hidden;
}

.contact-cta::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--accent), transparent);
}

/* Footer */
footer {
  padding: 40px 0;
  border-top: 1px solid var(--border-default);
  opacity: 0;
  transition: opacity 0.3s ease;
}
body.page-ready footer { opacity: 1; }

footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-text {
  color: var(--foreground-muted);
  font-size: 0.875rem;
}

.social-links {
  display: flex;
  gap: 16px;
}

.social-links a {
  color: var(--foreground-muted);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.2s ease;
}

.social-links a:hover {
  color: var(--foreground);
}

/* Image skeleton shimmer */
@keyframes skeletonShimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.project-image::after,
.project-detail-logo::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,0.06) 50%,
    transparent 100%
  );
  animation: skeletonShimmer 1.6s ease-in-out infinite;
  pointer-events: none;
  border-radius: inherit;
  z-index: 2;
  transition: opacity 0.4s ease;
}

.project-image.img-loaded::after,
.project-detail-logo.img-loaded::after {
  opacity: 0;
  animation: none;
}

/* Animations */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }

/* Responsive */
@media (max-width: 768px) {
  section {
    padding: 60px 0;
  }

  .hero {
    padding: 100px 0 60px;
  }

  .btn-group {
    flex-direction: column;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  #scene-canvas,
  #scene-debug {
    display: none;
  }
}

/* Design embed iframe */
.design-embed-wrap {
  position: relative;
  margin-top: 32px;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border-default);
  height: 80vh;
  background: rgb(var(--ink));
}

.design-embed-spinner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-base);
  z-index: 1;
}

.design-embed-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* Achievements */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.achievement-card {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 24px;
}

.achievement-icon {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-default);
  border-radius: 14px;
}

.achievement-body {
  flex: 1;
}

.achievement-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.achievement-award {
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.achievement-award.gold {
  background: rgba(245,158,11,0.12);
  color: #f59e0b;
  border: 1px solid rgba(245,158,11,0.25);
}

.achievement-award.bronze {
  background: rgba(205,127,50,0.12);
  color: #cd7f32;
  border: 1px solid rgba(205,127,50,0.25);
}

.achievement-body h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.achievement-subtitle {
  color: var(--foreground-muted);
  font-size: 0.875rem;
  line-height: 1.5;
}

.certifications-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 8px;
}

.cert-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  font-size: 0.875rem;
  color: var(--foreground-muted);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.cert-item:hover {
  border-color: var(--border-hover);
  background: var(--surface-hover);
}

/* Focus states */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Placeholder image style */
.placeholder-img {
  background: linear-gradient(135deg, var(--bg-elevated), var(--bg-base));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--foreground-muted);
  font-size: 0.875rem;
}

/* Menu icon animation */
.menu-toggle iconify-icon {
  display: inline-flex;
  transition: opacity 0.2s ease;
}

.menu-toggle .menu-close-icon {
  display: none;
}

.menu-toggle.active .menu-open-icon {
  display: none;
}

.menu-toggle.active .menu-close-icon {
  display: inline-flex;
}

/* ── SPA Page Transitions ──────────────────────────────────── */

#app {
  min-height: calc(100vh - 80px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

#app.page-exit {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
}

#app.page-enter {
  opacity: 0;
  transform: translateY(-6px);
}

.page-hero {
  padding-top: 88px;
  padding-bottom: 80px;
}

/* ── IYAI Bridge Page ────────────────────────────────────── */
.iyai-bridge-page {
  padding: 58px 0 0; /* override generic section { padding: 100px 0 } */
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.iyai-bridge-wrap {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 58px);
  overflow: hidden;
}

/* Top bar */
.ib-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: var(--bg-elevated);
  backdrop-filter: blur(12px);
  gap: 16px;
  flex-shrink: 0;
}

.ib-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--foreground);
  white-space: nowrap;
}

.ib-conn-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  justify-content: flex-end;
}

.ib-port-input {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  color: var(--foreground-muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  padding: 6px 12px;
  width: 200px;
  outline: none;
  transition: border-color 0.2s;
}
.ib-port-input:focus { border-color: var(--accent); color: var(--foreground); }

.ib-connect-btn {
  padding: 6px 16px;
  border-radius: 8px;
  background: var(--accent);
  border: none;
  color: var(--bg-deep);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity 0.18s, transform 0.12s cubic-bezier(0.34,1.56,0.64,1);
}
.ib-connect-btn:hover { opacity: 0.85; }
.ib-connect-btn:active { transform: scale(0.94); }

.ib-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--foreground-muted);
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.ib-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
}
.ib-dot-connected    { background: #4ade80; box-shadow: 0 0 6px #4ade8088; }
.ib-dot-connecting   { background: #fbbf24; animation: ibPulse 1s ease-in-out infinite; }
.ib-dot-disconnected { background: rgba(255,255,255,0.2); }

@keyframes ibPulse {
  0%,100% { opacity:1; } 50% { opacity:0.3; }
}

/* Main floating-window container */
body.ib-page {
  overflow: hidden;
  height: 100dvh;
  display: flex;
  flex-direction: column;
}
body.ib-page footer { display: none; }
body.ib-page #app {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

body.bm-page {
  overflow: hidden;
  height: 100dvh;
  display: flex;
  flex-direction: column;
}
body.bm-page footer { display: none; }
body.bm-page #app {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

body.mm-page {
  overflow: hidden;
  height: 100dvh;
  display: flex;
  flex-direction: column;
}
body.mm-page footer { display: none; }
body.mm-page #app {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

body.as-page {
  overflow: hidden;
  height: 100dvh;
  display: flex;
  flex-direction: column;
}
body.as-page footer { display: none; }
body.as-page #app {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ── Workspace container ─────────────────────────────────────── */
.ib-main {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
  background: var(--bg-deep);
}

/* ── Windows (absolutely positioned) ────────────────────────── */
.ib-window {
  display: none;
  flex-direction: column;
  position: absolute;
  background: rgba(4, 6, 8, 0.82);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid rgba(236, 235, 231, 0.08);
  border-radius: 8px;
  box-shadow:
    0 1px 0 rgba(236, 235, 231, 0.04) inset,
    0 16px 56px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(236, 235, 231, 0.04);
  overflow: hidden;
  min-width: 220px;
  min-height: 140px;
}

/* ── Snap ghost preview ──────────────────────────────────────── */
.ib-snap-ghost {
  display: none;
  position: absolute;
  border: 2px dashed rgba(236,235,231,0.55);
  border-radius: 8px;
  background: rgba(236,235,231,0.06);
  box-shadow: inset 0 0 24px rgba(236,235,231,0.05), 0 0 0 1px rgba(236,235,231,0.12);
  pointer-events: none;
  z-index: 9998;
  transition: left 0.07s ease, top 0.07s ease, width 0.07s ease, height 0.07s ease;
}

/* ── 8-direction resize handles ─────────────────────────────── */
.ib-rz { position: absolute; z-index: 10; }
.ib-rz-n  { top:0;    left:10px;  right:10px; height:5px;  cursor:n-resize;  }
.ib-rz-s  { bottom:0; left:10px;  right:10px; height:5px;  cursor:s-resize;  }
.ib-rz-e  { right:0;  top:10px;   bottom:10px;width:5px;   cursor:e-resize;  }
.ib-rz-w  { left:0;   top:10px;   bottom:10px;width:5px;   cursor:w-resize;  }
.ib-rz-ne { top:0;    right:0;    width:14px; height:14px; cursor:ne-resize; }
.ib-rz-nw { top:0;    left:0;     width:14px; height:14px; cursor:nw-resize; }
.ib-rz-se { bottom:0; right:0;    width:14px; height:14px; cursor:se-resize; }
.ib-rz-sw { bottom:0; left:0;     width:14px; height:14px; cursor:sw-resize; }


/* Full-edge spanning highlight overlay (positioned in ibMain, not inside window) */
#ibRzHighlight {
  position: absolute;
  pointer-events: none;
  z-index: 9997;
  background: rgba(236,235,231, 0.55);
  box-shadow: 0 0 8px 2px rgba(236,235,231, 0.35);
  border-radius: 2px;
}

.ib-win-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--foreground-muted);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  background: rgba(255,255,255,0.025);
  flex-shrink: 0;
  cursor: grab;
  user-select: none;
  transition: background 0.18s, color 0.18s;
}
.ib-win-header:hover { background: rgba(255,255,255,0.045); color: var(--foreground); }
.ib-win-header:active { cursor: grabbing; }
.ib-header-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: inherit;
  opacity: 0.5;
  cursor: pointer;
  padding: 2px 3px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  transition: opacity 0.15s, background 0.15s;
}
.ib-header-btn:hover { opacity: 1; background: rgba(255,255,255,0.08); }
.ib-header-btn:disabled { opacity: 0.2; pointer-events: none; }

.ib-win-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.ib-messages-body { overflow: hidden; }


/* ── Misc ────────────────────────────────────────────────────── */
.ib-win-toggles { display: flex; gap: 4px; flex-shrink: 0; }
.ib-toggle-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px; color: var(--foreground-muted);
  cursor: pointer; padding: 5px 8px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s, transform 0.12s cubic-bezier(0.34,1.56,0.64,1), border-color 0.15s;
}
.ib-toggle-btn:hover { background: rgba(255,255,255,0.09); color: var(--foreground); border-color: rgba(236,235,231,0.35); }
.ib-toggle-btn:active { transform: scale(0.9); }
.ib-toggle-active {
  background: rgba(236,235,231,0.12);
  border-color: rgba(236,235,231,0.45);
  color: rgba(236,235,231,1);
}
.ib-toggle-active:hover {
  background: rgba(236,235,231,0.2);
  border-color: rgba(236,235,231,0.7);
}
.ib-preset-active {
  background: rgba(236,235,231,0.15) !important;
  border-color: rgba(236,235,231,0.5) !important;
  color: rgba(236,235,231,1) !important;
}
.ib-preset-btn {
  gap: 5px;
  padding: 4px 9px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0;
}
.ib-preset-label {
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.ib-toggle-sep {
  width: 1px;
  height: 14px;
  background: rgba(255,255,255,0.1);
  align-self: center;
  margin: 0 2px;
}

/* ── Help button ─────────────────────────────────────────────── */
.ib-help-btn {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  color: var(--foreground-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.12s cubic-bezier(0.34,1.56,0.64,1);
  flex-shrink: 0;
}
.ib-help-btn:hover { background: rgba(236,235,231,0.12); border-color: rgba(236,235,231,0.45); color: rgba(236,235,231,1); }
.ib-help-btn:active { transform: scale(0.88); }
.ib-help-btn:disabled { opacity: 0.35; cursor: not-allowed; pointer-events: none; }

/* ── Modal backdrop ──────────────────────────────────────────── */
.ib-modal-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(var(--ink),0.55);
  backdrop-filter: blur(3px);
  z-index: 10000;
}
.ib-modal-backdrop.ib-modal-open { display: block; animation: ibFadeIn 0.18s ease both; }

/* ── Modal ───────────────────────────────────────────────────── */
.ib-modal {
  display: none;
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -48%) scale(0.97);
  width: min(480px, calc(100vw - 32px));
  background: #111014;
  border: 1px solid rgba(236,235,231,0.2);
  border-radius: 14px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.04) inset;
  z-index: 10001;
  opacity: 0;
  transition: none;
}
.ib-modal.ib-modal-open {
  display: block;
  animation: ibModalIn 0.22s cubic-bezier(0.34,1.3,0.64,1) both;
}
@keyframes ibModalIn {
  from { opacity: 0; transform: translate(-50%, -46%) scale(0.94); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes ibFadeIn {
  from { opacity: 0; } to { opacity: 1; }
}
.ib-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.ib-modal-title {
  display: flex; align-items: center; gap: 8px;
  font-family: 'Syne', sans-serif;
  font-size: 0.9rem; font-weight: 700;
  color: var(--foreground);
  letter-spacing: 0.02em;
}
.ib-modal-close {
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px;
  background: transparent; border: none;
  border-radius: 6px; color: var(--foreground-muted);
  cursor: pointer; transition: background 0.12s, color 0.12s;
}
.ib-modal-close:hover { background: rgba(255,255,255,0.07); color: var(--foreground); }
.ib-modal-body { padding: 18px; }

/* ── Help steps ──────────────────────────────────────────────── */
.ib-help-steps {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 16px;
}
.ib-help-steps li {
  display: flex; gap: 12px; align-items: flex-start;
}
.ib-help-step-num {
  flex-shrink: 0;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(236,235,231,0.18);
  border: 1px solid rgba(236,235,231,0.4);
  color: rgba(236,235,231,1);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin-top: 1px;
}
.ib-help-steps li > div > strong:first-child {
  display: block;
  font-size: 0.78rem; font-weight: 600;
  color: var(--foreground); margin-bottom: 3px;
}
.ib-help-steps p {
  font-size: 0.72rem; color: var(--foreground-muted);
  line-height: 1.55; margin: 0;
}
.ib-help-steps a { color: rgba(149,162,255,0.9); text-decoration: none; }
.ib-help-steps a:hover { text-decoration: underline; }
.ib-help-steps code, .ib-help-note code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  background: rgba(236,235,231,0.1);
  border: 1px solid rgba(236,235,231,0.2);
  border-radius: 4px; padding: 1px 5px;
  color: rgba(179,188,255,1);
}
.ib-help-note {
  display: flex; align-items: flex-start; gap: 7px;
  margin-top: 18px; padding: 10px 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  font-size: 0.7rem; color: var(--foreground-muted); line-height: 1.5;
}
.ib-help-note iconify-icon { flex-shrink: 0; margin-top: 1px; opacity: 0.6; }

.ib-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1;
  min-height: 80px;
  color: var(--foreground-muted);
  font-size: 0.7rem;
  text-align: center;
  padding: 24px;
  line-height: 1.5;
  opacity: 0.6;
}

/* Explorer */
.ib-explorer {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  padding: 4px 0;
  display: flex;
  flex-direction: column;
}

.ib-explorer-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 100%;
  color: var(--foreground-muted);
  font-size: 0.7rem;
  text-align: center;
  padding: 24px;
  line-height: 1.5;
}

.ib-node {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  cursor: pointer;
  font-size: 0.72rem;
  color: var(--foreground-muted);
  transition: background 0.1s;
  user-select: none;
}
.ib-node:hover { background: rgba(255,255,255,0.04); color: var(--foreground); }
.ib-node-sel { background: rgba(236,235,231,0.18) !important; color: var(--foreground) !important; }

.ib-section-header {
  padding: 10px 8px 3px;
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--foreground-muted);
  user-select: none;
}
.ib-section-header:first-child { padding-top: 6px; }

.ib-node-ghost { opacity: 0.35; pointer-events: none; }
.ib-node-loading { opacity: 0.5; gap: 4px; pointer-events: none; }
.ib-node-loading-label { font-size: 0.65rem; font-family: 'JetBrains Mono', monospace; }
.ib-props-loading {
  display: flex; align-items: center; gap: 8px;
  padding: 16px 12px;
  font-size: 0.68rem;
  color: var(--foreground-muted);
  font-family: 'JetBrains Mono', monospace;
}

.ib-node-arrow {
  width: 10px;
  font-size: 0.45rem;
  cursor: pointer;
  color: var(--foreground-muted);
  transition: transform 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ib-node-arrow.ib-leaf { visibility: hidden; }
.ib-node-arrow.ib-open { transform: rotate(90deg); }

.ib-node-icon { flex-shrink: 0; image-rendering: pixelated; }
.ib-node-name { font-family: 'JetBrains Mono', monospace; font-size: 0.68rem; }

/* Chat */
.ib-chat-panel { border-right: none; }

.ib-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ib-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 12px;
  color: var(--foreground-muted);
  font-size: 0.78rem;
  text-align: center;
}
.ib-welcome p { margin: 0; line-height: 1.6; }
.ib-welcome code { background: rgba(255,255,255,0.06); padding: 2px 6px; border-radius: 4px; font-family: 'JetBrains Mono', monospace; }

/* User message bubble */
.ib-msg-user {
  align-self: flex-end;
  max-width: 80%;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.78rem;
  line-height: 1.5;
  background: rgba(236,235,231,0.15);
  border: 1px solid rgba(236,235,231,0.25);
  color: var(--foreground);
}
/* AI response — bare text, no card */
.ib-msg-ai {
  align-self: flex-start;
  max-width: 88%;
  padding: 4px 2px;
}
/* System notice */
.ib-msg-system {
  align-self: center;
  font-size: 0.65rem;
  color: var(--foreground-muted);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.04em;
  padding: 2px 0;
}
/* Tool call row: dot + name + preview */
.ib-tool-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 3px 2px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.67rem;
  width: 100%;
}
.ib-tool-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ib-tool-name {
  color: var(--foreground-muted);
}
.ib-tool-preview {
  color: var(--foreground-muted);
  opacity: 0.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
/* Dot colours by state */
.ib-tool-row-busy .ib-tool-dot {
  background: #fbbf24;
  animation: ib-dot-pulse 1.4s ease-in-out infinite;
}
.ib-tool-row-ok .ib-tool-dot   { background: #4ade80; }
.ib-tool-row-fail .ib-tool-dot { background: #f87171; }
.ib-tool-row-ok .ib-tool-name  { color: var(--foreground-subtle); }
.ib-tool-row-fail .ib-tool-name { color: #f87171; opacity: 0.8; }
@keyframes ib-dot-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.35; transform: scale(0.7); }
}
@keyframes ib-spin { to { transform: rotate(360deg); } }
.ib-tool-spin { animation: ib-spin 1.2s linear infinite; display: inline-block; }

/* ── Window loading overlay ──────────────────────────────────── */
.ib-win-loader {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(12,12,16,0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  align-items: center;
  justify-content: center;
  z-index: 50;
  border-radius: inherit;
  pointer-events: none;
}
.ib-win-loading .ib-win-loader { display: flex; }
.ib-win-loader::after {
  content: '';
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.1);
  border-top-color: rgba(236,235,231,0.75);
  border-radius: 50%;
  animation: ib-spin 0.75s linear infinite;
}
.ib-win-body { position: relative; }
/* Markdown rendering inside AI messages */
.ib-md { line-height: 1.6; font-size: 0.78rem; color: var(--foreground); }
.ib-md p { margin: 0 0 6px; }
.ib-md p:last-child { margin-bottom: 0; }
.ib-md strong { color: var(--foreground); font-weight: 600; }
.ib-md em { font-style: italic; opacity: 0.85; }
.ib-md code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 4px;
  padding: 1px 5px;
  color: #93c5fd;
}
.ib-md pre {
  background: rgba(var(--ink),0.35);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 6px;
  padding: 10px 12px;
  overflow-x: auto;
  margin: 6px 0;
}
.ib-md pre code {
  background: none; border: none; padding: 0;
  font-size: 0.67rem; color: var(--foreground);
}
.ib-md ul, .ib-md ol { padding-left: 18px; margin: 4px 0 6px; }
.ib-md li { margin-bottom: 2px; }
.ib-md h1, .ib-md h2, .ib-md h3 {
  font-size: 0.78rem; font-weight: 600;
  color: var(--foreground); margin: 8px 0 4px;
}
.ib-md a { color: var(--accent-bright); text-decoration: none; }
.ib-md a:hover { text-decoration: underline; }
.ib-md blockquote {
  border-left: 2px solid var(--accent);
  margin: 4px 0; padding: 2px 10px;
  opacity: 0.75;
}
.ib-md hr { border: none; border-top: 1px solid rgba(255,255,255,0.08); margin: 8px 0; }

/* History panel */
.ib-history-list { padding: 6px; overflow-y: auto; height: 100%; }
.ib-hist-item {
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  margin-bottom: 3px;
  transition: background 0.12s;
}
.ib-hist-item:hover { background: rgba(255,255,255,0.05); }
.ib-hist-active {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.1);
}
.ib-hist-title {
  font-size: 0.72rem;
  color: var(--foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}
.ib-hist-meta {
  font-size: 0.6rem;
  color: var(--foreground-muted);
  margin-top: 2px;
  font-family: 'JetBrains Mono', monospace;
}

/* Skills panel */
.ib-skills-list { padding: 6px; overflow-y: auto; height: 100%; display: flex; flex-direction: column; gap: 5px; }
.ib-skills-count {
  margin-left: 5px;
  font-size: 0.6rem;
  font-family: 'JetBrains Mono', monospace;
  color: var(--foreground-muted);
  background: rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 1px 6px;
}
.ib-skill-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border-default);
  transition: background 0.12s, border-color 0.12s;
}
.ib-skill-card:hover { background: var(--surface-hover); border-color: var(--border-hover); }
.ib-skill-info { flex: 1; min-width: 0; }
.ib-skill-name { font-size: 0.73rem; font-weight: 600; color: var(--foreground); line-height: 1.3; }
.ib-skill-desc { font-size: 0.65rem; color: var(--foreground-muted); margin-top: 3px; line-height: 1.4; font-style: italic; }
.ib-skill-toggle {
  position: relative;
  flex-shrink: 0;
  width: 32px;
  height: 17px;
  background: rgba(255,255,255,0.1);
  border-radius: 9px;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
  padding: 0;
}
.ib-skill-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
  transition: transform 0.18s, background 0.18s;
}
.ib-skill-toggle.ib-skill-on { background: #4ade80; }
.ib-skill-toggle.ib-skill-on::after { transform: translateX(15px); background: #fff; }

/* Tools panel */
.ib-tools-list { padding: 6px; overflow-y: auto; height: 100%; }
.ib-tools-group { margin-bottom: 10px; }
.ib-tools-group-title {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--foreground-muted);
  padding: 4px 8px 3px;
}
.ib-tool-item {
  padding: 5px 8px;
  border-radius: 5px;
  margin-bottom: 2px;
}
.ib-tool-item:hover { background: rgba(255,255,255,0.04); }
.ib-tool-item-name {
  font-size: 0.68rem;
  color: var(--foreground);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
}
.ib-tool-item-desc {
  font-size: 0.6rem;
  color: var(--foreground-muted);
  margin-top: 1px;
  line-height: 1.4;
}

/* Settings modal */
.ib-settings-form { display: flex; flex-direction: column; gap: 14px; padding-bottom: 16px; }
.ib-settings-field { display: flex; flex-direction: column; gap: 5px; }
.ib-settings-label { font-size: 0.65rem; color: var(--foreground-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.ib-settings-input, .ib-settings-select {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 7px;
  color: var(--foreground);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  padding: 7px 10px;
  outline: none;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.ib-settings-input:focus, .ib-settings-select:focus { border-color: rgba(255,255,255,0.25); }
.ib-settings-select option { background: #1a1b22; }
.ib-api-key-row { display: flex; gap: 6px; }
.ib-api-key-row .ib-settings-input { flex: 1; }
.ib-apikey-toggle {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 7px;
  color: var(--foreground-muted);
  cursor: pointer;
  padding: 0 10px;
  transition: background 0.12s;
}
.ib-apikey-toggle:hover { background: rgba(255,255,255,0.12); color: var(--foreground); }
.ib-settings-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.ib-settings-note { font-size: 0.6rem; color: var(--foreground-muted); display: flex; align-items: center; gap: 4px; }
.ib-settings-actions { display: flex; gap: 8px; }
.ib-settings-cancel {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  color: var(--foreground-muted);
  cursor: pointer;
  font-size: 0.7rem;
  padding: 5px 12px;
  transition: background 0.12s;
}
.ib-settings-cancel:hover { background: rgba(255,255,255,0.06); }
.ib-settings-save {
  background: var(--accent-bright, #4ade80);
  border: none;
  border-radius: 6px;
  color: #0a0b10;
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 5px 14px;
  transition: opacity 0.12s;
}
.ib-settings-save:hover { opacity: 0.85; }

.ib-input-row {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid rgba(255,255,255,0.05);
  flex-shrink: 0;
}
.ib-msg-input {
  flex: 1;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  color: var(--foreground);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  padding: 8px 12px;
  outline: none;
  transition: border-color 0.2s;
}
.ib-msg-input:focus { border-color: var(--accent); }
.ib-msg-input:disabled { opacity: 0.4; cursor: not-allowed; }
.ib-send-btn {
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--accent);
  border: none;
  color: var(--bg-deep);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.18s, transform 0.12s cubic-bezier(0.34,1.56,0.64,1);
}
.ib-send-btn:hover:not(:disabled) { opacity: 0.85; }
.ib-send-btn:active:not(:disabled) { transform: scale(0.88); }
.ib-send-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* Properties */
.ib-props { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }
.ib-props-cls {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--accent-bright);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  letter-spacing: 0.04em;
}
.ib-props-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.68rem;
}
.ib-props-table tr { border-bottom: 1px solid rgba(255,255,255,0.03); }
.ib-props-table tr:hover { background: rgba(255,255,255,0.03); }
.ib-prop-cat td {
  padding: 8px 8px 3px;
  font-size: 0.57rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--foreground-muted);
  background: transparent;
}
.ib-prop-cat:first-child td { padding-top: 4px; }
.ib-prop-name {
  padding: 5px 12px;
  color: var(--foreground-muted);
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
  width: 48%;
}
.ib-prop-val {
  padding: 5px 8px;
  color: var(--foreground);
  font-family: 'JetBrains Mono', monospace;
}
.ib-pt-float, .ib-pt-double, .ib-pt-int, .ib-pt-int64 { color: #86efac; }
.ib-pt-bool, .ib-pt-boolean { color: #fbbf24; }
.ib-pt-string { color: #93c5fd; }
.ib-pt-Color3 { color: #f9a8d4; }
.ib-pt-BrickColor { color: #f9a8d4; }
.ib-pt-EnumItem { color: #c4b5fd; }
.ib-pt-Vector3, .ib-pt-Vector2 { color: #fdba74; }
.ib-pt-CFrame { color: #f97316; }
.ib-pt-UDim2, .ib-pt-UDim { color: #38bdf8; }
.ib-pt-Instance { color: #a78bfa; }


/* ── Output / Log window ─────────────────────────────────────── */
.ib-logbar-clear {
  background: none;
  border: none;
  color: var(--foreground-muted);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  opacity: 0.5;
  transition: opacity 0.15s;
  pointer-events: auto; /* header has cursor:grab, button must override */
}
.ib-logbar-clear:hover { opacity: 1; }

.ib-log-entries {
  flex: 1;
  overflow-y: auto;
  padding: 4px 12px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.ib-log-entry {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.64rem;
  line-height: 1.6;
  color: var(--foreground-muted);
}

.ib-log-ts {
  color: rgba(255,255,255,0.2);
  flex-shrink: 0;
  font-size: 0.6rem;
}

.ib-log-msg { word-break: break-all; }

.ib-log-ok  .ib-log-msg { color: #4ade80; }
.ib-log-err .ib-log-msg { color: #f87171; }
.ib-log-in  .ib-log-msg { color: #93c5fd; }
.ib-log-out .ib-log-msg { color: #c4b5fd; }

@media (max-width: 768px) {
  .ib-port-input { width: 140px; }
}

/* Active nav link */
.nav-links a.active {
  color: var(--foreground);
}

/* ── Back button ───────────────────────────────────────────── */

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 48px;
  font-size: 0.875rem;
}

/* ── Project Detail Page ───────────────────────────────────── */

.project-detail-header {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 48px;
  align-items: flex-start;
  margin-bottom: 48px;
}

@media (max-width: 768px) {
  .project-detail-header {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

.project-detail-logo {
  aspect-ratio: 1;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: 24px;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.project-detail-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.project-detail-badges {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.project-detail-meta h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 16px;
}

.project-detail-summary {
  color: var(--foreground-muted);
  font-size: 1.0625rem;
  line-height: 1.7;
  max-width: 600px;
}

.project-detail-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 768px) {
  .project-detail-body {
    grid-template-columns: 1fr;
  }
}

.project-detail-section {
  padding: 28px;
}

.project-detail-section h3 {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--foreground-muted);
  margin-bottom: 20px;
}

.project-highlights li {
  color: var(--foreground-muted);
  font-size: 0.9375rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 500;
}

.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status-active {
  background: rgba(34, 197, 94, 0.12);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

/* ── UX Quality ────────────────────────────────────────────── */

/* cursor: pointer on every interactive element */
.project-card,
.stat-item,
.highlight-pill,
.cert-item,
.achievement-card,
.bento-card.hero-card,
.link-arrow,
.back-btn {
  cursor: pointer;
}

/* Smooth transition on all interactive cards that were missing it */
.project-card {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.2s ease;
}

/* Keyboard focus — visible ring on anything focusable */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Skip to main content link for keyboard users */
.skip-link {
  position: fixed;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: var(--bg-deep);
  padding: 10px 20px;
  border-radius: 0 0 8px 8px;
  font-size: 0.875rem;
  font-weight: 500;
  z-index: 9999;
  text-decoration: none;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 0;
}


.status-archived {
  background: rgba(255,255,255,0.06);
  color: var(--foreground-muted);
  border: 1px solid var(--border-default);
}

/* ── Code window ─────────────────────────────────────────────── */
.ib-code-body {
  padding: 0;
  overflow: hidden;
}

.ib-code-editor-wrap {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.ib-code-tabs {
  display: flex;
  flex-shrink: 0;
  gap: 2px;
  padding: 4px 6px 0;
  background: rgba(0,0,0,0.15);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  overflow-x: auto;
  scrollbar-width: none;
}
.ib-code-tabs::-webkit-scrollbar { display: none; }

.ib-code-tab-new {
  flex-shrink: 0;
  align-self: center;
  background: none;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--foreground-muted);
  cursor: pointer;
  padding: 2px 5px;
  display: flex;
  align-items: center;
  transition: color 0.12s, background 0.12s;
}
.ib-code-tab-new:hover { color: var(--foreground); background: rgba(255,255,255,0.08); }

.ib-code-tab {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-bottom: none;
  border-radius: 5px 5px 0 0;
  color: var(--foreground-muted);
  cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  padding: 4px 6px 4px 10px;
  transition: background 0.12s, color 0.12s;
}
.ib-code-tab:hover { background: rgba(255,255,255,0.08); color: var(--foreground); }
.ib-code-tab-active {
  background: rgba(255,255,255,0.09);
  border-color: rgba(255,255,255,0.13);
  color: var(--foreground);
}
.ib-code-tab-name { pointer-events: none; }
.ib-code-tab-close {
  font-size: 0.75rem;
  line-height: 1;
  padding: 1px 2px;
  border-radius: 3px;
  color: var(--foreground-muted);
  opacity: 0;
  transition: opacity 0.1s, color 0.1s, background 0.1s;
}
.ib-code-tab:hover .ib-code-tab-close { opacity: 0.6; }
.ib-code-tab-close:hover { opacity: 1 !important; color: #ecebe7; background: rgba(236,235,231,0.15); }

.ib-code-editor {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
}
/* Monaco scrollbar tint */
.ib-code-editor .monaco-scrollable-element > .scrollbar > .slider {
  background: rgba(255,255,255,0.14) !important;
  border-radius: 3px !important;
}

.ib-code-output {
  flex-shrink: 0;
  background: rgba(0,0,0,0.3);
  border-top: 1px solid rgba(255,255,255,0.06);
  color: var(--foreground-muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  line-height: 1.5;
  max-height: 80px;
  overflow-y: auto;
  padding: 6px 10px;
  white-space: pre-wrap;
  word-break: break-all;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.ib-code-output:empty { display: none; }
.ib-code-err { color: rgba(255,110,110,0.9); }

/* ── Context menu ── */
.ib-ctx-menu {
  position: fixed;
  z-index: 9000;
  background: #111014;
  border: 1px solid var(--border-default);
  border-radius: 10px;
  padding: 4px;
  min-width: 180px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.04);
}
.ib-ctx-header {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.58rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent); opacity: 0.7;
  padding: 6px 10px 2px;
}
.ib-ctx-sep { height: 1px; background: var(--border-default); margin: 4px 0; }
.ib-ctx-item {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; padding: 7px 10px;
  border-radius: 6px; cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem; color: var(--foreground);
  transition: background 0.1s;
}
.ib-ctx-item:hover { background: rgba(255,255,255,0.06); }
.ib-ctx-disabled { opacity: 0.3; cursor: not-allowed; pointer-events: none; }
.ib-ctx-danger { color: #ecebe7; }
.ib-ctx-danger:hover { background: rgba(236,235,231,0.1); }

/* ── Decompile window ── */
.ib-decompile-body {
  flex: 1;
  overflow: auto;
  padding: 10px 12px;
}
.ib-decompile-pre {
  margin: 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  line-height: 1.6;
  color: var(--foreground-muted);
  white-space: pre;
  tab-size: 4;
}

/* ── Page loader ─────────────────────────────────────────────── */
#page-loader {
  position: fixed;
  inset: 0;
  z-index: 10000;
  overflow: hidden;
}

.loader-panel {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  background: var(--bg-deep, #080404);
  will-change: transform;
  transition: transform 0.75s cubic-bezier(0.76, 0, 0.24, 1);
}

.loader-panel-l { left: 0; }
.loader-panel-r { right: 0; }

.loader-content {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.loader-name {
  font-family: 'Syne', sans-serif;
  font-size: clamp(4.5rem, 16vw, 11rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  background: linear-gradient(110deg, #ecebe7 0%, #ecebe7 45%, #ecebe7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  /* revealed left→right via clip-path */
  clip-path: inset(0 101% 0 0);
  animation: loaderFill 1.1s cubic-bezier(0.16, 1, 0.3, 1) 0.15s forwards;
}

@keyframes loaderFill {
  to { clip-path: inset(0 -4px 0 0); }
}

/* Exit state */
#page-loader.loader-exit .loader-panel-l { transform: translateX(-100%); }
#page-loader.loader-exit .loader-panel-r { transform: translateX(100%); }
#page-loader.loader-exit .loader-content { opacity: 0; }
#page-loader.loader-gone { display: none; }

