/* =========================================================================
   PMIT — Design System
   Palette sampled directly from the PMIT logo (red #E20F27 / slate #2A363E).
   Signature motif: "circuit trace" dividers + diamond node bullets — a
   nod to the Institute's VLSI / embedded / semiconductor identity rather
   than a decorative default.
   ========================================================================= */

:root {
    /* ---- Color tokens ------------------------------------------------ */
    --pmit-crimson: #E20F27;
    --pmit-crimson-deep: #A80E1E;
    --pmit-crimson-mist: #FCE7E9;
    --pmit-slate: #2A363E;
    --pmit-slate-deep: #161E24;
    --pmit-ink: #1B2126;
    --pmit-paper: #F7F7F8;
    --pmit-mist: #EEF0F2;
    --pmit-line: #E2E4E7;
    --pmit-white: #FFFFFF;
    --pmit-muted: #5B6670;

    /* ---- Type ---------------------------------------------------------- */
    --font-display: 'Space Grotesk', 'Segoe UI', sans-serif;
    --font-body: 'Inter', 'Segoe UI', sans-serif;
    --font-mono: 'IBM Plex Mono', 'Courier New', monospace;

    /* ---- Layout --------------------------------------------------------- */
    --container-max: 1240px;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
    --nav-height: 84px;
    --shadow-sm: 0 1px 2px rgba(22, 30, 36, 0.06), 0 1px 1px rgba(22, 30, 36, 0.04);
    --shadow-md: 0 8px 24px rgba(22, 30, 36, 0.10);
    --shadow-lg: 0 20px 48px rgba(22, 30, 36, 0.16);
}

