/* Respect the hidden attribute even on elements with a display rule (e.g. .btn). */
[hidden] {
  display: none !important;
}

/* ==========================================================================
   Tokens
   ========================================================================== */
:root {
  color-scheme: dark;

  --bg: #0a0e1a;
  --surface: #111827;
  --surface-2: #161f34;

  --cyan: #06b6d4;
  --violet: #8b5cf6;
  --pink: #ec4899;
  --emerald: #10b981;

  --text: #f9fafb;
  --text-2: #9ca3af;
  --text-3: #6b7280;

  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-fill: rgba(255, 255, 255, 0.045);
  --glass-fill-strong: rgba(255, 255, 255, 0.08);

  --gradient: linear-gradient(120deg, var(--cyan), var(--violet));
  --gradient-2: linear-gradient(120deg, var(--violet), var(--pink));

  --font-head: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --container: 1180px;

  --nav-h: 84px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  scroll-behavior: auto;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  cursor: default;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  margin: 0;
  color: var(--text);
}

p {
  margin: 0;
}

::selection {
  background: var(--cyan);
  color: #06131a;
}

::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--surface-2);
  border-radius: 10px;
  border: 2px solid var(--bg);
}

.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ==========================================================================
   Texture / ambient layers
   ========================================================================== */
.grain {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 500px;
  height: 500px;
  margin: -250px 0 0 -250px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.16), transparent 70%);
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: screen;
  opacity: 1;
  will-change: transform;
  transform: translate(-1000px, -1000px);
  transition: opacity 0.2s ease;
}

@media (max-width: 860px), (hover: none) {
  .cursor-glow { display: none; }
}

/* ==========================================================================
   Custom cursor
   ========================================================================== */
.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 9999;
  will-change: transform;
  transform: translate(-1000px, -1000px);
}

.cursor-dot {
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: var(--cyan);
}

.cursor-ring {
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px;
  border-radius: 50%;
  border: 1.5px solid rgba(6, 182, 212, 0.5);
  transition: width 0.25s var(--ease), height 0.25s var(--ease), margin 0.25s var(--ease), border-color 0.25s var(--ease), background 0.25s var(--ease);
}

.cursor-ring.is-link {
  width: 64px;
  height: 64px;
  margin: -32px 0 0 -32px;
  background: rgba(6, 182, 212, 0.08);
  border-color: var(--cyan);
}

body.has-cursor .cursor-dot,
body.has-cursor .cursor-ring {
  opacity: 1;
}

.cursor-dot,
.cursor-ring {
  opacity: 0;
  transition: opacity 0.2s ease, width 0.25s var(--ease), height 0.25s var(--ease), margin 0.25s var(--ease), border-color 0.25s var(--ease), background 0.25s var(--ease);
}

@media (max-width: 860px), (hover: none) {
  .cursor-dot, .cursor-ring { display: none; }
}

/* ==========================================================================
   Preloader
   ========================================================================== */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.preloader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}

.preloader-mark {
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 6px;
  color: var(--text-2);
}

.preloader-bar {
  width: 200px;
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
}

.preloader-bar-fill {
  width: 0%;
  height: 100%;
  background: var(--gradient);
}

.preloader-count {
  font-family: var(--font-head);
  font-size: 13px;
  color: var(--text-3);
  letter-spacing: 1px;
}

/* ==========================================================================
   Layout helpers
   ========================================================================== */
.section {
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(70px, 10vw, 140px) 24px;
}

.section-head {
  max-width: 640px;
  margin-bottom: clamp(40px, 6vw, 72px);
}

.section-kicker {
  display: inline-block;
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 14px;
}

.section-title {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.15;
}

.section-sub {
  margin-top: 14px;
  color: var(--text-2);
  font-size: 16px;
  line-height: 1.7;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 28px;
  border-radius: 14px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  isolation: isolate;
}

.btn i {
  font-size: 13px;
}

.btn-primary {
  color: #06131a;
  background: var(--gradient);
}

.btn-primary span,
.btn-primary i {
  position: relative;
  z-index: 1;
}

.btn-ghost {
  color: var(--text);
  border: 1.5px solid var(--glass-border);
  background: var(--glass-fill);
}

