:root {
    --ink: #0A0A0B;
    --void: #000000;
    --neon: #7F5AF0;
    --text: #EDEDF0;
    --font-display: "Space Grotesk", sans-serif;
    --font-body: "Manrope", sans-serif;
    --font-mono: "JetBrains Mono", monospace;
  }

  * { box-sizing: border-box; }

  html { scroll-behavior: smooth; }

  body {
    margin: 0;
    background-color: var(--void);
    color: var(--text);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
    word-break: keep-all;
  }

  ::selection { background: rgba(127, 90, 240, 0.35); color: #fff; }

  a { text-decoration: none; color: inherit; }
  button { font-family: inherit; cursor: pointer; }

  /* ── Ambient background layers ───────────────────────────── */
  .bg-field {
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background:
      radial-gradient(60vw 60vw at 78% -10%, rgba(127,90,240,0.20), transparent 60%),
      radial-gradient(50vw 50vw at 8% 18%, rgba(90,130,240,0.12), transparent 60%),
      radial-gradient(70vw 50vw at 50% 120%, rgba(127,90,240,0.10), transparent 60%),
      var(--ink);
  }
  .bg-grid {
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background-image:
      linear-gradient(to right, rgba(255,255,255,0.035) 1px, transparent 1px),
      linear-gradient(to bottom, rgba(255,255,255,0.035) 1px, transparent 1px);
    background-size: 64px 64px;
    -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black, transparent 80%);
    mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black, transparent 80%);
  }
  .bg-noise {
    position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  }

  /* ── Glassmorphism ───────────────────────────────────────── */
  .glass {
    background: rgba(255,255,255,0.045);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    border: 1px solid rgba(255,255,255,0.09);
  }

  /* ── Layout helpers ──────────────────────────────────────── */
  #content { position: relative; z-index: 10; }
  .wrap { margin: 0 auto; padding-left: 1.5rem; padding-right: 1.5rem; }
  .mx-5xl { max-width: 64rem; }
  .mx-6xl { max-width: 72rem; }
  .mx-4xl { max-width: 56rem; }

  /* ── Logo ────────────────────────────────────────────────── */
  .logo { display: inline-flex; align-items: center; gap: 0.5rem; user-select: none; }
  .logo-mark {
    position: relative; display: inline-flex; align-items: center; justify-content: center;
    filter: drop-shadow(0 3px 9px rgba(255,0,122,0.35));
  }
  .logo-mark .ico { display: inline-flex; }
  .logo-glyph { display: block; }
  .logo-word {
    font-family: var(--font-display); font-weight: 700;
    letter-spacing: -0.02em; font-size: 17px; color: #fff;
  }
  .logo-word .tld {
    background: linear-gradient(135deg,#7000FF,#FF007A);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
  }

  /* ── Typography utility ──────────────────────────────────── */
  .mono-label {
    font-family: var(--font-mono); font-size: 0.75rem; color: var(--neon);
    text-transform: uppercase; letter-spacing: 0.3em;
  }

  /* ── Gradient shimmer title ──────────────────────────────── */
  @keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
  .grad-text {
    background: linear-gradient(92deg, #FFFFFF 0%, #C9BBFF 38%, #7F5AF0 64%, #FFFFFF 100%);
    background-size: 200% auto;
    -webkit-background-clip: text; background-clip: text;
    color: transparent;
    animation: shimmer 7s linear infinite;
  }

  /* ── Reveal on scroll ────────────────────────────────────── */
  @keyframes floatUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
  .reveal { opacity: 0; }
  .reveal.in { animation: floatUp 0.9s cubic-bezier(0.22,1,0.36,1) forwards; }

  /* ── Pulsing live dot ────────────────────────────────────── */
  @keyframes pulseDot { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.35; transform: scale(0.8); } }
  .live-dot { animation: pulseDot 1.8s ease-in-out infinite; }

  /* ── Hero ────────────────────────────────────────────────── */
  .hero { position: relative; padding-top: 7rem; padding-bottom: 5rem; }
  .badge {
    display: inline-flex; align-items: center; gap: 0.5rem;
    border-radius: 9999px; padding: 0.375rem 0.875rem;
    font-size: 0.75rem; color: rgba(255,255,255,0.6); font-family: var(--font-mono);
  }
  .badge .dot { width: 6px; height: 6px; border-radius: 9999px; background: #3EE6A0; }
  .hero h1 {
    margin: 1.75rem 0 0; font-family: var(--font-display); font-weight: 700;
    letter-spacing: -0.03em; line-height: 0.95;
    font-size: clamp(3rem, 11vw, 7.5rem);
  }
  .hero h1 .white { color: #fff; }
  .hero-sub {
    margin: 2rem 0 0; max-width: 42rem; font-size: 1.125rem;
    color: rgba(255,255,255,0.6); line-height: 1.7;
  }
  .hero-sub .em { color: rgba(255,255,255,0.9); }

  .cta-row { margin-top: 2.5rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
  .btn {
    display: inline-flex; align-items: center; gap: 0.5rem;
    border-radius: 0.75rem; padding: 0.75rem 1.25rem;
    font-weight: 500; transition: transform .15s ease, color .25s ease;
    border: none;
  }
  .btn:active { transform: scale(0.98); }
  .btn-primary {
    color: #fff;
    background: linear-gradient(135deg,#7F5AF0,#5A6BF0);
    box-shadow: 0 12px 34px -10px rgba(127,90,240,0.7);
  }
  .btn-ghost { color: rgba(255,255,255,0.8); }
  .btn-ghost:hover { color: #fff; }

  /* stat strip */
  .stats {
    margin-top: 4rem; display: grid; grid-template-columns: repeat(3, 1fr);
    max-width: 36rem; gap: 1px; border-radius: 1rem; overflow: hidden;
    border: 1px solid rgba(255,255,255,0.08);
  }
  .stat { padding: 1.25rem; background: rgba(255,255,255,0.025); }
  .stat .num { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; color: #fff; }
  .stat .lbl { margin-top: 0.25rem; font-size: 11px; color: rgba(255,255,255,0.45); font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.05em; }

  /* ── Section heads ───────────────────────────────────────── */
  .section { position: relative; padding-top: 5rem; padding-bottom: 5rem; }
  .head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
  .head-row h2 {
    margin: 0.75rem 0 0; font-family: var(--font-display);
    font-size: 2.25rem; font-weight: 600; letter-spacing: -0.02em; color: #fff;
  }
  .head-note { font-size: 0.875rem; color: rgba(255,255,255,0.45); max-width: 20rem; }

  /* ── Project grid ────────────────────────────────────────── */
  .grid {
    margin-top: 2.5rem; display: grid; grid-template-columns: 1fr;
    gap: 1.25rem; grid-auto-rows: 1fr;
  }
  .card {
    width: 100%; height: 100%; text-align: left; display: flex; flex-direction: column;
    position: relative; overflow: hidden; border-radius: 1.5rem; padding: 1.5rem;
    min-height: 240px;
    transition: transform .45s cubic-bezier(.22,1,.36,1), border-color .4s, background .4s;
  }
  .card:hover { transform: translateY(-6px); border-color: rgba(127,90,240,0.45); background: rgba(127,90,240,0.06); }
  .card .accent-glow {
    position: absolute; top: -4rem; right: -4rem; width: 11rem; height: 11rem;
    border-radius: 9999px; filter: blur(48px); opacity: 0; transition: opacity .5s ease;
  }
  .card:hover .accent-glow { opacity: 1; }
  .card-top { position: relative; display: flex; align-items: flex-start; justify-content: space-between; }
  .icon-box {
    display: inline-flex; align-items: center; justify-content: center;
    width: 50px; height: 50px; border-radius: 0.75rem;
  }
  .status-pill {
    display: inline-flex; align-items: center; gap: 0.375rem;
    border-radius: 9999px; padding: 0.25rem 0.625rem; font-size: 11px; font-weight: 500;
  }
  .status-pill .pdot { width: 6px; height: 6px; border-radius: 9999px; }
  .card-body { position: relative; margin-top: 1.25rem; flex: 1; }
  .card-body h3 { margin: 0; font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; color: #fff; letter-spacing: -0.01em; }
  .card-body p { margin: 0.5rem 0 0; color: rgba(255,255,255,0.55); line-height: 1.6; font-size: 0.875rem; }
  .card-foot { position: relative; margin-top: 1.25rem; display: flex; align-items: flex-end; justify-content: space-between; gap: 0.75rem; }
  .tags { display: flex; flex-wrap: wrap; gap: 0.375rem; }
  .tag {
    font-family: var(--font-mono); font-size: 11px; color: rgba(255,255,255,0.45);
    border-radius: 0.375rem; padding: 0.25rem 0.5rem;
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.07);
  }
  .go-btn {
    flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
    width: 2.25rem; height: 2.25rem; border-radius: 9999px; color: rgba(255,255,255,0.6);
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
    transition: color .3s ease;
  }
  .card:hover .go-btn { color: #fff; }

  /* featured card spans / larger copy */
  .card.featured { min-height: 260px; }
  .card.featured .card-body p { font-size: 15px; max-width: 28rem; }

  /* ── Contact ─────────────────────────────────────────────── */
  .contact-card {
    border-radius: 2rem; padding: 2.5rem; text-align: center; position: relative; overflow: hidden;
  }
  .contact-card .blob {
    position: absolute; top: -6rem; left: 50%; transform: translateX(-50%);
    width: 18rem; height: 18rem; border-radius: 9999px; filter: blur(48px);
    background: rgba(127,90,240,0.3);
  }
  .contact-inner { position: relative; }
  .contact-inner h2 {
    margin: 1rem 0 0; font-family: var(--font-display); font-weight: 600;
    font-size: 1.875rem; letter-spacing: -0.02em; color: #fff; line-height: 1.2;
  }
  .contact-inner p { margin: 1.25rem auto 0; color: rgba(255,255,255,0.55); max-width: 28rem; }
  .contact-btns { margin-top: 2rem; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.75rem; }
  .footer-row {
    margin-top: 3.5rem; display: flex; flex-direction: column; align-items: center;
    justify-content: space-between; gap: 1rem; color: rgba(255,255,255,0.35); font-size: 0.875rem;
  }
  .footer-row .copy { font-family: var(--font-mono); font-size: 0.75rem; }

  /* ── Floating nav ────────────────────────────────────────── */
  .floating-nav {
    position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%);
    z-index: 40; width: calc(100% - 2rem); max-width: 36rem; padding: 0 0.5rem;
  }
  .nav-bar {
    border-radius: 1rem; display: flex; align-items: center; justify-content: space-between;
    gap: 0.5rem; padding: 0.625rem 0.75rem;
    box-shadow: 0 20px 50px -16px rgba(0,0,0,0.8);
  }
  .nav-items { display: flex; align-items: center; gap: 0.25rem; overflow-x: auto; }
  .nav-items::-webkit-scrollbar { display: none; }
  .nav-link {
    display: inline-flex; align-items: center; gap: 0.375rem; border-radius: 0.75rem;
    padding: 0.5rem 0.75rem; font-size: 0.875rem; font-weight: 500; white-space: nowrap;
    color: rgba(255,255,255,0.5); border: 1px solid transparent; transition: color .25s ease;
  }
  .nav-link:hover { color: rgba(255,255,255,0.8); }
  .nav-link.active {
    color: #fff; background: rgba(127,90,240,0.18); border: 1px solid rgba(127,90,240,0.4);
  }

  /* ── Redirect overlay ────────────────────────────────────── */
  .overlay {
    position: fixed; inset: 0; z-index: 50; display: none; align-items: center; justify-content: center;
    padding: 1.5rem; background: rgba(0,0,0,0.72); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  }
  .overlay.open { display: flex; }
  .overlay-card {
    border-radius: 1.5rem; width: 100%; max-width: 28rem; padding: 2rem; text-align: center;
    position: relative; box-shadow: 0 30px 80px -20px rgba(127,90,240,0.45);
  }
  .overlay-close {
    position: absolute; top: 1rem; right: 1rem; color: rgba(255,255,255,0.4);
    background: none; border: none; transition: color .25s ease;
  }
  .overlay-close:hover { color: #fff; }
  .overlay-icon {
    margin: 0 auto 1.25rem; display: inline-flex; align-items: center; justify-content: center;
    width: 64px; height: 64px; border-radius: 1rem;
  }
  .overlay-card h3 { margin: 0; font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; color: #fff; }
  .overlay-card .ov-tag { margin: 0.5rem 0 0; font-size: 0.875rem; color: rgba(255,255,255,0.55); line-height: 1.6; padding: 0 0.5rem; }
  .overlay-card .ov-url { margin-top: 1rem; display: inline-flex; align-items: center; gap: 0.5rem; font-family: var(--font-mono); font-size: 0.75rem; color: rgba(255,255,255,0.4); }
  .ov-go {
    margin-top: 1.75rem; width: 100%; display: inline-flex; align-items: center; justify-content: center;
    gap: 0.5rem; border-radius: 0.75rem; padding: 0.875rem; font-weight: 500; color: #fff; border: none;
    background: linear-gradient(135deg,#7F5AF0,#5A6BF0); box-shadow: 0 10px 30px -8px rgba(127,90,240,0.7);
    transition: transform .15s ease;
  }
  .ov-go:active { transform: scale(0.98); }
  .ov-newtab { margin-top: 0.75rem; font-size: 11px; color: rgba(255,255,255,0.3); font-family: var(--font-mono); }
  .ov-loading { padding: 1.5rem 0; }
  .ov-bar { margin: 0 auto 1.25rem; height: 4px; width: 10rem; overflow: hidden; border-radius: 9999px; background: rgba(255,255,255,0.1); }
  .ov-bar > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg,#7F5AF0,#5A6BF0); }
  .ov-bar.run > i { animation: loadbar 1.1s ease forwards; }
  @keyframes loadbar { from { width: 0; } to { width: 100%; } }
  .ov-loading p { font-family: var(--font-mono); font-size: 0.875rem; color: rgba(255,255,255,0.7); margin: 0; }

  /* icons inherit color via stroke=currentColor */
  .ico { display: inline-flex; }
  .ico svg { display: block; }

  /* ── Responsive ──────────────────────────────────────────── */
  @media (min-width: 640px) {
    .hero { padding-top: 9rem; }
    .hero-sub { font-size: 1.25rem; }
    .head-row h2 { font-size: 3rem; }
    .stat .num { font-size: 1.875rem; }
    .stat .lbl { font-size: 0.75rem; }
    .contact-card { padding: 3.5rem; }
    .contact-inner h2 { font-size: 3rem; }
    .footer-row { flex-direction: row; }
    .nav-link .label { display: inline; }
  }
  @media (max-width: 639px) {
    .nav-link .label { display: none; }
  }
  @media (min-width: 768px) {
    .grid { grid-template-columns: repeat(2, 1fr); }
    .card.featured { grid-column: span 2; }
  }
  @media (min-width: 1024px) {
    .grid { grid-template-columns: repeat(3, 1fr); }
    .card.featured { grid-column: span 2; }
  }

  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
    .reveal { opacity: 1 !important; }
  }