@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  * { margin: 0; }
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  img, svg, video { display: block; max-width: 100%; }
  input, button, textarea, select { font: inherit; color: inherit; }
  button { cursor: pointer; background: none; border: 0; padding: 0; }
  p, h1, h2, h3, h4 { overflow-wrap: break-word; }
  ul[class], ol[class] { list-style: none; padding: 0; }
  fieldset { border: 0; padding: 0; min-width: 0; }
  legend { padding: 0; }
  [hidden] { display: none !important; }
}

@layer base {
  html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
  @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; }
  }

  body {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-ui);
    font-size: var(--fs-md);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
  }

  h1, h2, h3, h4 { line-height: 1.15; font-weight: 800; letter-spacing: -0.01em; text-wrap: balance; }
  h1 { font-size: var(--fs-2xl); }
  h2 { font-size: var(--fs-xl); }
  h3 { font-size: var(--fs-lg); }
  p { text-wrap: pretty; }

  a { color: inherit; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
  a:hover { color: var(--slime-600); }

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

  ::selection { background: var(--slime-100); color: var(--ink); }

  input:not([type="radio"], [type="checkbox"], [type="file"]), select, textarea {
    width: 100%;
    padding: 0.7rem 0.95rem;
    border: 1.5px solid var(--line-strong);
    border-radius: var(--r-sm);
    background: var(--surface);
    transition: border-color 0.15s, box-shadow 0.15s;
  }
  input:not([type="radio"], [type="checkbox"], [type="file"]):focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--slime);
    box-shadow: 0 0 0 4px rgb(63 184 175 / 0.2);
  }
  textarea { resize: vertical; min-height: 3.2em; }
  input[type="radio"], input[type="checkbox"] { accent-color: var(--slime-600); width: 1.1em; height: 1.1em; flex: none; }
  ::placeholder { color: #8b97a3; }
}

@layer utilities {
  .visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0);
    white-space: nowrap; border: 0;
  }
  .muted { color: var(--muted); }
  .small { font-size: var(--fs-sm); }
  .stack > * + * { margin-top: var(--s-3); }
  .stack-lg > * + * { margin-top: var(--s-6); }
  .stack-xl > * + * { margin-top: var(--s-7); }
  .row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; }
  .row-wrap { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
  .js .js-hide { display: none; }
  @media (max-width: 859px) { .hide-mobile { display: none !important; } }

  .float { animation: float 5s ease-in-out infinite; }
  @keyframes float { 50% { transform: translateY(-8px) rotate(-2deg); } }
}
