/*
 * Style guide — loaded only by page-style.php.
 *
 * Deliberately kept OUT of style.css. Some of this documents the real
 * system; some of it is competing options that must never leak into it.
 * Everything is scoped under .sg-. When an OPEN section is decided, its
 * winning values move into style.css and the losing options are deleted
 * from here.
 */

.sg-section {
	margin-block: 5rem;
}

.sg-section__head {
	border-bottom: 1px solid var(--color-text);
	padding-bottom: 1rem;
	margin-bottom: 2.5rem;
}

.sg-section__title {
	margin: 0 0 0.5rem;
	font-size: clamp(1.5rem, 2.5vw, 2rem);
	display: flex;
	align-items: center;
	gap: 0.85rem;
	flex-wrap: wrap;
}

.sg-section__note {
	margin: 0;
	max-width: 46rem;
	color: var(--color-muted);
	font-size: 0.95rem;
	font-family: var(--font-sans);
}

.sg-badge {
	font-family: var(--font-sans);
	font-size: 0.62rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	padding: 0.2rem 0.5rem;
	border: 1px solid;
}

.sg-badge--decided {
	color: var(--color-muted);
	border-color: var(--color-border);
}

.sg-badge--open {
	color: var(--color-accent);
	border-color: var(--color-accent);
}

.sg-option {
	padding-block: 2.5rem;
	border-bottom: 1px solid var(--color-border);
}

.sg-option:last-child {
	border-bottom: none;
}

.sg-option__head {
	display: flex;
	align-items: baseline;
	gap: 1rem;
	flex-wrap: wrap;
	margin-bottom: 1.75rem;
}

.sg-option__name,
.sg-linkrow__state {
	font-family: var(--font-sans);
	font-size: 0.7rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--color-muted);
}

.sg-option__current {
	font-family: var(--font-sans);
	font-size: 0.65rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--color-accent);
	border: 1px solid var(--color-accent);
	padding: 0.15rem 0.45rem;
}

.sg-option__note {
	font-family: var(--font-sans);
	font-size: 0.9rem;
	color: var(--color-muted);
	margin: 1.5rem 0 0;
	max-width: 44rem;
}

/* ---- Type scale ------------------------------------------------------- */

.sg-spec {
	display: grid;
	grid-template-columns: 16rem 1fr;
	gap: 2rem;
	align-items: baseline;
	padding-block: 1.5rem;
	border-bottom: 1px solid var(--color-border);
}

.sg-spec:last-child {
	border-bottom: none;
}

@media (max-width: 48rem) {
	.sg-spec {
		grid-template-columns: 1fr;
		gap: 0.5rem;
	}
}

.sg-spec__meta {
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
}

.sg-spec__class {
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 0.78rem;
	color: var(--color-text);
}

.sg-spec__size {
	font-family: var(--font-sans);
	font-size: 0.75rem;
	color: var(--color-muted);
}

.sg-spec__sample {
	font-family: var(--font-display);
	color: var(--color-text);
}

.sg-spec--hero  { font-size: clamp(2rem, 4vw, 3rem); font-weight: 700; letter-spacing: -0.015em; line-height: 1.05; }
.sg-spec--h1    { font-size: clamp(1.75rem, 3vw, 2.25rem); font-weight: 700; letter-spacing: -0.015em; }
.sg-spec--h2    { font-size: clamp(1.875rem, 2.6vw, 2.375rem); font-weight: 600; }
.sg-spec--h3    { font-size: clamp(1.5rem, 2.5vw, 2rem); font-weight: 600; }
.sg-spec--lede  { font-family: var(--font-sans); font-size: 1.05rem; color: var(--color-muted); }
.sg-spec--body  { font-family: var(--font-sans); font-size: 1rem; line-height: 1.5; }
.sg-spec--micro { font-family: var(--font-sans); font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--color-muted); }

/* ---- Colour tokens ---------------------------------------------------- */

.sg-tokens {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
	gap: 1.5rem;
}

.sg-token__chip {
	aspect-ratio: 5 / 2;
	display: flex;
	align-items: flex-end;
	padding: 0.55rem;
	border: 1px solid var(--color-border);
	margin-bottom: 0.6rem;
}

.sg-token__chip span {
	font-family: var(--font-sans);
	font-size: 0.62rem;
	font-weight: 600;
	letter-spacing: 0.04em;
}

