/* -------------------------------------------------------------------
 * Dark mode palette
 * ------------------------------------------------------------------- */
[data-theme="dark"] {
    --color-body: #0E1011;
    --color-text: #F3F5F5;
    --color-text-dark: #FFFFFF;
    --color-text-light: #9CA3AF;
    --color-1: hsla(185, 60%, 55%, 1);
    --color-1-dark: hsla(185, 60%, 45%, 1);
    --color-1-light: hsla(185, 60%, 65%, 1);
    --color-1-lighter: hsla(185, 60%, 75%, 1);
    --color-border: rgba(255, 255, 255, 0.1);
    --color-preloader-bg: #0E1011;
    --color-loader: #FFFFFF;
}

[data-theme="dark"] body,
[data-theme="dark"] .s-footer {
    background-color: var(--color-body);
    color: var(--color-text);
}

[data-theme="dark"] .note-card,
[data-theme="dark"] .entry {
    background: #161818;
    border-color: var(--color-border);
}

[data-theme="dark"] .filter-btn.active {
    background: var(--color-1);
    color: #0E1011;
    border-color: var(--color-1);
}

[data-theme="dark"] .s-header.sticky {
    background: rgba(14, 16, 17, 0.96);
}

[data-theme="dark"] .s-header__nav li a {
    color: var(--color-text);
}

[data-theme="dark"] .s-header__branding a {
    color: var(--color-text);
}

[data-theme="dark"] .s-header__social svg {
    fill: var(--color-text);
}

[data-theme="dark"] .ss-go-top a {
    background-color: var(--color-1);
}


/* -------------------------------------------------------------------
 * Header social row — spacing, alignment, separator before toggle
 * ------------------------------------------------------------------- */
.s-header__social {
    align-items: center;
    gap: 1.4rem;
}

.s-header__social li {
    margin-right: 0 !important;
    display: inline-flex;
    align-items: center;
}

.s-header__social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* visual separator before the theme toggle (last item) */
.s-header__social li:has(.theme-toggle) {
    margin-left: 0.4rem;
    padding-left: 1.4rem;
    border-left: 1px solid var(--color-border);
    height: 2.4rem;
}


/* -------------------------------------------------------------------
 * Theme toggle button
 * ------------------------------------------------------------------- */
.theme-toggle {
    background: none;
    border: none;
    padding: 0.4rem;
    cursor: pointer;
    color: var(--color-text-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: color 0.2s ease, background 0.2s ease;
    width: 3.2rem;
    height: 3.2rem;
}

.theme-toggle:hover {
    color: var(--color-1);
    background: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .theme-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
}

.theme-toggle__icon {
    fill: currentColor;
    stroke: currentColor;
    display: inline-block;
}

.theme-toggle__icon--moon { display: none; }
[data-theme="dark"] .theme-toggle__icon--sun { display: none; }
[data-theme="dark"] .theme-toggle__icon--moon { display: inline-block; }


/* -------------------------------------------------------------------
 * Anchor offset + section rhythm
 * ------------------------------------------------------------------- */
section[id] {
    scroll-margin-top: 8rem;
}

section + section:not(#about):not(.s-intro) {
    border-top: 1px solid var(--color-border);
}

#about,
#notes,
#blog,
#gallery {
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

#about {
    min-height: 40vh;
}

/* -------------------------------------------------------------------
 * Scroll Progress Indicator
 * ------------------------------------------------------------------- */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: var(--color-1);
    z-index: 9999;
    transition: width 0.1s ease-out;
}

/* -------------------------------------------------------------------
 * Header / sticky behaviour
 * ------------------------------------------------------------------- */
.s-header {
    transition: background-color 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.s-header.sticky {
    background: rgba(250, 250, 247, 0.96);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02);
}

.s-header__nav a {
    position: relative;
}

.s-header__nav a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--color-1);
    transform: translateX(-50%);
    transition: width 0.25s ease;
}

.s-header__nav a:hover::before,
.s-header__nav a.active::before {
    width: 60%;
}

/* -------------------------------------------------------------------
 * Section heading hierarchy
 * ------------------------------------------------------------------- */
.section-eyebrow {
    font-family: var(--font-1);
    font-size: 1.2rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--color-text-light);
    margin: 0 0 var(--space-3);
}

.section-title {
    font-family: var(--font-1);
    font-size: clamp(2.6rem, 3.6vw, 4rem);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: var(--color-text);
    margin: 0 0 var(--space-4);
    max-width: 30ch;
}

