/* ============================================================
   Shazzad Hossain Nabil — Portfolio
   Theme: Modern Textile Engineering & Sustainability
   ------------------------------------------------------------
   Palette logic:
   - Backgrounds borrow from raw, undyed fibre: jute, cotton,
     unbleached linen.
   - Accents borrow from the reactive dye bath: indigo and a
     deep reactive teal.
   ============================================================ */

:root {
    /* --- Fibre / neutral tones --- */
    --cotton:        #f6f1e7;  /* page background — unbleached cotton */
    --linen:         #ece4d4;  /* raised surfaces */
    --jute:          #c9b48d;  /* warm structural mid-tone */
    --jute-deep:     #a8946c;  /* borders, woven lines */

    /* --- Reactive dye accents --- */
    --indigo:        #243b6b;  /* primary ink / headings */
    --indigo-soft:   #35508a;
    --teal:          #0f6e6a;  /* reactive teal accent */
    --teal-bright:   #15938c;

    /* --- Text --- */
    --ink:           #2a2620;  /* near-black, warm */
    --ink-muted:     #6a6253;

    /* --- Type --- */
    --font-display: "Fraunces", Georgia, "Times New Roman", serif;
    --font-body:    "Inter", system-ui, -apple-system, sans-serif;

    /* --- Rhythm --- */
    --section-pad:   clamp(4rem, 9vw, 8rem);
    --measure:       68ch;
    --radius:        4px;

    /* --- Motion --- */
    --ease-thread:   cubic-bezier(0.65, 0, 0.35, 1);
}

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

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

body {
    font-family: var(--font-body);
    color: var(--ink);
    background-color: var(--cotton);
    line-height: 1.65;
    /* A faint woven texture across the whole page: two thin
       crosshatched gradients standing in for warp + weft. */
    background-image:
        repeating-linear-gradient(90deg, rgba(168, 148, 108, 0.05) 0 1px, transparent 1px 14px),
        repeating-linear-gradient(0deg,  rgba(168, 148, 108, 0.05) 0 1px, transparent 1px 14px);
    overflow-x: hidden;
}

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

h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 500;
    line-height: 1.08;
    color: var(--indigo);
    letter-spacing: -0.01em;
}

::selection {
    background: var(--teal);
    color: var(--cotton);
}

/* Respect users who prefer reduced motion: freeze the loom,
   the drawing thread, and any looping decoration. */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto;
    }
}

/* ------------------------------------------------------------
   LOOM LOADER
   Vertical warp threads held taut; a horizontal shuttle (weft)
   slides back and forth weaving through them.
------------------------------------------------------------ */
.loom-loader {
    position: fixed;
    inset: 0;
    z-index: 999;
    display: grid;
    place-content: center;
    gap: 1.75rem;
    background: var(--cotton);
}

.loom {
    position: relative;
    display: flex;
    align-items: stretch;
    gap: 10px;
    height: 90px;
    padding: 0 6px;
}

/* Each warp thread eases in from nothing, as if strung onto the loom */
.loom .warp {
    width: 2px;
    background: linear-gradient(var(--jute-deep), var(--indigo));
    transform: scaleY(0);
    transform-origin: top;
    animation: warp-string 0.5s var(--ease-thread) forwards;
}
.loom .warp:nth-child(1) { animation-delay: 0.00s; }
.loom .warp:nth-child(2) { animation-delay: 0.06s; }
.loom .warp:nth-child(3) { animation-delay: 0.12s; }
.loom .warp:nth-child(4) { animation-delay: 0.18s; }
.loom .warp:nth-child(5) { animation-delay: 0.24s; }
.loom .warp:nth-child(6) { animation-delay: 0.30s; }
.loom .warp:nth-child(7) { animation-delay: 0.36s; }

/* The shuttle: a small bright weft thread passing across the warp */
.loom .shuttle {
    position: absolute;
    top: 50%;
    left: 0;
    width: 26px;
    height: 3px;
    margin-top: -1.5px;
    border-radius: 2px;
    background: var(--teal-bright);
    box-shadow: 0 0 8px rgba(21, 147, 140, 0.6);
    animation: shuttle-pass 1.4s ease-in-out 0.4s infinite;
}

@keyframes warp-string {
    to { transform: scaleY(1); }
}

@keyframes shuttle-pass {
    0%   { left: 0;             transform: translateY(-6px); }
    50%  { left: calc(100% - 26px); transform: translateY(6px); }
    100% { left: 0;             transform: translateY(-6px); }
}

.loom-caption {
    font-family: var(--font-display);
    font-style: italic;
    color: var(--ink-muted);
    text-align: center;
    letter-spacing: 0.02em;
}

/* When JS adds .is-loaded, the curtain lifts away */
.loom-loader.is-hidden {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s ease, visibility 0s linear 0.6s;
}

