/* The Quick tips page. Flat CSS, no nesting, for the same iOS reason as
   global.css. Every class starts with tips- so nothing here can touch the site
   chrome, and every color is a theme token except the values a demo is about. */

/* No bottom padding: the page ends on its last band, which meets the
   footer's signup row with no empty strip between (owner, 2026-11-11). */
.tips-page {
	max-width: 1240px;
	margin: 0 auto;
	padding: 2.5rem 1.25rem 0;
}

.tips-page h1 {
	margin-bottom: .6rem;
	font-size: clamp(2rem, 5vw, 3rem);
	font-weight: 800;
	letter-spacing: -.035em;
	line-height: 1.1;
}

.tips-lede {
	max-width: 62ch;
	margin-bottom: 1rem;
	color: var(--text-muted);
}

.tips-group {
	margin: 2.5rem 0 .4rem;
	font-size: 1.35rem;
	font-weight: 700;
	letter-spacing: -.02em;
}

.tips-group-note {
	max-width: 62ch;
	margin-bottom: 1rem;
	font-size: .9rem;
	color: var(--text-muted);
}

/* One tip per row, so each has room for its write-up and the demos sit
   apart instead of packed three across (owner, 2026-11-10). */
.tips-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
}

/* One tip per band: the demo, then the name, the write-up and the snippet.
   Each band runs the full width of the window (border-image paints its
   ground out to both edges without adding a sideways scroll), and every
   second band carries the other theme (below), so paper and ink take turns
   (owner, 2026-11-11). */
.tips-card {
	display: grid;
	grid-template-rows: auto 1fr;
	padding-block: clamp(2.25rem, 5vw, 3.75rem);
	color: var(--text);
	border-image-source: linear-gradient(var(--bg), var(--bg));
	border-image-slice: 0 fill;
	border-image-outset: 0 100vw;
}

.tips-card-try {
	grid-template-rows: auto auto 1fr;
}

.tips-card-body {
	display: grid;
	gap: .75rem;
	align-content: start;
	padding: 1.5rem 0 0;
}

.tips-card-body h3 {
	font-size: 1.3rem;
	letter-spacing: -.015em;
	line-height: 1.2;
	text-wrap: balance;
}

.tips-card-body p {
	max-width: 62ch;
	font-size: 1rem;
	line-height: 1.6;
	color: var(--text);
}

.tips-card-body p + p {
	margin-top: .25rem;
}

.tips-snippet {
	padding: .55rem .7rem;
	border-radius: var(--radius);
	background: var(--surface-2);
	font: .8rem var(--font-mono);
	color: var(--accent);
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}

.tips-snippet code {
	font: inherit;
}

/* The Without and With panes. */
/* the demo is a framed panel on its band: the bar (when there is one) on top */
.tips-pair {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	overflow: hidden;
}

.tips-bar + .tips-pair {
	border-top: 0;
	border-top-left-radius: 0;
	border-top-right-radius: 0;
}

.tips-pair-one,
.tips-pair-stack {
	grid-template-columns: minmax(0, 1fr);
}

.tips-pane {
	display: grid;
	grid-template-rows: auto 1fr;
	gap: .5rem;
	min-width: 0;
	min-height: 190px;
	padding: .7rem .8rem .9rem;
}

.tips-pane + .tips-pane {
	border-left: 1px solid var(--border);
}

.tips-pair-stack .tips-pane {
	min-height: 0;
}

.tips-pair-stack .tips-pane + .tips-pane {
	border-left: 0;
	border-top: 1px solid var(--border);
}

.tips-pane figcaption {
	font: .66rem var(--font-mono);
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--text-muted);
}

.tips-pane-with figcaption {
	color: var(--accent);
}

.tips-stage {
	display: grid;
	place-items: center;
	min-width: 0;
}

.tips-stage-low {
	align-items: end;
	padding-top: 50px;
}

/* text-wrap */
.tips-headline {
	width: 300px;
	max-width: 100%;
	font-size: 1.3rem;
	font-weight: 700;
	line-height: 1.2;
}

