/* ===== Reset & Variables ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Brand palette — exact hex codes per "colours for the rooted here website.pdf" */
    --bg: #e8e6d8;       /* main background */
    --bg-dark: #d7ccb5;  /* top bar section */
    --text: #1e1f1e;     /* all text */
    --dark: #1e1f1e;     /* dark fills (pills, logo) share the text near-black */
    /* accent colours */
    --yellow: #dfa22f;
    --red: #e35330;
    --green: #196e3f;
    --blue: #1b98ad;     /* single teal/blue accent from the palette */
    --teal: #1b98ad;
    --white: #FFFFFF;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

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

img {
    display: block;
}

/* ===== Navigation ===== */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 28px;
    background: var(--bg-dark);
}

.logo {
    width: 72px;   /* ~50% larger than the previous 48px */
    height: 72px;
    background: var(--dark);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    /* Keep the top bar its ORIGINAL height: via negative margins the logo only adds
       its old 48px to the row, while the full 72px droops ~18px (25%) below the bar. */
    margin: 8px 0 -32px;
    position: relative;
    z-index: 10;
}

.logo-mark {
    width: 72%;
    height: auto;
    display: block;
    /* PNG is black-on-transparent; invert renders it white inside the dark circle */
    filter: invert(1);
}

.nav-links {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.nav-pill {
    background: var(--dark);
    color: var(--white);
    font-size: 10.5px;
    font-weight: 500;
    padding: 7px 14px;
    border-radius: 20px;
    letter-spacing: 0.2px;
    transition: opacity 0.2s;
    white-space: nowrap;
}

.nav-pill:hover {
    opacity: 0.8;
}

/* ===== Hero Section ===== */
.hero {
    background: var(--bg);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

.hero-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 24px 40px;
    position: relative;
}

.hero h1 {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: clamp(2.2rem, 5.5vw, 4.2rem);
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: -0.015em;
    color: var(--text);
    text-align: center;
}

.hero h1 .line {
    display: block;
}

.hero h1 .line.scroll-link {
    cursor: pointer;
    transition: opacity 0.2s;
}
.hero h1 .line.scroll-link:hover {
    opacity: 0.7;
}

/* Hero brand image — replaces the old `.brand-text` span */
.hero h1 .brand-line {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.brand-logo {
    height: clamp(3.4rem, 9vw, 6.8rem);
    width: auto;
    display: inline-block;
    vertical-align: middle;
}

/* ===== Inline Shapes ===== */
.shape {
    display: inline-block;
    vertical-align: middle;
    position: relative;
    top: -3px;
}

.shape.dot {
    /* em-based so they track the heading; ~just taller than the glyphs */
    width: 0.95em;
    height: 0.95em;
    border-radius: 50%;
    margin: 0 0.12em;
}

.shape.pill {
    width: 1.8em;
    height: 0.95em;
    border-radius: 999px;
    margin: 0 0.12em;
}

.shape.dot.yellow { background: var(--yellow); }
.shape.dot.red { background: var(--red); }
.shape.dot.blue { background: var(--blue); }
.shape.dot.green, .shape.pill.green { background: var(--green); }
.shape.dot.teal { background: var(--teal); }

/* Down arrow shape */
.shape.arrow-down {
    width: 0.95em;
    height: 1.95em;   /* ~50% longer than before; scales with the heading */
    border-radius: 999px;
    background: var(--yellow);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 0.12em;
    /* Sit the top of the pill at the top of the text and let it hang downward,
       rather than the old centred position that poked above the line. */
    vertical-align: text-top;
    top: 0.1em;
}

.shape.arrow-down svg {
    display: block;
    width: 54%;
    height: 68%;
}

/* ===== Class Grid ===== */
.class-section {
    background: var(--bg);
    padding: 40px 28px 80px;
}

.students {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 32px 32px;
}

/* Stepped responsive: drop one column at each breakpoint instead of cramming */
@media (max-width: 1024px) { .students { grid-template-columns: repeat(6, 1fr); } }
@media (max-width: 850px)  { .students { grid-template-columns: repeat(5, 1fr); } }
@media (max-width: 680px)  { .students { grid-template-columns: repeat(4, 1fr); gap: 24px 18px; } }
@media (max-width: 480px)  { .students { grid-template-columns: repeat(3, 1fr); gap: 22px 14px; } }

.student {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}

.student:hover {
    transform: scale(1.06);
}

.avatar {
    width: 82%;
    aspect-ratio: 1;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: #c0b8a8;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar {
    background: transparent;
}

/* Artsy illustrations: square frame, image flows freely (hair etc not clipped) */
.avatar.illustration {
    border-radius: 0;
    overflow: visible;
    background: transparent;
}
.avatar.illustration img {
    object-fit: contain;
}

.profile-photo.illustration {
    border-radius: 0;
    overflow: visible;
    background: transparent;
}
.profile-photo.illustration img {
    object-fit: contain;
}
.profile-photo.illustration::after {
    display: none;
}

/* Placeholder avatar (form-only students with no source art yet) */
.avatar.placeholder,
.profile-photo.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
}
.avatar.placeholder .initials {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: clamp(20px, 3.5vw, 36px);
    font-weight: 700;
    color: var(--white);
    letter-spacing: 0.5px;
}
.profile-photo.placeholder .initials {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 64px;
    font-weight: 700;
    color: var(--white);
    letter-spacing: 1px;
}
.profile-photo.placeholder::after {
    display: none;
}

/* Sketch art avatar backgrounds */
.avatar.sketch-blue { background: var(--blue); }
.avatar.sketch-red { background: var(--red); }
.avatar.sketch-red-warm { background: #D94A38; }
.avatar.sketch-green { background: var(--green); }
.avatar.sketch-dark { background: #2E3D50; }
.avatar.sketch-teal { background: #2A8A7A; }
.avatar.sketch-orange { background: #E07830; }
.avatar.sketch-yellow { background: #E8B830; }

.avatar .sketch-face {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.student .name {
    font-size: 10.5px;
    font-weight: 600;
    text-align: center;
    letter-spacing: 0.1px;
    line-height: 1.3;
    color: var(--text);
}

/* ===== Profile Page ===== */
.profile-page {
    background: var(--bg);
}

.profile-section {
    display: flex;
    gap: 28px;
    padding: 24px 28px 36px;
    align-items: flex-start;
}

.profile-photo {
    width: 190px;
    height: 190px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
    background: #b0a898;
}

.profile-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-photo {
    background: transparent;
}

.profile-photo::after {
    content: '';
    position: absolute;
    top: 10%;
    right: 14%;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.85) 0%, rgba(255,255,255,0.3) 40%, rgba(255,255,255,0) 70%);
    pointer-events: none;
}

.profile-info {
    flex: 1;
    min-width: 0;
    padding-top: 8px;
}

.profile-name {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dot-indicator {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-block;
}

.dot-indicator.teal { background: var(--teal); }
.dot-indicator.green { background: var(--green); }

/* ===== Profile bio / specialties / socials ===== */
.specialties {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}

.spec-tag {
    background: var(--dark);
    color: var(--white);
    font-size: 10px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 999px;
    letter-spacing: 0.2px;
}

.bio {
    font-size: 12px;
    font-weight: 400;
    line-height: 1.7;
    color: var(--text);
    opacity: 0.85;
    margin-bottom: 16px;
    max-width: 720px;
}

.socials {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.socials li a {
    display: inline-block;
    background: var(--bg-dark);
    color: var(--text);
    font-size: 10.5px;
    font-weight: 500;
    padding: 5px 12px;
    border-radius: 999px;
    transition: opacity 0.2s;
}

.socials li a:hover {
    opacity: 0.7;
}

/* ===== Portfolio Section ===== */
.portfolio-section {
    padding: 0 28px 80px;
}

.portfolio-heading {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.portfolio-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.portfolio-row {
    display: flex;
    gap: 12px;
    height: clamp(240px, 34vw, 420px);
}

/* Row heights tuned to the dominant orientation in the row */
.portfolio-row.tall   { height: clamp(320px, 46vw, 560px); }
.portfolio-row.short  { height: clamp(200px, 28vw, 340px); }
.portfolio-row.medium { height: clamp(240px, 34vw, 420px); }

.portfolio-row.single {
    justify-content: center;
}

.portfolio-row .portfolio-item {
    overflow: hidden;
    border-radius: 4px;
    cursor: zoom-in;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.portfolio-row .portfolio-item:hover {
    transform: scale(1.01);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.portfolio-row .portfolio-item.wide   { flex: 1.7; }
.portfolio-row .portfolio-item.narrow { flex: 1; }
.portfolio-row .portfolio-item.equal  { flex: 1; }
.portfolio-row.single .portfolio-item.narrow { flex: 0 1 55%; }
.portfolio-row.single .portfolio-item.wide   { flex: 1; }

.portfolio-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 4px;
}

/* Videos are appended after the image grid → render at full grid width */
.portfolio-video {
    width: 100%;
    border-radius: 4px;
    overflow: hidden;
    background: #000;
    aspect-ratio: 16 / 9;
}

.portfolio-video video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

/* ===== Lightbox ===== */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(15, 13, 10, 0.92);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    animation: lb-fade 0.18s ease;
}

@keyframes lb-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.lightbox[hidden] {
    display: none;
}

.lightbox-img {
    max-width: 92vw;
    max-height: 88vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 14px 60px rgba(0, 0, 0, 0.5);
    cursor: default;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: rgba(0, 0, 0, 0.45);
    color: white;
    border: none;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    line-height: 1;
    transition: background 0.15s ease, transform 0.15s ease;
    border-radius: 999px;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(0, 0, 0, 0.75);
    transform: scale(1.06);
}

.lightbox-close {
    top: 18px;
    right: 22px;
    width: 42px;
    height: 42px;
    font-size: 28px;
    font-weight: 300;
}

.lightbox-prev,
.lightbox-next {
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    font-size: 36px;
    font-weight: 300;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    transform: translateY(-50%) scale(1.06);
}

.lightbox-prev { left: 22px; }
.lightbox-next { right: 22px; }

.lightbox-counter {
    position: absolute;
    bottom: 22px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.4px;
    background: rgba(0, 0, 0, 0.4);
    padding: 6px 14px;
    border-radius: 999px;
}

@media (max-width: 520px) {
    .lightbox-close { top: 12px; right: 12px; width: 38px; height: 38px; font-size: 24px; }
    .lightbox-prev, .lightbox-next { width: 42px; height: 42px; font-size: 28px; }
    .lightbox-prev { left: 8px; }
    .lightbox-next { right: 8px; }
}

/* ===== Responsive ===== */
@media (max-width: 520px) {
    .navbar {
        padding: 12px 14px;
    }

    .nav-pill {
        font-size: 9px;
        padding: 5px 10px;
    }

    .student .name {
        font-size: 8.5px;
    }

    .class-section {
        padding: 30px 10px 60px;
    }

    .avatar {
        width: 90%;
    }

    .profile-section {
        flex-direction: column;
        align-items: center;
        padding: 20px 18px 28px;
        gap: 20px;
    }

    .profile-photo {
        width: 150px;
        height: 150px;
    }

    .profile-info {
        width: 100%;
    }

    .portfolio-section {
        padding: 0 18px 60px;
    }

    .portfolio-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 769px) {
    .hero h1 {
        font-size: clamp(2.8rem, 5vw, 4.2rem);
    }

    .class-section {
        padding: 40px 40px 100px;
    }

    .students {
        gap: 36px 36px;
    }

    .profile-section {
        padding: 32px 44px 44px;
        gap: 36px;
    }

    .profile-photo {
        width: 220px;
        height: 220px;
    }

    .profile-name {
        font-size: 1.7rem;
    }

    .portfolio-section {
        padding: 0 44px 80px;
    }
}
