/* ==========================================
   0. SHARED COLOURS
   Every piece of text on the site resolves to one of these two.
   Change them here and the whole site follows.
   ========================================== */
:root {
    --ink: #ffffff;        /* all body text   */
    --ink-soft: #ffffff;   /* supporting text */
}

/* ==========================================
   1. SYSTEM RESET & TRANSPARENT ROOT LAYER
   ========================================== */
html, body {
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
    font-family: 'Inter', sans-serif;
    color: #ffffff;
    scroll-behavior: smooth;
    
    /* 1. REMOVE THE SOLID BACKDROP PAINT FROM THE ROOT nodes */
    background: transparent !important; 
    position: relative;
}

/* ==========================================
   THE LAYERED BACKDROP STACK (FIXED)
   ========================================== */

/* LAYER 1 (DEEPEST): The absolute fallback color base */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #020024; /* Your signature dark baseline color */
    z-index: -3;               /* The absolute deepest layer */
    pointer-events: none;
}

/* LAYER 2 (MIDDLE): The actual streaming video component */
.bg-video {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    object-fit: cover; 
    z-index: -2;               /* Sits safely on top of the fallback color layer */
    pointer-events: none; 
}

/* LAYER 3 (VEIL): near black down the left, easing to grey on the right, so
   text on the left of each slide sits on the darkest part while the video
   shows through more on the right. Every stop is a plain grey on purpose, so
   no blue or purple creeps back in.
   To go back to one flat tone: background: rgba(38, 38, 42, 0.62); */
body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(
        90deg,
        rgba(0, 0, 0, 0.90) 0px,
        rgba(0, 0, 0, 0.90) 60px,      /* holds flat black before easing off */
        rgba(14, 14, 16, 0.82) 22%,
        rgba(34, 34, 38, 0.68) 55%,
        rgba(62, 62, 66, 0.48) 100%
    );
    z-index: -1;                     /* Sits directly on top of the video player */
    pointer-events: none;
}

/* Keep your page wrappers transparent so the video is visible underneath */
#page1, #page2, #page3, #page4 {
    background: transparent !important;
}

/* ==========================================
   THE CRUCIAL BACKGROUND FIX
   Stripping solid color walls so the global animated layers show through
   ========================================== */
#page1, #page2, #page3, #page4 {
    background: transparent !important;
}



/* ==========================================
   2. FIXED NAVIGATION BAR
   ========================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    display: flex;
    justify-content: center;
    gap: 40px;
    padding: 10px 0;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar a {
    color: #ffffff;
    text-decoration: none;
    font-weight: 800;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.3s ease;
    padding-left: 70px;
    padding-right: 70px;
    text-align: center;
}

.navbar a:hover {
    color: #ffffff;
    text-shadow: 0 0 14px rgba(255, 255, 255, 0.85);
    transform: translateY(2px);
}

/* ==========================================
   3. SCROLL SNAP ENGINE
   ========================================== */
.scroll-container {
    height: 100vh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    position: relative !important;
    z-index: 1 !important;
    background: transparent !important;
}

.scroll-container::-webkit-scrollbar {
    width: 0px; /* Hidden scrollbar for native app aesthetic */
}

/* ==========================================
   4. LAYOUT COMPONENT STRUCTURING
   ========================================== */
.page {
    height: 100vh;
    width: 100vw;
    scroll-snap-align: start;
    display: flex;
    justify-content: center; /* Center horizontally by default */
    align-items: center;     /* Center vertically by default */
    box-sizing: border-box;
    padding: 0 10%;
}

/* Main internal layout wrapper */
.page-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Custom alignment rule for Page 1 (Mid-Left-Top layout positioning) */
.page-content.align-left-center {
    width: 100%;
    max-width: 1200px;
    align-items: flex-start; /* Aligns content to the left side */
    padding-left: 10%;       /* Pushes it halfway out toward the center */
    margin-top: -50px;       /* Balances vertical centering upwards */
}

/* ==========================================
   5. TYPOGRAPHIC HIERARCHY (BIG vs small)
   ========================================== */
.giant-heading {
    font-family: 'Kanit', 'Inter', sans-serif;
    font-size: 5.5rem;
    font-weight: 800;
    letter-spacing: -1px;
    color: #ffffff;
    text-shadow: 0 0 40px rgba(251, 251, 251, 0.2);
    margin: 0;
    text-transform: uppercase;
}

.bio-text {
    display: flex;
    flex-direction: column;
    gap: 10px;

}

