/* ============================================================
   Custom Properties
   ============================================================ */
:root {
  --bg:            #04040a;
  --surface:       rgba(19, 19, 32, 0.45);
  --surface-hi:    rgba(26, 26, 46, 0.65);
  --border:        rgba(255, 255, 255, 0.08);
  --border-hi:     rgba(255, 255, 255, 0.16);
  --accent:        #14b8a6;
  --accent-muted:  rgba(20, 184, 166, 0.12);
  --accent-glow:   rgba(20, 184, 166, 0.25);
  --text:          #f4f4f5;
  --text-2:        #94a3b8;
  --text-3:        #475569;
  --radius:        16px;
  --radius-sm:     8px;
  --max-w:         1100px;
  --section-pad:   clamp(80px, 11vw, 136px);
}

/* ============================================================
   Background Effects
   ============================================================ */
.bg-effects {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background: radial-gradient(circle at 50% 0%, rgba(20, 20, 45, 1) 0%, rgba(5, 5, 12, 1) 60%, rgba(0, 0, 0, 1) 100%);
}

#space-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.noise-overlay {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  opacity: 0.06;
  mix-blend-mode: overlay;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: clamp(15px, 1.55vw, 17px);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.nav-open {
  overflow: hidden;
  /* iOS Safari: prevent scroll-under */
  position: fixed;
  width: 100%;
}

h1, h2, h3, h4 {
  font-family: 'Syne', system-ui, sans-serif;
  line-height: 1.15;
  color: var(--text);
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img, svg { display: block; max-width: 100%; }

/* ============================================================
   Custom Cursor
   ============================================================ */
.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 9999;
  border-radius: 50%;
  will-change: transform;
  opacity: 0;
  transition: opacity 0.3s;
}

.cursor-dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  transition:
    opacity 0.3s,
    width 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    height 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    background 0.2s;
}

.cursor-ring {
  width: 36px;
  height: 36px;
  border: 1.5px solid rgba(20, 184, 166, 0.45);
  background: transparent;
  transition:
    opacity 0.3s,
    width 0.28s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    height 0.28s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    background 0.28s,
    border-color 0.28s;
}

/* Visible state */
body.has-custom-cursor .cursor-dot,
body.has-custom-cursor .cursor-ring {
  opacity: 1;
}

/* Hide default cursor everywhere */
body.has-custom-cursor,
body.has-custom-cursor * {
  cursor: none !important;
}

/* Hover over interactive elements */
body.cursor-hover .cursor-dot {
  width: 0;
  height: 0;
  opacity: 0;
}

body.cursor-hover .cursor-ring {
  width: 52px;
  height: 52px;
  border-color: rgba(20, 184, 166, 0.75);
  background: rgba(20, 184, 166, 0.06);
}

/* Click feedback */
body.cursor-clicking .cursor-dot {
  background: #fff;
}

body.cursor-clicking .cursor-ring {
  width: 24px;
  height: 24px;
  border-color: rgba(20, 184, 166, 0.9);
}

/* ============================================================
   Skip Nav
   ============================================================ */
.skip-nav {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 200;
  background: var(--accent);
  color: #000;
  font-family: 'Outfit', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.5rem 1.125rem;
  border-radius: var(--radius-sm);
  transition: top 0.15s;
}
.skip-nav:focus { top: 1rem; }

/* ============================================================
   Navigation
   ============================================================ */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  transition: background 0.35s, border-color 0.35s;
}

.site-header.scrolled {
  background: rgba(11, 11, 18, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 1.375rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  color: var(--accent);
  transition: opacity 0.2s;
}
.nav-logo:hover { opacity: 0.72; }
.nav-logo:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 4px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.nav-link {
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.015em;
  color: var(--text-2);
  transition: color 0.2s;
}
.nav-link:hover { color: var(--text); }
.nav-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 4px;
  color: var(--text);
}

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  z-index: 300;
  position: relative;
}
.nav-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.toggle-bar {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text-2);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.2s, background 0.2s;
}
.nav-toggle:hover .toggle-bar { background: var(--text); }
.nav-toggle[aria-expanded="true"] .toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8rem 2rem 6rem;
  overflow: hidden;
}

