:root {
  --maroon: #7a0c2e;
  --maroon-dark: #560820;
  --gold: #c9a227;
  --cream: #faf7f2;
  --ink: #1a1a1a;
  --grey: #5c5c5c;
  --line: #e6e1d8;
  --white: #ffffff;
  --radius: 6px;
  --shadow: 0 8px 24px rgba(0,0,0,0.08);
  --maxw: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--white);
  line-height: 1.55;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-weight: 700; margin: 0 0 .5em; line-height: 1.2; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: 72px 0; }
.section--tight { padding: 48px 0; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .78rem;
  font-weight: 700;
  color: var(--maroon);
  margin-bottom: 10px;
  display: block;
}
.section-title { font-size: clamp(1.6rem, 3vw, 2.3rem); color: var(--maroon-dark); }
.section-sub { color: var(--grey); max-width: 720px; }
.btn {
  display: inline-block;
  padding: 14px 30px;
  border-radius: 999px;
  font-weight: 700;
  font-size: .9rem;
  letter-spacing: .03em;
  text-transform: uppercase;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all .2s ease;
}
.btn--gold { background: var(--gold); color: var(--maroon-dark); }
.btn--gold:hover { background: #b08c1f; }
.btn--outline { background: transparent; border-color: var(--white); color: var(--white); }
.btn--outline:hover { background: rgba(255,255,255,.15); }
.btn--maroon { background: var(--maroon); color: var(--white); }
.btn--maroon:hover { background: var(--maroon-dark); }
.btn--block { display: block; width: 100%; text-align: center; }
.btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--maroon);
  border-bottom: 1px solid rgba(255,255,255,.08);
  transition: background .25s ease, box-shadow .25s ease;
}
.site-header.is-scrolled {
  background: var(--white);
  border-bottom-color: var(--line);
  box-shadow: var(--shadow);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 76px; }
.logo-swap img { height: 38px; }
.logo-swap .logo-color { display: none; }
.site-header.is-scrolled .logo-swap .logo-white { display: none; }
.site-header.is-scrolled .logo-swap .logo-color { display: block; }
.main-nav { display: flex; gap: 36px; align-items: center; }
.main-nav a {
  position: relative;
  color: var(--white); font-weight: 600; font-size: .88rem;
  text-transform: uppercase; letter-spacing: .05em;
  padding: 6px 0;
}
.main-nav a:not(.btn)::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 0; height: 2px; background: var(--gold);
  transition: width .25s ease;
}
.main-nav a:not(.btn):hover::after { width: 100%; }
.site-header.is-scrolled .main-nav a { color: var(--ink); }
.main-nav a:hover { color: var(--gold); }
.main-nav a.btn:hover { color: var(--maroon-dark); }

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px; height: 40px;
  background: none; border: none; cursor: pointer;
  padding: 0;
}
.nav-toggle span {
  display: block; width: 24px; height: 2px;
  background: var(--white); transition: all .25s ease;
}
.site-header.is-scrolled .nav-toggle span { background: var(--ink); }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Hero */
.hero {
  position: relative;
  min-height: 640px;
  display: flex;
  align-items: flex-end;
  background: linear-gradient(180deg, rgba(20,4,10,.35) 0%, rgba(20,4,10,.75) 100%),
    url("https://university.taylors.edu.my/content/dam/taylorsrevamp/university/open-day/2026/c1-2026/taylors-open-day-virtual-tour-808x454-high-res.png/_jcr_content/renditions/cq5dam.web.1212.681.webp")
    center / cover no-repeat;
  color: var(--white);
  padding: 20px 0 56px;
}
.hero-content { max-width: 640px; }
.hero-dates { font-size: clamp(2rem, 4.5vw, 3.2rem); margin-bottom: 14px; }
.hero-copy { font-size: 1.05rem; opacity: .92; margin-bottom: 28px; }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }

