/* ====== Design Tokens ====== */
/*
 * CSS Custom Properties for consistent theming
 * These variables define the color palette, spacing, and animation values
 * used throughout the site for easy maintenance and theming
 */
:root {
  /* Default Theme - Dark cyan */
  --bg: #0b0d12;           /* Primary background - deep dark blue */
  --bg-soft: #0f131b;      /* Softer background for cards/overlays */
  --text: #e8eefc;         /* Primary text color - light blue-white */
  --muted: #a6b1c9;        /* Secondary text - muted blue-gray */
  --accent: #6bf0ff;       /* Primary accent - bright cyan */
  --accent-2: #a87bff;     /* Secondary accent - purple for gradients */
  --card: #121826;         /* Card background - slightly lighter than bg */
  --line: #1b2232;         /* Border/divider color - subtle gray-blue */

  /* Layout & Effects */
  --radius: 18px;          /* Standard border radius for consistent rounding */
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);        /* Default shadow */
  --shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.4);   /* Enhanced hover shadow */

  /* Animation & Transitions */
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);      /* Fast smooth transition */
  --transition-slow: all 0.6s cubic-bezier(0.4, 0, 0.2, 1); /* Slow reveal transition */

  /* Typography */
  --font-mono: ui-monospace, 'SF Mono', 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
}

/* Orange Theme */
[data-theme="orange"] {
  --bg: #1a0f0a;
  --bg-soft: #1f1108;
  --text: #fff5e6;
  --muted: #d4b896;
  --accent: #ff8c42;
  --accent-2: #ff6b35;
  --card: #2a1810;
  --line: #3d2418;
}

/* Purple Theme */
[data-theme="purple"] {
  --bg: #120a1a;
  --bg-soft: #16081f;
  --text: #f5e6ff;
  --muted: #c496d4;
  --accent: #a855f7;
  --accent-2: #8b5cf6;
  --card: #1e1028;
  --line: #2e1838;
}

/* Green Theme */
[data-theme="green"] {
  --bg: #0a1a0f;
  --bg-soft: #081f11;
  --text: #e6fff0;
  --muted: #96d4a8;
  --accent: #10b981;
  --accent-2: #059669;
  --card: #102818;
  --line: #183828;
}

/* Pink Theme */
[data-theme="pink"] {
  --bg: #1a0a14;
  --bg-soft: #1f0819;
  --text: #ffe6f5;
  --muted: #d496c4;
  --accent: #ec4899;
  --accent-2: #db2777;
  --card: #281020;
  --line: #381830;
}

/* Red Theme */
[data-theme="red"] {
  --bg: #1a0a0a;
  --bg-soft: #1f0808;
  --text: #ffe6e6;
  --muted: #d49696;
  --accent: #ef4444;
  --accent-2: #dc2626;
  --card: #281010;
  --line: #381818;
}

/* Blue Theme */
[data-theme="blue"] {
  --bg: #0a0f1a;
  --bg-soft: #08111f;
  --text: #e6f0ff;
  --muted: #96a8d4;
  --accent: #3b82f6;
  --accent-2: #2563eb;
  --card: #101828;
  --line: #182838;
}

/* Yellow Theme */
[data-theme="yellow"] {
  --bg: #1a1a0a;
  --bg-soft: #1f1f08;
  --text: #ffffe6;
  --muted: #d4d496;
  --accent: #eab308;
  --accent-2: #ca8a04;
  --card: #282810;
  --line: #383818;
}

/* Teal Theme */
[data-theme="teal"] {
  --bg: #0a1a1a;
  --bg-soft: #081f1f;
  --text: #e6ffff;
  --muted: #96d4d4;
  --accent: #14b8a6;
  --accent-2: #0d9488;
  --card: #102828;
  --line: #183838;
}

/* Indigo Theme */
[data-theme="indigo"] {
  --bg: #0f0a1a;
  --bg-soft: #11081f;
  --text: #f0e6ff;
  --muted: #a896d4;
  --accent: #6366f1;
  --accent-2: #4f46e5;
  --card: #181028;
  --line: #281838;
}