.sg-token__name {
	display: block;
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 0.75rem;
	margin-bottom: 0.2rem;
}

.sg-token__use {
	display: block;
	font-family: var(--font-sans);
	font-size: 0.78rem;
	color: var(--color-muted);
}

.sg-rules {
	margin-top: 3rem;
	border-left: 3px solid var(--color-accent);
	padding-left: 1.75rem;
	max-width: 44rem;
}

.sg-rules__title {
	font-family: var(--font-sans);
	font-size: 0.7rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--color-text);
	margin: 0 0 0.75rem;
}

.sg-rules__title--no {
	margin-top: 1.75rem;
}

.sg-rules__list {
	margin: 0;
	padding-left: 1.1rem;
	font-family: var(--font-sans);
	font-size: 0.9rem;
	color: var(--color-muted);
}

.sg-rules__list li {
	margin-bottom: 0.35rem;
}

/* ---- Icon set --------------------------------------------------------- */

.sg-iconset {
	display: flex;
	gap: 3rem;
	flex-wrap: wrap;
}

.sg-iconset__item {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.75rem;
}

.sg-iconset svg {
	width: 1.75rem;
	height: 1.75rem;
	display: block;
	color: var(--color-text);
}

.sg-iconset__item span {
	font-family: var(--font-sans);
	font-size: 0.68rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--color-muted);
}

/* ---- Stat treatment (decided: number first, label under) --------------- */

.sg-statrow {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 2.5rem;
}

@media (max-width: 40rem) {
	.sg-statrow {
		grid-template-columns: 1fr;
		gap: 1.75rem;
	}
}

.sg-stat__rule {
	display: none;
	width: 2.5rem;
	height: 3px;
	background: var(--color-text);
	margin-bottom: 1rem;
}

.sg-stat__value {
	display: block;
	font-family: var(--font-sans);
	font-weight: 700;
	font-size: clamp(1.6rem, 2.6vw, 2rem);
	line-height: 1.1;
	color: var(--color-text);
}

.sg-stat__label {
	display: block;
	font-family: var(--font-sans);
	font-size: 0.72rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--color-muted);
	margin-top: 0.4rem;
}

/* a — rule above */
.sg-statrow--a .sg-stat__rule { display: block; }

/* b — number first, label under (no rule) — the default above */

/* ---- Button (decided: solid, nudge-right) ------------------------------ */

.sg-btnrow {
	display: flex;
	gap: 1.5rem;
	flex-wrap: wrap;
	align-items: center;
}

.sg-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	font-family: var(--font-sans);
	font-size: 0.9rem;
	font-weight: 600;
	padding: 0.7rem 1.4rem;
	border: 1px solid transparent;
	text-decoration: none;
	cursor: pointer;
}

.sg-btn svg {
	width: 0.9rem;
	height: 0.9rem;
	display: block;
	flex-shrink: 0;
}

