/* Bitter Moon — component styles. Every value is a token; tokens.css comes first. */
body { margin: 0; background: var(--bm-bg-canvas); color: var(--bm-text-primary); font-family: var(--font-sans); -webkit-font-smoothing: antialiased; }
.serif-display, .serif-statement, .serif-accent, .serif-body, .serif-label { font-feature-settings: "dlig" 1, "liga" 0; }
.serif-label, .sans-caption { text-transform: uppercase; }
.bm-primary { color: var(--bm-text-primary); }
.bm-secondary { color: var(--bm-text-secondary); }
.bm-tertiary { color: var(--bm-text-tertiary); }
a { color: var(--bm-text-link); }
:where(a, button, input, textarea, .bm-archive-row, .bm-work-row):focus-visible { outline: var(--bm-focus-width) solid var(--bm-text-primary); outline-offset: var(--bm-focus-offset); }

/* Logo */
.bm-logo { display: block; height: auto; max-width: 100%; }

/* Site / Header */
.bm-header { display: flex; align-items: center; justify-content: space-between; height: 44px; }
.bm-header-logo { display: block; width: 132px; }
.bm-header-logo .bm-logo { width: 132px; height: 44px; }
.bm-nav { display: flex; align-items: center; gap: 28px; }
.bm-nav-item { color: var(--bm-text-secondary); text-decoration: none; white-space: pre; }
.bm-nav-item.is-active, .bm-nav-item:hover { color: var(--bm-text-primary); }
.bm-header-center .bm-header-side { flex: 1 1 0; display: flex; align-items: center; }
.bm-header-center .bm-header-end { justify-content: flex-end; }
.bm-nav-index { font-family: var(--font-sans); font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--bm-text-primary); text-decoration: none; white-space: pre; }
.bm-menu { position: relative; width: 24px; height: 24px; padding: 0; border: 0; background: none; cursor: pointer; }
.bm-menu span { position: absolute; left: 0; width: 24px; height: 2px; background: var(--bm-text-primary); }
.bm-menu span:first-child { top: 8px; }
.bm-menu span:last-child { top: 15px; }

/* Status — one signal dot + caption */
.bm-status { display: inline-flex; align-items: center; gap: 10px; color: var(--bm-text-primary); }
.bm-signal { flex: none; width: 7px; height: 7px; border-radius: var(--bm-radius-pill); }
.bm-signal-now { background: var(--bm-signal-now); }
.bm-signal-enter { background: var(--bm-signal-enter); }
.bm-signal-process { background: var(--bm-signal-process); }
.bm-signal-lab { background: var(--bm-signal-lab); }

/* Site / Footer */
.bm-footer { display: flex; flex-direction: column; align-items: center; gap: var(--bm-space-24); border-top: var(--bm-stroke-rule) solid var(--bm-border-default); padding-top: var(--bm-space-24); }
.bm-footer-links { align-self: stretch; display: flex; justify-content: space-between; align-items: center; }
.bm-footer-links a { color: var(--bm-text-primary); text-decoration: none; }
.bm-footer-links a:hover { text-decoration: underline; }
.bm-colophon { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--bm-text-tertiary); }
.bm-colophon-slogan { font-family: var(--font-serif); font-style: italic; font-size: 12px; line-height: 1.65; white-space: pre; font-feature-settings: "dlig" 1, "liga" 0; }

/* Site / Media */
.bm-media { position: relative; margin: 0; overflow: hidden; background: var(--bm-bg-sunken); border-radius: var(--bm-radius-none); }
.bm-media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: opacity var(--bm-duration-image) var(--bm-ease-out); }
.bm-media-play { position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; }
.bm-play-ring { fill: none; stroke: var(--bm-bg-surface); stroke-opacity: 0.9; stroke-width: 1; }
.bm-play-tri { fill: var(--bm-bg-surface); }
.bm-media-duration { position: absolute; left: 14px; bottom: 14px; font-family: "Geist Mono", ui-monospace, Menlo, monospace; font-size: 10px; line-height: 13px; color: var(--bm-bg-surface); }

/* Site / Caption */
.bm-caption { display: flex; align-items: center; gap: var(--bm-space-16); margin-top: var(--bm-space-16); }

/* Site / Work row */
.bm-work-row { display: flex; align-items: baseline; padding: var(--bm-space-24) 0; border-bottom: var(--bm-stroke-rule) solid var(--bm-border-default); color: inherit; text-decoration: none; }
.bm-work-year { white-space: pre; }
.bm-fill { flex: 1 1 auto; }