.bio-text h2 {
    font-family: 'Kanit', 'Inter', sans-serif;
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin: 0;
    color: var(--ink);
}

.bio-text h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ink);
    margin: 0;
}

.highlight {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--ink);
    margin-top: 15px;
    max-width: 700px;
    line-height: 1.4;
}

p {
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
}

/* ==========================================
   8. DYNAMIC DECK STACKING ENGINE
   ========================================== */
.page-content.wide-layout {
    width: 100%;
    max-width: 1500px;
    align-items: center;
    justify-content: center;
}

/* A row of equal cards. Opening one lets it grow and the rest shrink,
   driven entirely by flex-grow, so it holds up with any number of cards
   at any width. */
.projects-container {
    display: flex;
    position: relative;
    width: 100%;
    margin-top: 10px;
    align-items: stretch;
    gap: 18px;
    justify-content: flex-start;

    /* cards keep a readable width, so the row runs off the edge and scrolls */
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px 2px;
    overscroll-behavior-x: contain;

    /* the row drives itself, so the scrollbar strip is just clutter */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.projects-container::-webkit-scrollbar { display: none; }

.project-card {
    flex: 0 0 clamp(286px, 24vw, 340px);
    min-width: 0;
    min-height: clamp(360px, 52vh, 440px);
    background: #0d1117 !important;
    border: 1px solid rgba(180, 180, 180, 0.12);
    border-radius: 14px;
    padding: 22px;
    padding-right: 34px;
    display: flex;
    flex-direction: row;
    gap: 0;
    position: relative;
    overflow: hidden;
    z-index: 5;
    transition: flex-basis 0.55s cubic-bezier(0.25, 1, 0.3, 1),
                opacity 0.35s ease,
                border-color 0.3s ease,
                background-color 0.3s ease,
                box-shadow 0.4s ease;
}

.project-card.expanded {
    flex-basis: min(840px, 76vw);
    min-height: 0;
    background: #0b1220 !important;
    border-color: rgba(233, 233, 233, 0.4);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
    z-index: 40;
}

/* the ones that stay shut step back a little */
.projects-container.has-expanded .project-card:not(.expanded) {
    opacity: 0.55;
}

.project-info-side {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: flex-basis 0.55s cubic-bezier(0.25, 1, 0.3, 1);
}

.project-card.expanded .project-info-side {
    flex: 0 0 clamp(240px, 22vw, 320px);
}

.project-demo-side {
    flex: 0 1 0;
    min-width: 0;
    padding-left: 0;
    opacity: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: flex-grow 0.55s cubic-bezier(0.25, 1, 0.3, 1),
                padding-left 0.55s cubic-bezier(0.25, 1, 0.3, 1),
                opacity 0.3s ease;
}

.project-card.expanded .project-demo-side {
    flex-grow: 1.3;
    padding-left: 20px;
    opacity: 1;
}

.project-card.expanded .tech-desc {
    -webkit-line-clamp: unset;
    overflow: visible;
}

/* While a card is shut its demo panel is only a few pixels wide, so anything
   left in flow inside it wraps to one character per line and stretches the
   whole row. Taking the contents out of flow until the card opens is what
   keeps all four cards the same sensible height. */
.project-demo-side > * { display: none; width: 100%; min-width: 0; }
.project-card.expanded .project-demo-side > * { display: block; }

.project-demo-side { flex-direction: column; gap: 10px; }

/* the diagram keeps its own shape rather than the 16:9 of a screenshot,
   so nothing at the top or bottom of the flow gets cropped away */
/* The box is sized from its height and keeps the diagram's own proportions,
   so nothing is letterboxed and nothing is cropped. Height is capped, since
   the diagram is taller than it is wide and would otherwise push the open
   card past the bottom of the slide. */
.aspect-ratio-box.diagram-box {
    padding-top: 0;          /* beats the 56.25% spacer the photo boxes use */
    height: min(52vh, 400px);
    width: auto;
    max-width: 100%;
    aspect-ratio: 1080 / 940;
    align-self: center;
    flex: 0 0 auto;
    background: #111111;
    border-color: rgba(255, 255, 255, 0.12);
}

/* two classes on purpose: .demo-img is defined further down the file and
   would otherwise win on source order and crop the diagram */
.demo-img.demo-diagram {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 10px;
    box-sizing: border-box;
    background: #111111;
}

.demo-caption {
    font-size: 0.78rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.72);
}

.demo-placeholder {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.35);
}

