/*
 * Cinnabar
 * The SpiritWeb Dash platform palette. Ruled by the owner on 2 November 2026,
 * replacing First Light's palette (locked 18 July 2026; design/first-light.css
 * is kept for history and is superseded by this file).
 *
 * Canonical token source for every platform surface: the account home
 * (dash.spiritweb.page), Dash's Authentik flows on auth.spiritual.cloud, the
 * public landing on spiritweb.page and any operator console. Client templates
 * never import this file; client sites carry their own looks.
 *
 * The look, as approved on the rendered "Your sites" screen (v5):
 * - Two grounds only: Parchment (light) and Void (dark). No beige.
 * - One button colour in both modes: Cinnabar, with white text.
 * - The signature spectrum line under the header, in both modes.
 * - House fonts: Cormorant Garamond italic for display, Plus Jakarta Sans for
 *   everything else. Self-hosted woff2 only; never a device fallback in use.
 * - Buttons 8px radius, cards 12px radius, hairline borders.
 * - Errors are ink text with a warning icon and a hairline frame, never red,
 *   so they cannot be confused with Cinnabar buttons. Destructive actions are
 *   outline buttons, never solid Cinnabar.
 *
 * Banked for reference, not in use: Patina #1E7470.
 *
 * Measured contrast (WCAG 2): white on Cinnabar 5.92:1; ink on Parchment
 * 17.64:1; muted on Parchment 5.72:1; muted on the dark surface 7.16:1;
 * Cinnabar against Void 3.26:1 (non-text). The dark accent is for marks and
 * underlines only (4.39:1 on the dark surface), never for small text.
 */

:root {
  /* Grounds and surfaces, light */
  --swd-ground: #FAFAF7;          /* Parchment (vf.brand.parchment) */
  --swd-surface: #FFFFFF;         /* cards, header, panels */
  --swd-hairline: #E6E5E0;        /* borders, dividers, empty meter */
  --swd-wash: #F3F3F0;            /* quiet fills: tiles being built */

  /* Ink, light */
  --swd-ink: #141412;             /* primary text and display */
  --swd-ink-soft: #45423C;        /* secondary text */
  --swd-muted: #67635B;           /* captions, addresses, hints */

  /* The one colour */
  --swd-cinnabar: #B33A26;        /* buttons in both modes, white text */
  --swd-cinnabar-hover: #9C3020;  /* hover and active */
  --swd-on-cinnabar: #FFFFFF;
  --swd-accent: #B33A26;          /* meter, status dots, link underlines */

  /* Signature */
  --swd-spectrum: linear-gradient(90deg, #FF1500, #FF5500, #FFD000, #A7FF00, #0896F2, #9000FF, #FF008B);
  --swd-spectrum-height: 3px;

  /* Focus ring: ink ring outside a surface gap, visible on both grounds */
  --swd-focus-ring: 0 0 0 2px var(--swd-surface), 0 0 0 4px var(--swd-ink);

  /* Errors: ink text, warning icon, hairline frame (never red) */
  --swd-error-text: var(--swd-ink);
  --swd-error-frame: var(--swd-ink-soft);

  /* Type */
  --swd-font-display: "Cormorant Garamond", serif;   /* italic 500 to 600 */
  --swd-font-ui: "Plus Jakarta Sans", sans-serif;    /* 400 to 600 */
  --swd-display-style: italic;
  --swd-weight-display: 500;
  --swd-weight-display-strong: 600;
  --swd-weight-body: 400;
  --swd-weight-medium: 500;
  --swd-weight-semibold: 600;

  /* Shape */
  --swd-radius-button: 8px;
  --swd-radius-card: 12px;

  /* Semantic aliases: components style against these */
  --swd-color-bg: var(--swd-ground);
  --swd-color-surface: var(--swd-surface);
  --swd-color-border: var(--swd-hairline);
  --swd-color-text: var(--swd-ink);
  --swd-color-text-secondary: var(--swd-ink-soft);
  --swd-color-text-muted: var(--swd-muted);
  --swd-color-cta: var(--swd-cinnabar);
  --swd-color-cta-hover: var(--swd-cinnabar-hover);
  --swd-color-cta-text: var(--swd-on-cinnabar);
  --swd-color-accent: var(--swd-accent);
  --swd-color-link: var(--swd-ink);
  --swd-color-link-underline: var(--swd-accent);
}

/* Dark: Void. Applied by the system setting unless the page forces light. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --swd-ground: #0D0D1A;        /* Void (vf.brand.void) */
    --swd-surface: #15152A;
    --swd-hairline: #26263F;
    --swd-wash: #1B1B33;
    --swd-ink: #ECEAF2;
    --swd-ink-soft: #C9C7D6;
    --swd-muted: #A3A2B5;
    --swd-accent: #D0583F;        /* marks and underlines only */
  }
}