.tips-pane-with .tips-headline {
	text-wrap: balance;
}

/* white-space */
.tips-typed {
	width: 100%;
	font: .82rem/1.55 var(--font-mono);
}

.tips-pane-with .tips-typed {
	white-space: pre;
}

/* contrast-color. The ink is only for the fallback below. */
.tips-swatches {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: .35rem;
	width: 100%;
}

.tips-swatch {
	display: grid;
	place-items: center;
	height: 58px;
	border-radius: 6px;
	font-weight: 700;
	color: #fff;
	background: var(--tips-swatch);
}

.tips-swatch-lime {
	--tips-swatch: #b8ff57;
	--tips-swatch-ink: #000;
}

.tips-swatch-navy {
	--tips-swatch: #1d3a8a;
	--tips-swatch-ink: #fff;
}

.tips-swatch-yellow {
	--tips-swatch: #ffd444;
	--tips-swatch-ink: #000;
}

.tips-swatch-wine {
	--tips-swatch: #7a1f3d;
	--tips-swatch-ink: #fff;
}

.tips-pane-with .tips-swatch {
	color: contrast-color(var(--tips-swatch));
}

/* Must stay after the rule above. That value holds a var(), so a browser without
   contrast-color() keeps the declaration and only finds it invalid at computed
   time, and the text then inherits the page color instead of falling back to
   the white above. Same specificity, later in the file, so this one wins there.
   First versions with it, from MDN's compatibility data: Chrome 147, Firefox 146,
   Safari 26. Older ones get this block. */
