/*
  Style 3 ("Journal"): a magazine front page. Cream and navy with orange and teal accents,
  tight bold headlines, illustrated cards and solid panels.
  Its display name is set in content/site.yaml. Scoped to :root[data-style="style3"].
*/

:root[data-style="style3"] {
  --bg: #F5EFE4;
  --tile: #EEE6D8;
  --navy: #1F2539;
  --navy-2: #283049;
  --ink: #14182A;
  --ink-soft: #3B4053;
  --orange: #E8A63F;
  --orange-text: #B8761A;
  --peach: #F4DDB6;
  --teal: #5FC2AE;
  --cream: #F4EEE2;
  --paper: #FBF8F2;
  --line: #D9D0BF;

  --c-bg: var(--bg);
  --c-ink: var(--ink);
  --c-focus: var(--orange);
  --f-sans: "Inter Tight", "Helvetica Neue", Arial, system-ui, sans-serif;
  --f-serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --f-hand: "Caveat", "Segoe Print", "Bradley Hand", cursive;
  --wrap: 1200px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  color-scheme: light;

  :focus-visible { outline-width: 2.5px; border-radius: 4px; }
  .hand { font-family: var(--f-hand); font-weight: 500; line-height: 1; }

  .eyebrow {
    margin: 0 0 .9rem;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--orange-text);
  }
  .i-arrow { width: 1.1em; height: .7em; flex: none; transition: transform .2s ease; }

  .btn-solid {
    display: inline-flex; align-items: center; justify-content: center; gap: .65rem;
    padding: .9rem 1.5rem;
    border: 0;
    border-radius: 7px;
    background: var(--navy);
    color: var(--cream);
    font-size: 1.05rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .2s ease, transform .2s ease;
  }
  .btn-solid:hover { background: #121728; }
  .btn-solid:active { transform: translateY(1px); }
  .btn-solid:disabled { opacity: .6; cursor: progress; }
  .text-link {
    display: inline-flex; align-items: center; gap: .55rem;
    padding-bottom: .2rem;
    border-bottom: 2px solid var(--orange);
    font-weight: 500;
    text-decoration: none;
  }
  .text-link:hover .i-arrow { transform: translateX(3px); }

  .icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; padding: 0;
    border: 0; border-radius: 8px;
    background: none;
    color: var(--ink);
    cursor: pointer;
  }
  .icon-btn svg { width: 22px; height: 22px; }
  .icon-btn:hover { background: rgba(20, 24, 42, .06); }

  .soon-pill {
    display: inline-block;
    padding: .25rem .6rem;
    border-radius: 999px;
    background: var(--teal);
    font-size: .64rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    line-height: 1.4;
    color: var(--ink);
  }

  /* The shared line drawings, recoloured in navy and orange */
  .art { width: 100%; height: auto; overflow: visible; }
  .art [stroke="#4F524B"] { stroke: var(--navy); }
  .art [fill="#4F524B"] { fill: var(--navy); }
  .art [stroke="#B8913F"] { stroke: var(--orange); }
  .art [fill="#C49A45"], .art [fill="#DDBE75"] { fill: var(--orange); }
  .art [fill="#FBF8F0"] { fill: var(--paper); }
  .art [fill="#F2EDE3"] { fill: var(--peach); }
  .art-hand { font-family: var(--f-hand); font-size: 34px; }
  .art-trail { stroke-dasharray: 1; }
  .art-sign { transform-origin: 78px 112px; transition: transform .6s cubic-bezier(.3, 1.6, .5, 1); }
  .art-goal, .art-dot { transform-box: fill-box; transform-origin: center; }
  .knob { transition: transform 1s cubic-bezier(.3, 1.3, .4, 1); }

  /* ---------- Header ---------- */
  .site-header {
    position: sticky; top: 0; z-index: 40;
    padding-top: env(safe-area-inset-top, 0px);
    background: rgba(245, 239, 228, .92);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
  }
  .header-inner { display: flex; align-items: center; gap: 1rem; height: 78px; }
  .brand { display: flex; align-items: center; gap: .9rem; margin-right: auto; text-decoration: none; }
  .brand-mark { width: 56px; height: 38px; flex: none; transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
  .brand:hover .brand-mark { transform: rotate(-10deg); }
  .brand-name { font-size: 1.65rem; font-weight: 600; letter-spacing: -.025em; white-space: nowrap; }
  .nav { display: flex; align-items: center; gap: 1.9rem; }
  .nav a { position: relative; padding-block: .35rem; font-size: 1rem; font-weight: 500; text-decoration: none; }
  .nav a:not(.btn-outline):hover::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -.2rem;
    height: 3px; border-radius: 2px;
    background: var(--orange);
  }
  .btn-outline {
    margin-left: .6rem;
    padding: .55rem 1.1rem !important;
    border: 1.5px solid var(--ink);
    border-radius: 8px;
    transition: background-color .2s ease, color .2s ease;
  }
  .btn-outline:hover { background: var(--ink); color: var(--cream); }
  .menu-toggle {
    display: none;
    width: 44px; height: 44px; margin-right: -10px;
    align-items: center; justify-content: center;
    background: none; border: 0; color: var(--ink); cursor: pointer;
  }
  .menu-toggle span, .menu-toggle span::before, .menu-toggle span::after {
    display: block; position: relative; width: 22px; height: 2px; border-radius: 2px; background: currentColor;
    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, as a featured story ---------- */
  .hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr);
    align-items: center;
    gap: clamp(2rem, 5vw, 4.5rem);
    padding-block: clamp(1.5rem, 3vw, 2rem) clamp(3rem, 5vw, 4rem);
  }
  .hero .eyebrow {
    display: inline-block;
    margin: .4rem 0 1.4rem;
    padding: .35rem .95rem;
    border-radius: 999px;
    background: var(--peach);
    font-size: .85rem;
    font-weight: 500;
    letter-spacing: .01em;
    text-transform: none;
    color: var(--ink);
  }
  .hero h1 {
    margin: 0 0 1.8rem;
    font-size: clamp(3rem, 7.2vw, 5.4rem);
    font-weight: 800;
    line-height: .92;
    letter-spacing: -.05em;
  }
  .hl {
    position: relative;
    display: inline-block;
    font-family: var(--f-serif);
    font-style: italic;
    font-weight: 400;
    font-size: 1.15em;
    letter-spacing: -.02em;
  }
  .hl-line { position: absolute; left: -2%; bottom: -.22em; width: 104%; height: .3em; overflow: visible; color: var(--orange); }
  .hero-body p { margin: 0 0 1rem; max-width: 50ch; font-size: 1.04rem; line-height: 1.6; color: var(--ink-soft); }
  .hero-body p:first-child {
    max-width: 40ch;
    margin-bottom: 1.4rem;
    font-size: clamp(1.15rem, 1.7vw, 1.35rem);
    line-height: 1.42;
    color: var(--ink);
  }
  .hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.6rem; margin-top: 1.8rem; }

  /* The portrait sits on a navy card with an orange ribbon */
  .hero-art {
    position: relative;
    display: flex; flex-direction: column; align-items: center;
    width: 100%; max-width: 460px;
    margin: 0;
    justify-self: end;
    padding: clamp(2rem, 3.4vw, 2.6rem) clamp(1.25rem, 2.6vw, 1.8rem) clamp(1.4rem, 2.6vw, 1.8rem);
    border-radius: 18px;
    background: var(--navy);
    color: var(--cream);
  }
  .hero-art::before {
    content: "";
    position: absolute; top: 0; right: 9%;
    width: 26px; height: 40px;
    background: var(--orange);
    clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 76%, 0 100%);
  }
  .hero-art img {
    width: min(80%, 320px); height: auto;
    aspect-ratio: 1;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 18px 30px -12px rgba(0, 0, 0, .6);
  }
  .hand-note {
    display: flex; align-items: center; gap: .2em;
    margin-top: 1.1rem;
    font-size: clamp(1.8rem, 2.8vw, 2.2rem);
    color: var(--orange);
    white-space: nowrap;
    transform: rotate(-4deg);
  }
  .hand-note svg { width: 1.3em; height: 1em; transform: scaleY(-1); }

  /* ---------- Long read: The Projects ---------- */
  .prose-section { padding-block: clamp(3rem, 6vw, 4.5rem); border-top: 1px solid var(--line); }
  .prose-inner {
    display: grid;
    grid-template-columns: minmax(0, .6fr) minmax(0, 1.4fr);
    gap: clamp(2rem, 5vw, 5rem);
    align-items: start;
  }
  .prose-aside { position: sticky; top: 108px; }
  .prose-aside::after { content: ""; display: block; width: 3rem; height: 5px; margin-top: 1.4rem; border-radius: 3px; background: var(--teal); }
  .prose-section h2, .projects h2 {
    margin: 0;
    font-size: clamp(2.2rem, 4.2vw, 3rem);
    font-weight: 700;
    line-height: 1.02;
    letter-spacing: -.04em;
  }

  .prose { max-width: 42rem; font-family: var(--f-serif); font-size: 1.17rem; line-height: 1.65; color: var(--ink); }
  .prose > :first-child { margin-top: 0; }
  .prose p { margin: 0 0 1.1em; }
  .prose-section .prose > p:first-child, .prose .lede {
    font-family: var(--f-sans);
    font-size: clamp(1.25rem, 2vw, 1.5rem);
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: -.012em;
  }
  .prose h2 {
    margin: 2.2em 0 .7em;
    font-family: var(--f-sans);
    font-size: clamp(1.5rem, 2.6vw, 1.9rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -.03em;
  }
  .prose h2::before { content: ""; display: block; width: 2.4rem; height: 4px; margin-bottom: .9rem; border-radius: 2px; background: var(--orange); }
  .prose ul { list-style: none; margin: 0 0 1.4em; padding: 0; }
  .prose ul li { position: relative; margin-bottom: .9em; padding-left: 1.5rem; }
  .prose ul li::before {
    content: ""; position: absolute; left: .1rem; top: .58em;
    width: .5rem; height: .5rem;
    border-radius: 2px;
    background: var(--orange);
  }
  .prose a { text-decoration-color: var(--orange); text-decoration-thickness: 2px; text-underline-offset: 3px; }
  .prose blockquote { margin: 1.6em 0; padding-left: 1.2em; border-left: 3px solid var(--orange); font-style: italic; }

  /* ---------- Panel: Apologies ---------- */
  .band { padding: 0 var(--gutter) clamp(3rem, 6vw, 4.5rem); }
  .band-inner {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1.15fr);
    align-items: center;
    gap: clamp(1.75rem, 4vw, 3rem);
    max-width: calc(var(--wrap) - 2 * var(--gutter));
    padding: clamp(1.8rem, 3.6vw, 2.8rem) clamp(1.5rem, 3.6vw, 2.8rem);
    overflow: hidden;
    border-radius: 14px;
    background: var(--navy);
    color: var(--cream);
  }
  .scribble { width: 110px; margin-top: 1.1rem; color: var(--orange); }
  .band-top { display: flex; align-items: center; gap: 1rem; margin-bottom: .9rem; }
  .band-top .brand-mark { width: 48px; height: 32px; }
  .band .eyebrow { margin: 0; color: var(--orange); }
  .band h2 { margin: 0; font-size: clamp(2rem, 3.6vw, 2.7rem); font-weight: 700; line-height: 1.02; letter-spacing: -.04em; }
  .band-rule { align-self: stretch; background: rgba(244, 238, 226, .25); }
  .band-body p { margin: 0 0 1rem; max-width: 46ch; font-size: 1.04rem; line-height: 1.5; color: rgba(244, 238, 226, .9); }
  .band blockquote { margin: 1.4rem 0 0; }
  .band blockquote p {
    margin: 0;
    max-width: 26ch;
    font-family: var(--f-serif);
    font-style: italic;
    font-size: clamp(1.4rem, 2.6vw, 1.85rem);
    line-height: 1.3;
    color: var(--orange);
    text-indent: -.4em;
  }

  /* ---------- Projects: illustrated cards ---------- */
  .projects { padding-block: clamp(3rem, 6vw, 4.5rem); border-top: 1px solid var(--line); }
  .projects-head { margin-bottom: 1.6rem; }
  .projects-intro { max-width: 42rem; margin-top: 1rem; font-size: 1.1rem; color: var(--ink-soft); }
  .project-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.4rem;
    margin: 0; padding: 0;
    list-style: none;
  }
  .project-card { position: relative; display: flex; flex-direction: column; }
  .card-art {
    order: -1;
    display: grid; place-items: center;
    aspect-ratio: 300 / 210;
    padding: 1rem 1.4rem;
    overflow: hidden;
    border-radius: 12px;
    background: var(--tile);
    transition: transform .35s cubic-bezier(.2, .7, .2, 1), box-shadow .35s ease;
  }
  .project-card:first-child .card-art { background: var(--navy); }
  .project-card:first-child .art [stroke="#4F524B"] { stroke: var(--cream); }
  .project-card:first-child .art [fill="#FBF8F0"] { fill: var(--navy-2); }
  .project-card:hover .card-art { transform: translateY(-4px); box-shadow: 0 20px 30px -22px rgba(20, 24, 42, .6); }
  .project-card:hover .knob { transform: rotate(var(--turn)); }
  .project-card:hover .art-sign { transform: rotate(-6deg); }
  .is-soon .card-art .art { opacity: .55; }
  .project-card .soon-pill { position: absolute; top: .8rem; left: .8rem; z-index: 1; }
  .project-link { display: block; padding-top: 1.1rem; text-decoration: none; }
  .project-link::after { content: ""; position: absolute; inset: 0; z-index: 2; border-radius: 12px; }
  .project-card .eyebrow { margin-bottom: .5rem; font-size: .66rem; }
  .project-card h3 { margin: 0 0 .5rem; font-size: clamp(1.3rem, 2vw, 1.6rem); font-weight: 700; line-height: 1.1; letter-spacing: -.03em; }
  .project-card:hover h3 { text-decoration: underline; text-decoration-color: var(--orange); text-decoration-thickness: 2px; text-underline-offset: 4px; }
  .project-sub { margin: 0 0 .5rem; font-family: var(--f-serif); font-style: italic; font-size: 1.05rem; color: var(--ink-soft); }
  .project-summary { margin: 0 0 1rem; max-width: 34ch; font-size: .98rem; line-height: 1.45; color: var(--ink-soft); }
  .project-card .text-link { font-size: .95rem; }
  .project-card:hover .text-link .i-arrow { transform: translateX(3px); }

  /* ---------- The book: a navy cover on a navy card, its title in orange ---------- */
  .book-feature { padding-block: clamp(3rem, 6vw, 4.5rem); border-top: 1px solid var(--line); }
  .book-inner {
    display: grid;
    grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
    align-items: center;
    gap: clamp(2rem, 5vw, 4.5rem);
  }
  .book-art { order: -1; }
  .book-feature h2 { margin: 0; font-size: clamp(2.4rem, 5vw, 3.6rem); font-weight: 800; line-height: .95; letter-spacing: -.05em; }
  .book-subtitle { margin: .8rem 0 1.4rem; font-family: var(--f-serif); font-style: italic; font-size: clamp(1.25rem, 2vw, 1.55rem); color: var(--ink-soft); }
  .book-body p { margin: 0 0 1rem; max-width: 46ch; font-size: 1.04rem; line-height: 1.6; color: var(--ink-soft); }
  .book-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.6rem; margin-top: 1.8rem; }

  .book-art {
    position: relative;
    display: flex; flex-direction: column; align-items: center;
    width: 100%; max-width: 440px;
    margin: 0;
    justify-self: start;
    padding: clamp(2.4rem, 3.8vw, 3rem) 1.5rem clamp(1.4rem, 2.6vw, 1.8rem);
    border-radius: 18px;
    background: var(--navy);
    color: var(--cream);
  }
  .book-art::before {
    content: "";
    position: absolute; top: 0; right: 9%;
    width: 26px; height: 40px;
    background: var(--orange);
    clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 76%, 0 100%);
  }
  .book {
    position: relative;
    width: min(62%, 260px);
    aspect-ratio: 265 / 375;
    container-type: inline-size;
    transition: transform .5s cubic-bezier(.2, .7, .2, 1);
  }
  .book-art:hover .book, .project-hero-book:hover .book { transform: translateY(-6px) rotate(-1.5deg); }
  .book::before {
    content: ""; position: absolute; z-index: 0;
    left: 6%; right: -6%; bottom: -5%; height: 9%;
    background: radial-gradient(closest-side, rgba(0, 0, 0, .55), transparent);
    filter: blur(6px);
  }
  /* the page edges */
  .book::after {
    content: ""; position: absolute; z-index: 0;
    top: 1.4%; bottom: 1.6%; right: -5cqw; width: 6cqw;
    background: repeating-linear-gradient(90deg, #F3ECDD 0 1px, #D4C9B3 1px 2px);
    border-radius: 0 3px 3px 0;
  }
  .book-front {
    position: relative; z-index: 1;
    width: 100%; height: 100%;
    display: flex; flex-direction: column; align-items: center;
    padding: 18cqw 8cqw 12cqw;
    text-align: center;
    border-radius: 3px 4px 4px 3px;
    background:
      linear-gradient(90deg, rgba(0, 0, 0, .45) 0, rgba(0, 0, 0, .1) 3%, rgba(255, 255, 255, .07) 4.5%, rgba(0, 0, 0, 0) 8%),
      linear-gradient(160deg, #2A3250 0%, #1C2236 60%, #161B2C 100%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06), 0 18px 30px -12px rgba(0, 0, 0, .6);
    overflow: hidden;
  }
  .book-front::before {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background-image: repeating-linear-gradient(0deg, rgba(255, 255, 255, .02) 0 1px, transparent 1px 3px);
  }
  .cover-title, .cover-sub, .cover-author { margin: 0; }
  .cover-title { font-family: var(--f-serif); font-weight: 500; font-size: 18cqw; line-height: .98; letter-spacing: -.02em; color: var(--orange); text-wrap: balance; }
  .cover-sub { margin-top: 6cqw; font-size: 5.6cqw; line-height: 1.35; color: rgba(244, 238, 226, .85); text-wrap: balance; }
  .cover-mark { width: 44cqw; margin-top: 10cqw; }
  .cover-author { margin-top: auto; font-size: 6cqw; font-weight: 500; letter-spacing: .24em; text-transform: uppercase; color: var(--cream); }
  .book-caption { margin: 1.7rem 0 0; font-size: .8rem; color: rgba(244, 238, 226, .62); }

  /* ---------- Newsletter ---------- */
  .signup { padding: 0 var(--gutter) clamp(2.5rem, 5vw, 3.5rem); }
  .signup-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    align-items: center;
    gap: 1.4rem 2.5rem;
    max-width: calc(var(--wrap) - 2 * var(--gutter));
    padding: clamp(1.8rem, 3.6vw, 2.6rem) clamp(1.5rem, 3.6vw, 2.6rem);
    border-radius: 14px;
    background: var(--peach);
  }
  .signup .eyebrow { color: var(--ink); }
  .signup h2 { margin: 0 0 .6rem; font-size: clamp(2rem, 3.8vw, 2.7rem); font-weight: 700; line-height: 1.02; letter-spacing: -.04em; }
  .signup-blurb { margin: 0; max-width: 36ch; font-size: 1.05rem; line-height: 1.45; color: var(--ink-soft); }
  .signup-form { position: relative; }
  .signup-row { display: flex; flex-wrap: wrap; gap: .7rem; }
  .signup-row input {
    flex: 1 1 14rem; min-width: 0; height: 52px;
    padding: 0 1rem;
    border: 1.5px solid var(--line);
    border-radius: 7px;
    background: var(--paper);
    font-size: 1rem;
  }
  .signup-row input::placeholder { color: #7A7C86; }
  .signup-row input:focus-visible { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(232, 166, 63, .3); }
  .signup-row input[aria-invalid="true"] { border-color: #A4331F; }
  .signup-row .btn-solid { height: 52px; }
  .form-msg { min-height: 1.5em; margin: .7rem 0 0; font-size: .92rem; color: var(--ink); }
  .form-msg.is-error { color: #A4331F; }
  .signup-aside { margin: 0; font-size: 1.45rem; color: var(--orange-text); transform: rotate(-2deg); transform-origin: left; }
  .signup-aside svg { display: none; }

  /* ---------- Footer ---------- */
  .footer-inner {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: 1rem 2rem;
    padding-block: 1.3rem calc(2rem + env(safe-area-inset-bottom, 0px));
    border-top: 1.5px solid var(--ink);
  }
  .footer-name { font-size: 1.35rem; font-weight: 500; letter-spacing: -.02em; }
  .footer-nav { display: flex; flex-wrap: wrap; gap: .5rem 1.8rem; font-size: .9rem; }
  .footer-nav a { text-decoration: none; }
  .footer-nav a:hover { text-decoration: underline; text-decoration-color: var(--orange); text-underline-offset: 4px; }
  .site-footer small { font-size: .9rem; margin-right: 4.5rem; }

  /* ---------- Project pages ---------- */
  .project-hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 2rem;
    padding-block: clamp(1rem, 2vw, 1.5rem) clamp(2.5rem, 5vw, 3.5rem);
  }
  .back-link {
    display: inline-flex; align-items: center; gap: .55rem;
    margin-bottom: 1.6rem;
    font-size: .95rem;
    font-weight: 500;
    color: var(--ink-soft);
    text-decoration: none;
  }
  .back-link .i-arrow { transform: scaleX(-1); }
  .back-link:hover { color: var(--ink); }
  .back-link:hover .i-arrow { transform: scaleX(-1) translateX(3px); }
  .project-page h1 { margin: 0; font-size: clamp(2.8rem, 6.6vw, 5rem); font-weight: 800; line-height: .95; letter-spacing: -.05em; }
  .project-hero .project-sub { margin-top: .9rem; font-size: clamp(1.25rem, 2.2vw, 1.55rem); }
  .project-hero-art {
    display: grid; place-items: center;
    width: clamp(220px, 28vw, 340px);
    aspect-ratio: 300 / 210;
    padding: 1.4rem 1.8rem;
    border-radius: 14px;
    background: var(--tile);
  }

  .project-hero-book {
    aspect-ratio: auto;
    width: clamp(220px, 24vw, 300px);
    padding: 2rem 1.5rem 2.2rem;
    border-radius: 18px;
    background: var(--navy);
  }
  .project-hero-book .book { width: 68%; }

  .project-layout {
    display: grid;
    grid-template-columns: minmax(0, 42rem);
    padding-block: clamp(2.5rem, 5vw, 3.5rem) clamp(3rem, 6vw, 4.5rem);
    border-top: 1px solid var(--line);
  }
  .project-layout.has-toc { grid-template-columns: 13rem minmax(0, 42rem); column-gap: clamp(2rem, 6vw, 5rem); }
  .toc { position: sticky; top: 108px; align-self: start; }
  .toc ol { margin: 0; padding: 0; list-style: none; }
  .toc a {
    display: block;
    padding: .45rem 0 .45rem .9rem;
    border-left: 3px solid var(--line);
    font-size: .95rem;
    font-weight: 500;
    line-height: 1.3;
    color: var(--ink-soft);
    text-decoration: none;
    transition: border-color .2s ease, color .2s ease;
  }
  .toc a:hover { color: var(--ink); }
  .toc a.is-current { border-left-color: var(--orange); color: var(--ink); }

  .coming-soon {
    margin: 2rem 0 1rem;
    padding: 1.5rem 1.6rem;
    border-left: 11px solid var(--teal);
    border-radius: 12px;
    background: var(--navy);
  }
  .coming-soon .hand { margin: 0; font-size: 2rem; color: var(--cream); }

  .documents { margin-top: 3rem; }
  .doc-list { margin: 0; padding: 0; list-style: none; border-top: 1.5px solid var(--ink); }
  .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(--line);
    font-family: var(--f-sans);
    text-decoration: none;
  }
  .doc-kind { font-size: .68rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--orange-text); }
  .doc-title { font-size: 1.08rem; font-weight: 600; letter-spacing: -.01em; }
  .doc-list a:hover .doc-title { text-decoration: underline; text-decoration-color: var(--orange); text-decoration-thickness: 2px; text-underline-offset: 4px; }
  .doc-list a:hover .i-arrow { transform: translateX(3px); }

  .project-pager { display: flex; justify-content: space-between; gap: .9rem; padding-block: 0 clamp(3rem, 6vw, 4.5rem); }
  .project-pager a {
    display: flex; flex: 0 1 24rem; flex-direction: column; gap: .4rem;
    padding: 1.3rem 1.5rem;
    border-radius: 12px;
    background: var(--navy);
    color: var(--cream);
    text-decoration: none;
    transition: background-color .2s ease, transform .3s cubic-bezier(.2, .7, .2, 1);
  }
  .project-pager a:hover { background: var(--navy-2); transform: translateY(-2px); }
  .project-pager .eyebrow { margin: 0; color: var(--orange); }
  .pager-next { align-items: flex-end; text-align: right; }
  .pager-title { font-size: clamp(1.25rem, 2.2vw, 1.5rem); font-weight: 700; line-height: 1.15; letter-spacing: -.03em; }

  /* ---------- Settings button + panel ---------- */
  .settings-btn {
    width: 3.5rem; height: 3.5rem; padding: 0;
    border: 0;
    border-radius: 12px;
    background: var(--navy);
    color: var(--cream);
    box-shadow: 0 14px 28px -12px rgba(20, 24, 42, .55);
    transition: transform .3s cubic-bezier(.3, 1.5, .5, 1), background-color .3s ease;
  }
  .cog { width: 2.1rem; height: 2.1rem; overflow: visible; transition: transform .9s cubic-bezier(.3, 1.3, .4, 1); }
  .cog-wheel { transform-box: view-box; transform-origin: 20px 20px; }
  .cog-wheel path { fill: var(--navy-2); }
  .cog circle[fill="#DDBE75"] { fill: var(--orange); }
  .settings-btn:hover { transform: translateY(-2px); }
  .settings-btn:hover .cog { transform: rotate(60deg); }
  .settings-btn[aria-expanded="true"] { background: var(--navy-2); }
  .settings-btn[aria-expanded="true"] .cog { transform: rotate(135deg); }
  .settings-hint { margin-right: .2rem; font-size: 1.45rem; color: var(--orange-text); 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.2rem 1.1rem 1.25rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--paper);
    color: var(--ink);
    box-shadow: 0 22px 40px -20px rgba(20, 24, 42, .5);
  }
  .settings-panel .eyebrow { margin: 0 0 .9rem .2rem; }
  .settings-panel legend { margin-bottom: .45rem; padding-left: .2rem; font-size: .74rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }
  .style-option { gap: .8rem; padding: .6rem .7rem; border-radius: 8px; transition: background-color .2s ease; }
  .style-option:not(.is-soon):hover { background: var(--tile); }
  .style-option:has(input:checked) { background: var(--peach); }
  .style-option:has(input:focus-visible) { outline: 2.5px solid var(--orange); outline-offset: 1px; }
  .style-option.is-soon { opacity: .55; }
  .swatches i { width: .95rem; height: .95rem; border: 1px solid rgba(20, 24, 42, .2); }
  .swatches i + i { margin-left: -.3rem; }
  .style-name { font-size: 1rem; font-weight: 600; letter-spacing: -.01em; }
  .soon { margin-left: auto; padding: .15rem .5rem; border-radius: 999px; background: var(--teal); font-family: var(--f-sans); font-size: .62rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
  .size-picker { margin-top: 1rem; padding-top: .9rem; border-top: 1px solid var(--line); }
  .size-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; }
  .size-options button { height: 42px; border: 1.5px solid var(--line); border-radius: 7px; background: none; font-weight: 600; }
  .size-options button:hover { background: var(--tile); }
  .size-options button[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: var(--cream); }

  /* ---------- Search ---------- */
  .search-dialog {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--paper);
    color: var(--ink);
    box-shadow: 0 30px 60px -30px rgba(20, 24, 42, .6);
  }
  .search-dialog::backdrop { background: rgba(20, 24, 42, .35); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
  .search-head { padding: .75rem .75rem .75rem 1.2rem; border-bottom: 1px solid var(--line); }
  .search-icon { width: 1.3rem; height: 1.3rem; flex: none; }
  .search-head input { padding: .35rem 0; font-size: 1.25rem; font-weight: 500; }
  .search-head input::placeholder { color: #7A7C86; }
  .search-results { padding: .4rem; }
  .search-results a { padding: .8rem .9rem; border-radius: 8px; transition: background-color .15s ease; }
  .search-results a:hover, .search-results a:focus-visible { background: var(--tile); }
  .result-where { display: block; margin-bottom: .2rem; font-size: .66rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--orange-text); }
  .result-title { display: block; font-size: 1.15rem; font-weight: 700; letter-spacing: -.02em; }
  .result-snippet { display: block; margin-top: .25rem; font-size: .95rem; line-height: 1.45; color: var(--ink-soft); }
  .search-results mark { padding: 0 .1em; border-radius: 3px; background: rgba(232, 166, 63, .35); color: inherit; }
  .search-empty { padding: .9rem .9rem 1.1rem; font-size: .98rem; color: var(--ink-soft); }

  /* ---------- Responsive ---------- */
  @media (max-width: 1100px) {
    .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }

  @media (max-width: 960px) {
    .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(--bg);
      border-bottom: 1px solid var(--line);
      box-shadow: 0 20px 30px -22px rgba(20, 24, 42, .4);
    }
    .nav.is-open { display: flex; }
    .nav a { padding: .95rem 0; border-bottom: 1px solid var(--line); font-size: 1.1rem; }
    .nav a:not(.btn-outline):hover::after { right: auto; width: 2.4rem; bottom: .55rem; }
    .nav .btn-outline { margin: 1.1rem 0 0; text-align: center; }

    .hero-inner { grid-template-columns: minmax(0, 1fr); }
    .hero-art { order: -1; justify-self: center; max-width: 520px; }
    .book-inner { grid-template-columns: minmax(0, 1fr); }
    .book-art { justify-self: center; max-width: 520px; }
    .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 { height: 1px; }
    .signup-inner { grid-template-columns: minmax(0, 1fr); }
    .project-layout.has-toc { grid-template-columns: minmax(0, 42rem); }
    .toc { position: static; margin-bottom: 2rem; }
  }

  @media (max-width: 700px) {
    .project-hero-inner { grid-template-columns: minmax(0, 1fr); }
    .project-hero-art { width: 220px; }
    .project-hero-book { width: 220px; }
  }

  @media (max-width: 600px) {
    .brand-mark { width: 46px; height: 30px; }
    .brand-name { font-size: 1.35rem; }
    .hero-actions .btn-solid { width: 100%; }
    /* Project cards become a swipeable row */
    .project-grid {
      display: flex; gap: 1rem;
      margin-inline: calc(var(--gutter) * -1);
      padding-inline: var(--gutter);
      overflow-x: auto;
      scroll-snap-type: x mandatory;
      scroll-padding-inline: var(--gutter);
      scrollbar-width: none;
    }
    .project-grid::-webkit-scrollbar { display: none; }
    .project-card { flex: 0 0 82%; scroll-snap-align: 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; }
    .footer-inner { flex-direction: column; align-items: flex-start; }
  }

  /* ---------- Motion ---------- */
  @media (prefers-reduced-motion: no-preference) {
    /* Home hero: the headline rises, the card settles, the ribbon drops and the name is underlined */
    .hero-copy > * { animation: s3-rise .8s cubic-bezier(.2, .7, .2, 1) both; }
    .hero-copy > :nth-child(2) { animation-delay: .07s; }
    .hero-copy > :nth-child(3) { animation-delay: .14s; }
    .hero-copy > :nth-child(4) { animation-delay: .21s; }
    .hero-art { animation: s3-settle 1s cubic-bezier(.2, .7, .2, 1) .15s both; }
    .hero-art::before { animation: s3-ribbon .6s cubic-bezier(.3, 1.4, .5, 1) 1s both; }
    .hl-line { animation: s3-write .9s cubic-bezier(.6, .1, .2, 1) .5s both; }
    .hand-note span { animation: s3-write 1s steps(14) 1.4s both; }
    .hand-note svg { animation: s3-fade .4s ease 2.4s both; }

    /* The scribble draws itself once the panel scrolls into view */
    .scribble path { stroke-dasharray: 1; stroke-dashoffset: 1; }
    .band-inner:has(.band-right.is-visible) .scribble path,
    &:not(.reveal-ready) .scribble path { animation: s3-draw 1.2s ease-in-out .3s both; }

    /* The book: the cover settles and the ribbon drops once the card scrolls into view */
    .book-art.is-visible .book { animation: s3-settle .9s cubic-bezier(.2, .7, .2, 1) .2s backwards; }
    .book-art.is-visible::before { animation: s3-ribbon .6s cubic-bezier(.3, 1.4, .5, 1) .8s both; }

    .project-hero-copy > * { animation: s3-rise .7s cubic-bezier(.2, .7, .2, 1) both; }
    .project-hero-copy > :nth-child(3) { animation: none; }
    .project-hero-art { animation: s3-settle .9s cubic-bezier(.2, .7, .2, 1) .1s both; }
    .project-hero-art .knob { animation: s3-turn 1.6s cubic-bezier(.3, 1.3, .4, 1) .3s both; }
    .project-hero-art .art-trail { animation: s3-draw 1.4s ease-in-out .4s both; }
    .project-card:hover .art-trail { animation: s3-draw .9s ease-in-out both; }
    .project-card:hover .art-goal { animation: s3-pulse 1.2s ease-in-out; }
    .art-dot { animation: s3-bounce 1.4s ease-in-out infinite; }
    .art-dot:nth-child(2) { animation-delay: .18s; }
    .art-dot:nth-child(3) { animation-delay: .36s; }

    .cog-wheel { animation: s3-tick 9s ease-in-out 3s infinite; }
    .settings-btn.is-hopping .cog-wheel { animation: s3-spin .9s cubic-bezier(.3, 1.2, .4, 1); }
    .settings-hint:not([hidden]) { animation: s3-write .9s steps(12) both; }
    .settings-hint.is-leaving { opacity: 0; transition: opacity .6s ease; }

    .settings-panel {
      transition: opacity .25s ease, transform .3s cubic-bezier(.2, .7, .2, 1), display .3s allow-discrete, overlay .3s allow-discrete;
    }
    .settings-panel:not(:popover-open) { opacity: 0; transform: translateY(10px); }
    @starting-style { .settings-panel:popover-open { opacity: 0; transform: translateY(10px); } }
    .search-dialog[open] { animation: s3-rise .3s cubic-bezier(.2, .7, .2, 1); }
  }
}

@keyframes s3-rise { from { opacity: 0; transform: translateY(16px); } }
@keyframes s3-fade { from { opacity: 0; } }
@keyframes s3-settle { from { opacity: 0; transform: translateY(20px); } }
@keyframes s3-ribbon { from { transform: translateY(-100%); } }
@keyframes s3-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes s3-write { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes s3-turn { from { transform: rotate(var(--turn)); } }
@keyframes s3-pulse { 50% { transform: scale(1.3); } }
@keyframes s3-bounce { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-5px); } }
@keyframes s3-tick { 0%, 90%, 100% { transform: rotate(0); } 93% { transform: rotate(14deg); } 96% { transform: rotate(-4deg); } }
@keyframes s3-spin { to { transform: rotate(360deg); } }
