/* Ollanders Sci-Fi — "Bold Poster" design system.
   Memphis/poster aesthetic: warm ivory paper, ink black, a tight saturated trio
   (yellow / sky-blue / coral). Two shadow languages — hard offset "sticker"
   shadows (border + pill) for interactive things, and a soft floating shadow used
   ONLY on the semantic profile cards. Bootstrap is loaded for reset/grid only;
   everything visual here is hand-written. Tokens first, then components.
   Sizes are set ~15% below the source spec (the spec read too large on screen);
   the 3px ink borders are kept full-weight so the sticker look survives. */

:root {
	/* neutrals */
	--paper: #FBF8F1;
	--card: #FFFFFF;
	--ink: #141414;
	--muted: #5d574a;
	--chip-text: #46423a;

	/* saturated trio + variants */
	--yellow: #FCDC2D;
	--yellow-soft: #FFD63A;
	--yellow-spark: #E8A700;
	--blue: #5DA2F6;
	--blue-band: #9AC6F6;
	--blue-pill: #54A6E8;
	--blue-deep: #2F86E8;
	--blue-spark: #3E92DA;
	--coral: #FB5840;
	--coral-pill: #FF5B43;

	/* marker-highlight stripe colors */
	--marker-yellow: #ffd750;
	--marker-red: #fb6649;

	/* legacy token names kept as aliases so every old rule still resolves */
	--canvas: var(--paper);
	--surface: var(--card);
	--ink-2: var(--muted);
	--rule: var(--ink);
	--accent: var(--blue-deep);
	--accent-2: #153c6e;
	--focus: var(--blue-deep);
	--error: #9B2C2C;

	/* fonts */
	--display: "Anton", Impact, system-ui, sans-serif;
	--sans: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
	--hank: "Hanken Grotesk", system-ui, sans-serif;
	--hand: "Caveat", "Comic Sans MS", cursive;
	--serif: var(--sans);

	/* hard offset "sticker" shadows */
	--sh-sm: 2px 2px 0 var(--ink);
	--sh-sticker: 2px 2px 0 var(--ink);
	--sh: 3px 3px 0 var(--ink);
	--sh-lg: 4px 4px 0 var(--ink);
	--sh-cover: 8px 8px 0 var(--ink);
	/* soft floating shadow — semantic cards only */
	--sh-soft: 0 2px 0 rgba(22,20,18,.06), 0 14px 30px -20px rgba(22,20,18,.30);

	--space: 8px;
	--maxw: 1000px;
	--radius: 14px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body.sf-body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--sans);
	font-size: 15px;
	line-height: 1.5;
	overflow-x: hidden;
	font-feature-settings: "tnum" 1;
}

a { color: var(--blue-deep); }
a:hover { color: var(--accent-2); }

img { max-width: 100%; }

::selection { background: var(--yellow); color: var(--ink); }
input::placeholder { color: #8a8472; }

.sf-container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }

