/* RESET & SEMANTIC VARIABLES */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body, h1, h2, h3, h4, p, ul, ol, figure { margin: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; background: none; border: none; cursor: pointer; }

:root {
  /* LIGHT MODE (Default) */
  --bg-color: #F2F2F0;
  --surface-color: #FFFFFF;
  --text-main: #111111;
  --text-muted: #666666;
  --border-color: rgba(17, 17, 17, 0.15);
  --border-strong: rgba(17, 17, 17, 1);
  --invert-bg: #111111;
  --invert-text: #F2F2F0;

  --tech-accent: #4A90E2; /* Unified minimal blue for tech stacks */

  --radius-pill: 999px;
  --radius-card: 20px;

  font-family: "Inter Tight", sans-serif;
  font-weight: 400;
  line-height: 1.5;
}

html[data-theme="dark"] {
  /* DARK MODE */
  --bg-color: #111111;
  --surface-color: #1A1A1A;
  --text-main: #F2F2F0;
  --text-muted: #999999;
  --border-color: rgba(242, 242, 240, 0.15);
  --border-strong: rgba(242, 242, 240, 1);
  --invert-bg: #F2F2F0;
  --invert-text: #111111;

  --tech-accent: #6AA6FF; /* Slightly brighter blue for dark mode visibility */
}

body { background: var(--bg-color); color: var(--text-main); overflow-x: hidden; transition: background 0.3s, color 0.3s; }

/* UTILITIES & SPACING */
.wrap { max-width: 1400px; margin-inline: auto; padding: 2rem 5vw; }
.content { padding-block: 2rem; }
.mt-qtr { margin-top: 0.25rem; }
.mt-half { margin-top: 0.5rem; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-large { margin-top: 5rem; }
.mt-massive { margin-top: 10rem; }
.mt-auto { margin-top: auto; }
.mb-half { margin-bottom: 0.5rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.pb-1 { padding-bottom: 1rem; }
.text-right { text-align: right; }
.block { display: block; }
.flex-row { display: flex; gap: 2rem; align-items: center; justify-content: space-between; }

.border-bottom { border-bottom: 1px solid var(--border-color); }
.border-top { border-top: 1px solid var(--border-color); }

.text-muted { color: var(--text-muted); }
.tech-accent { color: var(--tech-accent); font-weight: 500; }

.surface-card { background: var(--surface-color); border: 1px solid var(--border-color); transition: background 0.3s, border-color 0.3s; }

/* TYPOGRAPHY */
h1, h2, h3, h4 { font-weight: 400; letter-spacing: -0.03em; line-height: 1.1; }
.massive-title { font-size: clamp(4rem, 15vw, 10rem); letter-spacing: -0.05em; line-height: 0.9; }
.statement-text { font-size: clamp(1.8rem, 5vw, 4.5rem); max-width: 1200px; line-height: 1.1; }
.medium-title { font-size: clamp(2rem, 3vw, 3rem); }
.huge-title { font-size: clamp(3.5rem, 10vw, 8rem); line-height: 0.9; letter-spacing: -0.05em; }
.massive-number { font-size: clamp(3rem, 6vw, 5rem); font-weight: 300; letter-spacing: -0.04em; }

.meta-text { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }

/* COMPONENTS: BUTTONS */
.pill-btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.8rem 1.5rem; border-radius: var(--radius-pill);
  font-size: 0.85rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
  background: var(--invert-bg); color: var(--invert-text);
  border: 1px solid var(--invert-bg);
  transition: transform 0.3s, opacity 0.3s;
}
.pill-btn:hover { transform: translateY(-3px); opacity: 0.9; }

.pill-btn.outline { background: transparent; color: var(--text-main); border: 1px solid var(--border-strong); }
.pill-btn.outline:hover { background: var(--invert-bg); color: var(--invert-text); }
.pill-btn.dark-btn { background: var(--text-main); color: var(--bg-color); border: 1px solid var(--text-main); }
.pill-btn.dark-btn:hover { background: transparent; color: var(--text-main); }

.icon-btn {
  display: inline-flex; justify-content: center; align-items: center;
  width: 48px; height: 48px; border: 1px solid var(--border-strong); border-radius: 50%;
  color: var(--text-main); font-size: 1.2rem; transition: background 0.3s, color 0.3s, transform 0.3s;
}
.icon-btn:hover { background: var(--invert-bg); color: var(--invert-text); transform: scale(1.05); }
.icon-btn.small { width: 32px; height: 32px; font-size: 0.9rem; border-color: var(--border-color); }

.floating-btn {
  position: fixed;
  top: 2rem;
  right: 5vw;
  z-index: 100;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), background 0.25s, color 0.25s, border-color 0.25s, box-shadow 0.25s;
}