.project-card:hover {
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 20; 
    background: rgba(153, 255, 51, 0.02);
    transform: translateY(-4px);
}

.aspect-ratio-box {
    width: 100%;
    position: relative;
    padding-top: 56.25%; 
    background: #0b1220;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

.demo-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 83%;
    object-fit: cover;
    background-color: #0b1220;
}

/* ==========================================
   THE TOGGLE BUTTON DESIGN REGULATION
   ========================================== */
.side-dropdown-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    
    width: 32px;
    height: 32px;
    border-radius: 50%;
    
    background: #0f172a;
    border: 1px solid rgba(153, 255, 51, 0.3);
    color: #ffffff;
    
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    padding: 0;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.arrow-icon {
    width: 14px;
    height: 14px;
    transition: transform 0.3s ease;
}

.side-dropdown-btn:hover {
    background: #ffffff;
    color: #05070a;
    border-color: #f8f8f8;
    box-shadow: 0 0 15px rgba(1, 1, 1, 0.4);
}

.project-card.expanded .side-dropdown-btn .arrow-icon {
    transform: rotate(90deg);
}

.project-card.expanded .side-dropdown-btn {
    right: 15px; 
}

.project-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 11px;
    margin-bottom: 16px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.14);
    padding-bottom: 14px;
}

/* year and link sit side by side under the title, not stacked beside it */
.proj-btn {
    display: flex;
    flex-direction: row;
    gap: 8px;
}

.project-header h3 {
    font-family: 'Kanit', 'Inter', sans-serif;
    font-size: 1.25rem;
    font-weight: 800;
    margin: 0;
    color: #ffffff;
    line-height: 1.4;
    letter-spacing: -0.3px;
    padding-right: 10px;
}

.project-date {
    font-size: 0.8rem;
    font-weight: 800;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 8px;
    border-radius: 4px;
}

.project-body {
    flex-grow: 1;
    margin-bottom: 20px;
}

.tech-desc {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 8;
    overflow: hidden;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.55;
    color: #ffffff !important;
    text-align: left;
}

.project-tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.project-tech-tags span {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #ffffff;
    background: rgba(153, 255, 51, 0.06);
    padding: 5px 10px;
    border-radius: 4px;
    border: 1px solid rgba(153, 153, 153, 0.1);
}

/* ==========================================
   CONTACT SECTION LAYOUT
   ========================================== */
.page-content.contact-layout {
    align-items: center;
    text-align: center;
    max-width: 800px;
}

.contact-sub {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--ink) !important;
    margin-bottom: 30px !important;
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    max-width: 500px;
}

.contact-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 18px 25px;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.contact-label {
    font-size: 1.25rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--ink);
}

.contact-value {
    font-size: 1.05rem;
    font-weight: 900;
    color: var(--ink);
    transition: color 0.3s ease;
}

.contact-item:hover {
    background: rgba(65, 51, 255, 0.03);
    border-color: rgba(49, 109, 129, 0.3);
    transform: scale(1.02);
}

.contact-item:hover .contact-value {
    color: var(--ink);
    text-shadow: 0 0 10px rgba(54, 51, 255, 0.2);
}

/* ==========================================
   BADGE CONTAINER GRID
   ========================================== */
.badge-container {
    display: flex;
    flex-direction: row;
    justify-content: center; 
    gap: 30px;
    width: 100%;
    margin-top: 30px;
}

.certificate-badge {
    width: 280px;           
    height: 160px;          
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.6) 0%, rgba(3, 5, 10, 0.8) 100%);
    border: 2px dashed rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    display: flex;          
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    padding: 15px;
    transition: all 0.3s ease;
}

