/* styles.css */

/* ==========================================================================
   1. CSS Variables
   ========================================================================== */
:root{
    --bg: #f8fafc;
    --panel: #ffffff;
    --text: #0f172a;
    --muted: #475569;
    --faint: #64748b;
    --line: rgba(0,0,0,0.08);
    --accent: #16a34a;
    --accent-dark: #15803d;
    --accent2: #2563eb;
    --warn: #d97706;
    --focus: #2563eb;
    --shadow: 0 12px 28px rgba(0,0,0,0.06);
    --shadow-sm: 0 6px 16px rgba(0,0,0,0.04);
    --radius: 18px;
    --radius2: 14px;
    --max: 1120px;
    --pad: clamp(16px, 3vw, 28px);
    --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Liberation Sans", sans-serif;

    /* Spacing scale */
    --s1: 4px;
    --s2: 8px;
    --s3: 12px;
    --s4: 16px;
    --s5: 24px;
    --s6: 32px;
    --s7: 56px;

    /* Type scale */
    --fs-sm: 14px;     /* secondary text, labels (minimum size) */
    --fs-base: 16px;   /* body copy */
    --fs-h3: 18px;
    --fs-h2: 26px;
}

/* ==========================================================================
   2. Reset & Base Styles
   ========================================================================== */
*{ box-sizing: border-box; }

html, body{ height: 100%; scroll-behavior: smooth; }
body{
    margin: 0;
    font-family: var(--font-sans);
    font-size: var(--fs-base);
    font-weight: 400;
    color: var(--text);
    background: var(--bg); /* solid fallback */
    line-height: 1.55;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Render the gradient as a single fixed composited layer */
body::before{
    content:"";
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background:
            radial-gradient(900px 520px at 12% 12%, rgba(37,99,235,0.06), transparent 62%),
            radial-gradient(850px 520px at 88% 22%, rgba(22,163,74,0.05), transparent 62%),
            radial-gradient(1000px 700px at 50% 92%, rgba(217,119,6,0.04), transparent 64%),
            linear-gradient(180deg, #f8fafc 0%, #f1f5f9 46%, #f8fafc 100%);
    transform: translateZ(0);
}

/* Subtle noise overlay to eliminate banding */
body::after{
    content:"";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.35'/%3E%3C/svg%3E");
    background-repeat: repeat;
}

h1, h2, h3{ font-weight: 700; color: var(--text); }
strong{ font-weight: 600; color: var(--text); }

a{ color: inherit; text-decoration: none; }
a:hover{ text-decoration: underline; text-underline-offset: 3px; }

/* Visible keyboard focus ring for every interactive element */
:focus-visible{
    outline: 3px solid var(--focus);
    outline-offset: 2px;
    border-radius: 6px;
}
.btn:focus-visible,
.nav a:focus-visible,
.nav-toggle-btn:focus-visible{ border-radius: 12px; }
main:focus, main:focus-visible{ outline: none; }

.skip{
    position:absolute; left:-9999px; top:auto; width:1px; height:1px; overflow:hidden;
}
.skip:focus{
    left: 12px; top: 12px; width:auto; height:auto; padding: 10px 12px;
    background: #111827; color: #ffffff; border: 1px solid var(--line); border-radius: 10px;
    z-index: 9999;
}

/* ==========================================================================
   3. Placeholder Content
   Template content stays in the HTML for the family to fill in, but is
   hidden from visitors. See the comment at the top of <main>.
   ========================================================================== */
.is-placeholder,
.is-placeholder-text{ display: none !important; }

/* Collapse wrappers whose only content is hidden placeholder links */
li:has(> a.is-placeholder:only-child),
.cta-row:not(:has(> :not(.is-placeholder))),
.badge-row:not(:has(> :not(.is-placeholder))){ display: none; }

/* Show a dash in a table cell whose only content is a hidden placeholder */
td:has(> .is-placeholder-text:only-child)::before{
    content: "—";
    color: var(--faint);
}

/* ==========================================================================
   4. Layout Components
   ========================================================================== */

/* Header */
.header{
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--line);
}
/* Blur lives on a pseudo-element: backdrop-filter on .header itself would make it the
   containing block for the fixed mobile drawer/overlay and trap them inside the header */
.header::before{
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(255,255,255,0.82);
}
.header-inner{
    max-width: var(--max);
    margin: 0 auto;
    padding: 10px var(--pad);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    position: relative;
}
.brand{
    display:flex;
    flex-direction: column;
    gap: 2px;
    min-width: 210px;
    flex-shrink: 0;
}
.brand .name{
    font-weight: 700;
    letter-spacing: 0.1px;
    font-size: 17px;
    line-height: 1.2;
}
.brand .meta{
    font-size: var(--fs-sm);
    color: var(--muted);
}

/* Hamburger Menu */
.nav-toggle-btn{
    display: none;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.9);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    flex-direction: column;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
    z-index: 1101;
    padding: 0;
    font: inherit;
    color: inherit;
}
.nav-toggle-btn span{
    width: 18px;
    height: 2px;
    background: var(--text);
    border-radius: 99px;
    opacity: 0.9;
    transition: transform 180ms ease, opacity 180ms ease;
}

