:root {
  --paper: #f5f2ec;
  --paper-deep: #ebe6dd;
  --ink: #1b2523;
  --muted: #66706b;
  --line: #d8d4ca;
  --accent: #b94e32;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "DM Sans", "Helvetica Neue", sans-serif;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-expo: cubic-bezier(.16, 1, .3, 1);
  --ease-back: cubic-bezier(.34, 1.56, .64, 1);
}

* { box-sizing: border-box; }
html { overflow-x: clip; scroll-behavior: smooth; scroll-padding-top: 96px; }
body { margin: 0; overflow-x: clip; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.6; }
body.modal-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
@supports not (overflow-x: clip) { html { overflow-x: visible; } body { overflow-x: hidden; } }
.page-loader { position: fixed; z-index: 10000; inset: 0; display: grid; place-items: center; gap: 18px; align-content: center; background: var(--paper); transition: opacity .55s var(--ease), visibility .55s; }
.page-loader.is-loaded { opacity: 0; visibility: hidden; pointer-events: none; }
html:not(.js) .page-loader { display: none; } /* without JavaScript nothing would ever hide it */
.container { width: min(1180px, calc(100% - 96px)); margin-inline: auto; }
.skip-link { position: fixed; z-index: 100; top: -60px; left: 20px; padding: 10px 15px; background: var(--ink); color: var(--paper); transition: top .2s; }
.skip-link:focus { top: 20px; }
.reading-progress { position: fixed; z-index: 20; top: 0; left: 0; width: 0; height: 3px; background: var(--accent); }

.site-header { position: sticky; z-index: 10; top: 0; background: rgba(245,242,236,.92); border-bottom: 1px solid transparent; backdrop-filter: blur(14px); transition: border-color .3s, box-shadow .3s, transform .5s var(--ease-expo); }
.site-header.is-hidden { transform: translateY(-100%); }
.site-header.is-scrolled { border-color: var(--line); box-shadow: 0 5px 20px rgba(27,37,35,.04); }
.nav-wrap { width: min(1280px, calc(100% - 96px)); height: 84px; margin: auto; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; gap: 10px; align-items: center; font-size: 14px; font-weight: 600; letter-spacing: -.02em; }
.brand-logo { display: block; flex: none; width: 38px; height: auto; color: var(--ink); }
.brand-name { font-family: var(--serif); font-size: 23px; font-weight: 600; letter-spacing: -.01em; line-height: 1; }
.brand-name em { font-style: italic; color: var(--accent); }
.desktop-nav { display: flex; align-items: center; gap: 34px; font-size: 13px; font-weight: 500; }
.desktop-nav a, .mobile-menu a, .footer-links a { transition: color .25s; }
.desktop-nav a:hover, .mobile-menu a:hover, .footer-links a:hover { color: var(--accent); }
.nav-link-accent { color: var(--accent); }
.nav-link-accent span, .text-link span, .read-link span { display: inline-block; transition: transform .25s var(--ease); }
.nav-link-accent:hover span, .text-link:hover span, .read-link:hover span { transform: translate(3px, -3px); }
.menu-toggle { display: none; width: 44px; height: 44px; padding: 12px 9px; border: 1px solid var(--line); background: transparent; }
.menu-toggle span { display: block; width: 24px; height: 1px; margin: 6px auto; background: var(--ink); transition: transform .3s var(--ease); }
.mobile-menu { display: none; }

