/* ============================================================
   style.css — Split Page Structural Engineering Architecture
   ============================================================ */

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

/* Base Variables Config Setup */
:root {
  --bg-color: #0f172a;
  --bg-glowing-spotlight: rgba(29, 78, 216, 0.15);
  --text-lead: #f1f5f9;
  --text-body: #94a3b8;
  --text-active: #5fe5e5; /* Electric teal-blue accent */
  --pill-bg: rgba(45, 212, 191, 0.1);
  --pill-text: #5fe5e5;
  --card-bg: rgba(15, 23, 42, 0.55);
  --card-border: rgba(255, 255, 255, 0.08);
  --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.10);
  --card-hover-bg: rgba(30, 41, 59, 0.4);
  --card-hover-border: rgba(255, 255, 255, 0.05);
  --surface-glow: rgba(95, 229, 229, 0.12);
  --modal-overlay-bg: rgba(0, 0, 0, 0.6);
  --bg-image: none;
  
  --font-headings: 'Space Grotesk', sans-serif;
  --font-content: 'Inter', sans-serif;
  --transition-smooth: 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  --button-bg: var(--text-active);
  --button-foreground: #0f172a;
}

/* Responsive Light Mode Switch Map Overrides */
[data-theme="light"] {
  --bg-color: #eef4ff;
  --bg-glowing-spotlight: rgba(59, 130, 246, 0.24);
  --text-lead: #0f172a;
  --text-body: #475569;
  --text-active: #1d4ed8; /* True royal blueprint blue */
  --pill-bg: rgba(59, 130, 246, 0.16);
  --pill-text: #2563eb;
  --card-bg: rgba(255, 255, 255, 0.98);
  --card-border: rgba(59, 130, 246, 0.18);
  --card-shadow: 0 20px 50px rgba(59, 130, 246, 0.12);
  --card-hover-bg: rgba(59, 130, 246, 0.10);
  --card-hover-border: rgba(59, 130, 246, 0.24);
  --surface-glow: rgba(59, 130, 246, 0.12);
  --modal-overlay-bg: rgba(15, 23, 42, 0.22);
  --bg-image: radial-gradient(circle at top left, rgba(59, 130, 246, 0.18), transparent 24%), radial-gradient(circle at bottom right, rgba(37, 99, 235, 0.12), transparent 32%);
  --button-foreground: #eef4ff;
}

html {
  scroll-behavior: smooth;
  overflow-x: clip; /* 'clip' avoids creating a new scroll container, so position:sticky on children still works */
}

body {
  overflow-x: clip; /* Same reason as html — 'hidden' would kill sticky positioning */
  background-color: var(--bg-color);
  background-image: var(--bg-image);
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--text-body);
  font-family: var(--font-content);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition-smooth), color var(--transition-smooth);
}

/* ── STAR FIELD BACKGROUND CANVAS ── */
.star-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 1;
  transition: opacity 0.6s ease;
}

[data-theme="light"] .star-bg {
  opacity: 0.3;
}

/* Background Layer capturing real-time pointer coordinates */
.spotlight-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(600px at var(--mouse-x, 0px) var(--mouse-y, 0px), var(--bg-glowing-spotlight), transparent 80%);
}

.split-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 45% 55%;
  min-height: 100vh;
  position: relative;
  z-index: 2;
}

/* ── LEFT SIDEBAR (STICKY MATRIX) ── */
.left-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 6rem 2rem 6rem 4rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.dev-name {
  font-family: var(--font-headings);
  font-size: 3rem;
  font-weight: 700;
  color: var(--text-lead);
  letter-spacing: -0.04em;
  margin-bottom: 0.5rem;
}

.dev-title {
  font-family: var(--font-headings);
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text-lead);
  margin-bottom: 1.5rem;
  min-height: 2.1rem;
}

.dev-tagline {
  color: var(--text-body);
  font-size: 1rem;
  max-width: 340px;
  margin-bottom: 1.6rem;
}

/* Typewriter Cursor Architecture */
.txt-cursor {
  color: var(--text-active);
  font-weight: 400;
  margin-left: 3px;
  animation: blink 0.7s infinite;
}

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

/* ASYNC SCROLL NAVIGATION DESIGN BLOCK */
.indicator-nav {
  margin-top: 4rem;
}
.indicator-nav ul {
  list-style: none;
}
.indicator-nav li {
  margin-bottom: 1rem;
}
.indicator-nav a {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  font-family: var(--font-headings);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-body);
  padding: 0.5rem 0;
  transition: var(--transition-smooth);
}
.nav-line {
  width: 32px;
  height: 1px;
  background-color: var(--text-body);
  transition: var(--transition-smooth);
}
.indicator-nav a:hover,
.indicator-nav a.active {
  color: var(--text-lead);
}
.indicator-nav a:hover .nav-line,
.indicator-nav a.active .nav-line {
  width: 64px;
  background-color: var(--text-lead);
  box-shadow: 0 0 8px var(--text-active);
}

/* Footer Control Links Layout Array */
.sidebar-bottom {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.utility-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.theme-toggle-btn {
  background: none;
  border: none;
  color: var(--text-lead);
  font-size: 1.2rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.theme-toggle-btn:hover {
  color: var(--text-active);
  transform: scale(1.1);
}

/* THE CONSISTENTLY ALIVE DOWNLOAD BUTTON BLOCK */
.cv-download-link {
  font-family: var(--font-headings);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-lead);
  text-decoration: none;
  display: inline-flex;  /* Handles advanced physics translation securely */
  align-items: center;
  gap: 0.5rem;
  transition: color var(--transition-smooth);
  
  /* Constant Idle Movement: Continuously loop a subtle breathe/bounce effect */
  animation: continuousIdleBreathe 2.4s ease-in-out infinite;
}

.cv-download-link:hover {
  color: var(--text-active);
  /* Interrupts the idle cycle to inject an energetic snap bounce upon cursor interaction */
  animation: dynamicSquishBounce 0.65s ease-in-out forwards;
}

.social-uplinks {
  display: flex;
  gap: 1.5rem;
}
.social-uplinks a {
  color: var(--text-body);
  font-size: 1.4rem;
  transition: var(--transition-smooth);
}
.social-uplinks a:hover {
  color: var(--text-lead);
}

/* ── RIGHT STREAM DATA DEPLOYMENTS ── */
.right-content-stream {
  padding: 6rem 4rem 6rem 2rem;
}
.mobile-section-header {
  display: none;
}
.scroll-anchor {
  padding-bottom: 5rem;
}

.section-title {
  font-family: var(--font-headings);
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--text-lead);
  margin-bottom: 2rem;
  letter-spacing: -0.02em;
}

/* ── ABOUT ME — TILTED MEMBER CARD ── */
.about-member-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-top: 4rem;
  padding: 2.25rem 1.75rem 1.75rem;
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  transform: scale(0.97);
  transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
}

