/* Texa base — reset + foundational element styles (flow.rest-faithful) */

/* Inter variable — vendored locally (vendor/inter-var.woff2, SIL OFL) so the type renders as
   Inter everywhere, including offline/installed-PWA, instead of falling back to the system font.
   Mirrors flow.rest's own @font-face (style normal, weight 100–900, woff2). */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(../vendor/inter-var.woff2) format("woff2");
}

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

* { margin: 0; padding: 0; }

html, body { height: 100%; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-family);
  font-size: 16px;
  line-height: 24px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, p { margin: 0; }   /* Flow lets the UA size <h2> day headings */

/* Global button = Flow's 40x40 ghost target with -8px bleed + highlight hover */
button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: -8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease);
}
button:hover, button:focus-visible { background: var(--highlight); }
button:focus { outline: 0; }
/* Tactile press feedback (transform only; suppressed under reduced motion) */
button:active { transform: scale(0.96); }

textarea, input {
  font: inherit;
  color: inherit;
  background: transparent;
  border: 0;
  outline: 0;
  resize: none;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

/* Keyboard-only focus indicators. Writing surfaces (root + thoughts) use the
   active-thought highlight pill as their focus indicator — keeping the calm Flow look. */
.logo:focus-visible { outline: 0; box-shadow: 0 0 0 2px var(--focus-ring); border-radius: 10px; }
.search:focus-visible,
#modalInput:focus-visible { box-shadow: 0 0 0 2px var(--focus-ring); border-radius: 6px; }

::selection { background: var(--fg); color: var(--bg); }

/* Visually hidden, still in the a11y tree (skip-to-content, document h1) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Thin, quiet scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--hairline) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--hairline); border-radius: 8px; }
*::-webkit-scrollbar-track { background: transparent; }

/* Generic kbd chip (modal / hints) */
kbd {
  display: inline-block;
  font-family: var(--font-family);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--gray1);
  border-radius: var(--radius-sm);
  padding: 2px 5px;
  line-height: 1;
}

/* Menu keycaps — flow.rest exact: gray1 chip, uppercase, 16x16; recolors on item focus */
.menu kbd {
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0;
  text-transform: uppercase;
  font-size: 10px;
  min-width: 16px;
  height: 16px;
  padding: 0;
  border-radius: 4px;
  background: var(--gray1);
  color: inherit;
}
