/* MAHIDOL SCIENCE ODYSSEY — stylesheet ร่วมของหน้าแรกและหน้าโครงการ */
:root {
    --navy:       #17468c;
    --navy-dark:  #0f3068;
    --navy-deep:  #0a1f4a;
    --navy-mid:   #2563eb;
    --navy-pale:  #e8f0fb;
    --navy-tint:  #f5f9ff;
    --gold:       #f9bc2c;
    --gold-dark:  #e5a200;
    --gold-deep:  #b45309;
    --gold-pale:  #fff8e1;
    --green:      #2ecc71;
    --green-pale: #e6f9ef;
    --sky:        #e0f0ff;
    --bg:         #eef3fc;
    --white:      #ffffff;
    --text:       #0f1e3a;
    --text-soft:  #1a2e4a;
    --muted:      #5a7294;
    --muted-soft: #8aa0bd;
    --border:     #d1e0f5;
    --border-soft:#e5edf9;
    --radius:     18px;
    --shadow-xs:  0 1px 3px rgba(23,70,140,0.06);
    --shadow-sm:  0 2px 12px rgba(23,70,140,0.08);
    --shadow:     0 6px 28px rgba(23,70,140,0.11);
    --shadow-lg:  0 16px 56px rgba(23,70,140,0.18);
    --shadow-glow-navy: 0 12px 40px rgba(23,70,140,0.25);
    --shadow-glow-gold: 0 12px 40px rgba(249,188,44,0.3);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Sarabun', sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    background-image:
        radial-gradient(circle at 20% 15%, rgba(190,227,255,0.35) 0%, transparent 35%),
        radial-gradient(circle at 85% 25%, rgba(255,240,179,0.32) 0%, transparent 40%),
        radial-gradient(circle at 50% 80%, rgba(200,245,220,0.3) 0%, transparent 45%);
    background-attachment: fixed;
}

/* ── DECORATIVE BLOBS ── */
.blobs {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}
.blob { position: absolute; border-radius: 50%; filter: blur(100px); opacity: 0.18; }
.blob-1 { width: clamp(280px,60vw,600px); height: clamp(280px,60vw,600px); background: #bee3ff; top: -15%; left: -10%; }
.blob-2 { width: clamp(240px,50vw,500px); height: clamp(240px,50vw,500px); background: #fff0b3; top: 20%; right: -10%; }
.blob-3 { width: clamp(200px,40vw,400px); height: clamp(200px,40vw,400px); background: #c8f5dc; bottom: 0; left: 30%; }

/* ── HEADER ── */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255,255,255,0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 2px solid var(--border);
    box-shadow: 0 2px 16px rgba(23,70,140,0.06);
}
.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 clamp(1rem, 4vw, 2rem);
    height: clamp(60px, 12vw, 120px);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
/* โลโก้ย่อได้เมื่อพื้นที่ไม่พอ เพื่อไม่ให้ดันเมนูล้นขอบขวา */
.logo-wrap { flex: 0 1 auto; min-width: 0; margin-right: 1rem; }
.logo-wrap img { height: auto; max-height: clamp(60px, 12vw, 120px); width: auto; max-width: 100%; display: block; }

nav.desktop-nav { display: flex; align-items: center; gap: clamp(0.25rem, 1.2vw, 1.25rem); flex-shrink: 0; }
nav.desktop-nav a {
    white-space: nowrap;
    font-family: 'Kanit', sans-serif;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--muted);
    text-decoration: none;
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    transition: all 0.2s;
}
nav.desktop-nav a:hover { background: var(--navy-pale); color: var(--navy); }
nav.desktop-nav a.active { background: var(--navy); color: white; }

.menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--navy);
    cursor: pointer;
    padding: 0.25rem;
}
.mobile-menu {
    display: none;
    flex-direction: column;
    background: white;
    border-top: 1px solid var(--border);
    padding: 0.75rem 2rem 1.25rem;
    gap: 0.2rem;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
    font-family: 'Kanit', sans-serif;
    color: var(--muted);
    text-decoration: none;
    padding: 0.7rem 0.75rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s;
}
.mobile-menu a:hover, .mobile-menu a.active { background: var(--navy-pale); color: var(--navy); }

/* ── HERO ── */
.hero {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: clamp(2rem, 6vw, 5rem) clamp(1rem, 4vw, 2rem) clamp(1.5rem, 4vw, 3rem);
    text-align: center;
}
.hero-deco {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}
.deco-icon {
    position: absolute;
    font-size: clamp(1.2rem, 3vw, 2rem);
    opacity: 0.2;
    animation: floatDeco 8s ease-in-out infinite;
}
.deco-icon:nth-child(1) { top: 10%; left: 3%;  animation-delay: 0s; }
.deco-icon:nth-child(2) { top: 20%; right: 4%; animation-delay: 1.2s; }
.deco-icon:nth-child(3) { top: 55%; left: 2%;  animation-delay: 2.4s; }
.deco-icon:nth-child(4) { top: 60%; right: 3%; animation-delay: 0.8s; }
.deco-icon:nth-child(5) { top: 80%; left: 8%;  animation-delay: 3s; }
.deco-icon:nth-child(6) { top: 75%; right: 8%; animation-delay: 1.8s; }
@keyframes floatDeco {
    0%,100% { transform: translateY(0) rotate(0deg); }
    33%      { transform: translateY(-12px) rotate(5deg); }
    66%      { transform: translateY(6px) rotate(-4deg); }
}

