/*
 * Swavo base styles: a small reset, typography and a handful of primitives (.btn, .input, .card, .badge, ...).
 * Needs tokens.css (and fonts.css for the brand fonts). Everything is low-specificity so apps can override it.
 */

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: var(--leading-normal);
  font-feature-settings: 'cv11', 'ss01', 'ss03'; /* Inter: single-storey a off, open digits */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
::selection {
  background: var(--selection);
}
img,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
}
img,
video {
  height: auto;
}
input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
:where(h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd) {
  margin: 0;
}
:where(ul, ol)[role='list'] {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ---------- Typography ---------- */
:where(h1, h2, h3, .display) {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-snug);
  text-wrap: balance;
}
:where(h1) {
  font-size: var(--text-2xl);
}
:where(h2) {
  font-size: var(--text-xl);
}
:where(h3) {
  font-size: var(--text-lg);
}
:where(h4, h5, h6) {
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
}
:where(p) {
  text-wrap: pretty;
}
/* Italic serif accent inside headlines: <h1>Mail, <em class="serif">aber anders</em></h1> */
.serif {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
}
.eyebrow {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-3);
}
.muted {
  color: var(--text-3);
}
.prose {
  max-width: var(--width-prose);
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
}
.prose :where(p, ul, ol, pre, blockquote) {
  margin-block: 0 1em;
}
.prose :where(h1, h2, h3) {
  margin-block: 1.6em 0.5em;
}
:where(a) {
  color: var(--link);
  text-decoration-line: underline;
  text-decoration-color: var(--link-underline);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.2em;
  transition: text-decoration-color var(--duration-fast) var(--ease-out), color var(--duration-fast);
}
:where(a):hover {
  text-decoration-color: currentColor;
}
:where(code, kbd, samp, pre) {
  font-family: var(--font-mono);
  font-size: 0.9em;
}
:where(code) {
  background: var(--surface-sunken);
  border-radius: var(--radius-xs);
  padding: 0.1em 0.35em;
}
kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 0.05em 0.4em;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: var(--radius-xs);
  background: var(--surface);
  font-size: 0.8em;
  text-align: center;
}
mark {
  background: var(--highlight);
  color: inherit;
  border-radius: 2px;
  padding: 0 0.1em;
}
hr {
  border: 0;
  border-top: 1px solid var(--divider);
  margin: var(--space-6) 0;
}

/* ---------- Focus ---------- */
:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-xs);
}
.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  z-index: var(--z-toast);
  padding: var(--space-2) var(--space-4);
  background: var(--primary);
  color: var(--text-on-primary);
  border-radius: var(--radius-md);
}
.skip-link:focus {
  top: var(--space-4);
}
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--surface);
  --btn-fg: var(--text);
  --btn-border: var(--border);
  --btn-hover: var(--surface-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--control-height);
  padding: 0 var(--space-4);
  border: 1px solid var(--btn-border);
  border-radius: var(--radius-md);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition:
    background-color var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out);
}
.btn:hover {
  background: var(--btn-hover);
}
.btn:active {
  transform: translateY(1px);
}
.btn:focus-visible {
  border-radius: var(--radius-md);
}
.btn:disabled,
.btn[aria-disabled='true'] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
.btn-primary {
  --btn-bg: var(--primary);
  --btn-fg: var(--text-on-primary);
  --btn-border: transparent;
  --btn-hover: var(--primary-hover);
  box-shadow: var(--shadow-sm);
}
.btn-accent {
  --btn-bg: var(--accent);
  --btn-fg: var(--text-on-accent);
  --btn-border: transparent;
  --btn-hover: var(--accent-hover);
  box-shadow: var(--shadow-sm);
}
.btn-success {
  --btn-bg: var(--success-fill);
  --btn-fg: #fff;
  --btn-border: transparent;
  --btn-hover: var(--success-fill);
}
.btn-danger {
  --btn-bg: var(--danger-fill);
  --btn-fg: #fff;
  --btn-border: transparent;
  --btn-hover: var(--danger-fill);
}
.btn-ghost {
  --btn-bg: transparent;
  --btn-border: transparent;
}
.btn-sm {
  min-height: var(--control-height-sm);
  padding: 0 var(--space-3);
  font-size: var(--text-sm);
  border-radius: var(--radius-sm);
}
.btn-lg {
  min-height: var(--control-height-lg);
  padding: 0 var(--space-6);
  font-size: var(--text-lg);
  border-radius: var(--radius-lg);
}

/* ---------- Form controls ---------- */
.input,
.select,
.textarea {
  width: 100%;
  min-height: var(--control-height);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  font-size: max(16px, var(--text-md)); /* 16px+ stops iOS zoom on focus */
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}
.textarea {
  min-height: 6rem;
  resize: vertical;
}
.input::placeholder,
.textarea::placeholder {
  color: var(--text-3);
}
.input:focus-visible,
.select:focus-visible,
.textarea:focus-visible {
  border-color: var(--focus-ring-color);
  border-radius: var(--radius-md);
}
.input[aria-invalid='true'] {
  border-color: var(--danger);
}
.label {
  display: block;
  margin-bottom: var(--space-1-5);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-2);
}
.hint {
  margin-top: var(--space-1);
  font-size: var(--text-sm);
  color: var(--text-3);
}

/* ---------- Surfaces ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  padding: var(--space-5);
}
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

/* ---------- Badges and notices ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  height: 1.375rem;
  padding: 0 var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: var(--text-2xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.badge-accent {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--accent-text);
}
.badge-info {
  background: var(--info-soft);
  border-color: var(--info-border);
  color: var(--info);
}
.badge-success {
  background: var(--success-soft);
  border-color: var(--success-border);
  color: var(--success);
}
.badge-warning {
  background: var(--warning-soft);
  border-color: var(--warning-border);
  color: var(--warning);
}
.badge-danger {
  background: var(--danger-soft);
  border-color: var(--danger-border);
  color: var(--danger);
}
.notice {
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--info-border);
  border-radius: var(--radius-md);
  background: var(--info-soft);
  color: var(--text);
}
.notice-success {
  border-color: var(--success-border);
  background: var(--success-soft);
}
.notice-warning {
  border-color: var(--warning-border);
  background: var(--warning-soft);
}
.notice-danger {
  border-color: var(--danger-border);
  background: var(--danger-soft);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