.nav-overlay{
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    z-index: 1050;
    display: block;
    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms ease;
}

/* Main */
main{
    max-width: var(--max);
    margin: 0 auto;
    padding: var(--s5) var(--pad) var(--s7);
}

/* Footer */
.footer{
    margin-top: var(--s7);
    padding-top: var(--s4);
    border-top: 1px solid var(--line);
    color: var(--faint);
    font-size: var(--fs-sm);
    display:flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items:center;
    justify-content: space-between;
}

/* ==========================================================================
   5. UI Components
   ========================================================================== */

/* Navigation */
.nav{
    display:flex;
    align-items:center;
    gap: var(--s1);
    flex-wrap: wrap;
    justify-content: flex-end;
}
.nav a{
    display:inline-flex;
    align-items:center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 12px;
    border: 1px solid transparent;
    color: var(--muted);
    font-weight: 500;
    font-size: 15px;
    transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}
.nav a:hover{
    border-color: var(--line);
    background: rgba(0,0,0,0.04);
    text-decoration: none;
    color: var(--text);
}
.nav a.btn{ color: #ffffff; font-weight: 600; margin-left: var(--s1); }

/* Buttons */
.btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height: 44px;
    padding: 10px 16px;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.12);
    background: #ffffff;
    font-weight: 600;
    font-size: 15px;
    line-height: 1.2;
    color: var(--text);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    transition: background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}
.btn:hover{
    background: #f1f5f9;
    border-color: rgba(0,0,0,0.18);
    text-decoration: none;
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
    transform: translateY(-1px);
}
.btn:active{ transform: translateY(0); }
.btn.primary{
    border-color: rgba(22,163,74,0.30);
    background: linear-gradient(180deg, var(--accent), var(--accent-dark));
    color: #ffffff;
}
.btn.primary:hover{
    background: linear-gradient(180deg, var(--accent-dark), #166534);
}
.btn-lg{
    min-height: 56px;
    padding: 14px 32px;
    font-size: 18px;
    border-radius: 14px;
}

/* Badges */
.badge-row{
    display:flex;
    flex-wrap: wrap;
    gap: var(--s2);
}
.badge{
    display:inline-flex;
    align-items:center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #ffffff;
    color: var(--muted);
    font-size: var(--fs-sm);
    font-weight: 600;
    white-space: nowrap;
}
.badge.link:hover{
    background: #f1f5f9;
    text-decoration: none;
    color: var(--text);
}

/* Pills */
.pill-row{
    display:flex;
    gap: var(--s2);
    flex-wrap: wrap;
    align-items:center;
    margin-top: var(--s3);
}
.pill{
    padding: 6px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #ffffff;
    font-weight: 600;
    font-size: var(--fs-sm);
    color: var(--muted);
}

/* Cards */
.card{
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius2);
    padding: var(--s5);
    box-shadow: var(--shadow-sm);
}
.card h3{ margin: 0 0 var(--s2); font-size: var(--fs-h3); line-height: 1.3; }
.card p{ margin: 0; color: var(--muted); }