.hero-logo {
    width: 100%;
    max-width: 520px;
    height: auto;
    display: block;
    margin: 0 auto 2rem;
    filter: drop-shadow(0 8px 32px rgba(23,70,140,0.18));
    animation: gentleFloat 5s ease-in-out infinite;
}
@keyframes gentleFloat {
    0%,100% { transform: translateY(0); }
    50%      { transform: translateY(-8px); }
}
.hero-tagline {
    font-size: clamp(0.95rem, 2.5vw, 1.2rem);
    font-weight: 400;
    color: var(--muted);
    line-height: 1.9;
    max-width: 580px;
    margin: 0 auto;
    padding: 0 0.5rem;
}
.hero-tagline em {
    font-style: normal;
    color: var(--navy);
    font-weight: 600;
    background: var(--gold-pale);
    padding: 0 6px;
    border-radius: 4px;
    border-bottom: 2px solid var(--gold);
}

/* ── HERO + โปสเตอร์เลื่อน (index.html) ──
   จอใหญ่: โลโก้/ข้อความซ้าย โปสเตอร์ขวา   จอเล็ก: เรียงลงมา และจำกัดความสูงโปสเตอร์ไม่ให้กินทั้งจอ */
.hero-split { display: grid; gap: clamp(1.5rem, 4vw, 3rem); justify-items: center; align-items: center; }
.hero-split .hero-text { position: relative; width: 100%; }
@media (min-width: 900px) {
    .hero-split { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); }
}
.hero-split.no-posters { grid-template-columns: 1fr; }

.poster-slider {
    position: relative;
    /* โปสเตอร์ 4:5 สูง = กว้าง x 1.25 จึงจำกัดกว้างไม่เกิน 48vh ให้สูงไม่เกินราว 60% ของจอ */
    width: min(100%, 400px, 48vh);
    min-width: 220px;
}
.ps-viewport {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4 / 5;
    border-radius: 18px;
    background: var(--white);
    box-shadow: 0 14px 40px rgba(23,70,140,0.18);
    touch-action: pan-y;
}
.ps-track { display: flex; height: 100%; transition: transform 0.5s ease; }
.ps-slide { flex: 0 0 100%; height: 100%; display: block; }
.ps-slide picture { display: block; height: 100%; }
.ps-slide img { width: 100%; height: 100%; object-fit: cover; display: block; -webkit-user-drag: none; user-select: none; }
.ps-slide:focus-visible { outline: 3px solid var(--gold); outline-offset: -3px; }