/* ------------------------------------------------------------
   NAVIGATION
------------------------------------------------------------ */
.site-header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 50;
    backdrop-filter: blur(8px);
    background: rgba(246, 241, 231, 0.72);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease, background 0.3s ease;
}
.site-header.is-stuck {
    border-bottom-color: var(--jute-deep);
}

.nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.1rem clamp(1.25rem, 5vw, 3rem);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav__brand {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--indigo);
    letter-spacing: 0.12em;
    white-space: nowrap;
    transition: color 0.25s ease;
}
.nav__brand:hover { color: var(--teal); }

.nav__links {
    display: flex;
    gap: clamp(1rem, 3vw, 2.25rem);
    list-style: none;
}
.nav__links a {
    position: relative;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--ink);
    padding: 0.25rem 0;
}
/* Underline that weaves in from the left */
.nav__links a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 100%;
    height: 1.5px;
    background: var(--teal);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s var(--ease-thread);
}
.nav__links a:hover::after { transform: scaleX(1); }
.nav__links a.is-active { color: var(--teal); }
.nav__links a.is-active::after { transform: scaleX(1); }

/* ------------------------------------------------------------
   BUTTONS
------------------------------------------------------------ */
.btn {
    display: inline-block;
    padding: 0.85rem 1.7rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: var(--radius);
    border: 1.5px solid var(--indigo);
    transition: transform 0.25s var(--ease-thread),
                background 0.25s ease,
                color 0.25s ease,
                box-shadow 0.25s ease;
}
.btn:hover { transform: translateY(-2px); }

.btn--solid {
    background: var(--indigo);
    color: var(--cotton);
    box-shadow: 0 6px 18px rgba(36, 59, 107, 0.18);
}
.btn--solid:hover { background: var(--indigo-soft); }

.btn--ghost {
    background: transparent;
    color: var(--indigo);
}
.btn--ghost:hover {
    background: var(--indigo);
    color: var(--cotton);
}

/* ------------------------------------------------------------
   HERO
------------------------------------------------------------ */
.hero {
    position: relative;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 7rem clamp(1.25rem, 5vw, 3rem) 4rem;
    overflow: hidden;
}

/* Warp-thread backdrop: vertical lines drifting almost imperceptibly,
   like threads under tension catching the light. */
.hero__weave {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image:
        repeating-linear-gradient(
            90deg,
            rgba(36, 59, 107, 0.06) 0 1px,
            transparent 1px 38px
        );
    -webkit-mask-image: radial-gradient(ellipse at center, #000 35%, transparent 78%);
            mask-image: radial-gradient(ellipse at center, #000 35%, transparent 78%);
    animation: warp-drift 14s ease-in-out infinite alternate;
}
@keyframes warp-drift {
    from { transform: translateX(-12px); }
    to   { transform: translateX(12px); }
}

.hero__inner {
    position: relative;
    z-index: 1;
    width: min(1180px, 100%);
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(300px, 0.92fr);
    align-items: center;
    gap: clamp(2.5rem, 6vw, 6.5rem);
}

.hero__content {
    text-align: left;
}

.hero__eyebrow {
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--teal);
    margin-bottom: 1.5rem;
    /* Fade-up entrance — staggered with the rest of the hero */
    opacity: 0;
    animation: rise 0.8s var(--ease-thread) 0.2s forwards;
}

.hero__name {
    font-size: clamp(3rem, 6vw, 5.5rem);
    font-weight: 500;
    margin-bottom: 0.6rem;
    opacity: 0;
    animation: rise 0.8s var(--ease-thread) 0.35s forwards;
}
.hero__name-accent {
    display: block;
    font-style: italic;
    color: var(--teal);
}

.hero__tagline {
    font-family: var(--font-display);
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    color: var(--ink-muted);
    letter-spacing: 0.04em;
    margin-bottom: 1.5rem;
    opacity: 0;
    animation: rise 0.8s var(--ease-thread) 0.5s forwards;
}

.hero__intro {
    max-width: 56ch;
    margin: 0 0 2.5rem;
    font-size: clamp(1rem, 1.6vw, 1.12rem);
    color: var(--ink);
    opacity: 0;
    animation: rise 0.8s var(--ease-thread) 0.65s forwards;
}

.hero__actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-start;
    flex-wrap: wrap;
    opacity: 0;
    animation: rise 0.8s var(--ease-thread) 0.8s forwards;
}

