/*
 * base.css — reset, element defaults, typography, buttons, forms, layout
 * primitives. No component or block styles: those live in components.css and
 * blocks.css. Mobile-first throughout.
 */

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--gg-header-h) + var(--gg-space-4));
}

body {
    margin: 0;
    font-family: var(--gg-font);
    font-size: var(--gg-text-base);
    font-weight: 400;
    line-height: 1.65;
    color: var(--gg-ink);
    background: var(--gg-surface);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Elements the browser still gives its own margins to.
 *
 * <figure> is the one that mattered: the UA default is `margin: 1em 40px`, and
 * nothing here reset it, so every figure without a component rule sat 40px
 * outside its parent on each side. On a 375px phone that pushed the page
 * 24px wider than the screen and gave the whole site a horizontal scrollbar —
 * the figure was 343px wide inside a 343px parent, but starting 40px in.
 *
 * Components that want space around a figure set it themselves. */
figure,
blockquote,
dl,
dd { margin: 0; }

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 0.5em;
    font-family: var(--gg-font-display);
    /* 700, not 500. The reference site sets headings smaller AND bolder, and
       that pairing is what stops a large heading reading as shouty. Montserrat
       at 500 also looked underweight against its own body text. */
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0;
    color: var(--gg-ink-900);
    text-wrap: balance;
}

h1 { font-size: var(--gg-display-1); }
h2 { font-size: var(--gg-display-2); }
h3 { font-size: var(--gg-text-2xl); letter-spacing: -0.01em; }
h4 { font-size: var(--gg-text-xl); }

p { margin: 0 0 1rem; }

a { color: var(--gg-primary); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--gg-primary-strong); }

img, svg { display: block; max-width: 100%; height: auto; }

ul, ol { padding-left: 1.25rem; }

strong { font-weight: 600; }

hr {
    border: 0;
    border-top: 1px solid var(--gg-border);
    margin: var(--gg-space-6) 0;
}

::selection { background: var(--gg-gold-200); color: var(--gg-ink-900); }

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

/* -------------------------------------------------------------------------
 * Layout primitives
 * ---------------------------------------------------------------------- */
.container {
    width: min(100% - 2 * var(--gg-gutter), var(--gg-container));
    margin-inline: auto;
}

/* Generous vertical space is most of what makes the reference site read as
   calm. The floor moves 56px -> 72px, which is where the narrow end was
   cramping; the ceiling follows so wide screens keep the proportion. */
.section { padding-block: clamp(4.5rem, 6.5vw, 8rem); }
/* The navbar is sticky, so anchored sections stop clear of it. */
:target { scroll-margin-top: 6rem; }

/* Scroll reveal.
 * Nothing is hidden until js/ui.js puts `reveal-on` on <html>, so if the script
 * never loads — or motion is unwelcome — the content is simply there. */
[data-reveal] {
    transition: opacity 700ms var(--gg-ease), transform 700ms var(--gg-ease);
    transition-delay: var(--reveal-delay, 0ms);
}

.reveal-on [data-reveal]:not(.is-revealed) {
    opacity: 0;
    transform: translateY(18px);
}