.section-meta {
    font-size: 1.3rem;
    color: var(--color-text-light);
    margin: 0;
}


/* -------------------------------------------------------------------
 * Intro — full-bleed hero
 * ------------------------------------------------------------------- */
.s-intro {
    position: relative;
    width: 100%;
    min-height: 100vh;
    padding: var(--space-7) var(--space-5);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: #111 url('../images/intro-bg.jpeg') center/cover no-repeat;
    overflow: hidden;
}

.s-intro__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0.35) 50%, rgba(0,0,0,0.55) 100%);
    pointer-events: none;
}

.s-intro__hero {
    position: relative;
    z-index: 1;
    max-width: 64rem;
    width: 100%;
    margin: 0 auto;
    text-align: center;
    color: #fff;
}

.s-intro__hero > * {
    text-align: center;
}

.s-intro__eyebrow {
    font-family: var(--font-1);
    font-size: 1.3rem;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.85);
    margin: 0 0 var(--space-4);
}

.s-intro__name {
    font-family: var(--font-1);
    font-size: clamp(5rem, 9vw, 9rem);
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.02em;
    color: #fff;
    margin: 0 0 var(--space-4);
}

.s-intro__tagline {
    font-size: clamp(1.6rem, 2vw, 2rem);
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
}

.s-intro__scroll-cue {
    position: absolute;
    bottom: var(--space-5);
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
    color: rgba(255, 255, 255, 0.7);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4.4rem;
    height: 4.4rem;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.25);
    text-decoration: none;
    transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
    animation: scrollCueBounce 2.4s ease-in-out infinite;
}

.s-intro__scroll-cue:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.s-intro__scroll-cue svg {
    fill: currentColor;
}

@keyframes scrollCueBounce {
    0%, 100% { transform: translate(-50%, 0); }
    50%      { transform: translate(-50%, 6px); }
}


/* -------------------------------------------------------------------
 * About — bio paragraph
 * ------------------------------------------------------------------- */
.s-about {
    padding: var(--space-7) var(--space-5);
    text-align: center;
}

.s-about__lead {
    font-size: clamp(1.9rem, 2.2vw, 2.4rem);
    line-height: 1.6;
    color: var(--color-text);
    margin: 0 auto;
    max-width: 60ch;
    text-align: center;
}


/* -------------------------------------------------------------------
 * Notes — tabs + card grid
 * ------------------------------------------------------------------- */
.s-notes {
    padding-top: var(--space-7);
    padding-bottom: var(--space-7);
}

.s-notes__header {
    margin-bottom: var(--space-6);
}

.notes-tabs {
    display: flex;
    gap: var(--space-2);
    border-bottom: 1px solid var(--color-border);
    margin-bottom: var(--space-6);
    flex-wrap: wrap;
}

.notes-tab {
    background: none;
    border: none;
    padding: var(--space-3) var(--space-4);
    font-family: var(--font-1);
    font-size: 1.7rem;
    font-weight: 500;
    color: var(--color-text-light);
    cursor: pointer;
    position: relative;
    transition: color 0.2s ease;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.notes-tab:hover {
    color: var(--color-text);
}

.notes-tab.is-active {
    color: var(--color-1);
    border-bottom-color: var(--color-1);
}

.notes-tab__count {
    display: inline-block;
    margin-left: 0.9rem;
    padding-left: 0.9rem;
    border-left: 1px solid var(--color-border);
    font-size: 1.3rem;
    font-weight: 500;
    color: var(--color-text-light);
    line-height: 1;
    vertical-align: baseline;
}

.notes-tab.is-active .notes-tab__count {
    color: var(--color-1);
}

.notes-tab:focus-visible {
    outline: 2px solid var(--color-1);
    outline-offset: 2px;
}

.notes-panel {
    display: none;
}

.notes-panel.is-active {
    display: block;
}

.notes-panel__note {
    margin: 0 0 var(--space-5);
    font-size: 1.6rem;
    color: var(--color-text-light);
    font-style: italic;
}

.notes-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
}

@media screen and (max-width: 700px) {
    .notes-grid {
        grid-template-columns: 1fr;
    }
}