@keyframes rise {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Portrait composition: a cut-out figure held inside an offset,
   loom-inspired frame with animated threads crossing behind it. */
.hero__portrait {
    position: relative;
    width: min(100%, 430px);
    justify-self: end;
    margin: 0;
    opacity: 0;
    animation: portrait-enter 1s var(--ease-thread) 0.5s forwards;
}

.hero__portrait::before {
    content: "";
    position: absolute;
    inset: 1.25rem -1.1rem -1.1rem 1.25rem;
    border: 1px solid rgba(36, 59, 107, 0.28);
    z-index: -1;
}

.hero__portrait-frame {
    position: relative;
    isolation: isolate;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    border: 1px solid rgba(36, 59, 107, 0.2);
    background:
        linear-gradient(145deg, rgba(255,255,255,0.68), rgba(236,228,212,0.86)),
        repeating-linear-gradient(90deg, transparent 0 17px, rgba(15,110,106,0.08) 17px 18px);
    box-shadow: 0 28px 65px rgba(36, 59, 107, 0.14);
}

.hero__portrait-halo {
    position: absolute;
    width: 78%;
    aspect-ratio: 1;
    top: 12%;
    left: 50%;
    transform: translateX(-50%);
    z-index: -1;
    border-radius: 50%;
    background: var(--teal);
    opacity: 0.12;
}

.hero__portrait-halo::before,
.hero__portrait-halo::after {
    content: "";
    position: absolute;
    border-radius: inherit;
    inset: -15px;
    border: 1px solid rgba(15, 110, 106, 0.32);
}

.hero__portrait-halo::after {
    inset: -31px;
    border-color: rgba(36, 59, 107, 0.14);
}

.hero__portrait-image {
    position: absolute;
    width: 121%;
    max-width: none;
    left: 50%;
    bottom: -1.5%;
    transform: translateX(-50%);
    filter: drop-shadow(0 18px 22px rgba(20, 25, 34, 0.2));
    animation: portrait-float 5s ease-in-out 1.5s infinite alternate;
}

.hero__portrait-thread {
    position: absolute;
    display: block;
    height: 1px;
    z-index: 2;
    transform-origin: left center;
    background: linear-gradient(90deg, transparent, var(--teal), transparent);
    opacity: 0.72;
}

.hero__portrait-thread--one {
    width: 122%;
    left: -11%;
    top: 27%;
    transform: rotate(-8deg);
    animation: thread-pulse 4.2s ease-in-out infinite alternate;
}

.hero__portrait-thread--two {
    width: 105%;
    left: -3%;
    bottom: 18%;
    transform: rotate(11deg);
    background: linear-gradient(90deg, transparent, var(--jute-deep), transparent);
    animation: thread-pulse 5s ease-in-out 0.8s infinite alternate-reverse;
}

.hero__portrait-label {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-muted);
}

@keyframes portrait-enter {
    from { opacity: 0; transform: translate(28px, 16px) rotate(1.5deg); }
    to   { opacity: 1; transform: translate(0, 0) rotate(0); }
}

@keyframes portrait-float {
    from { transform: translate(-50%, 0); }
    to   { transform: translate(-50%, -9px); }
}

@keyframes thread-pulse {
    from { opacity: 0.35; filter: blur(0); }
    to   { opacity: 0.9; filter: blur(0.35px); }
}

/* Scroll cue at the foot of the hero — a thread paying out downward */
.hero__scroll {
    position: absolute;
    bottom: 1.75rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.72rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--ink-muted);
}
.hero__scroll-line {
    width: 1.5px;
    height: 46px;
    background: var(--jute-deep);
    overflow: hidden;
}
/* A bright bead of weft runs down the line on a loop */
.hero__scroll-line::after {
    content: "";
    display: block;
    width: 100%;
    height: 14px;
    background: var(--teal);
    animation: thread-fall 1.8s ease-in-out infinite;
}
@keyframes thread-fall {
    0%   { transform: translateY(-16px); }
    100% { transform: translateY(46px); }
}

/* ------------------------------------------------------------
   THREAD DIVIDER
   The path draws itself via stroke-dashoffset; a "needle" rides
   along just ahead of the drawn thread.
------------------------------------------------------------ */
.thread-divider {
    line-height: 0;
    margin: -1px 0;
}
.thread-divider svg {
    display: block;
    width: 100%;
    height: 60px;
}
.thread-divider__path {
    stroke: var(--jute-deep);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-dasharray: 1700;
    stroke-dashoffset: 1700;
    animation: draw-thread 3s var(--ease-thread) forwards;
}
.thread-divider__needle {
    fill: var(--teal);
    /* Glides along roughly the same arc as the path head */
    offset-path: path("M0,30 C150,0 250,60 400,30 C550,0 650,60 800,30 C950,0 1050,60 1200,30");
    animation: needle-run 3s var(--ease-thread) forwards;
}

@keyframes draw-thread {
    to { stroke-dashoffset: 0; }
}
@keyframes needle-run {
    from { offset-distance: 0%; opacity: 1; }
    90%  { opacity: 1; }
    to   { offset-distance: 100%; opacity: 0; }
}