.hero { min-height: 690px; display: grid; grid-template-columns: 1.15fr .85fr; align-items: center; gap: 11%; padding-top: 72px; padding-bottom: 105px; }
.eyebrow { margin: 0 0 24px; color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: .14em; line-height: 1.4; text-transform: uppercase; }
.eyebrow-line { display: inline-block; width: 33px; height: 1px; margin-right: 10px; vertical-align: middle; background: currentColor; }
h1, h2, p { margin-top: 0; }
h1, h2 { font-family: var(--serif); font-weight: 600; letter-spacing: -.045em; line-height: .93; }
h1 { max-width: 760px; margin-bottom: 31px; font-size: clamp(4.2rem, 7.8vw, 7.7rem); }
h1 i, h2 i { color: var(--accent); font-weight: 500; font-style: italic; }
.hero-intro { max-width: 510px; margin-bottom: 33px; color: var(--muted); font-size: 17px; line-height: 1.7; }
.hero-actions { display: flex; gap: 27px; align-items: center; }
.button { display: inline-flex; gap: 17px; align-items: center; justify-content: center; min-height: 48px; padding: 0 21px; border: 1px solid transparent; font-size: 12px; font-weight: 700; letter-spacing: .02em; transition: background .25s, color .25s, transform .25s; }
.button span { font-size: 17px; transition: transform .25s var(--ease); }
.button { transform: translate(var(--mx, 0px), var(--my, 0px)); }
.button:hover { transform: translate(var(--mx, 0px), calc(var(--my, 0px) - 2px)); }
.button:hover span { transform: translate(3px, -2px); }
.button-dark { background: var(--ink); color: var(--paper); }
.button-dark:hover { background: var(--accent); }
.button-outline { border-color: var(--ink); background: transparent; color: var(--ink); }
.button-outline:hover { background: var(--ink); color: var(--paper); }
.text-link, .read-link { border-bottom: 1px solid var(--accent); color: var(--ink); font-size: 12px; font-weight: 700; }
.hero-aside { position: relative; max-width: 390px; justify-self: end; }
.portrait-frame { position: relative; padding: 0 0 25px 25px; }
.portrait-frame::before { position: absolute; z-index: -1; bottom: 0; left: 0; width: calc(100% - 25px); height: calc(100% - 25px); border: 1px solid var(--accent); content: ""; }
.portrait-frame img { width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; filter: saturate(.72); }
.portrait-caption { position: absolute; right: -22px; bottom: 51px; padding: 10px 13px; background: var(--paper); color: var(--accent); font-family: var(--serif); font-size: 19px; line-height: 1.05; transform: rotate(-4deg); }
.hero-note { display: flex; gap: 17px; align-items: flex-start; margin-top: 26px; padding-left: 25px; color: var(--muted); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.hero-note span { color: var(--accent); font-family: var(--serif); font-size: 24px; line-height: 1; }
.hero-note p { margin: 0; line-height: 1.5; }

.section-kicker { display: flex; gap: 14px; align-items: center; margin-bottom: 37px; color: var(--muted); }
.section-kicker > span:first-child { color: var(--accent); font-family: var(--serif); font-size: 21px; }
.section-kicker h2 { margin: 0; font-family: var(--sans); font-size: 12px; font-weight: 700; letter-spacing: .12em; line-height: 1; text-transform: uppercase; }
.section-rule { flex: 1; height: 1px; background: var(--line); }
.article-count { font-size: 11px; }
.featured { padding: 70px 0 110px; border-top: 1px solid var(--line); }
.featured-article { display: grid; grid-template-columns: 1.2fr .8fr; min-height: 440px; background: var(--paper-deep); }
.image-link { overflow: hidden; background: #d5d2ca; }
.image-link img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.7); transition: transform .8s var(--ease), filter .5s; }
.image-link:hover img { transform: scale(1.04); filter: saturate(1); }
.featured-copy { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding: 55px 9%; }
.article-meta { display: flex; gap: 4px 8px; flex-wrap: wrap; margin-bottom: 22px; color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.category-label { color: var(--accent); }
.featured-copy h2 { margin-bottom: 20px; font-size: clamp(2.8rem, 4.5vw, 4.5rem); }
.featured-copy h2 a { transition: color .25s; }
.featured-copy h2 a:hover { color: var(--accent); }
.featured-copy > p { max-width: 340px; margin-bottom: 31px; color: var(--muted); font-size: 15px; line-height: 1.7; }
.read-link { color: var(--accent); }

.journal { padding-bottom: 124px; }
.journal-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 25px; }
.journal-toolbar p { margin: 0; color: var(--muted); font-family: var(--serif); font-size: 23px; }
.search-wrap { display: flex; gap: 9px; align-items: center; width: 220px; padding: 7px 0; border-bottom: 1px solid var(--ink); }
.search-wrap span { color: var(--accent); font-size: 22px; line-height: 1; }
.search-wrap input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 12px; }
.search-wrap input::placeholder { color: var(--muted); }
.search-wrap { transition: border-color .25s; }
.search-wrap:focus-within { border-color: var(--accent); box-shadow: 0 1px 0 var(--accent); }
.topic-filters { display: flex; gap: 8px; max-width: 100%; margin-bottom: 43px; overflow-x: auto; }
.filter-button { padding: 7px 13px; border: 1px solid var(--line); border-radius: 100px; background: transparent; color: var(--muted); font-size: 11px; transition: color .25s, border .25s, background .25s; }
.filter-button:hover, .filter-button.is-active { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.article-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.article-card { min-width: 0; }
.card-image { position: relative; display: block; overflow: hidden; aspect-ratio: 1 / 1; margin-bottom: 19px; background: var(--paper-deep); }
.card-image img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.72); transition: transform .65s var(--ease), filter .4s; }
.article-card:hover .card-image img { transform: scale(1.045); filter: saturate(1); }
.card-image::after { position: absolute; right: 13px; bottom: 13px; display: grid; width: 30px; height: 30px; place-items: center; background: var(--paper); color: var(--accent); content: "↗"; font-size: 15px; opacity: 0; transform: translate(-4px, 4px); transition: opacity .3s, transform .3s; }
.article-card:hover .card-image::after { opacity: 1; transform: translate(0); }
.card-meta { display: flex; flex-wrap: wrap; gap: 4px 8px; margin-bottom: 10px; color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; }
.card-meta .category-label { color: var(--accent); }
.article-card h3 { margin-bottom: 9px; font-family: var(--serif); font-size: 29px; font-weight: 600; line-height: .98; letter-spacing: -.03em; }
.article-card h3 a { transition: color .2s; }
.article-card h3 a:hover { color: var(--accent); }
.article-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.journal-more-wrap { display: flex; justify-content: center; padding-top: 48px; }
.read-more-button[hidden] { display: none; }
.empty-state { padding: 45px 0; color: var(--muted); font-family: var(--serif); font-size: 25px; }