/* Archive row — default / hover */
.bm-archive-row { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)) 120px 40px; column-gap: var(--bm-grid-gutter); align-items: center; min-height: 56px; border-top: var(--bm-stroke-rule) solid var(--bm-border-default); color: var(--bm-text-secondary); text-decoration: none; transition: color var(--bm-duration-fast) var(--bm-ease-out), border-color var(--bm-duration-fast) var(--bm-ease-out); }
.bm-a-title { grid-column: 1 / span 5; color: var(--bm-text-primary); line-height: 1.7; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bm-a-type { grid-column: 6 / span 3; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bm-a-disc { grid-column: 9 / span 2; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bm-a-client { grid-column: 11; white-space: nowrap; }
.bm-a-year { grid-column: 12; text-align: right; white-space: nowrap; }
.bm-archive-row:hover, .bm-archive-row.is-hover { border-top-color: var(--bm-text-primary); color: var(--bm-text-primary); }

/* Journal row — default / hover */
.bm-journal-row { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--bm-grid-gutter); align-items: center; padding: var(--bm-space-24) 0; border-top: var(--bm-stroke-rule) solid var(--bm-border-default); color: inherit; text-decoration: none; transition: border-color var(--bm-duration-fast) var(--bm-ease-out); }
.bm-j-thumb { grid-column: 1; }
.bm-j-meta { grid-column: 2 / span 2; white-space: nowrap; color: var(--bm-text-tertiary); transition: color var(--bm-duration-fast) var(--bm-ease-out); }
.bm-j-title { grid-column: 4 / span 6; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; color: var(--bm-text-primary); }
.bm-j-cat { grid-column: 11 / span 2; text-align: right; white-space: nowrap; color: var(--bm-text-secondary); transition: color var(--bm-duration-fast) var(--bm-ease-out); }
.bm-journal-row:hover, .bm-journal-row.is-hover { border-top-color: var(--bm-text-primary); }
.bm-journal-row:hover .bm-j-meta, .bm-journal-row:hover .bm-j-cat, .bm-journal-row.is-hover .bm-j-meta, .bm-journal-row.is-hover .bm-j-cat { color: var(--bm-text-primary); }

/* Bracket nav — filters and view toggles */
.bm-bracket-nav { display: flex; gap: var(--bm-space-24); }
.bm-bracket { padding: 0; border: 0; background: none; cursor: pointer; color: var(--bm-text-secondary); white-space: pre; }
.bm-bracket:hover, .bm-bracket.is-active { color: var(--bm-text-primary); }

/* Chips */
.bm-chip-group { display: flex; flex-wrap: wrap; gap: var(--bm-space-8); }
.bm-chip { padding: 8px 14px; border: var(--bm-stroke-rule) solid var(--bm-border-default); border-radius: var(--bm-radius-pill); background: transparent; color: var(--bm-text-primary); cursor: pointer; transition: border-color var(--bm-duration-fast) var(--bm-ease-out); }
.bm-chip:hover { border-color: var(--bm-text-primary); }
.bm-chip.is-selected { background: var(--bm-bg-inverse); border-color: var(--bm-text-primary); color: var(--bm-bg-canvas); }

/* Primary action — the only filled button */
.bm-primary-action { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 18px 24px; border: 0; border-radius: var(--bm-radius-none); background: var(--bm-bg-inverse); color: var(--bm-bg-canvas); cursor: pointer; }

/* Field — label above, underline, no box */
.bm-field { display: flex; flex-direction: column; gap: var(--bm-space-8); }
.bm-field-input { width: 100%; box-sizing: border-box; padding: 0 0 var(--bm-space-8); border: 0; border-bottom: var(--bm-stroke-rule) solid var(--bm-border-default); border-radius: var(--bm-radius-none); background: transparent; color: var(--bm-text-primary); font-family: var(--font-sans); outline: none; resize: vertical; min-height: 34px; transition: border-color var(--bm-duration-fast) var(--bm-ease-out); }
.bm-field-input:focus, .bm-field.has-error .bm-field-input { border-bottom-color: var(--bm-text-primary); }
.bm-field-input:focus-visible { outline: none; }

/* Motion part 01 — hover preview reveal */
.bm-reveal { position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; overflow: hidden; background: var(--bm-bg-sunken); border-radius: var(--bm-radius-none); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity var(--bm-duration-reveal) var(--bm-ease-in-out), visibility 0s linear var(--bm-duration-reveal); }
.bm-reveal.is-on { opacity: 1; visibility: visible; transition: opacity var(--bm-duration-reveal) var(--bm-ease-in-out), visibility 0s; }
.bm-reveal img { width: 100%; height: 100%; object-fit: cover; }
.bm-reveal-num { font-family: var(--font-sans); font-size: 32px; line-height: 1; letter-spacing: -0.01em; color: var(--bm-text-tertiary); font-variant-numeric: tabular-nums; }

/* Motion part 02 — page entrance */
.bm-page-enter { opacity: 0; transition: opacity var(--bm-duration-page) var(--bm-ease-in-out); }
.bm-page-enter.is-in { opacity: 1; }

/* Motion part 03 — content reveal (images and text) */
.bm-fade { opacity: 0; transition: opacity var(--bm-duration-content) var(--bm-ease-out); }
.bm-fade.is-in { opacity: 1; }
/* text blocks also rise from below into place; images only fade */
.bm-fade.bm-rise { transform: translateY(var(--bm-rise-distance)); transition: opacity var(--bm-duration-content) var(--bm-ease-out), transform var(--bm-duration-content) var(--bm-ease-out); }
.bm-fade.bm-rise.is-in { transform: none; }

/* Motion — honour reduced motion everywhere */
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; } }