.btn-copy {
  color: #06131a;
}

/* ==========================================================================
   Nav
   ========================================================================== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 500;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  transition: transform 0.5s var(--ease), background 0.4s ease, border-color 0.4s ease;
  border-bottom: 1px solid transparent;
}

.nav.is-scrolled {
  background: rgba(10, 14, 26, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom-color: var(--glass-border);
}

.nav.is-hidden {
  transform: translateY(-100%);
}

.nav-inner {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.nav-logo {
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 700;
}

.nav-logo .dot {
  color: var(--cyan);
}

.nav-links {
  position: relative;
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 6px;
}

.nav-links a {
  position: relative;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  transition: color 0.3s ease;
  z-index: 1;
}

.nav-links a.is-active,
.nav-links a:hover {
  color: var(--text);
}

.nav-indicator {
  position: absolute;
  top: 6px;
  left: 6px;
  height: calc(100% - 12px);
  width: 0;
  border-radius: 20px;
  background: var(--glass-fill-strong);
  border: 1px solid var(--glass-border);
  transition: transform 0.4s var(--ease), width 0.4s var(--ease), opacity 0.3s ease;
  opacity: 0;
  pointer-events: none;
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  border: 1.5px solid var(--glass-border);
  background: var(--glass-fill);
  white-space: nowrap;
}

.nav-cta i {
  font-size: 11px;
}

.nav-burger {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
}

.nav-burger span {
  width: 20px;
  height: 1.5px;
  background: var(--text);
  transition: transform 0.3s var(--ease), opacity 0.3s ease;
}

.nav-burger.is-open span:first-child {
  transform: translateY(3.75px) rotate(45deg);
}
.nav-burger.is-open span:last-child {
  transform: translateY(-3.75px) rotate(-45deg);
}

@media (max-width: 780px) {
  .nav-links, .nav-cta { display: none; }
  .nav-burger { display: flex; }
}

/* Mobile menu */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(10, 14, 26, 0.98);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px;
  transform: translateY(-100%);
  opacity: 0;
  transition: transform 0.5s var(--ease), opacity 0.4s ease;
  pointer-events: none;
}

.mobile-menu.is-open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.mobile-menu-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mobile-menu-links a {
  font-family: var(--font-head);
  font-size: clamp(32px, 10vw, 48px);
  font-weight: 700;
  color: var(--text);
  padding: 10px 0;
  opacity: 0;
  transform: translateY(24px);
}

.mobile-menu.is-open .mobile-menu-links a {
  animation: menuLinkIn 0.6s var(--ease) forwards;
}

.mobile-menu.is-open .mobile-menu-links a:nth-child(1) { animation-delay: 0.08s; }
.mobile-menu.is-open .mobile-menu-links a:nth-child(2) { animation-delay: 0.15s; }
.mobile-menu.is-open .mobile-menu-links a:nth-child(3) { animation-delay: 0.22s; }
.mobile-menu.is-open .mobile-menu-links a:nth-child(4) { animation-delay: 0.29s; }

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

.mobile-menu-footer {
  margin-top: 40px;
  color: var(--text-2);
  font-size: 15px;
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: calc(var(--nav-h) + 20px) 24px 100px;
}

.aurora {
  position: absolute;
  inset: 0;
  z-index: 0;
  filter: blur(80px);
  opacity: 0.55;
}

.aurora-blob {
  position: absolute;
  border-radius: 50%;
  will-change: transform;
}

.aurora-blob.b1 {
  width: 46vw;
  height: 46vw;
  max-width: 620px;
  max-height: 620px;
  top: -10%;
  left: -8%;
  background: radial-gradient(circle at 30% 30%, var(--violet), transparent 70%);
}

.aurora-blob.b2 {
  width: 40vw;
  height: 40vw;
  max-width: 560px;
  max-height: 560px;
  bottom: -15%;
  right: -6%;
  background: radial-gradient(circle at 60% 40%, var(--cyan), transparent 70%);
}

.aurora-blob.b3 {
  width: 30vw;
  height: 30vw;
  max-width: 420px;
  max-height: 420px;
  top: 35%;
  left: 40%;
  background: radial-gradient(circle at 50% 50%, var(--pink), transparent 70%);
  opacity: 0.6;
}