/* Emerald Theme */
[data-theme="emerald"] {
  --bg: #0a1a0f;
  --bg-soft: #081f11;
  --text: #e6fff0;
  --muted: #96d4a8;
  --accent: #059669;
  --accent-2: #047857;
  --card: #102818;
  --line: #183828;
}

/* Rose Theme */
[data-theme="rose"] {
  --bg: #1a0a0f;
  --bg-soft: #1f0811;
  --text: #ffe6f0;
  --muted: #d496a8;
  --accent: #f43f5e;
  --accent-2: #e11d48;
  --card: #281018;
  --line: #381828;
}

/* ====== Global Reset & Base Styles ====== */

/* Universal box-sizing for predictable layouts */
*, *::before, *::after {
  box-sizing: border-box;
}

/* Universal theme transition for smooth color changes */
*,
*::before,
*::after {
  transition-property: color, background-color, border-color, box-shadow, opacity;
  transition-duration: 0.6s;
  transition-timing-function: ease;
}

/* Ensure full height is available for layout */
html, body {
  height: 100%;
}

/*
 * Body: Main container styling
 * - Uses system font stack for optimal performance and native feel
 * - Radial gradient background creates depth and visual interest
 * - Enhanced typography rendering for crisp text display
 */
body {
  margin: 0;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Ubuntu, Cantarell, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
  background: radial-gradient(1200px 800px at 70% -10%, #111629 0%, var(--bg) 60%);
  background-attachment: fixed;  /* Keeps background fixed during scroll */
  color: var(--text);
  line-height: 1.65;            /* Optimal reading line height */
  font-feature-settings: 'kern' 1;        /* Enable font kerning */
  text-rendering: optimizeLegibility;     /* Optimize text rendering */
  -webkit-font-smoothing: antialiased;    /* Smooth fonts on Webkit */

  /* Smooth theme transitions */
  transition: background-color 0.6s ease, color 0.6s ease;
}
/* ====== Media & Link Styles ====== */

/*
 * Image styling: Responsive and rounded
 * - max-width ensures images don't overflow containers
 * - height: auto maintains aspect ratio
 * - border-radius uses calculated value for consistency
 */
img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: calc(var(--radius) - 6px);  /* Slightly smaller radius than cards */
}

/*
 * Link styling: Accessible and animated
 * - Uses accent color for brand consistency
 * - Smooth transitions for better UX
 * - Enhanced underlines on hover for clarity
 */
a {
  color: var(--accent);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;    /* Thicker underline for visibility */
  text-underline-offset: 2px;        /* Spacing from text for readability */
}

/* Focus styles for keyboard navigation accessibility */
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ====== Typography ====== */

/*
 * Paragraph styling optimized for readability
 * - 65ch max-width follows optimal line length guidelines
 * - Generous line-height improves reading flow
 */
p {
  margin: 0 0 1.25rem;
  max-width: 65ch;              /* Optimal reading line length */
  line-height: 1.7;
}

/*
 * Heading styles with responsive sizing
 * - Uses clamp() for fluid typography that scales with viewport
 * - Negative letter-spacing improves readability at large sizes
 * - Consistent margins create visual rhythm
 */
h1, h2, h3 {
  line-height: 1.15;            /* Tighter line-height for headings */
  margin: 0 0 0.6rem;
  font-weight: 600;
  letter-spacing: -0.02em;      /* Optical adjustment for better spacing */
}

/* Hero heading: Large, bold, fluid scaling */
h1 {
  font-size: clamp(2.5rem, 2rem + 3.2vw, 4.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;      /* More spacing reduction for large text */
  margin-bottom: 1rem;
}

/* Section headings: Medium size, good hierarchy */
h2 {
  font-size: clamp(1.6rem, 1.4rem + 1.4vw, 2.4rem);
  margin-bottom: 1.5rem;
}

/* Card/component headings: Smaller, consistent */
h3 {
  font-size: 1.2rem;
  font-weight: 600;
}

.small {
  font-size: 0.9rem;
}

.muted {
  color: var(--muted);
}

code {
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.1);
  padding: 0.125em 0.25em;
  border-radius: 4px;
  font-size: 0.9em;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: #000;
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  transition: var(--transition);
}

