/* Swarmsec components. Colours, spacing and radii are tokens.
   Literals are the live site's own values: 1.05em mark, 0.3em lockup gap, 6px meta row gap, 13px/12px text. */

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: var(--font-sans); font-size: 16px; line-height: 1.5; background: var(--paper); color: var(--ink); -webkit-font-smoothing: antialiased; }
::selection { background: var(--sage); color: var(--on-sage); }

/* Wordmark */
.sw-wordmark { display: inline-flex; align-items: center; gap: 0.3em; font-family: var(--font-sans); font-size: var(--wordmark-size); font-weight: 700; line-height: 1; letter-spacing: -0.05em; text-decoration: none; color: inherit; }
.sw-wordmark__mark { display: block; width: 1.05em; height: 1.05em; flex: 0 0 auto; }
.sw-wordmark--display { font-size: 72px; }
.sw-wordmark:focus-visible { outline: var(--focus-width) solid currentColor; outline-offset: var(--focus-offset); border-radius: var(--radius-sm); }

/* TextLink */
.sw-link { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.sw-link:hover { text-decoration: underline; text-underline-offset: var(--space-1); }
.sw-link:focus-visible { outline: var(--focus-width) solid currentColor; outline-offset: var(--focus-offset); border-radius: var(--radius-sm); }
.sw-link--inline { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: var(--space-1); }
.sw-link--inline:hover { text-decoration-thickness: 2px; }

/* MetaLine */
.sw-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 6px var(--space-6); flex-wrap: wrap; font-size: 13px; font-weight: 700; letter-spacing: 0.02em; line-height: 1.4; }
.sw-meta p { margin: 0; }
.sw-meta--on-image { color: var(--light); text-shadow: var(--shadow-text); }
@media (max-width: 520px) { .sw-meta { flex-direction: column; align-items: flex-start; } }

/* SkipLink */
.sw-skip { position: absolute; left: var(--gutter-x); top: -100px; z-index: 5; padding: var(--space-3) var(--space-4); background: var(--paper); color: var(--ink); font-size: 12px; }
.sw-skip:focus { top: var(--space-3); }
.sw-skip:focus-visible { outline: var(--focus-width) solid currentColor; outline-offset: var(--focus-offset); border-radius: var(--radius-sm); }

/* Stage */
.sw-stage { position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; height: 100svh; background: var(--paper); color: var(--ink); }
.sw-stage__image { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.sw-stage__image > img, .sw-stage__image > svg { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 72% 55%; }
.sw-stage__image::after { content: ""; position: absolute; inset: auto 0 0; height: var(--scrim-height); background: linear-gradient(to top, var(--scrim), rgba(16, 18, 14, 0)); }
.sw-stage__header, .sw-stage__footer { padding-left: max(var(--gutter-x), env(safe-area-inset-left)); padding-right: max(var(--gutter-x), env(safe-area-inset-right)); }
.sw-stage__header { display: flex; align-items: center; padding-top: max(var(--gutter-y), env(safe-area-inset-top)); padding-bottom: var(--gutter-y); }
.sw-stage__footer { padding-top: var(--gutter-y); padding-bottom: max(var(--gutter-y), env(safe-area-inset-bottom)); }

/* Button */
.sw-btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); height: 40px; padding: 0 var(--space-4); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: transparent; color: var(--ink); font-family: var(--font-sans); font-size: 13px; font-weight: 700; letter-spacing: 0.02em; line-height: 1; text-decoration: none; cursor: pointer; }
.sw-btn:hover { border-color: var(--ink); text-decoration: underline; text-underline-offset: var(--space-1); }
.sw-btn:focus-visible { outline: var(--focus-width) solid var(--ink); outline-offset: var(--focus-offset); }
.sw-btn--primary { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.sw-btn:disabled, .sw-btn[aria-disabled="true"] { background: var(--paper-sunk); border-color: var(--line); color: var(--ink-muted); text-decoration: none; cursor: not-allowed; }

/* Field */
.sw-field { display: grid; gap: var(--space-2); max-width: 360px; }
.sw-field__label { font-size: 13px; font-weight: 700; letter-spacing: 0.02em; line-height: 1.4; color: var(--ink); }
.sw-field__input { width: 100%; height: 44px; padding: 0 var(--space-3); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--paper-raised); color: var(--ink); font-family: var(--font-sans); font-size: 16px; line-height: 24px; }
.sw-field__input--mono { font-family: var(--font-mono); font-size: 13px; }
.sw-field__input::placeholder { color: var(--ink-muted); opacity: 1; }
.sw-field__input:focus-visible { outline: var(--focus-width) solid var(--ink); outline-offset: var(--focus-offset); }
.sw-field__hint { margin: 0; font-size: 13px; line-height: 1.4; color: var(--ink-muted); }
.sw-field--error .sw-field__input { border: 2px solid var(--alert); padding: 0 calc(var(--space-3) - 1px); }
.sw-field--error .sw-field__hint { color: var(--alert); font-weight: 700; }

/* Tag */
.sw-tag { display: inline-flex; align-items: center; height: 24px; padding: 0 var(--space-2); border-radius: var(--radius-sm); background: var(--sage); color: var(--on-sage); font-size: 12px; font-weight: 700; letter-spacing: 0.02em; line-height: 1; white-space: nowrap; }
.sw-tag--neutral { background: var(--paper-sunk); color: var(--ink); }
.sw-tag--alert { background: var(--alert-soft); color: var(--alert); }
.sw-tag--watch { background: var(--watch-soft); color: var(--watch); }
.sw-tag--clear { background: var(--clear-soft); color: var(--clear); }

/* Panel */
.sw-panel { display: grid; gap: var(--space-2); padding: var(--space-6); border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper-raised); color: var(--ink); }
.sw-panel__label { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: 0.02em; line-height: 1.4; color: var(--ink-muted); }
.sw-panel__title { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; }
.sw-panel__body { margin: 0; font-size: 16px; line-height: 24px; max-width: var(--measure); }
.sw-panel--night { background: var(--night); border-color: var(--night); color: var(--light); }
.sw-panel--night .sw-panel__label { color: var(--light); }

/* Notice */
.sw-notice { display: grid; gap: var(--space-1); padding: var(--space-4); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--paper-raised); color: var(--ink); }
.sw-notice__title { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: 0.02em; line-height: 1.4; }
.sw-notice__body { margin: 0; font-size: 16px; line-height: 24px; }
.sw-notice--alert { background: var(--alert-soft); border-color: var(--alert); }
.sw-notice--alert .sw-notice__title { color: var(--alert); }
.sw-notice--watch { background: var(--watch-soft); border-color: var(--watch); }
.sw-notice--watch .sw-notice__title { color: var(--watch); }
.sw-notice--clear { background: var(--clear-soft); border-color: var(--clear); }
.sw-notice--clear .sw-notice__title { color: var(--clear); }

/* Preview scaffolding (cards only; not part of the product CSS) */
.sw-demo { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4) var(--space-6); padding: var(--space-6); }
.sw-demo--stack { flex-direction: column; align-items: stretch; }
.sw-demo--split { display: grid; grid-template-columns: 1fr 1fr; gap: 0; padding: 0; }
.sw-demo__cell { display: flex; align-items: center; padding: var(--space-6); min-height: 96px; }
.sw-demo__cell--night { background: var(--night); color: var(--light); }