/* Key-Value Pairs */
.kv{
    display:grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: var(--s3);
}
.kv .item{
    padding: var(--s3) var(--s4);
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 12px;
}
.kv .k{
    font-size: var(--fs-sm);
    color: var(--faint);
    margin-bottom: 2px;
    font-weight: 500;
}
.kv .v{
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
}

/* Lists */
.list{
    margin: 0;
    padding-left: 20px;
    color: var(--muted);
}
.list li{ margin: var(--s2) 0; }
.list li::marker{ color: var(--accent); }
.list a{ color: var(--accent2); font-weight: 500; }

/* CTA Rows */
.cta-row{
    display:flex;
    gap: var(--s3);
    flex-wrap: wrap;
    margin-top: var(--s4);
}

/* ==========================================================================
   6. Content Sections
   ========================================================================== */

/* Hero Section: profile + stats + media
   Desktop: profile | media, stats strip full width below.
   Mobile (see media queries): profile, stats, media stacked. */
.hero{
    display: grid;
    grid-template-columns: 5fr 7fr;
    grid-template-areas:
        "profile media"
        "stats   stats";
    gap: var(--s5);
    align-items: stretch;
}
.hero-profile{ grid-area: profile; }
.hero-media{ grid-area: media; }
.stats{ grid-area: stats; }

.panel{
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.panel-inner{
    flex: 1;
    padding: var(--s5);
    background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(248,250,252,0.95));
    display: flex;
    flex-direction: column;
    gap: var(--s4);
}
.panel-title{
    margin: 0;
    font-size: var(--fs-h3);
    line-height: 1.3;
}

.eyebrow{
    margin: 0;
    font-size: var(--fs-sm);
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--accent-dark);
}
.headline{
    font-size: clamp(34px, 4vw, 48px);
    line-height: 1.05;
    letter-spacing: -0.02em;
    margin: calc(var(--s2) * -1) 0 0;
}
.subline{
    margin: calc(var(--s3) * -1) 0 0;
    font-size: 17px;
    font-weight: 500;
    color: var(--muted);
}
.subhead{
    margin: 0;
    color: var(--muted);
    font-size: var(--fs-base);
    max-width: 60ch;
}
.hero .cta-row{ margin-top: auto; padding-top: var(--s1); }

/* Stat strip */
.stats{
    margin: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.stat{
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: var(--s4) var(--s5);
    border-left: 1px solid var(--line);
}
.stat:first-child{ border-left: none; }
.stat dt{
    order: 2;
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--muted);
}
.stat dd{ margin: 0; }
.stat-value{
    order: 1;
    font-size: clamp(26px, 2.6vw, 32px);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}
.stat:nth-child(1) .stat-value{ color: var(--accent-dark); }
.stat:nth-child(2) .stat-value{ color: #b45309; }
.stat-note{
    order: 3;
    font-size: var(--fs-sm);
    color: var(--faint);
}

/* Video (16:9). An <iframe> embed placed inside fills the frame. */
.video{
    aspect-ratio: 16 / 9;
    width: 100%;
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    border: 1px solid var(--line);
    border-radius: var(--radius2);
    display:flex;
    align-items:center;
    justify-content:center;
    position: relative;
    overflow: hidden;
}
.video::before{
    content:"";
    position:absolute;
    inset: -35%;
    background:
        radial-gradient(circle at 30% 40%, rgba(37,99,235,0.10), transparent 58%),
        radial-gradient(circle at 70% 65%, rgba(22,163,74,0.08), transparent 58%);
    transform: rotate(8deg);
    opacity: 0.9;
}
.video iframe{
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}
.video-content{
    position: relative;
    padding: var(--s4);
    text-align:center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--s3);
    color: var(--text);
}
.video-title{
    font-weight: 600;
    margin: 0;
    color: var(--text);
}
.play{
    width: 64px; height: 64px; border-radius: 99px;
    border: 1px solid rgba(0,0,0,0.10);
    background: rgba(255,255,255,0.9);
    display:flex; align-items:center; justify-content:center;
    box-shadow: 0 10px 18px rgba(0,0,0,0.06);
}
.play span{
    display:block;
    width: 0; height: 0;
    border-left: 18px solid var(--accent2);
    border-top: 11px solid transparent;
    border-bottom: 11px solid transparent;
    margin-left: 4px;
}