.ps-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.85);
    color: var(--navy);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.18);
    opacity: 0.85;
    transition: opacity 0.2s, background 0.2s;
}
.ps-nav:hover, .ps-nav:focus-visible { opacity: 1; background: #fff; }
.ps-prev { left: 8px; }
.ps-next { right: 8px; }

.ps-dots { display: flex; justify-content: center; gap: 8px; margin-top: 0.8rem; }
.ps-dot {
    width: 10px;
    height: 10px;
    padding: 0;
    border: 2px solid var(--brand, var(--navy));
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s;
}
.ps-dot[aria-selected="true"] { background: var(--brand, var(--navy)); width: 26px; border-radius: 6px; }
.ps-hint { margin-top: 0.4rem; text-align: center; font-size: 0.8rem; color: var(--muted); }
.poster-slider.single .ps-nav, .poster-slider.single .ps-dots { display: none; }

@media (prefers-reduced-motion: reduce) {
    .ps-track { transition: none; }
}

/* ── SECTION WRAP ── */
.section-wrap {
    position: relative; z-index: 1;
    max-width: 1200px; margin: 0 auto;
    padding: 0 clamp(1rem,4vw,2rem) clamp(2.5rem,5vw,4rem);
}

/* ── SECTION HEADER — premium ── */
.section-head {
    display: flex; align-items: flex-end; gap: 1.5rem;
    margin-bottom: clamp(1.75rem,3.5vw,2.5rem);
}
.section-head-label {
    display: flex; flex-direction: column; gap: 0.35rem;
    flex-shrink: 0; position: relative;
}
.section-head-label .eyebrow {
    display: inline-flex; align-items: center; gap: 0.5rem;
    font-family: 'Kanit', sans-serif; font-size: 0.6rem; font-weight: 700;
    letter-spacing: 0.24em; text-transform: uppercase;
    color: var(--navy); width: fit-content;
}
.section-head-label .eyebrow::before {
    content: ''; width: 18px; height: 2px;
    background: linear-gradient(to right, var(--navy), var(--gold));
    border-radius: 2px;
}
.section-head-label .title {
    font-family: 'Kanit', sans-serif;
    font-size: clamp(1.35rem,3.5vw,1.85rem);
    font-weight: 800; color: var(--text); white-space: nowrap;
    letter-spacing: -0.025em; line-height: 1;
}
.section-head-label .title em {
    font-style: normal;
    background: linear-gradient(135deg, var(--navy) 0%, var(--gold) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.section-head .divider, .section-head .line {
    flex: 1; height: 1.5px;
    background: linear-gradient(to right, var(--border) 0%, transparent 100%);
    border-radius: 2px;
    margin-bottom: 0.55rem;
}
.section-head h3 {
    font-family:'Kanit',sans-serif; font-size:clamp(1.35rem,3.5vw,1.85rem);
    font-weight:800; color:var(--text); white-space:nowrap; letter-spacing:-0.025em;
}

/* ═══════════════════════════════════════
   PROJECT CARDS — redesigned
═══════════════════════════════════════ */

/* ── section bg ── */
.projects-section-bg {
    position: relative;
    z-index: 1;
}

/* ── group label (Active / Upcoming) ── */
.project-group { margin-bottom: clamp(1.75rem, 3vw, 2.25rem); }
.group-label {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-family: 'Kanit', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    margin-bottom: 1.1rem;
    padding: 0.4rem 1rem 0.4rem 0.75rem;
    border-radius: 100px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.1);
}
.group-label.gl-active {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
    color: white;
    box-shadow: 0 6px 18px rgba(23,70,140,0.3);
}
.group-label.gl-active::before {
    content: '';
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #7dd3fc;
    box-shadow: 0 0 0 3px rgba(125,211,252,0.35);
    animation: blink 1.4s infinite;
    flex-shrink: 0;
}
.group-label.gl-upcoming {
    background: linear-gradient(135deg, var(--gold) 0%, #fb923c 100%);
    color: var(--navy-dark);
    box-shadow: 0 6px 18px rgba(249,188,44,0.32);
}
.group-label.gl-upcoming::before { content: '🔜'; font-size: 0.8rem; line-height: 1; }

/* ── grids ── */
/* Active: 2 wide featured cards */
.grid-active {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
    gap: clamp(1rem, 2.5vw, 1.5rem);
    margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
}
/* Upcoming: tighter 4-col grid */
.grid-upcoming {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
    gap: clamp(0.85rem, 2vw, 1.1rem);
}
/* Archive: same compact grid as upcoming */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
    gap: clamp(0.85rem, 2vw, 1.1rem);
}

/* ── base card ── */
.pcard {
    background: var(--white);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    border: 1.5px solid var(--border-soft);
    overflow: hidden;
    transition: transform 0.32s cubic-bezier(.22,.68,0,1.15),
                box-shadow 0.32s ease,
                border-color 0.32s ease;
    position: relative;
}
.pcard:hover { transform: translateY(-7px); box-shadow: var(--shadow-lg); }

/* active border glow */
.pcard.active-card {
    border-color: rgba(23,70,140,0.22);
    box-shadow: var(--shadow-sm), 0 0 0 1px rgba(23,70,140,0.05);
}
.pcard.active-card:hover {
    border-color: rgba(23,70,140,0.5);
    box-shadow: var(--shadow-glow-navy);
}
.pcard.upcoming-card {
    border-color: rgba(249,188,44,0.32);
    box-shadow: var(--shadow-sm), 0 0 0 1px rgba(249,188,44,0.06);
}
.pcard.upcoming-card:hover {
    border-color: rgba(249,188,44,0.65);
    box-shadow: var(--shadow-glow-gold);
}
.pcard.completed-card { opacity: 0.78; filter: saturate(0.65); }
.pcard.completed-card:hover { opacity: 1; filter: saturate(1); border-color: rgba(23,70,140,0.28); }

/* ── image ── */
.card-img-wrap {
    position: relative;
    width: 100%;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--navy-pale);
}
.active-card .card-img-wrap { aspect-ratio: 16/9; }
.upcoming-card .card-img-wrap { aspect-ratio: 4/3; }
.completed-card .card-img-wrap { aspect-ratio: 4/3; }

.card-img-wrap img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.55s cubic-bezier(.22,.68,0,1.15);
}
.pcard:hover .card-img-wrap img { transform: scale(1.08); }

/* gradient overlay — stronger and includes top vignette */
.card-img-wrap::after {
    content: '';
    position: absolute; inset: 0;
    background:
        linear-gradient(to top, rgba(10,20,50,0.6) 0%, transparent 50%),
        linear-gradient(to bottom, rgba(10,20,50,0.18) 0%, transparent 30%);
    pointer-events: none;
}

/* episode number — bolder */
.card-num {
    position: absolute;
    bottom: 0.7rem; right: 0.85rem;
    font-family: 'Kanit', sans-serif;
    font-weight: 900;
    font-size: clamp(1.8rem, 4vw, 2.4rem);
    line-height: 0.9;
    color: rgba(255,255,255,0.95);
    text-shadow: 0 2px 12px rgba(0,0,0,0.45);
    letter-spacing: -0.04em;
    pointer-events: none;
    user-select: none;
    z-index: 3;
}
.upcoming-card .card-num,
.completed-card .card-num { font-size: clamp(1.4rem, 3.5vw, 1.7rem); }
/* ป้าย "MISSION" เหนือเลขครั้งที่ เลขเปล่า ๆ บนรูปถูกอ่านเป็นวันที่/ที่นั่งเหลือได้ */
.card-num small {
    display: block;
    text-align: right;
    font-size: 0.6rem;            /* ตายตัว ไม่ขยายตามตัวเลข */
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    line-height: 1;
    margin-bottom: 0.2rem;
    margin-right: -0.18em;        /* ชดเชย letter-spacing ตัวท้าย ให้ขอบขวาตรงกับตัวเลข */
}