.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 9999;
}

/* ====== Layout Components ====== */

/*
 * Site Header: Container for hero section
 * - Relative positioning for absolute child elements
 * - Overflow hidden prevents canvas from extending beyond bounds
 * - Bottom border creates section separation
 */
.site-header {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

/* Hero */
.hero {
  position: relative;
  width: 100%;
  min-height: 40vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem;
}

.hero-art {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.6;
}

#mesh {
  width: 100%;
  height: 100%;
  display: block;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  text-align: left;
  width: 100%;
}

.hero-content p {
  font-size: clamp(1rem, 0.9rem + 0.5vw, 1.125rem);
  color: rgba(232, 238, 252, 0.9);
  margin-bottom: 2rem;
  line-height: 1.6;
}

.hero-content h1 {
  line-height: 1.2;
  padding-bottom: 0.4rem;
}
.cta {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

@media (max-width: 600px) {
  .cta {
    flex-direction: column;
    align-items: flex-start;
  }
}
.button {
  display: inline-block;
  padding: 0.7rem 1rem;
  border-radius: 14px;
  background: var(--accent);
  color: #051016;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: var(--shadow);
  transition: var(--transition);
  cursor: pointer;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.button::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transform: translateX(-100%);
  transition: transform 0.6s;
}

.button:hover::before {
  transform: translateX(100%);
}

.button.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

.button.ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--accent);
}

.button:hover {
  transform: translateY(-2px);
  text-decoration: none;
  box-shadow: var(--shadow-hover);
}

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

.button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Sections */
.section {
  max-width: 1100px;
  margin: 3rem auto;
  padding: 2rem 1rem;
}

.section:first-of-type {
  margin-top: 1rem;
}
.grid{display:grid; gap:1rem}
.grid.two{grid-template-columns: 1fr 1.2fr}

/* About section specific layout with floating image */
#about.section {
  /* Use same constraints as other sections for alignment */
  max-width: 1100px;
  margin: 3rem auto;
  padding: 2rem 1rem;
}

.about-content {
  width: 100%;
  /* Natural flow container for text wrapping */
}

.about-content p {
  max-width: none; /* Remove character limit for text wrapping */
}

.about-content h2 {
  max-width: none; /* Remove any width constraints on headings too */
}

.about-content .card.photo {
  float: left;
  width: 320px;
  margin: 0 2rem 1.5rem 0;
  shape-outside: margin-box; /* Better text wrapping */

  /* Remove card styling to match bottom photos */
  background: none;
  border: none;
  padding: 0;
  box-shadow: none;
  transition: var(--transition);
}

.about-content .card.photo:hover {
  /* Match the photo hover effect from bottom gallery */
  transform: translateY(-4px);
  border-color: transparent;
  box-shadow: none;
}

.about-content .card.photo img {
  transition: var(--transition);
}

.about-content .card.photo:hover img {
  transform: scale(1.02);
}

.about-content::after {
  content: "";
  display: table;
  clear: both; /* Clear float after section */
}
.grid.three{grid-template-columns: repeat(3, 1fr)}
@media (max-width: 900px) {
  .grid.two, .grid.three {
    grid-template-columns: 1fr;
  }

  /* About section mobile: stack image and text */
  .about-content .card.photo {
    float: none;
    width: 100%;
    max-width: 320px;
    margin: 0 auto 1.5rem auto;
  }

  .hero {
    padding: 1rem;
  }

  .hero-content {
    max-width: 100%;
  }
}
.stack{display:flex; flex-direction:column; gap:1rem}
.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent), var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  position: relative;
  transition: var(--transition);
  will-change: transform;
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: var(--shadow-hover);
}

.card:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), var(--shadow-hover);
}

/* Only lift project cards on hover */
.project:hover {
  transform: translateY(-2px);
}