/* ------------------------------------------------------------
   SECTION HEADINGS (shared)
------------------------------------------------------------ */
.section-head {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 2.75rem;
}
.section-head__index {
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--teal);
    letter-spacing: 0.1em;
}
.section-head__title {
    font-size: clamp(1.9rem, 4vw, 2.8rem);
    position: relative;
}
/* Short woven underline tucked beneath each section title */
.section-head__title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -0.55rem;
    width: 3.5rem;
    height: 3px;
    background: repeating-linear-gradient(
        90deg,
        var(--teal) 0 6px,
        transparent 6px 10px
    );
}

/* ------------------------------------------------------------
   ABOUT
------------------------------------------------------------ */
.about {
    padding: var(--section-pad) clamp(1.25rem, 5vw, 3rem);
}
.about__inner {
    max-width: 1100px;
    margin: 0 auto;
}
.about__grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: clamp(2rem, 5vw, 4.5rem);
    align-items: start;
}
.about__body { max-width: var(--measure); }
.about__lead {
    font-family: var(--font-display);
    font-size: clamp(1.2rem, 2.4vw, 1.6rem);
    line-height: 1.4;
    color: var(--indigo);
    margin-bottom: 1.5rem;
}
.about__body p + p { margin-top: 1.1rem; }
.about__body strong { color: var(--indigo); font-weight: 600; }

.about__skills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1.75rem;
    list-style: none;
}

.about__skills li {
    padding: 0.42rem 0.8rem;
    border: 1px solid rgba(15, 110, 106, 0.32);
    background: rgba(15, 110, 106, 0.055);
    color: var(--indigo);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.025em;
}

/* --- Woven swatch card --- */
.about__swatch {
    position: relative;
    padding: 2rem 1.75rem;
    background: var(--linen);
    border: 1px solid var(--jute-deep);
    border-radius: var(--radius);
    overflow: hidden;
    outline: none;
    transition: transform 0.4s var(--ease-thread),
                box-shadow 0.4s ease;
}
.about__swatch:hover,
.about__swatch:focus-visible {
    transform: translateY(-4px);
    box-shadow: 0 16px 34px rgba(36, 59, 107, 0.12);
}

/* The interlacing weft: two crosshatched gradients that fade in
   and tighten when the card is hovered/focused — a fabric being
   woven before your eyes. */
.swatch__weave {
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: 0.4;
    background-image:
        repeating-linear-gradient(90deg, var(--jute) 0 2px, transparent 2px 18px),
        repeating-linear-gradient(0deg,  var(--jute) 0 2px, transparent 2px 18px);
    transition: opacity 0.45s ease, background-size 0.45s var(--ease-thread);
    background-size: 18px 18px;
}
.about__swatch:hover .swatch__weave,
.about__swatch:focus-visible .swatch__weave {
    opacity: 0.7;
    background-size: 9px 9px;   /* threads tighten into denser cloth */
}

.swatch__facts {
    position: relative;
    z-index: 1;
    list-style: none;
    display: grid;
    gap: 1.1rem;
}
.swatch__facts li {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding-bottom: 1.1rem;
    border-bottom: 1px solid rgba(168, 148, 108, 0.5);
}
.swatch__facts li:last-child { border-bottom: none; padding-bottom: 0; }
.swatch__label {
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-muted);
}
.swatch__value {
    font-family: var(--font-display);
    font-size: 1.05rem;
    color: var(--indigo);
}

/* Flipped divider for visual variety between sections */
.thread-divider--flip svg { transform: scaleY(-1); }

/* ------------------------------------------------------------
   SCROLL REVEAL
   Elements tagged .reveal start hidden; script.js adds
   .is-visible via IntersectionObserver. Falls back to visible
   if JS never runs (see the no-js note in script.js).
------------------------------------------------------------ */
.reveal {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 0.7s var(--ease-thread),
                transform 0.7s var(--ease-thread);
}
.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ------------------------------------------------------------
   EXPERIENCE — timeline
------------------------------------------------------------ */
.experience {
    padding: var(--section-pad) clamp(1.25rem, 5vw, 3rem);
    background: var(--linen);
}
.experience__inner {
    max-width: 1000px;
    margin: 0 auto;
}

.timeline {
    list-style: none;
    position: relative;
    padding-left: 2.5rem;
}
/* The spine — a continuous thread running down the timeline */
.timeline::before {
    content: "";
    position: absolute;
    top: 0.4rem;
    bottom: 0.4rem;
    left: 7px;
    width: 2px;
    background: linear-gradient(var(--jute-deep), var(--teal));
}

.timeline__item {
    position: relative;
    padding-bottom: 2.5rem;
}
.timeline__item:last-child { padding-bottom: 0; }

/* The knot/node where each entry meets the spine */
.timeline__node {
    position: absolute;
    left: -2.5rem;
    top: 0.4rem;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--cotton);
    border: 3px solid var(--teal);
    box-shadow: 0 0 0 4px var(--linen);
}