@supports not (color: contrast-color(#000)) {
	.tips-pane-with .tips-swatch {
		color: var(--tips-swatch-ink);
	}
}

/* centering */
.tips-frame {
	width: 100%;
	height: 124px;
	border: 1px dashed var(--border);
	border-radius: 8px;
}

.tips-frame-box {
	display: block;
	width: 58px;
	height: 58px;
	border-radius: 10px;
	background: var(--accent);
}

.tips-pane-with .tips-frame {
	display: grid;
	place-items: center;
}

/* grid */
.tips-wrap {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: .3rem;
	width: 100%;
}

.tips-pane-with .tips-wrap {
	grid-template-columns: repeat(auto-fit, minmax(62px, 1fr));
}

.tips-wrap-tile {
	display: grid;
	place-items: center;
	min-width: 0;
	height: 52px;
	overflow: hidden;
	border-radius: 6px;
	font: .72rem var(--font-mono);
	color: var(--bg);
	background: var(--accent);
}

/* animation */
.tips-ball {
	width: 46px;
	height: 46px;
	border-radius: 50%;
	background: var(--accent);
}

.tips-pane-with .tips-ball {
	animation: tips-bounce .6s ease-in-out infinite alternate;
}

@keyframes tips-bounce {
	to { transform: translateY(-46px) scale(1.15); }
}

/* caret-color */
.tips-input {
	width: 100%;
	padding: .6rem;
	border: 1px solid var(--border);
	border-radius: 8px;
	font-family: inherit;
	font-size: 1.15rem;
	color: var(--text);
	background: var(--surface);
}

.tips-pane-with .tips-input {
	caret-color: #ff6b6b;
}

/* cursor */
.tips-cursors {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: .35rem;
	width: 100%;
}

.tips-cursor {
	display: grid;
	place-items: center;
	min-width: 0;
	height: 58px;
	border: 1px solid var(--border);
	border-radius: 6px;
	font: .72rem var(--font-mono);
	text-align: center;
	background: var(--surface);
}

.tips-cursor:hover {
	border-color: var(--accent);
	color: var(--accent);
}

.tips-cursor-pointer { cursor: pointer; }
.tips-cursor-zoom-in { cursor: zoom-in; }
.tips-cursor-grab { cursor: grab; }
.tips-cursor-help { cursor: help; }
.tips-cursor-wait { cursor: wait; }
.tips-cursor-crosshair { cursor: crosshair; }
.tips-cursor-not-allowed { cursor: not-allowed; }
.tips-cursor-text { cursor: text; }

/* user-select */
.tips-select {
	font-size: .95rem;
	text-align: center;
}

.tips-pane-with .tips-select {
	-webkit-user-select: none;
	user-select: none;
}

/* resize. 1rem stops iOS zooming the page when the box takes focus, and the
   max-width stops a drag sliding this box over the other pane. */
.tips-area {
	width: 100%;
	max-width: 100%;
	height: 96px;
	padding: .5rem;
	border: 1px solid var(--border);
	border-radius: 8px;
	font-family: inherit;
	font-size: 1rem;
	color: var(--text);
	background: var(--surface);
}

.tips-pane-with .tips-area {
	resize: none;
}

/* focus-within */
.tips-field {
	display: grid;
	gap: .3rem;
	width: 100%;
	padding: .7rem;
	border: 2px solid var(--border);
	border-radius: 10px;
	font-size: .8rem;
	background: var(--surface);
	transition: border-color .15s, box-shadow .15s;
}

.tips-field input {
	min-width: 0;
	padding: .4rem;
	border: 1px solid var(--border);
	border-radius: 6px;
	font-family: inherit;
	font-size: 1rem;
	color: var(--text);
	background: var(--bg);
}

.tips-field input::placeholder {
	color: var(--text-muted);
	opacity: 1;
}

/* Mixed from the accent so the glow follows the theme. A browser without
   color-mix() still gets the border. */
.tips-pane-with .tips-field:focus-within {
	border-color: var(--accent);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}

/* scrollbar-gutter */
.tips-scroll {
	width: 100%;
	height: 118px;
	padding: .45rem;
	overflow-y: auto;
	border: 1px solid var(--border);
	border-radius: 8px;
	font-size: .8rem;
	background: var(--surface);
}

.tips-pane-with .tips-scroll {
	scrollbar-gutter: stable;
}

.tips-scroll-block {
	display: block;
	height: 26px;
	margin-bottom: .3rem;
	border-radius: 5px;
	background: var(--accent);
}

.tips-scroll-more {
	display: none;
}

.tips-toggle-input:checked ~ .tips-pair .tips-scroll-more {
	display: block;
}

/* Says what to do, in the accent, on every card that needs it. A tint rather than a
   solid fill, so the demo below stays the loudest thing on the card. */
.tips-bar {
	display: flex;
	gap: .5rem;
	align-items: center;
	padding: .55rem .85rem;
	font-size: .84rem;
	font-weight: 600;
	line-height: 1.25;
	color: var(--accent);
	background: var(--accent-dim);
	border: 1px solid var(--border);
	border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.tips-bar .fa-icon {
	width: 1rem;
	height: 1rem;
	color: inherit;
}

.tips-bar-note {
	flex: none;
	margin-left: auto;
	padding: .05rem .45rem;
	border: 1px solid currentColor;
	border-radius: 999px;
	font: .66rem var(--font-mono);
	white-space: nowrap;
}

/* The checkbox stays in the page, only unseen, so Tab still reaches it. */
.tips-card-scroll {
	position: relative;
}

.tips-toggle-input {
	position: absolute;
	opacity: 0;
}

/* The wider gap clears the dashed ring around the box. */
.tips-toggle {
	gap: .8rem;
	cursor: pointer;
}

.tips-toggle-box {
	flex: none;
	width: 16px;
	height: 16px;
	border: 2px solid currentColor;
	border-radius: 4px;
}

.tips-toggle-input:checked + .tips-toggle .tips-toggle-box {
	background: currentColor;
}

/* Inset, because the bar runs edge to edge in a card that clips its overflow. */
.tips-toggle-input:focus-visible + .tips-toggle {
	outline: 2px solid var(--accent);
	outline-offset: -4px;
}

/* Pulses on the thing to touch, until someone is using the card. */
.tips-target {
	outline: 2px dashed var(--accent);
	outline-offset: 3px;
	animation: tips-ring 1.6s ease-in-out infinite;
}

/* Leaves a focused target alone, or this would blank its focus outline. */
.tips-card:hover .tips-target:not(:focus-visible),
.tips-card:focus-within .tips-target:not(:focus-visible) {
	outline-color: transparent;
	animation: none;
}

@keyframes tips-ring {
	50% { outline-color: transparent; }
}

.tips-page input:focus-visible,
.tips-page textarea:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
	animation: none;
}

@media (prefers-reduced-motion: reduce) {
	.tips-pane-with .tips-ball,
	.tips-target {
		animation: none;
	}

	.tips-field {
		transition: none;
	}
}

/* From lg the demo sits on the left and the write-up on the right. Grid
   areas place them, so the markup (and the toggle that works through ~)
   stays as it is. */
@media (min-width: 992px) {
	.tips-card {
		grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
		grid-template-rows: minmax(0, 1fr);
		grid-template-areas: "pair body";
	}

	.tips-card-try {
		grid-template-rows: auto minmax(0, 1fr);
		grid-template-areas: "bar body" "pair body";
	}

	.tips-card {
		column-gap: clamp(2rem, 4vw, 4rem);
	}

	.tips-card > .tips-bar {
		grid-area: bar;
	}

	.tips-card > .tips-pair {
		grid-area: pair;
	}

	.tips-card-body {
		grid-area: body;
		align-content: center;
		padding: 0;
	}

	.tips-pane {
		min-height: 240px;
	}
}

/* ── The light theme's accent is the brand violet ─────────────────────── */

/* Lime fails as text on paper, so the light theme needs a darker accent.
   Since 2026-11-14 the whole site uses the brand violet there; this page set it first
   (owner's pick from mockups/light-accent/, 2026-11-11), 6.9:1 on paper.
   The charcoal bands below keep lime. */
body:has(#theme-toggle:checked) .tips-page {
	--accent: #6f2fd6;
	--accent-dim: rgba(111, 47, 214, 0.08);
}

/* ── Bands take turns within the theme ─────────────────────────────────── */

/* The same pairs as the home page's fields (home.css): in the light theme
   paper and charcoal take turns, in the dark theme charcoal and a second,
   lighter dark. So the switch changes the theme, rather than trading the
   two band colors (owner, 2026-11-11). The page opens dark (body.ink-first)
   and the checked switch makes it light.

   Dark theme: the odd bands are the second dark. Only the grounds and the
   muted text move; the rest of the dark token set already applies. */
body:not(:has(#theme-toggle:checked)) .tips-card:nth-child(odd) {
	--bg: #1f1f22;
	--surface: #29292d;
	--surface-2: #333338;
	--border: #44444a;
	--text-muted: #a2a2aa;
}

/* Light theme: the even bands are charcoal, home's light-theme ink, with the
   whole dark token set so the demo, text and form controls match. */
body:has(#theme-toggle:checked) .tips-card:nth-child(even) {
	--bg: #1f1f22;
	--surface: #29292d;
	--surface-2: #333338;
	--border: #44444a;
	--text: #f0f0f0;
	--text-muted: #a2a2aa;
	--accent: #b8ff57;
	--accent-dim: rgba(184, 255, 87, 0.1);
	--coral: #ff6b6b;
	--coral-dim: rgba(255, 107, 107, 0.12);
	--orange: #ff9040;
	--orange-dim: rgba(255, 144, 64, 0.12);
	--yellow: #ffd444;
	--yellow-dim: rgba(255, 212, 68, 0.12);
	--teal: #57d9a3;
	--teal-dim: rgba(87, 217, 163, 0.12);
	--sky: #38bdf8;
	--sky-dim: rgba(56, 189, 248, 0.12);
	--violet: #c084fc;
	--accent-in-palette: #b8ff57;
	--accent-beside-violets: #b8ff57;
	--violet-dim: rgba(192, 132, 252, 0.12);
	--rose: #f472b6;
	--rose-dim: rgba(244, 114, 182, 0.12);
	color-scheme: dark;
}
