/* Semaphore theme: the frame, header, band, rail, footer, journal and post
   views of the Site design. Page sections live in Ghost HTML cards and are
   styled by content.css (generated). Values are the design's own. */

:root {
  --ink: #17160F; --rust: #C2451C; --paper: #F6F4ED; --mid: #5C594B; --mute: #807C6C;
  --rule: #D8D4C6; --track: #EDEAE0; --soft: #3A382E; --hover: #EFEDE4;
  --mono: ui-monospace, 'IBM Plex Mono', Menlo, monospace;
  --serif: 'Source Serif 4', Georgia, serif;
  /* responsive values the design computes from window width (< 760px = narrow) */
  --g: 40px; --hero: 44px; --post: 38px; --stick: sticky; --globe: 400px; --band: 34px; --postimg: 340px;
}
@media (max-width: 759px) {
  :root { --g: 22px; --hero: 32px; --post: 28px; --stick: static; --globe: 300px; --band: 26px; --postimg: 220px; }
}

html, body { margin: 0; padding: 0; background: #0E0D0A; }
body { font-family: ui-sans-serif, -apple-system, "Helvetica Neue", sans-serif; color: var(--ink); line-height: 1.6; -webkit-font-smoothing: antialiased; }
* { box-sizing: border-box; }
::selection { background: var(--ink); color: var(--paper); }
a { color: var(--rust); text-decoration: none; }
a:hover { color: var(--ink); text-decoration: none; }
h1, h2, h3 { font-weight: 400; margin: 0; }
input, textarea { font-family: inherit; }
/* :where() keeps these below the generated section classes, as the design's inline styles were */
:where(input[type=range]) { -webkit-appearance: none; appearance: none; width: 100%; height: 18px; background: transparent; cursor: pointer; margin: 0; }
input[type=range]::-webkit-slider-runnable-track { height: 3px; background: var(--rule); }
input[type=range]::-moz-range-track { height: 3px; background: var(--rule); }
input[type=range]::-moz-range-progress { height: 3px; background: var(--ink); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 3px; height: 18px; margin-top: -7.5px; background: var(--ink); border: 0; }
input[type=range]::-moz-range-thumb { width: 3px; height: 18px; background: var(--ink); border: 0; border-radius: 0; }
input[type=range]:hover::-webkit-slider-thumb { background: var(--rust); }
input[type=range]:hover::-moz-range-thumb { background: var(--rust); }
input[type=range]:focus { outline: none; }
input:focus, textarea:focus { outline: none; border-color: var(--ink); }
@keyframes smRise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes smFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes smSweep { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes smProbe { 0%, 100% { background: rgba(23,22,15,0.12); } 5% { background: rgba(23,22,15,0.88); } 26% { background: rgba(23,22,15,0.28); } }
@keyframes smFill { from { background: #C2451C; } to { background: transparent; } }
@keyframes smGrow { from { transform: scale(0.2); opacity: 0; } to { transform: none; opacity: 1; } }

/* anchors that stand in for the design's <button>s */
a.sm-btn { display: inline-block; line-height: normal; text-align: center; }
[data-sm="routes"] { display: contents; }

/* frame */
.sm-frame { background: #0E0D0A; min-height: 100vh; padding: 14px; }
.sm-card { background: var(--paper); color: var(--ink); border: 1px solid var(--ink); border-radius: 14px; overflow: hidden; width: 100%; }
.sm-prog-track { position: sticky; top: 0; z-index: 50; height: 2px; background: transparent; }
#sm-prog { height: 2px; background: var(--rust); transform: scaleX(0); transform-origin: 0 50%; will-change: transform; }
.sm-page { animation: smFade 0.4s ease both; }
.sm-label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; color: var(--mute); font-weight: 400; margin: 0; }
.sm-link-rust { font-size: 13px; color: var(--rust); line-height: normal; }
.sm-link-rust:hover { color: var(--ink); }

/* header */
.sm-head { position: sticky; top: 0; z-index: 40; background: var(--paper); display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding: 20px var(--g); border-bottom: 0.5px solid var(--rule); }
.sm-logo { display: flex; align-items: center; gap: 10px; color: var(--ink); line-height: normal; }
.sm-logo:hover { color: var(--ink); }
.sm-logo img { height: 18px; width: auto; display: block; }
.sm-logo-name { font-size: 13px; letter-spacing: 0.22em; font-weight: 500; text-transform: uppercase; }
.sm-nav { display: flex; gap: 26px; font-size: 12.5px; flex-wrap: wrap; align-items: center; }
.sm-nav-link { font-size: 12.5px; color: var(--mid); padding: 0 0 1px; border-bottom: 1px solid transparent; line-height: normal; }
.sm-nav-link:hover { color: var(--ink); }
.sm-nav-link.is-current, .post-template .sm-nav-link[href$="/journal/"], .tag-template .sm-nav-link[href$="/journal/"] { color: var(--ink); border-bottom-color: var(--ink); }
.sm-cta-sm { background: var(--ink); color: var(--paper); padding: 8px 15px; border-radius: 3px; font-size: 12.5px; white-space: nowrap; flex: none; }
.sm-cta-sm:hover { background: var(--rust); color: var(--paper); }

/* home: from the journal */
.sm-featured { padding: 60px var(--g) 72px; border-top: 0.5px solid var(--rule); }
.sm-featured-head { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 26px; }
.sm-featured-grid { display: flex; flex-wrap: wrap; gap: 0; border-top: 0.5px solid var(--rule); }
.sm-featured-card { display: block; text-align: left; flex: 1 1 280px; min-width: 0; padding: 22px 26px 26px 0; border-bottom: 0.5px solid var(--rule); border-right: 0.5px solid var(--rule); line-height: normal; }
.sm-featured-card:hover { background: var(--hover); }
.sm-featured-kicker { font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; color: var(--rust); padding-left: 26px; text-transform: uppercase; }
.sm-featured-title { font-family: var(--serif); font-size: 17px; line-height: 1.35; margin-top: 10px; padding-left: 26px; color: var(--ink); }
.sm-featured-meta { font-size: 12.5px; color: var(--mute); margin-top: 10px; padding-left: 26px; }

/* closing band */
.sm-band { border-top: 0.5px solid var(--ink); background: var(--ink); color: var(--paper); padding: 52px var(--g) 56px; }
.sm-band-row { display: flex; flex-wrap: wrap; gap: 40px; align-items: flex-end; justify-content: space-between; }
.sm-band-copy { flex: 1 1 420px; min-width: 0; }
.sm-band-kicker { font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; color: var(--rust); margin-bottom: 20px; }
.sm-band-title { font-family: var(--serif); font-size: var(--band); line-height: 1.18; letter-spacing: -0.015em; margin: 0 0 16px; max-width: 520px; }
.sm-band-body { font-size: 14px; color: #B8B2A2; margin: 0; max-width: 470px; text-wrap: pretty; }
.sm-band-act { flex: 0 1 300px; min-width: 0; }
.sm-band-cta { background: var(--paper); color: var(--ink); padding: 14px 24px; border-radius: 3px; font-size: 13.5px; white-space: nowrap; width: 100%; }
.sm-band-cta:hover { background: var(--rust); color: var(--paper); }
.sm-band-assure { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.sm-band-assure > div { display: flex; align-items: baseline; gap: 9px; }
.sm-band-assure > div > span:first-child { width: 5px; height: 5px; background: var(--rust); display: block; flex: none; position: relative; top: -2px; }
.sm-band-assure > div > span:last-child { font-size: 12.5px; color: #B8B2A2; line-height: 1.5; }

/* rail */
.sm-rail-wrap { border-top: 0.5px solid var(--rule); padding: 44px 0 52px; }
.sm-rail-head { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: 0 var(--g) 22px; }
.sm-rail-arrows { display: flex; align-items: center; gap: 10px; }
.sm-arrow { appearance: none; cursor: pointer; background: none; border: 0.5px solid var(--rule); border-radius: 3px; width: 30px; height: 26px; color: var(--mid); font-family: ui-monospace, Menlo, monospace; font-size: 12px; line-height: 1; padding: 0; }
.sm-arrow:hover { border-color: var(--ink); color: var(--ink); }
#sm-rail { display: flex; gap: 18px; overflow-x: auto; scroll-behavior: smooth; padding: 0 var(--g) 6px; scrollbar-width: none; }
#sm-rail::-webkit-scrollbar { display: none; }
.sm-rail-card { display: block; text-align: left; flex: 0 0 300px; width: 300px; line-height: normal; }
.sm-rail-card:hover { opacity: 0.86; }
.sm-rail-img { position: relative; width: 300px; height: 188px; border: 0.5px solid var(--rule); border-radius: 4px; overflow: hidden; background: var(--track); }
.sm-rail-kicker { font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; color: var(--rust); margin-top: 14px; text-transform: uppercase; }
.sm-rail-title { font-family: var(--serif); font-size: 16px; line-height: 1.35; margin-top: 8px; color: var(--ink); }
.sm-rail-meta { font-size: 12px; color: var(--mute); margin-top: 8px; }
/* display-only muted tone so photos sit in the paper palette; the image files stay unmodified */
.sm-cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; filter: saturate(0.72) sepia(0.12); }
.sm-noimg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(127,127,127,0.08); }

/* footer */
.sm-foot { padding: 34px var(--g); border-top: 0.5px solid var(--rule); display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.sm-foot-logo { display: flex; align-items: center; gap: 9px; color: var(--mute); }
.sm-foot-logo span { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; }
.sm-foot-logo:hover { color: var(--ink); }
.sm-foot-links { font-size: 11.5px; color: var(--mute); display: flex; gap: 20px; flex-wrap: wrap; }
.sm-foot-links a { color: var(--mute); }
.sm-foot-links a:hover { color: var(--ink); }

/* journal */
.sm-journal-hero { display: flex; flex-wrap: wrap; gap: 44px 56px; align-items: flex-end; padding: 76px var(--g) 44px; }
.sm-search { flex: 1 1 340px; min-width: 0; }
.sm-search-label { display: block; font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.14em; color: var(--mid); padding-bottom: 6px; line-height: 1.6; }
.sm-search-input { width: 100%; font-family: var(--serif); font-size: 22px; letter-spacing: -0.015em; color: var(--ink); background: none; border: 0; border-bottom: 1px solid var(--ink); padding: 10px 0; border-radius: 0; cursor: text; }
.sm-search-input::placeholder { color: #757575; }
.sm-search-note { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.1em; color: #6E6A5B; padding: 12px 0 0; }
.sm-search-hits { min-height: 96px; }
.sm-chips { padding: 0 var(--g) 20px; display: flex; flex-wrap: wrap; gap: 8px; border-bottom: 0.5px solid var(--rule); }
.sm-chip { cursor: pointer; padding: 6px 13px; border-radius: 3px; white-space: nowrap; font-family: var(--mono); font-size: 11px; border: 0.5px solid var(--rule); background: transparent; color: var(--mid); line-height: normal; }
.sm-chip:hover { color: var(--ink); border-color: var(--ink); }
.sm-chip.is-on, .sm-chip.is-on:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.sm-postrow { border-bottom: 0.5px solid var(--rule); width: 100%; text-align: left; display: flex; flex-wrap: wrap; align-items: baseline; gap: 14px 28px; padding: 24px var(--g); line-height: normal; }
.sm-postrow:hover { background: var(--hover); }
.sm-postrow-kicker { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em; color: var(--rust); flex: none; width: 118px; text-transform: uppercase; }
.sm-postrow-main { flex: 1 1 320px; min-width: 0; }
.sm-postrow-title { display: block; font-family: var(--serif); font-size: 19px; line-height: 1.32; color: var(--ink); }
.sm-postrow-excerpt { display: block; font-size: 13px; color: var(--mid); margin-top: 8px; text-wrap: pretty; }
.sm-postrow-meta { font-family: var(--mono); font-size: 10.5px; color: var(--mute); flex: none; text-align: right; width: 108px; }
.pagination { display: flex; justify-content: space-between; align-items: center; padding: 20px var(--g); font-family: var(--mono); font-size: 11px; color: var(--mute); }
.pagination:not(:has(a)) { display: none; }
.sm-letter { padding: 44px var(--g) 76px; display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between; }
.sm-letter-copy { flex: 1 1 320px; min-width: 0; }
.sm-letter-title { font-family: var(--serif); font-size: 18px; margin-bottom: 6px; }
.sm-letter-note { font-size: 12.5px; color: var(--mute); }
.sm-letter-form { display: flex; gap: 8px; flex: 1 1 300px; min-width: 0; margin: 0; }
.sm-letter-form input { flex: 1 1 auto; min-width: 0; padding: 11px 13px; border: 0.5px solid var(--rule); border-radius: 3px; background: #FBFAF5; font-size: 13px; color: var(--ink); }
.sm-letter-form button { appearance: none; border: 0; cursor: pointer; background: var(--ink); color: var(--paper); padding: 11px 18px; border-radius: 3px; font-size: 13px; font-family: inherit; flex: none; }
.sm-letter-form button:hover { background: var(--rust); }
.sm-letter-done, .sm-letter-form.success .sm-letter-idle { display: none; }
.sm-letter-form.success .sm-letter-done { display: inline; }
.sm-letter-form.loading button { opacity: 0.6; }
.sm-letter-form.error input { border-color: var(--rust); }

/* post */
.sm-post-back { padding: 44px var(--g) 0; }
.sm-post-back a { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.14em; color: var(--rust); }
.sm-post-back a:hover { color: var(--ink); }
.sm-post-wrap { display: flex; flex-wrap: wrap; gap: 56px; padding: 30px var(--g) 76px; align-items: flex-start; }
.sm-post-main { flex: 1 1 560px; min-width: 0; max-width: 660px; }
.sm-post-kicker { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.14em; color: var(--mute); margin-bottom: 20px; text-transform: uppercase; }
.sm-post-kicker a { color: inherit; }
.sm-post-kicker a:hover { color: var(--rust); }
.sm-post-title { font-family: var(--serif); font-size: var(--post); line-height: 1.16; margin: 0 0 20px; letter-spacing: -0.015em; }
.sm-post-meta { font-size: 13px; color: var(--mute); padding-bottom: 26px; border-bottom: 0.5px solid var(--rule); }
.sm-post-figure { margin: 0; }
.sm-post-img { position: relative; width: 100%; height: var(--postimg); border: 0.5px solid var(--rule); border-radius: 4px; overflow: hidden; background: var(--track); margin-top: 26px; }
.sm-post-caption { font-size: 11.5px; color: var(--mute); margin-top: 10px; }
.sm-post-standfirst { font-family: var(--serif); font-size: 19px; line-height: 1.55; color: var(--soft); margin: 26px 0 0; text-wrap: pretty; }
.sm-post-body h2 { font-family: var(--serif); font-size: 21px; margin: 38px 0 12px; line-height: 1.3; font-weight: 400; }
.sm-post-body h3 { font-family: var(--serif); font-size: 18px; margin: 30px 0 10px; line-height: 1.3; font-weight: 400; }
.sm-post-body p, .sm-post-body li { font-size: 15px; line-height: 1.75; color: var(--soft); text-wrap: pretty; }
.sm-post-body p { margin: 18px 0 0; }
.sm-post-body blockquote { margin: 30px 0; padding: 20px 0 20px 22px; border-left: 2px solid var(--rust); }
.sm-post-body blockquote, .sm-post-body blockquote p { font-family: var(--serif); font-size: 19px; line-height: 1.45; color: var(--ink); }
.sm-post-body blockquote p { margin: 0; }
.sm-post-body a { text-decoration: underline; text-underline-offset: 2px; }
.sm-post-body img { max-width: 100%; height: auto; }
.sm-post-body figure { margin: 30px 0; }
.sm-post-body figcaption { font-size: 11.5px; color: var(--mute); margin-top: 10px; }
.sm-post-body pre { font-family: var(--mono); font-size: 12.5px; background: var(--track); padding: 16px; overflow-x: auto; }
.sm-post-body code { font-family: var(--mono); font-size: 0.9em; }
.sm-post-body pre code { font-size: inherit; }
.sm-post-body table { display: block; overflow-x: auto; width: 100%; border-collapse: collapse; margin: 26px 0; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.sm-post-body th { text-align: left; font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; color: var(--mute); font-weight: 400; text-transform: uppercase; padding: 0 16px 10px 0; border-bottom: 0.5px solid var(--ink); }
.sm-post-body td { padding: 11px 16px 11px 0; border-bottom: 0.5px solid var(--rule); color: var(--soft); vertical-align: top; }
.sm-post-body ul, .sm-post-body ol { padding-left: 1.2em; margin: 18px 0 0; }
.kg-width-wide { position: relative; width: 85vw; min-width: 100%; max-width: 1040px; }
.kg-width-full { position: relative; width: 100%; }
.sm-post-side { flex: 1 1 220px; max-width: 260px; min-width: 0; position: var(--stick); top: 96px; }
.sm-side-label { font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; color: var(--mute); border-top: 0.5px solid var(--rule); padding-top: 12px; }
.sm-side-gap { margin-top: 28px; }
.sm-toc { display: flex; flex-direction: column; gap: 9px; margin-top: 12px; }
.sm-toc a { font-size: 12.5px; color: var(--mid); line-height: 1.45; }
.sm-toc a:hover { color: var(--rust); }
.sm-related { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }
.sm-related a { text-align: left; font-family: var(--serif); font-size: 14.5px; line-height: 1.4; color: var(--ink); }
.sm-related a:hover { color: var(--rust); }

/* error */
.sm-error { padding: 76px var(--g) 76px; max-width: 700px; }
.sm-kicker { font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; color: var(--rust); margin-bottom: 26px; }
.sm-error-title { font-family: var(--serif); font-size: var(--hero); line-height: 1.14; margin: 0 0 24px; letter-spacing: -0.015em; }
.sm-error-body { font-size: 15px; color: var(--mid); margin: 0; }

/* figures (web/ghost-content/graphics): inline SVG in HTML cards */
.sm-fig { padding: 60px var(--g) 64px; border-top: 0.5px solid var(--rule); }
.sm-fig-head { margin-bottom: 30px; }
.sm-fig-label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; color: var(--mute); margin-bottom: 14px; }
.sm-fig-title { font-family: var(--serif); font-size: 20px; color: var(--soft); margin: 0; max-width: 520px; line-height: 1.45; text-wrap: pretty; }
.sm-fig-scroll { overflow-x: auto; }
.sm-fig-svg { display: block; width: 100%; max-width: 1100px; height: auto; }
.sm-fig-note { font-size: 12px; color: var(--mute); margin: 18px 0 0; line-height: 1.6; max-width: 560px; }
.sm-fig-inline { margin: 6px 0 0; max-width: 640px; }
.sm-fig-inline .sm-fig-svg { max-width: 640px; }
.sm-fig-inline figcaption { font-size: 12px; color: var(--mute); margin-top: 12px; line-height: 1.6; }
@media (max-width: 759px) {
  .sm-fig-scroll > .sm-fig-svg { min-width: 720px; }   /* keep diagram labels legible; the figure scrolls sideways */
}

/* ---- large displays (1920 and 2560 wide): extend the design, do not stretch it ---- */
/* the whole design scales up so type and spacing keep their proportions at 100% OS scaling */
@media (min-width: 1800px) { html { zoom: 1.2; } }
@media (min-width: 2300px) { html { zoom: 1.35; } }
@media (min-width: 1500px) {
  /* the card stays a readable width, centred in the dark frame */
  .sm-card { max-width: 1680px; margin: 0 auto; }
  /* comfortable measure for running text; widths the design sets on a paragraph still win */
  :where(.sm-page) p { max-width: 66ch; }
  .sm-postrow-main { max-width: 820px; }
  .sm-postrow-excerpt { max-width: 66ch; }
  .sm-postrow-meta { margin-left: auto; }
  /* a post is one centred block: text column plus its sidebar */
  .sm-post-back, .sm-post-wrap { max-width: 1120px; margin-left: auto; margin-right: auto; }
  .sm-post-main { max-width: 680px; }
  .sm-post-body p, .sm-post-body li { font-size: 16px; max-width: 36em; }
  .sm-post-standfirst { font-size: 20px; }
  .sm-post-img { height: 400px; }
}