.sg-btn--solid { background: var(--color-text); color: #fff; }

/* ---- Hover motion (live — these are real :hover, not static twins) ----- */

.sg-btn[class*="sg-motion--"] {
	transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.sg-btn[class*="sg-motion--"] svg {
	transition: transform 0.18s ease;
}

/* a — the whole button travels right, arrow with it */
.sg-motion--nudge:hover { transform: translateX(4px); }
.sg-motion--nudge:hover svg { transform: translate(2px, -2px); }

/* b — lift */

/* c — offset press: a hard block sits behind, the button moves into it.
   No blur anywhere; the squared corners are what make this read. */

/* d — only the arrow moves; the button holds still */

/* Colour still changes on all of them, so the state survives when motion
   is switched off below. */
.sg-btn--solid[class*="sg-motion--"]:hover { background: var(--color-accent); }

@media (prefers-reduced-motion: reduce) {
	.sg-btn[class*="sg-motion--"],
	.sg-btn[class*="sg-motion--"] svg {
		transition: background-color 0.18s ease, color 0.18s ease;
	}

	.sg-motion--nudge:hover,
	.sg-motion--nudge:hover svg {
		transform: none;
	}
}

/* ---- Links (documenting the five current treatments) ------------------- */

.sg-linkrow {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 2rem;
}

@media (max-width: 40rem) {
	.sg-linkrow {
		grid-template-columns: 1fr;
	}
}

.sg-linkrow__cell {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	align-items: flex-start;
}

.sg-link {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	font-family: var(--font-sans);
	font-size: 0.95rem;
	color: var(--color-text);
}

.sg-link svg {
	width: 0.85rem;
	height: 0.85rem;
	display: block;
	transition: transform 0.2s ease;
}

.sg-link--inline { text-decoration: underline; text-underline-offset: 0.22em; }
.sg-link--inline svg { display: none; }
.sg-link--inline.is-hover { color: var(--color-accent); }

.sg-link--arrow.is-hover { color: var(--color-accent); }
.sg-link--arrow.is-hover svg { transform: translateX(0.25rem); }

.sg-link--row { width: 100%; justify-content: space-between; padding-block: 0.6rem; }
.sg-link--row.is-hover { color: var(--color-accent); text-decoration: underline; text-underline-offset: 0.22em; }
.sg-link--row.is-hover svg { transform: translateX(0.25rem); }

.sg-link--card {
	border: 1px solid var(--color-border);
	padding: 1.25rem 1.4rem;
	width: 100%;
	justify-content: space-between;
	transition: transform 0.25s ease;
}

.sg-link--card.is-hover { transform: rotate(-0.4deg) scale(1.012); }

.sg-focus--default { outline: 2px solid Highlight; outline-offset: 0; }
.sg-focus--proposed { outline: 2px solid var(--color-accent); outline-offset: 3px; }

/* ---- Rule weights ------------------------------------------------------ */

.sg-rulestack {
	display: flex;
	flex-direction: column;
	gap: 2rem;
	max-width: 46rem;
}

.sg-ruledemo__line {
	display: block;
	width: 100%;
	margin-bottom: 0.6rem;
}

.sg-ruledemo__line--hair   { height: 1px; background: var(--color-border); }
.sg-ruledemo__line--mid    { height: 1px; background: var(--color-rule); }
.sg-ruledemo__line--strong { height: 1px; background: var(--color-text); }
.sg-ruledemo__line--accent { height: 3px; width: 2.5rem; background: var(--color-accent); }

.sg-ruledemo__label {
	font-family: var(--font-sans);
	font-size: 0.82rem;
	color: var(--color-muted);
}

.sg-ruledemo__label code {
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 0.78rem;
	color: var(--color-text);
}

/* ---- Arrow demos ------------------------------------------------------- */

.sg-arrowdemo svg { transition: transform 0.18s ease; }
.sg-arrowdemo:hover { color: var(--color-accent); }
.sg-arrowdemo--internal:hover svg { transform: translateX(3px); }
.sg-arrowdemo--external:hover svg { transform: translate(2px, -2px); }

/* ---- Spacing scale ----------------------------------------------------- */

.sg-space {
	display: grid;
	grid-template-columns: 7rem 5rem 1fr;
	gap: 1.5rem;
	align-items: center;
	padding-block: 0.7rem;
	border-bottom: 1px solid var(--color-border);
}

.sg-space:last-child { border-bottom: none; }

.sg-space__bar {
	height: 0.75rem;
	background: var(--color-accent);
	display: block;
}

.sg-space__value,
.sg-col-demo code,
.sg-contrast code {
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 0.78rem;
	color: var(--color-text);
}

.sg-space__use {
	font-family: var(--font-sans);
	font-size: 0.85rem;
	color: var(--color-muted);
}

/* ---- Column-width demos ------------------------------------------------ */

.sg-cols {
	display: flex;
	flex-direction: column;
	gap: 1.75rem;
	margin-top: 1.5rem;
}

.sg-col-demo {
	display: flex;
	align-items: flex-start;
	gap: 1.5rem;
}

.sg-col-demo__bar {
	height: 2.5rem;
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	flex-shrink: 0;
}

.sg-col-demo div { display: flex; flex-direction: column; gap: 0.3rem; }

.sg-col-demo span {
	font-family: var(--font-sans);
	font-size: 0.85rem;
	color: var(--color-muted);
	max-width: 34rem;
}

@media (max-width: 40rem) {
	.sg-col-demo { flex-direction: column; gap: 0.6rem; }
	.sg-col-demo__bar { width: 100% !important; height: 0.75rem; }
	.sg-space { grid-template-columns: 1fr; gap: 0.3rem; }
}

/* ---- Band preview ------------------------------------------------------ */

.sg-bandpreview {
	background: var(--color-surface);
	padding: 2.5rem 0;
	/* breaks out of the guide's own column so the full-bleed behaviour is
	   visible rather than described */
	margin-inline: -1.5rem;
}

.sg-bandpreview__inner { padding-inline: 1.5rem; }

/* ---- Dimension (open), round 2 -----------------------------------------
   Round 1 (offset colour panel, bordered overlay card, dot-grid texture)
   read as dated and was deleted rather than kept as dead weight — see
   git history if it's ever worth resurrecting. This round chases depth
   through overlap, scale and (for the first time on this site) a very
   soft shadow, instead of flat offset shapes. */

/* A — overlapping pair: two photos at different scale, one lapping the
   other's corner. The shadow here is only enough to separate the two
   layers, not a standalone effect. */
.sg-photo-overlap {
	position: relative;
	width: 16rem;
	max-width: 100%;
	padding: 0 2rem 2rem 0;
}

.sg-photo-overlap__main {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 5;
	object-fit: cover;
}

.sg-photo-overlap__accent {
	position: absolute;
	right: 0;
	bottom: 0;
	width: 55%;
	height: auto;
	aspect-ratio: 1;
	object-fit: cover;
	box-shadow: 0 0.5rem 1.5rem rgba(13, 17, 20, 0.16);
}

/* B — tilted, soft shadow: the one real system change in this round.
   Wide blur, low opacity, minimal offset — reads as ambient light, not
   a UI card lifting off the page. If this is decided in, it belongs in
   style.css as a named token (e.g. --shadow-soft) rather than a literal
   repeated at every call site. */
.sg-photo-tilt {
	width: 16rem;
	max-width: 100%;
	transform: rotate(-2deg);
}

.sg-photo-tilt img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 5;
	object-fit: cover;
	box-shadow: 0 1.5rem 3rem rgba(13, 17, 20, 0.14);
}

/* C — asymmetric pair: no shadow, no rotation. Depth from breaking the
   equal-square grid alone — two aspect ratios, two vertical offsets. */
.sg-photo-asymmetric {
	display: flex;
	align-items: flex-end;
	gap: 1.5rem;
}

.sg-photo-asymmetric__tall {
	width: 9rem;
	height: auto;
	aspect-ratio: 3 / 4;
	object-fit: cover;
}

.sg-photo-asymmetric__wide {
	width: 13rem;
	height: auto;
	aspect-ratio: 5 / 4;
	object-fit: cover;
	margin-bottom: 2rem;
}

/* ---- Voice: not-this / this ------------------------------------------- */

.sg-voice {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 1.5rem;
}

@media (max-width: 40rem) {
	.sg-voice { grid-template-columns: 1fr; }
}

.sg-voice__cell {
	border: 1px solid var(--color-border);
	padding: 1.25rem 1.4rem;
}

.sg-voice__cell p {
	margin: 0;
	font-family: var(--font-sans);
	font-size: 0.95rem;
	line-height: 1.5;
}

.sg-voice__cell--no p { color: var(--color-muted); text-decoration: line-through; text-decoration-thickness: 1px; }
.sg-voice__cell--yes { border-color: var(--color-text); }

.sg-voice__tag {
	display: block;
	font-family: var(--font-sans);
	font-size: 0.62rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--color-muted);
	margin-bottom: 0.6rem;
}

