/* 
 * Portfolio ChatBot Style Sheet
 * Refined using the Stitch MCP 'Common Thread' Design System
 * Aesthetic: Deep Obsidian Glassmorphism with Electric Cyan accents.
 */

:root {
  /* Color Mode: Dark (Obsidian - Common Thread Default) */
  --bg-from: #05070A;
  --bg-to: #0D1117;
  --panel: rgba(13, 17, 23, 0.7);
  --panel-2: rgba(13, 17, 23, 0.4);
  --muted: #B0B7C3;
  --text: #DEE3E8;
  --accent: #3ABEFF; /* Electric Cyan */
  --accent-hover: #83CFFF;
  --accent2: #98D6FF;
  --accent-gradient: linear-gradient(135deg, var(--accent), var(--accent2));
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.15);
  --input-bg: rgba(5, 7, 10, 0.8);
  --code-color: #98D6FF;
  --chat-border: rgba(255, 255, 255, 0.06);
  --profile-bg: rgba(13, 17, 23, 0.85);
  --profile-border: rgba(255, 255, 255, 0.1);
  --glass-blur: blur(20px);
  --glow: 0 0 20px rgba(58, 190, 255, 0.3);
  
  /* Shapes & Spacing Scale (Common Thread) */
  --radius-sm: 4px;
  --radius-md: 12px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
}

:root[data-theme="light"] {
  /* Color Mode: Light (Slate / Indigo Accent) */
  --bg-from: #F8FAFC;
  --bg-to: #E2E8F0;
  --panel: rgba(255, 255, 255, 0.7);
  --panel-2: rgba(255, 255, 255, 0.5);
  --muted: #64748B;
  --text: #0F172A;
  --accent: #4F46E5; /* Indigo */
  --accent-hover: #4338CA;
  --accent2: #9333EA; /* Purple */
  --accent-gradient: linear-gradient(135deg, var(--accent), var(--accent2));
  --border: rgba(0, 0, 0, 0.08);
  --border-hover: rgba(0, 0, 0, 0.15);
  --input-bg: rgba(255, 255, 255, 0.8);
  --code-color: #0284C7;
  --chat-border: rgba(0, 0, 0, 0.08);
  --profile-bg: rgba(255, 255, 255, 0.85);
  --profile-border: rgba(0, 0, 0, 0.1);
  --glow: 0 4px 20px rgba(79, 70, 229, 0.2);
}

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

html {
  scroll-padding-top: 120px;
  scroll-behavior: smooth;
}

body {
  height: 100%;
  background: linear-gradient(135deg, var(--bg-from), var(--bg-to));
  color: var(--text);
  transition: background 0.3s ease, color 0.3s ease;
}

/* Cinematic lighting point leaks behind the layout */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 0%, rgba(58, 190, 255, 0.06) 0%, transparent 50%), 
              radial-gradient(circle at 100% 100%, rgba(152, 214, 255, 0.04) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
  transition: background 0.3s ease;
}

:root[data-theme="light"] body::before {
  background: radial-gradient(circle at 50% 0%, rgba(79, 70, 229, 0.04) 0%, transparent 50%), 
              radial-gradient(circle at 100% 100%, rgba(147, 51, 234, 0.03) 0%, transparent 50%);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent);
}

/* Screen reader accessibility utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Header Notch */
header.notch {
  position: sticky;
  top: 16px;
  display: flex;
  justify-content: center;
  z-index: 120;
  padding: 0 16px;
}

.notch-inner {
  width: min(1100px, 96%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  border-radius: var(--radius-lg);
  background: var(--panel);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  transition: all 0.3s ease;
}

:root[data-theme="light"] .notch-inner {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-gradient);
  color: #fff;
  font-weight: 800;
  font-size: 1.2rem;
  cursor: pointer;
  border: 2px solid transparent;
  background-clip: padding-box;
  position: relative;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
}

.avatar::after {
  content: '';
  position: absolute;
  inset: -2px;
  background: var(--accent-gradient);
  z-index: -1;
  border-radius: var(--radius-full);
}

.avatar:hover {
  transform: scale(1.05);
  box-shadow: var(--glow);
}

.brand .titles {
  line-height: 1.2;
}

.brand .title {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.5px;
}

.brand .sub {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 500;
}

nav.top {
  display: flex;
  gap: 8px;
  align-items: center;
}

nav.top a {
  padding: 8px 16px;
  border-radius: var(--radius-lg);
  background: transparent;
  color: var(--muted);
  font-weight: 500;
  transition: all 0.2s ease;
  font-size: 0.95rem;
}

nav.top a:hover {
  color: var(--text);
  background: var(--panel-2);
  transform: translateY(-1px);
}