.about-member-card:hover {
  transform: scale(1);
  box-shadow: var(--card-shadow);
}


.about-photo-block {
  position: relative;
  margin-top: -3.75rem;
  margin-bottom: 1.5rem;
}

.about-photo-frame {
  position: relative;
  width: 150px;
  height: 200px;
  padding: 0.4rem;
  border-radius: 16px;
  overflow: hidden;

  /* Diagonal frame edge nodding to the original card's slanted thumb */
  background: linear-gradient(-82deg, var(--bg-color) 0 65%, var(--text-active) 0 100%);
  transform: rotate(-5deg);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
  transition: var(--transition-smooth);
}

.about-member-card:hover .about-photo-frame {
  transform: rotate(-1deg);
  padding: 0.15rem;
}

.about-photo {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  border-radius: 12px;
  display: block;
  z-index: 1;

  /* ── ANTI-CRISP ANTI-ARTIFACT SMOOTHING FILTER ── */
  image-rendering: smooth;
  filter: grayscale(1) contrast(1.02) blur(0.30px);
  transition: filter 0.45s ease;
}

.about-member-card:hover .about-photo {
  filter: grayscale(0) blur(0.30px);
}

.about-photo-glow {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40%;
  background: linear-gradient(to top, rgba(95, 229, 229, 0.18), transparent);
  border-radius: 0 0 12px 12px;
  z-index: 2;
  pointer-events: none;
}

/* Name tag — a flat "sticky note" label that snaps level on hover */
.about-name-tag {
  display: inline-block;
  font-family: var(--font-headings);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--bg-color);
  background-color: var(--text-lead);
  padding: 0.5rem 1.1rem;
  border-radius: 8px;
  transform: rotate(-2deg);
  transition: var(--transition-smooth);
  margin-bottom: 1rem;
}

.about-member-card:hover .about-name-tag {
  transform: rotate(0deg);
  background-color: var(--text-active);
}

.about-photo-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1rem;
  background: var(--pill-bg);
  border: 1px solid rgba(95, 229, 229, 0.25);
  border-radius: 20px;
  font-family: var(--font-headings);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--pill-text);
  letter-spacing: 0.04em;
  margin-bottom: 1.25rem;

  /* 3D tilt effect (driven by main.js on mouseenter/mousemove) */
  position: relative;
  overflow: hidden;
  transform: rotate3d(0);
  transition-duration: 300ms;
  transition-property: transform, box-shadow;
  transition-timing-function: ease-out;
}

.about-photo-badge:hover {
  transition-duration: 150ms;
  box-shadow: 0 5px 20px 5px rgba(95, 229, 229, 0.18);
}

.about-photo-badge .glow {
  position: absolute;
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
  pointer-events: none;
  border-radius: inherit;
  background-image: radial-gradient(circle at 50% -20%, #ffffff22, #0000000f);
  z-index: 0;
}

.about-photo-badge i,
.about-photo-badge span {
  position: relative;
  z-index: 1;
}

.about-photo-badge i {
  font-size: 0.8rem;
}

.profile-stream-card {
  max-width: 480px;
}

.profile-stream-card p {
  margin-bottom: 1.5rem;
  font-size: 1rem;
}

/* Connect chip — hover-invert pill, echoing the original card's link treatment */
.about-connect-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--text-lead);
  color: var(--bg-color);
  font-family: var(--font-headings);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.6rem 1.2rem;
  border-radius: 10px;
  text-decoration: none;
  transition: var(--transition-smooth);
}

.about-connect-link:hover {
  background-color: var(--text-active);
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}

@media (min-width: 640px) {
  .about-member-card {
    flex-direction: row;
    align-items: center;
    text-align: left;
    padding: 2rem 2.75rem 2rem 1rem;
  }
  .about-photo-block {
    margin-top: 0;
    margin-bottom: 0;
    margin-left: -2.25rem;
    margin-right: 2rem;
    flex-shrink: 0;
  }
}



/* ── PROFESSIONAL JOURNEY — VERTICAL TIMELINE ── */
.timeline-stream {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}

/* Each row: date | spine | card */
.tl-entry {
  display: grid;
  grid-template-columns: 100px 48px 1fr;
  gap: 0 0;
  align-items: stretch;
}

/* Date column */
.tl-left {
  display: flex;
  justify-content: flex-end;
  padding-right: 16px;
  padding-top: 0.35rem;
}

.tl-date {
  font-family: var(--font-headings);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-active);
  white-space: nowrap;
  line-height: 1.4;
  text-align: right;
}

/* Spine: dot + vertical line */
.tl-spine {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.tl-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--card-bg);
  border: 2px solid var(--text-active);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  z-index: 1;
  transition: var(--transition-smooth);
  box-shadow: 0 0 0 4px var(--surface-glow);
}

.tl-dot i {
  font-size: 0.8rem;
  color: var(--text-active);
  transition: var(--transition-smooth);
}

.tl-entry:hover .tl-dot {
  background-color: var(--text-active);
  box-shadow: 0 0 0 6px var(--surface-glow);
}

.tl-entry:hover .tl-dot i {
  color: var(--bg-color);
}

.tl-line {
  flex: 1;
  width: 2px;
  background-color: rgba(148, 163, 184, 0.15); /* Subdued track background */
  position: relative;
  margin-top: 4px;
}

/* Interactive accent layer that grows dynamically on scroll */
.tl-line::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--line-progress, 0%);
  background-color: var(--text-active);
  box-shadow: 0 0 10px var(--text-active);
}

.tl-entry:last-child .tl-line {
  display: none;
}

.tl-entry:last-child .tl-line {
  display: none;
}

/* Card */
.tl-card {
  padding: 0 0 2.5rem 1.5rem;
  padding-top: 0.1rem;
}

.tl-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.2rem;
  flex-wrap: wrap;
}

.tl-card h3 {
  font-family: var(--font-headings);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-lead);
  line-height: 1.3;
  transition: var(--transition-smooth);
}

.tl-entry:hover .tl-card h3 {
  color: var(--text-active);
}

.tl-card h4 {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-body);
  margin-bottom: 0.75rem;
  opacity: 0.8;
}

.tl-card p {
  font-size: 0.9rem;
  color: var(--text-body);
  line-height: 1.7;
  margin-bottom: 1rem;
}

/* Type badges */
.tl-type {
  font-family: var(--font-headings);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Unified Colors (Based on Freelance style) */
.tl-type--edu,
.tl-type--intern,
.tl-type--freelance {
  background-color: rgba(251, 191, 36, 0.1);
  color: #f59e0b;
  border: 1px solid rgba(251, 191, 36, 0.2);
}

/* Unified Light Theme Colors */
[data-theme="light"] .tl-type--edu,
[data-theme="light"] .tl-type--intern,
[data-theme="light"] .tl-type--freelance {
  background-color: rgba(217, 119, 6, 0.1);
  color: #b45309;
  border-color: rgba(217, 119, 6, 0.2);
}

/* Legacy selectors kept for project cards */
.title-link-icon {
  font-size: 0.8rem;
  opacity: 0;
  transform: translate(-4px, 4px);
  transition: var(--transition-smooth);
}
.project-stream-card:hover .title-link-icon {
  opacity: 1;
  transform: translate(0, 0);
}

/* Mobile: collapse date into card */
@media (max-width: 600px) {
  .tl-entry {
    grid-template-columns: 28px 1fr;
  }
  .tl-left {
    display: none;
  }
  .tl-date-inline {
    display: block;
    font-family: var(--font-headings);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-active);
    margin-bottom: 0.3rem;
  }
}