.badge-img {
    max-height: 120px;      
    max-width: 100%;
    object-fit: contain;    
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================
   PAGE 1 TWO-COLUMN SPLIT ROW LAYOUT
   ========================================== */
.page-content.align-split-row {
    display: flex;
    flex-direction: row;       
    justify-content: space-between; 
    align-items: center;       
    width: 100%;
    max-width: 1200px;
    gap: 90px;                 
}

.intro-text-column {
    flex: 1.2;                 
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.intro-animation-column {
    flex: 0.8;                 
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Responsive adjustment for small screens */
@media (max-width: 768px) {
    .page-content.align-split-row {
        flex-direction: column; 
        text-align: center;
    }
    lottie-player {
        max-width: 300px;      
    }
}

.project-header a{
    font-size: 0.8rem;
    font-weight: 600;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 8px;
    border-radius: 4px;
    gap:10px;
    text-decoration: none;

}

.project-header span,
.project-header a {
  display: inline-block;
  text-align: center;
  margin-bottom: 0;
  font-size: 0.8rem;
  font-weight: 800;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 8px;
  border-radius: 4px;
  text-decoration: none;
  
}

/* ==========================================
   PAGE 2 CUSTOM LAYOUT (Vertical Heading & Horizontal Skills)
   ========================================== */
/* ==========================================
   PAGE 2 CUSTOM LAYOUT (Letter-by-Letter Vertical Heading)
   ========================================== */
/* ==========================================
   PAGE 2 LAYOUT (Clean Vertical Upright Heading)
   ========================================== */
.page-content.page2-layout {
    flex-direction: row !important;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    max-width: 1500px;
    gap: 40px;
}

/* Professional letter-by-letter vertical stacking */
.vertical-upright-heading {
    writing-mode: vertical-rl;
    text-orientation: upright;
    font-size: 2.2rem !important; /* Perfect readable size */
    letter-spacing: 4px;         /* Adds clean breathing room between letters */
    line-height: 1;
    text-align: center;
    margin: 0 !important;
    flex-shrink: 0;
    text-transform: uppercase;
    padding: 14px 7px;
    border-radius: 16px;
    background-color: #000000;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
}

.page2-right-content {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 20px;
}

/* Stretch skills horizontally across the grid */
.skills-grid.horizontal-skills {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
    gap: 15px;
    margin-bottom: 0;
}

/* Transparent background by default, visible on hover */
/* ==========================================
   GLOSSY GLASSMORPHISM SKILLS BOX
   ========================================== */
.skills-category {
    flex: 1;
    /* Glassmorphism glossy background */
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0.02) 100%) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    
    /* Subtle glossy borders & reflections */
    border: 1px solid rgba(39, 38, 38, 0.15);
    border-top: 1px solid rgba(251, 251, 251, 0.3); /* Brighter top edge for light reflection */
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    
    padding: 15px;
    height: 300px;
    border-radius: 12px;
    opacity: 0.85;
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    transform: none !important;
}

/* Hover state: Brightens and pops the glossy card */
.skills-category:hover {
    background: linear-gradient(135deg, rgba(212, 212, 212, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%) !important;
    opacity: 1;
    transform: translateY(-8px) scale(1.02) !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), 0 0 20px rgba(81, 82, 81, 0.2);
    border-color: rgba(239, 239, 239, 0.5);
    border-top: 1px solid rgba(103, 103, 103, 0.8);
}


/*responsive */

/* ==========================================
   9. MOBILE RESPONSIVE ADAPTATIONS (max-width: 768px)
   ========================================== */
@media (max-width: 768px) {
    /* Allow pages to grow dynamically based on contents on small screens */
    html, body {
        overflow-y: auto !important;
        height: auto !important;
    }
    
    .scroll-container {
        height: auto !important;
        overflow-y: visible !important;
        scroll-snap-type: none !important; /* Disable strict snapping for easier scrolling */
    }

    .page {
        height: auto !important;
        min-height: 100vh;
        width: 100vw;
        padding: 80px 20px 40px 20px !important; /* Spacing for fixed navbar */
        scroll-snap-align: none !important;
        display: block !important; /* Fall back from rigid flexing */
    }

    /* Navbar tuning */
    .navbar {
        gap: 10px;
        padding: 12px 10px;
        justify-content: space-around;
    }

    .navbar a {
        padding-left: 0 !important;
        padding-right: 0 !important;
        font-size: 0.75rem;
        letter-spacing: 1px;
        flex: 1;
    }

    /* Page Content wrapper configurations */
    .page-content,
    .page-content.align-left-center,
    .page-content.wide-layout,
    .page-content.contact-layout {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 0 !important;
        margin-top: 0 !important;
        align-items: center !important;
        text-align: center;
    }

    /* Typography scale downs */
    .giant-heading {
        font-size: 2.8rem !important;
        letter-spacing: -1px;
        margin-bottom: 15px !important;
    }

    .bio-text h2 {
        font-size: 1.6rem !important;
    }

    .bio-text h3 {
        font-size: 1.1rem !important;
    }

    .highlight {
        font-size: 1.1rem !important;
        margin-top: 10px;
    }

    /* Skills layout restructuring */
    .skills-grid {
        display: grid;
        grid-template-columns: 1fr 1fr; /* Creates exactly two equal columns */
        gap: 20px; /* Adds space between the categories (adjust as needed) */
}

.skills-category {
  /* Optional: Adds a background and padding so you can clearly see the boxes */
        background-color: #f4f4f4;
        padding: 15px;
        border-radius: 8px;
        box-sizing: border-box; /* Ensures padding doesn't break the grid */
}

/* Optional styling for the headings inside the boxes */
.skills-category h2 {
        margin-top: 0;
        font-size: 1.2rem;
}

    .skills-category:hover {
        transform: none !important;
    }

    .skills-category h3 {
        font-size: 1.2rem !important;
        margin-bottom: 5px !important;
    }

    

    /* Badge Grid tuning */
    .badge-container {
        flex-direction: column !important;
        align-items: center;
        gap: 15px !important;
        transform: none !important;
        margin-top: 25px;
    }

    .certificate-badge {
        width: 100% !important;
        max-width: 280px;
    }

    /* Projects: cards unroll into a single column, demos always open */
    .projects-container {
        flex-direction: column !important;
        min-height: 0 !important;
        gap: 18px !important;
        align-items: center !important;
    }

    /* Hide the desktop toggling button element since cards are fully unrolled */
    .side-dropdown-btn {
        display: none !important;
    }

    .project-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .project-header h3 {
        text-align: left;
    }

    .proj-btn {
        display: flex;
        gap: 10px;
        width: 100%;
    }

    .project-header span, 
    .project-header a {
        margin-bottom: 0;
    }

    /* Contact Links block adjustments */
    .contact-links {
        max-width: 100% !important;
    }

    .contact-item {
        padding: 14px 18px !important;
    }

    .contact-value {
        font-size: 0.95rem !important;
    }
}

/* ==========================================
   RESUME BUTTON HIGHLIGHT STYLING
   ========================================== */
.contact-item.resume-btn {
    background: rgba(58, 51, 255, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.contact-item.resume-btn:hover {
    background: rgba(61, 51, 255, 0.1) !important;
    border-color: #000000 !important;
    box-shadow: 0 0 25px rgba(33, 15, 126, 0.25) !important;
    transform: scale(1.03);
}





/* ==========================================================
   PROJECTS — FITTING FOUR CARDS ON ONE SLIDE
   ========================================================== */
#page3 .giant-heading {
    font-size: clamp(2.1rem, 4.4vw, 3.5rem);
    margin-bottom: 4px;
}

#page3 .projects-container { margin-top: 10px; }

#page3 .project-header h3 { font-size: 1rem; line-height: 1.3; }
#page3 .project-header { margin-bottom: 10px; padding-bottom: 10px; }
#page3 .project-body { margin-bottom: 12px; }

#page3 .project-tech-tags span {
    font-size: 0.66rem;
    padding: 3px 7px;
    letter-spacing: 0.04em;
}

#page3 .tech-desc {
    font-size: 0.88rem;
    line-height: 1.6;
    -webkit-line-clamp: 8;
}

