:root {
    --bg: #0f172a;
    --panel: #111827;
    --panel-soft: #1f2937;
    --text: #f8fafc;
    --muted: #cbd5e1;
    --accent: #38bdf8;
    --accent-soft: rgba(56, 189, 248, 0.12);
    --border: rgba(148, 163, 184, 0.25);
    --max-width: 1120px;
  }

  * {
    box-sizing: border-box;
  }

  html {
    scroll-behavior: smooth;
  }

  body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
      radial-gradient(circle at top left, rgba(56, 189, 248, 0.16), transparent 36rem),
      radial-gradient(circle at top right, rgba(168, 85, 247, 0.14), transparent 34rem),
      var(--bg);
    color: var(--text);
    line-height: 1.6;
  }

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

  a:hover {
    color: var(--accent);
  }

  .container {
    width: min(100% - 2rem, var(--max-width));
    margin: 0 auto;
  }

  header {
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(16px);
    background: rgba(15, 23, 42, 0.78);
    border-bottom: 1px solid var(--border);
  }

  nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    gap: 1rem;
  }

  .logo {
    font-weight: 800;
    letter-spacing: -0.04em;
  }

  .nav-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.95rem;
    color: var(--muted);
  }

  .hero {
    padding: 6rem 0 4rem;
  }

  .hero-layout {
    display: grid;
    grid-template-columns: 1.4fr 0.6fr;
    gap: 3rem;
    align-items: center;
  }
  
  .hero-text {
    min-width: 0;
  }
  
  .hero-image-wrap {
    display: flex;
    justify-content: center;
  }
  
  .profile-image {
    width: min(280px, 70vw);
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 999px;
    border: 1px solid var(--border);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
    background: var(--panel);
  }
  .eyebrow {
    color: var(--accent);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.8rem;
    margin-bottom: 1rem;
  }

  h1, h2, h3 {
    line-height: 1.1;
    letter-spacing: -0.04em;
    margin: 0;
  }

  h1 {
    max-width: 920px;
    font-size: clamp(2.6rem, 7vw, 5.8rem);
  }

  .hero p {
    max-width: 760px;
    margin: 1.4rem 0 0;
    color: var(--muted);
    font-size: clamp(1.05rem, 2vw, 1.25rem);
  }

  .actions {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    margin-top: 2rem;
  }

  .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.72rem 1rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--accent-soft);
    color: var(--text);
    font-weight: 700;
  }

  .button.primary {
    background: var(--accent);
    color: #06101f;
    border-color: transparent;
  }

  section {
    padding: 4rem 0;
  }

  .section-heading {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    align-items: end;
    margin-bottom: 1.5rem;
  }

  .section-heading p {
    max-width: 640px;
    margin: 0;
    color: var(--muted);
  }

  h2 {
    font-size: clamp(2rem, 4vw, 3rem);
  }

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

  .card {
    background: linear-gradient(180deg, rgba(31, 41, 55, 0.88), rgba(17, 24, 39, 0.92));
    border: 1px solid var(--border);
    border-radius: 1.25rem;
    padding: 1.2rem;
    box-shadow: 0 24px 80px rgba(0,0,0,0.18);
  }

  .project-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 1rem;
    border: 1px solid var(--border);
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: rgba(15, 23, 42, 0.55);
  }
  .project-hero {
    position: relative;
    overflow: hidden;
    padding: 5.5rem 0 4.5rem;
  }
  
  .project-hero-layout {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 3rem;
    align-items: center;
    position: relative;
  }
  
  .project-hero-text {
    position: relative;
    z-index: 2;
  }
  
  .project-hero-text h1 {
    max-width: 760px;
  }
  
  .project-hero-text p {
    max-width: 720px;
  }
  
  .project-hero-visual {
    position: relative;
    min-height: 360px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .project-hero-visual::before {
    content: "";
    position: absolute;
    width: 110%;
    aspect-ratio: 1;
    border-radius: 999px;
    background:
      radial-gradient(circle, rgba(56, 189, 248, 0.22), transparent 62%),
      radial-gradient(circle, rgba(168, 85, 247, 0.16), transparent 68%);
    filter: blur(4px);
    z-index: 0;
  }
  
  .project-hero-image {
    position: relative;
    z-index: 1;
    width: min(100%, 520px);
    max-height: 340px;
    object-fit: contain;
    border-radius: 1.4rem;
    border: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.55);
    padding: 0.7rem;
    box-shadow:
      0 28px 100px rgba(0, 0, 0, 0.38),
      0 0 0 1px rgba(56, 189, 248, 0.08);
    transform: rotate(1.5deg);
  }
  
  .project-hero-image:hover {
    transform: rotate(0deg) scale(1.02);
    transition: transform 180ms ease;
  }
  @media (max-width: 860px) {
    .project-hero-layout {
      grid-template-columns: 1fr;
      gap: 2rem;
    }
  
    .project-hero-visual {
      min-height: auto;
      justify-content: flex-start;
    }
  
    .project-hero-image {
      width: 100%;
      max-height: 260px;
      transform: none;
    }
  
    .project-hero-image:hover {
      transform: none;
    }
  }
  .project-hero-image-flat {
    transform: none;
  }
  
  .project-hero-image-flat:hover {
    transform: scale(1.02);
  }

  .card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
  }

  .card p {
    color: var(--muted);
    margin: 0 0 1rem;
  }

  .tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 1rem 0;
  }

  .tag {
    display: inline-flex;
    padding: 0.28rem 0.55rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.55);
    color: var(--muted);
    font-size: 0.8rem;
  }

  .card-links {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    font-weight: 700;
    font-size: 0.94rem;
  }

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

  .skills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
  }

  .skill {
    padding: 0.55rem 0.75rem;
    border-radius: 0.8rem;
    background: var(--panel-soft);
    border: 1px solid var(--border);
    color: var(--muted);
  }
  .skill-explorer-layout {
    display: grid;
    grid-template-columns: 0.8fr 1.6fr;
    gap: 1rem;
    align-items: start;
  }
  
  .skill-menu {
    display: grid;
    gap: 0.65rem;
    position: sticky;
    top: 5.5rem;
  }
  
  .skill-tab {
    width: 100%;
    text-align: left;
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 0.9rem 1rem;
    background: rgba(31, 41, 55, 0.7);
    color: var(--muted);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease;
  }
  
  .skill-tab:hover {
    transform: translateY(-1px);
    border-color: rgba(56, 189, 248, 0.55);
    color: var(--text);
  }
  
  .skill-tab.active {
    background: var(--accent-soft);
    border-color: rgba(56, 189, 248, 0.7);
    color: var(--text);
  }
  
  .skill-detail {
    display: none;
  }
  
  .skill-detail.active {
    display: block;
  }
  
  .skill-detail-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
  }
  
  .skill-detail-header .eyebrow {
    margin-bottom: 0.45rem;
  }
  
  .skill-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    padding: 0.45rem 0.7rem;
    border-radius: 999px;
    border: 1px solid rgba(56, 189, 248, 0.45);
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 800;
  }
  
  .skill-columns {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 1rem;
    margin-top: 1.2rem;
  }
  
  .skill-columns h4 {
    margin: 0 0 0.7rem;
    font-size: 0.95rem;
    color: var(--text);
  }
  
  .skill-columns ul {
    margin: 0;
    padding-left: 1.1rem;
    color: var(--muted);
  }
  
  .skill-columns li {
    margin-bottom: 0.35rem;
  }
  
  .skill-example {
    margin: 1.2rem 0 0;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 1rem;
    background: rgba(15, 23, 42, 0.45);
    color: var(--muted);
  }
  
  .skill-example strong {
    color: var(--text);
  }
  .academic-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .academic-card {
    min-height: 100%;
  }
  
  .academic-card p {
    min-height: 6.5rem;
  }
  .project-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
    height: 100%;
    padding: 0;
    overflow: hidden;
    transition:
      transform 180ms ease,
      border-color 180ms ease,
      box-shadow 180ms ease,
      background 180ms ease;
  }
  
  .project-card-link:hover,
  .project-card-link:focus-visible {
    transform: translateY(-6px);
    border-color: rgba(56, 189, 248, 0.7);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.34);
    color: inherit;
  }
  
  .project-card-link:focus-visible {
    outline: 3px solid rgba(56, 189, 248, 0.55);
    outline-offset: 4px;
  }
  
  .project-card-content {
    padding: 1.2rem;
    height: 100%;
  }
  
  .project-card-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
  }
  
  .project-type {
    color: var(--accent);
    font-weight: 800;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
  }
  
  .project-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--accent);
    background: var(--accent-soft);
    transition: transform 180ms ease;
  }
  
  .project-card-link:hover .project-arrow,
  .project-card-link:focus-visible .project-arrow {
    transform: translateX(4px);
  }
  
  .project-card-link .project-image {
    width: 100%;
    height: 180px;
    object-fit: contain;
    border-radius: 1rem;
    border: 1px solid var(--border);
    margin-bottom: 1rem;
    background: rgba(15, 23, 42, 0.55);
    padding: 0.5rem;
    transition: transform 180ms ease, border-color 180ms ease;
  }
  
  .project-card-link:hover .project-image,
  .project-card-link:focus-visible .project-image {
    transform: scale(1.02);
    border-color: rgba(56, 189, 248, 0.5);
  }
  
  .project-hint {
    margin: 1rem 0 0;
    color: var(--accent);
    font-weight: 800;
    font-size: 0.92rem;
  }
  .bot-noora-toggle {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 50;
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    transition:
      transform 220ms ease,
      opacity 160ms ease,
      right 220ms ease,
      bottom 220ms ease;
  }
  
  .bot-noora-toggle:hover {
    transform: translateY(-3px) scale(1.02);
  }
  
  .bot-noora-toggle.hidden {
    opacity: 0;
    pointer-events: none;
  }
  
  /* Big version shown near the top of the page */
  .bot-noora-toggle.bot-noora-large {
    right: 3rem;
    bottom: 3rem;
    transform: scale(1.18);
  }
  
  /* Small floating version after scrolling */
  .bot-noora-toggle.bot-noora-small {
    right: 1.25rem;
    bottom: 1.25rem;
    transform: scale(1);
  }
  
  .bot-noora-toggle.bot-noora-small:hover {
    transform: translateY(-3px) scale(1.02);
  }
  
  .bot-noora-button-img {
    width: 78px;
    height: 78px;
    object-fit: cover;
    border-radius: 999px;
    border: 2px solid rgba(56, 189, 248, 0.65);
    background: var(--panel);
    box-shadow:
      0 24px 70px rgba(0, 0, 0, 0.35),
      0 0 0 8px rgba(56, 189, 248, 0.08);
    display: block;
    transition: width 220ms ease, height 220ms ease;
  }
  
  .bot-noora-large .bot-noora-button-img {
    width: 104px;
    height: 104px;
  }
  
  .bot-noora-small .bot-noora-button-img {
    width: 72px;
    height: 72px;
  }
  
  .bot-noora-bubble {
    position: relative;
    padding: 0.65rem 0.9rem;
    border-radius: 1rem;
    border: 1px solid rgba(56, 189, 248, 0.55);
    background: rgba(17, 24, 39, 0.96);
    color: var(--text);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
    white-space: nowrap;
    transition:
      padding 220ms ease,
      border-radius 220ms ease,
      opacity 220ms ease;
  }
  
  .bot-noora-bubble strong {
    display: block;
    font-size: 1rem;
    line-height: 1.1;
  }
  
  .bot-noora-bubble small {
    display: block;
    margin-top: 0.2rem;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 600;
  }
  
  .bot-noora-bubble::after {
    content: "";
    position: absolute;
    right: -6px;
    top: 50%;
    width: 10px;
    height: 10px;
    transform: translateY(-50%) rotate(45deg);
    background: rgba(17, 24, 39, 0.96);
    border-top: 1px solid rgba(56, 189, 248, 0.55);
    border-right: 1px solid rgba(56, 189, 248, 0.55);
  }
  
  /* Smaller bubble after scrolling */
  .bot-noora-small .bot-noora-bubble {
    padding: 0.55rem 0.8rem;
    border-radius: 999px;
  }
  
  .bot-noora-small .bot-noora-bubble strong {
    font-size: 0.9rem;
  }
  
  .bot-noora-small .bot-noora-bubble small {
    display: none;
  }
  
  @media (max-width: 720px) {
    .bot-noora-toggle.bot-noora-large,
    .bot-noora-toggle.bot-noora-small {
      right: 0.9rem;
      bottom: 0.9rem;
      transform: scale(1);
    }
  
    .bot-noora-large .bot-noora-button-img,
    .bot-noora-small .bot-noora-button-img {
      width: 72px;
      height: 72px;
    }
  
    .bot-noora-bubble {
      display: none;
    }
  }
  
  .bot-noora-widget {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    width: min(420px, calc(100vw - 2rem));
    height: min(620px, calc(100vh - 2rem));
    z-index: 60;
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 1.4rem;
    background:
      radial-gradient(circle at top left, rgba(56, 189, 248, 0.16), transparent 18rem),
      rgba(17, 24, 39, 0.96);
    box-shadow: 0 30px 110px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(18px);
  }
  
  .bot-noora-widget.open {
    display: flex;
  }
  
  .bot-noora-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
  }
  
  .bot-noora-header strong {
    display: block;
    font-size: 1.05rem;
  }
  
  .bot-noora-header p {
    margin: 0.2rem 0 0;
    color: var(--muted);
    font-size: 0.9rem;
  }
  
  .bot-noora-close {
    width: 2rem;
    height: 2rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.7);
    color: var(--text);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
  }
  
  .bot-noora-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: grid;
    align-content: start;
    gap: 0.75rem;
  }
  
  .bot-message,
  .user-message {
    max-width: 88%;
    padding: 0.8rem 0.9rem;
    border-radius: 1rem;
    font-size: 0.95rem;
  }
  
  .bot-message {
    justify-self: start;
    background: rgba(31, 41, 55, 0.88);
    border: 1px solid var(--border);
    color: var(--muted);
  }
  
  .bot-message strong {
    display: block;
    color: var(--text);
    margin-bottom: 0.35rem;
  }
  
  .bot-message p {
    margin: 0;
  }
  
  .user-message {
    justify-self: end;
    background: var(--accent);
    color: #06101f;
    font-weight: 700;
  }
  
  .bot-message-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.75rem;
  }
  
  .bot-message-links a {
    display: inline-flex;
    padding: 0.35rem 0.55rem;
    border-radius: 999px;
    background: var(--accent-soft);
    border: 1px solid rgba(56, 189, 248, 0.45);
    color: var(--accent);
    font-weight: 800;
    font-size: 0.82rem;
  }
  
  .bot-noora-quick-actions {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
    padding: 0 1rem 1rem;
    border-bottom: 1px solid var(--border);
  }
  
  .bot-noora-quick-actions button {
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.65);
    color: var(--muted);
    padding: 0.45rem 0.65rem;
    font: inherit;
    font-size: 0.85rem;
    cursor: pointer;
  }
  
  .bot-noora-quick-actions button:hover {
    color: var(--text);
    border-color: rgba(56, 189, 248, 0.5);
  }
  
  .bot-noora-form {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
  }
  
  .bot-noora-form input {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.75rem 0.9rem;
    background: rgba(15, 23, 42, 0.8);
    color: var(--text);
    font: inherit;
  }
  
  .bot-noora-form input::placeholder {
    color: rgba(203, 213, 225, 0.65);
  }
  
  .bot-noora-form button {
    border: 0;
    border-radius: 999px;
    padding: 0.75rem 0.95rem;
    background: var(--accent);
    color: #06101f;
    font: inherit;
    font-weight: 900;
    cursor: pointer;
  }

  .bot-noora-title-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
  }
  
  .bot-info-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
  }
  
  .bot-info-button {
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 999px;
    border: 1px solid rgba(56, 189, 248, 0.5);
    background: var(--accent-soft);
    color: var(--accent);
    font: inherit;
    font-size: 0.8rem;
    font-weight: 900;
    line-height: 1;
    cursor: help;
  }
  
  .bot-info-tooltip {
    position: absolute;
    left: 50%;
    top: calc(100% + 0.55rem);
    transform: translateX(-50%) translateY(-4px);
    width: min(260px, 75vw);
    padding: 0.7rem 0.8rem;
    border-radius: 0.9rem;
    border: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.96);
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 500;
    line-height: 1.45;
    box-shadow: 0 20px 70px rgba(0, 0, 0, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 160ms ease, transform 160ms ease;
    z-index: 80;
  }
  
  .bot-info-wrap:hover .bot-info-tooltip,
  .bot-info-wrap:focus-within .bot-info-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  
  @media (max-width: 540px) {
    .bot-noora-widget {
      right: 0.75rem;
      bottom: 0.75rem;
      width: calc(100vw - 1.5rem);
      height: min(620px, calc(100vh - 1.5rem));
    }
  
    .bot-noora-toggle {
      right: 0.75rem;
      bottom: 0.75rem;
    }
  }
  
  @media (max-width: 860px) {
    .academic-grid {
      grid-template-columns: 1fr;
    }
  
    .academic-card p {
      min-height: auto;
    }
  }
  
  @media (max-width: 860px) {
    .skill-explorer-layout {
      grid-template-columns: 1fr;
    }
  
    .skill-menu {
      position: static;
    }
  
    .skill-columns {
      grid-template-columns: 1fr;
    }
  
    .skill-detail-header {
      flex-direction: column;
    }
  }

  .timeline {
    display: grid;
    gap: 1rem;
  }

  .timeline-item {
    border-left: 2px solid var(--accent);
    padding-left: 1rem;
  }

  .timeline-item p {
    margin: 0.4rem 0 0;
    color: var(--muted);
  }

  footer {
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    color: var(--muted);
  }

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

    nav {
      align-items: flex-start;
      flex-direction: column;
    }

    .hero {
      padding-top: 4rem;
    }
    .hero-layout {
      grid-template-columns: 1fr;
    }
  
    .hero-image-wrap {
      justify-content: flex-start;
    }
  }