:root[data-theme="dark"] {
  --swd-ground: #0D0D1A;
  --swd-surface: #15152A;
  --swd-hairline: #26263F;
  --swd-wash: #1B1B33;
  --swd-ink: #ECEAF2;
  --swd-ink-soft: #C9C7D6;
  --swd-muted: #A3A2B5;
  --swd-accent: #D0583F;
}

/* The spectrum line drifts slowly (vf-flow), and stands still, whole, for
 * anyone who has asked for reduced motion. */
@keyframes swd-spectrum-flow {
  from { background-position: 0 0; }
  to { background-position: 200% 0; }
}

/*
 * The account home's components (Cinnabar, ruled 2 November 2026).
 * The built stylesheet is design/cinnabar.css, unchanged, followed by this
 * file (scripts/build-assets.mjs). Every colour, radius, font and the focus
 * ring are Cinnabar's custom properties; no value is copied by hand here.
 * Fonts are self-hosted (D-30); the font URLs below are rewritten to their
 * hashed names at build.
 */

@font-face {
	font-family: "Cormorant Garamond";
	font-style: italic;
	font-weight: 500;
	font-display: block;
	src: url("fonts/cormorant-garamond-latin-500-italic.4fb55a7a6d.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: "Cormorant Garamond";
	font-style: italic;
	font-weight: 600;
	font-display: block;
	src: url("fonts/cormorant-garamond-latin-600-italic.0b6719b252.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: "Plus Jakarta Sans";
	font-style: normal;
	font-weight: 400;
	font-display: block;
	src: url("fonts/plus-jakarta-sans-latin-400-normal.221a4135d0.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: "Plus Jakarta Sans";
	font-style: normal;
	font-weight: 500;
	font-display: block;
	src: url("fonts/plus-jakarta-sans-latin-500-normal.bad081c8db.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: "Plus Jakarta Sans";
	font-style: normal;
	font-weight: 600;
	font-display: block;
	src: url("fonts/plus-jakarta-sans-latin-600-normal.8872bb5c91.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	background: var(--swd-color-bg);
	color: var(--swd-color-text);
	font-family: var(--swd-font-ui);
	font-weight: var(--swd-weight-body);
	line-height: 1.55;
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

body {
	margin: 0;
	min-height: 100vh;
}

a {
	color: inherit;
}

/* Focus: Cinnabar's ring, drawn as a shadow. No ancestor of a focusable
 * control clips (only the preview tile hides overflow, and it holds none). */
:focus {
	outline: none;
}
:focus-visible {
	outline: none;
	box-shadow: var(--swd-focus-ring);
}

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

/* --- Header: a surface bar, the wordmark, the member, then the spectrum --- */

.bar {
	background: var(--swd-surface);
	border-bottom: 1px solid var(--swd-hairline);
}

.bar-inner {
	max-width: 1040px;
	margin: 0 auto;
	padding: 14px 20px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 10px 16px;
}

.wordmark {
	font-family: var(--swd-font-display);
	font-style: var(--swd-display-style);
	font-weight: var(--swd-weight-display);
	font-size: 1.75rem;
	line-height: 1;
	color: var(--swd-ink);
	text-decoration: none;
	border-radius: 4px;
	padding: 2px 0;
}

/* "SpiritWeb" is one word; the t-W pair is tightened (owner, 2 November). */
.wordmark b {
	font-weight: var(--swd-weight-display-strong);
	margin-left: -0.09em;
}

.who {
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 0;
}

.who-email {
	color: var(--swd-ink-soft);
	font-size: 0.9375rem;
	overflow-wrap: anywhere;
}

/* The signature line: 3px, drifting slowly; still and whole under reduced motion. */
.spectrum {
	height: var(--swd-spectrum-height);
	width: 100%;
	background-image: var(--swd-spectrum);
	background-size: 200% 100%;
	background-repeat: repeat-x;
	animation: swd-spectrum-flow 20s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
	.spectrum {
		animation: none;
		width: 100%;
		background-size: 100% 100%;
		background-position: 0 0;
	}
}

/* --- Layout --- */

.main {
	max-width: 1040px;
	margin: 0 auto;
	padding: 32px 20px 72px;
}

.display {
	font-family: var(--swd-font-display);
	font-style: var(--swd-display-style);
	font-weight: var(--swd-weight-display-strong);
	font-size: 3rem;
	line-height: 1.05;
	margin: 4px 0 24px;
}

.display-small {
	font-size: 2rem;
	line-height: 1.15;
}

@media (max-width: 600px) {
	.display {
		font-size: 2.375rem;
	}
	.display-small {
		font-size: 1.75rem;
	}
}

.card {
	background: var(--swd-surface);
	border: 1px solid var(--swd-hairline);
	border-radius: var(--swd-radius-card);
	padding: 24px;
}

.narrow {
	max-width: 560px;
	margin: 40px auto;
}

.lede {
	color: var(--swd-ink-soft);
	margin: 0 0 20px;
}

.back {
	margin: 0 0 4px;
}

.back a,
.link {
	color: var(--swd-color-link);
	font-weight: var(--swd-weight-medium);
	text-decoration: underline;
	text-decoration-color: var(--swd-color-link-underline);
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
	border-radius: 2px;
}

.link-quiet {
	color: var(--swd-color-text-muted);
	font-weight: var(--swd-weight-body);
	text-decoration-color: var(--swd-hairline);
}

/* --- Buttons: 8px, Cinnabar the only filled colour --- */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 10px 18px;
	border: 1px solid transparent;
	border-radius: var(--swd-radius-button);
	font-family: var(--swd-font-ui);
	font-size: 1rem;
	font-weight: var(--swd-weight-semibold);
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
}

.btn-primary {
	background: var(--swd-color-cta);
	color: var(--swd-color-cta-text);
}

.btn-primary:hover,
.btn-primary:active {
	background: var(--swd-color-cta-hover);
}

.btn-quiet {
	background: transparent;
	color: var(--swd-ink);
	border-color: var(--swd-hairline);
}

.btn-quiet:hover {
	border-color: var(--swd-ink-soft);
}

/* Destructive: an outline, never solid Cinnabar. */
.btn-danger {
	background: transparent;
	color: var(--swd-ink);
	border-color: var(--swd-ink);
}

.btn-danger:hover {
	background: var(--swd-wash);
}

.btn-small {
	min-height: 36px;
	padding: 6px 12px;
	font-size: 0.9375rem;
}

.actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 16px;
}

form.inline {
	display: inline-flex;
	margin: 0;
}

/* --- Lines: errors and notes --- */

.alert,
.note {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	margin: 0 0 20px;
	padding: 12px 14px;
	border-radius: var(--swd-radius-button);
	background: var(--swd-surface);
}

.alert p,
.note p {
	margin: 0;
}

/* Errors: ink text, a warning icon, a hairline frame; never red. */
.alert {
	color: var(--swd-error-text);
	border: 1px solid var(--swd-error-frame);
}

.alert .icon {
	flex: none;
	margin-top: 2px;
}

.note {
	border: 1px solid var(--swd-hairline);
}

/* --- The plan band --- */

.band {
	margin: 0 0 28px;
}

.band-line {
	margin: 0 0 14px;
	font-size: 1.0625rem;
}

.band .note {
	margin-bottom: 16px;
}

.meter {
	display: flex;
	gap: 4px;
	max-width: 360px;
	margin: 0 0 18px;
}

.seg {
	flex: 1;
	height: 8px;
	border-radius: 4px;
	background: var(--swd-hairline);
}

.seg-on {
	background: var(--swd-accent);
}

/* --- Site cards: two columns from 900px --- */

.sites {
	list-style: none;
	margin: 0 0 28px;
	padding: 0;
	display: grid;
	grid-template-columns: 1fr;
	gap: 20px;
}

@media (min-width: 900px) {
	.sites {
		grid-template-columns: 1fr 1fr;
	}
}

.site {
	padding: 0;
	display: flex;
	flex-direction: column;
}

.preview {
	position: relative;
	aspect-ratio: 16 / 10;
	background: var(--swd-wash);
	border-bottom: 1px solid var(--swd-hairline);
	border-radius: calc(var(--swd-radius-card) - 1px) calc(var(--swd-radius-card) - 1px) 0 0;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}

.preview img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: top center;
}

.preview-wait {
	color: var(--swd-color-text-muted);
	font-size: 0.9375rem;
}

.site-body {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 20px 22px 22px;
}

.site-name {
	margin: 0;
	font-family: var(--swd-font-display);
	font-style: var(--swd-display-style);
	font-weight: var(--swd-weight-display-strong);
	font-size: 1.75rem;
	line-height: 1.1;
	overflow-wrap: anywhere;
}

.site-address {
	margin: 0;
	color: var(--swd-color-text-muted);
	text-decoration: underline;
	text-decoration-color: var(--swd-accent);
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
	overflow-wrap: anywhere;
	align-self: flex-start;
}

.site-meta {
	margin: 2px 0 0;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.pill {
	display: inline-block;
	padding: 3px 10px;
	border: 1px solid var(--swd-hairline);
	border-radius: 999px;
	color: var(--swd-ink-soft);
	font-size: 0.8125rem;
	font-weight: var(--swd-weight-semibold);
}

.pill-muted {
	background: var(--swd-wash);
}

.status {
	margin: 0;
	display: flex;
	align-items: baseline;
	gap: 9px;
	color: var(--swd-ink-soft);
}

.dot {
	flex: none;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--swd-muted);
	transform: translateY(-1px);
}

.dot-live {
	background: var(--swd-accent);
}

.site .actions {
	margin-top: 10px;
}

.start {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 14px;
}

.start p {
	margin: 0;
	max-width: 62ch;
}

/* --- Forms --- */

.form {
	max-width: 640px;
}

.field {
	margin: 0 0 22px;
	padding: 0;
	border: 0;
	min-width: 0;
}

/* Not the radio rows: .choice draws its own row (it lost its padding to this rule at the 2B screenshot pass). */
.field > label:not(.choice),
.field > legend {
	display: block;
	margin: 0 0 6px;
	padding: 0;
	font-weight: var(--swd-weight-semibold);
}

input[type="text"] {
	width: 100%;
	min-height: 44px;
	padding: 10px 12px;
	border: 1px solid var(--swd-color-text-muted);
	border-radius: var(--swd-radius-button);
	background: var(--swd-surface);
	color: var(--swd-ink);
	font-family: var(--swd-font-ui);
	font-size: 0.9375rem;
}

/* iOS Safari zooms a focused field under 16px (estate gotcha). */
@media (pointer: coarse) {
	input[type="text"] {
		font-size: 16px;
	}
}

.suffixed {
	display: flex;
	align-items: center;
	gap: 6px;
}

.suffixed input {
	flex: 1;
	min-width: 0;
}

.suffix {
	color: var(--swd-color-text-muted);
	white-space: nowrap;
}

.hint {
	margin: 6px 0 0;
	color: var(--swd-color-text-muted);
	font-size: 0.875rem;
}

.choice {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 8px;
	padding: 10px 12px;
	border: 1px solid var(--swd-hairline);
	border-radius: var(--swd-radius-button);
	cursor: pointer;
}

.choice input {
	width: 18px;
	height: 18px;
	margin: 0;
	accent-color: var(--swd-cinnabar);
	flex: none;
}

/* Style is asked only when the look is Marketing. */
form:has(input[name="template"][value="spirit-editorial"]:checked) .style-field {
	display: none;
}