/* Micro-badge Tags Framework */
.card-pills, .matrix-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.card-pills span, .matrix-pills span {
  font-family: var(--font-headings);
  font-size: 0.75rem;
  font-weight: 500;
  background-color: var(--pill-bg);
  color: var(--pill-text);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
}

/* ============================================================
   SKILLS SECTION — Tabbed Interface
   ============================================================ */

.sk-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 1.75rem;
}

.sk-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  background: transparent;
  color: var(--text-body);
  font-family: var(--font-headings);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.sk-tab:hover {
  background-color: var(--card-hover-bg);
  color: var(--text-lead);
  border-color: rgba(255,255,255,0.12);
}

.sk-tab.active {
  background-color: var(--text-lead);
  color: var(--bg-color);
  border-color: var(--text-lead);
}

.sk-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 0.68rem;
  font-weight: 700;
  background-color: var(--pill-bg);
  color: var(--pill-text);
  font-family: var(--font-content);
}

.sk-tab.active .sk-tab-count {
  background-color: rgba(0,0,0,0.15);
  color: inherit;
}

/* Panels */
.sk-panel {
  display: none;
}

.sk-panel.active {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 10px;
  animation: sk-in 0.22s ease;
}

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

/* Card */
.sk-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  overflow: hidden;
  cursor: grab;
  transition: transform var(--transition-smooth),
              border-color var(--transition-smooth),
              background-color var(--transition-smooth),
              box-shadow var(--transition-smooth);
}

/* Left accent bar */
.sk-card::after {
  content: '';
  position: absolute;
  left: 0;
  top: 18%;
  bottom: 18%;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background-color: var(--accent, var(--text-active));
  opacity: 0;
  transition: opacity var(--transition-smooth);
}

.sk-card:hover {
  transform: translateY(-3px);
  background-color: var(--card-hover-bg);
  border-color: rgba(255,255,255,0.1);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.sk-card:hover::after {
  opacity: 1;
}

/* Icon box */
.sk-card-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--accent, var(--text-active));
  background-color: var(--surface-glow);
  border: 1px solid var(--card-border);
  transition: transform var(--transition-smooth);
}

.sk-card:hover .sk-card-icon {
  transform: scale(1.1) rotate(-4deg);
}

.sk-card-icon--text {
  font-family: var(--font-headings);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* Text */
.sk-card-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.sk-card-name {
  font-family: var(--font-headings);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-lead);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color var(--transition-smooth);
}

.sk-card:hover .sk-card-name {
  color: var(--accent, var(--text-active));
}

.sk-card-sub {
  font-size: 0.7rem;
  color: var(--text-body);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Light mode adjustments */
[data-theme="light"] .sk-tab.active {
  background-color: var(--text-lead);
  color: #eef4ff;
  border-color: var(--text-lead);
}

[data-theme="light"] .sk-card:hover {
  border-color: rgba(59,130,246,0.2);
  box-shadow: 0 8px 24px rgba(59,130,246,0.1);
}

/* Responsive */
@media (max-width: 600px) {
  .sk-panel.active {
    grid-template-columns: 1fr 1fr;
  }
  .sk-tab {
    padding: 6px 12px;
    font-size: 0.75rem;
  }
}

/* Hide old skill elements */
.logo-grid, .logo-card, .skill-category-block, .skills-stream-box { display: none; }

/* Footer card color tokens */
:root {
  --footer-green:  #6C63FF;
  --footer-yellow: #3EB5FF;
  --footer-orange: #A855F7;
  --footer-red:    #EC4899;
}

.stream-footer {
  padding: 4rem 2rem 3rem;
  display: flex;
  justify-content: center;
}

.footer-card {
  background-color: var(--bg-color);
  width: 100%;
  max-width: 405px;
  min-height: 60px;
  padding: 1.5rem 1.75rem;
  cursor: pointer;
  border: 3px solid var(--text-active);
  box-shadow:
    10px -10px 0 -3px var(--bg-color), 10px -10px 0 0 var(--footer-green),
    20px -20px 0 -3px var(--bg-color), 20px -20px 0 0 var(--footer-yellow),
    30px -30px 0 -3px var(--bg-color), 30px -30px 0 0 var(--footer-orange),
    40px -40px 0 -3px var(--bg-color), 40px -40px 0 0 var(--footer-red);
}

.footer-card:hover {
  animation: footer-shadow-wave 1s ease infinite;
}

@keyframes footer-shadow-wave {
  0% {
    border-color: var(--text-active);
    box-shadow:
      10px -10px 0 -3px var(--bg-color), 10px -10px 0 0 var(--footer-green),
      20px -20px 0 -3px var(--bg-color), 20px -20px 0 0 var(--footer-yellow),
      30px -30px 0 -3px var(--bg-color), 30px -30px 0 0 var(--footer-orange),
      40px -40px 0 -3px var(--bg-color), 40px -40px 0 0 var(--footer-red);
  }
  20% {
    border-color: var(--footer-red);
    box-shadow:
      10px -10px 0 -3px var(--bg-color), 10px -10px 0 0 var(--text-active),
      20px -20px 0 -3px var(--bg-color), 20px -20px 0 0 var(--footer-green),
      30px -30px 0 -3px var(--bg-color), 30px -30px 0 0 var(--footer-yellow),
      40px -40px 0 -3px var(--bg-color), 40px -40px 0 0 var(--footer-orange);
  }
  40% {
    border-color: var(--footer-orange);
    box-shadow:
      10px -10px 0 -3px var(--bg-color), 10px -10px 0 0 var(--footer-red),
      20px -20px 0 -3px var(--bg-color), 20px -20px 0 0 var(--text-active),
      30px -30px 0 -3px var(--bg-color), 30px -30px 0 0 var(--footer-green),
      40px -40px 0 -3px var(--bg-color), 40px -40px 0 0 var(--footer-yellow);
  }
  60% {
    border-color: var(--footer-yellow);
    box-shadow:
      10px -10px 0 -3px var(--bg-color), 10px -10px 0 0 var(--footer-orange),
      20px -20px 0 -3px var(--bg-color), 20px -20px 0 0 var(--footer-red),
      30px -30px 0 -3px var(--bg-color), 30px -30px 0 0 var(--text-active),
      40px -40px 0 -3px var(--bg-color), 40px -40px 0 0 var(--footer-green);
  }
  80% {
    border-color: var(--footer-green);
    box-shadow:
      10px -10px 0 -3px var(--bg-color), 10px -10px 0 0 var(--footer-yellow),
      20px -20px 0 -3px var(--bg-color), 20px -20px 0 0 var(--footer-orange),
      30px -30px 0 -3px var(--bg-color), 30px -30px 0 0 var(--footer-red),
      40px -40px 0 -3px var(--bg-color), 40px -40px 0 0 var(--text-active);
  }
  100% {
    border-color: var(--text-active);
    box-shadow:
      10px -10px 0 -3px var(--bg-color), 10px -10px 0 0 var(--footer-green),
      20px -20px 0 -3px var(--bg-color), 20px -20px 0 0 var(--footer-yellow),
      30px -30px 0 -3px var(--bg-color), 30px -30px 0 0 var(--footer-orange),
      40px -40px 0 -3px var(--bg-color), 40px -40px 0 0 var(--footer-red);
  }
}

.footer-card .footer-cta {
  font-family: var(--font-headings);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-active);
  margin-bottom: 0.5rem;
  letter-spacing: 0.3px;
}