.topics { padding-bottom: 126px; }
.topic-list { border-top: 1px solid var(--ink); }
.topic-list a { display: grid; grid-template-columns: 8% 30% 1fr 30px; gap: 20px; align-items: center; padding: 22px 0; border-bottom: 1px solid var(--line); transition: padding .3s var(--ease), color .3s; }
.topic-list a:hover { padding-inline: 13px; color: var(--accent); }
.topic-list span { color: var(--accent); font-size: 11px; }
.topic-list strong { font-family: var(--serif); font-size: 30px; font-weight: 600; line-height: 1; }
.topic-list em { color: var(--muted); font-size: 13px; font-style: normal; }
.topic-list i { font-size: 19px; font-style: normal; text-align: right; }

.about-section { display: grid; grid-template-columns: .65fr 1.35fr; gap: 9%; padding: 90px 9%; background: var(--ink); color: var(--paper); }
.about-aside { color: #b2b8b0; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.about-aside .eyebrow-line { color: var(--accent); }
.about-copy h2 { margin-bottom: 30px; color: var(--paper); font-size: clamp(3rem, 5.5vw, 5.3rem); }
.about-copy h2 i { color: #d8795c; }
.about-copy p { max-width: 610px; color: #b2b8b0; font-size: 15px; line-height: 1.75; }
.about-copy .button { margin-top: 10px; border-color: #76807a; color: var(--paper); }
.about-copy .button:hover { border-color: var(--paper); background: var(--paper); color: var(--ink); }
.contact-cta { display: flex; align-items: end; justify-content: space-between; padding-top: 130px; padding-bottom: 130px; }
.contact-cta h2 { margin: 0; font-size: clamp(3.7rem, 6.7vw, 6.8rem); }
.cta-right { width: 255px; }
.cta-right p { margin-bottom: 27px; color: var(--muted); font-size: 15px; line-height: 1.7; }
.cta-right .button { min-height: 54px; padding-inline: 25px; font-size: 14px; }
.social-links-inline { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 22px; }
.social-links-inline .social-link { padding: 7px 8px; font-size: 10px; }
.site-footer { display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: end; padding-top: 28px; padding-bottom: 35px; border-top: 1px solid var(--line); }
.site-footer > p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; text-align: center; }
.footer-links { display: flex; justify-content: end; gap: 8px; color: var(--muted); font-size: 11px; }
.back-to-top { position: fixed; z-index: 15; right: 96px; bottom: 28px; display: inline-flex; gap: 9px; align-items: center; padding: 11px 15px; border: 1px solid var(--accent); border-radius: 999px; background: var(--accent); color: var(--paper); box-shadow: 0 8px 24px rgba(27,37,35,.16); font-size: 11px; font-weight: 700; letter-spacing: .04em; opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(12px); transition: opacity .35s var(--ease), visibility .35s, background .25s, color .25s, transform .35s var(--ease), box-shadow .25s; }
.back-to-top.is-visible { opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0); }
.back-to-top span { display: grid; width: 18px; height: 18px; place-items: center; border: 1px solid currentColor; border-radius: 50%; font-size: 14px; line-height: 1; transition: transform .25s var(--ease); }
.back-to-top:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); transform: translateY(-4px); box-shadow: 0 12px 28px rgba(27,37,35,.22); }
.back-to-top:hover span { transform: translateY(-2px); }
.social-link { display: inline-flex; gap: 6px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); transition: border-color .25s, background .25s, color .25s, transform .25s; }
.social-link span { display: grid; width: 18px; height: 18px; place-items: center; background: var(--ink); color: var(--paper); font-size: 9px; font-weight: 700; line-height: 1; }
.social-link:hover { border-color: var(--accent); background: var(--paper-deep); color: var(--accent); transform: translateY(-2px); }