.timeline__card {
    background: var(--cotton);
    border: 1px solid var(--jute-deep);
    border-radius: var(--radius);
    padding: 1.5rem 1.75rem;
    transition: transform 0.35s var(--ease-thread), box-shadow 0.35s ease;
}
.timeline__card:hover {
    transform: translateX(6px);
    box-shadow: 0 14px 30px rgba(36, 59, 107, 0.1);
}

.timeline__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.65rem;
    flex-wrap: wrap;
}
.timeline__tag {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--teal);
    padding: 0.3rem 0.7rem;
    border: 1px solid var(--teal);
    border-radius: 100px;
}
.timeline__tag--award {
    color: var(--cotton);
    background: var(--indigo);
    border-color: var(--indigo);
}
.timeline__year {
    font-family: var(--font-display);
    font-style: italic;
    color: var(--ink-muted);
}
.experience-group-title {
    font-size: 1.8rem;
    color: var(--teal);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(21, 147, 140, 0.2);
    font-family: var(--font-display);
}
.timeline__title {
    font-size: 1.4rem;
    margin-bottom: 0.15rem;
}
.timeline__org {
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-muted);
    margin-bottom: 0.9rem;
}
.timeline__card strong { color: var(--indigo); font-weight: 600; }

/* ------------------------------------------------------------
   PROJECTS — hover-card grid
------------------------------------------------------------ */
/* Achievements: balanced cards keep ranks and descriptions readable. */
.achievements {
    padding: var(--section-pad) clamp(1.25rem, 5vw, 3rem);
}

.achievements__inner {
    max-width: 1100px;
    margin: 0 auto;
}

.awards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    list-style: none;
}

.award-card {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    align-items: center;
    gap: 1.35rem;
    min-height: 150px;
    padding: 1.4rem 1.5rem;
    border: 1px solid rgba(168, 148, 108, 0.72);
    background: rgba(255, 255, 255, 0.32);
    box-shadow: 0 10px 25px rgba(36, 59, 107, 0.055);
    transition: transform 0.35s var(--ease-thread),
                border-color 0.35s ease,
                box-shadow 0.35s ease;
}

.award-card:hover {
    transform: translateY(-4px);
    border-color: var(--teal);
    box-shadow: 0 16px 34px rgba(36, 59, 107, 0.11);
}

.award-card__rank {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    border-right: 1px solid rgba(168, 148, 108, 0.6);
    font-family: var(--font-display);
    font-size: 2rem;
    line-height: 1;
    color: var(--teal);
    text-align: center;
}

.award-card__rank small {
    margin-top: 0.45rem;
    font-family: var(--font-body);
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-muted);
}

.award-card__rank--star { font-size: 1.7rem; }
.award-card__body { min-width: 0; }
.award-card__title {
    margin-bottom: 0.45rem;
    font-size: clamp(1.1rem, 2vw, 1.35rem);
}
.award-card__meta {
    color: var(--ink-muted);
    font-size: 0.88rem;
    line-height: 1.5;
}

.projects,
.training {
    padding: var(--section-pad) clamp(1.25rem, 5vw, 3rem);
}
.projects__inner,
.training__inner {
    max-width: 1100px;
    margin: 0 auto;
}
.projects__grid,
.training__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.75rem;
}

.project-card {
    position: relative;
    min-height: 280px;
    display: flex;
    border: 1px solid var(--jute-deep);
    border-radius: var(--radius);
    background: var(--cotton);
    overflow: hidden;
    outline: none;
    transition: transform 0.4s var(--ease-thread), box-shadow 0.4s ease;
}
.project-card:hover,
.project-card:focus-visible {
    transform: translateY(-6px);
    box-shadow: 0 22px 40px rgba(36, 59, 107, 0.15);
}

/* Woven overlay that tightens on hover — same motif as the about swatch,
   so the projects read as cut from the same cloth. */
.project-card__weave {
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: 0.18;
    background-image:
        repeating-linear-gradient(90deg, var(--jute) 0 2px, transparent 2px 20px),
        repeating-linear-gradient(0deg,  var(--jute) 0 2px, transparent 2px 20px);
    background-size: 20px 20px;
    transition: opacity 0.45s ease, background-size 0.45s var(--ease-thread);
}
.project-card:hover .project-card__weave,
.project-card:focus-visible .project-card__weave {
    opacity: 0.42;
    background-size: 10px 10px;
}