.project:focus-within {
  transform: translateY(-2px);
}

/* Don't lift contact cards */
#contact .card:hover,
#contact .card:focus-within {
  transform: none;
}

.project {
  cursor: pointer;
}

.project:hover .chip {
  transform: scale(1.05);
}

.project:hover h3 {
  color: var(--accent);
}
.card h3{margin-bottom:.3rem}
.card .chip {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  font-size: 0.8rem;
  color: #051016;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  padding: 0.25rem 0.6rem;
  border-radius: 12px;
  font-weight: 700;
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(107, 240, 255, 0.3);
}
.facts{padding-left:1rem}
.facts li{margin:.25rem 0}

/* Photos masonry */
.masonry {
  column-count: 3;
  column-gap: 1.5rem;
}

.masonry .shot {
  break-inside: avoid;
  margin: 0 0 1.5rem;
  transition: var(--transition);
}

.masonry .shot:hover {
  transform: translateY(-4px);
}

.masonry .shot img {
  transition: var(--transition);
}

.masonry .shot:hover img {
  transform: scale(1.02);
}

.masonry figcaption {
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 0.5rem;
  padding: 0 0.25rem;
}

@media (max-width: 900px) {
  .masonry {
    column-count: 2;
    column-gap: 1rem;
  }
}

@media (max-width: 600px) {
  .masonry {
    column-count: 1;
  }
}

/* Contact */
form.contact label{display:grid; gap:.4rem; margin:.6rem 0}
input, textarea {
  background: #0c111b;
  color: var(--text);
  border: 1px solid var(--line);
  padding: 0.7rem 0.8rem;
  border-radius: 12px;
  outline: none;
  transition: var(--transition);
  font-family: inherit;
  font-size: inherit;
  width: 100%;
}

input:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(107, 240, 255, 0.15);
}

input::placeholder, textarea::placeholder {
  color: var(--muted);
  opacity: 0.8;
}

textarea {
  resize: vertical;
  min-height: 100px;
}



.contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.contact-list a {
  display: block;
  padding: 0.5rem 0;
  border-bottom: 1px solid transparent;
  transition: var(--transition);
}

.contact-list a:hover {
  border-bottom-color: var(--accent);
  text-decoration: none;
}
.actions{display:flex; align-items:center; gap:.8rem}

/* ====== Theme Switcher Styles ====== */

.theme-switcher {
  display: flex;
  align-items: center;
  margin-top: 2rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: var(--transition);

  /* Desktop: center and gap */
  justify-content: center;
  gap: 0.5rem;

  /* Mobile: horizontal scroll */
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}

/* Hide scrollbar for webkit browsers */
.theme-switcher::-webkit-scrollbar {
  display: none;
}

.theme-block {
  cursor: pointer;
  transition: var(--transition);
  border-radius: calc(var(--radius) - 4px);
  position: relative;
  overflow: hidden;
  flex-shrink: 0; /* Prevent compression on mobile */

  /* Desktop: square blocks */
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
}

.theme-block:hover {
  transform: translateY(-2px);
}

.theme-item {
  border-radius: calc(var(--radius) - 6px);
  transition: var(--transition);
  position: relative;
  overflow: hidden;

  /* Desktop: smaller items inside blocks */
  width: 32px;
  height: 32px;
}

/* Mobile responsive design */
@media (max-width: 768px) {
  .theme-switcher {
    justify-content: flex-start;
    gap: 0;
    padding: 0.5rem;
  }

  .theme-block {
    /* Mobile: fill the height, create bars */
    width: 60px;
    height: 50px;
    border-radius: 0;
  }

  .theme-block:first-child {
    border-radius: calc(var(--radius) - 4px) 0 0 calc(var(--radius) - 4px);
  }

  .theme-block:last-child {
    border-radius: 0 calc(var(--radius) - 4px) calc(var(--radius) - 4px) 0;
  }

  .theme-item {
    /* Mobile: fill the entire block */
    width: 100%;
    height: 100%;
    border-radius: 0;
  }

  .theme-block:first-child .theme-item {
    border-radius: calc(var(--radius) - 6px) 0 0 calc(var(--radius) - 6px);
  }

  .theme-block:last-child .theme-item {
    border-radius: 0 calc(var(--radius) - 6px) calc(var(--radius) - 6px) 0;
  }
}