.hero-grid {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 40%, transparent 90%);
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 780px;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--text-2);
  padding: 8px 16px;
  border: 1px solid var(--glass-border);
  background: var(--glass-fill);
  border-radius: 30px;
  margin-bottom: 28px;
}

.eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.hero-title {
  font-size: clamp(52px, 11vw, 118px);
  font-weight: 800;
  letter-spacing: -3px;
  line-height: 0.98;
}

.hero-title .line {
  display: block;
  overflow: hidden;
  padding: 0 4px;
}

.hero-title .line span {
  display: inline-block;
  will-change: transform;
}

.hero-title .line:first-child {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  background-size: 200% 100%;
}

.hero-tagline {
  margin-top: 26px;
  font-family: var(--font-head);
  font-size: clamp(14px, 1.6vw, 18px);
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.3px;
}

.hero-bio {
  margin-top: 18px;
  max-width: 560px;
  color: var(--text-2);
  font-size: 16px;
  line-height: 1.75;
}

.hero-actions {
  margin-top: 40px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.scroll-cue {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-3);
  z-index: 1;
  animation: scrollCue 2.4s ease-in-out infinite;
}

@keyframes scrollCue {
  0%, 100% { transform: translate(-50%, 0); opacity: 0.6; }
  50% { transform: translate(-50%, 8px); opacity: 1; }
}

/* ==========================================================================
   Stats
   ========================================================================== */
.stats {
  border-top: 1px solid var(--glass-border);
  border-bottom: 1px solid var(--glass-border);
  background: linear-gradient(180deg, transparent, rgba(139, 92, 246, 0.035), transparent);
}

.stats-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 56px 24px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.stat {
  text-align: center;
}

.stat-value {
  font-family: var(--font-head);
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stat-label {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-2);
  letter-spacing: 0.3px;
}

@media (max-width: 700px) {
  .stats-inner { grid-template-columns: repeat(2, 1fr); }
}

/* ==========================================================================
   Reveal
   ========================================================================== */
.reveal-item,
.reveal-child {
  opacity: 0;
  transform: translateY(36px);
}

.reveal-ready .reveal-item,
.reveal-ready .reveal-child {
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease), filter 0.8s var(--ease);
}

/* .reveal-group is only an IntersectionObserver trigger — it stays visible
   itself while its direct .reveal-child elements animate in with a stagger */
.reveal-group {
  opacity: 1;
  transform: none;
}

/* ==========================================================================
   Marquee (tech stack)
   ========================================================================== */
.marquee-wrap {
  display: flex;
  flex-direction: column;
  gap: 18px;
  mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
}

.marquee-row {
  display: flex;
  width: max-content;
  gap: 16px;
  will-change: transform;
}

.marquee-row.dir-right {
  animation: marqueeRight 70s linear infinite;
}
.marquee-row.dir-left {
  animation: marqueeLeft 70s linear infinite;
}

.marquee-wrap:hover .marquee-row {
  animation-play-state: paused;
}

@keyframes marqueeLeft {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@keyframes marqueeRight {
  from { transform: translateX(-50%); }
  to { transform: translateX(0); }
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  background: var(--glass-fill);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
  transition: border-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

.pill:hover {
  border-color: var(--cyan);
  color: var(--text);
  transform: translateY(-2px);
}

.pill i {
  font-size: 15px;
  color: var(--cyan);
  width: 16px;
  text-align: center;
}

.pill .pill-cat {
  color: var(--text-3);
  font-size: 11px;
  border-left: 1px solid var(--glass-border);
  padding-left: 10px;
  margin-left: 2px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ==========================================================================
   Projects
   ========================================================================== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

@media (max-width: 820px) {
  .projects-grid { grid-template-columns: 1fr; }
}

.project-card {
  position: relative;
  border-radius: 24px;
  border: 1px solid var(--glass-border);
  background: var(--glass-fill);
  padding: 28px 28px 0;
  overflow: hidden;
  cursor: pointer;
  isolation: isolate;
  will-change: transform;
}

.project-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  z-index: -1;
  border-radius: 24px;
  opacity: 0;
  padding: 1px;
  background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 50%), var(--cyan), transparent 60%);
  transition: opacity 0.4s ease;
}

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