.footer-card p {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-body);
}

/* Connect Section Styles */
.connect-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.connect-content {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.connect-subtitle {
  font-size: 1rem;
  color: var(--text-body);
  line-height: 1.8;
  max-width: 600px;
}

.contact-methods {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  padding: 1.5rem;
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  transition: var(--transition-smooth);
}

.contact-item:hover {
  background-color: var(--card-hover-bg);
  border-color: var(--card-hover-border);
  transform: translateY(-2px);
}

.contact-item i {
  font-size: 1.8rem;
  color: var(--text-active);
  margin-top: 0.25rem;
  flex-shrink: 0;
}

.contact-item h4 {
  font-family: var(--font-headings);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-lead);
  margin-bottom: 0.5rem;
}

.contact-item a,
.contact-item p {
  color: var(--text-body);
  font-size: 0.95rem;
  text-decoration: none;
  transition: var(--transition-smooth);
}

.contact-item a:hover {
  color: var(--text-active);
}

.social-connect {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.social-connect h3 {
  font-family: var(--font-headings);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-lead);
}

.social-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}

.social-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.5rem 1rem;
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text-lead);
  transition: var(--transition-smooth);
  font-family: var(--font-headings);
  font-size: 0.9rem;
  font-weight: 500;
}

.social-button:hover {
  background-color: var(--card-hover-bg);
  border-color: var(--text-active);
  color: var(--text-active);
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(95, 229, 229, 0.15);
}

.social-button i {
  font-size: 1.5rem;
}

/* ── MODAL POPUP STYLES ── */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--modal-overlay-bg);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(4px);
}
.modal-overlay.active {
  display: flex;
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background-color: var(--bg-color);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-strong);
  animation: slideUp 0.3s ease-out;
  position: relative;
}

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

.modal-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: var(--text-lead);
  font-size: 1.5rem;
  cursor: pointer;
  transition: var(--transition-smooth);
  z-index: 10;
}

.modal-close:hover {
  color: var(--text-active);
  transform: scale(1.1);
}

.modal-header {
  padding: 2rem 2rem 1rem;
  border-bottom: 1px solid var(--card-border);
}

.modal-header h2 {
  font-family: var(--font-headings);
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--text-lead);
  margin-bottom: 0.5rem;
}

.modal-header p {
  color: var(--text-body);
  font-size: 0.95rem;
}

.modal-body {
  padding: 2rem;
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 2rem;
}

.contact-info-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.contact-info-section h3,
.contact-form-section h3 {
  font-family: var(--font-headings);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-lead);
  margin-bottom: 0.75rem;
}

.contact-intro {
  color: var(--text-body);
  line-height: 1.7;
  max-width: 38rem;
}

.contact-cards {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 1rem;
}

.contact-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.5rem;
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  text-align: left;
  transition: var(--transition-smooth);
  text-decoration: none;
}

.contact-card:hover {
  background-color: var(--card-hover-bg);
  border-color: var(--text-active);
  transform: translateY(-2px);
}

.contact-card i {
  font-size: 1.6rem;
  color: var(--text-active);
  background: rgba(59, 130, 246, 0.12);
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
}

.contact-card h4 {
  font-family: var(--font-headings);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-lead);
  margin: 0;
}

.contact-card p {
  color: var(--text-body);
  font-size: 0.95rem;
  margin: 0;
}

.contact-form-section {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-field label {
  font-family: var(--font-headings);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-lead);
}

.form-field input,
.form-field textarea {
  width: 100%;
  border-radius: 14px;
  background-color: var(--input-bg, rgba(255, 255, 255, 0.9));
  border: 1px solid var(--input-border, rgba(148, 163, 184, 0.26));
  color: var(--text-body);
  padding: 0.95rem 1rem;
  font-family: var(--font-content);
  font-size: 0.95rem;
  transition: var(--transition-smooth);
}

.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--text-active);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

.form-actions {
  display: flex;
  justify-content: flex-start;
}

.form-actions .theme-toggle-btn {
  padding: 0.95rem 1.5rem;
  border-radius: 14px;
  border: 1px solid transparent;
  background-color: var(--button-bg);
  color: var(--button-foreground);
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.form-actions .theme-toggle-btn:hover {
  transform: translateY(-1px);
}

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

@media (min-width: 993px) {
  .contact-form-section {
    border-left: 1px solid var(--card-border);
    padding-left: 1.5rem;
  }
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.contact-form input,
.contact-form textarea {
  font-family: var(--font-content);
  padding: 0.85rem 1rem;
  background-color: rgba(95, 229, 229, 0.06);
  border: 1px solid var(--card-border);
  border-radius: 0px;
  color: var(--text-lead);
  font-size: 0.95rem;
  transition: var(--transition-smooth);
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--text-active);
  background-color: rgba(95, 229, 229, 0.12);
  box-shadow: 0 0 10px rgba(95, 229, 229, 0.2);
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: var(--text-body);
}

.submit-btn {
  padding: 0.95rem 2rem;
  background-color: transparent;
  color: var(--button-bg);
  border: 1px solid var(--button-bg);
  border-radius: 8px;
  font-family: var(--font-headings);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.25s ease, color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
  margin-top: 0.5rem;
}

.submit-btn:hover {
  background-color: var(--button-bg);
  color: var(--button-foreground);
  border-color: var(--button-bg);
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(95, 229, 229, 0.2);
}

.submit-btn:active {
  transform: translateY(0);
}

.submit-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

/* ── CONTACT FORM STATUS MESSAGES ── */
.form-status {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.form-status--success {
  background: rgba(62, 207, 142, 0.12);
  border: 1px solid rgba(62, 207, 142, 0.4);
  color: #3ecf8e;
}

.form-status--error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
}

/* ── ANIMATED CONTACT FORM INPUTS ── */
.cf-input-container {
  position: relative;
  width: 100%;
  /* Reserve space above each field for the floating label */
  padding-top: 18px;
}

.cf-input {
  width: 100%;
  padding: 10px 12px;
  height: 44px;
  border: 2px solid var(--card-border);
  border-top: none;
  border-bottom: none;
  font-size: 0.95rem;
  font-family: var(--font-content);
  background: rgba(95, 229, 229, 0.04);
  color: var(--text-lead);
  outline: none;
  box-shadow: 6px 6px 0px 0px var(--text-active);
  transition: box-shadow 0.45s ease, background 0.45s ease;
  border-radius: 0;
}

.cf-input:focus {
  box-shadow: none;
  background: rgba(95, 229, 229, 0.09);
  transition: box-shadow 0.45s ease, background 0.45s ease;
}

.cf-textarea {
  height: auto;
  resize: vertical;
  min-height: 110px;
  padding-top: 14px;
}

.cf-label {
  position: absolute;
  /* Sits in the padding-top zone above the input */
  top: 0;
  left: 12px;
  font-family: var(--font-headings);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-active);
  transition: all 0.45s ease;
  /* Hidden by default — slides in from slightly below on focus */
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  white-space: nowrap;
}

