/* ── Tokens ── */
    :root {
      --cream:       #f7f3ee;
      --paper:       #faf8f4;
      --warm-white:  #fffefb;
      --ink:         #1c1917;
      --ink-mid:     #1c1917;
      --ink-light:   #78716c;
      --ink-faint:   #a8a29e;
      --amber:       #c2692a;
      --amber-light: #e8956a;
      --amber-pale:  #fdf0e8;
      --amber-dark:  #8a4418;
      --rule:        #e5ddd5;
      --rule-strong: #d6ccc2;

      --serif-display: 'Lora', Georgia, serif;
      --serif-body:    'Source Serif 4', Georgia, serif;
      --mono:          'DM Mono', 'Courier New', monospace;

      --col-text: 680px;
      --col-wide: 960px;
      --col-full: 1200px;

      --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    }

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

    html {
      font-size: 18px;
      scroll-behavior: smooth;
      color-scheme: light;
      background: var(--paper);
    }

    body {
      background: var(--paper);
      color: var(--ink);
      font-family: var(--serif-body);
      font-weight: 300;
      line-height: 1.75;
      -webkit-font-smoothing: antialiased;
      overflow-x: hidden;
      color-scheme: light;
    }

    /* ── 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.035'/%3E%3C/svg%3E");
      pointer-events: none;
      z-index: 9999;
      opacity: 0.6;
    }

    /* ── Nav ── */
    nav {
      position: fixed;
      top: 0; left: 0; right: 0;
      z-index: 100;
      padding: 1.1rem 2.5rem;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 1.5rem;
      background: rgba(250, 248, 244, 0.88);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      border-bottom: 1px solid var(--rule);
    }

    .nav-name {
      font-family: var(--serif-display);
      font-size: 1rem;
      font-weight: 500;
      color: var(--ink);
      text-decoration: none;
      letter-spacing: 0.01em;
      white-space: nowrap;
      flex-shrink: 1;
      min-width: 0;
    }

    .nav-links {
      display: flex;
      gap: 2rem;
      list-style: none;
      flex-shrink: 0;
    }

    .nav-links a {
      font-family: var(--mono);
      font-size: 0.72rem;
      font-weight: 300;
      color: var(--ink-light);
      text-decoration: none;
      letter-spacing: 0.06em;
      text-transform: uppercase;
      transition: color 0.2s;
    }
    .nav-links a:hover { color: var(--amber); }

    /* ── Hero ── */
    .hero {
      padding: 11rem 2.5rem 5rem;
      max-width: var(--col-full);
      margin: 0 auto;
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      opacity: 0;
      transform: translateY(24px);
      animation: fadeUp 1s var(--ease-out) 0.1s forwards;
      background: var(--paper);
    }

    #home-view, #case-view, section, footer {
      background: var(--paper);
    }

    .projects-section, .about-section {
      background: var(--paper);
    }

    @keyframes fadeUp {
      to { opacity: 1; transform: translateY(0); }
    }

    .hero-eyebrow {
      font-family: var(--mono);
      font-size: 0.72rem;
      font-weight: 300;
      letter-spacing: 0.12em;
      text-transform: uppercase;
      color: var(--amber);
      margin-bottom: 1.5rem;
    }

    .hero-title {
      font-family: var(--serif-display);
      font-size: clamp(2.4rem, 4.5vw, 3.8rem);
      font-weight: 500;
      line-height: 1.18;
      color: var(--ink);
      letter-spacing: -0.01em;
    }

    .hero-title em {
      font-style: italic;
      color: var(--amber);
    }

    .hero-bio {
      font-size: clamp(1.2rem, 1.6vw, 1.5rem);
      line-height: 1.55;
      color: var(--ink-mid);
      font-weight: 300;
      width: 100%;
    }

    .hero-bio a {
      color: var(--amber-dark);
      text-decoration: none;
      border-bottom: 1px solid var(--amber);
      padding-bottom: 1px;
      transition: border-color 0.2s, color 0.2s;
    }
    .hero-bio a:hover {
      color: var(--ink);
      border-bottom-color: var(--ink);
    }

    .hero-meta {
      width: 100%;
    }

    /* ── Section titles ── */
    .section-header {
      max-width: var(--col-full);
      margin: 0 auto;
      padding: 0 2.5rem;
      display: flex;
      align-items: center;
      gap: 1.5rem;
      margin-bottom: 4rem;
    }

    .section-label {
      font-family: var(--mono);
      font-size: 0.68rem;
      font-weight: 300;
      letter-spacing: 0.14em;
      text-transform: uppercase;
      color: var(--ink-faint);
      white-space: nowrap;
    }

    .section-rule {
      flex: 1;
      height: 1px;
      background: var(--rule);
    }

    /* ── Project grid ── */
    .projects-section {
      padding: 6rem 0 6rem;
    }

    .projects-grid {
      max-width: var(--col-full);
      margin: 0 auto;
      padding: 0 2.5rem;
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 0;
      background: transparent;
    }

    .project-item {
      background: transparent;
      padding: 2rem 1.75rem;
      cursor: pointer;
      opacity: 0;
      transform: translateY(12px);
      transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
      position: relative;
      border-bottom: 1px solid var(--rule);
    }
    .project-item:nth-child(-n+3) { border-top: 1px solid var(--rule); }
    /* 8 items = 3+3+2, ensure the last row also has top border */
    .project-item.visible { opacity: 1; transform: translateY(0); }



    .project-thumbnail {
      width: 100%;
      aspect-ratio: 4/3;
      background: var(--cream);
      border-radius: 2px;
      overflow: hidden;
      margin-bottom: 1.1rem;
    }

    .project-thumbnail img {
      width: 100%; height: 100%;
      object-fit: cover; display: block;
      transition: transform 0.6s var(--ease-out);
    }
    .project-item:hover .project-thumbnail img { transform: scale(1.04); }

    .project-type {
      font-family: var(--mono);
      font-size: 0.62rem;
      font-weight: 300;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: var(--amber);
      margin-bottom: 0.45rem;
    }

    .project-title {
      font-family: var(--serif-display);
      font-size: 1rem;
      font-weight: 500;
      line-height: 1.35;
      color: var(--ink);
      margin-bottom: 0.5rem;
      letter-spacing: -0.01em;
      transition: color 0.2s;
    }
    .project-item:hover .project-title { color: var(--amber); }

    .project-desc {
      font-size: 0.82rem;
      line-height: 1.7;
      color: var(--ink-light);
    }

    .project-year {
      font-family: var(--mono);
      font-size: 0.6rem;
      color: var(--ink-faint);
      margin-top: 0.9rem;
    }



    .thumbnail-placeholder {
      width: 100%;
      height: 100%;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    /* placeholder pattern — unique per item */
    .ph-1 { background: linear-gradient(135deg, #e8ddd2 0%, #d4c4b5 100%); }
    .ph-2 { background: linear-gradient(160deg, #dde5d8 0%, #c8d4c2 100%); }
    .ph-3 { background: linear-gradient(120deg, #d8d8e5 0%, #c4c4d8 100%); }
    .ph-4 { background: linear-gradient(150deg, #e5d8d8 0%, #d4c2c2 100%); }

    .ph-label {
      font-family: var(--mono);
      font-size: 0.65rem;
      letter-spacing: 0.1em;
      text-transform: uppercase;
      color: rgba(28,25,23,0.3);
    }

    .read-link {
      display: inline-flex;
      align-items: center;
      gap: 0.5rem;
      font-family: var(--mono);
      font-size: 0.72rem;
      font-weight: 400;
      letter-spacing: 0.06em;
      text-transform: uppercase;
      color: var(--amber);
      text-decoration: none;
      transition: gap 0.2s;
    }
    .project-item:hover .read-link { gap: 0.8rem; }

    .read-link::after { content: '→'; }

    /* ── Case study article layout ── */
    .case-study {
      display: none;
      padding: 5rem 2.5rem 8rem;
      max-width: var(--col-full);
      margin: 0 auto;
    }

    .case-study.active { display: block; }

    .back-btn {
      font-family: var(--mono);
      font-size: 0.72rem;
      letter-spacing: 0.06em;
      text-transform: uppercase;
      color: var(--ink-light);
      background: none;
      border: none;
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 0.5rem;
      margin-bottom: 4rem;
      padding: 0;
      transition: color 0.2s;
    }
    .back-btn:hover { color: var(--amber); }
    .back-btn::before { content: '←'; }

    /* Article: narrow reading column, centered */
    .article-header {
      max-width: var(--col-text);
      margin: 0 auto 4rem;
    }

    .article-eyebrow {
      font-family: var(--mono);
      font-size: 0.68rem;
      font-weight: 300;
      letter-spacing: 0.12em;
      text-transform: uppercase;
      color: var(--amber);
      margin-bottom: 1.2rem;
    }

    .article-title {
      font-family: var(--serif-display);
      font-size: clamp(2rem, 4vw, 3.2rem);
      font-weight: 500;
      line-height: 1.15;
      letter-spacing: -0.015em;
      color: var(--ink);
      margin-bottom: 1.5rem;
    }

    .article-subtitle {
      font-size: 1.15rem;
      font-style: italic;
      color: var(--ink-mid);
      line-height: 1.65;
      margin-bottom: 2rem;
    }

    .article-meta-row {
      display: flex;
      gap: 2rem;
      padding-top: 1.5rem;
      border-top: 1px solid var(--rule);
    }

    .meta-item {
      display: flex;
      flex-direction: column;
      gap: 0.2rem;
    }

    .meta-label {
      font-family: var(--mono);
      font-size: 0.6rem;
      font-weight: 300;
      letter-spacing: 0.12em;
      text-transform: uppercase;
      color: var(--ink-faint);
    }

    .meta-value {
      font-family: var(--mono);
      font-size: 0.75rem;
      color: var(--ink-mid);
    }

    /* Hero image — full bleed within wide col */
    .article-hero-img {
      max-width: var(--col-wide);
      margin: 0 auto 4rem;
      aspect-ratio: 21/9;
      background: var(--cream);
      border-radius: 3px;
      overflow: hidden;
      border: 1px solid var(--rule);
    }

    .article-hero-img img {
      width: 100%;
      height: 100%;
      object-fit: contain;
      display: block;
    }

    .article-hero-img .thumbnail-placeholder {
      width: 100%; height: 100%;
    }

    /* Body text column */
    .article-body {
      max-width: var(--col-text);
      margin: 0 auto;
    }

    .article-body p {
      font-size: 1.05rem;
      line-height: 1.85;
      color: var(--ink-mid);
      margin-bottom: 1.6rem;
    }

    .article-body p:first-child::first-letter {
      font-family: var(--serif-display);
      font-size: 3.8em;
      font-weight: 600;
      line-height: 0.85;
      float: left;
      margin: 0.05em 0.12em 0 0;
      color: var(--amber);
    }

    .article-body h2 {
      font-family: var(--serif-display);
      font-size: 1.5rem;
      font-weight: 500;
      color: var(--ink);
      margin: 3rem 0 1rem;
      line-height: 1.3;
    }

    .article-body h3 {
      font-family: var(--serif-display);
      font-size: 1.1rem;
      font-weight: 500;
      font-style: italic;
      color: var(--ink);
      margin: 2.5rem 0 0.75rem;
    }

    .article-body blockquote {
      border-left: 2px solid var(--amber);
      padding: 0.5rem 0 0.5rem 1.75rem;
      margin: 2.5rem 0;
      font-size: 1.15rem;
      font-style: italic;
      color: var(--ink);
      line-height: 1.7;
    }

    /* Pull quote — breaks out wider */
    .pull-quote {
      max-width: 780px;
      margin: 3rem auto;
      padding: 2.5rem 3rem;
      background: var(--amber-pale);
      border-radius: 3px;
      font-family: var(--serif-display);
      font-size: 1.3rem;
      font-style: italic;
      font-weight: 400;
      color: var(--ink);
      line-height: 1.55;
      text-align: center;
    }

    /* Inline images — various widths */
    .img-block {
      margin: 3rem auto;
    }

    .img-block.narrow { max-width: var(--col-text); }
    .img-block.wide   { max-width: var(--col-wide); }
    .img-block.full   { max-width: var(--col-full); }

    .img-block figure {
      background: var(--cream);
      border: 1px solid var(--rule);
      border-radius: 3px;
      overflow: hidden;
    }

    .img-placeholder {
      width: 100%;
      aspect-ratio: 4/3;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .img-placeholder.wide-ratio { aspect-ratio: 16/9; }
    .img-placeholder.cinema { aspect-ratio: 21/9; }

    .img-block figcaption {
      padding: 0.75rem 1rem;
      font-family: var(--mono);
      font-size: 0.68rem;
      font-weight: 300;
      letter-spacing: 0.04em;
      color: var(--ink-faint);
      border-top: 1px solid var(--rule);
    }

    /* Diagram block */
    .diagram-block {
      max-width: var(--col-wide);
      margin: 3.5rem auto;
      background: var(--warm-white);
      border: 1px solid var(--rule-strong);
      border-radius: 4px;
      padding: 2.5rem;
    }

    .diagram-title {
      font-family: var(--mono);
      font-size: 0.7rem;
      font-weight: 300;
      letter-spacing: 0.1em;
      text-transform: uppercase;
      color: var(--ink-faint);
      margin-bottom: 1.5rem;
    }

    .diagram-placeholder {
      width: 100%;
      height: 200px;
      background: var(--cream);
      border: 1px dashed var(--rule-strong);
      border-radius: 2px;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 3rem;
    }

    /* Simple SVG diagram inline demo */
    .diagram-placeholder svg { opacity: 0.4; }

    /* Video embed */
    .video-block {
      max-width: var(--col-wide);
      margin: 3.5rem auto;
    }

    .video-wrapper {
      aspect-ratio: 16/9;
      background: #1c1917;
      border-radius: 3px;
      overflow: hidden;
      position: relative;
      border: 1px solid var(--rule);
    }

    .video-wrapper iframe {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      border: 0;
    }

    .video-play-btn {
      width: 64px;
      height: 64px;
      background: rgba(194, 105, 42, 0.85);
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: transform 0.2s, background 0.2s;
    }
    .video-play-btn:hover { transform: scale(1.1); background: var(--amber); }

    .video-play-btn svg { margin-left: 4px; }

    .video-caption {
      margin-top: 0.75rem;
      font-family: var(--mono);
      font-size: 0.68rem;
      font-weight: 300;
      letter-spacing: 0.04em;
      color: var(--ink-faint);
    }

    /* Annotation / aside */
    .aside {
      max-width: var(--col-text);
      margin: 2rem auto;
      padding: 1.25rem 1.5rem;
      background: var(--cream);
      border-radius: 3px;
      border: 1px solid var(--rule);
    }

    .aside-label {
      font-family: var(--mono);
      font-size: 0.6rem;
      font-weight: 300;
      letter-spacing: 0.12em;
      text-transform: uppercase;
      color: var(--amber);
      margin-bottom: 0.5rem;
    }

    .aside p {
      font-size: 0.9rem !important;
      line-height: 1.7 !important;
      color: var(--ink-light) !important;
      margin: 0 !important;
    }

    .aside p::first-letter { all: unset !important; }

    /* Image grid 2-up */
    .img-grid {
      max-width: var(--col-wide);
      margin: 3rem auto;
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 1rem;
    }

    .img-grid figure {
      background: var(--cream);
      border: 1px solid var(--rule);
      border-radius: 3px;
      overflow: hidden;
    }

    .img-grid .img-placeholder { aspect-ratio: 4/3; }
    .img-grid figcaption {
      padding: 0.6rem 0.9rem;
      font-family: var(--mono);
      font-size: 0.63rem;
      letter-spacing: 0.04em;
      color: var(--ink-faint);
      border-top: 1px solid var(--rule);
    }

    /* ── About section ── */
    .about-section {
      padding: 6rem 2.5rem 8rem;
      max-width: var(--col-full);
      margin: 0 auto;
    }

    .about-inner {
      max-width: var(--col-text);
      margin: 0 auto;
    }

    .about-inner p {
      font-size: 1.05rem;
      line-height: 1.85;
      color: var(--ink-mid);
      margin-bottom: 1.5rem;
    }

    .contact-row {
      margin-top: 3rem;
      padding-top: 2rem;
      border-top: 1px solid var(--rule);
      display: flex;
      gap: 2.5rem;
    }

    .contact-link {
      font-family: var(--mono);
      font-size: 0.75rem;
      font-weight: 300;
      letter-spacing: 0.06em;
      color: var(--amber);
      text-decoration: none;
      transition: opacity 0.2s;
    }
    .contact-link:hover { opacity: 0.7; }

    /* ── Footer ── */
    footer {
      border-top: 1px solid var(--rule);
      padding: 2rem 2.5rem;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    footer span {
      font-family: var(--mono);
      font-size: 0.65rem;
      font-weight: 300;
      letter-spacing: 0.08em;
      color: var(--ink-faint);
    }

    /* ── Reading progress bar ── */
    .progress-bar {
      position: fixed;
      top: 0; left: 0;
      height: 2px;
      background: var(--amber);
      width: 0%;
      z-index: 200;
      transition: width 0.1s linear;
      display: none;
    }
    .progress-bar.visible { display: block; }

    /* ── Scroll reveal utility ── */
    .reveal {
      opacity: 0;
      transform: translateY(16px);
      transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
    }
    .reveal.visible { opacity: 1; transform: none; }

    /* ── Page sections visibility ── */
    #home-view  { display: block; }
    #case-view  { display: none; }

    /* ── Interior page fade-in ── */
    #case-view.entering {
      animation: fadeUp 1s var(--ease-out) 0.8s forwards;
      opacity: 0;
      transform: translateY(24px);
    }

    /* ── Responsive ── */
    .nav-name-full { display: inline; }
    .nav-name-short { display: none; }

    @media (max-width: 480px) {
      .nav-name-full { display: none; }
      .nav-name-short { display: inline; }
    }

    @media (max-width: 900px) {
      .hero { padding: 8rem 1.5rem 4rem; }
      .hero-title { font-size: clamp(2.4rem, 10vw, 3.5rem); }
      .projects-grid { grid-template-columns: 1fr; padding: 0 1.5rem; }
      .project-item:nth-child(-n+3) { border-top: none; }
      .project-item:first-child { border-top: 1px solid var(--rule); }
      .img-grid { grid-template-columns: 1fr; }
      nav { padding: 0.9rem 1.2rem; gap: 1rem; }
      .nav-name { font-size: 0.82rem; }
      .nav-links { gap: 1.1rem; }
      .nav-links a { font-size: 0.65rem; }
      .case-study { padding: 4rem 1.5rem 6rem; }
    }