html[data-theme="dark"] .floating-btn {
  background: rgba(20, 20, 20, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* HERO LAYOUT (Viewport Aware) */
.hero {
  min-height: 90svh;
  display: flex;
  flex-direction: column;
  padding-top: 4rem;
  padding-bottom: 2rem;
}
.hero-top { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 1px solid var(--border-color); padding-bottom: 1rem; }
.hero-middle { flex: 1; display: flex; align-items: center; padding-block: 4rem; }
.hero-bottom { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 2rem; }

.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

.hero-img-pill {
  width: 280px;
  height: 360px;
  border-radius: 200px;
  overflow: hidden;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  display: flex;
  justify-content: center;
  align-items: center;
}
.hero-img-pill img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

/* EXPERIENCE & EDUCATION */
.section-header.split { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 1rem; }

.resume-actions-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.company-link {
  color: var(--text-main);
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 4px;
  transition: color 0.25s ease, text-decoration-color 0.25s ease;
}

.company-link:hover {
  text-decoration-color: var(--text-main);
  color: var(--tech-accent);
}

.resume-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8rem; }

.resume-item { display: flex; flex-direction: column; margin-bottom: 4rem; }
.resume-item:last-child { margin-bottom: 0; }

.item-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.75rem; }
.item-head h4 { font-size: 1.4rem; font-weight: 500; }
.company { font-weight: 500; font-size: 1.15rem; color: var(--text-main); margin-bottom: 1.5rem; }

.bullet-list { list-style: none; }
.bullet-list li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 1.2rem;
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.6;
}
.bullet-list li::before { content: "—"; position: absolute; left: 0; color: var(--text-muted); font-size: 0.8rem; top: 0.35rem; }

/* SKILLS GRID */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 2rem; }
.skills-col { display: flex; flex-direction: column; }
.skills-category { font-size: 1.15rem; font-weight: 500; margin-bottom: 1rem; color: var(--text-main); }
.skills-list { font-size: 1.05rem; color: var(--text-muted); line-height: 1.6; }

/* STATS GRID */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.5rem; }
.stat-card { padding: 3rem 2rem; border-radius: var(--radius-card); display: flex; flex-direction: column; justify-content: center; }

/* BENTO GRID RESTRUCTURE (Minimal, Modern, Image in Box) */
.bento-12-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 2rem; grid-auto-flow: dense; }

.bento-card {
  position: relative;
  border-radius: var(--radius-card);
  overflow: hidden;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s;
}
.bento-card:hover { transform: translateY(-5px); box-shadow: 0 15px 35px rgba(0,0,0,0.06); }

/* Grid Spans */
.span-8 { grid-column: span 8; }
.span-4 { grid-column: span 4; }
.span-6 { grid-column: span 6; }
.span-12 { grid-column: span 12; }

/* Embedded Image Box */
.card-image-box {
  width: 100%;
  height: 220px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  flex-shrink: 0;
}
.span-4 .card-image-box, .span-6 .card-image-box { height: 180px; }
.card-image-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(20%) brightness(0.9);
  transition: transform 0.6s ease;
}
.bento-card:hover .card-image-box img { transform: scale(1.03); }

/* Text Content Area */
.bento-info {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  padding-right: 64px; /* Ensure text never overlaps the large button */
}
.bento-info h3 { font-size: 1.6rem; font-weight: 500; }
.bento-info p { font-size: 1rem; line-height: 1.5; }

/* Horizontal Layout for Mobile App Cards */
@media (min-width: 769px) {
  .horizontal-card {
    flex-direction: row;
    align-items: stretch;
  }

  .horizontal-card .card-image-box {
    width: 35%;          /* Makes the image box narrower */
    height: auto;        /* Allows it to stretch vertically */
    min-height: 320px;   /* Ensures it is nice and tall */
  }

  .horizontal-card .bento-info {
    justify-content: center; /* Centers the text vertically next to the image */
    padding-left: 1rem;
    padding-right: 80px;     /* Leaves room for the circular button */
  }
}