nav.top a.cta {
  background: var(--accent-gradient);
  color: #fff;
  padding: 8px 20px;
  box-shadow: var(--glow);
  border: none;
}

nav.top a.cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(58, 190, 255, 0.5);
  color: #fff;
}

:root[data-theme="light"] nav.top a.cta:hover {
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}

/* Theme Toggle Switcher */
.theme-toggle {
  width: 54px;
  height: 30px;
  padding: 4px;
  border-radius: 30px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.theme-toggle:hover {
  border-color: var(--border-hover);
}

.theme-toggle .knob {
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  background: var(--accent-gradient);
  transform: translateX(0);
  transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

:root[data-theme="light"] .theme-toggle .knob {
  transform: translateX(24px);
}

/* Profile Panel drawer */
.profile-panel {
  position: fixed;
  right: 20px;
  top: 86px;
  width: 400px;
  min-width: 280px;
  max-width: calc(100% - 40px);
  background: var(--profile-bg);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid var(--profile-border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45);
  transform: translateY(-15px) scale(0.95);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 99999;
  transform-origin: top right;
}

.profile-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.profile-row {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: nowrap;
}

.profile-img {
  width: 90px;
  height: 90px;
  border-radius: var(--radius-full);
  overflow: hidden;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #fff;
  font-size: 2rem;
  box-shadow: var(--glow);
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.profile-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profile-info .name {
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: 0.5px;
}

.profile-info .role {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.4;
}

.profile-actions {
  margin-top: 20px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Layout Grid container */
main.container {
  max-width: 1200px;
  margin: 32px auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 1fr minmax(320px, 460px);
  gap: 24px;
}

@media (max-width: 980px) {
  main.container {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* Chatbot Area */
.chat-window {
  background: var(--panel);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: var(--radius-lg);
  padding: 24px;
  height: 75vh;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border: 1px solid var(--chat-border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  min-height: 480px;
  position: relative;
  overflow: hidden;
}

.chat-window::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--accent-gradient);
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.bot-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  box-shadow: var(--glow);
  transition: transform 0.3s ease;
}

.bot-avatar:hover {
  transform: rotate(5deg) scale(1.05);
}

.bot-meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 2px;
}

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 10px 5px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.messages::-webkit-scrollbar {
  width: 6px;
}

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

.messages::-webkit-scrollbar-thumb {
  background-color: var(--border);
  border-radius: 10px;
}

.msg {
  animation: slideUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  transform-origin: bottom;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(15px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.msg.bot {
  align-self: flex-start;
  background: var(--panel-2);
  border: 1px solid var(--border);
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  border-bottom-left-radius: 4px;
  max-width: 85%;
  line-height: 1.5;
}

.msg.user {
  align-self: flex-end;
  background: var(--accent-gradient);
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  border-bottom-right-radius: 4px;
  color: #fff;
  max-width: 85%;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  line-height: 1.5;
}

.msg code {
  background: rgba(0, 0, 0, 0.2);
  color: var(--accent);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9em;
}

/* Typing Indicator */
.typing {
  display: flex;
  gap: 4px;
  align-items: center;
  height: 20px;
}

.typing .dot {
  width: 6px;
  height: 6px;
  background: var(--muted);
  border-radius: var(--radius-full);
  animation: typing 1.4s infinite ease-in-out both;
}

.typing .dot:nth-child(1) {
  animation-delay: -0.32s;
}

.typing .dot:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes typing {
  0%, 80%, 100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}

/* Quick Action Chips */
.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 10px;
}

.chip {
  background: var(--panel-2);
  padding: 8px 14px;
  border-radius: var(--radius-sm); /* Machined feeling (Common Thread) */
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text);
  cursor: pointer;
  border: 1px solid var(--border);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chip:hover {
  background: var(--panel);
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.chip.primary {
  background: var(--accent-gradient);
  color: #fff;
  border: none;
  box-shadow: var(--glow);
}

.chip.primary:hover {
  box-shadow: 0 6px 20px rgba(58, 190, 255, 0.5);
  transform: translateY(-2px);
}

/* Input Fields */
.input-row {
  display: flex;
  gap: 12px;
  padding-top: 16px;
  position: relative;
}

.input-row input {
  flex: 1;
  padding: 16px 20px;
  border-radius: var(--radius-sm); /* Machined feeling */
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.3s ease;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

.input-row input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(58, 190, 255, 0.2);
}

.input-row input::placeholder {
  color: var(--muted);
}

.input-row button {
  padding: 0 24px;
  border-radius: var(--radius-sm); /* Machined */
  border: 0;
  background: var(--accent-gradient);
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--glow);
}

.input-row button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(58, 190, 255, 0.5);
}

.input-row button:active {
  transform: translateY(0);
}

/* Right Column Panels & Terminal */
.right-column {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.terminal {
  background: rgba(5, 7, 10, 0.85); /* Deep dark background */
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: var(--radius-lg);
  padding: 16px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.3s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

:root[data-theme="light"] .terminal {
  background: rgba(15, 23, 42, 0.95);
  color: #f8fafc;
}

.term-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px;
}

.terminal .controls {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

.small-btn {
  padding: 8px 14px;
  border-radius: var(--radius-sm); /* Machined */
  border: 1px solid var(--border);
  background: var(--panel-2);
  cursor: pointer;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s;
  font-family: inherit;
}

:root[data-theme="light"] .terminal .small-btn {
  color: #fff;
  border-color: rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.08);
}

.small-btn:hover {
  background: var(--panel);
  border-color: var(--border-hover);
}

.terminal.resizable {
  resize: both;
  overflow: hidden;
  min-height: 280px;
  max-height: 60vh;
  min-width: 240px;
  max-width: 100%;
}

.terminal.collapsed {
  height: 65px !important;
  min-height: 65px !important;
  resize: none;
}

.dots {
  display: flex;
  gap: 8px;
  padding-left: 8px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: var(--radius-full);
  background: #FF5F56;
  box-shadow: 0 0 10px rgba(255, 95, 86, 0.4);
}

pre.code {
  flex: 1;
  overflow: auto;
  white-space: pre-wrap;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  background: transparent;
  color: var(--code-color);
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 0.9rem;
  line-height: 1.6;
  background: rgba(0, 0, 0, 0.35);
  scrollbar-width: thin;
}

/* Quick links card */
.quick-links-card {
  background: var(--panel);
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

.quick-links-card h4 {
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}

/* Projects grid section */
section.projects {
  grid-column: 1 / -1;
  margin-top: 40px;
  scroll-margin-top: 120px;
}

.section-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 24px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.projects-search {
  display: flex;
  gap: 12px;
  align-items: center;
  flex: 1;
  max-width: 400px;
}

.projects-search input {
  width: 100%;
  padding: 12px 20px;
  border-radius: var(--radius-sm); /* Machined */
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-family: inherit;
  transition: all 0.2s;
  backdrop-filter: var(--glass-blur);
}

.projects-search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(58, 190, 255, 0.1);
}

.project-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.project-card {
  background: var(--panel);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  padding: 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  min-height: 160px;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275),
              box-shadow 0.3s ease,
              border-color 0.3s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
  /* Safety net: always visible unless GSAP explicitly hides via autoAlpha */
  opacity: 1;
  visibility: visible;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--accent-gradient);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
  border-color: var(--border-hover);
}

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

.project-card h4 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0;
}

.project-card h4 a {
  display: block;
  transition: color 0.2s;
}

.project-card h4 a:hover {
  color: var(--accent);
}

.project-desc {
  color: var(--muted);
  flex: 1;
  font-size: 0.95rem;
  line-height: 1.5;
  margin-top: 4px;
}

/* Content Sections (About, Gists, Contact) */
.content-section {
  background: var(--panel);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  padding: 40px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  margin-top: 40px;
  scroll-margin-top: 120px;
}

.content-section p {
  margin-bottom: 16px;
  line-height: 1.7;
  font-size: 1.05rem;
  color: var(--muted);
}

.content-section p strong {
  color: var(--text);
}

.content-section ul {
  list-style-position: inside;
  margin-bottom: 20px;
  padding-left: 10px;
}

.content-section li {
  margin-bottom: 8px;
  color: var(--muted);
  line-height: 1.6;
  font-size: 1.05rem;
}

.content-section li strong {
  color: var(--text);
}

.content-section h2 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 24px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  margin-top: 0;
}

.content-section h4 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-top: 2em;
  margin-bottom: 1em;
  color: var(--text);
}

