/*
  Style 1 ("Field Notes"): warm paper, forest green and gold, pencil annotations.
  Its display name is set in content/site.yaml.
  Everything is scoped to :root[data-style="style1"] so other styles can sit alongside it.
*/

:root[data-style="style1"] {
  --paper: #F2EDE3;
  --paper-light: #F7F4EE;
  --ink: #14261F;
  --ink-soft: #3B4842;
  --pencil: #37403B;
  --forest: #1F4234;
  --forest-band: #23443A;
  --sage: #DDE5DA;
  --gold: #B8913F;
  --gold-soft: #DDBE75;
  --cream: #EEE5CF;
  --rule: #D3CBBC;
  --line: #9EA59C;

  --c-bg: var(--paper-light);
  --c-ink: var(--ink);
  --c-focus: var(--gold);
  --f-serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --f-sans: "Hanken Grotesk", "Helvetica Neue", Arial, system-ui, sans-serif;
  --f-hand: "Caveat", "Segoe Print", "Bradley Hand", cursive;
  --wrap: 1240px;
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  color-scheme: light;

  .hand { font-family: var(--f-hand); font-weight: 500; line-height: 1; }

  .eyebrow {
    margin: 0 0 1rem;
    font-family: var(--f-sans);
    font-size: .72rem;
    font-weight: 500;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--ink-soft);
  }
  .i-arrow { width: 1.15em; height: .7em; flex: none; transition: transform .25s ease; }

  .text-link {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    font-family: var(--f-serif);
    font-size: 1.1rem;
    text-decoration: none;
    padding-bottom: .15rem;
    border-bottom: 1px solid currentColor;
  }
  .text-link:hover .i-arrow { transform: translateX(4px); }

  .btn-solid {
    display: inline-block;
    padding: 1rem 2rem;
    border: 0;
    border-radius: 2px;
    background: var(--forest);
    color: var(--paper-light);
    font-family: var(--f-serif);
    font-size: 1.1rem;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .2s ease, transform .2s ease;
  }
  .btn-solid:hover { background: #163327; }
  .btn-solid:active { transform: translateY(1px); }
  .btn-solid:disabled { opacity: .6; cursor: progress; }

  .icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; padding: 0;
    background: none; border: 0; border-radius: 50%; cursor: pointer;
    transition: background-color .2s ease;
  }
  .icon-btn svg { width: 22px; height: 22px; }
  .icon-btn:hover { background: rgba(20, 38, 31, .06); }

  /* ---------- Header ---------- */
  .site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    padding-top: env(safe-area-inset-top, 0px);
    background: rgba(242, 237, 227, .94);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--rule);
  }
  .header-inner { display: flex; align-items: center; gap: 1rem; height: 70px; }
  .brand { display: flex; align-items: center; gap: 1.1rem; margin-right: auto; text-decoration: none; }
  .brand-mark { width: 58px; height: 40px; flex: none; }
  .brand:hover .brand-mark { transform: rotate(-8deg); }
  .brand-mark { transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
  .brand-name {
    font-family: var(--f-serif);
    font-size: 1.02rem;
    font-weight: 500;
    letter-spacing: .3em;
    text-transform: uppercase;
    white-space: nowrap;
  }
  .nav { display: flex; align-items: center; gap: 2.1rem; }
  .nav a { font-family: var(--f-serif); font-size: 1rem; text-decoration: none; }
  .nav a:not(.btn-outline):hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 6px; }
  .btn-outline {
    margin-left: .4rem;
    padding: .62rem 1.6rem;
    border: 1px solid var(--ink);
    transition: background-color .2s ease, color .2s ease;
  }
  .btn-outline:hover { background: var(--ink); color: var(--paper); }

  .menu-toggle {
    display: none;
    width: 44px; height: 44px;
    align-items: center; justify-content: center;
    margin-right: -10px;
    background: none; border: 0; color: var(--ink); cursor: pointer;
  }
  .menu-toggle span, .menu-toggle span::before, .menu-toggle span::after {
    display: block; width: 22px; height: 1.5px; background: currentColor; position: relative;
    transition: transform .25s ease, background-color .25s ease;
  }
  .menu-toggle span::before, .menu-toggle span::after { content: ""; position: absolute; left: 0; }
  .menu-toggle span::before { top: -7px; }
  .menu-toggle span::after { top: 7px; }
  .menu-toggle[aria-expanded="true"] span { background: transparent; }
  .menu-toggle[aria-expanded="true"] span::before { transform: translateY(7px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] span::after { transform: translateY(-7px) rotate(-45deg); }

  /* ---------- Hero: Meet Tom ---------- */
  .hero { background: var(--paper); overflow: hidden; }
  .hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
    align-items: center;
    gap: clamp(2rem, 5vw, 5rem);
    padding-block: clamp(3rem, 7vw, 5.5rem) clamp(3rem, 6vw, 5rem);
  }
  .hero h1 {
    margin: 0 0 1.5rem;
    font-family: var(--f-serif);
    font-weight: 400;
    font-size: clamp(2.9rem, 6.6vw, 5.6rem);
    line-height: .98;
    letter-spacing: -.035em;
    text-wrap: balance;
  }
  .hero-body p {
    margin: 0 0 1rem;
    max-width: 50ch;
    font-size: 1.08rem;
    line-height: 1.6;
    color: var(--ink-soft);
  }
  .hero-body p:first-child {
    max-width: 34ch;
    margin-bottom: 1.4rem;
    font-family: var(--f-serif);
    font-size: clamp(1.3rem, 2vw, 1.6rem);
    line-height: 1.35;
    color: var(--ink);
  }
  .hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem 2.4rem; margin-top: 2.2rem; }

  .hero-art {
    position: relative;
    width: min(100%, 440px);
    aspect-ratio: 1;
    margin: 0;
    justify-self: center;
    color: var(--pencil);
  }
  .blob { position: absolute; height: auto; fill: #C7D4C1; opacity: .75; overflow: visible; }
  .hero-art .blob { left: -14%; top: -8%; width: 128%; }
  .hero-art img {
    position: absolute; left: 10%; top: 10%;
    width: 80%; height: 80%;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 22px 36px -22px rgba(20, 38, 31, .6);
  }
  .ring { position: absolute; left: 5%; top: 6%; width: 90%; height: 90%; overflow: visible; transform: rotate(-6deg); }
  .hand-note {
    position: absolute; right: -4%; top: -4%;
    font-size: clamp(1.7rem, 2.8vw, 2.3rem);
    white-space: nowrap;
    transform: rotate(-9deg);
  }
  .hand-note span { display: block; }
  .hand-note svg { width: 1.9em; height: 1.5em; margin: .1em 0 0 .1em; }

  /* ---------- Prose section: The Projects ---------- */
  .prose-section { background: var(--paper-light); padding-block: clamp(3.5rem, 8vw, 6.5rem); }
  .prose-inner {
    display: grid;
    grid-template-columns: minmax(0, .8fr) minmax(0, 1.4fr);
    gap: clamp(2rem, 6vw, 6rem);
    align-items: start;
  }
  .prose-aside { position: sticky; top: 110px; }
  .eyebrow-row { display: flex; align-items: flex-start; gap: 1.6rem; }
  .eyebrow-row .eyebrow { margin: 0; }
  .star { width: 32px; height: 32px; flex: none; margin-top: -.7rem; color: var(--gold); transition: transform 1.4s cubic-bezier(.2, .7, .2, 1); }
  .prose-aside:hover .star { transform: rotate(135deg); }
  .prose-section h2 {
    margin: .6rem 0 0;
    font-family: var(--f-serif);
    font-weight: 400;
    font-size: clamp(2.4rem, 5vw, 4rem);
    line-height: 1;
    letter-spacing: -.03em;
  }

  /* Long-form text, used on the home page and project pages */
  .prose {
    max-width: 40rem;
    font-family: var(--f-serif);
    font-size: 1.16rem;
    line-height: 1.65;
    color: var(--ink);
  }
  .prose > :first-child { margin-top: 0; }
  .prose p { margin: 0 0 1.15em; }
  .prose > p:first-child, .prose .lede { font-size: clamp(1.32rem, 2.1vw, 1.6rem); line-height: 1.45; }
  .prose h2 {
    margin: 2.4em 0 .75em;
    font-weight: 400;
    font-size: clamp(1.8rem, 3vw, 2.3rem);
    line-height: 1.1;
    letter-spacing: -.02em;
  }
  .prose h2::before { content: ""; display: block; width: 2.5rem; height: 1px; margin-bottom: 1rem; background: var(--gold); }
  .prose ul { list-style: none; margin: 0 0 1.4em; padding: 0; }
  .prose ul li { position: relative; margin-bottom: .9em; padding-left: 1.6rem; }
  .prose ul li::before {
    content: ""; position: absolute; left: .2rem; top: .64em;
    width: .45rem; height: .45rem; border-radius: 50%;
    background: var(--gold);
  }
  .prose a { text-decoration-thickness: 1px; text-underline-offset: 3px; }
  .prose a:hover { text-decoration-color: var(--gold); }
  .prose blockquote { margin: 1.6em 0; padding-left: 1.2em; border-left: 2px solid var(--gold-soft); font-style: italic; }
  .prose strong { font-weight: 500; }

  /* ---------- Band: Apologetic Note ---------- */
  .band { background: var(--forest-band); color: #EFE8D8; }
  .band-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1.15fr);
    align-items: center;
    gap: clamp(2rem, 5vw, 4rem);
    padding-block: clamp(3rem, 6vw, 4.5rem);
  }
  .band-top { display: flex; align-items: center; gap: 1.4rem; }
  .band-top .brand-mark { width: 74px; height: 50px; }
  .band .eyebrow { margin: .9rem 0 0; color: #CBD4C8; }
  .band h2 {
    margin: .3rem 0 0 clamp(0rem, 5vw, 3.75rem);
    font-family: var(--f-serif);
    font-weight: 400;
    font-size: clamp(2.2rem, 4.5vw, 3.4rem);
    line-height: 1.02;
    letter-spacing: -.025em;
  }
  .band-rule { width: 1px; align-self: stretch; background: rgba(239, 232, 216, .35); }
  .band-body p {
    margin: 0 0 1rem;
    max-width: 44ch;
    font-family: var(--f-serif);
    font-size: 1.16rem;
    line-height: 1.55;
    opacity: .92;
  }
  .band blockquote { margin: 1.8rem 0 0; }
  .band blockquote p {
    margin: 0;
    max-width: 30ch;
    font-family: var(--f-serif);
    font-size: clamp(1.45rem, 2.5vw, 1.95rem);
    line-height: 1.3;
    text-indent: -.42em;
    color: var(--gold-soft);
  }

  /* ---------- Project cards ---------- */
  .projects { background: var(--paper-light); padding-block: clamp(3.5rem, 7vw, 5.5rem); }
  .projects-head { margin-bottom: 2rem; }
  .projects h2 {
    margin: 0;
    font-family: var(--f-serif);
    font-weight: 400;
    font-size: clamp(2.4rem, 5vw, 3.8rem);
    line-height: 1;
    letter-spacing: -.03em;
  }
  .projects-intro { max-width: 40rem; margin-top: 1rem; font-family: var(--f-serif); font-size: 1.15rem; color: var(--ink-soft); }
  .project-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin: 0; padding: 0;
    list-style: none;
  }
  .project-card {
    position: relative;
    min-height: 21rem;
    padding: 2rem 1.9rem;
    overflow: hidden;
    container: card / inline-size;
    transition: transform .4s cubic-bezier(.2, .7, .2, 1), box-shadow .4s ease, opacity .9s ease;
  }
  .project-card:hover { transform: translateY(-4px); box-shadow: 0 24px 36px -28px rgba(20, 38, 31, .55); }
  .card--sage { background: var(--sage); }
  .card--outline { background: var(--paper-light); border: 1px solid var(--line); }
  .project-link { display: block; max-width: 56%; text-decoration: none; }
  .project-link::after { content: ""; position: absolute; inset: 0; z-index: 2; }
  .project-card .eyebrow { font-size: .7rem; margin-bottom: 1.2rem; }
  .project-card h3 {
    margin: 0 0 .5rem;
    font-family: var(--f-serif);
    font-weight: 400;
    font-size: clamp(1.9rem, 8.5cqw, 2.8rem);
    line-height: 1.03;
    letter-spacing: -.028em;
    text-wrap: balance;
  }
  .project-sub { margin: 0 0 1rem; font-family: var(--f-serif); font-style: italic; font-size: 1.15rem; color: var(--ink-soft); }
  .project-summary { margin: 0 0 1.6rem; max-width: 32ch; font-size: 1.02rem; line-height: 1.45; color: var(--ink-soft); }
  .project-card:hover .text-link .i-arrow { transform: translateX(4px); }
  .card-art { position: absolute; right: 3%; bottom: 5%; width: 42%; pointer-events: none; }
  .art { width: 100%; height: auto; overflow: visible; }
  .art-hand { font-family: var(--f-hand); font-size: 34px; }

  @container card (max-width: 440px) {
    .project-link { max-width: none; }
    .card-art { position: relative; right: auto; bottom: auto; width: 62%; margin: -1.75rem -1rem -1.25rem auto; }
  }

  /* Coming soon: dashed card, faded drawing, and a snail slowly crawling past */
  .project-card.is-soon { background: var(--paper); border: 1.5px dashed #A9AE9F; padding-bottom: 5rem; }
  .is-soon .card-art { opacity: .45; filter: grayscale(.5); }
  .card-snail { position: absolute; left: 0; bottom: .9rem; width: 76px; color: var(--pencil); }
  .card-snail .snail { width: 100%; height: auto; overflow: visible; }

  .art-trail { stroke-dasharray: 1; }
  .art-sign { transform-origin: 78px 112px; transition: transform .6s cubic-bezier(.3, 1.6, .5, 1); }
  .project-card:hover .art-sign { transform: rotate(-6deg); }
  .art-goal { transform-box: fill-box; transform-origin: center; }
  .knob { transition: transform 1s cubic-bezier(.3, 1.3, .4, 1); }
  .project-card:hover .knob { transform: rotate(var(--turn)); }
  .art-dot { transform-box: fill-box; transform-origin: center; }

  /* ---------- The book: a green hardback on a scrap of graph paper ---------- */
  .book-feature { background: var(--paper); overflow: hidden; }
  .book-inner {
    display: grid;
    grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
    align-items: center;
    gap: clamp(2rem, 5vw, 5rem);
    padding-block: clamp(3.5rem, 7vw, 5.5rem);
  }
  .book-art { order: -1; }
  .book-feature h2 {
    margin: 0;
    font-family: var(--f-serif);
    font-weight: 400;
    font-size: clamp(2.5rem, 5vw, 4.2rem);
    line-height: 1;
    letter-spacing: -.03em;
    text-wrap: balance;
  }
  .book-subtitle { margin: .7rem 0 1.6rem; font-family: var(--f-serif); font-style: italic; font-size: clamp(1.25rem, 2vw, 1.5rem); color: var(--ink-soft); }
  .book-body p { margin: 0 0 1rem; max-width: 46ch; font-size: 1.08rem; line-height: 1.6; color: var(--ink-soft); }
  .book-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem 2.4rem; margin-top: 2rem; }

  .book-art {
    position: relative;
    width: min(100%, 480px);
    aspect-ratio: 490 / 530;
    margin: 0;
    justify-self: center;
  }
  .book-art .blob { left: -4%; top: 4%; width: 96%; }
  .paper-wrap {
    position: absolute; left: 2%; top: 44%; width: 96%; height: 46%;
    filter: drop-shadow(0 8px 12px rgba(70, 58, 34, .13));
  }
  .paper {
    width: 100%; height: 100%;
    transform: rotate(-3deg);
    background-color: #F5F0E3;
    background-image:
      linear-gradient(rgba(150, 135, 105, .28) 1px, transparent 1px),
      linear-gradient(90deg, rgba(150, 135, 105, .28) 1px, transparent 1px);
    background-size: 15px 15px;
    clip-path: polygon(0% 6%, 14% 5%, 28% 4%, 42% 3.2%, 56% 2.4%, 70% 1.6%, 85% 1%, 100% 0%,
      99.2% 8%, 100% 15%, 98.6% 23%, 99.9% 32%, 98.8% 41%, 100% 50%, 98.6% 59%, 99.8% 68%, 98.4% 77%, 99.6% 87%, 98% 100%,
      90% 98.6%, 81% 100%, 71% 97.8%, 61% 99.4%, 51% 97.6%, 41% 99.2%, 31% 97.4%, 21% 99%, 11% 97.3%, 2% 98.6%,
      .6% 82%, 1.6% 62%, 0% 42%, 1.2% 22%);
  }
  .book {
    position: relative; z-index: 2;
    width: 60%;
    aspect-ratio: 300 / 460;
    container-type: inline-size;
    transition: transform .6s cubic-bezier(.2, .7, .2, 1);
  }
  .book-art .book { position: absolute; left: 17%; top: 0; }
  .book-art:hover .book { transform: translateY(-6px) rotate(-1.5deg); }
  /* the page edges */
  .book::after {
    content: "";
    position: absolute; z-index: -1;
    top: 1.2%; bottom: 1.4%; right: -3.4cqw;
    width: 4cqw;
    background: repeating-linear-gradient(90deg, #F1EBDD 0 1px, #D7CFBE 1px 2px);
    border-radius: 0 3px 3px 0;
    box-shadow: 3px 4px 8px rgba(40, 34, 20, .18);
  }
  .book-ribbon {
    position: absolute; z-index: -1;
    left: 6%; bottom: -7%;
    width: 5.5cqw; height: 16cqw;
    background: linear-gradient(90deg, #A67C2E, #D4AE5E 55%, #B28637);
    clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 84%, 0 100%);
    transform: rotate(22deg);
    transform-origin: top center;
  }
  .book-front {
    position: relative;
    width: 100%; height: 100%;
    display: flex; flex-direction: column; align-items: center;
    padding: 14cqw 8cqw 9cqw;
    text-align: center;
    color: var(--cream);
    border-radius: 3px 5px 5px 3px;
    overflow: hidden;
    background:
      linear-gradient(90deg, rgba(0,0,0,.38) 0, rgba(0,0,0,.08) 2.4%, rgba(255,255,255,.08) 3.6%, rgba(0,0,0,0) 7%),
      radial-gradient(120% 90% at 30% 18%, #2A5242 0%, #1F4234 55%, #16322A 100%);
    box-shadow: 0 34px 50px -20px rgba(18, 34, 27, .6), 0 12px 22px -12px rgba(18, 34, 27, .45);
  }
  .book-front::before {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background-image:
      repeating-linear-gradient(0deg, rgba(255,255,255,.028) 0 1px, transparent 1px 3px),
      repeating-linear-gradient(90deg, rgba(0,0,0,.05) 0 1px, transparent 1px 3px);
  }
  .cover-title, .cover-sub, .cover-author { margin: 0; }
  .cover-title { font-family: var(--f-serif); font-size: 16cqw; line-height: .95; letter-spacing: -.015em; text-wrap: balance; }
  .cover-sub { margin-top: 5cqw; font-family: var(--f-serif); font-size: 5.6cqw; line-height: 1.3; opacity: .92; text-wrap: balance; }
  .cover-art { width: 108%; margin-top: auto; flex: none; }
  .cover-author { margin-top: 4cqw; font-family: var(--f-serif); font-size: 4.7cqw; letter-spacing: .26em; text-transform: uppercase; }
  .book-note {
    position: absolute; left: 79%; top: 24%; z-index: 3;
    width: 5.2em;
    margin: 0;
    font-size: clamp(1.45rem, 2.4vw, 1.9rem);
    color: var(--pencil);
    transform: rotate(-12deg);
  }
  .book-note span { display: block; }
  .book-caption {
    position: absolute; left: 17%; width: 60%; bottom: 0;
    margin: 0; text-align: center;
    font-size: .74rem; color: #6C7069;
  }

  /* ---------- Newsletter signup ---------- */
  .signup { background: var(--sage); }
  .signup-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: clamp(2rem, 5vw, 5rem);
    padding-block: clamp(3.25rem, 6vw, 4.75rem);
  }
  .signup h2 {
    margin: 0 0 .8rem;
    font-family: var(--f-serif);
    font-weight: 400;
    font-size: clamp(2.2rem, 4.4vw, 3.3rem);
    line-height: 1.02;
    letter-spacing: -.025em;
  }
  .signup-blurb { margin: 0; max-width: 34ch; font-family: var(--f-serif); font-size: 1.2rem; line-height: 1.45; color: var(--ink-soft); }
  .signup-form { position: relative; }
  .signup-row { display: flex; flex-wrap: wrap; gap: .75rem; }
  .signup-row input {
    flex: 1 1 14rem; min-width: 0;
    padding: .95rem 1.1rem;
    border: 1px solid var(--line);
    border-radius: 2px;
    background: var(--paper-light);
    font-family: var(--f-serif);
    font-size: 1.1rem;
  }
  .signup-row input::placeholder { color: #7A827C; }
  .signup-row input[aria-invalid="true"] { border-color: #8A3B2E; }
  .form-msg { min-height: 1.5em; margin: .8rem 0 0; font-size: .95rem; color: var(--forest); }
  .form-msg.is-error { color: #8A3B2E; }
  .signup-aside {
    position: absolute; right: 1%; bottom: calc(100% + .4rem);
    margin: 0;
    font-size: 1.5rem;
    color: var(--pencil);
    white-space: nowrap;
    transform: rotate(-5deg);
  }
  .signup-aside svg { display: inline-block; width: 1.3em; height: 1em; margin-left: .2em; vertical-align: -.6em; transform: scaleX(-1) rotate(10deg); }

  /* ---------- Footer ---------- */
  .site-footer { border-top: 1px solid var(--rule); }
  .footer-inner {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: 1.25rem 2rem;
    padding-block: 2rem calc(2rem + env(safe-area-inset-bottom, 0px));
  }
  .footer-name { font-family: var(--f-serif); font-size: .98rem; letter-spacing: .3em; text-transform: uppercase; }
  .footer-nav { display: flex; flex-wrap: wrap; gap: .5rem 2.2rem; }
  .footer-nav a { font-size: .9rem; text-decoration: none; }
  .footer-nav a:hover { text-decoration: underline; text-underline-offset: 4px; }
  .site-footer small { font-size: .85rem; margin-right: 4.5rem; }

  /* ---------- Project pages ---------- */
  .project-hero { background: var(--paper); border-bottom: 1px solid var(--rule); overflow: hidden; }
  .project-hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 2rem;
    padding-block: clamp(2rem, 4vw, 3rem) clamp(2.5rem, 5vw, 4rem);
  }
  .back-link {
    display: inline-flex; align-items: center; gap: .6rem;
    margin-bottom: clamp(1.5rem, 4vw, 2.6rem);
    font-size: .92rem;
    color: var(--ink-soft);
    text-decoration: none;
  }
  .back-link .i-arrow { transform: scaleX(-1); }
  .back-link:hover .i-arrow { transform: scaleX(-1) translateX(4px); }
  .back-link:hover { color: var(--ink); }
  .project-page h1 {
    margin: 0;
    font-family: var(--f-serif);
    font-weight: 400;
    font-size: clamp(2.8rem, 7vw, 5.4rem);
    line-height: .98;
    letter-spacing: -.035em;
    text-wrap: balance;
  }
  .project-hero .project-sub { margin: 1rem 0 0; font-size: clamp(1.3rem, 2.2vw, 1.7rem); }
  .project-hero-art { position: relative; width: clamp(200px, 26vw, 330px); }
  .project-hero-art .blob { left: -16%; top: -16%; width: 132%; }
  .project-hero-art .art { position: relative; }
  .project-hero-book { display: grid; place-items: center; padding-block: 1rem 2rem; }
  .project-hero-book .book { width: 62%; }

  .project-layout {
    display: grid;
    grid-template-columns: minmax(0, 40rem);
    justify-content: center;
    padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(3rem, 7vw, 5rem);
  }
  .project-layout.has-toc { grid-template-columns: 13rem minmax(0, 40rem); column-gap: clamp(2rem, 6vw, 6rem); }
  .toc { position: sticky; top: 110px; align-self: start; }
  .toc ol { margin: 0; padding: 0; list-style: none; border-left: 1px solid var(--rule); }
  .toc a {
    display: block;
    margin-left: -1px;
    padding: .45rem 0 .45rem 1rem;
    border-left: 1px solid transparent;
    font-family: var(--f-serif);
    font-size: .98rem;
    line-height: 1.3;
    color: var(--ink-soft);
    text-decoration: none;
    transition: color .2s ease, border-color .2s ease;
  }
  .toc a:hover { color: var(--ink); }
  .toc a.is-current { border-left-color: var(--gold); color: var(--ink); }

  .coming-soon {
    position: relative;
    margin: 2.2rem 0 1rem;
    padding: 1.6rem 1.6rem 5.4rem;
    border: 1.5px dashed #A9AE9F;
    overflow: hidden;
    container-type: inline-size;
  }
  .coming-soon .hand { margin: 0; font-size: 2rem; color: var(--pencil); transform: rotate(-2deg); transform-origin: left; }
  .coming-soon-snail { position: absolute; left: 0; bottom: .4rem; width: 130px; color: var(--pencil); }
  .coming-soon-snail .snail { width: 100%; height: auto; overflow: visible; }

  .documents { margin-top: 3rem; }
  .doc-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); }
  .doc-list li { margin: 0; padding: 0; }
  .doc-list li::before { display: none; }
  .doc-list a {
    display: grid; grid-template-columns: 6.5rem minmax(0, 1fr) auto; align-items: center; gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--rule);
    text-decoration: none;
  }
  .doc-kind { font-family: var(--f-sans); font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-soft); }
  .doc-title { font-size: 1.12rem; line-height: 1.3; }
  .doc-list a:hover .doc-title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
  .doc-list a:hover .i-arrow { transform: translateX(4px); }

  .project-pager { display: flex; justify-content: space-between; gap: 1.5rem; padding-block: 0 clamp(3rem, 6vw, 4.5rem); }
  .project-pager a {
    display: flex; flex: 0 1 22rem; flex-direction: column; gap: .35rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--ink);
    text-decoration: none;
  }
  .project-pager .eyebrow { margin: 0; }
  .pager-next { align-items: flex-end; text-align: right; }
  .pager-title { font-family: var(--f-serif); font-size: clamp(1.3rem, 2.2vw, 1.7rem); line-height: 1.15; }
  .project-pager a:hover .pager-title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }

  /* ---------- Settings button: a little cog ---------- */
  .settings-btn {
    width: 3.75rem; height: 3.75rem; padding: 0;
    border: 1px solid var(--rule);
    border-radius: 50%;
    background: var(--paper-light);
    color: var(--pencil);
    box-shadow: 0 12px 24px -14px rgba(20, 38, 31, .55), 0 2px 4px rgba(20, 38, 31, .06);
    transition: transform .3s cubic-bezier(.3, 1.5, .5, 1), box-shadow .3s ease, background-color .3s ease;
  }
  .cog { width: 2.2rem; height: 2.2rem; overflow: visible; transition: transform .9s cubic-bezier(.3, 1.3, .4, 1); }
  .cog-wheel { transform-box: view-box; transform-origin: 20px 20px; }
  .settings-btn:hover { transform: translateY(-3px); box-shadow: 0 16px 28px -14px rgba(20, 38, 31, .6); }
  .settings-btn:hover .cog { transform: rotate(60deg); }
  .settings-btn[aria-expanded="true"] { background: var(--sage); }
  .settings-btn[aria-expanded="true"] .cog { transform: rotate(135deg); }
  .settings-hint { margin-right: -.2rem; font-size: 1.45rem; color: var(--pencil); transform: rotate(-6deg); }
  .settings-hint svg { display: inline-block; width: 1.2em; height: 1em; margin-left: .15em; vertical-align: -.7em; transform: scaleX(-1) rotate(-25deg); }

  .settings-panel {
    padding: 1.5rem 1.4rem 1.5rem;
    overflow: visible;
    background: #FBF9F4;
    color: var(--ink);
    border: 1px solid var(--rule);
    border-radius: 3px;
    box-shadow: 0 26px 44px -26px rgba(20, 38, 31, .6);
    transform: rotate(-.8deg);
  }
  .settings-panel::before {
    content: "";
    position: absolute; top: -.7rem; left: 50%;
    width: 5.5rem; height: 1.4rem;
    background: rgba(221, 190, 117, .55);
    transform: translateX(-50%) rotate(2deg);
  }
  .settings-panel legend { margin-bottom: .5rem; padding: 0; font-family: var(--f-serif); font-size: 1.15rem; }
  .style-option { gap: .8rem; margin: 0 -.7rem; padding: .55rem .7rem; border-radius: 3px; transition: background-color .2s ease; }
  .style-option:not(.is-soon):hover { background: var(--paper); }
  .style-option:has(input:checked) { background: var(--sage); }
  .style-option:has(input:focus-visible) { outline: 2px solid var(--gold); outline-offset: 1px; }
  .style-option.is-soon { opacity: .6; }
  .swatches i { width: .95rem; height: .95rem; border: 1px solid rgba(20, 38, 31, .2); }
  .swatches i + i { margin-left: -.3rem; }
  .style-name { font-family: var(--f-serif); font-size: 1.05rem; }
  .soon { margin-left: auto; font-size: 1.3rem; color: var(--gold); transform: rotate(-4deg); }
  .size-picker { margin-top: 1.1rem; padding-top: 1rem; border-top: 1px solid var(--rule); }
  .size-options { gap: .5rem; }
  .size-options button {
    width: 3rem; height: 2.75rem;
    border: 1px solid var(--rule);
    border-radius: 3px;
    background: none;
    font-family: var(--f-serif);
    transition: background-color .2s ease, color .2s ease;
  }
  .size-options button:hover { background: var(--paper); }
  .size-options button[aria-pressed="true"] { background: var(--forest); border-color: var(--forest); color: var(--paper-light); }

  /* ---------- Search ---------- */
  .search-dialog {
    border: 1px solid var(--rule);
    border-radius: 3px;
    background: var(--paper-light);
    color: var(--ink);
    box-shadow: 0 30px 60px -30px rgba(20, 38, 31, .6);
  }
  .search-dialog::backdrop { background: rgba(20, 38, 31, .32); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
  .search-head { padding: .8rem .8rem .8rem 1.3rem; border-bottom: 1px solid var(--rule); }
  .search-icon { width: 1.35rem; height: 1.35rem; flex: none; color: var(--ink-soft); }
  .search-head input { padding: .35rem 0; font-family: var(--f-serif); font-size: 1.35rem; }
  .search-head input::placeholder { color: #7A827C; }
  .search-results a { padding: 1rem 1.3rem; border-bottom: 1px solid var(--rule); transition: background-color .15s ease; }
  .search-results a:hover, .search-results a:focus-visible { background: var(--paper); outline-offset: -3px; }
  .search-results li:last-child a { border-bottom: 0; }
  .result-where { display: block; margin-bottom: .25rem; font-size: .68rem; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-soft); }
  .result-title { display: block; font-family: var(--f-serif); font-size: 1.2rem; }
  .result-snippet { display: block; margin-top: .3rem; font-size: .95rem; line-height: 1.45; color: var(--ink-soft); }
  .search-results mark { padding: 0 .1em; border-radius: 2px; background: rgba(221, 190, 117, .55); color: inherit; }
  .search-empty { padding: 1.3rem 1.3rem 1.5rem; font-family: var(--f-hand); font-size: 1.55rem; color: var(--pencil); }

  /* ---------- Responsive ---------- */
  @media (max-width: 1000px) {
    .project-layout.has-toc { grid-template-columns: minmax(0, 40rem); }
    .toc { position: static; margin-bottom: 2.5rem; }
  }

  @media (max-width: 860px) {
    .menu-toggle { display: inline-flex; }
    .nav {
      position: absolute; top: 100%; left: 0; right: 0;
      display: none; flex-direction: column; align-items: stretch; gap: 0;
      padding: .25rem var(--gutter) 1.4rem;
      background: var(--paper);
      border-bottom: 1px solid var(--rule);
      box-shadow: 0 18px 30px -20px rgba(20, 38, 31, .35);
    }
    .nav.is-open { display: flex; }
    .nav a { padding: .95rem 0; border-bottom: 1px solid var(--rule); font-size: 1.1rem; }
    .nav .btn-outline { margin: 1.1rem 0 0; text-align: center; border: 1px solid var(--ink); }

    .hero-inner { grid-template-columns: minmax(0, 1fr); padding-top: 2.5rem; }
    .hero-art { order: -1; width: min(72vw, 320px); }

    .prose-inner { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
    .prose-aside { position: static; }

    .band-inner { grid-template-columns: minmax(0, 1fr); }
    .band-rule { width: 100%; height: 1px; }

    .book-inner { grid-template-columns: minmax(0, 1fr); }
    .book-art { width: min(78vw, 420px); justify-self: start; }

    .project-grid { grid-template-columns: minmax(0, 1fr); }
    .signup-inner { grid-template-columns: minmax(0, 1fr); }
    .signup-aside { position: static; margin-top: .4rem; transform: rotate(-2deg); }
    .signup-aside svg { display: none; }
  }

  @media (max-width: 700px) {
    .project-hero-inner { grid-template-columns: minmax(0, 1fr); }
    .project-hero-art { width: 200px; justify-self: end; margin-top: -1rem; }
  }

  @media (max-width: 620px) {
    .brand-mark { width: 46px; height: 32px; }
    .brand { gap: .8rem; }
    .brand-name { font-size: .92rem; letter-spacing: .24em; }
    .band h2 { margin-left: 0; }
    .footer-inner { flex-direction: column; align-items: flex-start; }
    .project-pager { flex-direction: column; }
    .project-pager a { flex-basis: auto; }
    .doc-list a { grid-template-columns: minmax(0, 1fr) auto; row-gap: .2rem; }
    .doc-kind { grid-column: 1 / -1; }
  }

  /* ---------- Motion ---------- */
  @media (prefers-reduced-motion: no-preference) {
    /* Home hero: the portrait settles, the pencil ring draws itself, then the note is written */
    .hero-copy > * { animation: s1-rise .9s cubic-bezier(.2, .7, .2, 1) both; }
    .hero-copy > :nth-child(2) { animation-delay: .08s; }
    .hero-copy > :nth-child(3) { animation-delay: .16s; }
    .hero-copy > :nth-child(4) { animation-delay: .24s; }
    .hero-art .blob { animation: s1-bloom 1.6s ease both; }
    .hero-art img { animation: s1-settle 1.1s cubic-bezier(.2, .7, .2, 1) .15s both; }
    .ring path { stroke-dasharray: 1; animation: s1-draw 1.6s ease-in-out .6s both; }
    .ring path + path { animation-delay: 1.3s; }
    .hand-note span { animation: s1-write 1s steps(14) 1.6s both; }
    .hand-note svg { stroke-dasharray: 1; animation: s1-draw .5s ease-out 2.5s both; }

    /* The book: the note is written once the cover scrolls into view */
    .book-art.is-visible .book-note span { animation: s1-write 1s steps(16) .7s both; }

    /* Project page header */
    .project-hero-copy > * { animation: s1-rise .8s cubic-bezier(.2, .7, .2, 1) both; }
    .project-hero-copy > :nth-child(3) { animation: none; }
    .project-hero-copy > :nth-child(4) { animation-delay: .1s; }
    .project-hero-art .blob { animation: s1-bloom 1.6s ease both; }
    .project-hero-art .art-trail { animation: s1-draw 1.4s ease-in-out .4s both; }
    .project-hero-art .knob { animation: s1-turn 1.6s cubic-bezier(.3, 1.3, .4, 1) .3s both; }

    /* Cards: hovering redraws the chosen path and pulses the goal */
    .project-card:hover .art-trail { animation: s1-draw .9s ease-in-out both; }
    .project-card:hover .art-goal, .project-hero-art .art-goal { animation: s1-pulse 1.2s ease-in-out; }
    .art-dot { animation: s1-bounce 1.4s ease-in-out infinite; }
    .art-dot:nth-child(2) { animation-delay: .18s; }
    .art-dot:nth-child(3) { animation-delay: .36s; }
    .project-grid .project-card:nth-child(2) { transition-delay: 0s, 0s, .1s; }

    /* Snails blink now and then and crawl past "coming soon" projects */
    .snail-eye { transform-box: fill-box; transform-origin: center; animation: s1-blink 7s ease-in-out infinite; }
    .snail-stalks { transform-box: fill-box; transform-origin: 50% 100%; }
    .snail-body { transform-box: fill-box; transform-origin: 0% 100%; }
    .card-snail { animation: s1-crawl 46s linear infinite; }
    .project-card:nth-child(even) .card-snail { animation-delay: -20s; }
    .coming-soon-snail { animation: s1-crawl 34s linear infinite; }
    .card-snail .snail-body, .coming-soon-snail .snail-body { animation: s1-squish 1.6s ease-in-out infinite; }

    /* The cog ticks now and then like clockwork, and spins when the style changes */
    .cog-wheel { animation: s1-tick 9s ease-in-out 3s infinite; }
    .settings-btn.is-hopping .cog-wheel { animation: s1-spin .9s cubic-bezier(.3, 1.2, .4, 1); }

    .settings-hint:not([hidden]) { animation: s1-write .9s steps(12) both; }
    .settings-hint.is-leaving { opacity: 0; transition: opacity .6s ease; }

    .settings-panel {
      transition: opacity .25s ease, transform .35s cubic-bezier(.2, .7, .2, 1), display .35s allow-discrete, overlay .35s allow-discrete;
    }
    .settings-panel:not(:popover-open) { opacity: 0; transform: translateY(12px) rotate(1.5deg); }
    @starting-style { .settings-panel:popover-open { opacity: 0; transform: translateY(12px) rotate(1.5deg); } }

    .search-dialog[open] { animation: s1-rise .35s cubic-bezier(.2, .7, .2, 1); }
    .search-dialog[open]::backdrop { animation: vt-fade-in .3s ease; }
  }
}

@keyframes s1-rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes s1-bloom { from { opacity: 0; transform: scale(.9); } }
@keyframes s1-settle { from { opacity: 0; transform: translateY(22px) rotate(1.5deg); } }
@keyframes s1-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes s1-write { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes s1-turn { from { transform: rotate(var(--turn)); } }
@keyframes s1-pulse { 50% { transform: scale(1.3); } }
@keyframes s1-bounce { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-5px); } }
@keyframes s1-blink { 0%, 94%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.15); } }
@keyframes s1-squish { 50% { transform: scaleX(1.05); } }
@keyframes s1-tick { 0%, 90%, 100% { transform: rotate(0); } 93% { transform: rotate(14deg); } 96% { transform: rotate(-4deg); } }
@keyframes s1-spin { to { transform: rotate(360deg); } }
@keyframes s1-crawl { from { transform: translateX(-140px); } to { transform: translateX(100cqw); } }