#page3 .project-card.expanded .tech-desc {
    font-size: 0.9rem;
    -webkit-line-clamp: unset;
}

/* ==========================================================
   PROJECTS — STACKED LAYOUT
   Four cards side by side need real width. Below 1100px they unroll into
   a single column with every demo already open, and the toggle is hidden.
   ========================================================== */
@media (max-width: 1200px) {
    .projects-container {
        flex-direction: column;
        min-height: 0;
        gap: 18px;
        align-items: center;
    }

    .project-card,
    .project-card.expanded,
    .projects-container.has-expanded .project-card:not(.expanded) {
        flex: 0 0 auto;
        flex-direction: column;
        width: 100%;
        max-width: 760px;
        box-sizing: border-box;
        opacity: 1;
        padding-right: 22px;
    }

    .project-card { min-height: 0; }

    .project-card.expanded .project-info-side { flex: 0 0 auto; }

    .project-demo-side,
    .project-card.expanded .project-demo-side {
        flex: 0 0 auto;
        width: 100%;
        max-width: 560px;
        padding-left: 0;
        margin-top: 14px;
        opacity: 1;
        overflow: visible;
    }

    .tech-desc,
    .project-card.expanded .tech-desc {
        -webkit-line-clamp: unset;
        overflow: visible;
    }

    .project-demo-side > * { display: block; }

    /* stacked: the diagram takes the full width and its height follows */
    .aspect-ratio-box.diagram-box {
        width: 100%;
        height: auto;
    }

    .side-dropdown-btn { display: none; }
}