/* Photo (flush at the top of the profile panel) */
.photo{
    display: block;
    border-bottom: 1px solid var(--line);
    background: #f1f5f9;
}
.photo img{
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    display: block;
}
.photo-placeholder{
    display: none;
    width: 100%;
    aspect-ratio: 3 / 2;
    background:
        radial-gradient(circle at 30% 40%, rgba(37,99,235,0.12), transparent 60%),
        radial-gradient(circle at 70% 70%, rgba(22,163,74,0.12), transparent 60%),
        #f8fafc;
    align-items: center;
    justify-content: center;
}
.photo-placeholder span{
    width: 96px; height: 96px; border-radius: 99px;
    display:flex; align-items:center; justify-content:center;
    background: #ffffff;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
    font-size: 30px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--accent-dark);
}
.photo.no-image img{ display: none; }
.photo.no-image .photo-placeholder{ display: flex; }

/* Sections */
.section{ margin-top: var(--s7); }
/* Keep native #hash jumps clear of the sticky header (JS jumps compute the offset too) */
.section[id]{ scroll-margin-top: 80px; }

.section-head{
    display:flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--s2) var(--s4);
    margin: 0 0 var(--s4);
    padding-bottom: var(--s3);
    border-bottom: 2px solid var(--line);
    position: relative;
}
/* Short green accent under each section heading */
.section-head::after{
    content: "";
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 48px;
    height: 2px;
    background: var(--accent);
}
.section-head h2{
    margin: 0;
    font-size: var(--fs-h2);
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.block{ margin-top: var(--s5); }
.block-title{
    margin: 0 0 var(--s3);
    font-size: var(--fs-h3);
    line-height: 1.3;
}

/* Grids: auto-fit so a hidden placeholder card lets the others fill the row */
.grid2{
    display:grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
    gap: var(--s4);
}

/* Tables */
.table-wrap{
    overflow-x: auto;
    border-radius: var(--radius2);
}
.card .table-wrap{ margin-top: var(--s3); }
table{
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: var(--radius2);
    border: 1px solid var(--line);
    background: #ffffff;
    box-shadow: var(--shadow-sm);
}
table.table-wide{ min-width: 620px; }
th, td{
    text-align: left;
    padding: var(--s3) var(--s4);
    border-bottom: 1px solid var(--line);
    font-size: 15px;
    color: var(--muted);
    vertical-align: top;
}
th{
    font-size: var(--fs-sm);
    color: var(--faint);
    background: #f8fafc;
    font-weight: 600;
    white-space: nowrap;
}
th:first-child{ border-top-left-radius: var(--radius2); }
th:last-child{ border-top-right-radius: var(--radius2); }
tbody tr:last-child td{ border-bottom: none; }
td strong{ color: var(--text); font-weight: 600; }

/* Contact: final call to action */
.contact-cta{
    text-align: center;
    padding: var(--s7) var(--s5);
    border-radius: var(--radius);
    border: 1px solid rgba(22,163,74,0.20);
    background:
        radial-gradient(600px 240px at 50% 0%, rgba(22,163,74,0.10), transparent 70%),
        radial-gradient(500px 220px at 50% 100%, rgba(37,99,235,0.06), transparent 70%),
        #ffffff;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--s3);
}
.contact-cta h2{
    margin: 0;
    font-size: clamp(28px, 3.2vw, 36px);
    line-height: 1.15;
    letter-spacing: -0.01em;
}
.contact-lead{
    margin: 0 0 var(--s2);
    color: var(--muted);
    font-size: 17px;
}
.contact-email{
    margin: 0;
    font-size: var(--fs-base);
}
.contact-email a{ color: var(--accent2); font-weight: 500; }
.contact-profiles{ margin: 0; color: var(--muted); }
.references{ margin-top: var(--s4); }

/* ==========================================================================
   7. Media Queries
   ========================================================================== */
@media (max-width: 900px){
    .header-inner{
        padding: 12px var(--pad);
        position: static;
    }

    .nav-toggle-btn{
        display: inline-flex;
        position: relative;
        z-index: 1200;
    }

    .nav{
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        width: min(86vw, 340px);
        padding: 16px;
        padding-top: 76px;
        background: #ffffff;
        border-left: 1px solid var(--line);
        box-shadow: -18px 0 40px rgba(0,0,0,0.14);
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 8px;
        transform: translateX(105%);
        visibility: hidden;
        transition: transform 220ms ease, visibility 0s linear 220ms;
        z-index: 1100;
    }

    .nav a{
        justify-content: flex-start;
        padding: 12px 12px;
        border-radius: 12px;
        background: rgba(0,0,0,0.02);
        color: var(--text);
        font-size: 16px;
    }
    .nav a:hover{
        border-color: var(--line);
        background: rgba(0,0,0,0.08);
        text-decoration: none;
    }
    .nav a.btn{
        justify-content: center;
        margin: 6px 0 0;
        background: linear-gradient(180deg, var(--accent), var(--accent-dark));
        color: #ffffff;
    }
    .nav a.btn:hover{
        background: linear-gradient(180deg, var(--accent-dark), #166534);
    }

    .header.nav-open .nav{
        transform: translateX(0);
        visibility: visible;
        transition: transform 220ms ease, visibility 0s linear 0s;
    }
    .header.nav-open .nav-overlay{
        opacity: 1;
        pointer-events: auto;
    }

    /* Animate hamburger into an "X" */
    .header.nav-open .nav-toggle-btn span:nth-child(1){
        transform: translateY(7px) rotate(45deg);
    }
    .header.nav-open .nav-toggle-btn span:nth-child(2){
        opacity: 0;
    }
    .header.nav-open .nav-toggle-btn span:nth-child(3){
        transform: translateY(-7px) rotate(-45deg);
    }

    .brand{ min-width: 0; flex-shrink: 1; }

    .hero{
        grid-template-columns: 1fr;
        grid-template-areas:
            "profile"
            "stats"
            "media";
        gap: var(--s4);
    }
    .stats{ grid-template-columns: repeat(2, 1fr); }
    .stat:nth-child(odd){ border-left: none; }
    .stat:nth-child(n+3){ border-top: 1px solid var(--line); }

    .section{ margin-top: var(--s6); }
}

@media (max-width: 560px){
    /* The hero eyebrow carries class/school/town on phones; keep the sticky header compact */
    .brand .meta{ display: none; }
    .panel-inner{ padding: var(--s4) var(--s4) var(--s5); }
    .card{ padding: var(--s4); }
    .stat{ padding: var(--s3) var(--s4); }
    .hero .cta-row .btn{ flex: 1 1 auto; }
    th, td{ padding: 10px 8px; }
    th:first-child, td:first-child{ padding-left: 12px; }
    .contact-cta{ padding: var(--s6) var(--s4); }
    .contact-cta .btn-lg{ width: 100%; }
}

@media (prefers-reduced-motion: reduce){
    html, body{ scroll-behavior: auto; }
    .nav-toggle-btn span, .btn, .nav a{ transition: none !important; }
    .btn:hover{ transform: none; }
}
