/* Astryx-lite base — reset + typography. Uses only variables from tokens.css. */

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

* {
  margin: 0;
}

/* A universal margin reset also removes the UA rule that centers modal dialogs. Put it back. */
dialog {
  margin: auto;
}

html {
  color-scheme: light;
  background: color-mix(in srgb, var(--color-background-blue) 35%, var(--color-background-body));
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  position: relative;
  min-height: 100dvh;
  background: transparent;
  color: var(--color-text-primary);
  font-family: var(--font-family-body);
  font-size: var(--ax-type-body);
  font-weight: var(--text-body-weight);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}

a {
  color: var(--color-text-accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-family-heading);
  color: var(--color-text-primary);
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h1 {
  font-size: var(--text-heading-1-size);
  font-weight: var(--text-heading-1-weight);
  line-height: var(--text-heading-1-leading);
}

h2 {
  font-size: var(--text-heading-2-size);
  font-weight: var(--text-heading-2-weight);
  line-height: var(--text-heading-2-leading);
}

h3 {
  font-size: var(--text-heading-3-size);
  font-weight: var(--text-heading-3-weight);
  line-height: var(--text-heading-3-leading);
}

h4 {
  font-size: var(--text-heading-4-size);
  font-weight: var(--text-heading-4-weight);
  line-height: var(--text-heading-4-leading);
}

p {
  max-width: 72ch;
}

small {
  font-size: var(--text-supporting-size);
  line-height: var(--text-supporting-leading);
  color: var(--color-text-secondary);
}

code,
kbd {
  font-family: var(--font-family-code);
  font-size: var(--text-code-size);
  background: var(--color-background-muted);
  border-radius: var(--ax-radius);
  padding: 0.1em 0.35em;
}

hr {
  border: 0;
  border-top: var(--border-width) solid var(--color-border);
}

:focus-visible {
  outline: var(--focus-outline-width) var(--focus-outline-style) var(--focus-outline-color);
  outline-offset: var(--focus-outline-offset);
  border-radius: var(--ax-radius);
}

::selection {
  background: var(--color-accent-muted);
}

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* [hidden] must win over component display rules */
[hidden] {
  display: none !important;
}

/* One radius scale for the whole page — map every corner to one of these. */
:root {
  --ax-island-pad: 14px; /* equal inset on all four sides of an island */
  --ax-radius-control: 18px; /* buttons, inputs, chips, rows */
  --ax-radius: calc(var(--ax-radius-control) + var(--ax-island-pad)); /* 32px: island = control + inset */

  /* Glassmorphism surface language: translucent fill + blur + hairline + inner highlight. */
  --ax-glass-bg: color-mix(in srgb, var(--color-background-surface) 68%, transparent);
  --ax-glass-border: color-mix(in srgb, var(--color-background-surface) 42%, var(--color-border));
  --ax-glass-highlight: inset 0 1px 0 color-mix(in srgb, var(--color-background-surface) 60%, transparent);
  --ax-glass-blur: blur(20px) saturate(1.4);

  /* Proportion layer: Fibonacci rhythm, phi type steps, pi for circles. */
  --ax-fib-1: 8px;   /* F6 */
  --ax-fib-2: 13px;  /* F7 */
  --ax-fib-3: 21px;  /* F8 */
  --ax-fib-4: 34px;  /* F9 */
  --ax-fib-5: 55px;  /* F10 */
  --ax-fib-6: 89px;  /* F11 */
  --ax-phi: 1.618;
  --ax-pi: 3.1416;
  --ax-type-body: 16px;
  --ax-type-h3: 21px;
  --ax-type-h2: 34px;
  --ax-type-hero: 55px;
}
