/* =============================================================================
   1 Percent Investment Club - Stylesheet
   White-dominant theme with gold/black accents. Mobile-first, then scaled up
   at the tablet (640px) and desktop (1024px, 1280px) breakpoints.
   ============================================================================= */

/* --------------------------------- Tokens -------------------------------- */
:root {
    --color-black: #0e0e10;
    --color-ink: #1c1c1f;
    --color-gold: #b3892b;
    --color-gold-light: #d4af5a;
    --color-gold-dark: #8c6a1f;
    --color-white: #ffffff;
    --color-offwhite: #faf9f6;
    --color-gray-100: #f3f2ee;
    --color-gray-200: #e6e4dd;
    --color-gray-400: #a8a6a0;
    --color-gray-600: #6b6a66;
    --color-gray-800: #333230;

    --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-heading: 'Georgia', 'Times New Roman', serif;

    --radius-sm: 4px;
    --radius-md: 10px;
    --radius-lg: 20px;

    --shadow-sm: 0 1px 3px rgba(14, 14, 16, 0.08);
    --shadow-md: 0 8px 24px rgba(14, 14, 16, 0.08);
    --shadow-lg: 0 20px 48px rgba(14, 14, 16, 0.12);

    --transition-fast: 150ms ease;
    --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);

    --container-width: 1200px;
}

/* --------------------------------- Reset --------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--color-ink);
    background: var(--color-white);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4 { font-family: var(--font-heading); line-height: 1.2; margin: 0 0 0.6em; color: var(--color-black); }
p { margin: 0 0 1em; }
button { font-family: inherit; cursor: pointer; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

.skip-link {
    position: absolute; left: -999px; top: 0;
    background: var(--color-black); color: var(--color-white);
    padding: 0.75em 1.25em; z-index: 1000;
}
.skip-link:focus { left: 0; }

.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

section { padding: 64px 0; }

/* -------------------------------- Buttons -------------------------------- */
.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.85em 1.8em;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    border: 1px solid transparent;
    overflow: hidden;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast), color var(--transition-fast);
    white-space: nowrap;
}
.btn--primary {
    background: var(--color-gold);
    color: var(--color-white);
}
.btn--primary:hover { background: var(--color-gold-dark); box-shadow: var(--shadow-md); transform: translateY(-1px); }
/* Subtle diagonal light sweep on hover - a restrained premium touch, not a gimmick. */
.btn--primary::after, .btn--dark::after {
    content: "";
    position: absolute;
    top: 0; left: -60%;
    width: 40%; height: 100%;
    background: linear-gradient(115deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    transform: skewX(-20deg);
    transition: left 650ms cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}
.btn--primary:hover::after, .btn--dark:hover::after { left: 130%; }
.btn--outline {
    background: transparent;
    border-color: var(--color-gray-200);
    color: var(--color-ink);
}
.btn--outline:hover { border-color: var(--color-black); }
.btn--ghost { background: transparent; color: var(--color-ink); }
.btn--ghost:hover { color: var(--color-gold); }
.btn--dark { background: var(--color-black); color: var(--color-white); }
.btn--dark:hover { background: var(--color-gold-dark); }
.btn--block { width: 100%; }
.btn--sm { padding: 0.5em 1.1em; font-size: 0.85rem; }

/* --------------------------------- Header --------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--color-gray-200);
}
.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    transition: padding var(--transition-base);
}
/* Applied via JS once the page scrolls past a threshold - a subtle premium
   touch (header tightens and gets slightly more opaque as you scroll). */
.site-header.is-scrolled {
    background: rgba(255, 255, 255, 0.97);
    box-shadow: var(--shadow-sm);
}
.site-header.is-scrolled .site-header__inner { padding: 8px 20px; }

/* Thin gold bar at the very top tracking scroll progress down the page. */
.scroll-progress {
    position: fixed;
    top: 0; left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, var(--color-gold-dark), var(--color-gold-light));
    z-index: 200;
    transition: width 80ms linear;
}
.site-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-black);
}
.nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 42px;
    height: 42px;
    background: none;
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius-sm);
}
.nav-toggle span {
    display: block;
    height: 2px;
    width: 20px;
    margin: 0 auto;
    background: var(--color-black);
    transition: transform var(--transition-fast), opacity var(--transition-fast);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.primary-nav {
    position: fixed;
    inset: 70px 0 0 0;
    background: var(--color-white);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 24px 20px 40px;
    transform: translateX(100%);
    transition: transform var(--transition-base);
    overflow-y: auto;
}
.primary-nav.is-open { transform: translateX(0); }
.primary-nav ul { display: flex; flex-direction: column; gap: 4px; }
.primary-nav a {
    display: block;
    padding: 14px 4px;
    font-weight: 600;
    border-bottom: 1px solid var(--color-gray-100);
}
.primary-nav a.is-active { color: var(--color-gold); }
.nav-auth { display: flex; flex-direction: column; gap: 10px; margin-top: 24px; }

/* -------------------------------- Hero -------------------------------- */
.hero {
    position: relative;
    padding: 90px 0 70px;
    background: linear-gradient(180deg, var(--color-offwhite) 0%, var(--color-white) 100%);
    overflow: hidden;
}
.hero::before {
    content: "";
    position: absolute;
    top: -120px; right: -120px;
    width: 360px; height: 360px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(179, 137, 43, 0.16), transparent 70%);
}
.hero__content { position: relative; max-width: 720px; }