.sg-voice__cell--yes .sg-voice__tag { color: var(--color-accent); }

/* ---- Contrast table ---------------------------------------------------- */

.sg-contrast {
	display: grid;
	grid-template-columns: 2rem 10rem 5rem 1fr;
	gap: 1rem;
	align-items: center;
	padding-block: 0.85rem;
	border-bottom: 1px solid var(--color-border);
}

.sg-contrast:last-child { border-bottom: none; }

.sg-contrast__swatch {
	width: 1.5rem;
	height: 1.5rem;
	border: 1px solid var(--color-border);
	display: block;
}

.sg-contrast__ratio {
	font-family: var(--font-sans);
	font-size: 0.85rem;
	font-weight: 700;
}

.sg-contrast__note {
	font-family: var(--font-sans);
	font-size: 0.85rem;
	color: var(--color-muted);
}

@media (max-width: 48rem) {
	.sg-contrast { grid-template-columns: 2rem 1fr; row-gap: 0.4rem; }
	.sg-contrast__note { grid-column: 2; }
}

/* ---- Editorial scale (open) --------------------------------------------
   Prompted by garri.design/fintech's overall visual style rather than
   one device. A: a display-scale statement, bigger than anything else
   currently in the case study body — .cs-turn__close-principle
   (clamp 1.5-2.5rem) is the site's current largest in-body statement;
   this goes noticeably past it to actually read as headline-scale. */
