/* Base layer: reset, document chrome, global element defaults.
 * The page frame itself (sidebar, topbar, content column) is layout/app-shell.css. */

@layer base {
/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Alpine: hide until initialised. */
[x-cloak] { display: none !important; }

/* Skip link: visually hidden until focused, then top-left. Catches keyboard
   and screen-reader users first. */
.skip-link {
  position: absolute;
  left: var(--space-sm);
  top: -3rem;
  z-index: var(--z-toast);
  background: var(--color-primary);
  color: var(--color-on-primary);
  padding: var(--space-sm) var(--space-14);
  border-radius: var(--radius-sm);
  font-weight: var(--fw-semibold);
  text-decoration: none;
  transition: top var(--transition-slow);
}
.skip-link:focus,
.skip-link:focus-visible {
  top: var(--space-sm);
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Text selection in the brand hue — alpha mix keeps the text readable. */
::selection {
  background: color-mix(in srgb, var(--color-accent) 24%, transparent);
}

html {
  background-color: var(--color-bg);
  scrollbar-gutter: stable;
}

body {
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: var(--lh-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* Inter: cv11 = single-storey a, ss03 = rounded quotes. */
  font-feature-settings: "kern", "liga", "calt", "cv11", "ss03";
  min-height: 100vh;
  min-height: 100dvh;
  /* Side gutter of the content column + topbar (layout/app-shell.css). The
     body itself is full-bleed: the shell owns the frame. */
  --page-pad-x: var(--space-lg);
}

@media (min-width: 600px) {
  body { --page-pad-x: var(--space-xl); }
}

@media (min-width: 960px) {
  body { --page-pad-x: var(--space-2xl); }
}

/* The ONE h1 per page: the page title (topbar in the app, card head on login). */
h1 {
  font-family: var(--font-sans);
  font-size: var(--font-size-xl);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tighter);
}

a { color: var(--color-primary); }

/* Keyboard shortcut display — passable without a consumer class. */
kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5em;
  padding: var(--space-1) var(--space-6);
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  font-weight: var(--fw-medium);
  line-height: var(--lh-tight);
  background: var(--color-tag-bg);
  color: var(--color-text);
  border: var(--border-thin) solid var(--color-border);
  border-radius: var(--radius-sm);
}

code {
  font-family: var(--font-mono);
  background: var(--color-tag-bg);
  padding: var(--space-1) var(--space-5);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-mini);
}

/* === Site title (login page brand) === */
.site-title {
  display: flex;
  align-items: center;
  gap: var(--space-10);
  font-size: var(--font-size-xl);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-tighter);
  color: var(--color-text);
}

.site-logo {
  width: 2.25rem;
  height: 2.25rem;
  flex-shrink: 0;
}
}
