:root {
      --ink: #eef5f6;
      --muted: #a9babf;
      --navy: #071117;
      --panel: rgba(9, 20, 26, 0.78);
      --panel-solid: #0c1b22;
      --line: rgba(153, 211, 222, 0.22);
      --cyan: #77d4e4;
      --amber: #e5ad55;
      --mx: 50%;
      --my: 50%;
    }

    * { box-sizing: border-box; }

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

    body {
      margin: 0;
      color: var(--ink);
      background: var(--navy);
      font-family: Inter, "Helvetica Neue", Arial, sans-serif;
      overflow-x: hidden;
    }

    a { color: inherit; }

    .backgrounds,
    .background,
    .shade,
    #neural-field {
      position: fixed;
      inset: 0;
      width: 100%;
      height: 100%;
      pointer-events: none;
    }

    .backgrounds { z-index: 0; overflow: hidden; }

    .background {
      inset: -7%;
      width: 114%;
      height: 114%;
      background-position: center;
      background-size: cover;
      filter: blur(13px) brightness(0.45) saturate(0.75);
      opacity: 0;
      transform: scale(1.04) translate3d(calc((var(--mx) - 50%) * -0.025), calc((var(--my) - 50%) * -0.025), 0);
      transition: opacity 1.1s ease;
    }

    .background.refs {
      background-image: url("/site/photos/people.jpg");
      opacity: 1;
    }

    .background.work {
      background-image: url("/site/photos/outcomes.jpg");
    }

    body[data-chapter="projects"] .background.refs { opacity: 0; }
    body[data-chapter="projects"] .background.work { opacity: 1; }

    .shade {
      z-index: 1;
      background:
        radial-gradient(circle at var(--mx) var(--my), rgba(39, 112, 128, 0.13), transparent 24rem),
        linear-gradient(180deg, rgba(5, 13, 17, 0.46), rgba(5, 13, 17, 0.89) 78%, #071117);
    }

    #neural-field {
      z-index: 2;
      opacity: 1;
    }

    .chapter {
      position: relative;
      z-index: 4;
      min-height: 100vh;
      padding: 112px clamp(22px, 6vw, 96px) 110px;
    }

    .chapter + .chapter {
      border-top: 1px solid rgba(255, 255, 255, 0.12);
    }

    .shell {
      width: min(1240px, 100%);
      margin: 0 auto;
    }

    .hero {
      display: grid;
      grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.65fr);
      gap: clamp(32px, 8vw, 110px);
      align-items: end;
      min-height: min(66vh, 700px);
      padding: 4vh 0 8vh;
    }

    .kicker {
      margin: 0 0 18px;
      color: var(--amber);
      font-size: 11px;
      font-weight: 700;
      letter-spacing: 0.2em;
      text-transform: uppercase;
    }

    h1,
    h2,
    h3,
    p { text-wrap: pretty; }

    h1,
    .chapter-title {
      margin: 0;
      font-family: Georgia, "Times New Roman", serif;
      font-weight: 400;
      letter-spacing: -0.035em;
    }

    h1 {
      max-width: 850px;
      font-size: clamp(54px, 8.4vw, 122px);
      line-height: 0.9;
    }

    .chapter-title {
      max-width: 920px;
      font-size: clamp(44px, 6.4vw, 90px);
      line-height: 0.95;
    }

    .hero-note,
    .chapter-lead {
      color: #d4e0e3;
      font-size: clamp(17px, 2vw, 23px);
      line-height: 1.55;
    }

    .hero-note {
      margin: 0 0 8px;
      padding: 20px 0 4px 22px;
      border-left: 2px solid var(--amber);
    }

    .stats {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      margin: 0 0 72px;
      border-top: 1px solid var(--line);
      border-bottom: 1px solid var(--line);
    }

    .stat {
      padding: 18px clamp(10px, 2vw, 24px);
      border-left: 1px solid var(--line);
    }

    .stat:first-child { border-left: 0; }

    .stat strong {
      display: block;
      color: var(--cyan);
      font-family: Georgia, "Times New Roman", serif;
      font-size: clamp(26px, 4vw, 44px);
      font-weight: 400;
    }

    .stat span {
      color: var(--muted);
      font-size: 11px;
      letter-spacing: 0.08em;
      text-transform: uppercase;
    }

    .featured-quote {
      position: relative;
      display: grid;
      grid-template-columns: 92px 1fr;
      gap: 24px;
      margin: 0 0 34px;
      padding: clamp(26px, 4vw, 48px);
      border: 1px solid rgba(229, 173, 85, 0.36);
      background: linear-gradient(135deg, rgba(63, 43, 20, 0.74), rgba(8, 22, 28, 0.86));
      box-shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
      backdrop-filter: blur(16px);
    }

    .quote-mark {
      color: var(--amber);
      font-family: Georgia, "Times New Roman", serif;
      font-size: 110px;
      line-height: 0.65;
    }

    blockquote { margin: 0; }

    .featured-quote blockquote {
      font-family: Georgia, "Times New Roman", serif;
      font-size: clamp(20px, 2.4vw, 30px);
      line-height: 1.38;
    }

    .attribution {
      margin-top: 18px;
      color: var(--muted);
      font-size: 13px;
      font-style: normal;
      line-height: 1.5;
    }

    .attribution strong {
      color: var(--ink);
      font-size: 14px;
    }

    .reference-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 20px;
      align-items: start;
    }

    .reference {
      position: relative;
      margin: 0;
      padding: 26px 24px 22px;
      border: 1px solid var(--line);
      background: var(--panel);
      box-shadow: 0 18px 48px rgba(0, 0, 0, 0.24);
      backdrop-filter: blur(16px);
      transition: transform 220ms ease, border-color 220ms ease, background 220ms ease;
    }

    .reference:hover {
      border-color: rgba(119, 212, 228, 0.55);
      background: rgba(10, 28, 35, 0.9);
      transform: translateY(-4px);
    }

    .reference::before {
      content: attr(data-index);
      position: absolute;
      top: 20px;
      right: 20px;
      color: rgba(119, 212, 228, 0.42);
      font-family: Georgia, "Times New Roman", serif;
      font-size: 24px;
    }

    .relation,
    .project-type {
      margin: 0 0 15px;
      color: var(--cyan);
      font-size: 9px;
      font-weight: 700;
      letter-spacing: 0.12em;
      text-transform: uppercase;
    }

    .reference blockquote {
      padding-right: 16px;
      font-family: Georgia, "Times New Roman", serif;
      font-size: 17px;
      line-height: 1.48;
    }

    .reference .attribution {
      display: grid;
      grid-template-columns: 42px minmax(0, 1fr);
      gap: 12px;
      align-items: center;
      padding-top: 16px;
      border-top: 1px solid var(--line);
    }

    /* A portrait where the person has one, otherwise their initials. */
    .portrait,
    .monogram {
      width: 42px;
      height: 42px;
      border-radius: 50%;
      border: 1px solid rgba(119, 212, 228, 0.28);
    }

    .portrait {
      object-fit: cover;
      filter: saturate(0.85) contrast(0.96);
    }

    .monogram {
      display: grid;
      place-items: center;
      background: rgba(119, 212, 228, 0.09);
      color: rgba(119, 212, 228, 0.72);
      font-size: 13px;
      font-weight: 600;
      letter-spacing: 0.04em;
    }

    .customer-end {
      margin-top: 68px;
      margin-bottom: 0;
    }

    .source-link {
      display: inline-flex;
      margin-top: 26px;
      color: var(--cyan);
      font-size: 12px;
      letter-spacing: 0.06em;
      text-decoration: none;
    }

    .source-link:hover { text-decoration: underline; }

    .chapter-head {
      display: grid;
      grid-template-columns: 1.15fr 0.85fr;
      gap: 60px;
      align-items: end;
      margin-bottom: 70px;
    }

    .chapter-lead {
      margin: 0;
      max-width: 560px;
      padding-left: 22px;
      border-left: 2px solid var(--cyan);
    }

    .section-label {
      display: flex;
      align-items: center;
      gap: 16px;
      margin: 68px 0 26px;
      color: var(--amber);
      font-size: 11px;
      font-weight: 700;
      letter-spacing: 0.16em;
      text-transform: uppercase;
    }

    .section-label::after {
      content: "";
      flex: 1;
      height: 1px;
      background: linear-gradient(90deg, rgba(229, 173, 85, 0.52), transparent);
    }

    .project-grid {
      display: grid;
      grid-template-columns: repeat(12, 1fr);
      gap: 20px;
    }

    .project {
      position: relative;
      grid-column: span 4;
      min-height: 350px;
      overflow: hidden;
      padding: 30px;
      border: 1px solid var(--line);
      background:
        linear-gradient(145deg, rgba(12, 31, 39, 0.94), rgba(8, 19, 25, 0.76));
      box-shadow: 0 22px 60px rgba(0, 0, 0, 0.27);
      backdrop-filter: blur(16px);
      transition: transform 220ms ease, border-color 220ms ease;
    }

    .project.featured {
      grid-column: span 8;
      min-height: 420px;
    }

    .cloud-gaming-project {
      isolation: isolate;
      display: flex;
      align-items: center;
      min-height: 560px;
      padding: clamp(34px, 6vw, 72px);
      background: #071117;
    }

    .cloud-gaming-project::before {
      content: "";
      position: absolute;
      z-index: 1;
      inset: 0;
      background:
        linear-gradient(90deg, rgba(5, 13, 17, 0.98) 0%, rgba(5, 13, 17, 0.88) 46%, rgba(5, 13, 17, 0.24) 78%, rgba(5, 13, 17, 0.5) 100%),
        linear-gradient(0deg, rgba(5, 13, 17, 0.88), transparent 48%);
      pointer-events: none;
    }

    .project-video {
      position: absolute;
      z-index: 0;
      inset: 0;
      width: 100%;
      height: 100%;
      object-fit: cover;
      filter: saturate(0.82) contrast(1.05);
    }

    .cloud-gaming-content {
      position: relative;
      z-index: 2;
      width: min(650px, 66%);
    }

    .cloud-gaming-project h3 {
      font-size: clamp(38px, 5vw, 62px);
    }

    .service-links {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
    }

    .project-link {
      display: block;
      color: inherit;
      text-decoration: none;
    }

    .project-link:focus-visible {
      border-color: var(--cyan);
      outline: 2px solid rgba(119, 212, 228, 0.3);
      outline-offset: 3px;
    }

    .visit-button {
      position: relative;
      z-index: 2;
      display: inline-flex;
      margin-top: 22px;
      padding: 9px 12px;
      border: 1px solid rgba(229, 173, 85, 0.52);
      color: var(--amber);
      font-size: 10px;
      font-weight: 700;
      letter-spacing: 0.08em;
      text-transform: uppercase;
    }

    .project-link:hover .visit-button,
    .project-link:focus-visible .visit-button {
      border-color: var(--amber);
      background: rgba(229, 173, 85, 0.09);
    }

    .project:hover {
      border-color: rgba(229, 173, 85, 0.5);
      transform: translateY(-5px);
    }

    .project::after {
      content: "";
      position: absolute;
      right: -70px;
      bottom: -90px;
      width: 210px;
      height: 210px;
      border: 1px solid rgba(119, 212, 228, 0.16);
      border-radius: 50%;
      box-shadow:
        0 0 0 24px rgba(119, 212, 228, 0.035),
        0 0 0 52px rgba(119, 212, 228, 0.02);
    }

    .project h3,
    .work-card h3 {
      position: relative;
      z-index: 1;
      margin: 0 0 14px;
      font-family: Georgia, "Times New Roman", serif;
      font-size: clamp(27px, 3vw, 40px);
      font-weight: 400;
      line-height: 1;
    }

    .project p:not(.project-type),
    .work-card p {
      position: relative;
      z-index: 1;
      color: #c3d1d5;
      font-size: 14px;
      line-height: 1.58;
    }

    .proof {
      position: relative;
      z-index: 1;
      margin-top: 22px;
      padding-top: 18px;
      border-top: 1px solid var(--line);
      color: var(--amber);
      font-size: 12px;
      line-height: 1.5;
    }

    .tags {
      position: relative;
      z-index: 1;
      display: flex;
      flex-wrap: wrap;
      gap: 7px;
      margin-top: 20px;
    }

    .tags span {
      padding: 6px 8px;
      border: 1px solid rgba(119, 212, 228, 0.2);
      color: #a9cbd2;
      font-size: 10px;
    }

    .work-timeline {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 1px;
      border: 1px solid var(--line);
      background: var(--line);
    }

    /* The grid draws its own gridlines, so an odd number of cards would leave
       a lit, empty half-cell. Let the last one take the whole row instead. */
    .work-timeline > .work-card:last-child:nth-child(odd) {
      grid-column: 1 / -1;
    }

    .work-card {
      min-height: 300px;
      padding: 30px;
      background: rgba(8, 21, 27, 0.93);
    }

    .work-card .meta {
      display: flex;
      justify-content: space-between;
      gap: 16px;
      margin-bottom: 18px;
      color: var(--cyan);
      font-size: 10px;
      font-weight: 700;
      letter-spacing: 0.08em;
      text-transform: uppercase;
    }

    .work-card h3 { font-size: 30px; }

    .work-card ul {
      margin: 18px 0 0;
      padding: 0;
      list-style: none;
    }

    .work-card li {
      position: relative;
      margin-top: 9px;
      padding-left: 16px;
      color: var(--muted);
      font-size: 13px;
      line-height: 1.45;
    }

    .work-card li::before {
      content: "";
      position: absolute;
      top: 0.55em;
      left: 0;
      width: 6px;
      height: 1px;
      background: var(--amber);
    }

    .closing {
      display: flex;
      flex-wrap: wrap;
      gap: 14px 28px;
      align-items: center;
      justify-content: space-between;
      margin-top: 72px;
      padding-top: 28px;
      border-top: 1px solid var(--line);
      color: var(--muted);
    }

    .closing strong {
      color: var(--ink);
      font-family: Georgia, "Times New Roman", serif;
      font-size: clamp(24px, 3vw, 38px);
      font-weight: 400;
    }

    .closing a {
      color: var(--cyan);
      font-size: 12px;
      letter-spacing: 0.06em;
      text-decoration: none;
    }

    .closing a:hover { text-decoration: underline; }

    @media (max-width: 900px) {
      .hero,
      .chapter-head {
        grid-template-columns: 1fr;
        gap: 28px;
      }

      .hero { min-height: auto; padding-top: 10vh; }
      .reference-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .project,
      .project.featured { grid-column: span 6; }
    }

    @media (max-width: 660px) {
      .chapter { padding-top: 100px; }
      h1 { font-size: clamp(48px, 17vw, 76px); }
      .stats { grid-template-columns: 1fr; }
      .stat { border-top: 1px solid var(--line); border-left: 0; }
      .stat:first-child { border-top: 0; }

      .featured-quote {
        grid-template-columns: 1fr;
      }

      .quote-mark { height: 38px; }
      .reference-grid { grid-template-columns: 1fr; }
      .project,
      .project.featured { grid-column: 1 / -1; min-height: auto; }
      .cloud-gaming-project { min-height: 610px; }
      .cloud-gaming-content { width: 100%; }
      .cloud-gaming-project::before {
        background:
          linear-gradient(90deg, rgba(5, 13, 17, 0.96), rgba(5, 13, 17, 0.74)),
          linear-gradient(0deg, rgba(5, 13, 17, 0.96), transparent 48%);
      }
      .work-timeline { grid-template-columns: 1fr; }
    }

    @media (prefers-reduced-motion: reduce) {
      html { scroll-behavior: auto; }
      .background,
      .reference,
      .project { transition: none; }
    }