.note-card {
    display: block;
    padding: var(--space-5);
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.note-card:hover,
.note-card:focus-visible {
    transform: translateY(-2px);
    border-color: var(--color-1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    outline: none;
}

.note-card__title {
    margin: 0 0 var(--space-2);
    font-size: 2.2rem;
    font-weight: 600;
    color: var(--color-text);
    line-height: 1.3;
}

.note-card__lecturer {
    margin: 0 0 var(--space-3);
    font-size: 1.5rem;
    color: var(--color-1);
    font-weight: 500;
}

.note-card__desc {
    margin: 0;
    font-size: 1.6rem;
    line-height: 1.6;
    color: var(--color-text-light);
}


/* -------------------------------------------------------------------
 * Blog cards (featured grid + index)
 * ------------------------------------------------------------------- */
.s-blog {
    padding-top: var(--space-7);
    padding-bottom: var(--space-7);
}

.s-blog__header {
    margin-bottom: var(--space-6);
}

.s-blog__intro {
    margin: var(--space-4) 0 0;
    max-width: 60ch;
    font-size: 1.7rem;
    line-height: 1.6;
    color: var(--color-text-light);
}

.s-blog__cta {
    margin-top: var(--space-6);
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-5);
    margin-top: var(--space-5);
}

#featured-blogs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-5);
    max-width: 640px;
    margin: 0 auto;
}

#featured-blogs .entry__thumb {
    aspect-ratio: 16 / 10;
}

#featured-blogs .entry__title {
    font-size: 2.2rem;
}

#featured-blogs .entry__meta {
    font-size: 1.4rem;
}

#featured-blogs .entry__excerpt p {
    font-size: 1.6rem;
}

#featured-blogs .entry__read-more {
    font-size: 1.6rem;
}

#featured-blogs .featured-badge {
    font-size: 1.3rem;
}

.entry {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    display: flex;
    flex-direction: column;
}

.entry:hover {
    transform: translateY(-2px);
    border-color: var(--color-1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.entry__thumb {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: var(--color-gray-2);
}

.entry__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.entry:hover .entry__thumb img {
    transform: scale(1.04);
}

.entry__body {
    padding: var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    flex: 1;
}

.entry__title {
    margin: 0;
    font-size: 2rem;
    font-weight: 600;
    line-height: 1.3;
}

.entry__title a {
    color: var(--color-text);
    text-decoration: none;
}

.entry:hover .entry__title a {
    color: var(--color-1);
}

.entry__meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    font-size: 1.2rem;
    color: var(--color-text-light);
}

.entry__meta-sep {
    opacity: 0.5;
}

.entry__excerpt p {
    margin: 0;
    color: var(--color-text-light);
    font-size: 1.4rem;
    line-height: 1.6;
}

.entry__read-more {
    color: var(--color-1);
    font-weight: 500;
    font-size: 1.4rem;
    text-decoration: none;
    align-self: flex-start;
}

.entry__read-more:hover {
    text-decoration: underline;
}

.entry__tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.entry__tag {
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text-light);
    padding: 0.3rem var(--space-3);
    border-radius: 999px;
    font-family: var(--font-1);
    font-size: 1.1rem;
    font-weight: 500;
    text-transform: capitalize;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.entry__tag:hover {
    color: var(--color-1);
    border-color: var(--color-1);
}

.featured-badge {
    display: inline-block;
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-1);
    margin-bottom: var(--space-2);
}


/* -------------------------------------------------------------------
 * Blog filters
 * ------------------------------------------------------------------- */
.s-blog__controls {
    margin-bottom: var(--space-5);
}

.blog-filters {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.filter-btn {
    padding: var(--space-2) var(--space-4);
    border: 1px solid var(--color-border);
    background: transparent;
    color: var(--color-text-light);
    border-radius: 999px;
    cursor: pointer;
    font-family: var(--font-1);
    font-size: 1.3rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    color: var(--color-text);
    border-color: var(--color-text-light);
}

.filter-btn.active {
    background: var(--color-text);
    color: #fff;
    border-color: var(--color-text);
}


/* -------------------------------------------------------------------
 * Blog post page (single)
 * ------------------------------------------------------------------- */
.blog-post {
    padding-top: var(--space-7);
    padding-bottom: var(--space-7);
}

.s-content__back {
    display: inline-block;
    margin-bottom: var(--space-5);
    color: var(--color-text-light);
    text-decoration: none;
    font-size: 1.4rem;
}

.s-content__back:hover {
    color: var(--color-1);
}

.s-content__entry-header {
    margin-bottom: var(--space-6);
}

.s-content__title {
    font-family: var(--font-1);
    font-size: clamp(3rem, 4.5vw, 5rem);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.01em;
    margin: 0 0 var(--space-4);
    color: var(--color-text);
}

.s-content__byline {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    font-size: 1.3rem;
    color: var(--color-text-light);
    margin: 0;
}

.s-content__pdf-fallback {
    margin-top: var(--space-4);
    font-size: 1.3rem;
    color: var(--color-text-light);
}


/* -------------------------------------------------------------------
 * Gallery
 * ------------------------------------------------------------------- */
.s-gallery {
    padding-top: var(--space-7);
    padding-bottom: var(--space-7);
}

.s-gallery__header {
    margin-bottom: var(--space-6);
}

.folio-list.row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-5);
    width: 92%;
    max-width: var(--width-grid-max);
    margin: 0 auto;
    padding: 0;
}