/* Subtle grid texture */
.hero-grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.028) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 20%, black 20%, transparent 70%);
  mask-image: radial-gradient(ellipse 80% 60% at 50% 20%, black 20%, transparent 70%);
  pointer-events: none;
}

/* Teal radial glow */
.hero-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 55% 40% at 50% 0%, rgba(20, 184, 166, 0.09) 0%, transparent 65%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 760px;
}

.hero-eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 0.35rem 0.875rem;
  border: 1px solid rgba(20, 184, 166, 0.3);
  border-radius: 100px;
  background: var(--accent-muted);
  margin-bottom: 1.75rem;
}

.hero-name {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: clamp(52px, 9.5vw, 104px);
  letter-spacing: -0.035em;
  line-height: 0.95;
  margin-bottom: 1rem;
  /* gradient text */
  background: linear-gradient(150deg, #ffffff 0%, #9090b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: var(--text); /* fallback */
}

.hero-subtitle {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(1rem, 2vw, 1.3125rem);
  font-weight: 400;
  color: var(--text-2);
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}

.hero-tagline {
  font-size: clamp(0.9375rem, 1.7vw, 1.0625rem);
  color: var(--text-2);
  line-height: 1.6;
  max-width: 500px;
  margin: 0 auto 2.75rem;
}

.hero-cta {
  display: flex;
  gap: 0.875rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--accent);
  color: #000;
  font-family: 'Outfit', sans-serif;
  font-size: 0.9375rem;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  transition: opacity 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
  transition: all 0.3s ease;
  box-shadow: 0 0 0 rgba(20, 184, 166, 0);
}
.btn-primary:hover { 
  opacity: 1; 
  transform: translateY(-2px); 
  box-shadow: 0 8px 30px rgba(255, 255, 255, 0.15), 0 0 15px rgba(191, 219, 254, 0.2);
}
.btn-primary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: transparent;
  color: var(--text-2);
  font-family: 'Outfit', sans-serif;
  font-size: 0.9375rem;
  font-weight: 500;
  padding: 0.75rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: color 0.2s, border-color 0.2s, transform 0.2s;
}
.btn-ghost:hover { color: var(--text); border-color: var(--border-hi); transform: translateY(-2px); }
.btn-ghost:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Scroll indicator */
.hero-scroll-hint {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
}

.scroll-line {
  width: 1px;
  height: 56px;
  background: linear-gradient(to bottom, transparent, var(--text-3));
  animation: scrollPulse 2.2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.25; }
  50%       { opacity: 0.9;  }
}

/* ============================================================
   Sections — shared
   ============================================================ */
.section {
  padding: var(--section-pad) 0;
}

.section-container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
}

.section-header {
  margin-bottom: 3rem;
}

.section-eyebrow {
  display: block;
  font-size: 0.725rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.section-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: clamp(1.75rem, 3.5vw, 2.75rem);
  letter-spacing: -0.025em;
}

.section-subtitle {
  font-size: 0.9375rem;
  color: var(--text-2);
  margin-top: 0.5rem;
}

/* ============================================================
   Scroll Reveal
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .scroll-line { animation: none; }
}

/* ============================================================
   About
   ============================================================ */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 4rem;
  align-items: start;
}

.about-text p {
  color: var(--text-2);
  margin-bottom: 1.25rem;
  font-size: clamp(0.9375rem, 1.55vw, 1.0625rem);
}
.about-text p:last-child { margin-bottom: 0; }

.about-lead {
  color: var(--text) !important;
  font-size: clamp(1.0625rem, 1.9vw, 1.25rem) !important;
  line-height: 1.55 !important;
  margin-bottom: 1.75rem !important;
}

.about-text strong {
  color: var(--text);
  font-weight: 600;
}

.about-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.about-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.375rem 1.5rem;
}

.about-card h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.875rem;
}

