/* ═══════════════════════════════════════════════════════════
   WEIRDLY PERFECT THEME
   Activate: add data-style="weirdly" to <html>.

   Modern SaaS product UI, after Kole Jain's "Weirdly Perfect UI"
   component set (kolejain.com/resources, Aug 2026): a task list
   sitting in a grey tray, an expense-report bar chart, an
   iOS-style segmented picker, a profile card, and the CRM
   dashboard that assembles them.

   What it takes from that set:
   - Neutral chrome, colour in the data. The page is a flat
     #f2f2f2 grey, surfaces are pure white on a #e5e5e5
     hairline, and almost every control is ink-on-white. Colour
     shows up in tags, charts and the one blue that means "on".
   - Ink is the primary. Filled buttons, tooltips and the
     inverted card footer use near-black (#1c1c1c), not the
     accent. The accent (#0048d8, sampled from the switch) stays
     for state: checked, on, focused, progress.
   - Concentric corners. 16px cards, 12px trays and menus, 8px
     controls, 6px tags, so a radius always nests inside its
     parent's radius minus the padding. Buttons are rounded
     rectangles, never pills.
   - The tray. A card's footer bands sit in a grey tray, and the
     white card above curves into it with its own rounded bottom
     edge (the task list's "Run shortcut" bar). This is drawn
     with a pseudo-element, so the markup stays plain
     .card-sub-foot / .card-foot.
   - Soft, layered shadows at low opacity, tinted tags with no
     keyline, Inter for the interface and Plus Jakarta Sans for
     headings and figures.

   Fonts: Inter (400/500/600) and Plus Jakarta Sans (500/600/700).
   ═══════════════════════════════════════════════════════════ */

