/* ==========================================================================
   GREENLYTES — BASE
   Core design tokens, reset, global rules and accessibility primitives.

   Scope:
   1. Design tokens
   2. Global box sizing and document defaults
   3. Media and form normalization
   4. Typography safeguards
   5. Accessibility primitives
   6. Responsive base adjustments
   7. Reduced-motion support

   This file must load before components.css and all page-specific stylesheets.
   ========================================================================== */


/* ==========================================================================
   01. DESIGN TOKENS
   ========================================================================== */

:root {
  /* --------------------------------------------------------------------------
     Brand and text colors
     -------------------------------------------------------------------------- */

  --color-ink: #0d1711;
  --color-ink-soft: #354039;
  --color-section-summary: #1f2922;
  --color-text-muted: #59665f;

  --color-white: #ffffff;
  --color-page: #f7f9f5;
  --color-surface-soft: #edf3e9;

  --color-green: #65964f;
  --color-green-dark: #3f7137;
  --color-green-deep: #315f2c;
  --color-green-light: #acd391;

  --color-dark: #101713;
  --color-footer: #090e0b;

  /* --------------------------------------------------------------------------
     Borders and focus
     -------------------------------------------------------------------------- */

  --color-border: rgba(16, 23, 19, 0.12);
  --color-border-strong: rgba(16, 23, 19, 0.22);
  --color-border-light: rgba(255, 255, 255, 0.16);

  --focus-ring-color: var(--color-green-dark);
  --focus-ring-width: 3px;
  --focus-ring-offset: 4px;

  /* --------------------------------------------------------------------------
     Layout
     -------------------------------------------------------------------------- */

  --container-width: 1240px;
  --page-gutter: 20px;

  /* --------------------------------------------------------------------------
     Rounded corners
     -------------------------------------------------------------------------- */

  --radius-small: 16px;
  --radius-medium: 24px;
  --radius-large: 34px;
  --radius-pill: 999px;

  /* --------------------------------------------------------------------------
     Shadows
     -------------------------------------------------------------------------- */

  --shadow-soft: 0 18px 50px rgba(25, 47, 31, 0.1);
  --shadow-large: 0 26px 70px rgba(22, 36, 25, 0.11);

  /* --------------------------------------------------------------------------
     Motion
     -------------------------------------------------------------------------- */

  --transition-fast: 180ms ease;
  --transition-medium: 300ms ease;
  --transition-slow: 650ms cubic-bezier(0.2, 0.7, 0.2, 1);
}


/* ==========================================================================
   02. DOCUMENT RESET AND GLOBAL RULES
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}


html {
  scroll-behavior: smooth;
  background: var(--color-page);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}


body {
  margin: 0;
  color: var(--color-ink);
  background: var(--color-page);

  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  line-height: 1.5;

  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}


main {
  display: block;
}


/* ==========================================================================
   03. MEDIA AND FORM NORMALIZATION
   ========================================================================== */

img,
picture {
  display: block;
}


img {
  max-width: 100%;
}


a {
  color: inherit;
}


button,
input,
textarea,
select {
  font: inherit;
}


button {
  color: inherit;
}


/* ==========================================================================
   04. TYPOGRAPHY SAFEGUARDS
   ========================================================================== */

h1,
h2,
h3,
p {
  overflow-wrap: break-word;
}


::selection {
  color: var(--color-white);
  background: var(--color-green-dark);
}


/* ==========================================================================
   05. ACCESSIBILITY
   ========================================================================== */

/* --------------------------------------------------------------------------
   Visually hidden content
   Keeps content available to assistive technologies while removing it from
   the visual layout.
   -------------------------------------------------------------------------- */

.visually-hidden {
  position: absolute;

  width: 1px;
  height: 1px;

  margin: -1px;
  padding: 0;

  overflow: hidden;

  border: 0;

  white-space: nowrap;

  clip: rect(0 0 0 0);
  clip-path: inset(50%);
}


/* --------------------------------------------------------------------------
   Skip link
   Hidden off-screen until focused by keyboard navigation.
   -------------------------------------------------------------------------- */

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 3000;

  padding: 11px 15px;

  border-radius: 10px;

  color: var(--color-white);
  background: var(--color-ink);

  text-decoration: none;

  transform: translateY(-160%);

  transition:
    transform var(--transition-fast);
}


.skip-link:focus,
.skip-link:focus-visible {
  transform: translateY(0);
}


/* --------------------------------------------------------------------------
   Global keyboard focus
   Uses a strong brand-aligned ring to remain clearly visible on both light
   and neutral surfaces.
   -------------------------------------------------------------------------- */

:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset: var(--focus-ring-offset);
}


/* ==========================================================================
   06. RESPONSIVE BASE
   ========================================================================== */

@media (max-width: 540px) {
  :root {
    --page-gutter: 14px;
  }
}


/* ==========================================================================
   07. REDUCED MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }


  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;

    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;

    transition-duration: 0.01ms !important;
  }
}