/* Shared primitives for the public site and authenticated application. */
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
a,
input,
textarea,
select {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
  color: inherit;
  border: 0;
  background: none;
}
button:disabled {
  cursor: not-allowed;
  opacity: var(--disabled-opacity);
}
a {
  color: var(--accent);
  text-underline-offset: 0.2em;
}
button,
a,
summary,
input,
select,
textarea {
  touch-action: manipulation;
}
svg {
  flex-shrink: 0;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1,
h2,
h3 {
  font-family: var(--font-display);
  text-wrap: balance;
}
h1 {
  font-size: var(--text-title);
  line-height: var(--leading-heading);
  letter-spacing: var(--tracking-heading);
  font-weight: 550;
  margin-bottom: var(--space-6);
}
h2 {
  font-size: clamp(1.5rem, 2.2vw, 2rem);
  line-height: 1.2;
  letter-spacing: -0.035em;
  font-weight: 550;
}
h3 {
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1.4;
}
p {
  line-height: var(--leading-body);
}
small {
  font-size: var(--text-xs);
  line-height: var(--leading-body);
}
:focus-visible {
  outline: var(--focus-width) solid var(--focus);
  outline-offset: var(--focus-offset);
}
::selection {
  background: var(--accent);
  color: var(--bg);
}
label {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 500;
  margin: var(--space-5) 0;
}
input,
textarea,
select {
  border: var(--border-width) solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  padding: var(--space-3);
  max-width: 100%;
  min-width: 0;
  min-height: var(--control-height);
}
input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
  opacity: 1;
}
textarea {
  resize: vertical;
  width: 100%;
  line-height: var(--leading-body);
}
input[type="checkbox"],
input[type="range"] {
  accent-color: var(--accent);
}
input[type="checkbox"] {
  min-height: auto;
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
}
form {
  margin: 0;
}
.muted {
  color: var(--text-muted);
}
.small {
  font-size: var(--text-sm);
}
.eyebrow {
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-label);
  font-weight: 550;
  color: var(--text-muted);
  display: block;
  margin-bottom: var(--space-5);
}
.row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.end {
  justify-content: flex-end;
}
.wide {
  width: 100%;
}
.primary,
.secondary,
.mini-primary {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-4);
  background: var(--action);
  color: var(--on-action);
  padding: var(--space-3) var(--space-5);
  min-height: var(--control-height);
  border: var(--border-width) solid transparent;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 550;
  text-decoration: none;
  transition:
    background var(--motion-fast) var(--ease-calm),
    border-color var(--motion-fast) var(--ease-calm);
}
.primary:hover:not(:disabled),
.mini-primary:hover:not(:disabled) {
  background: var(--action-hover);
}
.secondary {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--text);
}
.secondary:hover:not(:disabled) {
  background: var(--surface-hover);
}
.mini-primary {
  padding: var(--space-2) var(--space-3);
  gap: var(--space-2);
}
.quiet {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  min-height: var(--control-height);
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-align: left;
}
.quiet:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 0.25em;
}
.icon {
  padding: var(--space-3);
  min-height: var(--control-height);
  min-width: var(--control-height);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}
.icon:hover:not(:disabled) {
  background: var(--surface-hover);
}
.danger {
  color: var(--danger);
}
.destructive {
  background: var(--danger);
  color: var(--on-danger);
}
.primary.destructive:hover {
  background: var(--danger);
  filter: brightness(0.9);
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  background: var(--surface-raised);
  color: var(--text-muted);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  line-height: var(--leading-body);
}
.tag.warm {
  background: var(--warning-surface);
  color: var(--warning);
}
.card {
  background: var(--surface);
  border: var(--border-width) solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
}
.brand {
  display: inline-flex;
  gap: var(--space-3);
  align-items: center;
  color: var(--text);
  text-decoration: none;
  padding: var(--space-2);
  width: max-content;
  flex-shrink: 0;
}
.brand-symbol {
  display: inline-block;
  flex-shrink: 0;
  width: 3rem;
  aspect-ratio: 324/168;
  background: currentColor;
  mask: url("/brand/logo-symbol.svg") center/contain no-repeat;
}
.brand-wordmark {
  display: inline-block;
  width: 7rem;
  aspect-ratio: 687/171;
  background: currentColor;
  mask: url("/brand/logo-wordmark.svg") center/contain no-repeat;
}
.brand-illustration {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  padding: var(--space-12);
  background: var(--surface);
  border: var(--border-width) solid var(--line);
  border-radius: var(--radius-lg);
  aspect-ratio: 1.25;
}
.brand-illustration .brand-symbol {
  width: 80%;
  max-width: 22rem;
}
.theme-selector {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  color: var(--text-muted);
  font-size: var(--text-xs);
}
.theme-selector select {
  background: var(--surface);
  border-color: var(--line);
  font-size: var(--text-xs);
  padding: var(--space-2);
  min-height: var(--control-height);
}
.theme-control {
  position: relative;
}
.theme-warning {
  position: absolute;
  z-index: 20;
  right: 0;
  top: 100%;
  width: 16rem;
  background: var(--warning-surface);
  color: var(--warning);
  border: var(--border-width) solid var(--line);
  padding: var(--space-3);
  border-radius: var(--radius-sm);
}
.theme-warning[hidden] {
  display: none;
}
.language {
  font-size: var(--text-xs);
  border: var(--border-width) solid var(--line);
  padding: var(--space-2) var(--space-3);
  min-height: var(--control-height);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-decoration: none;
  color: var(--text);
}
.error {
  background: var(--danger-surface);
  border: var(--border-width) solid var(--danger);
  color: var(--danger);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  overflow-wrap: anywhere;
}
.empty {
  border: var(--border-width) dashed var(--line-strong);
  border-radius: var(--radius-lg);
  padding: var(--space-12) var(--space-6);
  text-align: center;
  color: var(--text-muted);
}
.empty .brand-symbol {
  color: var(--text);
  width: 2.5rem;
}
.empty p {
  font-size: var(--text-sm);
  max-width: 30rem;
  margin: var(--space-4) auto 0;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  z-index: 100;
  top: var(--space-3);
  left: var(--space-3);
  transform: translateY(-200%);
  background: var(--action);
  color: var(--on-action);
  padding: var(--space-3);
  border-radius: var(--radius-sm);
}
.skip-link:focus {
  transform: none;
}
dialog {
  border: var(--border-width) solid var(--line-strong);
  border-radius: var(--radius-lg);
  max-width: 36rem;
  width: calc(100% - var(--space-8));
  padding: var(--space-8);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-dialog);
  max-height: 90dvh;
}
dialog::backdrop {
  background: var(--backdrop);
  backdrop-filter: blur(4px);
}
.modal-heading {
  display: flex;
  gap: var(--space-5);
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-5);
}
.modal-heading h2 {
  font-size: var(--text-xl);
  margin: 0;
}
.modal-heading .icon {
  margin-top: calc(-1 * var(--space-2));
}
dialog textarea {
  margin-bottom: var(--space-5);
}
@media (forced-colors: active) {
  .brand-symbol,
  .brand-wordmark {
    background: CanvasText;
    forced-color-adjust: none;
  }
  .primary,
  .tag,
  .icon {
    border: 1px solid ButtonText;
  }
}

/* Visible even while the SPA module is still loading. */
.boot {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  align-items: center;
  justify-content: center;
  color: var(--text);
}
.boot .brand-symbol {
  width: 5rem;
}
.boot small {
  color: var(--text-muted);
}