/* Resume and Custom Dialog Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100000;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal-backdrop.open {
  display: flex;
  opacity: 1;
}

.resume-modal {
  width: 100%;
  max-width: 1100px;
  height: 88vh;
  background: var(--profile-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-backdrop.open .resume-modal {
  transform: scale(1);
}

.resume-top {
  display: flex;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  gap: 16px;
  background: rgba(0, 0, 0, 0.2);
  color: var(--text);
}

.resume-actions {
  margin-left: auto;
  display: flex;
  gap: 12px;
  align-items: center;
}

.resume-frame {
  flex: 1;
  background: #fff;
}

.resume-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.small-link {
  padding: 8px 16px;
  border-radius: var(--radius-sm); /* Machined */
  background: var(--panel-2);
  border: 1px solid var(--border);
  cursor: pointer;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
  display: inline-block;
}

.small-link:hover {
  background: var(--panel);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

/* Footer Section */
footer {
  grid-column: 1 / -1;
  margin-top: 60px;
  padding: 30px;
  border-radius: var(--radius-lg);
  text-align: center;
  color: var(--muted);
  background: var(--panel);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 0.9rem;
  justify-content: center;
  align-items: center;
}

.footer-nav a {
  color: var(--muted);
}

.footer-nav a:hover {
  color: var(--accent);
}

/* GDPR Cookie Consent Banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(110%);
  width: min(560px, 94%);
  background: var(--profile-bg);
  border: 1px solid var(--profile-border);
  border-top: 1px solid var(--profile-border);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  padding: 18px 24px;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.4);
  z-index: 100001;
  display: flex;
  flex-direction: column;
  gap: 14px;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  transition: transform 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cookie-banner.show {
  transform: translateX(-50%) translateY(0);
}

/* Push page body up so cookie banner never covers footer */
body.cookie-visible {
  padding-bottom: 140px;
}

.cookie-text {
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text);
}