/* ── Weirdly light ── */
html[data-style='weirdly'] {
	/* ── Palette ── sampled from the source frames: the bar chart's
	   blue / violet / sky, the saved-view dots (emerald, amber,
	   red, pink) and the sales line chart's rust. ── */
	--p-accent-1: #3458f6;
	--p-accent-2: #7c50f4;
	--p-accent-3: #2bb3f5;
	--p-accent-4: #0cb981;
	--p-accent-5: #f59e0b;
	--p-accent-6: #f1394a;
	--p-accent-7: #ec4899;
	--p-accent-8: #be614c;
	--p-info: #3786ff;
	--p-success: #0cb981;
	--p-warn: #f59e0b;
	--p-danger: #f1394a;
	/* White ink on the solid fills, like the switch's white thumb on
	   blue, so the fill is pinned DARK (see the --fill-l block in
	   base.css). Same direction as minimal/bold/win95. */
	--p-on-accent: #ffffff;
	--fill-l: 0.5;
	--fill-toward: #000000;

	/* ── Type ── product UI, not a marketing page: a modest top
	   step, tight display tracking, body leading that suits dense
	   lists rather than long prose. ── */
	--t-h1: clamp(2rem, 1.55rem + 2vw, 2.75rem);
	--t-h2: clamp(1.375rem, 1.2rem + 0.8vw, 1.75rem);
	--t-h3: 1.125rem;
	--t-body: 0.9375rem;
	--t-lh-display: 1.1;
	--t-lh-heading: 1.25;
	--t-lh-body: 1.55;
	--t-track-display: -0.03em;
	--t-track-heading: -0.015em;

	/* ── Radius ── concentric steps. The segmented track is --r-md
	   with a 3px inset, so the --r-sm segment inside it lands
	   almost exactly on 12 − 3. ── */
	--r-xs: 0.375rem;
	--r-sm: 0.5rem;
	--r-md: 0.75rem;
	--r-lg: 1rem;

	/* ── Elevation ── two layers each: a 1px contact shadow that
	   defines the edge, plus a wide low-opacity blur for lift. ── */
	--e-control: 0 1px 2px rgba(0, 0, 0, 0.06);
	--e-input: 0 1px 2px rgba(0, 0, 0, 0.05);
	--e-raised: 0 1px 2px rgba(0, 0, 0, 0.06), 0 6px 16px -4px rgba(0, 0, 0, 0.12);
	--e-surface: 0 1px 2px rgba(0, 0, 0, 0.04), 0 12px 32px -8px rgba(0, 0, 0, 0.14);
	--e-accent: var(--e-surface);

	/* A 1px accent line hugging the control, plus a soft halo. The
	   line is what makes it a visible indicator (it measures over 7:1
	   on white); the halo is the softness. Declared once: it is
	   --c-accent-derived, so it re-resolves under the dark accent. */
	--e-focus:
		0 0 0 1px var(--c-accent),
		0 0 0 4px color-mix(in srgb, var(--c-accent) 22%, transparent);

	/* Resting material shadow, theme-private. It is not elevation,
	   so it is not an --e-* role: it is the thin edge under the white
	   pill in the segmented track and under the curved lip of a card
	   above its tray. Both are shape, not hover feedback. */
	--wp-lift: 0 1px 2px rgba(0, 0, 0, 0.07), 0 1px 1px rgba(0, 0, 0, 0.03);

	--bw-hair: 1px;
	--bw-base: 1px;
	--bw-thick: 2px;
	--bw-edge: 2px;

	/* ── Motion ── fast and decisive: a strong ease-out, nothing
	   lingers. */
	--dur-fast: 0.12s;
	--dur-base: 0.2s;
	--dur-slow: 0.5s;
	--ease-out: cubic-bezier(0.23, 1, 0.32, 1);
	--ease-standard: cubic-bezier(0.4, 0, 0.2, 1);

	/* ── Surfaces & text ── */
	--c-bg: #f2f2f2;
	--c-surface: #ffffff;
	--c-border: #e5e5e5;
	/* Darker than the source's #e0e0e0 control edges. WCAG SC 1.4.11
	   wants 3:1 for a boundary that identifies a control, and this
	   has to clear it on the page, on a card and on the #eeeeee tray. */
	--c-control-border: #878787;
	/* The source's #737373 clears 4.5:1 on white but not on the
	   #f2f2f2 page, and the page is the binding constraint. */
	--c-muted: #6b6b6b;
	--c-text: #1c1c1c;
	--c-text-sub: #5c5c5c;
	--c-dot: #e2e2e2;
	--c-nav-bg: rgba(242, 242, 242, 0.85);
	--c-accent: #0048d8;
	--c-accent-2: #7c50f4;
	--c-accent-3: #2bb3f5;
	--c-on-accent: #ffffff;
	--c-grad-h1-from: var(--c-text);
	--c-grad-h1-mid: var(--c-text);
	--c-grad-h1-to: var(--c-accent);

	/* ── Theme-private surfaces ──
	   --wp-tray     the grey well: segmented track, chips
	   --wp-pill     what sits raised inside a tray (the pressed segment)
	   --wp-inverse  the ink fill: primary button, tooltip, card footer
	   --wp-thumb    an unchecked switch's thumb
	   --wp-lip      height and radius of the card's curve into its tray */
	--wp-tray: #eeeeee;
	--wp-pill: #ffffff;
	--wp-inverse: #1c1c1c;
	--wp-on-inverse: #ffffff;
	--wp-thumb: #ffffff;
	--wp-lip: var(--r-md);

	/* The colour a card's label, subtitle and link icon ink from when
	   no .accent-N says otherwise. Set here on <html> so it INHERITS:
	   an .accent-N class on the card itself still sets --card-color
	   on the card and wins. "SAVED VIEWS" and "SEGMENTS" in the
	   source are grey, not blue. */
	--card-color: var(--c-muted);
}

/* ── Weirdly dark ──
   The source frames are light only. Dark keeps the same structure:
   a near-black page, surfaces one step up, the tray one step up again,
   and the ink fill inverted to near-white. */