/* Special layout for the massive text-only card */
.text-only-card { padding: 3rem; justify-content: center; }
.text-only-card .bento-info { padding-right: 80px; }
.bento-info .info-left { flex: 0 0 35%; }
.bento-info .info-right { flex: 1; font-size: 1.05rem; }

/* LARGE WHITE CIRCULAR BUTTON */
.large-white-btn {
  position: absolute;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #FFFFFF; /* Forced pure white */
  color: #111111; /* Forced dark icon */
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s;
  z-index: 10;
  border: 1px solid rgba(0,0,0,0.05);
}
.large-white-btn:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  background: #FFFFFF;
  color: #000000;
}
html[data-theme="dark"] .large-white-btn {
  background: #FFFFFF;
  color: #111111;
  border: none;
  box-shadow: 0 4px 16px rgba(255,255,255,0.05);
}
.absolute-center-right {
  bottom: auto;
  top: 50%;
  transform: translateY(-50%);
  right: 2rem;
}
.absolute-center-right:hover {
  transform: translateY(-50%) scale(1.08);
}

/* MASSIVE EDITORIAL FOOTER */
.site-footer { border-top: 1px solid var(--border-color); padding-block: 6rem 2rem; }
.footer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; }

.status-indicator { display: inline-flex; align-items: center; gap: 0.8rem; padding: 0.5rem 1rem; border: 1px solid var(--border-color); border-radius: var(--radius-pill); }
.status-indicator .dot { width: 8px; height: 8px; background: #22c55e; border-radius: 50%; animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); } 70% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }

.footer-table { display: flex; flex-direction: column; border-top: 1px solid var(--border-strong); }
.table-row { display: flex; justify-content: space-between; padding: 1.5rem 0; border-bottom: 1px solid var(--border-color); font-size: 1.1rem; font-weight: 400; transition: color 0.2s; }
.table-row.head { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; color: var(--text-muted); padding-block: 1rem; }
a.table-row:hover { color: var(--text-muted); }

/* ANIMATIONS & REVEALS */
.hero .fade-up { opacity: 1; transform: none; }
.fade-up { opacity: 0; transform: translateY(20px); transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1); }
.reveal-up { opacity: 0; transform: translateY(40px); transition: all 1s cubic-bezier(0.16, 1, 0.3, 1); }
.reveal-scale { opacity: 0; transform: scale(0.97) translateY(20px); transition: all 1s cubic-bezier(0.16, 1, 0.3, 1); }

.is-in { opacity: 1 !important; transform: translateY(0) scale(1) !important; }
.reveal-stagger.is-in .fade-up:nth-child(1) { transition-delay: 0s; }
.reveal-stagger.is-in .fade-up:nth-child(2) { transition-delay: 0.15s; }
.reveal-stagger.is-in .fade-up:nth-child(3) { transition-delay: 0.3s; }