/* status ribbon */
.card-ribbon {
    position: absolute;
    top: 0.75rem; left: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.32rem 0.78rem;
    border-radius: 100px;
    font-family: 'Kanit', sans-serif;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    backdrop-filter: blur(12px) saturate(140%);
    -webkit-backdrop-filter: blur(12px) saturate(140%);
    box-shadow: 0 4px 14px rgba(0,0,0,0.18);
    z-index: 3;
}
.ribbon-active {
    background: rgba(255,255,255,0.96);
    color: #15803d;
    border: 1.5px solid rgba(34,197,94,0.45);
}
.ribbon-active::before {
    content: '';
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34,197,94,0.25);
    animation: blink 1.4s infinite;
    flex-shrink: 0;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.35} }
.ribbon-upcoming {
    background: rgba(255,255,255,0.96);
    color: #b45309;
    border: 1.5px solid rgba(251,191,36,0.55);
}
.ribbon-upcoming::before { content: '🔜'; font-size: 0.65rem; line-height: 1; }
.ribbon-completed {
    background: rgba(255,255,255,0.9);
    color: #475569;
    border: 1.5px solid rgba(148,163,184,0.4);
}
.ribbon-completed::before { content: '✓'; font-weight: 900; font-size: 0.7rem; }

/* ── date strip ── */
.card-date-strip {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 1rem;
    font-family: 'Kanit', sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    border-bottom: 1.5px solid var(--border-soft);
    flex-shrink: 0;
    letter-spacing: 0.01em;
}
.active-card    .card-date-strip { background: linear-gradient(90deg, var(--navy-pale) 0%, #f5f9ff 100%); color: var(--navy); }
.upcoming-card  .card-date-strip { background: linear-gradient(90deg, var(--gold-pale) 0%, #fffdf5 100%); color: #92400e; }
.completed-card .card-date-strip { background: #f8fafc; color: #64748b; }
.card-date-strip svg { width: 12px; height: 12px; opacity: 0.65; flex-shrink: 0; }

/* ── body ── */
.card-body {
    padding: 1rem 1.05rem 0.7rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.card-title {
    font-family: 'Kanit', sans-serif;
    font-weight: 800;
    color: var(--text);
    line-height: 1.18;
    margin-bottom: 0.75rem;
    letter-spacing: -0.015em;
}
.active-card   .card-title { font-size: clamp(1rem, 2.3vw, 1.18rem); }
.upcoming-card .card-title,
.completed-card .card-title { font-size: clamp(0.88rem, 1.8vw, 0.98rem); }

/* skill tags */
.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.32rem;
    flex: 1;
    align-content: flex-start;
    margin-bottom: 0.85rem;
}
.tag {
    display: inline-flex;
    align-items: center;
    padding: 0.22rem 0.6rem;
    border-radius: 7px;
    font-family: 'Sarabun', sans-serif;
    font-size: 0.72rem;
    font-weight: 500;
    line-height: 1.35;
    transition: all 0.2s;
}
.active-card    .tag { background: var(--navy-pale); color: var(--navy);   border: 1px solid rgba(23,70,140,0.13); }
.upcoming-card  .tag { background: var(--gold-pale);  color: #92400e;       border: 1px solid rgba(249,188,44,0.28); }
.completed-card .tag { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }

/* ── footer ── */
.card-footer { padding: 0 1.05rem 1.05rem; flex-shrink: 0; }
.card-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.85rem 1.2rem;
    border-radius: 12px;
    font-family: 'Kanit', sans-serif;
    font-weight: 700;
    font-size: 0.88rem;
    text-decoration: none;
    transition: all 0.24s ease;
    width: 100%;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.01em;
}
.card-btn svg { width: 14px; height: 14px; transition: transform 0.22s; flex-shrink: 0; }
.card-btn:hover svg { transform: translateX(4px); }

/* button shine sweep on hover */
.card-btn::before {
    content: '';
    position: absolute;
    top: 0; left: -75%;
    width: 50%; height: 100%;
    background: linear-gradient(120deg, transparent 0%, rgba(255,255,255,0.35) 50%, transparent 100%);
    transition: left 0.55s ease;
}
.card-btn:hover::before { left: 130%; }

.btn-blue {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
    color: white;
    box-shadow: 0 3px 12px rgba(23,70,140,0.22);
}
.btn-blue:hover { box-shadow: 0 8px 24px rgba(23,70,140,0.4); transform: translateY(-2px); }
.btn-gold {
    background: linear-gradient(135deg, #f5a623 0%, var(--gold) 100%);
    color: var(--navy-dark);
    box-shadow: 0 3px 12px rgba(249,188,44,0.28);
}
.btn-gold:hover { box-shadow: 0 8px 24px rgba(249,188,44,0.45); transform: translateY(-2px); }
.btn-gray { background: #f1f5f9; color: #475569; border: 1.5px solid #e2e8f0; }
.btn-gray:hover { background: var(--navy-pale); color: var(--navy); border-color: rgba(23,70,140,0.3); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(23,70,140,0.15); }

.card-badge { display: none; }

/* ── TIMELINE ── */
.timeline-outer {
    position: relative;
    z-index: 1;
    background: var(--white);
    border-top: 2px solid var(--border);
    border-bottom: 2px solid var(--border);
    padding: clamp(2rem, 5vw, 3.5rem) 0;
    margin-bottom: clamp(1.5rem, 4vw, 3rem);
}
.timeline-inner { max-width: 1200px; margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2rem); }

.tl-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.75rem;
    position: relative;
    margin-bottom: clamp(2rem, 4vw, 3rem);
}
.tl-row:last-child { margin-bottom: 0; }

/* connector line at dot-centre of normal items (dot = 44px, centre = 22px) */
.tl-row::before {
    content: '';
    position: absolute;
    top: 22px;
    left: 5%; right: 5%;
    height: 2px;
    background: repeating-linear-gradient(
        90deg,
        var(--border) 0px, var(--border) 8px,
        transparent 8px, transparent 16px
    );
    z-index: 0;
}

.tl-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    z-index: 1;
}
/* down items hang below the line */
.tl-item.down { margin-top: 2.5rem; }

.tl-dot {
    width: 44px; height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Kanit', sans-serif;
    font-weight: 700;
    font-size: 0.88rem;
    margin-bottom: 0.55rem;
    flex-shrink: 0;
    border: 3px solid var(--white);
    box-shadow: 0 3px 12px rgba(0,0,0,0.12);
    transition: transform 0.22s, box-shadow 0.22s;
    position: relative;
}
.tl-dot:hover { transform: scale(1.15); }

/* ── Status colours ── */
.tl-item.s-done .tl-dot {
    background: #e2e8f0;
    color: #94a3b8;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}
.tl-item.s-done .tl-name  { color: var(--muted); opacity: 0.8; }
.tl-item.s-done .tl-date  { opacity: 0.6; }

/* Active — navy gradient, matches active-card top bar */
.tl-item.s-active .tl-dot {
    background: linear-gradient(135deg, var(--navy) 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 4px 16px rgba(23,70,140,0.35);
    border-color: var(--white);
}
.tl-item.s-active .tl-dot::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid rgba(23,70,140,0.28);
    animation: ringPulse 1.8s ease-out infinite;
}
@keyframes ringPulse {
    0%   { transform: scale(1);   opacity: 1; }
    100% { transform: scale(1.55); opacity: 0; }
}
.tl-item.s-active .tl-name { color: var(--navy); font-weight: 700; }

/* Upcoming — gold gradient, matches upcoming-card top bar */
.tl-item.s-upcoming .tl-dot {
    background: linear-gradient(135deg, var(--gold) 0%, #fb923c 100%);
    color: var(--navy-dark);
    box-shadow: 0 4px 16px rgba(249,188,44,0.38);
    border-color: var(--white);
}
.tl-item.s-upcoming .tl-name { color: var(--gold-dark); font-weight: 700; }

.tl-name {
    font-family: 'Kanit', sans-serif;
    font-weight: 600;
    font-size: clamp(0.6rem, 1.4vw, 0.68rem);
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--text);
    line-height: 1.35;
    margin-bottom: 0.2rem;
}
.tl-date { font-size: clamp(0.55rem, 1.2vw, 0.62rem); color: var(--muted); letter-spacing: 0.05em; }

/* ── FOOTER ── */
footer { position: relative; z-index: 1; background: var(--navy); margin-top: clamp(2rem, 5vw, 4rem); }
.footer-inner {
    max-width: 1200px; margin: 0 auto;
    padding: clamp(2rem, 5vw, 3.5rem) clamp(1rem, 4vw, 2rem);
    display: grid; grid-template-columns: repeat(3,1fr); gap: clamp(1.5rem, 4vw, 3rem);
}
.footer-col h5 {
    font-family: 'Kanit', sans-serif; font-size: 0.65rem; font-weight: 700;
    letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); margin-bottom: 1.1rem;
}
.footer-col p, .footer-col address {
    font-size: 0.84rem; color: rgba(255,255,255,0.55); line-height: 1.85; font-style: normal;
}
.footer-col p strong { color: rgba(255,255,255,0.85); font-weight: 500; }
.footer-col nav { display: flex; flex-direction: column; gap: 0.4rem; }
.footer-col nav a {
    font-size: 0.84rem; color: rgba(255,255,255,0.55); text-decoration: none;
    transition: color 0.2s; display: flex; align-items: center; gap: 0.5rem;
}
.footer-col nav a:hover { color: var(--gold); }
.footer-col nav a::before { content: '›'; color: var(--gold); font-size: 1rem; }
.fb-link {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.85rem 1rem; background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1); border-radius: 12px;
    text-decoration: none; transition: all 0.2s;
}
.fb-link:hover { background: rgba(255,255,255,0.09); border-color: rgba(255,255,255,0.2); }
.fb-icon { width: 36px; height: 36px; background: #1877f2; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.fb-icon svg { width: 20px; height: 20px; fill: white; }
.fb-text small { display: block; font-size: 0.68rem; color: rgba(255,255,255,0.4); margin-bottom: 0.1rem; }
.fb-text span { font-size: 0.84rem; color: rgba(255,255,255,0.8); font-weight: 500; font-family: 'Kanit', sans-serif; }
.footer-bottom {
    max-width: 1200px; margin: 0 auto; padding: 1.25rem 2rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    text-align: center; font-size: 0.7rem; color: rgba(255,255,255,0.25); letter-spacing: 0.04em;
}

/* ── ANIMATIONS ── */
.fade-up { opacity: 0; transform: translateY(20px); animation: fadeUp 0.6s ease forwards; }
@keyframes fadeUp { to { opacity:1; transform:translateY(0); } }
.d1 { animation-delay: 0.1s; }
.d2 { animation-delay: 0.2s; }
.d3 { animation-delay: 0.3s; }

.tl-head { margin-bottom: 2.5rem; }

/* Tablet landscape: 1024px — no overrides needed */

/* Tablet portrait: 768px */
@media (max-width: 768px) {
    .footer-inner { grid-template-columns: 1fr 1fr; }
    .card-num { font-size: 3rem; }
}

/* เมนูแฮมเบอร์เกอร์: โลโก้ + เมนู 5 รายการวางแถวเดียวไม่พอเมื่อจอแคบกว่านี้ */
@media (max-width: 1100px) {
    nav.desktop-nav { display: none; }
    .menu-btn { display: block; }
    .mobile-menu { padding: 0.75rem clamp(1rem, 4vw, 1.5rem) 1.25rem; }
}

/* Mobile: 600px */
@media (max-width: 600px) {
    .hero-tagline br { display: none; }

    .tl-row {
        grid-template-columns: 1fr !important;
        max-width: 100% !important;
        gap: 1.5rem;
        margin-bottom: 1.5rem;
        padding-left: 0.5rem;
    }
    .tl-row::before { 
        display: block;
        left: calc(0.5rem + 21px);
        right: auto;
        top: 22px;
        bottom: calc(-1.5rem - 22px);
        width: 2px;
        height: auto;
        background: repeating-linear-gradient(
            180deg,
            var(--border) 0px, var(--border) 8px,
            transparent 8px, transparent 16px
        );
    }
    .tl-row:last-child::before {
        bottom: 22px;
    }
    .tl-item {
        display: grid;
        grid-template-columns: 44px 1fr;
        grid-template-rows: auto auto;
        column-gap: 1.25rem;
        row-gap: 0;
        text-align: left;
        align-items: center;
    }
    .tl-item.down { margin-top: 0; }
    .tl-dot { grid-column: 1; grid-row: 1 / span 2; margin-bottom: 0; }
    .tl-name { grid-column: 2; grid-row: 1; align-self: end; margin-bottom: 0; padding-top: 0.15rem; font-size: 0.75rem; }
    .tl-date { grid-column: 2; grid-row: 2; align-self: start; padding-bottom: 0.15rem; font-size: 0.68rem; }

    .footer-inner { grid-template-columns: 1fr; }
    .footer-bottom { padding: 1rem clamp(1rem, 4vw, 2rem); font-size: 0.68rem; }
}

/* Small mobile: 400px */
@media (max-width: 400px) {
    .card-num { display: none; }
    .projects-grid { grid-template-columns: 1fr; }
    .deco-icon { display: none; }
    .card-btn { font-size: 0.82rem; padding: 0.8rem 1rem; }
}

/* ═══════════════════════════════════════
   PROGRAM FAMILY (ใช้ร่วมกันทุกหน้า)
   Science Odyssey / Explorer+ / Openlab
═══════════════════════════════════════ */
[hidden] { display: none !important; }

[data-brand="odyssey"]  { --brand: #17468c; --brand-2: #2563eb; --brand-pale: #e8f0fb; --brand-ink: #17468c; --brand-glow: rgba(23,70,140,0.28); }
[data-brand="explorer"] { --brand: #0f8a7e; --brand-2: #22c3a6; --brand-pale: #e2f6f2; --brand-ink: #0b6158; --brand-glow: rgba(15,138,126,0.28); }
[data-brand="openlab"]  { --brand: #6d3fd1; --brand-2: #a77bf3; --brand-pale: #f0eafd; --brand-ink: #4c2a99; --brand-glow: rgba(109,63,209,0.28); }

.prog-loc {
    display: inline-block;
    font-family: 'Kanit', sans-serif; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.04em;
    background: rgba(255,255,255,0.18); border: 1px solid rgba(255,255,255,0.3);
    padding: 0.22rem 0.7rem; border-radius: 100px; color: white;
}
.prog-new {
    display: inline-block; vertical-align: middle;
    font-family: 'Kanit', sans-serif; font-size: 0.55rem; font-weight: 700; letter-spacing: 0.14em;
    background: var(--gold); color: var(--navy-dark);
    padding: 0.2rem 0.55rem; border-radius: 100px; transform: translateY(-4px);
}
sup.plus { font-size: 0.6em; color: var(--gold); }

/* ── ปุ่มเลือกโครงการใต้ hero ── */
.jump-grid {
    position: relative; z-index: 1;
    max-width: 1200px; margin: 0 auto;
    padding: 0 clamp(1rem,4vw,2rem) clamp(2rem,5vw,3.5rem);
    display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
    gap: clamp(0.75rem, 2vw, 1.1rem);
}
.jump-card {
    display: flex; align-items: center; gap: 1rem;
    padding: 1rem 1.2rem;
    background: var(--white);
    border: 1.5px solid var(--border-soft); border-left: 6px solid var(--brand);
    border-radius: 16px; box-shadow: var(--shadow-sm);
    text-decoration: none; color: var(--text);
    transition: transform 0.25s, box-shadow 0.25s;
}
.jump-card:hover { transform: translateY(-3px); box-shadow: 0 10px 28px var(--brand-glow); }
.jump-num {
    flex-shrink: 0; width: 52px; height: 52px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Kanit', sans-serif; font-weight: 800; font-size: 1.5rem;
    color: white; background: linear-gradient(135deg, var(--brand), var(--brand-2));
}
.jump-text { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.jump-name { font-family: 'Kanit', sans-serif; font-weight: 700; font-size: 1.02rem; color: var(--brand-ink); }
.jump-meta { font-size: 0.78rem; color: var(--muted); }
.jump-arrow { margin-left: auto; color: var(--brand); font-size: 1.2rem; }

/* ── แผงโครงการบนหน้าแรก ── */
.band {
    position: relative; z-index: 1;
    max-width: 1200px; margin: 0 auto clamp(2rem, 5vw, 3rem);
    padding: 0 clamp(1rem,4vw,2rem);
    scroll-margin-top: 140px;
}
.band-panel {
    background: var(--white); border-radius: 24px; overflow: hidden;
    border: 1.5px solid var(--border-soft);
    box-shadow: var(--shadow);
}
.band-head {
    position: relative; overflow: hidden;
    display: grid; grid-template-columns: 1fr auto; gap: 1.5rem; align-items: end;
    padding: clamp(1.3rem, 3vw, 1.9rem) clamp(1.2rem, 3vw, 2rem);
    color: white;
    background:
        radial-gradient(circle at 100% 0%, rgba(255,255,255,0.22) 0%, transparent 45%),
        linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
}
.band-head::after, .phero::after {
    content: ''; position: absolute; right: -40px; bottom: -60px;
    width: 220px; height: 220px; border-radius: 50%;
    border: 26px solid rgba(255,255,255,0.1); pointer-events: none;
}
.band-name {
    font-family: 'Kanit', sans-serif; font-weight: 800;
    font-size: clamp(1.6rem, 4vw, 2.2rem); line-height: 1.1; letter-spacing: -0.02em;
    margin-top: 0.6rem;
}
.band-th { font-size: 0.92rem; opacity: 0.9; margin-top: 0.2rem; }
.band-facts { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.9rem; }
.band-fact {
    font-size: 0.78rem; font-weight: 500;
    background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.28);
    padding: 0.28rem 0.75rem; border-radius: 100px;
}
.band-actions { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 0.55rem; }
.band-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
    font-family: 'Kanit', sans-serif; font-weight: 700; font-size: 0.88rem;
    padding: 0.75rem 1.3rem; border-radius: 12px; text-decoration: none;
    background: white; color: var(--brand-ink);
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
    transition: transform 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}
.band-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(0,0,0,0.18); }
.band-btn.ghost { background: transparent; color: white; border: 1.5px solid rgba(255,255,255,0.55); box-shadow: none; }
.band-btn.ghost:hover { background: rgba(255,255,255,0.12); }
.band-btn:focus-visible, .jump-card:focus-visible, .other-tile:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.band-body {
    padding: clamp(1.1rem, 3vw, 1.6rem) clamp(1.2rem, 3vw, 2rem) clamp(1.3rem, 3vw, 2rem);
    background: linear-gradient(180deg, var(--brand-pale) 0%, var(--white) 160px);
}
.band-sub {
    display: flex; align-items: center; gap: 0.5rem;
    font-family: 'Kanit', sans-serif; font-size: 0.7rem; font-weight: 700;
    letter-spacing: 0.16em; text-transform: uppercase; color: var(--brand-ink);
    margin-bottom: 1rem;
}
.band-sub::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); animation: blink 1.4s infinite; }
.band-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
    gap: clamp(0.85rem, 2vw, 1.1rem);
}
.band-empty {
    text-align: center; color: var(--muted); font-size: 0.9rem;
    border: 1.5px dashed var(--border); border-radius: 16px; padding: 1.5rem; background: var(--white);
}
.band-empty a { color: var(--brand-ink); font-weight: 600; }

/* ── การ์ดภารกิจที่ใช้สีประจำโครงการ ── */
.pcard.brand-card { border-color: color-mix(in srgb, var(--brand) 22%, transparent); }
.pcard.brand-card:hover { border-color: color-mix(in srgb, var(--brand) 55%, transparent); box-shadow: 0 12px 40px var(--brand-glow); }
.brand-card .card-img-wrap { aspect-ratio: 4/3; }
.brand-card .card-date-strip { background: linear-gradient(90deg, var(--brand-pale) 0%, #fbfdff 100%); color: var(--brand-ink); }
.brand-card .card-title { font-size: clamp(0.92rem, 1.8vw, 1.02rem); }
.brand-card .card-num { font-size: clamp(1.4rem, 3.5vw, 1.7rem); }
.brand-card .tag { background: var(--brand-pale); color: var(--brand-ink); border: 1px solid color-mix(in srgb, var(--brand) 16%, transparent); }
.ribbon-brand { background: rgba(255,255,255,0.96); color: var(--brand-ink); border: 1.5px solid color-mix(in srgb, var(--brand) 40%, transparent); }
.ribbon-brand::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); animation: blink 1.4s infinite; flex-shrink: 0; }
.btn-brand { background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%); color: white; box-shadow: 0 3px 12px var(--brand-glow); }
.btn-brand:hover { box-shadow: 0 8px 24px var(--brand-glow); transform: translateY(-2px); }

/* ── หน้าโครงการ: hero ── */
.phero {
    position: relative; z-index: 1; overflow: hidden; color: white;
    background:
        radial-gradient(circle at 90% 10%, rgba(255,255,255,0.22) 0%, transparent 40%),
        linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
    padding: clamp(1.75rem, 5vw, 3.5rem) 0 clamp(2rem, 5vw, 3.75rem);
    margin-bottom: clamp(2rem, 5vw, 3.5rem);
}
.phero-inner {
    position: relative; z-index: 1;
    max-width: 1200px; margin: 0 auto; padding: 0 clamp(1rem,4vw,2rem);
    display: grid; grid-template-columns: 1.25fr 1fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: center;
}
.crumb { font-size: 0.82rem; opacity: 0.9; margin-bottom: 1rem; }
.crumb a { color: white; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,0.4); }
.crumb a:hover { border-bottom-color: white; }
.phero h1 {
    font-family: 'Kanit', sans-serif; font-weight: 800;
    font-size: clamp(2.1rem, 6vw, 3.3rem); line-height: 1.05; letter-spacing: -0.025em;
    margin: 0.7rem 0 0.35rem;
}
.phero-th { font-size: clamp(1rem, 2.4vw, 1.15rem); font-weight: 500; opacity: 0.95; }
.phero-desc { font-size: 0.95rem; line-height: 1.8; opacity: 0.88; margin: 0.9rem 0 1.4rem; max-width: 560px; }
.phero-cta { display: flex; flex-wrap: wrap; gap: 0.65rem; }
.phero-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.pfact {
    background: rgba(255,255,255,0.13); border: 1px solid rgba(255,255,255,0.26);
    border-radius: 16px; padding: 1rem 1.1rem;
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.pfact small { display: block; font-size: 0.72rem; opacity: 0.8; margin-bottom: 0.25rem; letter-spacing: 0.04em; }
.pfact b { font-family: 'Kanit', sans-serif; font-weight: 700; font-size: clamp(0.95rem, 2vw, 1.1rem); line-height: 1.3; }

/* ── หน้าโครงการ: ลิงก์ไปโครงการอื่น ── */
.other-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 1rem; }
.other-tile {
    position: relative; overflow: hidden;
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: 1.3rem 1.5rem; border-radius: 18px; text-decoration: none; color: white;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
    box-shadow: 0 8px 24px var(--brand-glow);
    transition: transform 0.25s;
}
.other-tile:hover { transform: translateY(-3px); }
.other-tile b { font-family: 'Kanit', sans-serif; font-size: 1.25rem; font-weight: 800; display: block; }
.other-tile span { font-size: 0.82rem; opacity: 0.9; }
.other-tile i { font-style: normal; font-size: 1.4rem; }

/* ── timeline ของแต่ละโครงการ ── */
.tl-row::before { right: var(--tl-right, 5%); }
[data-brand] .tl-dot { font-size: 0.8rem; }
[data-brand] .tl-item.s-upcoming .tl-dot { background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%); color: white; box-shadow: 0 4px 16px var(--brand-glow); }
[data-brand] .tl-item.s-upcoming .tl-name { color: var(--brand-ink); }

.empty-note {
    text-align: center; color: var(--muted); font-size: 0.9rem;
    background: var(--white); border: 1.5px dashed var(--border); border-radius: 16px; padding: 1.5rem;
}

@media (max-width: 800px) {
    .phero-inner { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
    .band-head { grid-template-columns: minmax(0, 1fr); align-items: start; }
    .band-actions { flex-direction: row; flex-wrap: wrap; }
    .band-btn { flex: 1 1 auto; white-space: normal; text-align: center; }
}
@media (max-width: 600px) {
    .tl-row::before { right: auto; }
}
@media (max-width: 400px) {
    .phero-facts { grid-template-columns: 1fr; }
}
