/* kellumjones.com
   Eggshell ground, black ink, oxblood accent. Cardo for display, Jost for text.
   Most layout is written inline in the templates (build.py); this file holds
   fonts, page basics, the helpers that need container queries, the menu and
   the styles for post bodies written in Markdown. */

@font-face { font-family: Cardo; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/cardo-regular.woff2) format('woff2'); }
@font-face { font-family: Cardo; font-style: italic; font-weight: 400; font-display: swap; src: url(/fonts/cardo-italic.woff2) format('woff2'); }
@font-face { font-family: Jost; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/fonts/jost-latin-wght.woff2) format('woff2'); }
/* Cyrillic, for the Russian pages: Jost has it; Cardo does not, so EB Garamond supplies those letters under Cardo's name.
   Browsers fetch these files only on pages that contain Cyrillic letters. */
@font-face { font-family: Jost; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/fonts/jost-cyrillic-wght.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Cardo; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/eb-garamond-cyrillic-regular.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; size-adjust: 106%; }
@font-face { font-family: Cardo; font-style: italic; font-weight: 400; font-display: swap; src: url(/fonts/eb-garamond-cyrillic-italic.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; size-adjust: 106%; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: #f0ead6;
  color: #000807;
  font-family: Jost, Futura, 'Century Gothic', system-ui, sans-serif;
  font-size: 18px;
  line-height: 30px;
}
img { max-width: 100%; }

a { color: #7a2531; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: #000807; text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid #7a2531; outline-offset: 2px; }
.on-dark a:focus-visible, .on-dark button:focus-visible, .on-dark input:focus-visible { outline-color: #f0ead6; }
.btn:hover { opacity: 0.86; }

.skip { position: absolute; left: 16px; top: -64px; z-index: 200; padding: 10px 16px; background: #000807; color: #f0ead6; }
.skip:focus { top: 16px; color: #f0ead6; }

/* The page is a size container so sections respond to its width. */
.page { position: relative; container-type: inline-size; min-height: 100vh; display: flex; flex-direction: column; }

/* Home header: the photo sits behind the name, the bow stands beside it. */
.d-hero { min-height: 760px; }
.d-hero-img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 50% 20%; }
.d-bow { position: absolute; top: 32px; left: 32%; height: calc(100% - 64px); transform: rotate(7deg); pointer-events: none; }
.d-bow * { vector-effect: non-scaling-stroke; }

/* Inner page header band. */
.p-band { min-height: 440px; }

/* Blending photos into the page.
   .p-fade sits over the part of a rising photo that overlaps the dark band and melts its top and sides into the band.
   .d-hero-fade does the same for the bottom of the home photo on a phone.
   .feather lets the bottom of a light-backdrop photo dissolve into the eggshell ground; its top and sides stay crisp. */
.p-fade { position: absolute; top: 0; left: 0; right: 0; height: 200px; pointer-events: none;
  background:
    linear-gradient(to bottom, #081918 0%, rgba(8, 25, 24, 0) 60%),
    linear-gradient(to right, #081918 0%, rgba(8, 25, 24, 0) 16%),
    linear-gradient(to left, #081918 0%, rgba(8, 25, 24, 0) 16%);
  -webkit-mask-image: linear-gradient(to bottom, #000 72%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 72%, transparent 100%); }
.d-hero-fade { display: none; }
.feather {
  -webkit-mask-image: linear-gradient(to top, transparent 0, rgba(0, 0, 0, 0.15) 8%, rgba(0, 0, 0, 0.6) 18%, #000 30%);
          mask-image: linear-gradient(to top, transparent 0, rgba(0, 0, 0, 0.15) 8%, rgba(0, 0, 0, 0.6) 18%, #000 30%); }

/* Offsets that make the layout slightly asymmetric on wide screens. */
.h-drop { margin-top: 104px; }
.h-drop-lg { margin-top: 200px; }
.h-pull { margin-top: -104px; }
.p-rise { margin-top: -280px; }
.h-news { margin-right: 18cqw; }
.p-bleed-r { margin-left: 18cqw; }
.p-indent { margin-left: 20%; }

@container (max-width: 919px) {
  .p-band { min-height: 0; }
  .h-drop, .h-drop-lg, .h-pull, .p-rise { margin-top: 0; }
  .h-news { margin-right: 0; }
  .p-bleed-r, .p-indent { margin-left: 0; }
  .p-fade, .wide-only { display: none !important; }
  .c-photo { order: 3; }
}
@container (max-width: 760px) {
  .d-hero { min-height: 0; }
  .d-hero-img { position: relative; height: 440px; object-position: 78% 0; }
  .d-bow { top: 456px; left: auto; right: 36px; height: calc(100% - 472px); }
  .d-hero-fade { display: block; position: absolute; left: 0; right: 0; top: 300px; height: 141px; pointer-events: none; background: linear-gradient(to bottom, rgba(8, 25, 24, 0) 0%, #081918 100%); }
}

/* The home bow fades in once on load. */
@media (prefers-reduced-motion: no-preference) {
  .d-bow { opacity: 0; animation: bow-in 0.9s ease-out 0.2s forwards; }
}
@keyframes bow-in { to { opacity: 1; } }

/* Menu: a full-screen sheet. Works from the link alone (:target); site.js adds focus handling. */
.menu { display: none; position: fixed; inset: 0; z-index: 100; background: #f0ead6; overflow: auto; }
.menu:target, .menu.is-open { display: flex; }
.menu-photo { position: relative; flex: 0 0 44%; background: #081918; overflow: hidden; }
.menu-photo img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 80% 20%; }
.menu-nav { flex: 1 1 0; min-width: 0; min-height: 100%; box-sizing: border-box; padding: 22px 32px 32px 72px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; }
.menu-top { display: flex; justify-content: space-between; align-items: center; }
.menu-top a { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; color: #000807; text-decoration: none; }
.menu-name { font-family: Cardo, Georgia, serif; font-size: 26px; line-height: 32px; }
.menu-close { padding: 0 4px; font-size: 15px; line-height: 20px; font-weight: 500; }
.menu-links { display: flex; flex-direction: column; align-items: flex-start; }
.menu-links a { display: inline-flex; align-items: center; min-height: 62px; box-sizing: border-box; color: #000807; text-decoration: none; font-family: Cardo, Georgia, serif; font-size: clamp(32px, 4.2vw, 44px); line-height: 1.18; border-bottom: 2px solid transparent; }
.menu-links a:hover { border-bottom-color: #b7b09a; }
.menu-links a[aria-current="page"] { border-bottom-color: #7a2531; }
.menu-foot { display: flex; flex-wrap: wrap; gap: 0 32px; }
.menu-foot a { display: inline-flex; align-items: center; min-height: 44px; font-size: 15px; line-height: 20px; font-weight: 500; }
@media (max-width: 860px) {
  .menu-photo { display: none; }
  .menu-nav { padding: 22px 16px 24px; }
}
@media (max-height: 640px) {
  .menu-links a { min-height: 48px; font-size: 30px; }
}

/* Languages: the button in the header, the list that opens under it, and the lists in the footer and the menu. */
.lang-btn:hover { color: #f0ead6; text-decoration: underline; text-underline-offset: 3px; }
.lang-panel { display: none; position: absolute; z-index: 50; top: 72px; right: max(clamp(16px, 2.5cqw, 32px), calc(50cqw - 608px));
  box-sizing: border-box; width: min(348px, calc(100cqw - 32px)); padding: 12px 24px 16px;
  background: #f0ead6; color: #000807; border: 1px solid #b7b09a; border-radius: 3px; box-shadow: 0 16px 40px rgba(0, 8, 7, 0.32); }
.lang-panel:target, .lang-panel.is-open { display: block; }
.lang-panel-top { display: flex; justify-content: space-between; align-items: center; min-height: 44px; font-size: 15px; line-height: 20px; font-weight: 500; color: #5c584b; }
.lang-panel-top a { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin-right: -15px; color: #000807; }
.lang-panel-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 24px; border-top: 1px solid #b7b09a; padding-top: 8px; }
.lang-panel-list a { position: relative; display: flex; align-items: center; min-height: 44px; color: #000807; text-decoration: none; font-size: 17px; line-height: 22px; font-weight: 500; }
.lang-panel-list a:hover { text-decoration: underline; }
.lang-panel-list a[aria-current] { color: #7a2531; }
.lang-panel-list a[aria-current]::before { content: ''; position: absolute; left: -14px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: #7a2531; }
.lang-more { grid-column: 1 / -1; margin-top: 8px; border-top: 1px solid #b7b09a; }
.lang-more summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding-top: 4px; color: #7a2531; font-size: 15px; line-height: 20px; font-weight: 500; cursor: pointer; list-style: none; }
.lang-more summary::-webkit-details-marker { display: none; }
.lang-more summary::after { content: ''; flex: none; width: 7px; height: 7px; margin-right: 3px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.lang-more[open] summary::after { transform: translateY(2px) rotate(225deg); }
.lang-more summary:hover { text-decoration: underline; }
.lang-more-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 24px; padding-bottom: 4px; }
.lang-panel-list .lang-more-list a { min-height: 40px; font-size: 15px; line-height: 20px; font-weight: 400; }

/* A one-time offer of the visitor's own language, added by site.js. It never redirects. */
.lang-offer { position: fixed; z-index: 60; left: 16px; bottom: 16px; max-width: calc(100% - 32px); box-sizing: border-box; display: flex; align-items: center;
  padding-left: 20px; background: #6d1f2b; color: #f0ead6; border-radius: 3px; box-shadow: 0 12px 32px rgba(0, 8, 7, 0.36); font-size: 16px; line-height: 22px; font-weight: 500; }
.lang-offer a { display: inline-flex; align-items: center; min-height: 52px; color: #f0ead6; text-underline-offset: 4px; }
.lang-offer a:hover { color: #f0ead6; }
.lang-offer button { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 52px; margin-left: 4px; padding: 0; border: 0; background: none; color: #e6dfc8; cursor: pointer; }
.lang-offer button:hover { color: #f0ead6; }
.lang-offer :focus-visible { outline-color: #f0ead6; }
@media (prefers-reduced-motion: no-preference) {
  .lang-offer { animation: offer-in 0.4s ease-out 0.6s backwards; }
}
@keyframes offer-in { from { opacity: 0; transform: translateY(8px); } }
.langs a { display: inline-flex; align-items: center; min-height: 44px; color: #e6dfc8; font-size: 15px; line-height: 20px; font-weight: 500; }
.langs a[aria-current] { color: #b7b09a; text-decoration: none; }
.menu-langs { display: flex; flex-wrap: wrap; gap: 0 20px; padding-top: 12px; border-top: 1px solid #b7b09a; }
.menu-langs a { display: inline-flex; align-items: center; min-height: 44px; font-size: 15px; line-height: 20px; font-weight: 500; }
.menu-langs a[aria-current] { color: #5c584b; text-decoration: none; }
@container (max-width: 560px) { .lang-name { display: none; } }

/* Chinese, Japanese and Korean: taller lines for large type, and no slanted text.
   Headings still in Latin letters (a name, the duo) are marked data-latin by i18n.py and keep the spacing drawn for Cardo. */
:is(:lang(ja), :lang(ko), :lang(zh)) :is(h1, h2, h3):not([translate="no"], [data-latin]) { line-height: 1.25 !important; letter-spacing: 0 !important; text-wrap: balance; }
:lang(ja) :is(h1, h2, h3) { word-break: auto-phrase; }
:is(:lang(ja), :lang(ko), :lang(zh)) .menu-links a { line-height: 1.3; }
:lang(ja) :is(.menu-links a, .prose h2, .prose h3, .prose blockquote) { font-family: Cardo, 'Hiragino Mincho ProN', 'Yu Mincho', 'Noto Serif CJK JP', 'Noto Serif JP', serif; font-style: normal; }
:lang(ko) :is(.menu-links a, .prose h2, .prose h3, .prose blockquote) { font-family: Cardo, AppleMyungjo, 'Nanum Myeongjo', Batang, 'Noto Serif CJK KR', 'Noto Serif KR', serif; font-style: normal; }
:lang(zh-Hant) :is(.menu-links a, .prose h2, .prose h3, .prose blockquote) { font-family: Cardo, 'Songti TC', PMingLiU, 'Noto Serif CJK TC', 'Noto Serif TC', serif; font-style: normal; }
:lang(zh-Hans) :is(.menu-links a, .prose h2, .prose h3, .prose blockquote) { font-family: Cardo, 'Songti SC', SimSun, 'Noto Serif CJK SC', 'Noto Serif SC', serif; font-style: normal; }
:lang(ko) { word-break: keep-all; }
:lang(ja) { line-break: strict; }

/* Post bodies come from Markdown, so they are styled here rather than inline. */
.prose { display: flex; flex-direction: column; gap: 28px; }
.prose > * { margin: 0; }
.prose p, .prose ul, .prose ol { max-width: 640px; font-size: 19px; line-height: 32px; }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li + li { margin-top: 8px; }
.prose h2 { margin-top: 20px; max-width: 720px; font-family: Cardo, Georgia, serif; font-size: 32px; line-height: 38px; font-weight: 400; }
.prose h3 { margin-top: 8px; max-width: 720px; font-family: Cardo, Georgia, serif; font-size: 26px; line-height: 32px; font-weight: 400; }
.prose blockquote { margin: 12px 0 12px clamp(0px, 8cqw, 104px); max-width: 620px; font-family: Cardo, Georgia, serif; font-style: italic; font-size: clamp(28px, 3cqw, 38px); line-height: 1.25; }
.prose blockquote p { margin: 0; max-width: none; font-size: inherit; line-height: inherit; }
.prose img, .prose figure, .prose .video { display: block; max-width: min(820px, 100%); margin-top: 12px; margin-bottom: 12px; }
.prose figcaption { margin-top: 12px; font-size: 15px; line-height: 22px; color: #5c584b; }
.prose hr { width: 100%; max-width: 640px; border: 0; border-top: 1px solid #b7b09a; }
.prose code { font-size: 0.9em; }

@media print {
  .menu, .skip, .lang-panel, .lang-offer { display: none !important; }
}

/* Blog archive on the Writing page: years and months that open and close */
details.archive > summary { display: flex; align-items: center; gap: 6px; min-height: 36px; font-size: 15px; line-height: 22px; font-weight: 500; cursor: pointer; list-style: none; }
details.archive > summary::-webkit-details-marker { display: none; }
details.archive > summary::before { content: ''; flex: none; width: 6px; height: 6px; margin-right: 6px; border-right: 1.5px solid #7a2531; border-bottom: 1.5px solid #7a2531; transform: rotate(-45deg); transition: transform 0.15s; }
details.archive[open] > summary::before { transform: rotate(45deg); }
details.archive a:hover { color: #7a2531; }

/* The contact form's trap for spam robots: hidden from people */
.hp { display: none !important; }