/* HOVER-EXPAND CHAT FAB (Aligned with Theme Toggle) */
.chat-fab {
  position: fixed; right: 5vw; bottom: 2rem; z-index: 90;
  background: var(--bg-color); color: var(--text-main);
  height: 48px; border-radius: 24px;
  border: 1px solid var(--border-strong);
  display: flex; align-items: center; overflow: hidden;
  max-width: 48px;
  transition: max-width 0.5s cubic-bezier(0.16, 1, 0.3, 1), background 0.3s, color 0.3s, border-color 0.3s, transform 0.3s;
  font-weight: 500; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em;
  padding: 0;
  transform-origin: right center;
}
.chat-fab:hover {
  max-width: 240px;
  background: var(--invert-bg);
  color: var(--invert-text);
  border-color: transparent;
  transform: scale(1.05);
}
.chat-fab .icon-wrap {
  width: 48px; height: 48px; flex-shrink: 0;
  display: flex; justify-content: center; align-items: center;
}
.chat-fab .chat-text {
  white-space: nowrap; opacity: 0;
  transform: translateX(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  padding-right: 1.5rem;
}
.chat-fab:hover .chat-text {
  opacity: 1;
  transform: translateX(0);
  transition-delay: 0.1s;
}

/* CHAT WIDGET OVERLAY & WEBGPU UI */
.chat-overlay { position: fixed; inset: 0; z-index: 120; background: rgba(0,0,0,0.6); backdrop-filter: blur(8px); display: grid; place-items: center; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.chat-overlay.open { opacity: 1; pointer-events: auto; }
.chat-panel { width: min(800px, 92vw); height: 78vh; border-radius: var(--radius-card); display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 25px 50px rgba(0,0,0,0.4); }
.chat-head { display: flex; justify-content: space-between; align-items: center; padding: 1.25rem 1.5rem; flex-shrink: 0; }
.chat-head-left { display: flex; align-items: center; gap: 0.75rem; }
.chat-head-right { display: flex; align-items: center; gap: 0.75rem; }

.mode-badge {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-pill);
  background: var(--border-color);
  color: var(--text-muted);
  transition: all 0.3s ease;
}
.mode-badge.active-gpu {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.pill-btn-small {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  transition: all 0.25s ease;
  cursor: pointer;
}
.pill-btn-small:hover {
  background: var(--invert-bg);
  color: var(--invert-text);
  border-color: var(--invert-bg);
}
.pill-btn-small.loading {
  opacity: 0.75;
  pointer-events: none;
}
.pill-btn-small.active {
  background: var(--text-main);
  color: var(--bg-color);
  border-color: var(--text-main);
}

.chat-status { padding: 0.6rem 1.5rem; background: var(--bg-color); flex-shrink: 0; }
.chat-status-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.5rem; }
.chat-progress-wrap { width: 100%; height: 3px; background: var(--border-color); overflow: hidden; margin-top: 0.4rem; border-radius: 2px; }
.chat-progress-bar { width: 0%; height: 100%; background: var(--tech-accent); transition: width 0.2s ease; }

.chat-log { flex: 1 1 0; min-height: 0; padding: 1.5rem; overflow-y: auto; display: flex; flex-direction: column; gap: 1rem; }
.msg { padding: 1rem 1.5rem; border-radius: 12px; max-width: 85%; font-size: 0.95rem; line-height: 1.5; border: 1px solid var(--border-color); word-break: break-word; }
.msg.user { align-self: flex-end; background: var(--invert-bg); color: var(--invert-text); border-color: transparent; border-bottom-right-radius: 4px; }
.msg.assistant { align-self: flex-start; background: var(--bg-color); color: var(--text-main); border-bottom-left-radius: 4px; }

.chat-suggestions { display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0.6rem 1.5rem; background: var(--surface-color); border-top: 1px solid var(--border-color); flex-shrink: 0; }
.suggestion-chip { font-size: 0.75rem; font-weight: 500; padding: 0.35rem 0.75rem; border-radius: var(--radius-pill); background: transparent; border: 1px solid var(--border-color); color: var(--text-muted); transition: all 0.2s ease; cursor: pointer; }
.suggestion-chip:hover { color: var(--text-main); border-color: var(--text-main); transform: translateY(-1px); }

.chat-form { display: flex; padding: 1rem 1.5rem; background: var(--surface-color); gap: 1rem; border-top: 1px solid var(--border-color); flex-shrink: 0; }
.chat-form textarea { flex: 1; padding: 0.8rem 1rem; border: 1px solid var(--border-color); border-radius: var(--radius-pill); background: transparent; color: var(--text-main); font-family: inherit; resize: none; outline: none; }

/* RESPONSIVE SCALING */
@media(max-width: 1024px) {
  .span-8, .span-4, .span-6, .span-12 { grid-column: span 6; }
  .bento-info.flex-row { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .text-only-card { padding: 1.5rem; }
  .text-only-card .bento-info { padding-right: 0; padding-bottom: 64px; } /* Room for button at bottom */
  .absolute-center-right { top: auto; bottom: 1.5rem; right: 1.5rem; transform: none; }
  .absolute-center-right:hover { transform: scale(1.08) translateY(-2px); }
  .resume-grid { gap: 5rem; }
}
@media(max-width: 900px) {
  .resume-grid { grid-template-columns: 1fr; gap: 5rem; }
  .footer-grid { grid-template-columns: 1fr; gap: 3rem; align-items: start; }
}
@media(max-width: 768px) {
  .span-8, .span-4, .span-6, .span-12 { grid-column: span 12; }
  .massive-title { font-size: clamp(3.5rem, 15vw, 6rem); }
  .statement-text { font-size: clamp(1.5rem, 6vw, 2.5rem); }
  .huge-title { font-size: clamp(2.8rem, 11vw, 4.5rem); }

  .hero {
    min-height: auto;
    padding-top: 2.5rem;
    padding-bottom: 2rem;
  }
  .hero-top {
    padding-right: 52px; /* Ensure title/weather never collides with fixed theme toggle */
  }
  .hero-middle {
    padding-block: 2.5rem;
  }
  .hero-actions {
    width: 100%;
    gap: 0.75rem;
  }
  .hero-actions .pill-btn {
    flex: 1 1 calc(50% - 0.5rem);
    justify-content: center;
    text-align: center;
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
  }
  .hero-img-pill { width: 190px; height: 250px; }
  .hero-bottom { flex-direction: column; align-items: flex-start; gap: 1.5rem; }

  .resume-grid { gap: 3.5rem; }
  .resume-item { margin-bottom: 2.5rem; }

  .bento-card {
    padding: 1.25rem;
    border-radius: 16px;
  }
  .card-image-box {
    height: 200px;
    border-radius: 10px;
  }
  .horizontal-card .card-image-box {
    height: 240px;
  }
  .horizontal-card .card-image-box img {
    object-position: top center;
  }
  .large-white-btn {
    width: 50px;
    height: 50px;
    bottom: 1.25rem;
    right: 1.25rem;
  }
  .large-white-btn svg {
    width: 20px;
    height: 20px;
  }
  .bento-info {
    padding-right: 0;
    padding-bottom: 56px; /* Ensure text doesn't hit bottom-right button */
  }
  .bento-info h3 { font-size: 1.35rem; }
  .bento-info p { font-size: 0.95rem; }

  .stat-card {
    padding: 2rem 1.5rem;
    border-radius: 16px;
  }
  .massive-number { font-size: clamp(2.5rem, 8vw, 3.5rem); }
  .skills-grid { gap: 1.5rem; }

  .site-footer { padding-block: 4rem 2rem; }
  .table-row { padding: 1.1rem 0; font-size: 1rem; }

  .mt-massive { margin-top: 5rem; }
  .mt-large { margin-top: 3rem; }

  /* Chat Modal Responsive */
  .chat-panel {
    width: min(94vw, 560px);
    height: 85svh;
    border-radius: 18px;
  }
  .chat-head {
    padding: 1rem 1.25rem;
  }
  .chat-head-left { gap: 0.5rem; }
  .chat-head h3 { font-size: 1.15rem; }
  .mode-badge { font-size: 0.6rem; padding: 0.2rem 0.45rem; }
  .pill-btn-small { padding: 0.35rem 0.65rem; font-size: 0.68rem; }
  .chat-status { padding: 0.5rem 1.25rem; }
  .chat-log { padding: 1rem 1.25rem; }
  .msg { padding: 0.85rem 1.1rem; max-width: 90%; font-size: 0.9rem; }
  .chat-suggestions { padding: 0.5rem 1.25rem; }
  .chat-form { padding: 0.75rem 1.25rem; }

  /* Lock FAB to icon on mobile to prevent clipping issues */
  .chat-fab:hover { max-width: 48px; transform: scale(1.05); }
  .chat-fab:hover .chat-text { opacity: 0; padding-right: 0; }
}

@media(max-width: 480px) {
  .wrap {
    padding-inline: 1.25rem;
  }
  .hero-actions .pill-btn {
    width: 100%;
    flex: 1 1 100%;
  }
  .hero-img-pill {
    width: 170px;
    height: 220px;
  }
  .floating-btn {
    top: 1.25rem;
    right: 1.25rem;
    width: 42px;
    height: 42px;
    font-size: 1.05rem;
  }
  .chat-fab {
    bottom: 1.25rem;
    right: 1.25rem;
    height: 44px;
    max-width: 44px;
  }
  .chat-fab .icon-wrap {
    width: 44px;
    height: 44px;
  }
  .chat-panel {
    width: 96vw;
    height: 88svh;
    border-radius: 14px;
  }
  .chat-head {
    padding: 0.75rem 1rem;
  }
  .pill-btn-small {
    padding: 0.3rem 0.55rem;
    font-size: 0.65rem;
  }
  .chat-status {
    padding: 0.45rem 1rem;
  }
  .chat-log {
    padding: 0.85rem 1rem;
  }
  .chat-suggestions {
    padding: 0.45rem 1rem;
  }
  .chat-form {
    padding: 0.65rem 1rem;
  }
  .chat-form textarea {
    font-size: 0.85rem;
    padding: 0.6rem 0.8rem;
  }
}

/* ==========================================================================
   LINKTREE / PROFILE HUB STYLES (Subtle, Clean & Minimal Animations)
   ========================================================================== */
.links-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  max-width: 680px;
  margin-inline: auto;
  padding: 4.5rem 1.5rem 3.5rem;
  width: 100%;
}

.links-top-nav {
  position: fixed;
  top: 2rem;
  right: 5vw;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  z-index: 100;
  animation: headerPopEnter 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.links-top-nav .icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  color: var(--text-main);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, color 0.25s ease;
}

html[data-theme="dark"] .links-top-nav .icon-btn {
  background: rgba(20, 20, 20, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.links-top-nav .icon-btn:hover {
  transform: scale(1.08) translateY(-1px);
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(0, 0, 0, 0.18);
  color: var(--text-main);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

html[data-theme="dark"] .links-top-nav .icon-btn:hover {
  background: rgba(32, 32, 32, 0.85);
  border-color: rgba(255, 255, 255, 0.25);
  color: var(--text-main);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.links-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  margin-bottom: 2rem;
}

.links-avatar-frame {
  width: 114px;
  height: 114px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--border-color);
  background: var(--surface-color);
  margin-bottom: 1.25rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease;
  opacity: 0;
  transform: translateY(14px);
}

.animate-ready .links-avatar-frame {
  animation: headerPopEnter 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.05s forwards;
}

.links-avatar-frame:hover {
  transform: scale(1.05);
  border-color: var(--border-strong);
}

.links-avatar-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform 0.4s ease;
}

.links-avatar-frame:hover img {
  transform: scale(1.04);
}

/* Staggered Blur-Settle Keyframes */
@keyframes avatarPopEnter {
  0% {
    opacity: 0;
    transform: scale(0.85) translateY(16px);
    filter: blur(6px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: blur(0);
  }
}

@keyframes headerPopEnter {
  0% {
    opacity: 0;
    transform: translateY(16px);
    filter: blur(4px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes ruleDraw {
  0% {
    transform: scaleX(0);
    opacity: 0;
  }
  100% {
    transform: scaleX(1);
    opacity: 1;
  }
}

@keyframes linkItemEnter {
  0% {
    opacity: 0;
    transform: translateY(26px) scale(0.98);
    filter: blur(3px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

/* Choreographed Header Entrances */
.fade-item {
  opacity: 0;
  transform: translateY(16px);
  filter: blur(4px);
}

.animate-ready .fade-item-1 {
  animation: headerPopEnter 0.75s cubic-bezier(0.16, 1, 0.3, 1) 0.12s forwards;
}
.animate-ready .fade-item-2 {
  animation: headerPopEnter 0.75s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
}
.animate-ready .fade-item-3 {
  animation: headerPopEnter 0.75s cubic-bezier(0.16, 1, 0.3, 1) 0.28s forwards;
}
.animate-ready .fade-item-4 {
  animation: headerPopEnter 0.75s cubic-bezier(0.16, 1, 0.3, 1) 0.36s forwards;
}

.links-name {
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 0.5rem;
}

.links-headline {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

/* Animated Playful Greeting Box */
.links-greeting-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin: 0.75rem auto 1.25rem;
  padding: 0.65rem 1.15rem;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  max-width: min(540px, 94vw);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.3s ease,
              box-shadow 0.3s ease;
  cursor: pointer;
  user-select: none;
}

.links-greeting-box:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.07);
}

html[data-theme="dark"] .links-greeting-box:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.greeting-content {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.92rem;
  color: var(--text-main);
  line-height: 1.4;
  font-weight: 450;
}

.greeting-emoji {
  display: inline-block;
  font-size: 1.15rem;
  transform-origin: 70% 70%;
  animation: waveHand 2.2s infinite ease-in-out;
}

@keyframes waveHand {
  0% { transform: rotate(0deg); }
  10% { transform: rotate(14deg); }
  20% { transform: rotate(-8deg); }
  30% { transform: rotate(14deg); }
  40% { transform: rotate(-4deg); }
  50% { transform: rotate(10deg); }
  60% { transform: rotate(0deg); }
  100% { transform: rotate(0deg); }
}

.greeting-text {
  letter-spacing: -0.01em;
  min-height: 1.4em;
  display: inline-block;
  transition: opacity 0.15s ease;
}

.greeting-cursor {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background: var(--tech-accent);
  margin-left: 2px;
  vertical-align: middle;
  animation: blinkCursor 0.9s infinite;
}

@keyframes blinkCursor {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.greeting-refresh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: var(--text-muted);
  background: transparent;
  padding: 0;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), color 0.3s ease, opacity 0.3s ease;
  margin-left: 0.25rem;
  opacity: 0.55;
  cursor: pointer;
}

.links-greeting-box:hover .greeting-refresh-btn {
  opacity: 1;
  color: var(--text-main);
  transform: rotate(180deg);
}

/* Top-Left Ambient Page Telemetry Info (Non-sticky, in page background) */
.links-page-telemetry,
.links-telemetry-hud {
  position: absolute;
  top: 2rem;
  left: 5vw;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  user-select: none;
  animation: headerPopEnter 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.links-page-telemetry .telemetry-item,
.links-meta-pill {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
  line-height: 1;
  transition: color 0.2s ease;
}

.links-page-telemetry .telemetry-item:hover,
.links-meta-pill:hover {
  color: var(--text-main);
}

.telemetry-icon-box {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.links-page-telemetry .telemetry-item:hover .telemetry-icon-box {
  color: var(--text-main);
}

.telemetry-icon-box svg {
  display: block;
  width: 13px;
  height: 13px;
}

.telemetry-val {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  line-height: 1;
}

/* Scroll-Fade States for Sticky Navigation Controls */
body.is-scrolling .links-top-nav,
body.is-scrolling .floating-btn {
  opacity: 0.18 !important;
  transform: scale(0.97) !important;
  pointer-events: none !important;
}

.links-top-nav:hover,
.floating-btn:hover {
  opacity: 1 !important;
  transform: none !important;
  pointer-events: auto !important;
}

.links-content {
  width: 100%;
  display: flex;
  flex-direction: column;
}

.links-section {
  width: 100%;
  margin-bottom: 1.75rem;
}

.links-section-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
}

.links-section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-color);
  transform-origin: left;
}

.animate-ready .links-section-title::after {
  animation: ruleDraw 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.links-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  width: 100%;
}

.links-list.links-grid-2col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
}

.links-grid-2col .link-card-span-2 {
  grid-column: 1 / -1;
}

.links-grid-2col .link-card:not(.link-card-span-2) {
  padding: 0.95rem 1.1rem;
  gap: 0.85rem;
}

.links-grid-2col .link-card:not(.link-card-span-2) .link-icon-box {
  width: 40px;
  height: 40px;
}

.links-grid-2col .link-card:not(.link-card-span-2) .link-icon-box svg {
  width: 20px;
  height: 20px;
}

.links-grid-2col .link-card:not(.link-card-span-2) .link-title {
  font-size: 0.98rem;
}

.links-grid-2col .link-card:not(.link-card-span-2) .link-badge {
  font-size: 0.62rem;
  padding: 0.18rem 0.45rem;
}

.links-grid-2col .link-card:not(.link-card-span-2) .link-desc {
  font-size: 0.8rem;
}

@media (max-width: 600px) {
  .links-list.links-grid-2col {
    grid-template-columns: 1fr;
  }
  .links-grid-2col .link-card:not(.link-card-span-2) {
    padding: 1rem;
    gap: 0.85rem;
  }
}

/* Link Cards with Interactive Cursor Spotlight */
.link-card {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  width: 100%;
  padding: 1.1rem 1.25rem;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  text-decoration: none;
  color: var(--text-main);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.3s ease,
              background 0.3s ease;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  opacity: 0;
  transform: translateY(24px) scale(0.98);
  filter: blur(3px);
}

.animate-ready .link-card {
  animation: linkItemEnter 0.75s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Subtle Cursor Spotlight Gradient */
.link-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(350px circle at var(--mouse-x, -500px) var(--mouse-y, -500px), rgba(74, 144, 226, 0.09), transparent 60%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
  z-index: 1;
}

.link-card:hover::before {
  opacity: 1;
}

html[data-theme="dark"] .link-card::before {
  background: radial-gradient(350px circle at var(--mouse-x, -500px) var(--mouse-y, -500px), rgba(106, 166, 255, 0.14), transparent 60%);
}

.link-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.06);
}

html[data-theme="dark"] .link-card:hover {
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45);
}

.link-card-featured {
  border-color: var(--border-strong);
  position: relative;
}

.link-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-main);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
  position: relative;
  z-index: 2;
}