.project-card__body {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    padding: 1.75rem;
}
.project-card__tag {
    align-self: flex-start;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--teal);
    margin-bottom: 1rem;
}
.project-card__title {
    font-size: 1.4rem;
    margin-bottom: 0.75rem;
}
.project-card__desc {
    font-size: 0.95rem;
    color: var(--ink);
    margin-bottom: 1.25rem;
}
.project-card__desc strong { color: var(--indigo); font-weight: 600; }
.project-card__foot {
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(168, 148, 108, 0.5);
    font-family: var(--font-display);
    font-style: italic;
    font-size: 0.9rem;
    color: var(--ink-muted);
}
.project-card__links {
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(168, 148, 108, 0.5);
    display: flex;
    gap: 0.75rem;
}
.project-card__link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--cotton) !important;
    background: var(--indigo);
    border: 1.5px solid var(--indigo);
    border-radius: var(--radius);
    text-decoration: none !important;
    transition: transform 0.25s var(--ease-thread), background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    box-shadow: 0 4px 10px rgba(36, 59, 107, 0.12);
}
.project-card__link:hover {
    background: var(--teal);
    border-color: var(--teal);
    transform: translateY(-1.5px);
    box-shadow: 0 6px 14px rgba(15, 110, 106, 0.2);
}


/* ------------------------------------------------------------
   CONTACT & FUTURE OUTLOOK
------------------------------------------------------------ */
.contact {
    padding: var(--section-pad) clamp(1.25rem, 5vw, 3rem);
    background: var(--linen);
}
.contact__inner {
    max-width: 1100px;
    margin: 0 auto;
}
.contact__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(2rem, 5vw, 4.5rem);
    align-items: start;
}
.contact__lead {
    font-family: var(--font-display);
    font-style: italic;
    font-size: clamp(1.4rem, 3vw, 2rem);
    color: var(--teal);
    margin-bottom: 1.25rem;
}
.contact__outlook p + p { margin-top: 1rem; }
.contact__outlook strong { color: var(--indigo); font-weight: 600; }

.contact__channels {
    list-style: none;
    margin-top: 2rem;
    display: grid;
    gap: 1rem;
}
.contact__channels li {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}
.contact__channel-label {
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-muted);
}
.contact__channels a { color: var(--indigo); font-weight: 500; }
.contact__channels a:hover { color: var(--teal); }
.contact__channels a.btn--whatsapp {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 1rem;
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    width: fit-content;
    margin-top: 0.25rem;
    background: #25d366;
    color: #ffffff;
    border-color: #25d366;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.2);
    border-radius: var(--radius);
    text-decoration: none;
    transition: transform 0.25s var(--ease-thread), background-color 0.25s ease, border-color 0.25s ease;
}
.contact__channels a.btn--whatsapp:hover {
    background: #1ebe57;
    border-color: #1ebe57;
    color: #ffffff;
    transform: translateY(-1.5px);
}
.contact__channels a.btn--linkedin {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 1rem;
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    width: fit-content;
    margin-top: 0.25rem;
    background: #0077b5;
    color: #ffffff;
    border-color: #0077b5;
    box-shadow: 0 4px 12px rgba(0, 119, 181, 0.2);
    border-radius: var(--radius);
    text-decoration: none;
    transition: transform 0.25s var(--ease-thread), background-color 0.25s ease, border-color 0.25s ease;
}
.contact__channels a.btn--linkedin:hover {
    background: #006396;
    border-color: #006396;
    color: #ffffff;
    transform: translateY(-1.5px);
}

/* --- Form --- */
.contact__form {
    background: var(--cotton);
    border: 1px solid var(--jute-deep);
    border-radius: var(--radius);
    padding: 2rem 1.75rem;
}
.field { margin-bottom: 1.25rem; }
.field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-muted);
    margin-bottom: 0.45rem;
}
.field input,
.field textarea {
    width: 100%;
    padding: 0.8rem 0.9rem;
    font-family: var(--font-body);
    font-size: 0.98rem;
    color: var(--ink);
    background: var(--cotton);
    border: 1.5px solid var(--jute-deep);
    border-radius: var(--radius);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    resize: vertical;
}
.field input:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(15, 110, 106, 0.15);
}
/* Invalid state, toggled by script.js */
.field.is-invalid input,
.field.is-invalid textarea {
    border-color: #b03a2e;
}
.field__error {
    display: block;
    min-height: 1rem;
    margin-top: 0.35rem;
    font-size: 0.8rem;
    color: #b03a2e;
}
.contact__submit { width: 100%; margin-top: 0.25rem; }
.contact__status {
    margin-top: 1rem;
    font-size: 0.9rem;
    text-align: center;
    min-height: 1.2rem;
}
.contact__status.is-success { color: var(--teal); }
.contact__status.is-error   { color: #b03a2e; }

/* ------------------------------------------------------------
   GALLERY
------------------------------------------------------------ */
.gallery {
    padding: var(--section-pad) clamp(1.25rem, 5vw, 3rem);
}

.gallery__sub-title {
    font-family: var(--font-display);
    font-size: clamp(1.3rem, 2.5vw, 1.7rem);
    color: var(--indigo);
    margin-top: 2.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    padding-left: 0.95rem;
    border-left: 3px solid var(--teal);
    letter-spacing: 0.02em;
}

.gallery__inner {
    max-width: 1100px;
    margin: 0 auto;
}

.gallery__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.75rem;
}

