*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

    :root {
      --navy: #2C4A6E;
      --navy-dark: #1E3652;
      --warm: #C4704B;
      --warm-light: rgba(196, 112, 75, 0.06);
      --text: #111318;
      --muted: #6B7280;
      --border: #E2E4E9;
      --bg: #F8F7F4;
      --surface: #FFFFFF;
    }

    body {
      font-family: 'Instrument Sans', 'DM Sans', sans-serif;
      background: var(--bg);
      color: var(--text);
      line-height: 1.5;
      -webkit-font-smoothing: antialiased;
    }

    .container {
      max-width: 1100px;
      margin: 0 auto;
      padding: 0 max(24px, env(safe-area-inset-right)) 0 max(24px, env(safe-area-inset-left));
    }

    /* Page nav top-right */
    .page-nav-top {
      position: fixed;
      top: 20px;
      right: 24px;
      font-family: 'JetBrains Mono', monospace;
      font-size: 0.7rem;
      color: var(--muted);
      letter-spacing: 0.04em;
      z-index: 50;
      display: flex;
      align-items: center;
      gap: 4px;
      background: rgba(248, 247, 244, 0.9);
      backdrop-filter: blur(8px);
      padding: 6px 12px;
      border-radius: 20px;
      border: 1px solid var(--border);
    }

    .page-nav-top .current-page {
      color: var(--text);
      font-weight: 500;
    }

    .page-nav-top a {
      color: var(--navy);
      text-decoration: none;
      border-bottom: 1px solid transparent;
      padding: 8px 4px 1px;
      min-width: 28px;
      min-height: 44px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }

    .page-nav-top a:hover {
      border-bottom-color: var(--navy);
    }

    /* Hero */
    .hero {
      padding: 48px 0 16px;
      border-bottom: 1px solid var(--border);
      margin-bottom: 0;
    }

    /* Monumental stats */
    .hero-stats {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 0;
      margin-bottom: 20px;
    }

    .hero-stat {
      display: flex;
      flex-direction: column;
    }

    .hero-stat strong {
      font-family: 'Playfair Display', serif;
      font-size: 3.2rem;
      font-weight: 700;
      color: var(--text);
      letter-spacing: -0.04em;
      line-height: 1;
    }

    .hero-stat span {
      font-family: 'JetBrains Mono', monospace;
      font-size: 0.6rem;
      color: var(--warm);
      letter-spacing: 0.08em;
      text-transform: uppercase;
      margin-top: 4px;
    }

    .hero h1 {
      font-family: 'Instrument Sans', sans-serif;
      font-size: 1.15rem;
      font-weight: 500;
      color: var(--muted);
      letter-spacing: -0.01em;
      line-height: 1.3;
      margin-bottom: 6px;
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .claude-logo {
      width: 24px;
      height: 24px;
      flex-shrink: 0;
    }

    .hero .meta {
      font-family: 'JetBrains Mono', monospace;
      font-size: 0.68rem;
      color: var(--muted);
      letter-spacing: 0.02em;
      padding-bottom: 14px;
    }

    .hero .meta span { color: var(--navy); }
    .hero .meta .story-link { color: var(--warm); text-decoration: none; border-bottom: 1px solid var(--warm); padding: 12px 0; }
    .hero .meta .story-link:hover { color: var(--navy); border-color: var(--navy); }

    .hero-quote {
      font-family: 'Playfair Display', serif;
      font-size: 0.95rem;
      font-style: italic;
      color: var(--muted);
      border: none;
      border-left: 2px solid var(--warm);
      margin: 12px 0 0;
      padding: 0 0 0 16px;
      max-width: 520px;
      line-height: 1.6;
    }
    .hero-quote cite {
      display: block;
      font-family: 'Instrument Sans', sans-serif;
      font-style: normal;
      font-size: 0.72rem;
      letter-spacing: 0.03em;
      margin-top: 4px;
      color: var(--warm);
    }

    /* Reduced motion */
    @media (prefers-reduced-motion: reduce) {
      *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
      }
    }

    /* Print */
    @media print {
      .case-study, .case-study-category, .case-study-name, .case-study-problem, .case-study-solution, .case-study-link, .case-study-number {
        opacity: 1 !important;
        transform: none !important;
      }
      .page-nav-top, .closing-cta, .thumb-dots { display: none; }
      .closing-cta { background: white; color: black; }
      body { background: white; }
    }

    /* Category colors */
    .cat-websites { color: #047857; }
    .cat-webapps { color: #4338CA; }
    .cat-games { color: #B45309; }
    .cat-tools { color: #475569; }
    .cat-data { color: #7C3AED; }
    .cat-personal { color: #BE185D; }
    .cat-prototypes { color: #BE185D; }

    /* Category tints via :has() */
    .case-study:has(.cat-webapps) { background: rgba(67, 56, 202, 0.02); }
    .case-study:has(.cat-websites) { background: rgba(4, 120, 87, 0.02); }
    .case-study:has(.cat-games) { background: rgba(180, 83, 9, 0.02); }
    .case-study:has(.cat-tools) { background: rgba(71, 85, 105, 0.02); }
    .case-study:has(.cat-data) { background: rgba(124, 58, 237, 0.02); }

    /* Case Study Sections */
    .case-studies {
      padding-top: 28px;
    }

    .case-study {
      padding: 50px 0;
      border-bottom: 1px solid var(--border);
      opacity: 0;
      transform: translateY(40px);
      transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .case-study:last-child {
      border-bottom: none;
    }

    .case-study.visible {
      opacity: 1;
      transform: translateY(0);
    }

    .case-study-inner {
      max-width: 1100px;
      margin: 0 auto;
      padding: 0 24px;
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 44px;
      align-items: center;
    }

    /* Project #1: hero treatment — larger image */
    .case-study:first-child .case-study-inner {
      grid-template-columns: 1.25fr 0.75fr;
      max-width: 1200px;
      gap: 56px;
    }

    .case-study:first-child .case-study-name {
      font-size: 2.8rem;
    }

    .case-study:first-child .thumb-slides {
      box-shadow: 0 16px 64px rgba(0, 0, 0, 0.12), 0 4px 20px rgba(0, 0, 0, 0.06);
    }

    /* Alternate layout: even sections flip image to right */
    .case-study:nth-child(even) .case-study-text {
      order: -1;
    }

    /* Image side */
    .case-study-image {
      position: relative;
    }

    /* Thumbnail Carousel */
    .thumb-carousel {
      position: relative;
    }

    .thumb-slides {
      position: relative;
      aspect-ratio: 16/10;
      border-radius: 8px;
      overflow: hidden;
      box-shadow: 0 8px 40px rgba(0, 0, 0, 0.08), 0 2px 12px rgba(0, 0, 0, 0.04);
      background: #ECEAE6;
      transition: box-shadow 0.4s ease;
      cursor: pointer;
    }

    .case-study:hover .thumb-slides {
      box-shadow: 0 12px 56px rgba(0, 0, 0, 0.14), 0 4px 16px rgba(0, 0, 0, 0.07);
    }

    .thumb-slide {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      object-fit: cover;
      opacity: 0;
      transition: opacity 0.8s ease;
    }

    .thumb-slide.active {
      opacity: 1;
    }

    .thumb-dots {
      display: flex;
      justify-content: center;
      gap: 6px;
      margin-top: 10px;
    }

    .thumb-dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: #D1D5DB;
      transition: background 0.3s ease;
      padding: 8px;
      background-clip: content-box;
      cursor: pointer;
    }

    .thumb-dot.active {
      background: var(--warm);
      background-clip: content-box;
    }

    .case-study-image .img-placeholder {
      width: 100%;
      aspect-ratio: 16/10;
      background: #ECEAE6;
      border-radius: 8px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-family: 'Playfair Display', serif;
      font-size: 3rem;
      color: #D1D5DB;
    }

    /* Text side */
    .case-study-text {
      position: relative;
    }

    /* Section number watermark — committed: bold, cropped, warm */
    .case-study-number {
      font-family: 'Playfair Display', serif;
      font-size: 8rem;
      font-weight: 700;
      line-height: 1;
      color: rgba(196, 112, 75, 0.07);
      position: absolute;
      top: -40px;
      left: -8px;
      pointer-events: none;
      user-select: none;
      opacity: 0;
      transform: translateY(20px);
      transition: opacity 0.6s ease 0.15s, transform 0.6s ease 0.15s;
    }

    .case-study.visible .case-study-number {
      opacity: 1;
      transform: translateY(0);
    }

    .case-study-category {
      font-family: 'JetBrains Mono', monospace;
      font-size: 0.65rem;
      font-weight: 500;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      margin-bottom: 8px;
      position: relative;
      z-index: 1;
      opacity: 0;
      transform: translateY(10px);
      transition: opacity 0.5s ease 0.1s, transform 0.5s ease 0.1s;
    }

    .case-study.visible .case-study-category {
      opacity: 1;
      transform: translateY(0);
    }

    .case-study-name {
      font-family: 'Playfair Display', serif;
      font-size: 2.4rem;
      font-weight: 700;
      color: var(--text);
      letter-spacing: -0.03em;
      line-height: 1.15;
      margin-bottom: 17px;
      position: relative;
      z-index: 1;
      opacity: 0;
      transform: translateY(10px);
      transition: opacity 0.5s ease 0.2s, transform 0.5s ease 0.2s;
    }

    .case-study.visible .case-study-name {
      opacity: 1;
      transform: translateY(0);
    }

    .case-study-problem::before {
      content: 'Problem';
      display: block;
      font-family: 'JetBrains Mono', monospace;
      font-size: 0.6rem;
      font-weight: 500;
      font-style: normal;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: #9CA3AF;
      margin-bottom: 6px;
    }

    .case-study-solution::before {
      content: 'What I built';
      display: block;
      font-family: 'JetBrains Mono', monospace;
      font-size: 0.6rem;
      font-weight: 500;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: var(--warm);
      margin-bottom: 6px;
    }

    .case-study-problem {
      font-family: 'Instrument Sans', 'DM Sans', sans-serif;
      font-size: 0.95rem;
      font-style: italic;
      color: var(--muted);
      line-height: 1.7;
      margin-bottom: 14px;
      position: relative;
      z-index: 1;
      opacity: 0;
      transform: translateY(10px);
      transition: opacity 0.5s ease 0.3s, transform 0.5s ease 0.3s;
    }

    .case-study.visible .case-study-problem {
      opacity: 1;
      transform: translateY(0);
    }

    .case-study-solution {
      font-family: 'Instrument Sans', 'DM Sans', sans-serif;
      font-size: 0.95rem;
      color: var(--text);
      line-height: 1.7;
      margin-bottom: 20px;
      position: relative;
      z-index: 1;
      opacity: 0;
      transform: translateY(10px);
      transition: opacity 0.5s ease 0.4s, transform 0.5s ease 0.4s;
    }

    .case-study.visible .case-study-solution {
      opacity: 1;
      transform: translateY(0);
    }

    .case-study-link {
      font-family: 'JetBrains Mono', monospace;
      font-size: 0.75rem;
      color: var(--navy);
      text-decoration: none;
      letter-spacing: 0.03em;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 10px 0;
      border-bottom: 1px solid transparent;
      position: relative;
      z-index: 1;
      opacity: 0;
      transform: translateY(10px);
      transition: opacity 0.5s ease 0.5s, transform 0.5s ease 0.5s, border-color 0.2s ease;
    }

    .case-study.visible .case-study-link {
      opacity: 1;
      transform: translateY(0);
    }

    .case-study-link:hover {
      border-bottom-color: var(--navy);
    }

    .case-study-link .arrow {
      display: inline-block;
      transition: transform 0.2s ease;
    }

    .case-study-link:hover .arrow {
      transform: translateX(4px);
    }

    /* Page navigation bottom */
    .page-nav-bottom {
      padding: 34px 0 12px;
      text-align: center;
      font-family: 'JetBrains Mono', monospace;
      font-size: 0.78rem;
      color: var(--muted);
      letter-spacing: 0.02em;
    }

    .page-nav-bottom a {
      color: var(--navy);
      text-decoration: none;
      border-bottom: 1px solid var(--navy);
      padding-bottom: 1px;
    }

    .page-nav-bottom a:hover {
      border-color: var(--navy-dark);
    }

    /* Smooth load */
    main, footer { opacity: 0; animation: bodyFadeIn 0.4s ease 0.05s forwards; }
    @keyframes bodyFadeIn { to { opacity: 1; } }

    .sr-only { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
    .sr-only:focus { position: static; width: auto; height: auto; overflow: visible; padding: 8px 16px; background: var(--text); color: #fff; font-size: 0.8rem; z-index: 100; }

    /* Focus styles */
    a:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; border-radius: 2px; }
    .story-link:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }

    /* Footer */
    footer {
      padding: 40px 0 56px;
      border-top: 1px solid var(--border);
    }

    footer p {
      font-family: 'JetBrains Mono', monospace;
      font-size: 0.72rem;
      color: var(--muted);
      letter-spacing: 0.02em;
    }

    footer p span { color: var(--warm); }
    footer a { color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--border); padding: 12px 0; }
    footer a:hover { border-color: var(--navy); }

    /* Responsive */
    @media (max-width: 900px) {
      .hero-stats {
        grid-template-columns: repeat(4, 1fr);
      }

      .hero-stat strong {
        font-size: 2.2rem;
      }

      .case-study {
        padding: 34px 0;
      }

      .case-study-inner {
        grid-template-columns: 1fr;
        gap: 28px;
      }

      /* First project also goes single-column on tablet */
      .case-study:first-child .case-study-inner {
        grid-template-columns: 1fr;
        gap: 28px;
      }

      .case-study:first-child .case-study-name {
        font-size: 1.8rem;
      }

      /* On mobile, always image on top, text below */
      .case-study:nth-child(even) .case-study-text {
        order: unset;
      }

      .case-study-image {
        order: -1;
      }

      .case-study-name {
        font-size: 1.8rem;
      }

      .case-study-number {
        font-size: 5rem;
        top: -24px;
      }

      .page-nav-top {
        top: 12px;
        right: 16px;
      }
    }

    @media (max-width: 480px) {
      .hero { padding: 32px 0 8px; }
      .hero h1 { font-size: 1rem; }

      .hero-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px 0;
        margin-bottom: 16px;
      }

      .hero-stat strong {
        font-size: 2rem;
      }

      .case-study {
        padding: 24px 0;
      }

      .case-study-inner {
        gap: 20px;
      }

      .case-study-name {
        font-size: 1.5rem;
        margin-bottom: 12px;
      }

      .case-study:first-child .case-study-name {
        font-size: 1.5rem;
      }

      .case-study-number {
        font-size: 4rem;
        top: -16px;
      }

      .case-study-problem,
      .case-study-solution {
        font-size: 0.88rem;
      }

      footer p { text-align: center; line-height: 2; }
    }

    /* Build stats per project */
    .case-study-stats {
      font-family: 'JetBrains Mono', monospace;
      font-size: 0.6rem;
      color: var(--warm);
      letter-spacing: 0.04em;
      margin-bottom: 11px;
      position: relative;
      z-index: 1;
      opacity: 0;
      transform: translateY(10px);
      transition: opacity 0.5s ease 0.15s, transform 0.5s ease 0.15s;
    }

    .case-study.visible .case-study-stats {
      opacity: 1;
      transform: translateY(0);
    }

    /* Closing CTA — dark, typographic */
    .closing-cta {
      text-align: center;
      padding: 64px 24px;
      background: var(--text);
      color: #fff;
    }

    .closing-cta .cta-kicker {
      font-family: 'JetBrains Mono', monospace;
      font-size: 0.65rem;
      font-weight: 500;
      letter-spacing: 0.1em;
      text-transform: uppercase;
      color: rgba(255,255,255,0.4);
      margin-bottom: 16px;
    }

    .closing-cta .cta-email {
      font-family: 'Playfair Display', serif;
      font-size: 1.6rem;
      font-weight: 700;
      color: #fff;
      text-decoration: none;
      letter-spacing: -0.02em;
      display: inline-block;
      padding-bottom: 4px;
      border-bottom: 2px solid var(--warm);
      transition: border-color 0.2s;
    }

    .closing-cta .cta-email:hover {
      border-color: #fff;
    }

    .closing-cta .cta-sub {
      font-family: 'Instrument Sans', 'DM Sans', sans-serif;
      font-size: 0.88rem;
      color: rgba(255,255,255,0.45);
      margin-top: 16px;
    }

    /* External link indicator */
    .case-study-link .ext {
      font-size: 0.55rem;
      opacity: 0.5;
      margin-left: 2px;
    }

    /* Page 2 Header */
    .page2-header {
      padding: 40px 0 12px;
      border-bottom: 1px solid var(--border);
      margin-bottom: 0;
    }

    .back-link {
      font-family: 'JetBrains Mono', monospace;
      font-size: 0.75rem;
      color: var(--muted);
      text-decoration: none;
      letter-spacing: 0.02em;
      display: inline-block;
      margin-bottom: 8px;
      border-bottom: 1px solid transparent;
      padding-bottom: 1px;
      transition: color 0.2s ease, border-color 0.2s ease;
    }

    .back-link:hover {
      color: var(--navy);
      border-bottom-color: var(--navy);
    }

    .page2-title {
      font-family: 'Playfair Display', serif;
      font-size: 1.5rem;
      font-weight: 700;
      color: var(--text);
      letter-spacing: -0.03em;
      line-height: 1.15;
      padding-bottom: 14px;
    }

    /* Page navigation (page 2) */
    .page-nav {
      padding: 28px 0;
      text-align: center;
      border-bottom: 1px solid var(--border);
    }

    .page-nav p {
      font-family: 'JetBrains Mono', monospace;
      font-size: 0.75rem;
      color: var(--muted);
      letter-spacing: 0.02em;
    }

    .page-nav a {
      color: var(--navy);
      text-decoration: none;
      border-bottom: 1px solid transparent;
      padding-bottom: 1px;
      transition: border-color 0.2s ease;
    }

    .page-nav a:hover {
      border-bottom-color: var(--navy);
    }

    @media (max-width: 480px) {
      .page2-header { padding: 40px 0 12px; }
      .page2-title { font-size: 1.3rem; }
    }

    /* Before/After Comparison Section */
    .before-after-section {
      padding: 70px 0 28px;
      border-top: 1px solid var(--border);
    }

    .before-after-section .section-header {
      max-width: 1100px;
      margin: 0 auto 42px;
      padding: 0 24px;
    }

    .before-after-section .section-header h2 {
      font-family: 'Playfair Display', serif;
      font-size: 2rem;
      font-weight: 700;
      color: var(--text);
      letter-spacing: -0.03em;
      margin-bottom: 8px;
    }

    .before-after-section .section-header p {
      font-family: 'Instrument Sans', 'DM Sans', sans-serif;
      font-size: 0.95rem;
      color: var(--muted);
      max-width: 520px;
    }

    .ba-item {
      max-width: 1100px;
      margin: 0 auto 56px;
      padding: 0 24px;
      opacity: 0;
      transform: translateY(30px);
      transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .ba-item.visible {
      opacity: 1;
      transform: translateY(0);
    }

    .ba-item-header {
      display: flex;
      align-items: baseline;
      gap: 16px;
      margin-bottom: 20px;
      flex-wrap: wrap;
    }

    .ba-item-name {
      font-family: 'Playfair Display', serif;
      font-size: 1.5rem;
      font-weight: 700;
      color: var(--text);
    }

    .ba-item-desc {
      font-family: 'Instrument Sans', 'DM Sans', sans-serif;
      font-size: 0.85rem;
      color: var(--muted);
    }

    .ba-item-link {
      font-family: 'JetBrains Mono', monospace;
      font-size: 0.7rem;
      color: var(--navy);
      text-decoration: none;
      border-bottom: 1px solid transparent;
      margin-left: auto;
    }

    .ba-item-link:hover {
      border-bottom-color: var(--navy);
    }

    /* Slider container */
    .ba-slider {
      position: relative;
      overflow: hidden;
      border-radius: 8px;
      box-shadow: 0 8px 40px rgba(0,0,0,0.08), 0 2px 12px rgba(0,0,0,0.04);
      cursor: ew-resize;
      user-select: none;
      -webkit-user-select: none;
      aspect-ratio: 16/9;
    }

    .ba-after {
      position: absolute;
      inset: 0;
    }

    .ba-after img,
    .ba-before img {
      display: block;
      width: 100%;
      height: 100%;
      object-fit: cover;
      object-position: top center;
    }

    .ba-before {
      position: absolute;
      top: 0;
      left: 0;
      width: 50%;
      height: 100%;
      overflow: hidden;
      border-right: 3px solid #fff;
      z-index: 2;
    }

    /* Drag handle */
    .ba-handle {
      position: absolute;
      top: 0;
      bottom: 0;
      left: 50%;
      width: 3px;
      background: #fff;
      z-index: 3;
      display: flex;
      align-items: center;
      justify-content: center;
      pointer-events: none;
    }

    .ba-handle-circle {
      width: 40px;
      height: 40px;
      border-radius: 50%;
      background: #fff;
      box-shadow: 0 2px 12px rgba(0,0,0,0.15);
      display: flex;
      align-items: center;
      justify-content: center;
      pointer-events: none;
      flex-shrink: 0;
    }

    .ba-handle-circle svg {
      width: 18px;
      height: 18px;
      color: var(--muted);
    }

    /* Labels */
    .ba-label {
      position: absolute;
      top: 16px;
      font-family: 'JetBrains Mono', monospace;
      font-size: 0.6rem;
      font-weight: 500;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      padding: 4px 10px;
      border-radius: 3px;
      z-index: 4;
      pointer-events: none;
    }

    .ba-label-before {
      left: 16px;
      background: rgba(0,0,0,0.6);
      color: #fff;
    }

    .ba-label-after {
      right: 16px;
      background: rgba(196,112,75,0.85);
      color: #fff;
    }

    @media (max-width: 900px) {
      .before-after-section { padding: 42px 0 14px; }
      .ba-item { margin-bottom: 42px; }
      .ba-item-name { font-size: 1.2rem; }
      .ba-item-link { margin-left: 0; }
      .ba-handle-circle { width: 32px; height: 32px; }
      .ba-handle-circle svg { width: 14px; height: 14px; }
    }

    @media (max-width: 480px) {
      .before-after-section .section-header h2 { font-size: 1.5rem; }
      .ba-label { font-size: 0.55rem; padding: 3px 8px; }
    }