.link-icon-box svg {
  width: 22px;
  height: 22px;
  transition: transform 0.3s ease;
}

.link-card:hover .link-icon-box {
  transform: scale(1.08) rotate(2deg);
  background: var(--invert-bg);
  color: var(--invert-text);
  border-color: var(--invert-bg);
}

.link-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  position: relative;
  z-index: 2;
}

.link-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.link-title {
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text-main);
}

/* Animated Badges & Beacons */
.link-badge {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-pill);
  background: var(--border-color);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
}

.link-badge.tech {
  color: var(--tech-accent);
  background: rgba(74, 144, 226, 0.12);
}

.link-badge.featured {
  background: var(--text-main);
  color: var(--bg-color);
}

.badge-pulse-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--tech-accent);
  margin-right: 4px;
  animation: beaconPulse 1.8s infinite ease-out;
}

@keyframes beaconPulse {
  0% { box-shadow: 0 0 0 0 rgba(74, 144, 226, 0.6); }
  70% { box-shadow: 0 0 0 6px rgba(74, 144, 226, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 144, 226, 0); }
}

.badge-sparkle {
  display: inline-block;
  margin-right: 3px;
  font-size: 0.72rem;
  animation: sparkleTwinkle 2.5s infinite ease-in-out;
}

@keyframes sparkleTwinkle {
  0%, 100% { opacity: 0.6; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.2); }
}

