    :root {
      --black: #030405;
      --nav: #020202;
      --ink: #141519;
      --muted: #5f626b;
      --pink: #bd4e70;
      --left-top: #151d2d;
      --left-bottom: #07090e;
      --right-top: #d4d8e3;
      --right-bottom: #8a94ad;
      --card: rgba(255, 255, 255, 0.97);
      --shell-width: min(70vw, 1400px);
      --nav-height: 70px;
      --radius: 22px;
      --transition: 280ms ease;
      --font-main: "Segoe UI", Inter, Arial, sans-serif;
      /* brand.png has a large transparent canvas around the visible mark. */
      --brand-zoom: 5;
    }

    * {
      box-sizing: border-box;
    }

    html {
      scroll-behavior: smooth;
      background: var(--left-top);
    }

    body {
      min-width: 320px;
      min-height: 100vh;
      min-height: 100dvh;
      margin: 0;
      overflow-x: hidden;
      color: var(--ink);
      background:
        linear-gradient(
          to right,
          var(--left-top) 0%,
          var(--left-bottom) 27%,
          #08090d 50%,
          var(--right-bottom) 100%
        );
      font-family: var(--font-main);
    }

    a {
      color: inherit;
    }

    button,
    a {
      -webkit-tap-highlight-color: transparent;
    }

    .page {
      position: relative;
      isolation: isolate;
      width: 100%;
      min-height: 100vh;
      min-height: 100dvh;
      display: flex;
      flex-direction: column;
    }

    /* Fixed decorative layer. The image is stored above /work/. */
    .decorative-background {
      position: fixed;
      inset: 0;
      z-index: -2;
      overflow: hidden;
      pointer-events: none;
      background:
        linear-gradient(to right, var(--left-top), var(--left-bottom) 38%, transparent 64%),
        linear-gradient(to bottom, transparent 48%, rgba(4, 6, 10, 0.96) 92%);
    }

    .decorative-background::before {
      content: "";
      position: absolute;
      top: var(--nav-height);
      bottom: 0;
      left: 0;
      width: 42%;
      background:
        linear-gradient(to right, rgba(7, 10, 17, 0.06), rgba(7, 10, 17, 0.90)),
        linear-gradient(to bottom, transparent 52%, rgba(4, 6, 10, 0.98)),
        url("../images/work-bg.jpg") left center / cover no-repeat;
      opacity: 0.79;
    }

    /*
      A fixed reading veil above the decorative image. It stays in the same
      viewport position while project cards scroll over it.
    */
    .fixed-reading-gradient {
      position: fixed;
      top: var(--nav-height);
      bottom: 0;
      left: 50%;
      z-index: -1;
      width: var(--shell-width);
      min-width: 860px;
      transform: translateX(-50%);
      pointer-events: none;
      background:
        linear-gradient(
          to bottom,
          #ffffff 0%,
          #ffffff 27%,
          rgba(250, 251, 253, 0.97) 34%,
          rgba(220, 224, 234, 0.69) 49%,
          rgba(150, 159, 181, 0.34) 64%,
          rgba(52, 63, 86, 0.13) 80%,
          rgba(10, 14, 24, 0) 100%
        );
    }

    .site-shell {
      position: relative;
      width: var(--shell-width);
      min-width: 860px;
      margin: 0 auto;
      display: flex;
      flex: 1 0 auto;
      flex-direction: column;
      background: transparent;
      box-shadow: 0 0 44px rgba(0, 0, 0, 0.05);
    }

    /* Navigation */
    .site-header {
      position: sticky;
      top: 0;
      z-index: 50;
      height: var(--nav-height);
      flex-shrink: 0;
      background: var(--nav);
    }

    /* Continue the black navigation bar behind the enlarged brand. */
    .site-header::before {
      content: "";
      position: absolute;
      top: 0;
      right: 100%;
      bottom: 0;
      width: 50vw;
      background: var(--nav);
      pointer-events: none;
    }

    .nav-inner {
      position: relative;
      width: 100%;
      height: 100%;
      padding: 0 28px;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .brand-logo {
      position: absolute;
      left: 78px;
      top: 50%;
      width: 48px;
      height: 48px;
      transform: translateY(-50%);
      text-decoration: none;
      overflow: visible;
    }

    .brand-logo img {
      display: block;
      width: 100%;
      height: 100%;
      object-fit: contain;
      transform: scale(var(--brand-zoom));
      transform-origin: center;
    }

    .brand-logo picture {
      display: block;
      width: 100%;
      height: 100%;
    }

    .nav-links {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: clamp(22px, 2.4vw, 38px);
      font-size: 0.96rem;
    }

    .nav-links a {
      position: relative;
      color: rgba(255, 255, 255, 0.82);
      text-decoration: none;
      white-space: nowrap;
      transition: color var(--transition), transform var(--transition);
    }

    .nav-links a::after {
      content: "";
      position: absolute;
      right: 0;
      bottom: -9px;
      left: 0;
      height: 2px;
      background: var(--pink);
      transform: scaleX(0);
      transform-origin: center;
      transition: transform var(--transition);
    }

    .nav-links a:hover,
    .nav-links a[aria-current="page"] {
      color: #fff;
    }

    .nav-links a:hover::after,
    .nav-links a[aria-current="page"]::after {
      transform: scaleX(1);
    }

    .language-selector {
      position: absolute;
      right: 78px;
      display: flex;
      align-items: center;
      gap: 6px;
      padding-left: 16px;
      border-left: 1px solid rgba(255, 255, 255, 0.28);
      font-size: 0.78rem;
      line-height: 1;
      letter-spacing: 0.06em;
    }

    .language-selector a,
    .language-selector span {
      position: relative;
      color: rgba(255, 255, 255, 0.78);
      text-decoration: none;
    }

    .language-selector a:hover,
    .language-selector .current-language {
      color: #fff;
    }

    .language-selector .current-language::after {
      content: "";
      position: absolute;
      right: 0;
      bottom: -7px;
      left: 0;
      height: 2px;
      background: var(--pink);
    }

    .menu-toggle {
      display: none;
      width: 44px;
      height: 44px;
      padding: 10px;
      border: 0;
      background: transparent;
      color: #fff;
      cursor: pointer;
    }

    .menu-toggle span {
      display: block;
      width: 100%;
      height: 2px;
      margin: 5px 0;
      background: currentColor;
      transition: transform var(--transition), opacity var(--transition);
    }

    /* Main surface: almost opaque at the top, fading into the fixed image. */
    .main-content {
      position: relative;
      flex: 1 0 auto;
      min-height: 760px;
      background: transparent;
    }

    /* Constant-height slot prevents a jump when the visible heading compacts. */
    .page-heading {
      position: sticky;
      top: var(--nav-height);
      z-index: 30;
      height: 190px;
      pointer-events: none;
    }

    .heading-panel {
      position: relative;
      width: 100%;
      height: 190px;
      padding: 44px clamp(46px, 5vw, 76px) 30px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 40px;
      background: rgba(255, 255, 255, 0.96);
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
      box-shadow: 0 1px 0 rgba(0, 0, 0, 0.025);
      transition: height 320ms ease, padding 320ms ease, background 320ms ease;
      pointer-events: auto;
    }

    .heading-panel::after {
      content: "";
      position: absolute;
      right: 0;
      bottom: -44px;
      left: 0;
      height: 44px;
      background: linear-gradient(to bottom, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0));
      pointer-events: none;
      transition: opacity var(--transition);
    }

    .page-heading h1 {
      margin: 0;
      color: #060606;
      font-size: clamp(2.1rem, 3.1vw, 3rem);
      line-height: 1;
      letter-spacing: -0.035em;
      text-shadow: 0 5px 6px rgba(0, 0, 0, 0.20);
      transition: font-size 320ms ease, transform 320ms ease;
    }

    .page-identity {
      min-width: 230px;
      transition: transform 320ms ease;
    }

    .page-identity strong {
      display: block;
      margin-bottom: 8px;
      color: var(--pink);
      font-family: Impact, "Arial Narrow", sans-serif;
      font-size: clamp(2rem, 2.7vw, 2.7rem);
      font-weight: 500;
      line-height: 0.88;
      text-transform: uppercase;
      text-shadow: 0 5px 9px rgba(60, 50, 95, 0.35);
      transition: font-size 320ms ease, margin 320ms ease;
    }

    .page-identity span {
      display: block;
      color: rgba(0, 0, 0, 0.75);
      font-size: 0.82rem;
      line-height: 1.45;
      opacity: 1;
      transition: opacity 180ms ease, max-height 260ms ease, transform 260ms ease;
    }

    body.is-scrolled .heading-panel {
      height: 92px;
      padding-top: 12px;
      padding-bottom: 12px;
      background: rgba(255, 255, 255, 0.93);
    }

    body.is-scrolled .page-heading h1 {
      font-size: 1.7rem;
    }

    body.is-scrolled .page-identity strong {
      margin-bottom: 0;
      font-size: 1.55rem;
    }

    body.is-scrolled .page-identity span {
      max-height: 0;
      opacity: 0;
      transform: translateY(-4px);
      overflow: hidden;
    }

    .work-layout {
      position: relative;
      z-index: 2;
      width: 100%;
      padding: 44px clamp(46px, 5vw, 76px) 90px;
      display: grid;
      grid-template-columns: minmax(220px, 0.72fr) minmax(460px, 1.75fr);
      align-items: start;
      gap: clamp(36px, 5vw, 78px);
    }

    /* Desktop index */
    .project-index {
      position: sticky;
      top: 190px;
      padding: 12px;
      border: 1px solid rgba(255, 255, 255, 0.46);
      border-radius: 17px;
      background: rgba(255, 255, 255, 0.80);
      box-shadow: 0 12px 30px rgba(8, 11, 18, 0.13);
      backdrop-filter: blur(13px);
      -webkit-backdrop-filter: blur(13px);
    }

    .project-index ol {
      margin: 0;
      padding: 0;
      list-style: none;
      counter-reset: projects;
    }

    .project-index li {
      counter-increment: projects;
      margin: 0 0 3px;
    }

    .project-index a {
      position: relative;
      display: grid;
      grid-template-columns: 31px 1fr;
      gap: 8px;
      padding: 10px 10px 10px 14px;
      border-left: 2px solid transparent;
      color: rgba(14, 15, 18, 0.82);
      font-size: 0.91rem;
      line-height: 1.4;
      text-decoration: none;
      transition: color var(--transition), border-color var(--transition), transform var(--transition);
    }

    .project-index a::before {
      content: "0" counter(projects);
      color: var(--pink);
      font-size: 0.76rem;
      font-weight: 700;
      letter-spacing: 0.04em;
    }

    .project-index a:hover,
    .project-index a.is-active {
      border-left-color: var(--pink);
      color: #050505;
      transform: translateX(4px);
    }

    .project-index a.is-active {
      background: rgba(255, 255, 255, 0.46);
    }

    /* Project cards */
    .project-list {
      display: grid;
      gap: 28px;
    }

    .project-card {
      scroll-margin-top: 185px;
      padding: clamp(30px, 3vw, 48px);
      border: 1px solid rgba(255, 255, 255, 0.54);
      border-radius: var(--radius);
      background: var(--card);
      box-shadow: 0 15px 36px rgba(12, 15, 24, 0.13);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
    }

    .project-number {
      display: block;
      margin-bottom: 10px;
      color: var(--pink);
      font-size: 0.75rem;
      font-weight: 800;
      letter-spacing: 0.14em;
      text-transform: uppercase;
    }

    .project-card h2 {
      margin: 0 0 15px;
      font-size: clamp(1.16rem, 1.5vw, 1.4rem);
      line-height: 1.28;
    }

    .project-card h3 {
      margin: 24px 0 10px;
      font-size: 0.94rem;
    }

    .project-card p,
    .project-card li {
      color: #282b31;
      font-size: 0.96rem;
      line-height: 1.68;
    }

    .project-card p {
      margin: 0 0 12px;
    }

    .project-card ul {
      margin: 0;
      padding-left: 22px;
    }

    .project-card li + li {
      margin-top: 5px;
    }

    .tech-tags {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-top: 14px;
    }

    .tech-tags span {
      padding: 7px 11px;
      border: 1px solid rgba(189, 78, 112, 0.17);
      border-radius: 999px;
      background: rgba(189, 78, 112, 0.07);
      color: #713248;
      font-size: 0.78rem;
      font-weight: 650;
    }

    /* Single global back-to-top control */
    .back-to-top {
      position: fixed;
      right: max(18px, calc((100vw - var(--shell-width)) / 2 + 12px));
      bottom: 24px;
      z-index: 90;
      width: 36px;
      height: 36px;
      border: 1px solid rgba(255, 255, 255, 0.62);
      border-radius: 50%;
      display: grid;
      place-items: center;
      background: rgba(255, 255, 255, 0.94);
      color: var(--pink);
      box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
      cursor: pointer;
      opacity: 0;
      visibility: hidden;
      transform: translateY(12px);
      transition: opacity var(--transition), visibility var(--transition), transform var(--transition), background var(--transition);
    }

    .back-to-top::before {
      content: "";
      width: 8px;
      height: 8px;
      border-top: 2px solid currentColor;
      border-left: 2px solid currentColor;
      transform: translateY(3px) rotate(45deg);
    }

    .back-to-top.is-visible {
      opacity: 1;
      visibility: visible;
      transform: translateY(0);
    }

    .back-to-top:hover {
      background: #fff;
    }

    .bottom-gradient {
      width: 100%;
      height: 22px;
      flex-shrink: 0;
      background: linear-gradient(to right, var(--left-bottom), #090a0f 54%, var(--right-bottom));
    }

    /* Flexible footer: never overlays the project cards. */
    .site-footer {
      flex-shrink: 0;
      padding: 25px clamp(34px, 5vw, 74px);
      background: #08090d;
      color: rgba(255, 255, 255, 0.74);
    }

    .footer-inner {
      width: var(--shell-width);
      min-width: 860px;
      margin: 0 auto;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 24px;
    }

    .copyright {
      margin: 0;
      font-size: 0.88rem;
    }

    .footer-links {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 22px;
    }

    .footer-links a {
      font-size: 0.88rem;
      text-decoration: none;
      transition: color var(--transition), transform var(--transition);
    }

    .footer-links a:hover {
      color: #fff;
      transform: translateY(-1px);
    }

    /* Fixed footer only where the viewport has enough room for it. */
@media (min-width: 1101px) and (min-height: 720px) {
  .main-content {
    padding-bottom: 104px;
  }

  .bottom-gradient {
    position: fixed;
    right: 0;
    bottom: 70px;
    left: 0;

    z-index: 69;

    display: block;
    height: 22px;
  }

      .site-footer {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 70;
        height: 70px;
        padding-top: 0;
        padding-bottom: 0;
        display: flex;
        align-items: center;
        box-shadow: 0 -12px 30px rgba(0, 0, 0, 0.10);
      }

      .footer-inner {
        height: 100%;
      }

  .back-to-top {
    bottom: 104px;
  }
}

    @media (max-width: 1100px) {
      :root {
        --shell-width: calc(100vw - 48px);
      }

      .site-shell,
      .footer-inner,
      .fixed-reading-gradient {
        min-width: 0;
      }

      .work-layout {
        grid-template-columns: minmax(190px, 0.65fr) minmax(430px, 1.6fr);
      }
    }

    /* Compact tablets and short landscape screens need the full content width.
       Keep the index for larger tablets such as iPad Pro (1024px and wider). */
    @media (max-width: 950px), (max-height: 520px) {
      .work-layout {
        grid-template-columns: minmax(0, 1fr);
        padding-right: clamp(24px, 6vw, 58px);
        padding-left: clamp(24px, 6vw, 58px);
      }

      .project-index {
        display: none;
      }

      .project-list {
        width: min(100%, 790px);
        margin-inline: auto;
      }
    }

    @media (max-width: 760px) {
      :root {
        --shell-width: calc(100vw - 24px);
        --nav-height: 60px;
        --radius: 17px;
      }

      body {
        background: #080b12;
      }

      .decorative-background::before {
        top: var(--nav-height);
        width: 100%;
        opacity: 0.56;
        background:
          linear-gradient(to right, rgba(7, 10, 17, 0.44), rgba(7, 10, 17, 0.72)),
          linear-gradient(to bottom, transparent 42%, rgba(4, 6, 10, 0.98)),
          url("../images/work-bg.jpg") left center / cover no-repeat;
      }

      .site-header {
        height: var(--nav-height);
      }

      .nav-inner {
        justify-content: flex-end;
        padding: 0 12px;
      }

      .brand-logo {
        left: 12px;
        width: 43px;
        height: 43px;
      }

      .brand-logo img {
        transform: none;
      }

      .menu-toggle {
        display: block;
      }

      .language-selector {
        right: 64px;
        padding-left: 10px;
        font-size: 0.72rem;
      }

      .nav-links {
        position: absolute;
        top: var(--nav-height);
        right: 0;
        left: 0;
        padding: 16px 20px 20px;
        display: grid;
        gap: 4px;
        background: rgba(2, 2, 2, 0.97);
        box-shadow: 0 14px 24px rgba(0, 0, 0, 0.22);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-8px);
        transition: opacity var(--transition), visibility var(--transition), transform var(--transition);
      }

      .nav-links.is-open {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
      }

      .nav-links a {
        padding: 10px 4px;
      }

      .nav-links a::after {
        bottom: 4px;
        transform-origin: left;
      }

      .main-content {
        min-height: 0;
        background: transparent;
      }

      .fixed-reading-gradient {
        background:
          linear-gradient(
            to bottom,
            rgba(255, 255, 255, 0.96) 0%,
            rgba(255, 255, 255, 0.94) 25%,
            rgba(220, 224, 234, 0.66) 47%,
            rgba(139, 150, 175, 0.31) 67%,
            rgba(38, 49, 70, 0.11) 84%,
            rgba(8, 12, 21, 0) 100%
          );
      }

      .page-heading {
        height: 142px;
      }

      .heading-panel {
        height: 142px;
        padding: 26px 22px 24px;
        gap: 16px;
      }

      .heading-panel::after {
        bottom: -34px;
        height: 34px;
      }

      .page-heading h1 {
        font-size: 2rem;
      }

      .page-identity {
        min-width: 128px;
        text-align: right;
      }

      .page-identity strong {
        font-size: 1.65rem;
      }

      .page-identity span {
        font-size: 0.72rem;
      }

      body.is-scrolled .heading-panel {
        height: 70px;
        padding: 8px 18px;
      }

      body.is-scrolled .page-heading h1 {
        font-size: 1.35rem;
      }

      body.is-scrolled .page-identity strong {
        font-size: 1.15rem;
      }

      .work-layout {
        padding: 22px 10px 64px;
        display: block;
      }

      .project-index {
        display: none;
      }

      .project-list {
        gap: 18px;
      }

      .project-card {
        scroll-margin-top: 145px;
        padding: 27px 22px;
        background: rgba(255, 255, 255, 0.95);
      }

      .project-card p,
      .project-card li {
        font-size: 0.93rem;
      }

      .back-to-top {
        right: 18px;
        bottom: 18px;
        width: 44px;
        height: 44px;
      }

      .site-footer {
        padding: 24px 20px;
      }

      .footer-inner {
        width: var(--shell-width);
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
      }

      .footer-links {
        gap: 14px 20px;
      }
    }

    @media (max-width: 420px) {
      :root {
        --shell-width: calc(100vw - 18px);
      }

      .heading-panel {
        padding-inline: 18px;
      }

      .page-heading h1 {
        font-size: 1.75rem;
      }

      .page-identity strong {
        font-size: 1.48rem;
      }

      .page-identity span {
        max-width: 124px;
        margin-left: auto;
      }

      .project-card {
        padding: 24px 19px;
      }
    }

    @media (prefers-reduced-motion: reduce) {
      html { scroll-behavior: auto; }
      *, *::before, *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
      }
    }
  