.about-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.about-list li {
  font-size: 0.875rem;
  color: var(--text-2);
  padding-left: 1rem;
  position: relative;
}
.about-list li::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--text-3);
  font-size: 0.75rem;
  top: 0.18em;
}

/* Stats card */
.about-card-stats .stats-row {
  display: flex;
  gap: 2rem;
}

.stat {
  display: flex;
  flex-direction: column;
}

.stat-number {
  font-family: 'Syne', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-2);
  margin-top: 0.25rem;
}

/* ============================================================
   Experience
   ============================================================ */
.experience-timeline {
  position: relative;
  padding-left: 2rem;
}

.experience-timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 1px;
  background: linear-gradient(to bottom, var(--accent), var(--border), transparent);
}

.experience-entry {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 2rem;
  padding-bottom: 2.5rem;
  position: relative;
}

.experience-entry:last-child {
  padding-bottom: 0;
}

.experience-entry::before {
  content: '';
  position: absolute;
  left: -2rem;
  top: 0.5rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  transform: translateX(-4px);
}

.experience-date {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-3);
  padding-top: 0.15rem;
  white-space: nowrap;
}

.experience-role {
  font-family: 'Syne', sans-serif;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin-bottom: 0.25rem;
}

.experience-company {
  display: inline-block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 0.625rem;
}

.experience-desc {
  font-size: 0.9rem;
  color: var(--text-2);
  line-height: 1.65;
  margin-bottom: 0.875rem;
}

.experience-entry .project-tags {
  margin-bottom: 0;
}

/* ============================================================
   Projects
   ============================================================ */
.project-group-label {
  font-family: 'Outfit', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 1rem;
  margin-top: 2.5rem;
}

.project-group-label:first-of-type {
  margin-top: 0;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-bottom: 1rem;
}

.projects-grid-featured {
  grid-template-columns: 1.2fr 1fr 1fr;
}

.project-card-wide {
  /* slightly elevated */
}

.project-icon-sm {
  width: 38px;
  height: 38px;
  background: var(--surface-hi);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}

.project-card:hover {
  border-color: var(--border-hi);
  transform: translateY(-4px);
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.45);
}

.project-card-dim {
  opacity: 0.6;
}
.project-card-dim:hover {
  opacity: 0.85;
}

.project-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.project-icon {
  width: 44px;
  height: 44px;
  background: var(--accent-muted);
  border: 1px solid rgba(20, 184, 166, 0.22);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--accent);
}

.project-icon-pkg { color: var(--accent); }
.project-icon-soon { opacity: 0.55; }

/* Status badges */
.project-badge {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border-radius: 100px;
}

.badge-active {
  background: rgba(34, 197, 94, 0.10);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.22);
}

.badge-pkg {
  background: var(--accent-muted);
  color: var(--accent);
  border: 1px solid rgba(20, 184, 166, 0.22);
}

.badge-soon {
  background: rgba(148, 163, 184, 0.08);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.badge-live {
  background: rgba(59, 130, 246, 0.10);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.22);
}

.badge-oss {
  background: rgba(168, 85, 247, 0.10);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.22);
}

.badge-grad {
  background: rgba(251, 191, 36, 0.10);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.22);
}

.project-screenshot {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin-bottom: 1rem;
  transition: transform 0.3s ease;
}

.project-card:hover .project-screenshot {
  transform: scale(1.02);
}

.project-name {
  font-family: 'Syne', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin-bottom: 0.625rem;
}

.project-desc {
  font-size: 0.9rem;
  color: var(--text-2);
  line-height: 1.65;
  flex: 1;
  margin-bottom: 1.25rem;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-bottom: 1.25rem;
}

.project-tags li {
  font-size: 0.725rem;
  font-weight: 500;
  color: var(--text-2);
  background: var(--surface-hi);
  border: 1px solid var(--border);
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  letter-spacing: 0.01em;
}

.project-links {
  display: flex;
  gap: 1.25rem;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-2);
  transition: color 0.2s;
}
.project-link:hover { color: var(--accent); }
.project-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ============================================================
   Skills
   ============================================================ */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem 3rem;
}

