﻿  /* ============================================================
     DESIGN TOKENS
     ============================================================ */
  :root{
    --color-bg: #0A0D10;
    --color-panel: #12171C;
    --color-panel-hover: #161C22;
    --color-border: #232B32;
    --color-text: #E8EDF0;
    --color-muted: #7C8A93;
    --color-accent: #E8453C;
    --color-live: #3FDA84;
    --color-amber: #F0A94E;
    --font-mono: 'IBM Plex Mono', monospace;
    --font-sans: 'Inter', sans-serif;
    --radius: 8px;
    --radius-lg: 12px;
    --ease-out: cubic-bezier(.22, 1, .36, 1);
  }

  /* ============================================================
     RESET & BASE
     ============================================================ */
  *{ margin:0; padding:0; box-sizing:border-box; }

  html{ scroll-behavior:smooth; }

  body{
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-sans);
    line-height: 1.5;
    overflow-x: hidden;
  }

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

  /* ============================================================
     LAYOUT
     ============================================================ */
  .container{
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 32px;
  }

  /* ============================================================
     BACKGROUND LAYERS
     ============================================================ */
  .bg-grid{
    position: fixed;
    inset: 0;
    background-image:
      linear-gradient(to right, rgba(255,255,255,0.02) 1px, transparent 1px),
      linear-gradient(to bottom, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 48px 48px;
    pointer-events: none;
    z-index: 0;
  }

  .scroll-progress{
    position: fixed;
    top: 0; left: 0;
    height: 2px;
    width: 0%;
    background: linear-gradient(90deg, var(--color-accent), var(--color-amber));
    box-shadow: 0 0 12px rgba(232,69,60,0.5);
    z-index: 100;
    pointer-events: none;
  }

  .cursor-glow{
    position: fixed;
    width: 520px;
    height: 520px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(232,69,60,0.07), transparent 62%);
    pointer-events: none;
    z-index: 0;
    transform: translate(-50%, -50%);
    transition: opacity .4s;
    opacity: 0;
  }

  /* ============================================================
     MOTION UTILITIES
     ============================================================ */
  .reveal{
    opacity: 0;
    transform: translateY(30px);
    transition: opacity .8s ease, transform .8s var(--ease-out);
    will-change: opacity, transform;
  }
  .reveal--visible{ opacity:1; transform:none; }

  /* variants */
  .reveal--fade{ transform:none; }
  .reveal--scale{ transform: scale(.92); }
  .reveal--scale.reveal--visible{ transform: scale(1); }
  .reveal--tilt{
    transform: perspective(1200px) rotateX(55deg) translateY(60px);
    transform-origin: top center;
  }
  .reveal--tilt.reveal--visible{
    transform: perspective(1200px) rotateX(0) translateY(0);
  }
  .reveal--flip{
    transform: perspective(1200px) rotateY(45deg) translateX(40px);
    transform-origin: left center;
  }
  .reveal--flip.reveal--visible{
    transform: perspective(1200px) rotateY(0) translateX(0);
  }

  /* stagger */
  .reveal--delay-1{ transition-delay: .08s; }
  .reveal--delay-2{ transition-delay: .16s; }
  .reveal--delay-3{ transition-delay: .24s; }
  .reveal--delay-4{ transition-delay: .32s; }
  .reveal--delay-5{ transition-delay: .40s; }

  /* scroll-linked 3D tilt (driven by JS) */
  .fx-parallax, .fx-hero{ will-change: transform; }

  /* hover 3D tilt (driven by JS, single card) */
  .fx-tilt{
    transform-style: preserve-3d;
    will-change: transform;
    transition: box-shadow .25s ease;
  }
  .fx-tilt .card__body{
    transform: translateZ(28px);
    transform-style: preserve-3d;
  }
  .fx-tilt .card__status,
  .fx-tilt .card__platform,
  .fx-tilt .card__chips{
    transform: translateZ(38px);
  }

  /* ============================================================
     MARQUEE
     ============================================================ */
  .marquee{
    position: relative;
    z-index: 1;
    overflow: hidden;
    border-bottom: 1px solid var(--color-border);
    padding: 16px 0;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  }
  .marquee__track{
    display: flex;
    width: max-content;
    animation: marquee-scroll 28s linear infinite;
    will-change: transform;
  }
  .marquee__item{
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--color-muted);
    letter-spacing: .1em;
    text-transform: uppercase;
    padding: 0 22px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 44px;
  }
  .marquee__item::after{
    content: '\2726';
    color: var(--color-accent);
    font-size: 11px;
    opacity: .8;
  }
  @keyframes marquee-scroll{
    from{ transform: translateX(0); }
    to{ transform: translateX(-50%); }
  }

  /* ============================================================
     NAVIGATION
     ============================================================ */
  .nav{
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(10,13,16,0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-border);
  }
  .nav__container{
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
  }
  .nav__logo{
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 15px;
    letter-spacing: .02em;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .nav__logo-dot{
    width: 8px; height: 8px;
    background: var(--color-accent);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--color-accent);
    animation: pulse 2.4s infinite;
  }
  .nav__links{
    display: flex;
    gap: 28px;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--color-muted);
  }
  .nav__link{ transition: color .2s; }
  .nav__link:hover{ color: var(--color-text); }

  .nav__toggle{
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
  }
  .nav__toggle span{
    width: 20px; height: 2px;
    background: var(--color-text);
    display: block;
  }

  .nav__mobile{
    display: none;
    flex-direction: column;
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--color-muted);
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg);
  }
  .nav__mobile a{
    padding: 16px 32px;
    border-top: 1px solid var(--color-border);
  }
  .nav__mobile.is-open{ display: flex; }

  /* ============================================================
     HERO
     ============================================================ */
  .hero{
    position: relative;
    z-index: 1;
    padding: 56px 0 100px;
    border-bottom: 1px solid var(--color-border);
  }
  .hero__container{
    transform-style: preserve-3d;
    perspective: 1000px;
    perspective-origin: 50% 30%;
  }
  .hero__container > *{ transform-style: preserve-3d; }

  .hero__eyebrow{
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--color-live);
    letter-spacing: .08em;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .hero__eyebrow::before{
    content: '';
    width: 18px; height: 1px;
    background: var(--color-live);
  }

  .hero__terminal{
    font-family: var(--font-mono);
    background: var(--color-panel);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 22px 24px;
    max-width: 640px;
    margin-bottom: 36px;
    font-size: 14px;
    color: var(--color-muted);
  }
  .hero__terminal-line{ margin-bottom: 6px; white-space: pre-wrap; }
  .hero__terminal-line:last-child{ margin-bottom: 0; }
  .hero__terminal-prompt{ color: var(--color-accent); }
  .hero__terminal-out{ color: var(--color-text); }
  .terminal-cursor{
    display: inline-block;
    width: .6em;
    height: 1.1em;
    background: var(--color-accent);
    margin-left: 3px;
    vertical-align: text-bottom;
    animation: cursor-blink 1s step-end infinite;
  }

  .hero__title{
    font-family: var(--font-mono);
    font-size: clamp(38px, 6vw, 64px);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -.01em;
    margin-bottom: 20px;
  }
  .hero__title span{ color: var(--color-accent); }

  .hero__subtitle{
    font-size: 17px;
    color: var(--color-muted);
    max-width: 560px;
    margin-bottom: 40px;
  }

  .hero__stats{
    display: flex;
    flex-wrap: wrap;
    border-top: 1px solid var(--color-border);
    max-width: 640px;
  }
  .hero__stat{
    flex: 1 1 140px;
    padding: 18px 20px 0 0;
    border-right: 1px solid var(--color-border);
    text-align: left;
  }
  .hero__stat:last-child{ border-right: none; }
  .hero__stat-value{
    font-family: var(--font-mono);
    font-size: 24px;
    font-weight: 600;
    color: var(--color-text);
  }
  .hero__stat-label{
    font-size: 12px;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-top: 4px;
  }

  /* ============================================================
     SECTION
     ============================================================ */
  .section{
    position: relative;
    z-index: 1;
    padding: 90px 0;
    border-bottom: 1px solid var(--color-border);
  }
  .section:last-of-type{ border-bottom: none; }

  .section__header{
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 48px;
    flex-wrap: wrap;
    gap: 12px;
  }
  .section__title{
    font-family: var(--font-mono);
    font-size: 26px;
    font-weight: 600;
  }
  .section__note{
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--color-muted);
  }

  /* ============================================================
     PROJECTS GRID
     ============================================================ */
  .projects-grid{
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
    background: var(--color-border);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
  }
  .projects-grid::before{
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 13px;
    background: linear-gradient(120deg, transparent 0%, rgba(232,69,60,0.15) 30%, rgba(240,169,78,0.12) 55%, transparent 80%);
    background-size: 300% 300%;
    opacity: 0;
    transition: opacity .6s ease;
    pointer-events: none;
    z-index: 2;
    animation: border-flow 6s linear infinite;
  }
  .projects-grid:hover::before{ opacity: 1; }
  @keyframes border-flow{
    0%{ background-position: 0% 0%; }
    100%{ background-position: 300% 0%; }
  }

  .card{
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--color-panel);
    padding: 28px;
    transition: background .25s ease, box-shadow .35s ease;
  }
  .card:hover{
    background: var(--color-panel-hover);
    box-shadow: 0 18px 40px rgba(0,0,0,0.45);
  }
  .card::after{
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--color-accent), var(--color-amber));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .4s var(--ease-out);
  }
  .card:hover::after{ transform: scaleX(1); }

  .card__body{ position: relative; z-index: 1; display: flex; flex-direction: column; flex: 1; }

  .card__top{
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
  }
  .card__status{
    display: flex;
    align-items: center;
    gap: 7px;
    font-family: var(--font-mono);
    font-size: 11.5px;
    letter-spacing: .06em;
    text-transform: uppercase;
  }
  .card__status-dot{
    width: 7px; height: 7px;
    border-radius: 50%;
  }
  .card__status--live{ color: var(--color-live); }
  .card__status--live .card__status-dot{
    background: var(--color-live);
    box-shadow: 0 0 6px var(--color-live);
    animation: pulse 2.4s infinite;
  }
  .card__status--beta{ color: var(--color-amber); }
  .card__status--beta .card__status-dot{
    background: var(--color-amber);
    box-shadow: 0 0 6px var(--color-amber);
  }

  .card__platform{
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--color-muted);
    border: 1px solid var(--color-border);
    padding: 3px 8px;
    border-radius: 20px;
  }

  .card__title{
    font-family: var(--font-mono);
    font-size: 19px;
    font-weight: 600;
    margin-bottom: 10px;
  }

  .card__description{
    font-size: 14.5px;
    color: var(--color-muted);
    margin-bottom: 20px;
    max-width: 44ch;
    flex: 1;
  }

  .card__chips{
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-end;
    margin-top: auto;
  }
  .chip{
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--color-text);
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--color-border);
    padding: 4px 9px;
    border-radius: 6px;
  }

  /* ============================================================
     STACK
     ============================================================ */
  .stack{
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
  }
  .stack__item{
    font-family: var(--font-mono);
    font-size: 13px;
    padding: 10px 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    color: var(--color-muted);
    background: var(--color-panel);
  }
  .stack__item b{ color: var(--color-text); font-weight: 600; }

  /* ============================================================
     CONTACT / FOOTER
     ============================================================ */
  .contact{
    position: relative;
    z-index: 1;
    padding: 80px 0 48px;
  }
  .contact__terminal{
    font-family: var(--font-mono);
    font-size: 15px;
    margin-bottom: 32px;
  }
  .contact__prompt{ color: var(--color-accent); }
  .contact__title{
    font-family: var(--font-mono);
    font-size: clamp(26px, 4vw, 38px);
    margin-bottom: 14px;
  }
  .contact__subtitle{
    color: var(--color-muted);
    max-width: 480px;
    margin-bottom: 40px;
  }

  .contact-form{
    max-width: 560px;
    display: flex;
    flex-direction: column;
    gap: 16px;
  }
  .contact-form__row{
    display: flex;
    gap: 16px;
  }
  .contact-form__row .contact-form__field{ flex: 1; }
  .contact-form__field{
    display: flex;
    flex-direction: column;
    gap: 7px;
  }
  .contact-form__label{
    font-family: var(--font-mono);
    font-size: 11.5px;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--color-muted);
  }
  .contact-form__input{
    font-family: var(--font-sans);
    font-size: 14px;
    color: var(--color-text);
    background: var(--color-panel);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 12px 14px;
    outline: none;
    transition: border-color .2s;
    width: 100%;
    resize: vertical;
  }
  .contact-form__input:focus{ border-color: var(--color-accent); }
  .contact-form__input::placeholder{ color: #4E5A63; }
  .contact-form__submit{
    align-self: flex-start;
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 600;
    color: var(--color-bg);
    background: var(--color-accent);
    border: none;
    border-radius: var(--radius);
    padding: 12px 22px;
    cursor: pointer;
    transition: opacity .2s, transform .2s;
  }
  .contact-form__submit:hover{ opacity: .88; transform: translateY(-1px); }
  .contact-form__submit:disabled{ opacity: .6; cursor: default; transform: none; }
  .contact-form__honeypot{
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
  }
  .contact-form__status{
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--color-live);
    display: none;
  }
  .contact-form__status.is-visible{ display: block; }
  .contact-form__status.is-error{ color: var(--color-amber); }

  .contact__footer{
    margin-top: 64px;
    padding-top: 24px;
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--color-muted);
  }

  /* ============================================================
     KEYFRAMES
     ============================================================ */
  @keyframes cursor-blink{
    0%{ opacity: 1; }
    50%{ opacity: 0; }
    100%{ opacity: 1; }
  }
  @keyframes pulse{
    0%, 100%{ opacity: 1; }
    50%{ opacity: .35; }
  }

  /* ============================================================
     REDUCED MOTION
     ============================================================ */
  @media (prefers-reduced-motion: reduce){
    .reveal, .fx-parallax, .fx-hero, .fx-tilt{
      opacity: 1 !important;
      transform: none !important;
      transition: none !important;
    }
    .scroll-progress, .cursor-glow{ display: none; }
  }

  /* ============================================================
     RESPONSIVE
     ============================================================ */
  @media (max-width: 1024px){
    .container{ padding: 0 24px; }
    .hero{ padding: 48px 0 72px; }
    .section{ padding: 64px 0; }
    .projects-grid{ grid-template-columns: repeat(2, 1fr); }
    .card{ padding: 24px; }
  }

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

  @media (max-width: 640px){
    .nav__links{ display: none; }
    .nav__toggle{ display: flex; }

    .container{ padding: 0 20px; }

    .hero{ padding: 36px 0 56px; }
    .hero__eyebrow{ font-size: 11px; margin-bottom: 20px; }

    .hero__terminal{
      padding: 16px;
      font-size: 12.5px;
      margin-bottom: 28px;
    }

    .hero__title{ margin-bottom: 16px; }
    .hero__subtitle{ font-size: 15.5px; margin-bottom: 32px; }

    .hero__stats{ flex-direction: column; max-width: 100%; }
    .hero__stat{
      border-right: none;
      border-bottom: 1px solid var(--color-border);
      padding: 14px 0;
    }
    .hero__stat:last-child{ border-bottom: none; }

    .section{ padding: 48px 0; }
    .section__header{ margin-bottom: 32px; }
    .section__title{ font-size: 21px; }

    .card{ padding: 22px 20px; }
    .card__title{ font-size: 17px; }
    .card__description{ max-width: none; }

    .stack{ flex-direction: column; }
    .stack__item{ width: 100%; }

    .contact{ padding: 56px 0 36px; }
    .contact__terminal{ font-size: 13px; }
    .contact-form__row{ flex-direction: column; }
    .contact__footer{
      flex-direction: column;
      align-items: flex-start;
      gap: 8px;
    }
  }

  @media (max-width: 380px){
    .container{ padding: 0 16px; }
    .hero__title{ font-size: 32px; }
    .hero__terminal{ font-size: 11.5px; }
  }