.link-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
}

/* Card Actions (Arrow & Quick Copy Mini-Button) */
.link-actions-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

.link-quick-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--surface-color);
  color: var(--text-muted);
  cursor: pointer;
  transition: transform 0.25s ease, background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
  padding: 0;
}

.link-quick-copy:hover {
  transform: scale(1.12);
  color: var(--text-main);
  border-color: var(--border-strong);
  background: var(--bg-color);
}

.link-quick-copy.copied {
  background: #22c55e;
  color: #FFFFFF;
  border-color: #22c55e;
  transform: scale(1.1);
}

.link-arrow {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), color 0.3s ease;
}

.link-arrow svg {
  width: 18px;
  height: 18px;
}

.link-card:hover .link-arrow {
  transform: translate(3px, -3px) scale(1.05);
  color: var(--text-main);
}

/* Footer & Telemetry Node */
.links-footer {
  margin-top: 3.5rem;
  width: 100%;
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  animation: headerPopEnter 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.6s forwards;
}



/* Toast Notification */
.links-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(30px);
  opacity: 0;
  background: var(--invert-bg);
  color: var(--invert-text);
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  pointer-events: none;
  z-index: 1000;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
}

.links-toast.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

@media (max-width: 600px) {
  .links-wrapper {
    padding: 4.5rem 1rem 2.5rem;
  }
  .links-page-telemetry,
  .links-telemetry-hud {
    top: 1.25rem;
    left: 1.25rem;
    gap: 0.35rem;
  }
  .links-page-telemetry .telemetry-item,
  .links-meta-pill {
    font-size: 0.65rem;
    gap: 0.45rem;
  }
  .telemetry-icon-box {
    width: 14px;
    height: 14px;
  }
  .telemetry-icon-box svg {
    width: 12px;
    height: 12px;
  }
  .link-card {
    padding: 1rem;
    gap: 0.85rem;
  }
  .link-icon-box {
    width: 40px;
    height: 40px;
  }
  .link-desc {
    font-size: 0.8rem;
  }
  .links-top-nav {
    top: 1.25rem;
    right: 1.25rem;
  }
  .links-top-nav .icon-btn {
    width: 38px;
    height: 38px;
    font-size: 1rem;
  }
}