@media (prefers-reduced-motion: reduce) {
    .reveal-on [data-reveal]:not(.is-revealed) { opacity: 1; transform: none; }
    [data-reveal] { transition: none; }
}
.section--alt { background: var(--gg-surface-band); }
.section--dark { background: var(--gg-green-950); color: var(--gg-ink-100); }
.section--dark h2, .section--dark h3 { color: #fff; }

.section__head { max-width: 46rem; margin-bottom: var(--gg-space-7); }
.section__head--center { margin-inline: auto; text-align: center; }
.section__eyebrow { margin: 0 0 var(--gg-space-3); }
/* Reference-theme titles: light uppercase display caps. */
.section__head h2 {
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.section__lead { font-size: var(--gg-text-lg); color: var(--gg-ink-muted); }
.section--dark .section__lead { color: var(--gg-ink-200); }

/* 12-column grid + gutters, no framework needed */
.grid { display: grid; gap: var(--gg-space-5); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 60rem) {
    .grid--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 42rem) {
    .grid--2 { grid-template-columns: 1fr; }
    .grid--3 { grid-template-columns: 1fr; }
    .grid--4 { grid-template-columns: 1fr; }
}

/* Text for screen readers only (icon-only buttons, slide names). */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 100;
}

.skip-link:focus {
    left: var(--gg-space-3);
    top: var(--gg-space-3);
    padding: var(--gg-space-3) var(--gg-space-4);
    background: var(--gg-surface);
    border-radius: var(--gg-radius);
    box-shadow: var(--gg-shadow-lg);
    color: var(--gg-ink-900);
    font-weight: 600;
}

/* -------------------------------------------------------------------------
 * Eyebrow / kicker
 * ---------------------------------------------------------------------- */
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    font-family: var(--gg-font-display);
    font-size: var(--gg-text-sm);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gg-accent-strong);
}

.eyebrow::before {
    content: "";
    width: 1.75rem;
    height: 2px;
    background: var(--gg-accent);
    border-radius: 2px;
}

.section--dark .eyebrow { color: var(--gg-gold-300); }

/* -------------------------------------------------------------------------
 * Buttons
 * ---------------------------------------------------------------------- */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5em;
    min-height: 48px;
    padding: 0.7rem 1.4rem;
    border: 1px solid transparent;
    /* Pill, as on the reference site: its CTAs are fully rounded, and at a
       48px control height a pill is what 20px-on-44px reads as there. */
    border-radius: var(--gg-radius-full);
    font-family: var(--gg-font-display);
    font-size: var(--gg-text-base);
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: transform var(--gg-speed) var(--gg-ease), background-color var(--gg-speed) var(--gg-ease), border-color var(--gg-speed) var(--gg-ease), box-shadow var(--gg-speed) var(--gg-ease);
}

/* A touch more lift than before, and only on devices that actually hover —
   on a phone :hover sticks after a tap and leaves the button raised. */
@media (hover: hover) {
    .button:hover { transform: translateY(-2px); }
}

.button--primary { background: var(--gg-accent-strong); color: #fff; }
.button--primary:hover { background: var(--gg-gold-700); box-shadow: var(--gg-shadow); }

.button--green { background: var(--gg-primary); color: #fff; }
.button--green:hover { background: var(--gg-primary-strong); box-shadow: var(--gg-shadow); }

.button--outline { background: transparent; border-color: currentColor; color: var(--gg-green-800); }
.button--outline:hover { background: var(--gg-green-50); }

.button--ghost { background: transparent; color: var(--gg-ink-700); }
.button--ghost:hover { background: var(--gg-ink-100); }

.button--on-dark { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.22); color: #fff; backdrop-filter: blur(4px); }
.button--on-dark:hover { background: rgba(255, 255, 255, 0.16); }

.button--sm { min-height: 40px; padding: 0.5rem 1rem; font-size: var(--gg-text-sm); }

/* -------------------------------------------------------------------------
 * Forms (public + auth; admin builds on top)
 * ---------------------------------------------------------------------- */
label { display: block; font-weight: 600; margin-bottom: var(--gg-space-2); }

input[type="text"], input[type="email"], input[type="tel"], input[type="url"],
input[type="password"], input[type="number"], input[type="date"], select, textarea {
    width: 100%;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--gg-border);
    border-radius: var(--gg-radius);
    font: inherit;
    color: var(--gg-ink);
    background: var(--gg-surface);
    transition: border-color var(--gg-speed) var(--gg-ease), box-shadow var(--gg-speed) var(--gg-ease);
}

input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: none;
    border-color: var(--gg-primary);
    box-shadow: 0 0 0 3px var(--gg-green-100);
}

/* -------------------------------------------------------------------------
 * Reduced motion
 * ---------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}
