/* ==========================================================================
   main.css — Avocado Technology
   Global reset, CSS custom properties, utility classes
   Read DESIGN.md before editing anything in this file.
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Reset (DESIGN.md section 13)
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Ensure the HTML `hidden` attribute always wins over display rules. */
[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  font-size: 0.9375rem;
  color: var(--fg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background:
    radial-gradient(ellipse 80% 60% at 10% 40%,
      hsla(100,50%,65%,0.5) 0%, transparent 60%),
    radial-gradient(ellipse 70% 50% at 90% 30%,
      hsla(160,40%,55%,0.4) 0%, transparent 55%),
    radial-gradient(ellipse 80% 70% at 50% 90%,
      hsla(45,60%,75%,0.45) 0%, transparent 50%),
    radial-gradient(ellipse 60% 50% at 30% 10%,
      hsla(80,45%,70%,0.3) 0%, transparent 50%),
    radial-gradient(ellipse 50% 40% at 80% 80%,
      hsla(130,35%,55%,0.3) 0%, transparent 50%),
    hsl(40, 30%, 97%);
  background-attachment: fixed;
  min-height: 100vh;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: var(--font-primary);
  cursor: pointer;
}

section {
  background: transparent;
}

/* --------------------------------------------------------------------------
   CSS Custom Properties (DESIGN.md sections 2–5)
   -------------------------------------------------------------------------- */
:root {
  /* Font */
  --font-primary: 'Plus Jakarta Sans', sans-serif;

  /* Brand colours */
  --bg:           hsl(40, 30%, 97%);
  --fg:           hsl(20, 10%, 12%);
  --muted:        hsl(20, 5%, 45%);
  --card:         hsl(40, 20%, 96%);
  --border:       hsl(40, 10%, 88%);
  --accent:       hsl(100, 40%, 30%);
  --primary:      hsl(20, 10%, 12%);
  --primary-fg:   hsl(40, 30%, 97%);
  --radius:       1rem;

  /* Greens */
  --green-light:  hsla(100, 50%, 85%, 0.6);
  --green-mid:    hsla(100, 40%, 30%, 1);
  --green-border: hsla(100, 30%, 60%, 1);

  /* Semantic */
  --error:        hsl(0, 70%, 50%);
  --success:      hsl(100, 40%, 30%);

  /* Shadows (DESIGN.md section 5) */
  --shadow-sm:    0 2px 8px rgba(0,0,0,0.06);
  --shadow-md:    0 10px 40px -10px rgba(0,0,0,0.10);
  --shadow-lg:    0 16px 56px -10px rgba(0,0,0,0.14);
  --shadow-focus: 0 0 0 3px hsla(100,40%,50%,0.25);

  /* Spacing (DESIGN.md section 3) */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Max widths */
  --max-width-content: 72rem;
  --max-width-narrow:  48rem;
  --max-width-prompt:  42rem;

  /* Border radius (DESIGN.md section 4) */
  --radius-sm:   0.5rem;
  --radius-md:   0.75rem;
  --radius-lg:   1rem;
  --radius-xl:   1.5rem;
  --radius-full: 9999px;
}

/* --------------------------------------------------------------------------
   Typography (DESIGN.md section 1)
   -------------------------------------------------------------------------- */
h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--fg);
}

h2 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--fg);
}

h3 {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--fg);
}

h4 {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--fg);
}

/* --------------------------------------------------------------------------
   Utility Classes
   -------------------------------------------------------------------------- */

/* Layout */
.container {
  max-width: var(--max-width-content);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.container--narrow {
  max-width: var(--max-width-narrow);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.section {
  padding: var(--space-24) 0;
}

/* Text */
.eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-3);
}

.accent { color: var(--accent); }

.text-center  { text-align: center; }
.text-muted   { color: var(--muted); }
.text-heading { color: var(--fg); }

/* Grid helpers */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-6);
}

/* Section header block */
.section-header {
  text-align: center;
  margin-bottom: var(--space-12);
}

.section-header h2 {
  margin-top: var(--space-3);
}

.section-header p {
  font-size: 1.125rem;
  color: var(--muted);
  max-width: 560px;
  margin: var(--space-4) auto 0;
  line-height: 1.65;
}

/* Visually hidden (accessibility) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   Hero section layout
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 80px;
}

.hero-fg {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  max-width: var(--max-width-narrow);
  padding: 0 var(--space-6) 7rem;
}

.hero-headline {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--fg);
  margin-bottom: var(--space-5);
}

.hero-headline .accent {
  color: var(--accent);
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--muted);
  margin-top: var(--space-5);
  margin-bottom: var(--space-10);
  max-width: 480px;
  line-height: 1.6;
}

@media (max-width: 768px) {
  .hero-fg { padding-bottom: 4rem; }

  /* background-attachment: fixed forces a full-page repaint on every scroll
     frame on mobile browsers (disables GPU compositing). Switch to scroll
     so the gradient blobs scroll with the page instead of repainting. */
  body { background-attachment: scroll; }
}