.gallery__item {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--jute-deep);
    border-radius: var(--radius);
    background: var(--cotton);
    overflow: hidden;
    transition: transform 0.4s var(--ease-thread), box-shadow 0.4s ease;
    outline: none;
}

.gallery__item:hover,
.gallery__item:focus-visible {
    transform: translateY(-6px);
    box-shadow: 0 22px 40px rgba(36, 59, 107, 0.15);
}

.gallery__image-wrapper {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--linen);
    border-bottom: 1px solid var(--jute-deep);
}

.gallery__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--ease-thread);
}

.gallery__item:hover .gallery__image,
.gallery__item:focus-visible .gallery__image {
    transform: scale(1.06);
}

.gallery__caption {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.gallery__caption h3 {
    font-family: var(--font-display);
    font-size: 1.15rem;
    color: var(--indigo);
}

.gallery__caption p {
    font-size: 0.88rem;
    color: var(--ink-muted);
    line-height: 1.45;
}

/* ------------------------------------------------------------
   FOOTER
------------------------------------------------------------ */
.site-footer {
    padding: 1.25rem clamp(1.25rem, 5vw, 3rem);
    text-align: center;
    background: var(--indigo);
    color: var(--cotton);
}
.site-footer__note {
    margin-top: 0.4rem;
    font-family: var(--font-display);
    font-style: italic;
    font-size: 0.9rem;
    opacity: 0.7;
}

/* ------------------------------------------------------------
   LIGHTBOX MODAL
------------------------------------------------------------ */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(42, 38, 32, 0.96); /* Warm near-black overlay */
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.is-active {
    display: flex;
    opacity: 1;
}

.lightbox__close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: transparent;
    border: none;
    color: var(--cotton);
    font-size: 2.5rem;
    cursor: pointer;
    line-height: 1;
    z-index: 1010;
    transition: transform 0.25s ease, color 0.25s ease;
}

.lightbox__close:hover {
    color: var(--teal-bright);
    transform: scale(1.1);
}

.lightbox__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--cotton);
    font-size: 1.5rem;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    cursor: pointer;
    display: grid;
    place-items: center;
    z-index: 1010;
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.lightbox__nav:hover {
    background: var(--teal);
    border-color: var(--teal-bright);
    transform: translateY(-50%) scale(1.05);
}

.lightbox__nav--prev {
    left: 2rem;
}

.lightbox__nav--next {
    right: 2rem;
}

.lightbox__content {
    max-width: 82vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="38" height="38" viewBox="0 0 38 38" stroke="%2315938c"><g fill="none" fill-rule="evenodd"><g transform="translate(1 1)" stroke-width="2"><circle stroke-opacity=".2" cx="18" cy="18" r="18"/><path d="M36 18c0-9.94-8.06-18-18-18"><animateTransform attributeName="transform" type="rotate" from="0 18 18" to="360 18 18" dur="1s" repeatCount="indefinite"/></path></g></g></svg>') no-repeat center 40%;
    background-size: 38px 38px;
}

.lightbox__image {
    max-width: 100%;
    max-height: 72vh;
    object-fit: contain;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: scale(0.97);
    transition: opacity 0.25s ease, transform 0.25s var(--ease-thread);
}

.lightbox__image.is-loaded {
    opacity: 1;
    transform: scale(1);
}

.lightbox__caption-bar {
    width: 100%;
    margin-top: 1.25rem;
    color: var(--cotton);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.lightbox__counter {
    font-size: 0.72rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--jute);
    font-weight: 600;
}

.lightbox__caption {
    font-size: 0.95rem;
    font-family: var(--font-body);
    line-height: 1.4;
    color: rgba(246, 241, 231, 0.85);
}

/* Responsiveness for controls */
@media (max-width: 760px) {
    .lightbox__nav {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }
    .lightbox__nav--prev { left: 0.8rem; }
    .lightbox__nav--next { right: 0.8rem; }
    .lightbox__close { top: 1.2rem; right: 1.2rem; font-size: 2.2rem; }
    .lightbox__content { max-width: 90vw; }
}

/* ------------------------------------------------------------
   RESPONSIVE
------------------------------------------------------------ */
@media (max-width: 980px) {
    .hero__inner {
        grid-template-columns: minmax(0, 1fr) minmax(270px, 0.72fr);
        gap: 2.75rem;
    }

    .hero__name { font-size: clamp(2.8rem, 7vw, 4.7rem); }
    .hero__portrait { width: min(100%, 360px); }
}