.modal-bg { position: fixed; z-index: 30; inset: 0; display: grid; place-items: center; padding: 24px; background: rgba(27,37,35,.72); backdrop-filter: blur(8px); }
.modal-bg[hidden] { display: none; }
.modal-box { position: relative; width: min(590px, 100%); max-height: 90vh; max-height: 90dvh; overflow: auto; overscroll-behavior: contain; padding: 55px clamp(25px, 6vw, 65px); background: var(--paper); box-shadow: 0 25px 80px rgba(0,0,0,.2); animation: modal-in .35s var(--ease); }
.modal-box h2 { margin-bottom: 25px; font-size: 55px; }
.modal-box p { color: var(--muted); font-size: 14px; line-height: 1.75; }
.modal-close { position: absolute; top: 18px; right: 21px; width: 35px; height: 35px; border: 1px solid var(--line); background: transparent; color: var(--ink); font-size: 24px; line-height: 1; transition: background .2s; }
.modal-close:hover { background: var(--paper-deep); }
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }
.reveal-delay { transition-delay: .16s; }
@keyframes modal-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

@media (max-width: 800px) {
  .container, .nav-wrap { width: min(100% - 40px, 620px); }
  .desktop-nav { display: none; }
  .menu-toggle { display: block; }
  .mobile-menu { display: flex; flex-direction: column; gap: 0; max-height: 0; overflow: hidden; padding: 0 20px; transition: max-height .35s var(--ease), padding .35s; }
  .mobile-menu.is-open { max-height: 300px; padding: 5px 20px 20px; border-top: 1px solid var(--line); }
  .mobile-menu a { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
  .mobile-menu a:last-child { border: 0; color: var(--accent); }
  .hero { min-height: auto; grid-template-columns: 1fr; gap: 58px; padding-top: 82px; padding-bottom: 90px; }
  .hero-aside { width: min(100%, 350px); justify-self: center; }
  h1 { font-size: clamp(4rem, 16vw, 6rem); }
  .featured { padding-bottom: 85px; }
  .featured-article { grid-template-columns: 1fr; }
  .featured-image { aspect-ratio: 1.55 / 1; }
  .featured-copy { padding: 40px; }
  .article-grid { grid-template-columns: repeat(2, 1fr); }
  .article-card:last-child:nth-child(odd) { grid-column: 1 / -1; max-width: calc(50% - 14px); }
  .about-section { grid-template-columns: 1fr; gap: 30px; padding: 60px 30px; }
  .contact-cta { align-items: start; flex-direction: column; gap: 35px; padding: 90px 0; }
  .cta-right { width: 100%; }
  .site-footer { grid-template-columns: 1fr 1fr; gap: 30px; }
  .site-footer > p { grid-column: 1 / -1; grid-row: 2; text-align: left; }
  .footer-links { justify-content: end; }
  .back-to-top { right: 92px; bottom: calc(31px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 520px) {
  .container, .nav-wrap { width: calc(100% - 36px); }
  .nav-wrap { height: 72px; }
  .hero { padding-top: 65px; }
  .hero-intro { font-size: 15px; }
  .portrait-caption { right: -8px; }
  .hero-actions { align-items: flex-start; flex-direction: column; gap: 20px; }
  .contact-cta h2 { font-size: clamp(3.2rem, 15vw, 4.7rem); }
  .cta-right { width: 100%; }
  .social-links-inline { gap: 6px; }
  .section-kicker { margin-bottom: 27px; }
  .section-kicker .section-rule { display: none; }
  .section-kicker { flex-wrap: wrap; }
  .section-kicker .article-count { width: 100%; margin-left: 35px; }
  .journal-toolbar { align-items: start; flex-direction: column; gap: 22px; }
  .journal-toolbar p { font-size: 20px; }
  .search-wrap { width: 100%; }
  .topic-filters { overflow-x: auto; padding-bottom: 5px; }
  .filter-button { flex-shrink: 0; }
  .article-grid { grid-template-columns: 1fr; gap: 45px; }
  .article-card:last-child:nth-child(odd) { grid-column: auto; max-width: none; }
  .topic-list a { grid-template-columns: 28px 1fr 20px; gap: 10px; }
  .topic-list em { display: none; }
  .topic-list strong { font-size: 25px; }
  .about-copy h2 { font-size: 3.1rem; }
  .site-footer { grid-template-columns: 1fr; }
  .site-footer > p { grid-column: auto; grid-row: auto; text-align: left; }
  .footer-links { justify-content: start; }
  .back-to-top { right: 90px; bottom: calc(32px + env(safe-area-inset-bottom, 0px)); padding: 10px 13px; }
  .modal-box { padding: 46px 24px 35px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
  .page-loader { transition: none; }
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

/* ==========================================================================
   Animated logo (header) + animated monogram (page loader)
   ========================================================================== */
.hs-ink    { fill: var(--ink); }
.hs-accent { fill: var(--accent); }

/* Header logo: SVG monogram + real-text wordmark.
   The wordmark is live text (not a drawing) so the browser can hint it and it stays sharp. */
.hs-logo-link { --logo-h: 22px; gap: calc(var(--logo-h) * .49); align-items: center; line-height: 1; }
.hs-mark { display: block; flex: none; height: var(--logo-h); width: auto; overflow: visible; }
.hs-wordmark { font-family: var(--serif); font-size: calc(var(--logo-h) * 1.2227); font-weight: 600; line-height: 1; letter-spacing: -.01em; color: var(--ink); white-space: nowrap; }
.hs-wordmark em { font-style: italic; font-weight: 600; color: var(--accent); }
.hs-word-1, .hs-word-2 { display: inline-block; }
.hs-word-1 { overflow: clip; padding-top: .2em; margin-top: -.2em; }   /* clip line for the rise */
.hs-word-1 > span { display: inline-block; }
/* extra box around "Scripts" so the wipe never trims the italic overhang or the p descender */
.hs-word-2 { padding: .15em .14em .32em .06em; margin: -.15em -.14em -.32em -.06em;
             background: linear-gradient(currentColor, currentColor) no-repeat .06em calc(100% - .16em) / 0 1px;
             transition: background-size .55s var(--ease-expo); }

/* Intro: plays when the page loader fades out */
.hs-mark .hs-in-H  { animation: hs-rise-up 1s cubic-bezier(.16,1,.3,1) .1s both; }
.hs-mark .hs-in-s  { transform-box: fill-box; transform-origin: 50% 0%; animation: hs-rise-swing .9s cubic-bezier(.34,1.56,.64,1) .45s both; }
.hs-word-1 > span  { animation: hs-rise-lift .9s cubic-bezier(.16,1,.3,1) .5s both; }
.hs-word-2         { animation: hs-rise-write 1s cubic-bezier(.16,1,.3,1) .95s both; }
/* Wait while the loader is still covering the page */
.page-loader:not(.is-loaded) ~ .site-header :is(.hs-mark .hs-in-H, .hs-mark .hs-in-s, .hs-word-1 > span, .hs-word-2) { animation-play-state: paused; }

@keyframes hs-rise-up    { from { transform: translateY(18px); opacity: 0; } }
@keyframes hs-rise-swing { from { transform: translate(-4px, -10px) rotate(-16deg); opacity: 0; } }
@keyframes hs-rise-lift  { from { transform: translateY(110%); } }
@keyframes hs-rise-write { from { clip-path: inset(0 100% 0 0); transform: translateX(-6px); } to { clip-path: inset(0 0 0 0); transform: none; } }

/* Hover and keyboard focus: the s swings and a line draws under "Scripts" */
.hs-mark .hs-hov-s { transform-box: fill-box; transform-origin: 50% 0%; }
.hs-logo-link:hover .hs-hov-s,
.hs-logo-link:focus-visible .hs-hov-s { animation: hs-hover-swing .9s ease-in-out both; }
.hs-logo-link:hover .hs-word-2,
.hs-logo-link:focus-visible .hs-word-2 { background-size: calc(100% - .2em) 1px; }
@keyframes hs-hover-swing { 35% { transform: rotate(-16deg); } 65% { transform: rotate(7deg); } 85% { transform: rotate(-2deg); } }

/* Page loader monogram */
.hs-loader-mark { width: 84px; height: auto; overflow: visible; }
.hs-load-base  { fill: var(--ink); opacity: .16; }
.hs-load-trace { fill: none; stroke: var(--ink); stroke-width: 16; stroke-linecap: round; stroke-dasharray: .2 .8; animation: hs-load-trace 2.4s linear infinite; }
.hs-load-s     { transform-box: fill-box; transform-origin: 50% 10%; animation: hs-load-sway 2.4s cubic-bezier(.65,0,.35,1) infinite; }
@keyframes hs-load-trace { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes hs-load-sway  { 0%, 100% { transform: rotate(-7deg); } 50% { transform: rotate(7deg); } }
@keyframes hs-load-pulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }

@media (max-width: 520px) {
  .hs-logo-link { --logo-h: 19px; }
}
@media (prefers-reduced-motion: reduce) {
  .hs-mark *, .hs-wordmark, .hs-wordmark *, .hs-loader-mark * { animation: none !important; }
  .hs-load-trace { display: none; }
  .hs-load-base  { opacity: 1; animation: hs-load-pulse 2.4s ease-in-out infinite !important; }
}

/* ==========================================================================
   Motion
   Everything that starts hidden lives inside "no-preference", so visitors
   who turn on reduced motion (and browsers without JavaScript) always see
   the finished page.
   ========================================================================== */

/* Word-by-word headline reveal (words are wrapped by script.js) */
.split-word { display: inline-block; vertical-align: top; overflow: clip; padding: 0 .1em .16em; margin: 0 -.1em -.16em; }
.split-inner { display: inline-block; transform-origin: 0 100%; }

/* Nav links: underline draws from the left */
.desktop-nav a { position: relative; }
.desktop-nav a::after { position: absolute; left: 0; right: 0; bottom: -6px; height: 1px; background: currentColor; content: ""; transform: scaleX(0); transform-origin: right; transition: transform .45s var(--ease-expo); }
.desktop-nav a:hover::after, .desktop-nav a:focus-visible::after { transform: scaleX(1); transform-origin: left; }

/* Hamburger turns into a close icon */
.menu-toggle[aria-expanded="true"] span:first-child { transform: translateY(3.5px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:last-child { transform: translateY(-3.5px) rotate(-45deg); }

/* Selected work: a paper sweep behind the row, arrow turns to point right */
.topic-list a { position: relative; isolation: isolate; }
.topic-list a::before { position: absolute; z-index: -1; inset: 0; background: var(--paper-deep); content: ""; transform: scaleX(0); transform-origin: right; transition: transform .6s var(--ease-expo); }
.topic-list a:hover::before, .topic-list a:focus-visible::before { transform: scaleX(1); transform-origin: left; }
.topic-list i { transition: transform .45s var(--ease-expo); }
.topic-list a:hover i, .topic-list a:focus-visible i { transform: rotate(45deg); }

/* Featured image gets a little extra size so the parallax never shows an edge */
.featured-image img { scale: 1.1; }

@media (prefers-reduced-motion: no-preference) {

  /* ---- Hero entrance: runs when the page loader leaves (html.is-ready) ---- */
  .js .hero .eyebrow { opacity: 0; transform: translateY(14px); transition: opacity .8s var(--ease-expo), transform .8s var(--ease-expo); }
  .js .hero .eyebrow-line { transform: scaleX(0); transform-origin: left; transition: transform 1.1s var(--ease-expo) .15s; }
  .js .hero [data-split] .split-inner { transform: translateY(108%) rotate(5deg); transition: transform 1.2s var(--ease-expo) calc(.18s + var(--w) * 60ms); }
  .js .hero-intro, .js .hero-actions > * { opacity: 0; transform: translateY(22px); transition: opacity 1s var(--ease-expo), transform 1s var(--ease-expo); }
  .js .hero-intro { transition-delay: .7s; }
  .js .hero-actions > :nth-child(1) { transition-delay: .85s; }
  .js .hero-actions > :nth-child(2) { transition-delay: .95s; }
  .js .portrait-frame img { clip-path: inset(100% 0 0 0); scale: 1.18; transition: clip-path 1.4s var(--ease-expo) .3s, scale 1.8s var(--ease-expo) .3s; }
  .js .portrait-frame::before { clip-path: inset(0 100% 0 0); transition: clip-path 1.3s var(--ease-expo) .8s; }
  .js .portrait-caption { opacity: 0; transform: translateY(14px) rotate(-14deg) scale(.9); transition: opacity .6s ease 1.25s, transform 1s var(--ease-back) 1.25s; }
  .js .hero-note { opacity: 0; transform: translateY(14px); transition: opacity .9s var(--ease-expo) 1.4s, transform .9s var(--ease-expo) 1.4s; }

  .is-ready .hero .eyebrow, .is-ready .hero-intro, .is-ready .hero-note { opacity: 1; transform: none; }
  .is-ready .hero-actions > * { opacity: 1; transform: translate(var(--mx, 0px), var(--my, 0px)); }
  .is-ready .hero-actions > .button:hover { transform: translate(var(--mx, 0px), calc(var(--my, 0px) - 2px)); }
  .is-ready .hero .eyebrow-line { transform: none; }
  .is-ready .hero [data-split] .split-inner { transform: none; }
  .is-ready .portrait-frame img { clip-path: inset(0 0 0 0); scale: 1; }
  .is-ready .portrait-frame::before { clip-path: inset(0 0 0 0); }
  .is-ready .portrait-caption { opacity: 1; transform: rotate(-4deg); }
  /* After the entrance, restore the normal quick hover transitions on the buttons */
  .is-ready.is-settled .hero-actions > * { transition: background .25s, color .25s, transform .25s; transition-delay: 0s; }

  /* ---- Section headings (about, contact) reveal when scrolled to ---- */
  .js .is-split:not(.hero *) .split-inner { transform: translateY(108%) rotate(5deg); transition: transform 1.2s var(--ease-expo) calc(.1s + var(--w) * 55ms); }
  .js .is-split.is-in .split-inner { transform: none; }

  /* ---- Section labels: the rule draws across, the number fades up ---- */
  .js .section-kicker .section-rule { transform: scaleX(0); transform-origin: left; transition: transform 1.4s var(--ease-expo) .2s; }
  .js .section-kicker > span:first-child { opacity: 0; transform: translateY(10px); transition: opacity .8s var(--ease-expo), transform .8s var(--ease-expo); }
  .js .section-kicker.is-in .section-rule { transform: none; }
  .js .section-kicker.is-in > span:first-child { opacity: 1; transform: none; }

  /* ---- Journal cards: rise in a stagger, photo wipes down (also on filter/search) ---- */
  .js .article-grid:not(.is-in) .article-card { opacity: 0; }
  .article-grid.is-in .article-card { animation: card-rise 1s var(--ease-expo) calc(var(--i, 0) * 75ms) both; }
  .article-grid.is-in .card-image { animation: image-wipe 1.2s var(--ease-expo) calc(var(--i, 0) * 75ms + 80ms) both; }

  /* ---- Selected work rows follow each other in ---- */
  .js .topics:not(.is-visible) .topic-list a { opacity: 0; }
  .topics.is-visible .topic-list a { animation: row-in .9s var(--ease-expo) both; }
  .topics.is-visible .topic-list a:nth-child(2) { animation-delay: .09s; }
  .topics.is-visible .topic-list a:nth-child(3) { animation-delay: .18s; }
  .js .topic-list { border-top-color: transparent; background: linear-gradient(var(--ink), var(--ink)) top left / 0 1px no-repeat border-box; transition: background-size 1.4s var(--ease-expo) .1s; }
  .topics.is-visible .topic-list { background-size: 100% 1px; }

  /* ---- Featured article: photo wipe when revealed ---- */
  .js .featured:not(.is-visible) .featured-image { clip-path: inset(0 0 100% 0); }
  .js .featured .featured-image { transition: clip-path 1.4s var(--ease-expo) .15s; }
  .js .featured.is-visible .featured-image { clip-path: inset(0 0 0 0); }

  /* ---- Mobile menu links drop in one after another ---- */
  @media (max-width: 800px) {
    .mobile-menu a { opacity: 0; transform: translateY(-8px); transition: color .25s, opacity .35s ease, transform .5s var(--ease-expo); }
    .mobile-menu.is-open a { opacity: 1; transform: none; }
    .mobile-menu.is-open a:nth-child(2) { transition-delay: 0s, .05s, .05s; }
    .mobile-menu.is-open a:nth-child(3) { transition-delay: 0s, .1s, .1s; }
    .mobile-menu.is-open a:nth-child(4) { transition-delay: 0s, .15s, .15s; }
  }

  /* ---- Pop-ups: backdrop fades in with the box ---- */
  .modal-bg:not([hidden]) { animation: backdrop-in .35s ease; }
}

@keyframes card-rise { from { opacity: 0; transform: translateY(48px); } }
@keyframes image-wipe { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes row-in { from { opacity: 0; transform: translateY(18px); } }
@keyframes backdrop-in { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .site-header.is-hidden { transform: none; }
}

/* ==========================================================================
   Large screens: use more of the width on big monitors
   ========================================================================== */
@media (min-width: 1800px) {
  .container { width: min(1360px, calc(100% - 160px)); }
  .nav-wrap { width: min(1480px, calc(100% - 160px)); }
  .hero { min-height: 760px; }
}

/* Landscape phones: the desktop hero is too tall for a 390px-high screen */
@media (max-height: 520px) and (orientation: landscape) {
  .hero { min-height: auto; padding-top: 48px; padding-bottom: 72px; }
  h1 { font-size: clamp(3.4rem, 7vw, 5rem); }
  .nav-wrap { height: 68px; }
}

/* Tablets in portrait at the desktop layout (801–1100px): give the text more room */
@media (min-width: 801px) and (max-width: 1100px) {
  .hero { gap: 7%; }
  .container, .nav-wrap { width: calc(100% - 64px); }
  .article-grid { gap: 22px; }
  .featured-copy { padding: 44px 7%; }
}

/* ==========================================================================
   Post pages (/posts/<id>/) - generated by build.js
   ========================================================================== */
.post { width: min(760px, calc(100% - 96px)); margin-inline: auto; padding: 56px 0 96px; }
.post-back { display: inline-flex; gap: 8px; align-items: center; margin-bottom: 44px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .02em; transition: color .25s; }
.post-back:hover { color: var(--accent); }
.post-header .article-meta { margin-bottom: 18px; }
.post-title { max-width: none; margin: 0 0 24px; font-size: clamp(2.8rem, 6.4vw, 5.2rem); line-height: 1; }
.post-excerpt { margin-bottom: 40px; color: var(--muted); font-family: var(--serif); font-size: clamp(1.3rem, 2.4vw, 1.6rem); line-height: 1.35; }
.post-hero { margin: 0 0 48px; aspect-ratio: 16 / 9; overflow: hidden; background: var(--paper-deep); }
.post-hero img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.8); }
.post-body { color: #3d4744; font-size: 17px; line-height: 1.8; }
.post-body p { margin-bottom: 22px; }
.post-body b, .post-body strong { color: var(--ink); }
.post-body h2 { margin: 40px 0 12px; color: var(--ink); font-family: var(--sans); font-size: 13px; font-weight: 700; letter-spacing: .08em; line-height: 1.4; text-transform: uppercase; }
.post-body ul { margin: 0 0 24px; padding-left: 21px; }
.post-body li { padding-left: 5px; margin-bottom: 6px; }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 72px; padding-top: 32px; border-top: 1px solid var(--line); }
.post-nav a { display: flex; flex-direction: column; gap: 8px; transition: color .25s; }
.post-nav a:hover { color: var(--accent); }
.post-nav small { color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.post-nav strong { font-family: var(--serif); font-size: 24px; font-weight: 600; line-height: 1.1; }
.post-nav .post-nav-next { grid-column: 2; text-align: right; }
@media (max-width: 800px) {
  .post { width: calc(100% - 40px); padding-top: 40px; }
}
@media (max-width: 520px) {
  .post { width: calc(100% - 36px); }
  .post-body { font-size: 16px; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav .post-nav-next { grid-column: auto; text-align: left; }
}