html[data-style='weirdly'][data-theme='dark'] {
	--c-bg: #111111;
	--c-surface: #1a1a1a;
	--c-border: #2b2b2b;
	--c-control-border: #6e6e6e;
	--c-muted: #8f8f8f;
	--c-text: #ededed;
	--c-text-sub: #a3a3a3;
	--c-dot: #242424;
	--c-nav-bg: rgba(17, 17, 17, 0.85);
	/* Lifted from #0048d8, which sinks into a dark surface (under 2:1).
	   White still clears AA on it, so --c-on-accent stays white. */
	--c-accent: #2563eb;
	--c-accent-2: #9171f8;
	--c-accent-3: #48c0fc;
	--c-on-accent: #ffffff;
	--c-grad-h1-from: var(--c-text);
	--c-grad-h1-mid: var(--c-text);
	--c-grad-h1-to: var(--c-accent);

	--wp-tray: #242424;
	--wp-pill: #363636;
	--wp-inverse: #ededed;
	--wp-on-inverse: #111111;
	--wp-thumb: #a3a3a3;

	/* Restated, not inherited: base.css's own dark --e-surface has
	   the same specificity as the light block above and loads later,
	   so it would otherwise win in dark mode. */
	--e-control: 0 1px 2px rgba(0, 0, 0, 0.4);
	--e-input: 0 1px 2px rgba(0, 0, 0, 0.4);
	--e-raised: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 20px -4px rgba(0, 0, 0, 0.55);
	--e-surface: 0 1px 2px rgba(0, 0, 0, 0.3), 0 16px 40px -8px rgba(0, 0, 0, 0.6);
	--e-accent: var(--e-surface);
	--wp-lift: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* ── Weirdly dark (system preference) ── */
@media (prefers-color-scheme: dark) {
	html[data-style='weirdly']:not([data-theme]) {
		--c-bg: #111111;
		--c-surface: #1a1a1a;
		--c-border: #2b2b2b;
		--c-control-border: #6e6e6e;
		--c-muted: #8f8f8f;
		--c-text: #ededed;
		--c-text-sub: #a3a3a3;
		--c-dot: #242424;
		--c-nav-bg: rgba(17, 17, 17, 0.85);
		--c-accent: #2563eb;
		--c-accent-2: #9171f8;
		--c-accent-3: #48c0fc;
		--c-on-accent: #ffffff;
		--c-grad-h1-from: var(--c-text);
		--c-grad-h1-mid: var(--c-text);
		--c-grad-h1-to: var(--c-accent);

		--wp-tray: #242424;
		--wp-pill: #363636;
		--wp-inverse: #ededed;
		--wp-on-inverse: #111111;
		--wp-thumb: #a3a3a3;

		--e-control: 0 1px 2px rgba(0, 0, 0, 0.4);
		--e-input: 0 1px 2px rgba(0, 0, 0, 0.4);
		--e-raised: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 20px -4px rgba(0, 0, 0, 0.55);
		--e-surface: 0 1px 2px rgba(0, 0, 0, 0.3), 0 16px 40px -8px rgba(0, 0, 0, 0.6);
		--e-accent: var(--e-surface);
		--wp-lift: 0 1px 2px rgba(0, 0, 0, 0.5);
	}
}

/* ══════════════════════════════════════════════════════════
   WEIRDLY PERFECT STYLE OVERRIDES
   Applied to html[data-style='weirdly']
   ══════════════════════════════════════════════════════════ */

/* ── Type: Inter for the interface, Plus Jakarta Sans for headings
   and figures (the profile card's name and stat values). ── */
html[data-style='weirdly'] body {
	font-family: 'Inter', system-ui, sans-serif;
}

html[data-style='weirdly'] h1,
html[data-style='weirdly'] h2,
html[data-style='weirdly'] h3,
html[data-style='weirdly'] h4,
html[data-style='weirdly'] h5,
html[data-style='weirdly'] h6,
html[data-style='weirdly'] .gradient-text,
html[data-style='weirdly'] .page-title,
html[data-style='weirdly'] .figure,
html[data-style='weirdly'] .card-foot-value,
html[data-style='weirdly'] .quote-mark {
	font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
	font-weight: 600;
}

/* "SAVED VIEWS": small caps label, light tracking, grey. The colour
   goes through :where() so it stays below base's `.card .section-label`,
   which inks a card's label from --card-color (grey here by default
   too, see the token block, but still re-tintable with .accent-N). */
html[data-style='weirdly'] .section-label {
	letter-spacing: 0.06em;
	font-weight: 500;
}
html[data-style='weirdly'] :where(.section-label) {
	color: var(--c-muted);
}

/* ── Buttons: rounded rectangles, not pills ──
   One border width for all three so a filled and an outlined button
   standing side by side are the same height, and a line-height that
   matches .input so a button next to a field lines up. ── */
html[data-style='weirdly'] .btn-primary,
html[data-style='weirdly'] .btn-danger,
html[data-style='weirdly'] .btn-outlined {
	padding: 0.5rem 0.875rem;
	border-width: var(--bw-base);
	border-radius: var(--r-sm);
	letter-spacing: normal;
	line-height: 1.4;
}
html[data-style='weirdly'] .btn-sm {
	padding: 0.3125rem 0.625rem;
}

/* Primary is ink, not accent. */
html[data-style='weirdly'] .btn-primary {
	background: var(--wp-inverse);
	color: var(--wp-on-inverse);
}

/* Outlined sits on white even on the grey page, like "Profile" and
   "Send offer". Hover tints the face and firms the edge rather than
   turning the label blue. */
html[data-style='weirdly'] .btn-outlined {
	background: var(--c-surface);
	transition:
		background-color var(--dur-base) var(--ease-standard),
		border-color var(--dur-base) var(--ease-standard),
		color var(--dur-base) var(--ease-standard),
		transform var(--dur-fast) var(--ease-out),
		box-shadow var(--dur-base) var(--ease-standard);
}
html[data-style='weirdly'] .btn-outlined:hover {
	border-color: var(--c-text-sub);
	background: color-mix(in srgb, var(--c-text) 4%, var(--c-surface));
	color: var(--c-text);
}

html[data-style='weirdly'] .btn-ghost:hover {
	color: var(--c-text);
}

html[data-style='weirdly'] .btn-icon,
html[data-style='weirdly'] .theme-toggle {
	transition:
		background-color var(--dur-base) var(--ease-standard),
		border-color var(--dur-base) var(--ease-standard),
		color var(--dur-base) var(--ease-standard),
		transform var(--dur-fast) var(--ease-out);
}
html[data-style='weirdly'] .btn-icon:hover,
html[data-style='weirdly'] .theme-toggle:hover {
	border-color: var(--c-control-border);
	background: color-mix(in srgb, var(--c-text) 4%, var(--c-surface));
	color: var(--c-text);
}

/* Focus: base draws --e-focus on its form controls, tabs and segments,
   but leaves buttons to the browser's own outline, which follows the OS
   accent colour (orange, graphite…) rather than this theme's blue. The
   kit's three-part recipe brings buttons in line with everything else. */
html[data-style='weirdly'] .btn-primary:focus-visible,
html[data-style='weirdly'] .btn-danger:focus-visible,
html[data-style='weirdly'] .btn-outlined:focus-visible,
html[data-style='weirdly'] .btn-ghost:focus-visible,
html[data-style='weirdly'] .btn-icon:focus-visible,
html[data-style='weirdly'] .theme-toggle:focus-visible {
	outline: var(--o-focus);
	outline-offset: var(--o-focus-offset);
	box-shadow: var(--e-focus);
}

/* Press feedback: a slight scale-down while held. Motion-gated: under
   reduced motion, :active simply does nothing. */
@media (prefers-reduced-motion: no-preference) {
	html[data-style='weirdly'] .btn-primary:active,
	html[data-style='weirdly'] .btn-danger:active,
	html[data-style='weirdly'] .btn-outlined:active,
	html[data-style='weirdly'] .btn-icon:active {
		transform: scale(0.97);
	}
}

/* ── Cards: they stay put on hover ──
   No translate. The soft --e-surface shadow is the only hover
   feedback. */
html[data-style='weirdly'] .card:hover,
html[data-style='weirdly'] .link-card:hover {
	transform: none;
	box-shadow: var(--e-surface);
}
html[data-style='weirdly'] .card-static:hover,
html[data-style='weirdly'] .link-card-static:hover {
	transform: none;
	box-shadow: none;
}

/* ── The tray ──
   The card's footer bands become a grey well, and the white card
   curves into it. Three parts:

   1. The band. --card-band-bg is the kit's own hook for the band fill.
      It stays translucent (text-over-transparent, like base) so a tinted
      card's band darkens that tint instead of covering it in neutral
      grey.
   2. An upward copy of the band, as a box-shadow offset by the lip
      height. An outer shadow is clipped to outside the border box, so
      only the part ABOVE the band paints: a strip of tray behind where
      the lip goes.
   3. The lip: a ::before with the card's own surface, a hairline and
      rounded bottom corners, sitting on that strip. Its sides overlap
      the card's border by exactly --bw-base, so the hairline peels
      inward from the card's edge. That reads as a white card resting in
      a grey tray, from plain .card-sub-foot / .card-foot markup.

   The lip lives in the card's own gap above the band, so it never
   covers content as long as --wp-lip (12px) is no taller than
   --card-gap (16px). ── */
html[data-style='weirdly'] .card {
	--card-band-bg: color-mix(in srgb, var(--c-text) 6.5%, transparent);
}

html[data-style='weirdly'] .card-sub-foot,
html[data-style='weirdly'] .card-foot-quiet {
	position: relative;
	border-top: none;
	box-shadow: 0 calc(-1 * var(--wp-lip)) 0 0 var(--card-band-bg);
}

/* The figure the card adds up to: ink, like the tooltip and the
   primary button, rather than base's accent. */
html[data-style='weirdly'] .card-foot {
	position: relative;
	background: var(--wp-inverse);
	color: var(--wp-on-inverse);
	box-shadow: 0 calc(-1 * var(--wp-lip)) 0 0 var(--wp-inverse);
}
/* Restated after .card-foot, which it also matches: the `background`
   shorthand above would otherwise wipe the band's gradient layer. */
html[data-style='weirdly'] .card-foot-quiet {
	background: none;
	background-image: linear-gradient(var(--card-band-bg), var(--card-band-bg));
	color: var(--c-text);
	box-shadow: 0 calc(-1 * var(--wp-lip)) 0 0 var(--card-band-bg);
}

html[data-style='weirdly'] .card-sub-foot::before,
html[data-style='weirdly'] .card-foot::before {
	content: '';
	position: absolute;
	right: calc(-1 * var(--bw-base));
	bottom: 100%;
	left: calc(-1 * var(--bw-base));
	box-sizing: border-box;
	height: var(--wp-lip);
	border: var(--bw-hair) solid var(--c-border);
	border-top: none;
	border-radius: 0 0 var(--wp-lip) var(--wp-lip);
	background: var(--c-surface);
	box-shadow: var(--wp-lift);
	pointer-events: none;
}

/* Docked under a sub-footer, the footer is the same tray continuing,
   not a second card edge: no lip, no upward strip, a hairline between. */
html[data-style='weirdly'] .card-sub-foot + .card-foot {
	border-top: var(--bw-hair) solid var(--c-border);
	box-shadow: none;
}
html[data-style='weirdly'] .card-sub-foot + .card-foot::before {
	content: none;
}

/* A danger card's surface is tinted and its border is --bw-thick, so a
   white lip at --bw-base would be the wrong colour and the wrong width.
   Its bands fall back to a plain hairline-topped band. */
html[data-style='weirdly'] .card-danger .card-sub-foot,
html[data-style='weirdly'] .card-danger .card-foot {
	border-top: var(--bw-hair) solid var(--c-border);
	box-shadow: none;
}
html[data-style='weirdly'] .card-danger .card-sub-foot::before,
html[data-style='weirdly'] .card-danger .card-foot::before {
	content: none;
}

/* ── Tags: tinted, no keyline ──
   The source's FINANCE / VC / PAYROLL chips are a soft fill with
   coloured caps, and no visible border. The border is made transparent
   rather than removed, so the box keeps its size and the fill paints
   under it (background-clip is border-box). .tag-strong is covered
   too, and its solid fill shows through the same way. A bare .tag
   keeps its hairline: with no tint, that line is its only shape. */
html[data-style='weirdly'] .tag {
	padding: 0.125rem 0.4375rem;
	border-radius: var(--r-xs);
	font-weight: 600;
	letter-spacing: 0.04em;
}
html[data-style='weirdly'] .tag[class*='tag-accent-'],
html[data-style='weirdly'] .tag-success,
html[data-style='weirdly'] .tag-warn,
html[data-style='weirdly'] .tag-danger,
html[data-style='weirdly'] .tag-info {
	border-color: transparent;
}

/* "in 2 days": a grey well instead of a hairline pill. */
html[data-style='weirdly'] .chip {
	border-color: transparent;
	background: var(--wp-tray);
}

/* ── Segmented control: iOS-style ──
   A grey track, with the pressed segment as a raised white pill
   carrying ink, not an accent fill. This is the Custom / Safe /
   Standard / Full picker from the source. The pill's ring is drawn
   as a shadow so it costs no layout. */
html[data-style='weirdly'] .segmented {
	gap: 0.125rem;
	padding: 0.1875rem;
	border-color: transparent;
	background: var(--wp-tray);
}
html[data-style='weirdly'] .segment {
	padding: 0.375rem 0.75rem;
	border-radius: var(--r-sm);
	transition:
		background var(--dur-base) var(--ease-standard),
		box-shadow var(--dur-base) var(--ease-standard),
		color var(--dur-base) var(--ease-standard);
}
html[data-style='weirdly'] .segmented .segment[aria-pressed='true'] {
	background: var(--wp-pill);
	color: var(--c-text);
	font-weight: 600;
	box-shadow:
		0 0 0 var(--bw-hair) var(--c-border),
		var(--wp-lift);
}
/* The pill's resting shadow outranks base's focus rule, so focus is
   restated or a focused pressed segment shows no ring. */
html[data-style='weirdly'] .segmented .segment[aria-pressed='true']:focus-visible {
	box-shadow: var(--e-focus);
}

/* ── Switch: a white thumb on the blue track, like the source ──
   Base paints the thumb --c-surface, which is right on a light track and
   wrong in dark mode, where it becomes a dark disc on a dark track (off)
   and on the blue (on). Off takes --wp-thumb (white / mid-grey). On takes
   --c-on-accent, the ink already verified against the accent fill. */
html[data-style='weirdly'] .switch::before {
	background: var(--wp-thumb);
}
html[data-style='weirdly'] .switch:checked::before {
	background: var(--c-on-accent);
}

/* ── Inputs: matched to the button height ── */
html[data-style='weirdly'] .input {
	padding: 0.5rem 0.75rem;
}
html[data-style='weirdly'] .select {
	padding: 0.5rem 2.25rem 0.5rem 0.75rem;
	line-height: 1.4;
}

/* ── Tabs ──
   Horizontal: an ink underline, not an accent one (the accent is kept
   for state). Vertical, the CRM sidebar: rounded rows inset from the
   rail. The active one gets a grey fill and drops the edge marker.
   Fill, weight and ink together carry the state. */
html[data-style='weirdly'] .tab-active::after {
	background: var(--c-text);
}
html[data-style='weirdly'] .tabs-vertical {
	gap: 0.125rem;
}
/* Inset on both sides, not just the rail side: in an icon-only rail
   the icon is centred in the row, so a one-sided margin pushes the pill
   off-centre beneath it. */
html[data-style='weirdly'] .tabs-vertical .tab {
	margin-inline: var(--sp-2);
	padding: 0.4375rem var(--sp-3);
	border-radius: var(--r-sm);
}
html[data-style='weirdly'] .tabs-vertical .tab:hover {
	background: color-mix(in srgb, var(--c-text) 4%, transparent);
}
html[data-style='weirdly'] .tabs-vertical .tab-active,
html[data-style='weirdly'] .tabs-vertical .tab-active:hover {
	background: color-mix(in srgb, var(--c-text) 7%, transparent);
}
html[data-style='weirdly'] .tabs-vertical .tab-active::after {
	background: transparent;
}

/* ── Tooltip: the dark chip from the expense chart ──
   The short label only. :not(.tooltip-rich *) leaves the rich variant
   as base's light surface with full-ink emphasis. An ink fill there
   would put its <b> on the same ink, and a paragraph in a black box is
   the "wall of colour" base's note warns about. */
html[data-style='weirdly'] .tooltip-bubble:not(.tooltip-rich *) {
	padding: 0.3125rem 0.625rem;
	background: var(--wp-inverse);
	color: var(--wp-on-inverse);
}