.project-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.project-card-cat {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--cyan);
}

.project-card-title {
  margin-top: 10px;
  font-size: 24px;
  font-weight: 700;
}

.project-card-desc {
  margin-top: 10px;
  color: var(--text-2);
  font-size: 14.5px;
  line-height: 1.65;
  max-width: 90%;
}

.project-card-link {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  transition: transform 0.35s var(--ease), background 0.35s ease, color 0.35s ease, border-color 0.35s ease;
}

.project-card:hover .project-card-link {
  background: var(--gradient);
  color: #06131a;
  border-color: transparent;
  transform: rotate(45deg);
}

.project-card-tags {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-card-tags span {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-3);
  border: 1px solid var(--glass-border);
  padding: 5px 10px;
  border-radius: 20px;
}

.project-card-media {
  margin-top: 26px;
  position: relative;
  height: 220px;
  border-radius: 18px 18px 0 0;
  overflow: hidden;
  background: var(--surface);
}

.project-card-media img {
  position: absolute;
  top: 14px;
  left: 50%;
  width: 128px;
  border-radius: 14px;
  border: 4px solid #0d1424;
  box-shadow: 0 20px 50px -12px rgba(0, 0, 0, 0.6);
  transition: transform 0.6s var(--ease);
}

.project-card-media img:nth-child(1) { transform: translate(-135%, 26px) rotate(-9deg); z-index: 1; }
.project-card-media img:nth-child(2) { transform: translate(-50%, 0) rotate(0deg); z-index: 2; }
.project-card-media img:nth-child(3) { transform: translate(35%, 26px) rotate(9deg); z-index: 1; }

.project-card:hover .project-card-media img:nth-child(1) { transform: translate(-150%, 14px) rotate(-13deg); }
.project-card:hover .project-card-media img:nth-child(2) { transform: translate(-50%, -14px) rotate(0deg); }
.project-card:hover .project-card-media img:nth-child(3) { transform: translate(50%, 14px) rotate(13deg); }

/* Single landscape screenshot (desktop / terminal apps). */
.project-card-media.is-wide img {
  width: 86%;
  top: 22px;
  border-radius: 10px;
  transform: translate(-50%, 0);
}
.project-card:hover .project-card-media.is-wide img { transform: translate(-50%, -10px); }

.project-card-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, var(--bg) 100%);
}

/* ==========================================================================
   Process timeline
   ========================================================================== */
.timeline {
  position: relative;
  padding-left: 56px;
}

.timeline-line {
  position: absolute;
  left: 5px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  height: calc(100% - 12px);
  overflow: visible;
}

.timeline-track {
  stroke: var(--glass-border);
  stroke-width: 2;
}

.timeline-progress {
  stroke: var(--cyan);
  stroke-width: 2;
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
}

.timeline-steps {
  display: flex;
  flex-direction: column;
  gap: 54px;
}

.timeline-step {
  position: relative;
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.timeline-num {
  position: absolute;
  left: -56px;
  top: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-3);
  transition: border-color 0.4s ease, color 0.4s ease, box-shadow 0.4s ease;
}

.timeline-step.is-active .timeline-num {
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: 0 0 0 6px rgba(6, 182, 212, 0.12);
}

.timeline-icon {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  background: var(--glass-fill);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--violet);
}

.timeline-body h3 {
  font-size: 21px;
  font-weight: 700;
  margin-bottom: 8px;
}

.timeline-body p {
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.7;
  max-width: 560px;
}

/* ==========================================================================
   Contact
   ========================================================================== */
.contact {
  padding-top: clamp(40px, 6vw, 80px);
}

.contact-card {
  position: relative;
  text-align: center;
  padding: clamp(48px, 8vw, 90px) 24px;
  border-radius: 32px;
  border: 1px solid var(--glass-border);
  background: var(--glass-fill);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.contact-glow {
  position: absolute;
  width: 60%;
  height: 260px;
  top: -100px;
  left: 20%;
  background: radial-gradient(ellipse, rgba(139, 92, 246, 0.28), transparent 70%);
  filter: blur(40px);
  z-index: 0;
}

.contact-card > * {
  position: relative;
  z-index: 1;
}

.contact .section-title {
  margin-top: 4px;
}

.contact .section-sub {
  max-width: 480px;
}

.contact-actions {
  margin-top: 36px;
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.social-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--glass-fill);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  color: var(--text-2);
  transition: color 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}