.skill-group-label {
  font-family: 'Outfit', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 0.875rem;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skill-tags li {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.375rem 0.875rem;
  border-radius: var(--radius-sm);
  transition: border-color 0.2s, color 0.2s;
}
.skill-tags li:hover {
  border-color: var(--border-hi);
  color: var(--text);
}

/* ============================================================
   Contact
   ============================================================ */
.contact .section-container {
  display: flex;
  justify-content: center;
}

.contact-inner {
  max-width: 580px;
  text-align: center;
}

.contact-heading {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: clamp(2.25rem, 5.5vw, 4rem);
  letter-spacing: -0.035em;
  line-height: 1.05;
  margin: 0.75rem 0 1.25rem;
}

.contact-body {
  font-size: clamp(0.9375rem, 1.6vw, 1.0625rem);
  color: var(--text-2);
  line-height: 1.65;
  margin-bottom: 2.5rem;
}

.contact-links {
  display: flex;
  gap: 0.875rem;
  justify-content: center;
  flex-wrap: wrap;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  transition: color 0.2s, border-color 0.2s, transform 0.2s;
}
.contact-link:hover {
  color: var(--accent);
  border-color: rgba(20, 184, 166, 0.35);
  transform: translateY(-2px);
}
.contact-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.75rem 2rem;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  justify-content: center;
}

.site-footer p {
  font-size: 0.8125rem;
  color: var(--text-3);
}

/* ============================================================
   Hero Phone Mockup
   ============================================================ */

/* ---- Desktop: side-by-side row ---- */
@media (min-width: 900px) {
  .hero {
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: clamp(3rem, 6vw, 6rem);
    padding: 8rem 3rem 6rem;
  }

  /* Constrain text column so phone has breathing room */
  .hero-content {
    max-width: 520px;
    flex-shrink: 0;
  }

  .hero-phone {
    flex-shrink: 0;
    margin-left: 90px;
  }
}

/* ---- Mobile: phone stacks below text ---- */
@media (max-width: 899px) {
  .hero-phone {
    margin-top: 2.5rem;
  }
}

/* ---- Shared: phone container ---- */
.hero-phone {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.phone-wrap {
  position: relative;
  /* 3D perspective applied via JS for parallax; fallback identity */
  transform: perspective(1200px) rotateX(0deg) rotateY(0deg);
  transform-style: preserve-3d;
  will-change: transform;
}

/* ---- Frame ---- */
.phone-frame {
  width: 252px;
  height: 508px;
  border-radius: 40px;
  background: linear-gradient(160deg, #1c1c2e 0%, #0d0d1a 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.10);
  outline: 1px solid rgba(0, 0, 0, 0.6);
  position: relative;
  overflow: hidden;
  /* Floating + glow pulse */
  animation: phone-float 7s ease-in-out infinite, phone-glow 4s ease-in-out infinite;
  /* Teal ambient glow */
  box-shadow:
    0 2px 0 1px rgba(255, 255, 255, 0.05),     /* top edge highlight */
    0 24px 64px rgba(0, 0, 0, 0.7),              /* depth shadow */
    0 0  60px rgba(20, 184, 166, 0.22),          /* near glow */
    0 0 120px rgba(20, 184, 166, 0.12),          /* far glow */
    0 0 200px rgba(20, 184, 166, 0.06);          /* ambient halo */
}

@keyframes phone-float {
  0%, 100% { transform: translateY(0px)   rotate(0deg);   }
  30%       { transform: translateY(-12px) rotate(0.4deg); }
  70%       { transform: translateY(-18px) rotate(-0.3deg); }
}

@keyframes phone-glow {
  0%, 100% {
    box-shadow:
      0 2px 0 1px rgba(255, 255, 255, 0.05),
      0 24px 64px rgba(0, 0, 0, 0.7),
      0 0  60px rgba(20, 184, 166, 0.22),
      0 0 120px rgba(20, 184, 166, 0.12),
      0 0 200px rgba(20, 184, 166, 0.06);
  }
  50% {
    box-shadow:
      0 2px 0 1px rgba(255, 255, 255, 0.05),
      0 24px 64px rgba(0, 0, 0, 0.7),
      0 0  60px rgba(20, 184, 166, 0.36),
      0 0 120px rgba(20, 184, 166, 0.20),
      0 0 220px rgba(20, 184, 166, 0.12);
  }
}

/* Side buttons (volume + power) */
.phone-frame::before {
  content: '';
  position: absolute;
  left: -3px;
  top: 90px;
  width: 3px;
  height: 36px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px 0 0 2px;
  box-shadow: 0 48px 0 rgba(255, 255, 255, 0.12);
}
.phone-frame::after {
  content: '';
  position: absolute;
  right: -3px;
  top: 120px;
  width: 3px;
  height: 60px;
  background: rgba(255, 255, 255, 0.10);
  border-radius: 0 2px 2px 0;
}

/* ---- Dynamic Island ---- */
.phone-island {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 88px;
  height: 24px;
  background: #000;
  border-radius: 100px;
  z-index: 10;
}

/* ---- Screen ---- */
.phone-screen {
  position: absolute;
  inset: 0;
  background: linear-gradient(175deg, #080815 0%, #0a0a18 40%, #080812 100%);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ---- Status bar ---- */
.phone-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 52px 18px 4px;
  font-size: 9px;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.65);
  flex-shrink: 0;
}

.phone-status-icons {
  display: flex;
  align-items: center;
  gap: 5px;
  color: rgba(255, 255, 255, 0.55);
}

/* ---- Chat header ---- */
.chat-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
}

.chat-header-back {
  color: var(--accent);
  flex-shrink: 0;
}

.chat-header-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.35), rgba(20, 184, 166, 0.08));
  border: 1.5px solid rgba(20, 184, 166, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  position: relative;
  flex-shrink: 0;
}