/* Theme preview colors */
.theme-block[data-theme="default"] .theme-item {
  background: linear-gradient(135deg, #6bf0ff, #a87bff);
}

.theme-block[data-theme="orange"] .theme-item {
  background: linear-gradient(135deg, #ff8c42, #ff6b35);
}

.theme-block[data-theme="purple"] .theme-item {
  background: linear-gradient(135deg, #a855f7, #8b5cf6);
}

.theme-block[data-theme="green"] .theme-item {
  background: linear-gradient(135deg, #10b981, #059669);
}

.theme-block[data-theme="pink"] .theme-item {
  background: linear-gradient(135deg, #ec4899, #db2777);
}

.theme-block[data-theme="red"] .theme-item {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.theme-block[data-theme="blue"] .theme-item {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.theme-block[data-theme="yellow"] .theme-item {
  background: linear-gradient(135deg, #eab308, #ca8a04);
}

.theme-block[data-theme="teal"] .theme-item {
  background: linear-gradient(135deg, #14b8a6, #0d9488);
}

.theme-block[data-theme="indigo"] .theme-item {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
}

.theme-block[data-theme="emerald"] .theme-item {
  background: linear-gradient(135deg, #059669, #047857);
}

.theme-block[data-theme="rose"] .theme-item {
  background: linear-gradient(135deg, #f43f5e, #e11d48);
}

/* Active theme indicator */
.theme-block.active {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.theme-block.active .theme-item {
  transform: scale(1.1);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}

/* Add shine effect to theme items */
.theme-item::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent 50%);
  border-radius: inherit;
}

/* Footer */
.site-footer{border-top:1px solid var(--line); padding:2rem 1rem; text-align:center; color:var(--muted)}

/* ====== Animations & Motion ====== */

/*
 * Shimmer text effect for hero heading
 * - Creates animated gradient that moves across text
 * - Uses background-clip to make gradient visible only on text
 * - Slow 8s animation for subtle, elegant effect
 */
.shimmer {
  background: linear-gradient(90deg, #fff 0%, #bcd6ff 20%, #fff 40%);
  background-size: 200% 100%;         /* Large background for animation */
  -webkit-background-clip: text;      /* Webkit prefix for compatibility */
  background-clip: text;              /* Clip background to text shape */
  color: transparent;                 /* Hide original text color */
  animation: shimmer 8s infinite linear;
}

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

/* Reveal animation for sections */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: var(--transition-slow);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger reveal animation for child elements */
.reveal.visible > * {
  animation: revealChild 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  opacity: 0;
  transform: translateY(10px);
}

.reveal.visible > *:nth-child(1) { animation-delay: 0.1s; }
.reveal.visible > *:nth-child(2) { animation-delay: 0.2s; }
.reveal.visible > *:nth-child(3) { animation-delay: 0.3s; }
.reveal.visible > *:nth-child(4) { animation-delay: 0.4s; }
.reveal.visible > *:nth-child(5) { animation-delay: 0.5s; }

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

/* Flow grid interactive motion */
.flow-grid {
  position: relative;
  perspective: 1000px;
  transform-style: preserve-3d;
}

.flow-grid .project {
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Floating animation for cards */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-5px); }
}

.card.project:hover {
  animation: float 3s ease-in-out infinite;
}

/* Pulse animation for interactive elements */
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(107, 240, 255, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(107, 240, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(107, 240, 255, 0); }
}

.button:focus-visible {
  animation: pulse 1.5s infinite;
}


/* Respect user motion preferences */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .shimmer {
    animation: none;
    background: var(--text);
    -webkit-background-clip: unset;
    background-clip: unset;
    color: var(--text);
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
