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

    :root {
      --bg:        #060B10;
      --bg2:       #0C1520;
      --bg3:       #111E2E;
      --line:      rgba(0,200,160,0.12);
      --green:     #00C8A0;
      --green2:    #00FFCC;
      --amber:     #FFB340;
      --text:      #E2EDF7;
      --muted:     #6B8AA0;
      --card:      #0E1C2C;
      --card-border: rgba(0,200,160,0.18);
      --font-display: 'Syne', sans-serif;
      --font-mono:    'DM Mono', monospace;
      --font-body:    'DM Sans', sans-serif;
    }

    html { scroll-behavior: smooth; }

    body {
      background: var(--bg);
      color: var(--text);
      font-family: var(--font-body);
      font-size: 16px;
      line-height: 1.7;
      overflow-x: hidden;
    }

    img, svg {
      max-width: 100%;
      height: auto;
    }

    ::selection { background: rgba(0,200,160,0.25); }

    /*        GRAIN OVERLAY        */
    body::before {
      content: '';
      position: fixed; 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='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
      pointer-events: none; z-index: 1000; opacity: 0.4;
    }

    /*        CIRCUIT GRID BACKGROUND        */
    .circuit-bg {
      position: fixed; inset: 0; pointer-events: none; z-index: 0;
      background-image:
        linear-gradient(rgba(0,200,160,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,200,160,0.03) 1px, transparent 1px);
      background-size: 48px 48px;
    }

    /*        NAV        */
    nav {
      position: fixed; top: 0; left: 0; right: 0; z-index: 900;
      display: flex; align-items: center; justify-content: space-between;
      padding: 1.2rem 4rem;
      background: rgba(6,11,16,0.85);
      backdrop-filter: blur(16px);
      border-bottom: 1px solid var(--line);
      transition: all 0.3s;
    }

    .nav-logo {
      font-family: var(--font-display);
      font-weight: 800; font-size: 1.1rem;
      color: var(--green);
      letter-spacing: 0.02em;
      text-decoration: none;
    }

    .nav-logo span { color: var(--text); }

    nav ul {
      display: flex; gap: 2.5rem; list-style: none;
    }

    nav ul a {
      font-family: var(--font-mono);
      font-size: 0.78rem; letter-spacing: 0.08em;
      color: var(--muted); text-decoration: none;
      text-transform: uppercase;
      transition: color 0.2s;
    }

    nav ul a:hover { color: var(--green); }

    /*        HERO        */
    #hero {
      min-height: 100vh;
      display: flex; flex-direction: column; justify-content: center;
      padding: 8rem 4rem 4rem;
      position: relative; z-index: 1;
    }

    .hero-label,
    #hero h1,
    .hero-tagline,
    .hero-chips,
    .hero-cta,
    .scroll-ind {
      position: relative;
      z-index: 2;
    }

    .hero-label {
      font-family: var(--font-mono);
      font-size: 0.8rem; letter-spacing: 0.15em;
      color: var(--green); text-transform: uppercase;
      margin-bottom: 1.2rem;
      opacity: 0; animation: fadeUp 0.6s 0.2s forwards;
    }

    .hero-label::before {
      content: ''; display: inline-block;
      width: 28px; height: 1px;
      background: var(--green); margin-right: 10px;
      vertical-align: middle;
    }

    h1 {
      font-family: var(--font-display);
      font-weight: 800; font-size: clamp(3rem, 7vw, 5.5rem);
      line-height: 1.0; letter-spacing: -0.02em;
      color: var(--text);
      opacity: 0; animation: fadeUp 0.7s 0.35s forwards;
      max-width: 100%;
      overflow-wrap: anywhere;
      word-break: break-word;
    }

    h1 .accent { color: var(--green); display: block; }

    .hero-tagline {
      margin-top: 1.4rem;
      font-size: 1.05rem; color: var(--muted);
      max-width: 560px; line-height: 1.8;
      opacity: 0; animation: fadeUp 0.7s 0.5s forwards;
    }

    .hero-chips {
      display: flex; flex-wrap: wrap; gap: 0.6rem;
      margin-top: 2rem;
      opacity: 0; animation: fadeUp 0.7s 0.65s forwards;
    }

    .chip {
      font-family: var(--font-mono); font-size: 0.72rem;
      letter-spacing: 0.06em; text-transform: uppercase;
      padding: 0.35rem 0.9rem;
      border: 1px solid var(--card-border);
      border-radius: 2px;
      color: var(--green); background: rgba(0,200,160,0.06);
    }

    .hero-cta {
      display: flex; gap: 1rem; margin-top: 2.8rem;
      opacity: 0; animation: fadeUp 0.7s 0.8s forwards;
    }

    .hero-fall {
      position: absolute;
      top: 6.5rem;
      right: 4rem;
      bottom: 3.5rem;
      width: min(34vw, 420px);
      overflow: hidden;
      pointer-events: none;
      z-index: 1;
      mask-image: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.95) 14%, rgba(0, 0, 0, 0.95) 88%, transparent 100%);
      -webkit-mask-image: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.95) 14%, rgba(0, 0, 0, 0.95) 88%, transparent 100%);
    }

    .hero-fall::before {
      content: '';
      position: absolute;
      inset: 0;
      background: radial-gradient(circle at 60% 10%, rgba(0, 200, 160, 0.14), transparent 60%);
      opacity: 0.5;
      z-index: 1;
    }

    .hero-fall::after {
      content: '';
      position: absolute;
      inset: 10% -2% 6% 18%;
      background: url('img-profile2.jpg') center/cover no-repeat;
      opacity: 0.17;
      filter: grayscale(20%) saturate(85%) contrast(110%);
      border-radius: 16px;
      border: 1px solid rgba(0, 200, 160, 0.16);
      box-shadow: inset 0 0 40px rgba(6, 11, 16, 0.65), 0 18px 36px rgba(0, 0, 0, 0.35);
      z-index: 0;
    }

    .fall-item {
      position: absolute;
      top: -28%;
      left: var(--x);
      color: rgba(207, 224, 238, 0.9);
      width: 40px;
      height: 40px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border: 1px solid rgba(0, 200, 160, 0.28);
      border-radius: 10px;
      background: linear-gradient(180deg, rgba(12, 21, 32, 0.78), rgba(14, 28, 44, 0.6));
      box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28), 0 0 14px rgba(0, 200, 160, 0.09);
      animation: dropDown var(--d) linear infinite;
      animation-delay: var(--delay);
      backdrop-filter: blur(2px);
      z-index: 2;
    }

    .fall-icon {
      width: 20px;
      height: 20px;
    }

    .fall-item:nth-child(odd) {
      width: 36px;
      height: 36px;
      border-radius: 8px;
      opacity: 0.86;
    }

    @keyframes dropDown {
      0% {
        transform: translateY(-30%) translateX(0) rotate(0.001deg);
        opacity: 0;
      }
      8% {
        opacity: 0.8;
      }
      74% {
        opacity: 0.85;
      }
      100% {
        transform: translateY(145vh) translateX(-8px) rotate(0.001deg);
        opacity: 0;
      }
    }

    .btn {
      font-family: var(--font-mono); font-size: 0.8rem;
      letter-spacing: 0.1em; text-transform: uppercase;
      padding: 0.85rem 2rem; text-decoration: none;
      transition: all 0.25s; cursor: pointer; border: none;
    }

    .btn-primary {
      background: var(--green); color: var(--bg);
      font-weight: 500;
    }

    .btn-primary:hover {
      background: var(--green2);
      transform: translateY(-2px);
      box-shadow: 0 8px 30px rgba(0,200,160,0.3);
    }

    .btn-outline {
      background: transparent; color: var(--text);
      border: 1px solid rgba(255,255,255,0.15);
    }

    .btn-outline:hover {
      border-color: var(--green); color: var(--green);
      transform: translateY(-2px);
    }

    /* scroll indicator */
    .scroll-ind {
      position: absolute; bottom: 2.5rem; left: 4rem;
      font-family: var(--font-mono); font-size: 0.7rem;
      color: var(--muted); letter-spacing: 0.12em;
      display: flex; align-items: center; gap: 0.6rem;
      opacity: 0; animation: fadeUp 0.7s 1.1s forwards;
    }

    .scroll-ind::before {
      content: ''; display: block;
      width: 1px; height: 40px;
      background: linear-gradient(to bottom, transparent, var(--green));
      animation: scrollPulse 2s infinite;
    }

    @keyframes scrollPulse {
      0%, 100% { opacity: 0.4; } 50% { opacity: 1; }
    }

    /*        SECTION BASE        */
    section { padding: 6rem 4rem; position: relative; z-index: 1; }

    .section-label {
      font-family: var(--font-mono); font-size: 0.75rem;
      letter-spacing: 0.18em; text-transform: uppercase;
      color: var(--green); margin-bottom: 0.7rem;
    }

    .section-label::before {
      content: '//'; margin-right: 6px; opacity: 0.5;
    }

    h2 {
      font-family: var(--font-display);
      font-size: clamp(2rem, 4vw, 2.8rem);
      font-weight: 700; color: var(--text);
      letter-spacing: -0.02em; margin-bottom: 3rem;
    }

    /*        ABOUT / RESEARCH        */
    #about { background: var(--bg2); }

    .about-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 4rem; align-items: start;
    }

    .about-img-wrap {
      position: relative;
    }

    /* 
                                                                                                             
         PHOTO PLACEHOLDER
    Replace the placeholder below with your actual photo.
    Steps:
      1. Add your photo to the portfolio folder, e.g. "photo.jpg"
      2. In this file, find .about-img and change background to:
         background: url('photo.jpg') center/cover no-repeat;
      3. Remove the .about-img::after pseudo-element styles below.
                                                                                                             
    */
    .about-img {
      width: 100%; aspect-ratio: 3/4;
      background: url('img-profile.jpg') center/cover no-repeat;
      border: 1px solid var(--card-border);
      position: relative; overflow: hidden;
      display: flex; align-items: center; justify-content: center;
    }

    .about-img-frame {
      position: absolute; top: 12px; left: 12px; right: -12px; bottom: -12px;
      border: 1px solid rgba(0,200,160,0.2); pointer-events: none;
      z-index: -1;
    }

    .about-text p {
      color: var(--muted); margin-bottom: 1.2rem; font-size: 0.97rem;
    }

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

    .research-tags {
      display: flex; flex-direction: column; gap: 0.8rem; margin-top: 1.5rem;
    }

    .research-tag {
      display: flex; align-items: flex-start; gap: 0.9rem;
      padding: 1rem 1.2rem;
      background: rgba(0,200,160,0.05);
      border-left: 2px solid var(--green);
    }

    .research-tag-num {
      font-family: var(--font-mono); font-size: 0.7rem;
      color: var(--green); margin-top: 0.15rem; flex-shrink: 0;
    }

    .research-tag-text { font-size: 0.88rem; color: var(--muted); }
    .research-tag-text strong { color: var(--text); display: block; margin-bottom: 0.2rem; }

    /*        PROJECTS        */
    #projects { background: var(--bg); }

    .projects-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
      gap: 1.5rem;
    }

    .project-card {
      background: var(--card);
      border: 1px solid var(--card-border);
      overflow: hidden;
      transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
      position: relative;
    }

    .project-card:hover {
      transform: translateY(-6px);
      box-shadow: 0 20px 60px rgba(0,0,0,0.4);
      border-color: rgba(0,200,160,0.4);
    }

    .project-card-img {
      width: 100%; aspect-ratio: 16/9;
      background: var(--bg3);
      display: flex; align-items: center; justify-content: center;
      overflow: hidden; position: relative;
    }

    /* 
                                                                                                             
         PROJECT IMAGE PLACEHOLDERS
    For each project, replace the placeholder with a real image.
    
    SiloGard     id="img-silogard"
    Voice Assistant     id="img-voice"
    WiFi-CAN Adapter     id="img-can"
    Digital Diya     id="img-diya"
    
    Steps per project:
      1. Add your image file to the portfolio folder
      2. Find the matching <div id="img-XXXX"> below
      3. Replace the entire <div> with:
         <img src="your-image.jpg" alt="Project Name" 
              style="width:100%;height:100%;object-fit:cover;">
                                                                                                             
    */
    .project-img-placeholder {
      text-align: center; color: var(--muted);
      font-family: var(--font-mono); font-size: 0.7rem;
    }

    .project-img-placeholder svg { display: block; margin: 0 auto 0.4rem; opacity: 0.25; }

    /* circuit trace decoration on cards */
    .project-card::before {
      content: '';
      position: absolute; top: 0; right: 0;
      width: 60px; height: 60px;
      border-right: 1px solid rgba(0,200,160,0.15);
      border-top: 1px solid rgba(0,200,160,0.15);
      pointer-events: none;
    }

    .project-card-body { padding: 1.4rem; }

    .project-status {
      font-family: var(--font-mono); font-size: 0.65rem;
      letter-spacing: 0.12em; text-transform: uppercase;
      padding: 0.25rem 0.6rem; display: inline-block;
      margin-bottom: 0.8rem;
    }

    .status-active { background: rgba(0,200,160,0.12); color: var(--green); }
    .status-review { background: rgba(255,179,64,0.12); color: var(--amber); }
    .status-complete { background: rgba(100,160,220,0.12); color: #64A0DC; }

    .project-card h3 {
      font-family: var(--font-display);
      font-size: 1.1rem; font-weight: 700;
      color: var(--text); margin-bottom: 0.6rem;
    }

    .project-card p {
      font-size: 0.85rem; color: var(--muted); line-height: 1.7;
      margin-bottom: 1rem;
    }

    .project-tags {
      display: flex; flex-wrap: wrap; gap: 0.4rem;
    }

    .project-tag {
      font-family: var(--font-mono); font-size: 0.65rem;
      letter-spacing: 0.05em;
      padding: 0.2rem 0.55rem;
      border: 1px solid rgba(255,255,255,0.08);
      color: var(--muted); border-radius: 2px;
    }

    #teaching { background: var(--bg2); }

    .teaching-grid {
      display: grid;
      grid-template-columns: 1fr 1.4fr;
      gap: 3.5rem;
      align-items: start;
    }

    .teaching-img {
      width: 100%; aspect-ratio: 16/9;
      background: var(--bg3);
      border: 1px solid var(--card-border);
      display: flex; align-items: center; justify-content: center;
      overflow: hidden;
    }

    .teaching-img-placeholder {
      text-align: center; color: var(--muted);
      font-family: var(--font-mono); font-size: 0.72rem;
    }

    .teaching-summary {
      font-size: 0.92rem; color: var(--muted);
      line-height: 1.8; margin: 1rem 0 1.5rem;
    }

    .teaching-role {
      display: flex; flex-wrap: wrap; gap: 0.5rem;
      margin-bottom: 1rem;
    }

    .teaching-items {
      display: flex; flex-direction: column; gap: 1rem;
    }

    .teaching-item {
      display: flex; gap: 1.2rem; align-items: flex-start;
      padding-bottom: 1rem;
      border-bottom: 1px solid var(--line);
    }

    .teaching-item-year {
      font-family: var(--font-mono); font-size: 0.7rem;
      color: var(--green); flex-shrink: 0; width: 52px;
      padding-top: 0.2rem;
    }

    .teaching-item strong {
      display: block; font-family: var(--font-display);
      font-size: 0.95rem; color: var(--text); margin-bottom: 0.3rem;
    }

    .teaching-item p {
      font-size: 0.82rem; color: var(--muted); line-height: 1.7; margin: 0;
    }

    /*        AWARDS        */
    #awards { background: var(--bg2); }

    .awards-list { display: flex; flex-direction: column; gap: 1px; }

    .award-item {
      display: flex; gap: 2rem; align-items: flex-start;
      padding: 1.6rem 0;
      border-bottom: 1px solid var(--line);
      transition: all 0.2s;
    }

    .award-item:hover .award-year { color: var(--green); }

    .award-year {
      font-family: var(--font-mono); font-size: 0.78rem;
      color: var(--muted); flex-shrink: 0;
      width: 52px; padding-top: 0.15rem;
      transition: color 0.2s;
    }

    .award-body { flex: 1; }

    .award-body h3 {
      font-family: var(--font-display);
      font-size: 1rem; font-weight: 700;
      color: var(--text); margin-bottom: 0.3rem;
    }

    .award-body p { font-size: 0.85rem; color: var(--muted); }

    .award-badge {
      font-family: var(--font-mono); font-size: 0.65rem;
      padding: 0.2rem 0.7rem;
      background: rgba(255,179,64,0.1); color: var(--amber);
      letter-spacing: 0.08em; align-self: center;
      white-space: nowrap;
    }

    /*        PUBLICATIONS        */
    #publications { background: var(--bg); }

    .pub-list { display: flex; flex-direction: column; gap: 1.2rem; }

    .pub-card {
      padding: 1.6rem 1.8rem;
      background: var(--card);
      border: 1px solid var(--card-border);
      border-left: 3px solid var(--green);
      transition: transform 0.2s;
    }

    .pub-card:hover { transform: translateX(4px); }

    .pub-status {
      font-family: var(--font-mono); font-size: 0.65rem;
      text-transform: uppercase; letter-spacing: 0.1em;
      padding: 0.2rem 0.6rem; display: inline-block;
      margin-bottom: 0.7rem;
    }

    .pub-card h3 {
      font-family: var(--font-display);
      font-size: 1rem; font-weight: 700;
      color: var(--text); margin-bottom: 0.4rem;
    }

    .pub-card p { font-size: 0.85rem; color: var(--muted); }

    /*        SKILLS        */
    #skills { background: var(--bg2); }

    .skills-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
      gap: 1.2rem;
    }

    .skill-group {
      padding: 1.5rem;
      background: var(--card);
      border: 1px solid var(--card-border);
    }

    .skill-group h3 {
      font-family: var(--font-mono); font-size: 0.72rem;
      letter-spacing: 0.12em; text-transform: uppercase;
      color: var(--green); margin-bottom: 1rem;
    }

    .skill-pills { display: flex; flex-wrap: wrap; gap: 0.45rem; }

    .skill-pill {
      font-family: var(--font-mono); font-size: 0.72rem;
      padding: 0.3rem 0.75rem;
      border: 1px solid rgba(255,255,255,0.08);
      color: var(--text); border-radius: 2px;
      transition: all 0.2s;
    }

    .skill-pill:hover {
      border-color: var(--green); color: var(--green);
      background: rgba(0,200,160,0.05);
    }

    /*        CONTACT        */
    #contact { background: var(--bg); text-align: center; }

    .contact-inner {
      max-width: 620px; margin: 0 auto;
    }

    .contact-inner p {
      color: var(--muted); margin-bottom: 2.5rem; font-size: 1rem;
    }

    .contact-links {
      display: flex; justify-content: center; gap: 1.5rem;
      flex-wrap: wrap; margin-top: 2rem;
    }

    .contact-link {
      display: flex; align-items: center; gap: 0.5rem;
      font-family: var(--font-mono); font-size: 0.78rem;
      letter-spacing: 0.08em; color: var(--muted);
      text-decoration: none; transition: color 0.2s;
    }

    .contact-link:hover { color: var(--green); }

    .contact-link svg { opacity: 0.6; transition: opacity 0.2s; }
    .contact-link:hover svg { opacity: 1; }

    /*        FOOTER        */
    footer {
      padding: 2rem 4rem;
      border-top: 1px solid var(--line);
      display: flex; justify-content: space-between; align-items: center;
      font-family: var(--font-mono); font-size: 0.72rem;
      color: var(--muted); position: relative; z-index: 1;
    }

    /*        ANIMATIONS        */
    @keyframes fadeUp {
      from { opacity: 0; transform: translateY(24px); }
      to   { opacity: 1; transform: translateY(0); }
    }

    .reveal {
      opacity: 0; transform: translateY(28px);
      transition: opacity 0.7s ease, transform 0.7s ease;
    }

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

    /*        MOBILE        */
    @media (max-width: 768px) {
      nav { padding: 1rem 1.5rem; }
      nav ul { display: none; }
      #hero, section { padding-left: 1.5rem; padding-right: 1.5rem; }
      #hero { min-height: auto; padding-top: 7rem; padding-bottom: 3rem; }
      .hero-fall { display: none; }
      .teaching-grid { grid-template-columns: 1fr; gap: 2rem; }
      h1 { font-size: clamp(2.35rem, 9.5vw, 3.4rem); line-height: 1.04; }
      .scroll-ind { display: none; }
      .hero-cta { flex-direction: column; align-items: stretch; }
      .hero-cta .btn { text-align: center; }
      .about-grid {
        grid-template-columns: 1fr;
        gap: 1.4rem;
      }
      .about-text { order: 2; }
      .about-img-wrap {
        order: 1;
        max-width: 100%;
        margin: 0;
      }
      #about .about-img-wrap.reveal {
        opacity: 1;
        transform: none;
      }
      #about .about-img {
        display: block;
        min-height: 380px;
      }
      #about #img-profile {
        background-image: url('img-profile.jpg');
        background-position: center top;
        background-size: cover;
        background-repeat: no-repeat;
      }
      .about-img-frame { right: 0; bottom: 0; }
      .projects-grid { grid-template-columns: 1fr; }
      .skills-grid { grid-template-columns: 1fr; }
      .award-item { flex-direction: column; gap: 0.6rem; }
      .award-year { width: auto; padding-top: 0; }
      .award-badge { align-self: flex-start; }
      .pub-card { padding: 1.2rem; }
      footer { flex-direction: column; gap: 0.5rem; text-align: center; }
    }

    @media (max-width: 420px) {
      nav { padding: 0.9rem 1rem; }
      #hero, section { padding-left: 1rem; padding-right: 1rem; }
      h1 { font-size: clamp(2.2rem, 11vw, 2.9rem); line-height: 1.06; }
      .hero-label { letter-spacing: 0.1em; }
      .chip { font-size: 0.65rem; padding: 0.3rem 0.7rem; }
      .project-card-body,
      .skill-group,
      .pub-card { padding: 1rem; }
      .contact-links { gap: 0.8rem; }
      footer { padding: 1.5rem 1rem; }
    }

    @media (max-width: 1100px) {
      .hero-fall {
        width: min(30vw, 320px);
        right: 2rem;
        opacity: 0.62;
      }
    }

    @media (prefers-reduced-motion: reduce) {
      .fall-item {
        animation: none;
        opacity: 0.45;
      }
    }