.online-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  border: 1.5px solid #080815;
}

.chat-header-info { flex: 1; min-width: 0; }

.chat-contact-name {
  display: block;
  font-family: 'Syne', sans-serif;
  font-size: 10px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.chat-online-status {
  font-size: 8px;
  color: #4ade80;
  font-weight: 500;
  font-family: 'Outfit', sans-serif;
}

.chat-header-action {
  color: var(--accent);
  opacity: 0.7;
  flex-shrink: 0;
}

/* ---- Chat messages ---- */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  scroll-behavior: smooth;
  scrollbar-width: none;
}
.chat-messages::-webkit-scrollbar { display: none; }

.chat-msg {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  opacity: 0;
}

.chat-msg.msg-out { flex-direction: row-reverse; }

.chat-av {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.3), rgba(20, 184, 166, 0.07));
  border: 1px solid rgba(20, 184, 166, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 7px;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}

.chat-bubble {
  max-width: 74%;
  padding: 6px 9px;
  border-radius: 14px;
  font-size: 9px;
  line-height: 1.45;
  font-family: 'Outfit', sans-serif;
  word-break: break-word;
}

.msg-in .chat-bubble {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.msg-out .chat-bubble {
  background: linear-gradient(135deg, #14b8a6, #0d9488);
  color: #000;
  font-weight: 600;
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 10px rgba(20, 184, 166, 0.28);
}

/* Typing indicator */
.typing-bubble {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 8px 10px;
  min-width: 40px;
}

.typing-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-3);
  flex-shrink: 0;
  animation: typingBounce 1.2s ease-in-out infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

/* ---- Chat input bar ---- */
.chat-input-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
}

.chat-input-field {
  flex: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 100px;
  padding: 5px 11px;
  font-size: 8px;
  color: var(--text-3);
  font-family: 'Outfit', sans-serif;
}

.chat-send-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #0d9488);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
  flex-shrink: 0;
  box-shadow: 0 0 8px rgba(20, 184, 166, 0.35);
}

.phone-home-indicator {
  width: 80px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 100px;
  align-self: center;
  margin: 6px auto 8px;
  flex-shrink: 0;
}

