:root {
  --mit-orange: #f26a10;
  --mit-orange-dark: #d85a08;
  --mit-charcoal: #333638;
  --mit-dark: #1f2123;
  --mit-light: #f6f6f6;
}

html { scroll-behavior: smooth; }
body { font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; color: #2b2d2f; }
a { color: var(--mit-orange-dark); }
a:hover { color: var(--mit-orange); }

/* Buttons */
.btn-mit { background: var(--mit-orange); border-color: var(--mit-orange); color: #fff; font-weight: 600; }
.btn-mit:hover, .btn-mit:focus { background: var(--mit-orange-dark); border-color: var(--mit-orange-dark); color: #fff; }
.btn-outline-mit { border: 2px solid var(--mit-orange); color: var(--mit-orange); font-weight: 600; }
.btn-outline-mit:hover { background: var(--mit-orange); color: #fff; }

/* Top bar */
.topbar { background: var(--mit-charcoal); color: #e9e9e9; font-size: .9rem; border-top: 6px solid var(--mit-orange); }
.topbar a { color: #e9e9e9; text-decoration: none; }
.topbar a:hover { color: var(--mit-orange); }
.topbar i { color: var(--mit-orange); margin-right: .35rem; }

/* Navbar */
.navbar { box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.navbar-brand img { height: 56px; width: auto; }
.navbar .nav-link { font-weight: 600; text-transform: uppercase; font-size: .88rem; letter-spacing: .04em; color: var(--mit-dark); }
.navbar .nav-link:hover, .navbar .nav-link.active { color: var(--mit-orange); }

/* Hero carousel */
.hero .carousel-item { height: 560px; background: var(--mit-dark); }
.hero .carousel-item > video, .hero .carousel-item > img { width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.hero .carousel-caption { top: 50%; bottom: auto; transform: translateY(-50%); text-align: left; left: 8%; right: 8%; }
.hero h1, .hero h2 { font-weight: 800; text-shadow: 0 2px 12px rgba(0,0,0,.6); }
.hero .lead { text-shadow: 0 1px 8px rgba(0,0,0,.7); max-width: 640px; }
.hero .accent { color: var(--mit-orange); }

/* Page banner (inner pages) */
.page-banner { background: linear-gradient(120deg, var(--mit-charcoal) 55%, var(--mit-orange) 55.1%); color: #fff; padding: 3.2rem 0; }
.page-banner h1 { font-weight: 800; margin: 0; }
.page-banner .breadcrumb { margin: .4rem 0 0; --bs-breadcrumb-divider-color: #ccc; }
.page-banner .breadcrumb a { color: #fff; }
.page-banner .breadcrumb-item.active { color: #ddd; }

/* Sections */
section { padding: 4.5rem 0; }
.bg-soft { background: var(--mit-light); }
.section-title { font-weight: 800; position: relative; padding-bottom: .8rem; margin-bottom: 2rem; }
.section-title::after { content: ""; position: absolute; left: 0; bottom: 0; width: 70px; height: 4px; background: var(--mit-orange); }
.section-title.text-center::after { left: 50%; transform: translateX(-50%); }
.eyebrow { color: var(--mit-orange); font-weight: 700; text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; }

/* Cards */
.product-card { border: 0; box-shadow: 0 4px 18px rgba(0,0,0,.08); overflow: hidden; height: 100%; transition: transform .25s, box-shadow .25s; }
.product-card:hover { transform: translateY(-5px); box-shadow: 0 10px 26px rgba(0,0,0,.15); }
.product-card .thumb { height: 220px; overflow: hidden; background: #ddd; }
.product-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.product-card:hover .thumb img { transform: scale(1.07); }
.product-card .card-title { font-weight: 700; }
.product-card .card-footer { background: #fff; border-top: 3px solid var(--mit-orange); }

.feature-box { text-align: center; padding: 2rem 1.2rem; background: #fff; border-radius: .5rem; box-shadow: 0 4px 18px rgba(0,0,0,.07); height: 100%; }
.feature-box i { font-size: 2.4rem; color: var(--mit-orange); }
.feature-box h3 { font-size: 1.15rem; font-weight: 700; margin-top: .8rem; }

/* Stats band */
.stats { background: var(--mit-charcoal); color: #fff; padding: 3rem 0; }
.stats .num { font-size: 2.4rem; font-weight: 800; color: var(--mit-orange); }

/* Gallery */
.gallery-item { display: block; position: relative; overflow: hidden; border-radius: .4rem; aspect-ratio: 4 / 3; background: #ddd; border: 0; padding: 0; width: 100%; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.gallery-item:hover img { transform: scale(1.08); }
.gallery-item::after { content: "\F52A"; font-family: "bootstrap-icons"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 2rem; color: #fff; background: rgba(242,106,16,.55); opacity: 0; transition: opacity .25s; }
.gallery-item:hover::after, .gallery-item:focus-visible::after { opacity: 1; }
.filter-btn.active { background: var(--mit-orange); border-color: var(--mit-orange); color: #fff; }
.lightbox-img { max-height: 80vh; object-fit: contain; }
.ratio video { background: #000; }

/* CTA */
.cta { background: var(--mit-orange); color: #fff; padding: 3rem 0; }
.cta .btn { background: var(--mit-charcoal); border-color: var(--mit-charcoal); color: #fff; font-weight: 600; }
.cta .btn:hover { background: var(--mit-dark); }

/* Contact */
.contact-card { background: var(--mit-charcoal); color: #fff; border-radius: .5rem; padding: 2rem; height: 100%; }
.contact-card a { color: #fff; text-decoration: none; }
.contact-card a:hover { color: var(--mit-orange); }
.contact-card .ico { color: var(--mit-orange); font-size: 1.4rem; margin-right: .8rem; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Footer */
footer { background: var(--mit-dark); color: #bfc2c5; }
footer h5 { color: #fff; font-weight: 700; }
footer a { color: #bfc2c5; text-decoration: none; }
footer a:hover { color: var(--mit-orange); }
footer .footer-logo { background: #fff; padding: .4rem .7rem; border-radius: .3rem; height: 60px; width: auto; }
footer .copy { border-top: 1px solid #3a3d40; font-size: .88rem; }

.to-top { position: fixed; right: 26px; bottom: 90px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--mit-orange); color: #fff; display: none; z-index: 1030; }
.to-top.show { display: block; }

@media (max-width: 767.98px) {
  .hero .carousel-item { height: 460px; }
  .hero h1, .hero h2 { font-size: 1.8rem; }
  .page-banner { background: var(--mit-charcoal); border-bottom: 5px solid var(--mit-orange); }
  section { padding: 3rem 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* WhatsApp floating button */
.wa-float { position: fixed; right: 18px; bottom: 18px; width: 58px; height: 58px; border-radius: 50%; background: #25d366; color: #fff; font-size: 2rem; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 14px rgba(0,0,0,.3); z-index: 1030; text-decoration: none; animation: wa-pulse 2.2s infinite; }
.wa-float:hover { background: #1ebe5a; color: #fff; }
@keyframes wa-pulse { 0% { box-shadow: 0 0 0 0 rgba(37,211,102,.6); } 70% { box-shadow: 0 0 0 16px rgba(37,211,102,0); } 100% { box-shadow: 0 0 0 0 rgba(37,211,102,0); } }

/* ================= Scroll animations ================= */
body { overflow-x: clip; }

/* scroll progress bar */
#scrollProgress { position: fixed; top: 0; left: 0; width: 100%; height: 4px; background: linear-gradient(90deg, var(--mit-orange), #ffb066); transform-origin: 0 50%; transform: scaleX(0); z-index: 2000; pointer-events: none; }

/* navbar shrink */
.navbar, .navbar-brand img { transition: padding .3s, height .3s, box-shadow .3s; }
.navbar.scrolled { padding-top: .15rem; padding-bottom: .15rem; box-shadow: 0 4px 18px rgba(0,0,0,.15); }
.navbar.scrolled .navbar-brand img { height: 42px; }

/* reveal on scroll */
.js .rv { opacity: 0; transition: opacity .9s ease, transform .9s cubic-bezier(.2,.7,.2,1); will-change: opacity, transform; }
.js .rv-up { transform: translateY(46px); }
.js .rv-left { transform: translateX(-70px); }
.js .rv-right { transform: translateX(70px); }
.js .rv-zoom { transform: scale(.88); }
.js .rv.in { opacity: 1; transform: none; }

/* hero: animated captions + video scale for parallax */
.hero .carousel-item > video { transform: scale(1.18); will-change: transform; }
.hero .carousel-item.active .carousel-caption > * { animation: capIn .9s cubic-bezier(.2,.7,.2,1) both; }
.hero .carousel-item.active .carousel-caption > :nth-child(2) { animation-delay: .15s; }
.hero .carousel-item.active .carousel-caption > :nth-child(3) { animation-delay: .3s; }
.hero .carousel-item.active .carousel-caption > :nth-child(4) { animation-delay: .4s; }
@keyframes capIn { from { opacity: 0; transform: translateY(34px); } to { opacity: 1; transform: none; } }
.scroll-cue { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 5; width: 26px; height: 42px; border: 2px solid #fff; border-radius: 14px; opacity: .85; pointer-events: none; }
.scroll-cue::after { content: ""; position: absolute; left: 50%; top: 7px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--mit-orange); animation: cue 1.6s infinite; }
@keyframes cue { 0% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(16px); } }

/* ticker */
.ticker { background: var(--mit-orange); color: #fff; overflow: hidden; white-space: nowrap; padding: .9rem 0; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; }
.ticker-track { display: inline-flex; animation: tick 32s linear infinite; }
.ticker span { padding: 0 1.4rem; }
.ticker i { opacity: .7; }
.ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes tick { to { transform: translateX(-50%); } }

/* pinned scroll story */
.story { position: relative; height: 420vh; padding: 0; background: var(--mit-dark); }
.story-stage { position: sticky; top: 0; height: 100vh; overflow: hidden; color: #fff; }
.story-bg { position: absolute; inset: 0; opacity: 0; transition: opacity 1s ease; }
.story-bg.active { opacity: 1; }
.story-bg video, .story-bg img { width: 100%; height: 100%; object-fit: cover; }
.story-bg.active video, .story-bg.active img { animation: kb 14s ease-out both; }
@keyframes kb { from { transform: scale(1.12); } to { transform: scale(1); } }
.story-stage::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, rgba(20,22,24,.9) 0%, rgba(20,22,24,.55) 55%, rgba(20,22,24,.25) 100%); }
.story-content { position: relative; z-index: 2; height: 100%; display: flex; align-items: center; padding-top: 80px; }
.story-step { position: absolute; max-width: 560px; opacity: 0; transform: translateY(40px); transition: opacity .7s ease, transform .7s ease; pointer-events: none; }
.story-step.active { opacity: 1; transform: none; pointer-events: auto; }
.story-step .num { font-size: clamp(4rem, 12vw, 9rem); font-weight: 900; line-height: .9; color: transparent; -webkit-text-stroke: 2px var(--mit-orange); }
.story-step h2 { font-weight: 800; font-size: clamp(2rem, 5vw, 3.4rem); }
.story-step p { font-size: 1.15rem; max-width: 460px; }
.story-meta { position: absolute; z-index: 3; right: 6%; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; align-items: center; gap: .9rem; }
.story-dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; opacity: .6; transition: all .4s; }
.story-dot.done { background: #fff; }
.story-dot.active { background: var(--mit-orange); border-color: var(--mit-orange); transform: scale(1.5); opacity: 1; }
.story-count { position: absolute; z-index: 3; left: 0; right: 0; bottom: 26px; text-align: center; font-weight: 700; letter-spacing: .2em; opacity: .85; }
.story-bar { position: absolute; z-index: 3; left: 0; bottom: 0; height: 5px; width: 100%; background: var(--mit-orange); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); }

/* horizontal scroll showcase */
.hscroll { padding: 0; background: var(--mit-light); }
.hscroll-sticky { position: sticky; top: 0; height: 100vh; overflow: hidden; display: flex; flex-direction: column; justify-content: center; padding-top: 90px; }
.hscroll-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 1.5rem; gap: 1rem; }
.hscroll-head .section-title { margin-bottom: 0; }
.hscroll-hint { font-weight: 700; color: var(--mit-orange); white-space: nowrap; }
.hscroll-track { display: flex; gap: 1.6rem; padding: .8rem 8vw 1.6rem; width: max-content; will-change: transform; }
.hscroll .hcard { width: 320px; flex: 0 0 auto; height: auto; }
.hscroll-progress { height: 4px; margin: 0 8vw; background: #ddd; border-radius: 2px; overflow: hidden; }
.hscroll-progress i { display: block; height: 100%; background: var(--mit-orange); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); }
@media (max-width: 991.98px) {
  .hscroll-sticky { position: static; height: auto; padding: 3rem 0; }
  .hscroll-track { width: auto; overflow-x: auto; scroll-snap-type: x mandatory; padding: .8rem 1rem 1.6rem; }
  .hscroll .hcard { scroll-snap-align: center; width: 78vw; max-width: 320px; }
  .hscroll-progress { display: none; }
  .story { height: 360vh; }
  .story-meta { right: 4%; }
  .story-stage::before { background: rgba(20,22,24,.62); }
}
@media (prefers-reduced-motion: reduce) {
  .ticker-track, .scroll-cue::after, .story-bg.active video, .story-bg.active img { animation: none !important; }
}

/* fallback when animations are off (reduced motion / no JS): plain stacked layout */
html:not(.js) .story { height: auto; padding: 4rem 0; }
html:not(.js) .story-stage { position: static; height: auto; }
html:not(.js) .story-stage::before, html:not(.js) .story-bg, html:not(.js) .story-meta, html:not(.js) .story-count, html:not(.js) .story-bar { display: none; }
html:not(.js) .story-content { display: block; padding-top: 0; }
html:not(.js) .story-step { position: static; opacity: 1; transform: none; margin-bottom: 2rem; }
html:not(.js) .hscroll-sticky { position: static; height: auto; overflow: visible; padding: 3rem 0; }
html:not(.js) .hscroll-track { width: auto; flex-wrap: wrap; }
html:not(.js) .hscroll-progress, html:not(.js) .hscroll-hint { display: none; }