/* ==========================================
   PAGE 1 — INTRO POINTS AND STATS
   ========================================== */
.intro-points {
    list-style: none;
    margin: 4px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 9px;
    max-width: 44ch;
}

.intro-points li {
    position: relative;
    padding-left: 24px;
    font-size: 0.98rem;
    font-weight: 600;
    line-height: 1.45;
    color: var(--ink);
}

.intro-points li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.52em;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.85);
}

.intro-points strong { font-weight: 800; }

.intro-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 16px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.42);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.stat strong {
    font-family: 'Kanit', 'Inter', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1;
    color: #ffffff;
}

.stat span {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
}

/* the intro column needs room now that it carries more */
.intro-text-column { gap: 22px !important; }

@media (max-width: 768px) {
    .intro-points { align-items: flex-start; text-align: left; margin-inline: auto; }
    .intro-stats { justify-content: center; }
    .stat { padding: 8px 13px; }
    .stat strong { font-size: 1.25rem; }
}

/* ==========================================
   10. SLIDE CHOREOGRAPHY
   Every page is a slide and arrives as ONE solid block: the whole content
   panel moves into place together and settles. Nothing inside flies in from
   its own direction any more — a dozen elements each taking their own path
   is what made scrolling feel restless.

   reveal.js adds .is-visible while a slide is on screen and .is-leaving
   while it moves away, so the move replays on every visit.
   ========================================== */
:root {
    --ease-slide: cubic-bezier(0.22, 1, 0.36, 1);   /* firm, no overshoot */
    --ease-exit:  cubic-bezier(0.4, 0, 0.7, 1);
    --ease-out:   cubic-bezier(0.16, 1, 0.3, 1);    /* still used by hovers */
    --slide-in:  0.72s;
    --slide-out: 0.32s;
}

/* One slide per flick, and never a sideways scrollbar */
.scroll-container {
    overflow-x: hidden;
    scroll-behavior: smooth;
}

.page {
    scroll-snap-stop: always;
}

/* ---------- Navbar drops in once, on load ---------- */
.navbar {
    animation: navDrop 0.7s var(--ease-slide) 0.05s backwards;
}

@keyframes navDrop {
    from { opacity: 0; translate: 0 -100%; }
}

/* ---------- The slide move ---------- */
.js-anim .page .page-content {
    will-change: transform, opacity;
}

/* waiting its turn */
.js-anim .page:not(.is-visible):not(.is-leaving) .page-content {
    opacity: 0;
    translate: 0 48px;
    pointer-events: none;
}

.js-anim .page.is-visible .page-content {
    animation: slideIn var(--slide-in) var(--ease-slide) both;
}

.js-anim .page.is-leaving .page-content {
    animation: slideOut var(--slide-out) var(--ease-exit) both;
}

@keyframes slideIn {
    from { opacity: 0; translate: 0 48px; }
    to   { opacity: 1; translate: 0 0; }
}

@keyframes slideOut {
    from { opacity: 1; translate: 0 0; }
    to   { opacity: 0; translate: 0 -36px; }
}


/* ==========================================
   PAGE 1 — AMBIENT MOTION
   Slow, continuous and quiet. These loops never restart with the slide,
   they just breathe underneath it.
   ========================================== */

/* Two soft lights drifting behind the intro */
#page1 .page-content { position: relative; }

#page1 .page-content::before,
#page1 .page-content::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
    filter: blur(60px);
}

#page1 .page-content::before {
    width: 30rem;
    height: 30rem;
    top: -8rem;
    left: -10rem;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.16), transparent 70%);
    animation: driftA 26s ease-in-out infinite;
}

#page1 .page-content::after {
    width: 24rem;
    height: 24rem;
    bottom: -7rem;
    right: -6rem;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.11), transparent 70%);
    animation: driftB 34s ease-in-out infinite;
}

@keyframes driftA {
    0%, 100% { translate: 0 0;        scale: 1; }
    50%      { translate: 70px 50px;  scale: 1.14; }
}

@keyframes driftB {
    0%, 100% { translate: 0 0;         scale: 1.08; }
    50%      { translate: -60px -45px; scale: 0.94; }
}

/* The portrait floats, with a glow breathing behind it */
.intro-animation-column {
    position: relative;
    animation: float 9s ease-in-out infinite;
}

