/* ==========================================================================
   Base: reset, typography, page scaffolding. Mobile-first.
   ========================================================================== */

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

* { margin: 0; }

/* The hidden attribute has to beat component styling. A component that sets
   `display: flex` otherwise overrides the browser's `display: none` for
   hidden="", and the element stays on screen however often the JS hides it. */
[hidden] { display: none !important; }

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: var(--fs-body);
    line-height: 1.65;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    /* Faint grain so large dark areas don't band */
    background-image:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(212, 175, 55, 0.05), transparent),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.02 0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}

main { flex: 1; }

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

/* --- Headings: display serif, tight leading --- */
h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 500;
    color: var(--text-strong);
    line-height: 1.12;
    letter-spacing: 0.01em;
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }

p { max-width: 65ch; }

a {
    color: var(--gold);
    text-decoration: none;
    transition: color 0.25s var(--ease-lux);
}
a:hover { color: var(--gold-bright); }

::selection { background: var(--gold-25); color: var(--text-strong); }

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

.section { padding-block: var(--sp-8); }

/* Uppercase tracked kicker above headings — the house label style */
.kicker {
    display: block;
    font-family: var(--font-body);
    font-size: var(--fs-label);
    letter-spacing: var(--track-label);
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: var(--sp-3);
}

/* Thin gold rule used as a section divider motif */
.rule {
    width: 56px;
    height: 1px;
    background: linear-gradient(90deg, var(--gold), transparent);
    border: 0;
    margin: var(--sp-4) 0;
}

.muted { color: var(--muted); }
.small { font-size: var(--fs-small); }

/* --- Scroll reveal (driven by reveal.js) --- */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.8s var(--ease-lux), transform 0.8s var(--ease-lux);
}
.reveal.is-visible {
    opacity: 1;
    transform: none;
}
/* Optional stagger for card grids */
.reveal[data-delay="1"] { transition-delay: 0.12s; }
.reveal[data-delay="2"] { transition-delay: 0.24s; }
.reveal[data-delay="3"] { transition-delay: 0.36s; }

/* --- Reduced motion: everything settles instantly --- */
@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;
    }
    .reveal { opacity: 1; transform: none; }
}

/* --- Focus visibility --- */
:focus-visible {
    outline: 1px solid var(--gold);
    outline-offset: 3px;
}

/* --- Utilities --- */
.centered { text-align: center; }

/* Readable by screen readers, invisible on screen. */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    border: 0;
    clip-path: inset(50%);
    white-space: nowrap;
}