/* ---- Chat animations ---- */
@keyframes msgAppear {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes msgPop {
  0%   { opacity: 0; transform: translateY(6px) scale(0.9); }
  65%  { transform: translateY(-1px) scale(1.025); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30%           { transform: translateY(-4px); }
}

.chat-msg.msg-in.visible:not(.chat-typing) {
  animation: msgAppear 0.35s ease forwards;
}

.chat-msg.msg-out.visible {
  animation: msgPop 0.42s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.chat-typing { transition: opacity 0.25s ease; }
.chat-typing.visible { opacity: 1; }

/* ---- Reduce motion ---- */
@media (prefers-reduced-motion: reduce) {
  .phone-frame  { animation: none; }
  .phone-wrap   { transform: none !important; }
  .typing-dot   { animation: none; }
}

/* ---- Phone sizing: tablet ---- */
@media (max-width: 899px) and (min-width: 640px) {
  .phone-frame {
    width: 218px;
    height: 440px;
  }
  .phone-island { width: 76px; height: 21px; }
}

/* ---- Phone sizing: mobile ---- */
@media (max-width: 639px) {
  .phone-frame {
    width: 192px;
    height: 388px;
    border-radius: 34px;
  }
  .phone-island   { width: 68px; height: 18px; top: 12px; }
  .phone-status-bar { padding-top: 44px; font-size: 8px; }
}

/* ============================================================
   Responsive — 900px
   ============================================================ */
@media (max-width: 900px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .about-sidebar {
    flex-direction: row;
    gap: 1rem;
  }

  .about-card {
    flex: 1;
  }

  .experience-entry {
    grid-template-columns: 160px 1fr;
    gap: 1.5rem;
  }

  .projects-grid,
  .projects-grid-featured {
    grid-template-columns: repeat(2, 1fr);
  }

  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
}

/* ============================================================
   Responsive — 640px (mobile)
   ============================================================ */
@media (max-width: 640px) {
  /* Show hamburger, hide nav links by default */
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    /* Explicit fallback — don't rely on CSS variable for full-screen overlay */
    background: #04040a;
    background: var(--bg, #04040a);
    /* Frosted glass effect */
    backdrop-filter: blur(24px) saturate(1.2);
    -webkit-backdrop-filter: blur(24px) saturate(1.2);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2.5rem;
    z-index: 200;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-link {
    font-size: 1.5rem;
    font-family: 'Syne', sans-serif;
    font-weight: 700;
  }

  .tagline-br { display: none; }

  .experience-entry {
    grid-template-columns: 1fr;
    gap: 0.25rem;
    padding-left: 1rem;
  }

  .experience-timeline {
    padding-left: 1.5rem;
  }

  .experience-entry::before {
    left: -1.5rem;
  }

  .experience-date {
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: 600;
    letter-spacing: 0.02em;
  }

  .projects-grid,
  .projects-grid-featured {
    grid-template-columns: 1fr;
  }

  .about-sidebar {
    flex-direction: column;
  }

  .hero-scroll-hint {
    display: none;
  }
}

/* ============================================================
   Responsive — 480px
   ============================================================ */
@media (max-width: 480px) {
  .nav-container {
    padding: 1rem 1.25rem;
  }

  .section-container {
    padding: 0 1.25rem;
  }

  .skills-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }

  .hero-cta {
    flex-direction: column;
    align-items: center;
  }

  .btn-primary,
  .btn-ghost {
    width: 100%;
    max-width: 260px;
    justify-content: center;
  }
}

/* ============================================================
   Responsive — 380px
   ============================================================ */
@media (max-width: 380px) {
  .skills-grid {
    grid-template-columns: 1fr;
  }
}
    gap: 1.5rem;
  }

  .hero-cta {
    flex-direction: column;
    align-items: center;
  }

  .btn-primary,
  .btn-ghost {
    width: 100%;
    max-width: 260px;
    justify-content: center;
  }
}

/* ============================================================
   Responsive — 380px
   ============================================================ */
@media (max-width: 380px) {
  .skills-grid {
    grid-template-columns: 1fr;
  }
}