/* Entrance animation for whatever's already above the fold on page load -
   staggered so the eyebrow, headline, lead, and buttons settle in sequence
   rather than all snapping in at once. Unconditional (not scroll-triggered)
   since this content is visible immediately. */
@keyframes heroFadeUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}
.hero__content > * {
    animation: heroFadeUp 900ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
.hero__content > *:nth-child(1) { animation-delay: 60ms; }
.hero__content > *:nth-child(2) { animation-delay: 160ms; }
.hero__content > *:nth-child(3) { animation-delay: 260ms; }
.hero__content > *:nth-child(4) { animation-delay: 360ms; }
.hero__eyebrow {
    display: inline-block;
    color: var(--color-gold-dark);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 14px;
}

/* Photographic hero variant - background image supplied per-page via the
   --hero-bg custom property, darkened with a gradient for text contrast. */
.hero--image {
    min-height: 480px;
    display: flex;
    align-items: center;
    background-image:
        linear-gradient(115deg, rgba(10, 10, 11, 0.88) 0%, rgba(10, 10, 11, 0.68) 45%, rgba(10, 10, 11, 0.42) 100%),
        var(--hero-bg);
    background-size: cover;
    background-position: center;
}
.hero--image::before { display: none; }
/* Compound ".hero.hero--image" (rather than ".hero--image" alone) so these
   reliably outrank the plain ".hero ..." text-color rules below, regardless
   of source order - both selectors would otherwise tie on specificity. */
.hero.hero--image .hero__eyebrow { color: var(--color-gold-light); }
.hero.hero--image h1,
.hero.hero--image h2 { color: var(--color-white); }
.hero.hero--image p.lead { color: rgba(255, 255, 255, 0.92); }
.hero.hero--image .btn--outline {
    border-color: rgba(255, 255, 255, 0.6);
    color: var(--color-white);
}
.hero.hero--image .btn--outline:hover {
    border-color: var(--color-white);
    background: rgba(255, 255, 255, 0.1);
}

/* Slimmer photographic hero used on interior pages (About/Opportunities/Blog/Contact) */
.hero--image.hero--sub { min-height: 340px; }

@media (min-width: 1024px) {
    .hero--image { min-height: 560px; }
}
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
.hero p.lead { font-size: 1.15rem; color: var(--color-gray-600); max-width: 60ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }

/* -------------------------------- Photo banner (full-width contextual image) -------------------------------- */
.photo-banner {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    min-height: 260px;
    background-size: cover;
    background-position: center;
    box-shadow: var(--shadow-md);
}
.photo-banner__caption {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 24px;
    background: linear-gradient(0deg, rgba(10, 10, 11, 0.88) 0%, rgba(10, 10, 11, 0.35) 70%, transparent 100%);
}
.photo-banner__caption h3 { color: var(--color-white); margin-bottom: 4px; font-size: 1.2rem; }
.photo-banner__caption p { color: rgba(255, 255, 255, 0.85); margin: 0; max-width: 60ch; }

@media (min-width: 1024px) {
    .photo-banner { min-height: 380px; }
    .photo-banner__caption { padding: 36px 40px; }
}

/* -------------------------------- Stats bar -------------------------------- */
.stats-bar {
    background: var(--color-black);
    color: var(--color-white);
    padding: 44px 0;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    text-align: center;
}
.stats-grid dt { font-family: var(--font-heading); font-size: 2rem; color: var(--color-gold-light); }
.stats-grid dd { margin: 4px 0 0; font-size: 0.85rem; color: var(--color-gray-400); text-transform: uppercase; letter-spacing: 0.06em; }

/* -------------------------------- Section headings -------------------------------- */
.section-heading { max-width: 640px; margin: 0 auto 40px; text-align: center; }
.section-heading .eyebrow {
    display: block;
    color: var(--color-gold-dark);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 10px;
}
.section-heading h2 { font-size: clamp(1.6rem, 3.5vw, 2.3rem); }
.section-heading p { color: var(--color-gray-600); }

/* -------------------------------- Cards / grids -------------------------------- */
.grid { display: grid; gap: 28px; }
.grid--2 { grid-template-columns: 1fr; }
.grid--3 { grid-template-columns: 1fr; }
.grid--4 { grid-template-columns: repeat(2, 1fr); }

.card {
    background: var(--color-white);
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card__media { aspect-ratio: 16/10; background: var(--color-gray-100); overflow: hidden; }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__body { padding: 22px; }
.card__body h3 { font-size: 1.15rem; margin-bottom: 8px; }
.card__meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }

.badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--color-gray-100);
    color: var(--color-gray-800);
}
.badge--gold { background: rgba(179, 137, 43, 0.14); color: var(--color-gold-dark); }
.badge--open { background: rgba(38, 128, 78, 0.12); color: #1f6b41; }
.badge--upcoming { background: rgba(179, 137, 43, 0.14); color: var(--color-gold-dark); }
.badge--closed { background: var(--color-gray-100); color: var(--color-gray-600); }
.badge--risk-low { background: rgba(38, 128, 78, 0.12); color: #1f6b41; }
.badge--risk-medium { background: rgba(179, 137, 43, 0.14); color: var(--color-gold-dark); }
.badge--risk-high { background: rgba(178, 47, 47, 0.1); color: #a52a2a; }

/* -------------------------------- Testimonials -------------------------------- */
.testimonial {
    background: var(--color-offwhite);
    border-radius: var(--radius-md);
    padding: 28px;
    border-left: 3px solid var(--color-gold);
}
.testimonial blockquote { margin: 0 0 14px; font-style: italic; color: var(--color-ink); }
.testimonial cite { font-style: normal; font-weight: 700; font-size: 0.9rem; }
.testimonial .role { display: block; font-weight: 400; color: var(--color-gray-600); font-size: 0.82rem; }

/* -------------------------------- Team / committee grid -------------------------------- */
.team-card { text-align: center; }
.team-card__photo {
    aspect-ratio: 1;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--color-gray-100);
    margin-bottom: 16px;
}
.team-card__photo img { width: 100%; height: 100%; object-fit: cover; }
.team-card h3 { margin-bottom: 2px; font-size: 1.1rem; }
.team-card .role { color: var(--color-gold-dark); font-weight: 600; font-size: 0.85rem; display: block; margin-bottom: 10px; }
.team-card p.bio { color: var(--color-gray-600); font-size: 0.92rem; }

/* -------------------------------- Forms -------------------------------- */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.9rem; }
.form-group .hint { display: block; font-weight: 400; color: var(--color-gray-600); font-size: 0.8rem; margin-top: 4px; }
.form-control {
    width: 100%;
    padding: 0.8em 1em;
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
    background: var(--color-white);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.form-control:focus {
    outline: none;
    border-color: var(--color-gold);
    box-shadow: 0 0 0 3px rgba(179, 137, 43, 0.15);
}
.form-control.is-invalid { border-color: #a52a2a; }
.field-error { color: #a52a2a; font-size: 0.82rem; margin-top: 6px; display: block; }
textarea.form-control { min-height: 140px; resize: vertical; }

.form-card {
    max-width: 560px;
    margin: 0 auto;
    background: var(--color-white);
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius-lg);
    padding: 36px 28px;
    box-shadow: var(--shadow-md);
}

/* -------------------------------- Alerts -------------------------------- */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin: 16px 0;
    font-size: 0.92rem;
}
.alert--success { background: rgba(38, 128, 78, 0.1); color: #1f6b41; border: 1px solid rgba(38, 128, 78, 0.25); }
.alert--error { background: rgba(178, 47, 47, 0.08); color: #a52a2a; border: 1px solid rgba(178, 47, 47, 0.25); }

/* -------------------------------- CTA band -------------------------------- */
.cta-band {
    background: var(--color-black);
    color: var(--color-white);
    border-radius: var(--radius-lg);
    padding: 48px 32px;
    text-align: center;
}
.cta-band h2 { color: var(--color-white); }
.cta-band p { color: var(--color-gray-400); max-width: 50ch; margin-left: auto; margin-right: auto; }
.cta-band .btn--outline { border-color: rgba(255, 255, 255, 0.5); color: var(--color-white); }
.cta-band .btn--outline:hover { border-color: var(--color-white); background: rgba(255, 255, 255, 0.1); }

/* -------------------------------- Footer -------------------------------- */
.site-footer { background: var(--color-offwhite); border-top: 1px solid var(--color-gray-200); padding: 56px 0 0; }
.site-footer__grid { display: grid; gap: 32px; grid-template-columns: 1fr; }
.site-footer__brand p { color: var(--color-gray-600); font-size: 0.9rem; max-width: 32ch; }
.site-footer__col h3 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 14px; }
.site-footer__col ul li { margin-bottom: 8px; }
.site-footer__col a:hover { color: var(--color-gold-dark); }
.site-footer__legal {
    border-top: 1px solid var(--color-gray-200);
    margin-top: 40px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--color-gray-600);
}
.site-footer__disclaimer { max-width: 80ch; }

/* -------------------------------- Scroll reveal -------------------------------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 700ms ease, transform 700ms ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* -------------------------------- Prose (rich admin-authored content) -------------------------------- */
/* Scoped typography for blog/opportunity body HTML - restores list markers
   and spacing that the global reset (ul{list-style:none}) strips out. */
.prose p { margin-bottom: 1.1em; }
.prose h2, .prose h3 { margin-top: 1.6em; }
.prose ul, .prose ol {
    margin: 0 0 1.1em;
    padding-left: 1.4em;
}
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { margin-bottom: 0.4em; }
.prose strong { color: var(--color-black); }
.prose a { color: var(--color-gold-dark); text-decoration: underline; }

/* -------------------------------- Dashboard / admin tables -------------------------------- */
.dashboard-panel {
    background: var(--color-white);
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius-md);
    padding: 28px;
    margin-bottom: 24px;
}
table.data-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
table.data-table th, table.data-table td {
    text-align: left;
    padding: 12px 14px;
    border-bottom: 1px solid var(--color-gray-100);
}
table.data-table th { color: var(--color-gray-600); font-weight: 600; text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.04em; }
.table-actions { display: flex; gap: 10px; }
.table-responsive { overflow-x: auto; }

/* -------------------------------- Utility -------------------------------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.u-flex-between { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* =============================================================================
   Breakpoints
   ============================================================================= */

/* Tablet and up */
@media (min-width: 640px) {
    .grid--2 { grid-template-columns: repeat(2, 1fr); }
    .grid--3 { grid-template-columns: repeat(2, 1fr); }
    .stats-grid { grid-template-columns: repeat(4, 1fr); }
    .site-footer__grid { grid-template-columns: repeat(2, 1fr); }
}

/* Desktop and up */
@media (min-width: 1024px) {
    .nav-toggle { display: none; }
    .primary-nav {
        position: static;
        flex-direction: row;
        align-items: center;
        transform: none;
        padding: 0;
        gap: 28px;
        background: transparent;
        overflow: visible;
    }
    .primary-nav ul { flex-direction: row; gap: 28px; }
    .primary-nav a { padding: 6px 0; border-bottom: none; position: relative; }
    .primary-nav a.is-active::after,
    .primary-nav a:hover::after {
        content: "";
        position: absolute;
        left: 0; right: 0; bottom: -4px;
        height: 2px;
        background: var(--color-gold);
    }
    .nav-auth { flex-direction: row; margin-top: 0; }

    .hero__actions { flex-wrap: nowrap; }
    .grid--3 { grid-template-columns: repeat(3, 1fr); }
    .grid--4 { grid-template-columns: repeat(4, 1fr); }
    .site-footer__grid { grid-template-columns: 2fr repeat(3, 1fr); }
}

@media (min-width: 1280px) {
    section { padding: 88px 0; }
}
