@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  * { margin: 0; padding: 0; }
  img, svg { display: block; max-width: 100%; }
}

@layer base {
  html { font-size: 100%; }

  body {
    font-family: var(--font-sans);
    font-weight: 500;
    line-height: 1.5;
    color: var(--text);
    text-shadow: var(--text-shadow);

    background-color: var(--bg);
    background-image: var(--bg-image);
    background-size: cover;
    background-repeat: no-repeat;
    /* Anchor the scene to the viewport floor so the grass line always sits
       at the bottom of the screen, whatever the aspect ratio. */
    background-position: center bottom;
    background-attachment: fixed;

    transition:
      background-color 0.3s ease,
      color 0.3s ease,
      background-image 0.3s ease;
  }

  /* Light, airy headings */
  h1, h2, h3 { font-weight: 300; line-height: 1.2; }
  h1 { font-size: 2.4rem; }
  h2 { font-size: 1.9rem; }
  h3 { font-size: 1.4rem; }

  /* Links pick up the accent */
  a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease;
  }
  a:hover {
    color: var(--accent-strong);
    text-decoration: underline;
  }

  label {
    font-weight: 500;
    font-size: 1rem;
    color: var(--text);
  }

  /* Glassy form controls — applies to Devise inputs without per-field classes */
  input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
  textarea,
  select {
    width: 100%;
    padding: 0.6rem 0.8rem;
    font: inherit;
    color: var(--text);
    background: var(--glass-bg-strong);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    backdrop-filter: var(--glass-filter);
    -webkit-backdrop-filter: var(--glass-filter);
    text-shadow: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
  }

  /* The option popup is drawn outside the page, so it can't use glass/blur —
     give it a solid themed surface (belt-and-suspenders with color-scheme) */
  select option {
    background: var(--bg);
    color: var(--text);
  }

  input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):focus,
  textarea:focus,
  select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
  }
}