.sg-editorial-quote {
	max-width: 44rem;
	margin: 0 0 1.5rem;
	font-family: var(--font-display);
	font-size: clamp(2rem, 4.5vw, 3.5rem);
	font-weight: 600;
	line-height: 1.1;
	letter-spacing: -0.015em;
	color: var(--color-text);
}

/* B: a full-bleed soft band holding real screenshots with generous
   air — breaks out of the guide's own column the same way
   .sg-bandpreview does. */
.sg-shot-band {
	background: var(--color-surface);
	padding-block: 3rem;
	margin-inline: -1.5rem;
	margin-bottom: 1.5rem;
}

.sg-shot-band__inner {
	max-width: 52rem;
	margin-inline: auto;
	padding-inline: 1.5rem;
	display: flex;
	flex-direction: column;
	gap: 3rem;
}

.sg-shot-band__inner img {
	display: block;
	width: 100%;
	height: auto;
	border: 1px solid var(--color-border);
}

/* C: the real hero content, given a tall fixed-height box to preview
   "more room" without claiming true viewport height inside the guide's
   own flow. Dashed border matches .case-study-image-placeholder's
   "this is a demo, not final" convention. */
.sg-hero-full {
	display: flex;
	flex-direction: column;
	justify-content: center;
	height: 32rem;
	padding: 2rem;
	margin-bottom: 1.5rem;
	background: var(--color-surface);
	border: 1px dashed var(--color-border);
}

/* ---- Closing-statement comparison -------------------------------------- */

.sg-closing-compare {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 3rem;
	align-items: start;
}

@media (max-width: 48rem) {
	.sg-closing-compare {
		grid-template-columns: 1fr;
		gap: 2.5rem;
	}
}

/* "More work" now renders with its real classes (.more-work*, in
   style.css) rather than an sg- mock — see the note on that section
   in page-style.php. */

/* ---- Colour: warm-neutral comparison ------------------------------------ */

/* Each side sets --color-* as an inline style on this wrapper (see
   page-style.php) — every element below reads them via var(), so one
   set of markup previews both neutral options with no per-option CSS. */
.sg-palette-demo {
	padding: 2.5rem;
	margin: 1.5rem 0;
	background: var(--color-bg);
	border: 1px solid var(--color-border);
}

.sg-palette-demo__heading {
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 1.5rem;
	line-height: 1.2;
	letter-spacing: -0.015em;
	color: var(--color-text);
	margin: 0 0 0.75rem;
}

.sg-palette-demo__text {
	font-family: var(--font-sans);
	font-size: 1rem;
	color: var(--color-muted);
	max-width: 34rem;
	margin: 0 0 1.5rem;
}

.sg-palette-demo__link {
	color: var(--color-accent);
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

.sg-palette-demo__row {
	display: flex;
	align-items: center;
	gap: 1.25rem;
	margin-bottom: 1.5rem;
}

.sg-palette-demo__button {
	display: inline-flex;
	align-items: center;
	background: var(--color-invert-bg);
	color: var(--color-invert-text);
	font-family: var(--font-sans);
	font-size: 0.875rem;
	font-weight: 600;
	padding: 0.7rem 1.4rem;
}

.sg-palette-demo__tag {
	display: inline-flex;
	align-items: center;
	background: var(--color-accent);
	color: var(--color-bg);
	font-family: var(--font-sans);
	font-size: 0.8125rem;
	font-weight: 600;
	padding: 0.4rem 0.9rem;
}

.sg-palette-demo__card {
	display: inline-flex;
	flex-direction: column;
	gap: 0.35rem;
	padding: 1.5rem 1.75rem;
	background: var(--color-surface);
	border: 1px solid var(--color-border);
}

.sg-palette-demo__stat-value {
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 1.75rem;
	color: var(--color-accent);
}

.sg-palette-demo__stat-label {
	display: block;
	font-family: var(--font-sans);
	font-size: 0.8125rem;
	color: var(--color-muted);
}

.sg-palette-compare {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 3rem;
	align-items: start;
}

@media (max-width: 48rem) {
	.sg-palette-compare {
		grid-template-columns: 1fr;
		gap: 2.5rem;
	}
}