.cookie-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Google AdSense containers */
.ad-placement {
  background: var(--panel-2);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: center;
  margin: 16px 0;
  position: relative;
  overflow: hidden;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: border-color 0.3s;
}

.ad-placement:hover {
  border-color: var(--border-hover);
}

.ad-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  margin-bottom: 8px;
  font-weight: 700;
}

/* responsive adjustments */
@media (max-width: 980px) {
  .notch-inner {
    padding: 12px 20px;
    border-radius: var(--radius-md);
  }
  .chat-window {
    height: 70vh;
    min-height: 480px;
  }
  .resume-modal {
    height: 80vh;
  }
  .terminal.resizable {
    max-height: 45vh;
    min-height: 240px;
  }
  .content-section {
    padding: 30px;
  }
}

@media (max-width: 640px) {
  nav.top a {
    display: none;
  }
  nav.top a.cta {
    display: inline-block;
  }
  main.container {
    grid-template-columns: 1fr;
    margin: 16px auto;
    padding: 0 12px;
    gap: 16px;
  }
  
  /* Mobile Bottom Sheet Drawer for Profile Panel */
  .profile-panel {
    position: fixed;
    bottom: 0;
    top: auto;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border-bottom: none;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-origin: bottom center;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
  }
  .profile-panel.open {
    transform: translateY(0);
  }
  .profile-row {
    gap: 16px;
    flex-direction: column;
    text-align: center;
  }
  .profile-actions {
    justify-content: center;
  }
  
  .resume-modal {
    height: 90vh;
    max-width: 100%;
    border-radius: var(--radius-md);
  }
  
  /* Capped fixed height chat window on mobile */
  .chat-window {
    height: 70vh;
    min-height: 480px;
    padding: 16px;
  }
  .messages {
    max-height: calc(100% - 130px);
  }
  
  /* Pill horizontal slider for chips on mobile screen */
  .chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: none; /* Firefox */
  }
  .chips::-webkit-scrollbar {
    display: none; /* Safari/Chrome */
  }
  .chip {
    flex-shrink: 0;
  }
  
  .content-section {
    padding: 24px;
    border-radius: var(--radius-md);
  }
  .section-title {
    font-size: 1.7rem;
    margin-bottom: 8px;
  }
  .projects-search {
    max-width: 100%;
    width: 100%;
    margin-top: 8px;
  }
  .project-list {
    grid-template-columns: 1fr;
  }
  .cookie-banner {
    width: 100%;
    left: 0;
    transform: translateX(0) translateY(110%);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    padding: 14px 18px;
  }
  .cookie-banner.show {
    transform: translateX(0) translateY(0);
  }
  body.cookie-visible {
    padding-bottom: 160px;
  }
  pre.code {
    white-space: pre-wrap;
    word-break: break-all;
    word-wrap: break-word;
  }
}

@media (max-width: 480px) {
  .brand {
    gap: 8px;
  }
  .brand .title {
    font-size: 0.95rem;
  }
  .brand .sub {
    font-size: 0.75rem;
  }
  .avatar {
    width: 36px;
    height: 36px;
  }
  nav.top a.cta {
    padding: 6px 12px;
    font-size: 0.85rem;
  }
  .notch-inner {
    padding: 8px 12px;
    border-radius: var(--radius-md);
  }
  
  /* Stack buttons inside the resume viewer top banner */
  .resume-top {
    padding: 12px 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .resume-actions {
    margin-left: 0;
    width: 100%;
    justify-content: space-between;
    gap: 6px;
  }
  .resume-actions .small-link {
    padding: 6px 10px;
    font-size: 0.8rem;
    flex: 1;
    text-align: center;
  }
}