@media (max-width: 760px) {
    .nav {
        flex-direction: column;
        justify-content: center;
        gap: 0.65rem;
        padding-top: 0.7rem;
        padding-bottom: 0.75rem;
    }
    .nav__brand { font-size: 1.15rem; }
    .nav__links {
        width: 100%;
        justify-content: center;
        gap: clamp(0.65rem, 3vw, 1rem);
    }
    .about__grid { grid-template-columns: 1fr; }
    .contact__grid { grid-template-columns: 1fr; }
    .hero__scroll { display: none; }
    .awards { grid-template-columns: 1fr; }

    .hero {
        min-height: auto;
        padding-top: 10rem;
        padding-bottom: 5rem;
    }

    .hero__inner {
        grid-template-columns: 1fr;
        grid-template-areas:
            "eyebrow"
            "name"
            "tagline"
            "portrait"
            "intro"
            "actions";
        gap: 0;
    }

    .hero__content { display: contents; }
    .hero__eyebrow { grid-area: eyebrow; text-align: center; }
    .hero__name { grid-area: name; text-align: center; }
    .hero__tagline { grid-area: tagline; text-align: center; }
    .hero__intro {
        grid-area: intro;
        margin: 2.25rem auto 2rem;
        text-align: center;
    }
    .hero__actions { grid-area: actions; justify-content: center; }
    .hero__portrait {
        grid-area: portrait;
        width: min(78vw, 310px);
        justify-self: center;
        margin-top: 1rem;
    }
}

@media (max-width: 460px) {
    .nav { padding-inline: 0.65rem; }
    .nav__links { gap: 0.55rem; }
    .nav__links a { font-size: 0.72rem; }
    .btn { padding: 0.75rem 1.3rem; }
    .hero__portrait-label { font-size: 0.58rem; letter-spacing: 0.1em; }

    .award-card {
        grid-template-columns: 68px minmax(0, 1fr);
        gap: 0.9rem;
        min-height: 130px;
        padding: 1rem;
    }
    .award-card__rank { font-size: 1.55rem; }
    .award-card__rank small {
        font-size: 0.52rem;
        letter-spacing: 0.06em;
    }
}

/* ------------------------------------------------------------
   VISITOR COUNTER WIDGET
   Subtle indicator in the footer displaying total site views.
------------------------------------------------------------ */
.site-footer__views {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.5rem;
    font-size: 0.76rem;
    font-family: var(--font-body);
    color: rgba(246, 241, 231, 0.4); /* Very subtle cotton shade */
    letter-spacing: 0.05em;
    gap: 0.25rem;
    transition: color 0.3s ease;
}
.site-footer__views:hover {
    color: rgba(246, 241, 231, 0.85);
}

/* ============================================================
   NEW EFFECTS (PARTICLES, SOCIALS, TILT)
============================================================ */

#particles-js {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    z-index: 0; /* Behind content, above weave */
}
.hero__inner, .hero__scroll {
    position: relative;
    z-index: 1; /* Stay above particles */
}

/* Social icons start */
.socials {
    position: relative;
    margin-top: 2rem;
}
.socials .social-icons {
    padding-left: 0;
    margin-bottom: 0;
    list-style: none;
    display: flex;
    gap: 1rem;
}
.social-icons a {
    font-size: 1.5rem;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    color: var(--cotton);
    background-color: var(--indigo);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    transition: all 0.2s linear;
}
.social-icons a:hover {
    color: var(--cotton);
    background-color: var(--teal);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}
/* Social icons end */

/* Tilt Effect */
.tilt {
    transform-style: preserve-3d;
    will-change: transform;
}

/* ============================================================
   PROJECT MODAL
============================================================ */
.project-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.project-modal[aria-hidden="false"] {
    visibility: visible;
    opacity: 1;
}

.project-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.project-modal__dialog {
    position: relative;
    background: var(--cotton);
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    border-radius: 8px;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transform: translateY(20px);
    transition: transform 0.3s ease;
    padding: 2.5rem;
}

.project-modal[aria-hidden="false"] .project-modal__dialog {
    transform: translateY(0);
}

.project-modal__close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--ink);
    cursor: pointer;
    transition: color 0.2s;
}

.project-modal__close:hover {
    color: var(--teal);
}

.project-modal__body img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 1rem;
}

/* ============================================================
   BEHIND THE SCENES GALLERY GRID
============================================================ */
#behind-the-scenes .gallery__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

#behind-the-scenes .gallery__item:nth-child(1) {
    grid-column: 1 / 2;
    grid-row: 1 / 4;
}

#behind-the-scenes .gallery__item:nth-child(n+2) {
    grid-column: 2 / 3;
}

#behind-the-scenes .gallery__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}



@media (max-width: 768px) {
    #behind-the-scenes .gallery__grid {
        grid-template-columns: 1fr;
    }
    #behind-the-scenes .gallery__item:nth-child(1) {
        grid-row: auto;
        grid-column: auto;
    }
    #behind-the-scenes .gallery__item:nth-child(n+2) {
        grid-column: auto;
    }
}