.folio-list .column,
.folio-list .column:nth-child(2n + 1),
.folio-list .column:nth-child(2n + 2) {
    width: 100%;
    max-width: 100%;
    padding: 0;
    margin: 0;
    flex: none;
}

.folio-item {
    width: 100%;
}

.folio-item__thumb {
    position: relative;
    overflow: hidden;
    border-radius: 6px;
    aspect-ratio: 4 / 3;
}

@media screen and (max-width: 900px) {
    .folio-list.row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 600px) {
    .folio-list.row {
        grid-template-columns: 1fr;
    }
}

.folio-item__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.folio-item:hover .folio-item__thumb img {
    transform: scale(1.04);
}

.folio-item__thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(14, 124, 134, 0.0);
    transition: background 0.3s ease;
}

.folio-item:hover .folio-item__thumb::after {
    background: rgba(14, 124, 134, 0.18);
}

.folio-item__info {
    padding: var(--space-3) 0 var(--space-5);
    text-align: center;
}

.folio-item__title {
    font-family: var(--font-1);
    font-size: 1.9rem;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: 0;
    color: var(--color-text);
    margin: 0;
    text-align: center;
}


/* -------------------------------------------------------------------
 * Footer — simplified
 * ------------------------------------------------------------------- */
.s-footer {
    padding: var(--space-7) 0 var(--space-5);
    border-top: 1px solid var(--color-border);
    background: var(--color-body);
}

.s-footer__contact {
    margin-bottom: var(--space-6);
}

.s-footer__links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-5);
    align-items: center;
}

.s-footer__links li {
    padding: 0;
}

.s-footer__links a {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    color: var(--color-text);
    text-decoration: none;
    font-size: 2rem;
    transition: color 0.2s ease;
}

.s-footer__links a:hover {
    color: var(--color-1);
}

.s-footer__links svg {
    width: 2.4rem;
    height: 2.4rem;
    fill: currentColor;
}


/* -------------------------------------------------------------------
 * Scroll reveal (subtle)
 * ------------------------------------------------------------------- */
.reveal,
.reveal-left,
.reveal-right,
.reveal-scale,
.stagger-item {
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal { transform: translateY(20px); }
.reveal-left { transform: translateX(-20px); }
.reveal-right { transform: translateX(20px); }
.reveal-scale { transform: scale(0.98); }
.stagger-item { transform: translateY(15px); }

.reveal.active,
.reveal-left.active,
.reveal-right.active,
.reveal-scale.active,
.stagger-item.active {
    opacity: 1;
    transform: none;
}

.stagger-item:nth-child(1) { transition-delay: 0.05s; }
.stagger-item:nth-child(2) { transition-delay: 0.1s; }
.stagger-item:nth-child(3) { transition-delay: 0.15s; }
.stagger-item:nth-child(4) { transition-delay: 0.2s; }
.stagger-item:nth-child(5) { transition-delay: 0.25s; }
.stagger-item:nth-child(6) { transition-delay: 0.3s; }
.stagger-item:nth-child(7) { transition-delay: 0.35s; }
.stagger-item:nth-child(8) { transition-delay: 0.4s; }


/* -------------------------------------------------------------------
 * Reading progress (blog post)
 * ------------------------------------------------------------------- */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: var(--color-1);
    z-index: 9999;
    transition: width 0.1s ease-out;
}


/* -------------------------------------------------------------------
 * Responsive
 * ------------------------------------------------------------------- */
@media screen and (max-width: 900px) {
    .blog-grid {
        grid-template-columns: 1fr;
    }
    .blog-filters {
        justify-content: flex-start;
    }
    .s-header__social {
        display: none;
    }
}

@media screen and (max-width: 600px) {
    .s-intro {
        min-height: 80vh;
        padding: var(--space-6) var(--space-4);
    }
    .s-about,
    .s-notes,
    .s-blog,
    .s-gallery,
    .s-footer {
        padding-top: var(--space-6);
        padding-bottom: var(--space-6);
    }
}
