/*
  YANTRA — Base
  Element defaults built on tokens.css. Generous ma (間) — breathing
  room over density. Mobile-first; every rule here is the small-screen
  truth, refined upward.
*/

html {
  background: var(--surface-0);
  scroll-behavior: smooth;
}

body {
  min-height: 100dvh;
  background: var(--surface-0);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  letter-spacing: var(--tracking-body);
  transition: background-color var(--duration-slow) var(--ease-paper),
              color var(--duration-slow) var(--ease-paper);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: var(--leading-tight);
  color: var(--text-primary);
}

h1 {
  font-size: var(--text-2xl);
  letter-spacing: var(--tracking-wide);
}

h2 {
  font-size: var(--text-xl);
  letter-spacing: var(--tracking-wide);
}

h3 {
  font-size: var(--text-lg);
  line-height: var(--leading-title);
  font-weight: 500;
  letter-spacing: var(--tracking-normal);
}

p {
  max-width: 34ch;
}

p + p {
  margin-top: var(--space-md);
}

small,
.text-muted {
  color: var(--text-muted);
  font-size: var(--text-sm);
  line-height: 1.43;
  letter-spacing: var(--tracking-label);
}

a {
  color: var(--accent-forest);
  transition: color var(--duration-fast) var(--ease-paper);
}

a:hover {
  color: var(--accent-vermillion);
}

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

:focus-visible {
  outline: 2px solid var(--accent-gold);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

button {
  font-family: inherit;
}

hr {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: var(--space-xl) 0;
}

/* ---------- Layout Primitives ---------- */

.container {
  width: 100%;
  max-width: var(--content-width-md);
  margin-inline: auto;
  padding-inline: var(--space-lg);
}

.stack > * + * {
  margin-top: var(--space-md);
}

.center {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* ---------- Screen-reader only ---------- */

.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;
}

/* ---------- Scrollbar (webkit) — quiet, not intrusive ---------- */

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--radius-full);
  border: 2px solid transparent;
  background-clip: padding-box;
}

/* ---------- Breakpoints (mobile-first refinement) ---------- */

@media (min-width: 640px) {
  .container {
    padding-inline: var(--space-xl);
  }

  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-2xl); }
}

@media (min-width: 1024px) {
  .container {
    max-width: var(--content-width-lg);
  }
}