/* Registration form */
.reg-card {
  background: var(--white);
  max-width: 900px;
  margin: -90px auto 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px;
  position: relative;
  z-index: 5;
}
.reg-card h2 { color: var(--maroon-dark); font-size: 1.4rem; }
.reg-card .step-note { color: var(--grey); font-size: .9rem; margin-bottom: 24px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 24px; }
.form-grid .full { grid-column: 1 / -1; }
.field label {
  display: block; font-size: .78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; color: var(--maroon-dark);
  margin-bottom: 6px;
}
.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field select {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: var(--radius); font-size: .95rem; background: var(--cream);
}
.field input:focus, .field select:focus {
  outline: 2px solid var(--gold); outline-offset: 1px; background: var(--white);
}
.radio-row { display: flex; gap: 24px; }
.radio-row label { display: flex; align-items: center; gap: 8px; font-size: .9rem; font-weight: 600; }
.checkbox-row { display: flex; gap: 10px; align-items: flex-start; font-size: .85rem; color: var(--grey); }
.hidden { display: none !important; }
.form-msg { margin-top: 18px; padding: 12px 16px; border-radius: var(--radius); font-size: .9rem; display: none; }
.form-msg.success { background: #e7f6ec; color: #1b6d3a; display: block; }
.form-msg.error { background: #fbe9e9; color: #a3231f; display: block; }

/* Tabs (Programmes) */
.tabs { display: flex; gap: 8px; margin-bottom: 40px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tab-btn {
  padding: 12px 22px; font-weight: 700; font-size: .9rem; color: var(--grey);
  border-bottom: 3px solid transparent; cursor: pointer; background: none; border-top: none; border-left: none; border-right: none;
}
.tab-btn.active { color: var(--maroon); border-color: var(--gold); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Dark section variant (At A Glance) */
.section--dark { background: #14141a; }
.eyebrow--light { color: var(--gold); }
.section-title--light { color: var(--white); }
.section-sub--light { color: #b5b3ad; }

.pill-tabs { display: flex; gap: 12px; flex-wrap: wrap; }
.pill-btn {
  padding: 10px 22px; border-radius: 999px; font-weight: 700; font-size: .85rem;
  background: transparent; border: 1.5px solid rgba(255,255,255,.25); color: var(--white);
  cursor: pointer; transition: all .2s ease;
}
.pill-btn.active { background: var(--maroon); border-color: var(--maroon); }
.pill-btn:hover:not(.active) { border-color: var(--gold); color: var(--gold); }

.panel { display: none; }
.panel.active { display: block; }

/* Cards grid */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 28px; }
.info-card { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--white); }
.info-card img { height: 190px; width: 100%; object-fit: cover; }
.info-card .info-card-body { padding: 20px; }
.info-card h4 { color: var(--maroon-dark); font-size: 1.02rem; }
.info-card .meta { font-size: .78rem; color: var(--gold); font-weight: 700; text-transform: uppercase; margin-bottom: 8px; }
.info-card p { color: var(--grey); font-size: .9rem; margin: 0; }

.info-card--dark { background: #1e1e26; border-color: rgba(255,255,255,.08); }
.info-card--dark h4 { color: var(--white); }
.info-card--dark p { color: #a8a6a0; }

/* Programme cards */
.programme-card { padding: 26px; border-left: 4px solid var(--gold); background: var(--cream); border-radius: var(--radius); }
.programme-card h4 { color: var(--maroon-dark); }
.programme-card p { color: var(--grey); font-size: .92rem; }

/* Table */
.programme-table-wrap { overflow-x: auto; }
table.programmes { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.programmes th, table.programmes td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.programmes th { background: var(--maroon); color: var(--white); text-transform: uppercase; font-size: .78rem; letter-spacing: .04em; }
table.programmes tr:nth-child(even) td { background: var(--cream); }

/* Rankings banners */
.ranking-banner { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.ranking-banner img { border-radius: var(--radius); }
.ranking-banner + .ranking-banner { margin-top: 56px; }

/* FAQ */
.faq-item { border-bottom: 1px solid var(--line); }
.faq-q {
  width: 100%; text-align: left; background: none; border: none; cursor: pointer;
  padding: 18px 0; font-weight: 700; font-size: 1rem; color: var(--ink);
  display: flex; justify-content: space-between; align-items: center;
}
.faq-q::after { content: "+"; font-size: 1.4rem; color: var(--maroon); font-weight: 400; }
.faq-item.open .faq-q::after { content: "\2212"; }
.faq-a { max-height: 0; overflow: hidden; color: var(--grey); font-size: .92rem; transition: max-height .25s ease; }
.faq-item.open .faq-a { padding-bottom: 18px; }

/* Directions */
.directions-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; }
.map-frame { width: 100%; height: 380px; border: 0; border-radius: var(--radius); }
.address-card { background: var(--cream); padding: 28px; border-radius: var(--radius); }
.address-card h4 { color: var(--maroon-dark); font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; }
.address-card p { margin: 0 0 20px; color: var(--grey); }
.address-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* Footer */
.site-footer { background: #0f0f14; color: rgba(255,255,255,.7); padding: 56px 0 0; }
.footer-grid {
  display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px;
  padding-bottom: 40px; border-bottom: 1px solid rgba(255,255,255,.08);
}
.footer-logo { height: 36px; margin-bottom: 16px; }
.footer-brand p { font-size: .85rem; line-height: 1.6; max-width: 260px; color: rgba(255,255,255,.55); }
.footer-col h5 {
  color: var(--white); font-size: .78rem; text-transform: uppercase;
  letter-spacing: .06em; margin-bottom: 16px;
}
.footer-col a { display: block; font-size: .88rem; margin-bottom: 10px; color: rgba(255,255,255,.65); }
.footer-col a:hover { color: var(--gold); }
.footer-bottom { padding: 24px 0; font-size: .8rem; color: rgba(255,255,255,.45); }
.social-row { display: flex; gap: 14px; }
.social-row a {
  width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.1);
  display: flex; align-items: center; justify-content: center; font-size: .8rem; color: var(--white);
}
.social-row a:hover { background: var(--gold); color: var(--maroon-dark); }

/* Responsive */
@media (max-width: 860px) {
  .main-nav {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    position: absolute;
    top: 76px; left: 0; right: 0;
    background: var(--white);
    padding: 16px 24px 24px;
    box-shadow: var(--shadow);
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease;
  }
  .main-nav.open { max-height: 320px; }
  .main-nav a { color: var(--ink); padding: 10px 0; width: 100%; }
  .main-nav a::after { display: none; }
  .main-nav .btn { margin-top: 10px; text-align: center; }
  .nav-toggle { display: flex; }

  .form-grid { grid-template-columns: 1fr; }
  .reg-card { margin-top: -60px; padding: 26px; }
  .ranking-banner, .directions-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
  .pill-tabs { flex-direction: column; }
  .pill-btn { width: 100%; text-align: center; }
}