/* Top animated border line */
.cf-topline {
  position: absolute;
  background-color: var(--text-active);
  width: 0%;
  height: 2px;
  right: 0;
  /* Sits at the top of the actual input (below the padding-top zone) */
  top: 18px;
  transition: width 0.45s ease;
}

/* Bottom animated border line */
.cf-underline {
  position: absolute;
  background-color: var(--text-active);
  width: 0%;
  height: 2px;
  right: 0;
  bottom: 0;
  transition: width 0.45s ease;
}

/* Focus triggers */
.cf-input-container .cf-input:focus ~ .cf-topline {
  width: 35%;
}

.cf-input-container .cf-input:focus ~ .cf-underline {
  width: 100%;
}

.cf-input-container .cf-input:focus ~ .cf-label {
  opacity: 1;
  transform: translateY(0);
}

/* Light theme overrides */
[data-theme="light"] .cf-input {
  border-color: var(--card-border);
  background: rgba(59, 130, 246, 0.04);
  color: var(--text-lead);
  box-shadow: 6px 6px 0px 0px var(--text-active);
}

[data-theme="light"] .cf-input:focus {
  background: rgba(59, 130, 246, 0.08);
  box-shadow: none;
}

[data-theme="light"] .cf-topline,
[data-theme="light"] .cf-underline {
  background-color: var(--text-active);
}

[data-theme="light"] .cf-label {
  color: var(--text-active);
}

/* ── RESPONSIVE ADAPTABILITY MATRIX ── */
@media (max-width: 992px) {
  .split-container {
    grid-template-columns: 1fr;
  }
  .left-sidebar {
    position: relative;
    height: auto;
    padding: 4rem 2rem 2rem;
  }
  .indicator-nav {
    display: none;
  }
  .right-content-stream {
    padding: 2rem 2rem 4rem;
  }
  .mobile-section-header {
    display: block;
    font-family: var(--font-headings);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-lead);
    margin-bottom: 2rem;
    position: sticky;
    top: 0;
    width: 100%;
    background: var(--bg-color);
    padding: 1rem 0;
    text-align: center;
    z-index: 100;
    transition: background var(--transition-smooth);
  }
  .contact-form-section {
    border-left: none;
    border-top: 1px solid var(--card-border);
    padding-left: 0;
    padding-top: 1.5rem;
    margin-top: 1.5rem;
  }
  .section-title {
    display: none;
  }
  .sidebar-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    padding-top: 1.5rem;
  }

  .utility-row {
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 1rem;
  }

  .cv-download-link {
    text-align: center;
  }

  .social-uplinks {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
  }
}

@media (max-width: 576px) {
  .timeline-item-card {
    grid-template-columns: 1fr;
    padding: 1rem;
  }
  .time-column {
    margin-bottom: 0.5rem;
  }
}

/* ── FEATURED PROJECTS — HORIZONTAL LIST LAYOUT ── */
.projects-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0 -1.5rem; /* bleed out so hover bg spans full width */
}

/* Each row */
.proj-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 1.5rem;
  padding: 1.5rem;
  border-radius: 14px;
  text-decoration: none !important;
  cursor: pointer;
  transition: background-color var(--transition-smooth), box-shadow var(--transition-smooth);
  position: relative;
}

.proj-row:hover {
  background-color: var(--card-hover-bg);
  box-shadow: 0 4px 32px rgba(95, 229, 229, 0.07);
}

/* Thumbnail box */
.proj-thumb {
  display: flex;
  align-items: flex-start;
  padding-top: 0.15rem;
}

.proj-thumb-inner {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  color: var(--text-active);
  transition: border-color var(--transition-smooth), background-color var(--transition-smooth);
  overflow: hidden;
}

.proj-thumb-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 7px;
}

.proj-row:hover .proj-thumb-inner {
  border-color: var(--text-active);
  background-color: rgba(95, 229, 229, 0.06);
}

/* Detail column */
.proj-details {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.proj-year {
  font-family: var(--font-headings);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-active);
  opacity: 0.75;
}

.proj-title {
  font-family: var(--font-headings);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-lead);
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: color var(--transition-smooth);
}

.proj-row:hover .proj-title {
  color: var(--text-active);
}

.proj-link-icon {
  font-size: 0.75rem;
  opacity: 0;
  transform: translate(-3px, 3px);
  transition: var(--transition-smooth);
}

.proj-row:hover .proj-link-icon {
  opacity: 1;
  transform: translate(0, 0);
}

.proj-desc {
  color: var(--text-body);
  font-size: 0.9rem;
  line-height: 1.65;
  margin: 0;
}

.proj-row .card-pills {
  margin-top: 0.25rem;
}

/* Strip link underlines inside projects list */
.projects-list a,
.proj-row,
.proj-row h3,
.proj-row p,
.proj-row span,
.proj-row i {
  text-decoration: none !important;
}

@media (max-width: 768px) {
  .projects-list {
    margin: 0 -1rem;
  }
  .proj-row {
    grid-template-columns: 90px 1fr;
    gap: 1rem;
    padding: 1.1rem 1rem;
  }
}

/* ── SCROLL-TO-TOP & FLOATING UTILITIES ── */
.scroll-top {
  position: fixed;
  right: 24px;
  bottom: 72px;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--text-lead);
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 220ms ease, transform 220ms ease, background 220ms ease;
  z-index: 1200;
}
.scroll-top i {
  font-size: 1rem;
}
.scroll-top.show {
  opacity: 1;
  transform: translateY(0);
}

.floating-theme-toggle {
  position: fixed;
  right: 24px;
  bottom: 18px;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--text-lead);
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease;
  z-index: 1199;
}
.floating-theme-toggle i { font-size: 1rem; }

