/* MyGrind · base.css
 * Font, reset, typography and utilities.
 */

/* Inter (SIL Open Font License, fonts/OFL.txt). One variable file covers every
 * weight plus the optical-size axis: large text gets the tighter "Display" cut,
 * small text the roomier "Text" cut, the way SF Pro does. */
@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-var.woff2") format("woff2-variations"), url("../fonts/inter-var.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.45;
  letter-spacing: var(--track-body);
  font-optical-sizing: auto;
  color: var(--ink);
  background: var(--bg);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

/* Warm glow behind everything; a fixed layer is cheaper than background-attachment: fixed. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(90% 50% at 100% 100%, var(--bg-glow), transparent 70%),
    radial-gradient(60% 40% at 0% 0%, var(--bg-glow), transparent 70%);
  opacity: 0.7;
}

h1, h2, h3, p, dl, dd, figure { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
a { color: inherit; }
svg { display: block; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend { padding: 0; }

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

/* ---------- Utilities ---------- */

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.muted { color: var(--ink-2); }
.small { font-size: var(--fs-foot); }

.stack { display: grid; gap: 16px; align-content: start; }
.stack-sm { display: grid; gap: 12px; }

:root[data-theme="dark"] .when-light,
:root:not([data-theme="dark"]) .when-dark { display: none; }

@media (min-width: 768px) {
  .only-mobile { display: none !important; }
}
@media (max-width: 767.98px) {
  .only-desktop { display: none !important; }
}
@media (min-width: 1024px) {
  .hide-lg { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

.noscript {
  padding: 24px;
  text-align: center;
  font-weight: 600;
}