.intro-animation-column::before {
    content: "";
    position: absolute;
    inset: -14px;
    z-index: -1;
    border-radius: 24px;
    background: radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.3), transparent 72%);
    filter: blur(26px);
    animation: breathe 11s ease-in-out infinite;
}

.intro-animation-column img {
    border-radius: 14px;
    box-shadow: 0 28px 60px rgba(0, 0, 0, 0.55);
}

@keyframes float {
    0%, 100% { translate: 0 0; }
    50%      { translate: 0 -12px; }
}

@keyframes breathe {
    0%, 100% { opacity: 0.45; scale: 1; }
    50%      { opacity: 0.85; scale: 1.06; }
}

/* No glow on the heading: plain white letters read cleaner against the dark
   left edge than a halo does. The slow pulse that used to live here was
   washing the whole word out at its brightest. */
#page1 .giant-heading {
    text-shadow: none;
}

/* The accent rule under the heading pulses very gently */
#page1 .giant-heading::after {
    animation: ruleGlow 7s ease-in-out infinite;
}

@keyframes ruleGlow {
    0%, 100% { opacity: 0.75; width: 96px; }
    50%      { opacity: 1;    width: 128px; }
}


/* ==========================================
   REDUCED MOTION — hold everything still
   ========================================== */
@media (prefers-reduced-motion: reduce) {
    .navbar,
    .page *,
    .page *::before,
    .page *::after,
    .js-anim .page .page-content {
        animation: none !important;
    }

    .js-anim .page .page-content {
        opacity: 1 !important;
        translate: none !important;
    }

    .scroll-container { scroll-behavior: auto; }
}

/* ==========================================================
   CONTACT PAGE IMAGES  (left + right hand)
   They show ONLY on the last page. Edit the numbers below.
   ========================================================== */
#page4 {
    /* size of each image box (the picture fits inside without stretching) */
    --hand-width: 59vw;          /* wider screen = wider image   */
    --hand-height: 99vh;         /* taller screen = taller image */

    /* vertical position, 0% = top of the page, 50% = middle, 100% = bottom */
    --hand-left-top: 50%;
    --hand-right-top: 50%;

    /* sideways position. 0px = touching the screen edge.
       positive = move toward the middle, negative = push off the edge */
    --hand-left-x: -355px;
    --hand-right-x: -355px;
}

.page-content.contact-layout {
    position: relative;
}

.image-container-hand {
    position: absolute;
    width: var(--hand-width);
    height: var(--hand-height);
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 0;
}

.image-container-hand img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.hand-left {
    top: var(--hand-left-top);
    left: calc(50% - 50vw + var(--hand-left-x));
}
.hand-left img { object-position: left center; }

.hand-right {
    top: var(--hand-right-top);
    right: calc(50% - 50vw + var(--hand-right-x));
}
.hand-right img { object-position: right center; }

/* the hands ride in with their slide, nothing of their own to do */

/* phones: no space beside the contact list, so the images are left out */
@media (max-width: 768px) {
    .image-container-hand { display: none; }
}

/* ==========================================================
   PAGE 2 — SKILLS
   The page reads as two bands with one spine down the left:

     [S]  [ portrait ]  [ 2 x 2 skill cards      ]
     [S]  [ Toolkit ............ Certifications  ]

   The SKILLS pill is the spine and runs the full height of both
   bands, which is what holds the composition together.
   ========================================================== */
#page2 {
    position: relative;
}

@media (min-width: 769px) {
    #page2 .page-content.page2-layout {
        display: grid;
        /* fixed spine, so the full-width lower band cannot inflate it */
        grid-template-columns: 58px minmax(0, 250px) minmax(0, 1fr);
        grid-template-areas:
            "label photo cards"
            "label extras extras";
        align-items: stretch;
        justify-content: center;
        gap: 22px;
        width: 100%;
        max-width: 1120px;
        margin: 0 auto;
    }

    #page2 .vertical-upright-heading { grid-area: label; }
    #page2 .page2-photo              { grid-area: photo; }
    #page2 .page2-right-content      { grid-area: cards; }
    #page2 .page2-extras             { grid-area: extras; }

    #page2 .vertical-upright-heading {
        align-self: stretch;
        display: grid;
        place-items: center;
        box-sizing: border-box;      /* padding + border stay inside the 58px track */
        width: 58px;
        height: auto;
        margin: 0 !important;
        padding: 18px 6px !important;
        transform: none !important;
    }
}

/* ---------- The portrait ---------- */
#page2 .page2-photo {
    width: 100%;
    min-height: 240px;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
}