@media (max-width: 992px) {
  .scroll-top {
    right: 16px;
    bottom: 70px;
    width: 44px;
    height: 44px;
  }
  .floating-theme-toggle {
    right: 16px;
    bottom: 16px;
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 600px) {
  .scroll-top {
    right: calc(12px + env(safe-area-inset-right, 0px));
    bottom: calc(68px + env(safe-area-inset-bottom, 0px));
    width: 44px;
    height: 44px;
  }
  .floating-theme-toggle {
    right: calc(12px + env(safe-area-inset-right, 0px));
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 992px) {
  #themeToggle { display: none; }
}

/* 1. Register the custom angle variable at the root level */
@property --border-angle {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}

/* ── PROJECTS VIEW MORE ACTION SYSTEM (Sparkle Button — Uiverse.io by JkHuger, recolored) ── */
.projects-action-row {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: 2.5rem;
}

.sp {
  position: relative;
}

.sparkle-button {
  --active: 0;
  --bg: radial-gradient(
      40% 50% at center 100%,
      color-mix(in srgb, var(--text-active) calc(var(--active) * 60%), transparent),
      transparent
    ),
    radial-gradient(
      80% 100% at center 120%,
      color-mix(in srgb, var(--text-active) calc(var(--active) * 45%), transparent),
      transparent
    ),
    color-mix(in srgb, var(--text-active) calc(var(--active) * 20%), var(--card-bg));
  background: var(--bg);

  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.95rem 2.25rem;

  color: var(--text-lead);
  font-family: var(--font-headings);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none !important;
  cursor: pointer;
  white-space: nowrap;

  position: relative;
  border: 2px solid transparent;
  border-radius: 100px;
  background-clip: padding-box;

  box-shadow: 0 0 calc(var(--active) * 3em) calc(var(--active) * 1em) color-mix(in srgb, var(--text-active) 65%, transparent),
    0 0 0 0 transparent inset;
  scale: calc(1 + (var(--active) * 0.06));
  transition: box-shadow var(--transition-smooth), scale var(--transition-smooth),
    background var(--transition-smooth), color var(--transition-smooth);
  z-index: 1;
}

.sparkle-button:active {
  scale: 1;
}

/* ── RUNNING LIGHT STRIP ── */
.sparkle-button::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 102px;
  padding: 2px;

  background: conic-gradient(
    from var(--border-angle),
    transparent 0deg,
    var(--text-active) 20deg,
    transparent 40deg
  );

  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;

  animation: sharpClockwiseSpin 2.5s linear infinite;
  opacity: 0.85;
  transition: opacity var(--transition-smooth);
  z-index: -1;
}

.sparkle-button:hover::before,
.sparkle-button:focus-visible::before {
  opacity: 1;
  background: conic-gradient(
    from var(--border-angle),
    transparent 0deg,
    var(--text-active) 25deg,
    transparent 50deg
  );
}

/* ── SOLID INTERIOR FILL ── */
.backdrop {
  position: absolute;
  inset: 2px;
  background: var(--bg);
  border-radius: 100px;
  transition: background var(--transition-smooth);
}

/* ── HOVER EFFECTS ── */
.sparkle-button:is(:hover, :focus-visible) {
  --active: 1;
  --play-state: running;
  color: var(--button-foreground) !important;
  transform: translateY(-2px);
}

.sparkle-button:is(:hover, :focus-visible) ~ :is(.bodydrop, .particle-pen) {
  --active: 1;
  --play-state: running;
}

@supports (selector(:has(:is(+ *)))) {
  body:has(.sparkle-button:is(:hover, :focus-visible)) {
    --active: 1;
  }
  .bodydrop { display: none; }
}

/* ── SPARKLE ICON ── */
.sparkle-button .sparkle {
  inline-size: 1.15em;
  translate: -10% -2%;
}

.sparkle path {
  color: var(--text-active);
  transform-box: fill-box;
  transform-origin: center;
  fill: currentColor;
  stroke: currentColor;
  animation-delay: calc((var(--transition-smooth) * 1.5) + (var(--delay) * 1s));
  animation-duration: 0.6s;
  transition: color var(--transition-smooth);
}

.sparkle-button:is(:hover, :focus-visible) path {
  animation-name: sparkleBounce;
}

@keyframes sparkleBounce {
  35%, 65% { scale: var(--scale); }
}

.sparkle path:nth-of-type(1) { --scale: 0.5; --delay: 0.1; }
.sparkle path:nth-of-type(2) { --scale: 1.5; --delay: 0.2; }
.sparkle path:nth-of-type(3) { --scale: 2.5; --delay: 0.35; }

/* ── PARTICLE BURST ── */
.particle-pen {
  position: absolute;
  width: 200%;
  aspect-ratio: 1;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  -webkit-mask: radial-gradient(white, transparent 65%);
  mask: radial-gradient(white, transparent 65%);
  z-index: -1;
  opacity: var(--active, 0);
  transition: opacity var(--transition-smooth);
  pointer-events: none;
}

.particle {
  fill: var(--text-active);
  width: calc(var(--size, 0.25) * 1rem);
  aspect-ratio: 1;
  position: absolute;
  top: calc(var(--y, 50) * 1%);
  left: calc(var(--x, 50) * 1%);
  opacity: var(--alpha, 1);
  animation: particleFloatOut calc(var(--duration, 1.6) * 1s) calc(var(--delay, 0) * -1s) infinite linear;
  transform-origin: var(--origin-x, 1000%) var(--origin-y, 1000%);
  z-index: -1;
  animation-play-state: var(--play-state, paused);
}

.particle path {
  fill: var(--text-active);
  stroke: none;
}

.particle:nth-of-type(even) {
  animation-direction: reverse;
}

/* Distribute particles around the button without inline style duplication */
.particle-pen .particle:nth-of-type(1)  { --x: 10; --y: 20; --duration: 1.4; --delay: 0.1; --size: 0.35; }
.particle-pen .particle:nth-of-type(2)  { --x: 85; --y: 15; --duration: 1.8; --delay: 0.4; --size: 0.25; }
.particle-pen .particle:nth-of-type(3)  { --x: 30; --y: 80; --duration: 1.5; --delay: 0.7; --size: 0.3; }
.particle-pen .particle:nth-of-type(4)  { --x: 70; --y: 85; --duration: 2.1; --delay: 0.2; --size: 0.2; }
.particle-pen .particle:nth-of-type(5)  { --x: 50; --y: 10; --duration: 1.7; --delay: 0.9; --size: 0.28; }
.particle-pen .particle:nth-of-type(6)  { --x: 15; --y: 55; --duration: 1.3; --delay: 0.5; --size: 0.22; }
.particle-pen .particle:nth-of-type(7)  { --x: 90; --y: 55; --duration: 2.3; --delay: 0.15; --size: 0.32; }
.particle-pen .particle:nth-of-type(8)  { --x: 40; --y: 35; --duration: 1.9; --delay: 0.6; --size: 0.24; }
.particle-pen .particle:nth-of-type(9)  { --x: 60; --y: 65; --duration: 1.6; --delay: 0.3; --size: 0.26; }
.particle-pen .particle:nth-of-type(10) { --x: 20; --y: 90; --duration: 2.0; --delay: 0.8; --size: 0.2; }
.particle-pen .particle:nth-of-type(11) { --x: 78; --y: 30; --duration: 1.45; --delay: 1.0; --size: 0.3; }
.particle-pen .particle:nth-of-type(12) { --x: 5;  --y: 70; --duration: 1.85; --delay: 0.45; --size: 0.27; }
.particle-pen .particle:nth-of-type(13) { --x: 95; --y: 75; --duration: 1.55; --delay: 0.65; --size: 0.23; }

@keyframes particleFloatOut {
  to { rotate: 360deg; }
}

/* ── BUTTON LABEL ── */
.sparkle-button .text {
  translate: 0 -2%;
  letter-spacing: 0.01ch;
  background: linear-gradient(
    90deg,
    var(--text-lead),
    color-mix(in srgb, var(--text-lead) 70%, transparent)
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  transition: background var(--transition-smooth);
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .projects-action-row {
    margin-top: 1.75rem;
  }
  .sp {
    width: 100%;
  }
  .sparkle-button {
    width: 100%;
    justify-content: center;
  }
}

/* ── SPIN KEYFRAME ENGINE ── */
@keyframes sharpClockwiseSpin {
  from { --border-angle: 0deg; }
  to   { --border-angle: 360deg; }
}

/* ==========================================================================
   PROJECT ICON LINK LABEL (Default Dark Mode: Text is White)
   ========================================================================== */

.project-link-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-headings);
  font-size: 0.80rem;
  font-weight: 350;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  
  /* Fallback: white color if variable setup isn't active in dark mode */
  color: var(--text-color, var(--text-main, #ffffff)); 
  
  width: fit-content;
  text-decoration: none !important; 
  cursor: pointer;                  
  
  transition: transform 0.2s ease-in-out, color 0.2s ease-in-out, text-shadow 0.2s ease-in-out; 
}

/* Hover Effect (Triggers ONLY when hovering directly over the text) */
.project-link-label:hover {
  color: var(--text-lead);
  transform: scale(1.05); 
  text-shadow: 0 0 8px rgba(95, 229, 229, 0.45);
}

/* ==========================================================================
   LIGHT MODE OVERRIDES (Forces text to Black when theme switches)
   ========================================================================== */

body.light-theme .project-link-label,
body.light .project-link-label,
[data-theme="light"] .project-link-label {
  color: #000000;
}


/* ==========================================================================
   LIGHT MODE OVERRIDES (Forces text to Black when theme switches)
   ========================================================================== */

/* Hook 1: If your site adds a .light-theme or .light class to the body */
body.light-theme .project-link-label,
body.light .project-link-label {
  color: #000000;
}

/* Hook 2: If your site uses a data attribute like data-theme="light" on the html/body */
[data-theme="light"] .project-link-label {
  color: #000000;
}


/* ── GLOBAL FORCE-RESET FOR REMOVING CARD LINK UNDERLINES ── */
.projects-stream a,
.project-stream-card,
.project-stream-card h3,
.project-stream-card p,
.project-stream-card span,
.project-stream-card i {
  text-decoration: none !important;
  text-decoration-line: none !important;
  outline: none !important;
}

/* ── NEW: IDLE CONTINUOUS BREATHING KEYFRAME ARRAY ── */
@keyframes continuousIdleBreathe {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-4px) scale(1.02); /* Subtle floating breathing motion */
  }
}