.social-icon:hover {
  color: var(--cyan);
  border-color: var(--cyan);
  background: rgba(6, 182, 212, 0.1);
}

.copy-toast {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translate(-50%, 12px);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--emerald);
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 8px 16px;
  border-radius: 30px;
  opacity: 0;
  transition: opacity 0.35s ease, transform 0.35s ease;
  pointer-events: none;
  z-index: 2;
}

.copy-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  max-width: var(--container);
  margin: 0 auto;
  padding: 36px 24px 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-3);
  font-size: 13.5px;
}

.scroll-top {
  position: relative;
  width: 44px;
  height: 44px;
}

.scroll-top svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.scroll-top-track {
  fill: none;
  stroke: var(--glass-border);
  stroke-width: 2;
}

.scroll-top-progress {
  fill: none;
  stroke: var(--cyan);
  stroke-width: 2;
  stroke-dasharray: 126;
  stroke-dashoffset: 126;
  transition: stroke-dashoffset 0.1s linear;
}

.scroll-top i {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--text-2);
}

/* ==========================================================================
   Magnetic
   ========================================================================== */
[data-magnetic] {
  will-change: transform;
}

/* ==========================================================================
   Modal
   ========================================================================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.modal.is-open {
  visibility: visible;
  opacity: 1;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 9, 17, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.modal-panel {
  position: relative;
  width: min(1000px, 100%);
  max-height: 88vh;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: 26px;
  display: grid;
  /* minmax(0, …): a column never grows past its share for wide content. */
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  transform: scale(0.92) translateY(20px);
  opacity: 0;
  transition: transform 0.45s var(--ease), opacity 0.4s ease;
}

.modal.is-open .modal-panel {
  transform: scale(1) translateY(0);
  opacity: 1;
}

@media (max-width: 820px) {
  .modal-panel { grid-template-columns: 1fr; max-height: 92vh; }
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 5;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(10, 14, 26, 0.6);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  backdrop-filter: blur(8px);
}

.modal-gallery {
  position: relative;
  background: #05070d;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 360px;
}

.modal-gallery-track {
  display: flex;
  width: 100%;
  height: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.modal-gallery-track::-webkit-scrollbar {
  display: none;
}

.modal-gallery-track img {
  flex: 0 0 100%;
  scroll-snap-align: center;
  width: 100%;
  height: 100%;
  min-height: 360px;
  /* Never taller than the panel, so the whole phone stays in view. */
  max-height: 88vh;
  object-fit: contain;
  padding: 30px 60px;
}

.modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(10, 14, 26, 0.6);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  backdrop-filter: blur(8px);
}

.modal-prev { left: 14px; }
.modal-next { right: 14px; }

.modal-dots {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 4;
}

.modal-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  transition: background 0.3s ease, transform 0.3s ease;
}

.modal-dots span.is-active {
  background: var(--cyan);
  transform: scale(1.3);
}

.modal-info {
  padding: 40px 36px;
  overflow-y: auto;
}

.modal-info h3 {
  font-size: 26px;
  font-weight: 700;
  margin: 8px 0 14px;
}

.modal-info p {
  color: var(--text-2);
  font-size: 14.5px;
  line-height: 1.75;
}

.modal-features {
  margin-top: 26px;
}

.modal-features h4 {
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 12px;
}

.modal-features ul {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.modal-features li {
  position: relative;
  padding-left: 20px;
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.6;
}

.modal-features li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 7px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
}

.modal-tech {
  margin-top: 26px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.modal-tech span {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  border: 1px solid var(--glass-border);
  padding: 6px 12px;
  border-radius: 20px;
}

.modal-info .btn {
  margin-top: 30px;
}

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

/* ==========================================================================
   Small screens
   ========================================================================== */
@media (max-width: 560px) {
  .hero-title { letter-spacing: -2px; }
  .project-card-media img { width: 104px; }
  .modal-info { padding: 28px 22px; }
}