.sf-content { min-height: 60vh; padding-bottom: 0; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.sf-visually-hidden {
	position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---- full-bleed bands (page rhythm) ---- */
.sf-band { position: relative; width: 100%; padding: 46px 0; overflow: hidden; }
.sf-band__inner { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 28px; position: relative; z-index: 2; }
.sf-band--paper { background: var(--paper); }
.sf-band--hero { background: var(--paper); padding: 36px 0 42px; }
.sf-band--blue { background: var(--blue-band); border-top: 3px solid var(--ink); border-bottom: 3px solid var(--ink); }
.sf-band--yellow { background: var(--yellow); border-top: 3px solid var(--ink); border-bottom: 3px solid var(--ink); }
.sf-band--coral { background: var(--coral); border-top: 3px solid var(--ink); border-bottom: 3px solid var(--ink); }
.sf-band--ink { background: var(--ink); color: var(--paper); border-top: 3px solid var(--ink); }

/* ---- display / marker ---- */
.sf-display { font-family: var(--display); text-transform: uppercase; }
.sf-marker {
	background: linear-gradient(transparent 56%, var(--marker-yellow) 56%, var(--marker-yellow) 93%, transparent 93%);
	padding: 0 6px; -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.sf-marker--red {
	background: linear-gradient(transparent 56%, var(--marker-red) 56%, var(--marker-red) 93%, transparent 93%);
}

/* ---- header ---- */
.sf-header { background: var(--paper); border-bottom: 3px solid var(--ink); position: sticky; top: 0; z-index: 50; }
.sf-header__inner { display: flex; align-items: center; gap: 16px; min-height: 54px; padding-top: 6px; padding-bottom: 6px; }
.sf-wordmark { font-family: var(--display); text-transform: uppercase; font-size: 22px; letter-spacing: .01em; color: var(--ink); text-decoration: none; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; }
.sf-wordmark__sub {
	font-family: var(--sans); font-weight: 800; font-style: normal; text-transform: uppercase; font-size: 10px; letter-spacing: .04em;
	color: #fff; background: var(--coral); border: 2px solid var(--ink); border-radius: 999px; box-shadow: var(--sh-sm);
	padding: 3px 8px; margin-left: 0; transform: rotate(-4deg);
}
.sf-nav { display: flex; align-items: center; gap: 16px; margin-left: auto; white-space: nowrap; }
.sf-nav__link { color: var(--ink); text-decoration: none; font-weight: 800; text-transform: uppercase; font-size: 12px; letter-spacing: .03em; }
.sf-nav__link:hover { color: var(--blue-deep); }
.sf-nav__count {
	display: inline-flex; align-items: center; justify-content: center; min-width: 21px; height: 21px; padding: 0 5px;
	border-radius: 999px; background: var(--blue); color: #fff; font-size: 11px; font-weight: 800; border: 2px solid var(--ink);
}

/* ---- search + typeahead ---- */
.sf-search { position: relative; flex: 1 1 auto; max-width: 500px; }
.sf-search__input, .sf-hero__input {
	width: 100%; padding: 9px 14px; border: 3px solid var(--ink); border-radius: 999px;
	background: var(--card); color: var(--ink); font-size: 14px; font-family: var(--sans); font-weight: 500;
	box-shadow: var(--sh-sticker);
}
.sf-search__input {
	padding-left: 38px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='17' height='17' viewBox='0 0 24 24' fill='none' stroke='%23141414' stroke-width='2.6' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
	background-repeat: no-repeat; background-position: 13px center;
}
.sf-suggest { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60; }
.sf-suggest:empty { display: none; }
.sf-suggest__list { list-style: none; margin: 0; padding: 7px; background: var(--card); border: 3px solid var(--ink); border-radius: var(--radius); box-shadow: var(--sh); max-height: 70vh; overflow: auto; }
.sf-suggest__group { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 800; padding: 7px 8px 4px; }
.sf-suggest__name { display: block; padding: 8px; text-decoration: none; border-radius: 10px; color: var(--ink); font-weight: 600; }
.sf-suggest__name:hover { background: var(--yellow); }
.sf-suggest__empty { background: var(--card); border: 3px solid var(--ink); border-radius: var(--radius); padding: 12px; margin: 0; color: var(--muted); box-shadow: var(--sh); }

/* ---- hero (generic page hero, e.g. home) ---- */
.sf-hero { background: var(--paper); border-bottom: 3px solid var(--ink); padding: 46px 0 36px; }
.sf-hero__headline { font-family: var(--display); text-transform: uppercase; font-size: clamp(33px, 6vw, 70px); line-height: .9; max-width: 16ch; margin: 0 0 24px; }
.sf-hero__search { position: relative; max-width: 640px; }
.sf-hero__input { font-size: 16px; padding: 13px 17px; }
.sf-hero__start { display: inline-block; margin-top: 16px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; }

/* ---- sections ---- */
.sf-section { padding-top: 8px; padding-bottom: 8px; }
.sf-section--tight { padding-top: 6px; padding-bottom: 6px; }
.sf-section__title { font-family: var(--display); text-transform: uppercase; font-weight: 400; font-size: clamp(26px, 3.9vw, 50px); line-height: .9; margin: 0 0 6px; }
.sf-section__sub { color: var(--muted); margin: 0 0 18px; font-weight: 500; }
.sf-section__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.sf-section__link { white-space: nowrap; font-weight: 800; text-transform: uppercase; font-size: 12px; letter-spacing: .03em; text-decoration: none; }
.sf-page-title { font-family: var(--display); text-transform: uppercase; font-size: clamp(30px, 5vw, 66px); line-height: .9; margin: 8px 0 10px; }

/* ---- chips / sorts / toggles (filter pills) ---- */
.sf-chips { display: flex; flex-wrap: wrap; gap: 9px; }
.sf-chip {
	display: inline-block; padding: 8px 16px; border: 3px solid var(--ink); border-radius: 999px;
	background: var(--ink); color: #fff; text-decoration: none; font-size: 13px; font-weight: 800;
	box-shadow: 2px 2px 0 rgba(20,20,20,.25);
}
.sf-chip:hover { color: #fff; transform: translate(1px,1px); box-shadow: 1px 1px 0 rgba(20,20,20,.25); }
.sf-chip--more, .sf-chip--ghost { background: var(--card); color: var(--ink); box-shadow: var(--sh-sticker); }
.sf-chip--more:hover, .sf-chip--ghost:hover { color: var(--ink); }
.sf-sorts { display: flex; gap: 14px; flex-wrap: wrap; }
.sf-sort { text-decoration: none; color: var(--muted); font-weight: 700; text-transform: uppercase; font-size: 13px; }
.sf-sort.is-active { color: var(--ink); border-bottom: 3px solid var(--coral); }

.sf-toggle { padding: 7px 13px; border: 3px solid var(--ink); border-radius: 999px; text-decoration: none; color: var(--ink); background: var(--card); font-size: 12px; font-weight: 800; box-shadow: var(--sh-sticker); }
.sf-toggle::before { content: "＋ "; }
.sf-toggle.is-on { background: var(--ink); color: #fff; }
.sf-toggle.is-on::before { content: "✓ "; color: #fff; }

/* ---- grids ---- */
.sf-grid { display: grid; gap: 22px 16px; }
.sf-grid--cards { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

/* ---- covers ---- */
.sf-cover { position: relative; display: block; aspect-ratio: 2 / 3; width: 100%; border-radius: 7px; overflow: hidden; background: var(--cover-bg, #2B3A55); border: 3px solid var(--ink); box-shadow: var(--sh-lg); }
.sf-cover__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 2; }
.sf-cover__fallback { position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; justify-content: space-between; padding: 10px; color: var(--cover-fg, #fff); }
.sf-cover__fb-title { font-family: var(--display); text-transform: uppercase; font-size: 14px; line-height: 1; }
.sf-cover__fb-author { font-size: 10px; opacity: .9; font-weight: 600; letter-spacing: .02em; }

/* ---- cards (connected books) ---- */
.sf-card { display: flex; flex-direction: column; gap: 10px; }
.sf-card__cover { display: block; }
.sf-card__cover .sf-cover { box-shadow: var(--sh-lg); }
.sf-card__title { font-family: var(--display); text-transform: uppercase; font-weight: 400; font-size: 16px; line-height: .98; margin: 0; }
.sf-card__title a { color: var(--ink); text-decoration: none; }
.sf-card__title a:hover { color: var(--blue-deep); }
.sf-card__meta { color: var(--muted); font-size: 12px; font-weight: 600; margin: 0; }
.sf-card__series { color: var(--muted); font-size: 12px; margin: 0; font-style: italic; }
.sf-card__reason { font-size: 13px; margin: 2px 0 0; color: var(--ink); }
.sf-card__actions { display: flex; align-items: center; gap: 12px; margin-top: 2px; }
.sf-card__continue { font-size: 12px; font-weight: 800; text-transform: uppercase; text-decoration: none; }

/* ---- compact rows (more by author / in the series) ---- */
.sf-rows { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px 40px; }
.sf-row { display: flex; gap: 12px; align-items: center; text-decoration: none; color: var(--ink); padding: 9px 4px; border-bottom: 2px solid var(--ink); }
.sf-row:hover { color: var(--blue-deep); }
.sf-row__cover { width: 34px; flex: 0 0 34px; }
.sf-row__cover .sf-cover { border-width: 2px; box-shadow: var(--sh-sm); }
.sf-row__title { display: block; font-weight: 800; font-size: 14px; }
.sf-row__meta { display: block; color: var(--muted); font-size: 12px; font-weight: 500; }

/* ---- buttons (pill CTAs) ---- */
.sf-btn {
	display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; border: 3px solid var(--ink); border-radius: 999px;
	background: var(--card); color: var(--ink); text-decoration: none; font-family: var(--sans); font-weight: 900;
	text-transform: uppercase; letter-spacing: .02em; font-size: 13px; cursor: pointer; box-shadow: var(--sh);
}
.sf-btn:hover { color: var(--ink); transform: translate(2px,2px); box-shadow: var(--sh-sm); }
.sf-btn--primary { background: var(--blue-deep); color: #fff; }
.sf-btn--primary:hover { background: var(--blue-deep); color: #fff; }
.sf-btn--primary::after { content: "→"; font-weight: 900; }
.sf-btn--ghost { background: var(--card); color: var(--ink); }
.sf-btn--ghost:hover { background: var(--card); color: var(--ink); }

/* ---- save control ---- */
.sf-save {
	padding: 8px 15px; border: 3px solid var(--ink); border-radius: 999px; background: var(--card); color: var(--ink);
	font-family: var(--sans); font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .02em;
	cursor: pointer; box-shadow: var(--sh-sticker);
}
.sf-save:hover { transform: translate(1px,1px); box-shadow: var(--sh-sm); }
.sf-save[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.sf-save[aria-pressed="true"] .sf-save__label::before { content: "✓ "; }
.sf-save[aria-pressed="true"] .sf-save__label { font-size: 0; }
.sf-save[aria-pressed="true"] .sf-save__label::after { content: "Saved"; font-size: 12px; }

/* ---- book page hero ---- */
.sf-book { padding: 0; }
.sf-book__head { display: grid; grid-template-columns: 236px 1fr; gap: 36px; align-items: start; }
.sf-book__cover { width: 236px; position: relative; }
.sf-book__cover::before {
	content: ""; position: absolute; z-index: 0; left: -18px; top: -15px;
	width: calc(100% + 36px); height: calc(100% + 32px); background: var(--yellow);
	border-radius: 48% 52% 56% 44% / 52% 46% 54% 48%;
}
.sf-book__cover .sf-cover { position: relative; z-index: 1; border-width: 4px; box-shadow: var(--sh-cover); }
.sf-book__identity { min-width: 0; }
.sf-book__title { font-family: var(--display); text-transform: uppercase; font-weight: 400; font-size: clamp(37px, 6.4vw, 88px); line-height: .86; letter-spacing: -.01em; margin: 0 0 10px; }
.sf-book__author { font-size: 17px; font-weight: 700; margin: 0 0 10px; }
.sf-book__logline { font-size: 17px; font-weight: 500; line-height: 1.4; margin: 0 0 10px; max-width: 60ch; }
.sf-book__line { color: var(--muted); margin: 0 0 12px; font-weight: 600; }
.sf-book__line a { color: var(--blue-deep); font-weight: 800; }
.sf-book__genres { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.sf-tag { display: inline-block; padding: 4px 12px; border: 2px solid var(--ink); border-radius: 999px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--ink); background: var(--card); text-decoration: none; box-shadow: var(--sh-sm); }
a.sf-tag:hover { background: var(--yellow); color: var(--ink); }
.sf-book__actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin: 18px 0 12px; }
.sf-note { color: var(--muted); font-size: 14px; margin: 4px 0; font-weight: 500; }
.sf-sparse { background: var(--card); border: 3px solid var(--ink); border-radius: var(--radius); padding: 11px 15px; color: var(--ink); font-weight: 600; box-shadow: var(--sh-sticker); margin-top: 16px; }

/* ---- rating ---- */
.sf-rating { margin: 10px 0; }
.sf-rating__summary { background: none; border: 0; padding: 0; cursor: pointer; color: var(--ink); font-size: 14px; font-weight: 600; }
.sf-rating__avg { font-weight: 900; }
.sf-rating__count { color: var(--muted); }
.sf-rating--none { color: var(--muted); }
.sf-rating__detail { margin: 12px 0; max-width: 340px; }
.sf-rating__row { display: grid; grid-template-columns: 28px 1fr 40px; align-items: center; gap: 8px; margin: 5px 0; font-size: 12px; color: var(--muted); }
.sf-rating__track { height: 9px; background: var(--card); border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; }
.sf-rating__fill { display: block; height: 100%; background: var(--blue); }
.sf-rating__reviews { font-size: 12px; color: var(--muted); margin: 6px 0 0; }

/* ---- external links ---- */
.sf-external { margin: 12px 0 0; }
.sf-external__label { font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0; font-size: 12px; }
.sf-external__list { list-style: none; padding: 9px 0 0; margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.sf-external__link { display: inline-flex; align-items: center; padding: 7px 14px; background: #fff; border: 3px solid var(--ink); border-radius: 999px; box-shadow: var(--sh-sticker); }
.sf-external__link:hover { transform: translate(1px,1px); box-shadow: var(--sh-sm); }
.sf-external__logo { height: 24px; width: auto; display: block; }

/* ---- semantic profile (the centerpiece, §7) ---- */
.sf-semantic { font-family: var(--hank); }
.sf-semantic .sf-section__head { margin-bottom: 8px; }
.sf-semantic .sf-section__title { font-family: var(--display); }
.sf-semantic .sf-section__sub { color: #153c6e; font-weight: 500; max-width: 60ch; }
.sf-axes { display: flex; flex-direction: column; gap: 13px; }
.sf-axis {
	display: grid; grid-template-columns: 200px 1fr; grid-template-areas: "name labels" "link labels"; column-gap: 28px; row-gap: 8px;
	background: #fff; border-radius: 24px; padding: 24px 28px; box-shadow: var(--sh-soft); align-items: start;
	--ax-fill: var(--yellow-soft); --ax-fg: #161412; --ax-spark: var(--yellow-spark);
}
.sf-axis:nth-child(3n+2) { --ax-fill: var(--blue-pill); --ax-fg: #161412; --ax-spark: var(--blue-spark); }
.sf-axis:nth-child(3n+3) { --ax-fill: var(--coral-pill); --ax-fg: #ffffff; --ax-spark: var(--coral-pill); }
.sf-axis__name {
	grid-area: name; font-family: var(--display); text-transform: uppercase; font-weight: 400;
	font-size: clamp(22px, 2.2vw, 29px); line-height: .96; color: #161412; margin: 0;
}
.sf-axis__name::before { content: "\2736"; display: block; font-family: var(--sans); font-size: 22px; line-height: 1; color: var(--ax-spark); margin-bottom: 7px; }
.sf-axis__labels { grid-area: labels; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.sf-axis__featured { display: flex; flex-wrap: wrap; gap: 9px; }
.sf-axis__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sf-axis__pill {
	display: inline-block; padding: 10px 16px; border-radius: 999px; background: var(--ax-fill); color: var(--ax-fg);
	border: 2px solid var(--ink); box-shadow: var(--sh-sticker); font-family: var(--hank); font-weight: 800; font-size: 15px;
	letter-spacing: .012em; text-transform: uppercase; white-space: nowrap; text-decoration: none;
}
.sf-axis__pill:hover { color: var(--ax-fg); transform: translate(1px,1px); box-shadow: var(--sh-sm); }
.sf-axis__chip {
	display: inline-block; padding: 6px 13px; border-radius: 999px; background: transparent; border: 1.5px solid rgba(22,20,18,.22);
	color: var(--chip-text); font-family: var(--hank); font-weight: 500; font-size: 13px; white-space: nowrap; text-decoration: none;
}
.sf-axis__chip:hover { border-color: #161412; background: rgba(22,20,18,.045); color: #161412; }
.sf-axis__link {
	grid-area: link; align-self: end; justify-self: start; font-family: var(--hank); font-weight: 700; font-size: 12px;
	letter-spacing: .05em; text-transform: uppercase; color: var(--coral); text-decoration: none;
}
.sf-axis__link:hover { color: #fff; background: var(--coral); border-radius: 999px; padding: 4px 10px; margin: -4px -10px; }
.sf-axis--secondary { opacity: .92; }

/* legacy label-chip (used by explore card bits) */
.sf-label-chip { text-decoration: none; color: var(--ink); border-bottom: 2px solid var(--yellow); font-weight: 600; }
.sf-label-chip:hover { color: var(--blue-deep); border-bottom-color: var(--blue-deep); }

/* ---- semantic axis controls ("find similar by") ---- */
.sf-axis-controls { display: flex; flex-direction: column; gap: 9px; }
.sf-axis-controls__label { font-family: var(--display); text-transform: uppercase; font-size: clamp(19px, 2.6vw, 29px); line-height: 1; color: var(--ink); margin: 0 0 2px; }
.sf-axis-controls__set { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 6px; }
.sf-axis-chip {
	display: inline-block; padding: 8px 15px; border: 3px solid var(--ink); border-radius: 999px; background: var(--card); color: var(--ink);
	text-decoration: none; font-size: 13px; font-weight: 800; box-shadow: var(--sh-sticker);
}
.sf-axis-chip:hover { color: var(--ink); transform: translate(1px,1px); box-shadow: var(--sh-sm); }
.sf-axis-chip.is-active { background: var(--ink); color: #fff; }
.sf-axis-chip--secondary { color: var(--muted); }
.sf-axis-chip--secondary.is-active { color: #fff; }

/* ---- semantic explore header / cards ---- */
.sf-semantic-explore__back { margin: 14px 0 0; }
.sf-back { color: var(--ink); text-decoration: none; font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; }
.sf-back:hover { color: var(--coral); }

.sf-semantic-header { margin: 16px 0 20px; }
.sf-semantic-header__title { font-family: var(--display); text-transform: uppercase; font-size: clamp(25px, 3.7vw, 47px); line-height: .92; margin: 0 0 10px; }
.sf-semantic-header__basis { color: var(--ink); margin: 0 0 8px; max-width: 680px; font-weight: 500; }
.sf-semantic-header__labels { color: var(--muted); font-size: 14px; margin: 2px 0; }
.sf-semantic-header__axis { font-weight: 800; color: var(--ink); }
.sf-semantic-header__focus { color: var(--ink); font-size: 14px; margin: 6px 0; }
.sf-semantic-header__limit { color: var(--muted); font-size: 13px; font-style: italic; margin: 8px 0 0; max-width: 680px; }

.sf-card--semantic .sf-why { margin: 2px 0 0; }
.sf-why__head { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 2px; }
.sf-why__axis { font-size: 13px; margin: 1px 0; line-height: 1.5; }
.sf-why__axis-name { color: var(--muted); font-weight: 700; }
.sf-evidence { margin: 6px 0 0; }
.sf-evidence__line { font-size: 12px; margin: 1px 0; color: var(--ink); }
.sf-evidence__line--muted { color: var(--muted); }

/* ratings filter slider */
.sf-ratings-filter { display: flex; align-items: center; gap: 10px; }
.sf-ratings-filter__label { font-size: 13px; color: var(--muted); font-weight: 700; white-space: nowrap; }
.sf-ratings-filter__slider { width: 150px; accent-color: var(--coral); }
.sf-ratings-filter__value { font-size: 13px; color: var(--ink); font-weight: 800; min-width: 7em; font-variant-numeric: tabular-nums; }

.sf-card-debug { margin-top: 6px; font-size: 12px; color: var(--muted); }
.sf-card-debug__list { margin: 4px 0 0; padding-left: 18px; }
.sf-card-debug__list li { font-size: 12px; }

/* ---- details (ink band) ---- */
.sf-details .sf-section__title { color: var(--paper); }
.sf-dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px 24px; max-width: none; align-items: start; }
.sf-dl dt { color: var(--yellow); font-weight: 900; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 3px; }
.sf-dl dd { margin: 0 0 6px; font-size: 14px; color: var(--paper); }
.sf-band--ink .sf-dl dd a { color: var(--blue-band); }
.sf-subjects { color: var(--paper); display: flex; flex-wrap: wrap; gap: 8px; }
.sf-subject-chip { display: inline-block; border: 2px solid #5a564c; color: var(--paper); border-radius: 999px; padding: 5px 12px; font-size: 12px; }

/* ---- debug (dev only) ---- */
.sf-debug { background: #fff; border: 3px solid var(--ink); border-radius: var(--radius); padding: 14px 18px; margin-top: 24px; box-shadow: var(--sh-sticker); }
.sf-facets { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px 24px; }
.sf-facet__label { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 800; margin: 0 0 6px; }
.sf-facet__list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.sf-facet__list li { font-size: 14px; }
.sf-facet__meta { display: block; color: var(--muted); font-size: 12px; }
.sf-facet__anchor { font-size: 12px; color: var(--muted); line-height: 1.4; margin: 0 0 10px; }
.sf-facet__anchor-key { font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.sf-facet__more > summary { cursor: pointer; color: var(--muted); font-size: 12px; }
.sf-facet__tags { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }

/* ---- explore ---- */
.sf-explore { padding-top: 24px; }
.sf-anchor { display: flex; gap: 16px; align-items: center; background: var(--card); border: 3px solid var(--ink); border-radius: var(--radius); padding: 12px 16px; box-shadow: var(--sh); }
.sf-anchor__cover { width: 42px; flex: 0 0 42px; }
.sf-anchor__cover .sf-cover { border-width: 2px; box-shadow: var(--sh-sm); }
.sf-anchor__label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 800; }
.sf-anchor__title { font-family: var(--display); text-transform: uppercase; font-weight: 400; font-size: 22px; line-height: .95; margin: 0; }
.sf-anchor__meta { color: var(--muted); margin: 0; font-size: 14px; }
.sf-anchor__actions { display: flex; gap: 12px; align-items: center; margin-left: auto; }

.sf-trail { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 14px 0; min-height: 12px; }
.sf-trail:empty { display: none; }
.sf-trail__step { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border: 2px solid var(--ink); border-radius: 999px; background: var(--card); text-decoration: none; color: var(--ink); font-size: 12px; font-weight: 600; box-shadow: var(--sh-sm); }
.sf-trail__step.is-current { background: var(--ink); color: #fff; font-weight: 800; }
.sf-trail__sep { color: var(--muted); }

.sf-modes { display: flex; flex-wrap: wrap; gap: 9px; padding-bottom: 4px; margin-top: 10px; }
.sf-mode { padding: 8px 15px; text-decoration: none; color: var(--ink); font-weight: 800; border: 3px solid var(--ink); border-radius: 999px; background: var(--card); box-shadow: var(--sh-sticker); }
.sf-mode:hover { color: var(--ink); transform: translate(1px,1px); box-shadow: var(--sh-sm); }
.sf-mode.is-active { background: var(--ink); color: #fff; }
.sf-mode__def { color: var(--muted); margin: 14px 0 18px; font-style: italic; }
.sf-refine { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 22px; }

.sf-more { text-align: center; padding: 30px 0; }
.sf-empty { background: var(--card); border: 3px solid var(--ink); border-radius: var(--radius); padding: 28px; text-align: center; box-shadow: var(--sh); }
.sf-empty__msg { font-size: 17px; margin: 0 0 14px; font-weight: 600; }

/* ---- dev note ---- */
.sf-devnote { display: inline-block; margin: 8px 0; padding: 3px 10px; border: 2px dashed #b08900; border-radius: 999px; background: #fff8e1; color: #6b5300; font-size: 12px; font-weight: 700; font-family: var(--sans); }

/* ---- prose ---- */
.sf-prose { max-width: 720px; }
.sf-prose p, .sf-prose li { font-size: 16px; line-height: 1.65; text-wrap: pretty; }

/* ---- the story section (book page, yellow band) ---- */
.sf-story { padding-bottom: 0; }
.sf-story .sf-section__title { margin: 0; font-size: clamp(34px, 5.1vw, 65px); }
.sf-story__head { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin: 0 auto 18px; max-width: 720px; }
.sf-doodle-arrow { color: var(--coral); flex: 0 0 auto; margin-bottom: 0; }
.sf-story__body { color: var(--ink); margin-left: auto; margin-right: auto; }
.sf-story__body p { margin: 0 0 16px; }
.sf-story__body p:last-child { margin-bottom: 0; }

/* collapse: only the top 100px shows until the tab is toggled */
.sf-story__cb { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sf-story__panel { max-height: 50px; overflow: hidden; transition: max-height .35s ease; }
.sf-story__cb:checked ~ .sf-story__panel { max-height: 6000px; padding-bottom: 56px; }
.sf-story__tab {
	position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
	display: flex; align-items: center; gap: 8px; width: max-content; max-width: 100%;
	cursor: pointer; background: var(--card); color: var(--ink); border: 3px solid var(--ink); border-bottom: 0;
	border-radius: 16px 16px 0 0; padding: 9px 22px; font-family: var(--sans); font-weight: 900;
	text-transform: uppercase; letter-spacing: .02em; font-size: 13px;
}
.sf-story__tab:hover { color: var(--coral); }
.sf-story__tab-label--hide { display: none; }
.sf-story__cb:checked ~ .sf-story__tab .sf-story__tab-label--see { display: none; }
.sf-story__cb:checked ~ .sf-story__tab .sf-story__tab-label--hide { display: inline; }
.sf-story__cb:focus-visible ~ .sf-story__tab { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ---- handwritten asides ---- */
.sf-hand { font-family: var(--hand); font-weight: 700; font-size: 22px; line-height: 1.2; color: var(--ink); transform: rotate(-3deg); margin: 4px 0 14px; }

/* ---- footer ---- */
.sf-footer { background: var(--ink); color: var(--paper); border-top: 3px solid var(--ink); margin-top: 0; }
.sf-footer__inner { display: flex; gap: 24px; padding-top: 22px; padding-bottom: 22px; flex-wrap: wrap; }
.sf-footer a { color: var(--paper); text-decoration: none; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; }
.sf-footer a:hover { color: var(--yellow); }

/* ---- decorations (sparing, pointer-events:none) ---- */
.sf-band--blue::after, .sf-band--coral::after, .sf-band--yellow::after {
	content: "\2733"; position: absolute; z-index: 1; pointer-events: none; font-family: var(--sans);
	font-size: 72px; line-height: 1; opacity: .5; top: 16px; right: 24px;
}
.sf-band--blue::after { color: var(--yellow); transform: rotate(12deg); }
.sf-band--coral::after { content: "+"; font-family: var(--display); color: #fff; font-size: 96px; top: 6px; right: 30px; opacity: .55; }
.sf-band--yellow::after { content: "\2736"; color: var(--ink); opacity: .25; font-size: 64px; transform: rotate(-10deg); }

@keyframes floaty { 0%,100% { transform: translateY(0) rotate(var(--r,0deg)); } 50% { transform: translateY(-8px) rotate(var(--r,0deg)); } }

/* ---- responsive ---- */
@media (max-width: 992px) {
	.sf-book__head { grid-template-columns: 190px 1fr; gap: 28px; }
	.sf-book__cover { width: 190px; }
	.sf-axis { grid-template-columns: 172px 1fr; column-gap: 22px; }
}
@media (max-width: 640px) {
	.sf-container, .sf-band__inner { padding: 0 16px; }
	.sf-band { padding: 32px 0; }
	.sf-grid--cards { grid-template-columns: repeat(2, 1fr); }
	.sf-rows { grid-template-columns: 1fr; gap: 0 0; }
	.sf-header__inner { flex-wrap: wrap; min-height: auto; padding: 10px 0; gap: 12px; }
	.sf-search { order: 3; flex-basis: 100%; max-width: none; }
	.sf-book__head { grid-template-columns: 1fr; gap: 24px; }
	.sf-book__cover { width: 172px; }
	.sf-anchor { flex-wrap: wrap; position: static; }
	.sf-anchor__actions { margin-left: 0; }
	.sf-modes { overflow-x: auto; flex-wrap: nowrap; }
	.sf-axis { grid-template-columns: 1fr; grid-template-areas: "name" "labels" "link"; row-gap: 14px; padding: 20px 18px; }
	.sf-axis__link { align-self: start; }
	.sf-band--blue::after, .sf-band--coral::after, .sf-band--yellow::after { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	* { transition: none !important; animation: none !important; }
}