/* ── SPRING BOUNCE HOVER KEYFRAME MATRIX ── */
@keyframes dynamicSquishBounce {
  0% {
    transform: scale(1) translateY(0);
  }
  30% {
    transform: scale(1.12, 0.85) translateY(0); /* Compresses horizontally onto baseline */
  }
  50% {
    transform: scale(0.9, 1.15) translateY(-8px); /* Explodes upward, stretching vertically */
  }
  70% {
    transform: scale(1.05, 0.95) translateY(1px); /* Catches landing with a tiny squish */
  }
  100% {
    transform: scale(1) translateY(0); /* Returns safely to absolute rest */
  }
}

/* ============================================================
   LOADING SCREEN
   ============================================================ */

/* ── LOADING SCREEN ── */
.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background-color: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.7s ease, visibility 0.7s ease;
}

[data-theme="light"] .loading-screen {
  background-color: #eef4ff;
}

.loading-screen.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-content {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── SVG PETAL LOADER ── */
.loader {
  --fill-color: #5fe5e5;
  --shine-color: rgba(95, 229, 229, 0.2);
  width: 120px;
  height: 120px;
  position: relative;
  filter: drop-shadow(0 0 18px var(--shine-color));
}

[data-theme="light"] .loader {
  --fill-color: #1d4ed8;
  --shine-color: rgba(29, 78, 216, 0.25);
}

.loader svg {
  width: 100px;
  height: 100px;
}

.loader #pegtopone {
  position: absolute;
  animation: flowe-one 1s linear infinite;
}

.loader #pegtoptwo {
  position: absolute;
  opacity: 0;
  transform: scale(0) translateY(-200px) translateX(-100px);
  animation: flowe-two 1s linear infinite;
  animation-delay: 0.3s;
}

.loader #pegtopthree {
  position: absolute;
  opacity: 0;
  transform: scale(0) translateY(-200px) translateX(100px);
  animation: flowe-three 1s linear infinite;
  animation-delay: 0.6s;
}

.loader svg g path:first-child {
  fill: var(--fill-color);
}

@keyframes flowe-one {
  0%   { transform: scale(0.5) translateY(-200px); opacity: 0; }
  25%  { transform: scale(0.75) translateY(-100px); opacity: 1; }
  50%  { transform: scale(1) translateY(0px); opacity: 1; }
  75%  { transform: scale(0.5) translateY(50px); opacity: 1; }
  100% { transform: scale(0) translateY(100px); opacity: 0; }
}

@keyframes flowe-two {
  0%   { transform: scale(0.5) rotateZ(-10deg) translateY(-200px) translateX(-100px); opacity: 0; }
  25%  { transform: scale(1) rotateZ(-5deg) translateY(-100px) translateX(-50px); opacity: 1; }
  50%  { transform: scale(1) rotateZ(0deg) translateY(0px) translateX(-25px); opacity: 1; }
  75%  { transform: scale(0.5) rotateZ(5deg) translateY(50px) translateX(0px); opacity: 1; }
  100% { transform: scale(0) rotateZ(10deg) translateY(100px) translateX(25px); opacity: 0; }
}