/* ---- Reset ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--pmit-ink);
    background: var(--pmit-white);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3, h4, h5 { font-family: var(--font-display); font-weight: 700; line-height: 1.15; margin: 0 0 0.5em; color: var(--pmit-slate-deep); }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--pmit-crimson); outline-offset: 2px; }

.container { max-width: var(--container-max); margin: 0 auto; padding: 0 24px; }
.section { padding: 88px 0; }
.section--tight { padding: 56px 0; }
.section--slate { background: var(--pmit-slate-deep); color: #C7CEDB; }
.section--slate h2, .section--slate h3 { color: var(--pmit-white); }
.section--paper { background: var(--pmit-paper); }
.text-center { text-align: center; }

/* ---- Type scale --------------------------------------------------- */
.eyebrow {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--pmit-crimson);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}
.eyebrow::before { content: ''; width: 8px; height: 8px; background: var(--pmit-crimson); transform: rotate(45deg); flex: none; }
.section--slate .eyebrow { color: #FF6B7A; }

h1.display, .h1 { font-size: clamp(2.4rem, 4.5vw, 3.6rem); letter-spacing: -0.01em; }
h2.display, .h2 { font-size: clamp(1.9rem, 3vw, 2.6rem); letter-spacing: -0.01em; }
h3.display, .h3 { font-size: 1.4rem; }
.lede { font-size: 1.15rem; color: var(--pmit-muted); max-width: 62ch; }
.section--slate .lede { color: #A7B0BC; }

/* ---- Circuit-trace divider (signature element) ---------------------- */
.trace {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    margin: 40px 0;
}
.trace::before, .trace::after {
    content: '';
    flex: 1;
    height: 1px;
    background: repeating-linear-gradient(90deg, var(--pmit-line) 0 6px, transparent 6px 12px);
}
.trace__node { width: 7px; height: 7px; background: var(--pmit-crimson); transform: rotate(45deg); flex: none; }
.trace--dark::before, .trace--dark::after { background: repeating-linear-gradient(90deg, #3A4750 0 6px, transparent 6px 12px); }

/* ---- Buttons -------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 14px 26px;
    border-radius: var(--radius-sm);
    border: 1.5px solid transparent;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, color 0.15s ease, border-color .15s ease;
    white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--pmit-crimson); color: var(--pmit-white); }
.btn--primary:hover { background: var(--pmit-crimson-deep); box-shadow: var(--shadow-md); }
.btn--outline { background: transparent; border-color: currentColor; color: var(--pmit-slate); }
.btn--outline:hover { background: var(--pmit-slate); color: var(--pmit-white); border-color: var(--pmit-slate); }
.btn--on-dark { border-color: rgba(255,255,255,0.4); color: var(--pmit-white); }
.btn--on-dark:hover { background: var(--pmit-white); color: var(--pmit-slate-deep); }
.btn--ghost { background: transparent; color: var(--pmit-crimson); padding-left: 4px; padding-right: 4px; }
.btn--ghost::after { content: '→'; transition: transform 0.15s ease; }
.btn--ghost:hover::after { transform: translateX(4px); }
.btn--block { width: 100%; justify-content: center; }
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; }

/* ---- Diamond bullet lists (echoes circuit nodes) ---------------------- */
.node-list li { position: relative; padding-left: 26px; margin-bottom: 12px; }
.node-list li::before {
    content: '';
    position: absolute; left: 0; top: 7px;
    width: 9px; height: 9px;
    background: var(--pmit-crimson);
    transform: rotate(45deg);
}
.section--slate .node-list li::before { background: #FF6B7A; }

/* ---- Cards ------------------------------------------------------------ */
.card {
    background: var(--pmit-white);
    border: 1px solid var(--pmit-line);
    border-radius: var(--radius-md);
    padding: 28px;
    transition: box-shadow 0.2s ease, transform 0.2s ease, border-color .2s ease;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); border-color: transparent; }
.card__icon {
    width: 48px; height: 48px;
    display: flex; align-items: center; justify-content: center;
    background: var(--pmit-crimson-mist); color: var(--pmit-crimson);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono); font-weight: 600; font-size: 13px;
    margin-bottom: 18px;
}
.card__eyebrow { font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--pmit-muted); }

.grid { display: grid; gap: 24px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--6 { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 980px) {
    .grid--3, .grid--4, .grid--6 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
    .grid--2, .grid--3, .grid--4, .grid--6 { grid-template-columns: 1fr; }
}

/* ---- Stat strip --------------------------------------------------------- */
.stat-strip { display: flex; flex-wrap: wrap; gap: 32px; }
.stat-strip__item { flex: 1 1 140px; }
.stat-strip__num { font-family: var(--font-display); font-size: 2.2rem; font-weight: 700; color: var(--pmit-white); }
.stat-strip__label { font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #A7B0BC; }

/* =========================================================================
   NAVBAR
   ========================================================================= */
.site-header {
    position: sticky; top: 0; z-index: 1000;
    background: rgba(22, 30, 36, 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.nav {
    max-width: var(--container-max); margin: 0 auto; padding: 0 24px;
    height: var(--nav-height);
    display: flex; align-items: center; justify-content: space-between;
}
.nav__logo { display: flex; align-items: center; gap: 10px; flex: none; }
.nav__logo img { height: 34px; width: auto; }
.nav__menu { display: flex; align-items: center; gap: 4px; }
.nav__item { position: relative; }
.nav__link {
    display: flex; align-items: center; gap: 6px;
    padding: 12px 14px;
    font-family: var(--font-mono); font-size: 12.5px; font-weight: 500;
    letter-spacing: 0.04em; text-transform: uppercase;
    color: #D6DCE3;
    border-radius: var(--radius-sm);
    transition: color .15s ease, background .15s ease;
}
.nav__link:hover, .nav__item.is-open > .nav__link { color: var(--pmit-white); background: rgba(255,255,255,0.06); }
.nav__caret { width: 8px; height: 8px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); margin-top: -3px; opacity: .7; }

.mega {
    position: absolute; top: calc(100% + 10px); left: 0;
    min-width: 320px;
    background: var(--pmit-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 10px;
    opacity: 0; visibility: hidden; transform: translateY(8px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}
.nav__item.is-open .mega { opacity: 1; visibility: visible; transform: translateY(0); }
.mega__link {
    display: flex; flex-direction: column; gap: 2px;
    padding: 12px 14px; border-radius: var(--radius-sm);
    color: var(--pmit-slate-deep);
}
.mega__link:hover { background: var(--pmit-paper); }
.mega__link strong { font-family: var(--font-display); font-size: 14.5px; font-weight: 600; }
.mega__link span { font-size: 12.5px; color: var(--pmit-muted); }

.nav__cta { display: flex; align-items: center; gap: 10px; flex: none; }
.nav__toggle { display: none; flex: none; background: none; border: none; padding: 8px; }
.nav__toggle span, .nav__toggle::before, .nav__toggle::after { content: ''; display: block; width: 22px; height: 2px; background: var(--pmit-white); margin: 5px 0; transition: transform .2s ease, opacity .2s ease; }

@media (max-width: 1080px) {
    .nav__menu { position: fixed; inset: var(--nav-height) 0 0 0; background: var(--pmit-slate-deep); flex-direction: column; align-items: stretch; padding: 16px; overflow-y: auto; transform: translateX(100%); transition: transform .25s ease; gap: 0; }
    .nav__menu.is-active { transform: translateX(0); }
    .nav__item { width: 100%; }
    .nav__link { width: 100%; justify-content: space-between; padding: 16px 10px; border-bottom: 1px solid rgba(255,255,255,0.06); }
    .mega { position: static; box-shadow: none; opacity: 1; visibility: visible; transform: none; display: none; background: rgba(255,255,255,0.03); }
    .nav__item.is-open .mega { display: flex; flex-direction: column; }
    .mega__link strong { color: var(--pmit-white); }
    .mega__link span { color: #A7B0BC; }
    .nav__toggle { display: block; }
    .nav__cta .btn--primary { display: none; }
}

/* =========================================================================
   HERO
   ========================================================================= */
.hero { position: relative; min-height: 86vh; display: flex; align-items: flex-end; overflow: hidden; background: var(--pmit-slate-deep); }
.hero__media { position: absolute; inset: 0; z-index: 0; }
.hero__media img, .hero__media video { width: 100%; height: 100%; object-fit: cover; }
.hero__scrim { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(22,30,36,0.55) 0%, rgba(22,30,36,0.45) 40%, rgba(15,20,24,0.94) 100%); }
.hero__content { position: relative; z-index: 1; padding: 64px 0 72px; color: var(--pmit-white); width: 100%; }
.hero__tagline { font-family: var(--font-mono); font-size: 13px; letter-spacing: .18em; text-transform: uppercase; color: #FF8A94; margin-bottom: 18px; }
.hero h1 { color: var(--pmit-white); font-size: clamp(2.4rem, 5.5vw, 4.2rem); max-width: 16ch; }
.hero__desc { max-width: 62ch; color: #D6DCE3; font-size: 1.1rem; margin-top: 18px; }
.hero__slides { position: absolute; inset: 0; }
.hero__slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1.2s ease; }
.hero__slide.is-active { opacity: 1; }
.hero__dots { position: absolute; right: 24px; bottom: 24px; z-index: 2; display: flex; gap: 8px; }
.hero__dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.4); border: none; padding: 0; cursor: pointer; }
.hero__dot.is-active { background: var(--pmit-crimson); width: 22px; border-radius: 4px; transition: width .2s ease; }

/* =========================================================================
   FOOTER
   ========================================================================= */
.site-footer { background: var(--pmit-slate-deep); color: #A7B0BC; padding: 72px 0 0; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr 1.2fr; gap: 40px; padding-bottom: 56px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.footer-grid h4 { color: var(--pmit-white); font-size: 13px; font-family: var(--font-mono); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 18px; }
.footer-grid ul li { margin-bottom: 10px; }
.footer-grid a:hover { color: var(--pmit-white); }
.footer-brand img { height: 30px; margin-bottom: 16px; }
.footer-brand p { color: #A7B0BC; max-width: 34ch; font-size: 14px; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; padding: 24px 0; font-size: 13px; }
.footer-bottom a { color: #A7B0BC; }
.footer-bottom a:hover { color: var(--pmit-white); }
.footer-legal { display: flex; gap: 18px; flex-wrap: wrap; }
@media (max-width: 980px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }

/* =========================================================================
   FORMS
   ========================================================================= */
.form-field { margin-bottom: 20px; }
.form-field label { display: block; font-family: var(--font-mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--pmit-slate); margin-bottom: 8px; }
.form-field input, .form-field select, .form-field textarea {
    width: 100%; padding: 13px 14px; border: 1.5px solid var(--pmit-line); border-radius: var(--radius-sm);
    font-family: var(--font-body); font-size: 15px; color: var(--pmit-ink); background: var(--pmit-white);
    transition: border-color .15s ease;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { border-color: var(--pmit-crimson); outline: none; }
.form-field textarea { resize: vertical; min-height: 120px; }
.form-hint { font-size: 12.5px; color: var(--pmit-muted); margin-top: 6px; }
.form-error { font-size: 12.5px; color: var(--pmit-crimson); margin-top: 6px; }

.alert { padding: 14px 18px; border-radius: var(--radius-sm); margin-bottom: 20px; font-size: 14.5px; }
.alert--success { background: #E8F6EC; color: #1E6B37; border: 1px solid #BFE6C9; }
.alert--error { background: var(--pmit-crimson-mist); color: var(--pmit-crimson-deep); border: 1px solid #F3C0C6; }

/* ---- Breadcrumb / page header (interior pages) --------------------------- */
.page-hero { background: var(--pmit-slate-deep); color: var(--pmit-white); padding: 64px 0 56px; position: relative; overflow: hidden; }
.page-hero__bg { position: absolute; inset: 0; z-index: 0; }
.page-hero__bg img { width: 100%; height: 100%; object-fit: cover; opacity: 0.28; }
.page-hero__inner { position: relative; z-index: 1; }
.breadcrumb { font-family: var(--font-mono); font-size: 12px; color: #A7B0BC; margin-bottom: 20px; }
.breadcrumb a:hover { color: var(--pmit-white); }

/* ---- Utility spacing ---------------------------------------------------- */
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; }
.gap-12 { gap: 12px; } .gap-20 { gap: 20px; }

/* ---- Table (used in dashboards + timetables) --------------------------- */
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th, .table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--pmit-line); }
.table th { font-family: var(--font-mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--pmit-muted); }
.badge { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 100px; font-size: 11.5px; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .04em; }
.badge--success { background: #E8F6EC; color: #1E6B37; }
.badge--warning { background: #FFF3E0; color: #A65C00; }
.badge--danger { background: var(--pmit-crimson-mist); color: var(--pmit-crimson-deep); }
.badge--info { background: #E7F1FC; color: #1C5EA8; }

/* ---- Scroll reveal ---------------------------------------------------- */
[data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
[data-reveal].is-visible { opacity: 1; transform: translateY(0); }