#page2 .page2-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ---------- The four skill cards ---------- */
#page2 .page2-right-content {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
}

#page2 .skills-grid.horizontal-skills {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    width: 100%;
    height: 100%;
    margin: 0;
}

#page2 .skills-category {
    height: auto;
    width: auto;
    padding: 18px 20px;
    box-sizing: border-box;
    overflow: hidden;
}

#page2 .skills-category h2 {
    font-size: 1.3rem;
    margin: 0 0 10px;
}

/* ==========================================================
   THE LOWER BAND — toolkit and certifications side by side
   ========================================================== */
.page2-extras {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: 20px;
    width: 100%;
    min-width: 0;
}

.panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    padding: 16px 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
}

.panel__title {
    margin: 0;
    font-family: 'Kanit', 'Inter', sans-serif;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
}

/* ---------- Individual tool tiles ---------- */
.tool-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.tool {
    position: relative;
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: #000000;
    border: 1px solid rgba(255, 255, 255, 0.13);
    cursor: default;
    transition: transform 0.25s cubic-bezier(0.34, 1.3, 0.5, 1),
                border-color 0.25s ease,
                box-shadow 0.25s ease;
}

.tool svg {
    width: 24px;
    height: 24px;
    fill: #9b9ba2;
    transition: fill 0.25s ease;
}

.tool:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.6);
}

.tool:hover svg { fill: #ffffff; }

/* name appears above the tile on hover */
.tool__name {
    position: absolute;
    bottom: calc(100% + 7px);
    left: 50%;
    translate: -50% 4px;
    padding: 4px 9px;
    border-radius: 7px;
    background: #000000;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    white-space: nowrap;
    color: #ffffff;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, translate 0.2s ease;
}

.tool:hover .tool__name,
.tool:focus-visible .tool__name {
    opacity: 1;
    translate: -50% 0;
}

/* ---------- Certificates ---------- */
.panel--certs .badge-container {
    display: flex;
    flex-direction: row;
    gap: 12px;
    width: 100%;
    margin: 0;
    flex: 1;
}

.panel--certs .certificate-badge {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    height: auto;
    min-height: 96px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    background: #000000;
    transition: transform 0.25s var(--ease-out), border-color 0.25s ease;
}

.panel--certs .certificate-badge:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.45);
}

.panel--certs .badge-img {
    max-height: 72px;
    max-width: 100%;
    object-fit: contain;
}

/* ==========================================================
   PAGE 2 — NARROWER SCREENS
   ========================================================== */

/* Laptop: the portrait steps aside so the cards keep their width */
@media (min-width: 769px) and (max-width: 1080px) {
    #page2 .page-content.page2-layout {
        grid-template-columns: 58px minmax(0, 1fr);
        grid-template-areas:
            "label cards"
            "label extras";
        max-width: 860px;
    }

    #page2 .page2-photo { display: none; }
}

/* Phone: one column, the spine lies flat as a pill above the cards */
@media (max-width: 768px) {
    #page2 .page-content.page2-layout {
        display: flex !important;
        flex-direction: column !important;
        align-items: center;
        gap: 16px;
    }

    #page2 .page2-photo { display: none; }

    #page2 .vertical-upright-heading {
        writing-mode: horizontal-tb;
        text-orientation: mixed;
        width: auto;
        height: auto;
        margin: 0 !important;
        padding: 9px 28px !important;
        transform: none !important;
        border-radius: 999px;
        letter-spacing: 8px;
        font-size: 1.5rem !important;
    }

    #page2 .skills-category { padding: 14px 16px; }
    #page2 .skills-category h2 { font-size: 1.15rem; }

    .page2-extras {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }

    .tool { width: 46px; height: 46px; border-radius: 11px; }
    .tool svg { width: 21px; height: 21px; }
}

@media (max-width: 520px) {
    #page2 .skills-grid.horizontal-skills { grid-template-columns: minmax(0, 1fr); }
    .panel--certs .badge-container { flex-direction: column; }
}

/* the portrait rides in with its slide, nothing of its own to do */

/* Add this anywhere in your style.css */
#page2 .skills-category p {
    display: inline;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.6;
    margin: 0;
    color: var(--ink);
}

#page2 .skills-category h2 {
    font-family: 'Kanit', 'Inter', sans-serif;
    font-weight: 800;
    color: var(--ink);
}

#page2 .skills-category p:not(:last-of-type)::after {
    content: ", ";
}