@keyframes flowe-three {
  0%   { transform: scale(0.5) rotateZ(10deg) translateY(-200px) translateX(100px); opacity: 0; }
  25%  { transform: scale(1) rotateZ(5deg) translateY(-100px) translateX(50px); opacity: 1; }
  50%  { transform: scale(1) rotateZ(0deg) translateY(0px) translateX(25px); opacity: 1; }
  75%  { transform: scale(0.5) rotateZ(-5deg) translateY(50px) translateX(0px); opacity: 1; }
  100% { transform: scale(0) rotateZ(-10deg) translateY(100px) translateX(-25px); opacity: 0; }
}

/* ── LOADING BAR + PERCENT (below SVG) ── */
.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.loading-bar-wrap {
  width: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

.loading-bar-track {
  width: 100%;
  height: 2px;
  background: rgba(255, 255, 255, 0.15);
  position: relative;
  border-radius: 2px;
}

[data-theme="light"] .loading-bar-track {
  background: rgba(15, 23, 42, 0.15);
}

.loading-bar-fill {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  width: 0%;
  background: var(--fill-color, #5fe5e5);
  border-radius: 2px;
  transition: width 0.05s linear;
}

[data-theme="light"] .loading-bar-fill {
  background: #1d4ed8;
}

.loading-percent {
  font-family: var(--font-headings, 'Space Grotesk', sans-serif);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--text-body, #94a3b8);
}

[data-theme="light"] .loading-percent {
  color: #475569;
}

@keyframes loadFadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   STACKED PROJECT CARDS — 3D HOVER EFFECT
   ========================================================================== */

/* Wrapper per group */
.proj-stack-wrapper {
  margin-bottom: 3.5rem;
}

/* Group label */
.proj-stack-label {
  font-family: var(--font-headings);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-active);
  margin-bottom: 1.1rem;
  padding-left: 2px;
  opacity: 0.85;
}

/* The <ul> — 3D perspective stage */
.proj-stack {
  position: relative;
  list-style: none;
  padding: 0;
  margin: 0;
  transform-style: preserve-3d;
  perspective: 600px;
  display: flex;
  flex-direction: column;
  gap: 0;
  transition: gap 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.proj-stack:hover {
  gap: 16px;
}

/* Each <li> card */
.proj-stack > li {
  list-style: none;
  border-radius: 14px;
  transition:
    transform  500ms cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity    400ms ease,
    filter     400ms ease;
  transition-delay: calc(var(--i) * 55ms);
  cursor: pointer;
}

/* Collapsed stacked depth positions */
.proj-stack > li:nth-child(1) {
  transform: translateZ(-80px) translateY(22px);
  opacity: 0.5;
  filter: blur(3px);
}
.proj-stack > li:nth-child(2) {
  opacity: 0.75;
  filter: blur(1.5px);
}
.proj-stack > li:nth-child(3) {
  transform: translateZ(60px) translateY(-28px);
}
.proj-stack > li:nth-child(4) {
  transform: translateZ(120px) translateY(-62px);
  filter: blur(1px);
}

/* Hover → fan out flat */
.proj-stack:hover > li {
  opacity: 1;
  filter: blur(0);
  transform: translateZ(0) translateY(0);
}

/* Inner anchor — the visible card surface */
.proj-stack-inner {
  display: flex;
  align-items: flex-start;
  gap: 1.1rem;
  padding: 1.1rem 1.25rem;
  text-decoration: none !important;
  color: inherit;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  box-shadow: var(--card-shadow);
  transition: background var(--transition-smooth),
              border-color var(--transition-smooth),
              box-shadow var(--transition-smooth);
}

.proj-stack-inner:hover {
  background: var(--card-hover-bg);
  border-color: var(--text-active);
  box-shadow: 0 4px 32px rgba(95, 229, 229, 0.10);
}

/* Icon badge */
.proj-stack-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--surface-glow);
  border: 1px solid var(--card-border);
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  color: var(--text-active);
  transition: transform var(--transition-smooth);
}

.proj-stack-inner:hover .proj-stack-icon {
  transform: scale(1.1) rotate(-4deg);
  background: rgba(95, 229, 229, 0.15);
}

/* Details block */
.proj-stack-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

/* Inherit existing proj-title hover colour */
.proj-stack-inner:hover .proj-title {
  color: var(--text-active);
}

.proj-stack-inner:hover .proj-link-icon {
  opacity: 1;
  transform: translate(0, 0);
}

/* Strip all underlines inside stacks */
.proj-stack a,
.proj-stack h3,
.proj-stack p,
.proj-stack span,
.proj-stack i {
  text-decoration: none !important;
}

/* Light theme */
[data-theme="light"] .proj-stack-inner:hover {
  box-shadow: 0 4px 32px rgba(59, 130, 246, 0.12);
}

/* Mobile — disable depth, show flat list */
@media (max-width: 768px) {
  .proj-stack {
    gap: 14px !important;
    perspective: none;
  }
  .proj-stack > li {
    transform: none !important;
    opacity: 1 !important;
    filter: none !important;
    transition: none;
  }
  .proj-stack-wrapper {
    margin-bottom: 2rem;
  }
}
/* ── TOAST NOTIFICATION ── */
.cf-toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 300px;
  max-width: 380px;
  padding: 16px 18px;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  transform: translateY(20px) scale(0.97);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.cf-toast--visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.cf-toast--success {
  background: rgba(20, 30, 24, 0.92);
  border: 1px solid rgba(62, 207, 142, 0.45);
}

.cf-toast--error {
  background: rgba(30, 18, 18, 0.92);
  border: 1px solid rgba(239, 68, 68, 0.45);
}

[data-theme="light"] .cf-toast--success {
  background: rgba(240, 255, 248, 0.96);
  border-color: rgba(62, 207, 142, 0.5);
}

[data-theme="light"] .cf-toast--error {
  background: rgba(255, 242, 242, 0.96);
  border-color: rgba(239, 68, 68, 0.5);
}

.cf-toast__icon {
  font-size: 1.1rem;
  font-weight: 700;
  margin-top: 1px;
  flex-shrink: 0;
}

.cf-toast--success .cf-toast__icon { color: #3ecf8e; }
.cf-toast--error   .cf-toast__icon { color: #f87171; }

.cf-toast__body {
  flex: 1;
  min-width: 0;
}

.cf-toast__title {
  margin: 0 0 3px;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.3;
}

.cf-toast--success .cf-toast__title { color: #3ecf8e; }
.cf-toast--error   .cf-toast__title { color: #f87171; }

.cf-toast__msg {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text-secondary, #a0a0b0);
}

[data-theme="light"] .cf-toast__msg {
  color: #555;
}

.cf-toast__close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0;
  color: var(--text-secondary, #a0a0b0);
  opacity: 0.7;
  flex-shrink: 0;
  margin-top: -1px;
  transition: opacity 0.2s;
}

.cf-toast__close:hover { opacity: 1; }

@media (max-width: 480px) {
  .cf-toast {
    bottom: 16px;
    right: 16px;
    left: 16px;
    min-width: unset;
    max-width: unset;
  }
}