/* Meston College theme — navy and gold */
:root {
	--ink: #071733;
	--deep: #0B2149;
	--night: #04102A;
	--gold: #CFAE69;
	--gold-light: #E3C98C;
	--gold-dark: #8A6A1F;
	--red: #D21C26;
	--red-dark: #B0141D;
	--ivory: #F6F1E7;
	--ivory-line: #D9CFBC;
	--text: #F3EEE3;
	--muted: #C9C2B3;
	--muted-dark: #4A4F5C;
	--line: rgba(207, 174, 105, 0.25);
	--serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
	--sans: Manrope, system-ui, -apple-system, "Segoe UI", sans-serif;
	--radius: 24px;
	--ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body { margin: 0; background: var(--ink); color: var(--text); font-family: var(--sans); font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold-light); }
a:hover { color: #fff; }
h1, h2, h3 { margin: 0; }
button, input, select { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
body.drawer-open { overflow: hidden; }

.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }
.skip-link { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--gold); color: var(--ink); padding: 12px 18px; border-radius: 999px; font-weight: 700; }
.skip-link:focus { top: 16px; }

.container { max-width: 1320px; margin: 0 auto; padding: 0 28px; }
.container--narrow { max-width: 860px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 14px 26px; border-radius: 999px; border: 1px solid transparent; font-weight: 700; font-size: 15px; text-decoration: none; transition: transform 0.3s var(--ease), background 0.3s, color 0.3s, border-color 0.3s; }
.btn:hover { transform: translateY(-2px); }
.btn--red { background: var(--red); color: #fff; }
.btn--red:hover { background: var(--red-dark); color: #fff; }
.btn--navy { background: var(--ink); color: var(--text); border: 0; }
.btn--navy:hover { background: var(--deep); color: #fff; }
.btn--ghost { color: var(--text); border-color: rgba(243, 238, 227, 0.45); background: transparent; }
.btn--ghost:hover { border-color: var(--gold); color: #fff; }
.btn--text { background: transparent; color: var(--ink); border: 0; }
.btn--large { padding: 17px 32px; font-size: 16px; }
.btn--small { min-height: 44px; padding: 12px 22px; font-size: 14px; }
.btn--block { width: 100%; }

.eyebrow { margin: 0; font-family: var(--sans); font-size: 12px; letter-spacing: 0.34em; font-weight: 700; color: var(--gold); text-transform: uppercase; }
.eyebrow--dark { color: var(--gold-dark); }
.display { font-family: var(--serif); font-weight: 500; font-size: clamp(40px, 5vw, 60px); line-height: 1.05; }
.display--tight { margin-top: 16px; }
.display--dark { color: var(--ink); margin-top: 16px; }
.lead { font-size: 17px; line-height: 1.75; color: var(--muted); max-width: 470px; margin: 0; }
.muted { color: #B9B3A6; font-size: 14px; margin: 0; }
.link-gold { display: inline-block; margin-top: 18px; color: var(--gold-light); font-weight: 700; padding: 10px 0; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 30; background: rgba(7, 23, 51, 0.84); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid rgba(207, 174, 105, 0.22); }
.admin-bar .site-header { top: 32px; }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; padding-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.brand__emblem { width: 50px; height: 50px; border-radius: 50%; border: 1px solid rgba(207, 174, 105, 0.6); object-fit: cover; }
.brand__text { display: flex; flex-direction: column; line-height: 1; }
.brand__name { font-family: var(--serif); font-size: 28px; font-weight: 600; letter-spacing: 0.12em; color: var(--text); }
.brand__sub { font-size: 10px; letter-spacing: 0.28em; color: var(--gold); font-weight: 600; margin-top: 5px; }
.nav { display: flex; align-items: center; gap: 8px; }
.nav__list { display: flex; align-items: center; gap: 2px; list-style: none; margin: 0; padding: 0; }
.nav__list a { display: block; color: var(--text); text-decoration: none; font-size: 14px; font-weight: 500; padding: 12px 14px; border-radius: 999px; transition: color 0.2s; }
.nav__list a:hover, .nav__list .current-menu-item > a { color: var(--gold-light); }
.nav__list .sub-menu { display: none; }
.nav-toggle { display: none; width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line); background: transparent; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.nav-toggle__bar { width: 20px; height: 2px; background: var(--text); transition: transform 0.3s; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:first-child { transform: translateY(4px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) { transform: translateY(-4px) rotate(-45deg); }

/* Hero */
.hero { position: relative; height: min(820px, 92vh); min-height: 620px; overflow: hidden; background: var(--ink); }
.hero__slide { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1); transition: opacity 1.4s ease, transform 7s ease; }
.hero__slide.is-active { opacity: 1; transform: scale(1.06); }
.hero__shade { position: absolute; inset: 0; background: rgba(5, 16, 38, 0.6); }
.hero__shade::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 320px; background: linear-gradient(rgba(7, 23, 51, 0), var(--ink)); }
.hero__content { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; padding-bottom: 64px; }
.hero__title { margin-top: 22px; font-family: var(--serif); font-weight: 500; font-size: clamp(48px, 7vw, 92px); line-height: 0.98; letter-spacing: -0.01em; max-width: 980px; }
.hero__title em { color: var(--gold-light); }
.hero__row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 32px; margin-top: 36px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero__meta { display: flex; align-items: center; gap: 28px; }
.counter { text-align: right; }
.counter__num { font-family: var(--serif); font-size: 64px; line-height: 1; color: var(--gold-light); font-weight: 600; font-variant-numeric: tabular-nums; }
.counter__label { font-size: 12px; letter-spacing: 0.24em; font-weight: 700; color: var(--muted); margin-top: 6px; text-transform: uppercase; }
.dots { display: flex; gap: 4px; }
.dots__btn { width: 44px; height: 44px; border: 0; background: transparent; padding: 0; display: flex; align-items: center; justify-content: center; }
.dots__btn span { width: 30px; height: 3px; border-radius: 3px; background: rgba(243, 238, 227, 0.35); transition: background 0.3s; }
.dots__btn.is-active span { background: var(--gold-light); }

.reveal { animation: meston-up 0.9s var(--ease) both; }
.reveal--2 { animation-delay: 0.15s; }
.reveal--3 { animation-delay: 0.3s; }
@keyframes meston-up { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* Ticker */
.ticker { overflow: hidden; background: var(--deep); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ticker__track { display: flex; width: max-content; gap: 48px; padding: 20px 0; font-family: var(--serif); font-size: 28px; font-style: italic; color: var(--gold-light); white-space: nowrap; animation: meston-ticker 38s linear infinite; }
.ticker__star { font-style: normal; font-size: 18px; color: var(--gold); align-self: center; }
@keyframes meston-ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* Sections */
.section { padding: 110px 0; }
.section--ink { background: var(--ink); }
.section--deep { background: var(--deep); }
.section--ivory { background: var(--ivory); color: var(--ink); }
.section--line { border-top: 1px solid rgba(207, 174, 105, 0.22); }
.section--rail { padding-bottom: 0; }
.split-head { display: flex; flex-wrap: wrap; gap: 32px 48px; justify-content: space-between; align-items: flex-end; }
.split-head--tight { margin-bottom: 40px; }

.lift { transition: transform 0.35s var(--ease), border-color 0.35s; }
.lift:hover { transform: translateY(-6px); border-color: var(--gold); }
.zoom { overflow: hidden; }
.zoom img { transition: transform 1s var(--ease); }
.zoom:hover img { transform: scale(1.06); }

/* Legacy */
.legacy { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin-top: 64px; }
.legacy__card { border: 1px solid var(--line); border-radius: 22px; padding: 32px; background: var(--deep); }
.legacy__year { font-family: var(--serif); font-size: 58px; line-height: 1; color: var(--gold-light); font-weight: 600; }
.legacy__card h3 { font-size: 18px; font-weight: 700; margin-top: 22px; line-height: 1.35; }
.legacy__card p { margin: 10px 0 0; font-size: 15px; line-height: 1.65; color: #B9B3A6; }
.legacy__card--gold { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.legacy__card--gold .legacy__year { color: var(--ink); }
.legacy__card--gold p { color: #2A2A2A; }

/* Programme explorer */
.explorer { display: flex; flex-wrap: wrap; gap: 40px; margin-top: 52px; align-items: stretch; }
.explorer__list { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; }
.explorer__item { text-align: left; background: transparent; border: 0; border-top: 1px solid rgba(207, 174, 105, 0.22); padding: 24px 0; display: flex; gap: 22px; align-items: baseline; color: var(--text); transition: border-color 0.3s; }
.explorer__item:last-child { border-bottom: 1px solid rgba(207, 174, 105, 0.22); }
.explorer__num { flex: 0 0 34px; font-size: 13px; font-weight: 700; color: #8E8778; }
.explorer__text { display: flex; flex-direction: column; gap: 6px; }
.explorer__name { font-family: var(--serif); font-size: 32px; font-weight: 500; line-height: 1.1; transition: color 0.3s; }
.explorer__degree { font-size: 12px; letter-spacing: 0.14em; font-weight: 600; color: #8E8778; text-transform: uppercase; }
.explorer__item:hover .explorer__name { color: var(--gold-light); }
.explorer__item.is-active { border-top-color: var(--gold); }
.explorer__item.is-active .explorer__num, .explorer__item.is-active .explorer__degree { color: var(--gold); }
.explorer__item.is-active .explorer__name { color: var(--gold-light); font-weight: 600; }
.explorer__panel { flex: 1 1 520px; min-width: 0; position: relative; border-radius: 26px; min-height: 560px; background: var(--ink); }
.explorer__panel img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity 0.4s ease, transform 1s var(--ease); }
.explorer__panel img.is-fading { opacity: 0; }
.explorer__card { position: absolute; left: 20px; right: 20px; bottom: 20px; background: rgba(7, 23, 51, 0.88); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid rgba(207, 174, 105, 0.3); border-radius: 20px; padding: 26px; display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.explorer__title { font-family: var(--serif); font-size: 28px; font-weight: 600; line-height: 1.15; }
.explorer__note { margin: 0; font-size: 14px; line-height: 1.6; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid rgba(207, 174, 105, 0.45); color: var(--gold-light); padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; }

/* Admissions steps */
.steps { list-style: none; margin: 56px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--ivory-line); }
.steps li { padding: 32px 28px 0 0; }
.steps__label { font-family: var(--serif); font-size: 22px; font-style: italic; color: var(--gold-dark); }
.steps h3 { font-size: 20px; font-weight: 700; margin-top: 12px; }
.steps p { margin: 10px 0 0; font-size: 15px; line-height: 1.65; color: var(--muted-dark); }

/* Gallery rail */
.rail { display: flex; gap: 18px; overflow-x: auto; padding: 0 max(28px, calc((100vw - 1320px) / 2 + 28px)) 110px; scroll-padding-left: max(28px, calc((100vw - 1320px) / 2 + 28px)); scroll-snap-type: x mandatory; scrollbar-width: thin; scrollbar-color: var(--gold) transparent; }
.rail:focus-visible { outline-offset: -4px; }
.rail__item { margin: 0; flex: 0 0 400px; height: 500px; border-radius: var(--radius); position: relative; scroll-snap-align: start; }
.rail__item img { width: 100%; height: 100%; object-fit: cover; }
.rail__item figcaption { position: absolute; left: 18px; bottom: 18px; background: rgba(7, 23, 51, 0.85); border: 1px solid rgba(207, 174, 105, 0.35); padding: 9px 16px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--gold-light); }

/* Principal */
.principal { display: flex; flex-wrap: wrap; gap: 56px; align-items: center; }
.principal__photo { flex: 0 1 320px; height: 400px; border-radius: 26px; border: 1px dashed rgba(207, 174, 105, 0.5); display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 14px; text-align: center; padding: 20px; overflow: hidden; }
.principal__photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 20px; }
.principal__photo:has(img) { border: 0; padding: 0; }
.principal__body { flex: 1 1 560px; min-width: 0; }
.principal__quote { margin: 22px 0 0; font-family: var(--serif); font-size: clamp(28px, 3vw, 38px); line-height: 1.3; font-style: italic; }
.principal__quote p { margin: 0 0 12px; }
.principal__name { margin-top: 30px; font-size: 18px; font-weight: 700; }

/* Crest */
.crest { display: flex; flex-direction: column; align-items: center; text-align: center; }
.crest__emblem { width: 150px; height: 150px; border-radius: 50%; border: 1px solid rgba(207, 174, 105, 0.6); }
.crest__motto { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 40px; margin: 40px 0 0; font-family: var(--serif); font-size: clamp(44px, 6vw, 76px); line-height: 1; font-weight: 500; }
.crest__motto em { color: var(--gold-light); }
.crest__dot { color: var(--gold); }
.crest__text { margin-top: 34px; max-width: 720px; }

/* Footer */
.site-footer { background: var(--night); color: #B9B3A6; }
.site-footer__grid { display: flex; flex-wrap: wrap; gap: 48px; padding-top: 80px; padding-bottom: 40px; }
.site-footer__grid > div { flex: 1 1 220px; }
.site-footer__grid > .site-footer__visit { flex: 2 1 380px; }
.site-footer__title { font-family: var(--serif); font-size: 40px; line-height: 1.1; color: var(--text); font-weight: 500; }
.site-footer__visit p { margin: 18px 0 0; font-size: 16px; line-height: 1.75; }
.footer__links { list-style: none; margin: 12px 0 0; padding: 0; }
.footer__links a { display: block; color: var(--text); text-decoration: none; padding: 6px 0; font-size: 15px; }
.footer__links a:hover { color: var(--gold-light); }
.site-footer__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; padding-top: 24px; padding-bottom: 32px; border-top: 1px solid rgba(207, 174, 105, 0.18); font-size: 13px; color: #8E8778; }

/* Floating Apply button */
.fab { position: fixed; right: 28px; bottom: 28px; z-index: 40; box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35); transition: opacity 0.35s, transform 0.35s var(--ease), background 0.3s; }
.fab.is-hidden { opacity: 0; transform: translateY(24px); pointer-events: none; }

/* Application drawer */
.drawer { position: fixed; inset: 0; z-index: 60; display: flex; justify-content: flex-end; }
.drawer[hidden] { display: none; }
.drawer__backdrop { position: absolute; inset: 0; background: rgba(2, 10, 26, 0.6); animation: meston-fade 0.3s ease both; }
.drawer__panel { position: relative; width: 460px; max-width: 100%; height: 100%; overflow-y: auto; background: var(--ivory); color: var(--ink); padding: 32px; display: flex; flex-direction: column; gap: 18px; animation: meston-slide 0.45s var(--ease) both; }
.drawer__panel:focus { outline: none; }
@keyframes meston-slide { from { transform: translateX(100%); } to { transform: none; } }
@keyframes meston-fade { from { opacity: 0; } to { opacity: 1; } }
.drawer__top { display: flex; justify-content: space-between; align-items: center; }
.drawer__close { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--ivory-line); background: transparent; color: var(--ink); display: flex; align-items: center; justify-content: center; }
.drawer__bars { display: flex; gap: 6px; }
.drawer__bars span { flex: 1; height: 3px; border-radius: 3px; background: var(--ivory-line); transition: background 0.3s; }
.drawer__bars span.is-on { background: var(--red); }
.drawer__notice { margin: 0; font-size: 13px; line-height: 1.5; background: #FFF8E6; border: 1px solid #E8D7A8; color: #5A4512; padding: 10px 14px; border-radius: 12px; }
.drawer__title { font-family: var(--serif); font-size: 34px; font-weight: 600; line-height: 1.1; }
.drawer__text { margin: 0; font-size: 15px; line-height: 1.65; color: var(--muted-dark); }
.step { display: flex; flex-direction: column; gap: 14px; }
.step[hidden] { display: none; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; }
.field input, .field select { padding: 14px; border: 1px solid var(--ivory-line); border-radius: 14px; font-size: 15px; font-weight: 400; background: #fff; color: var(--ink); width: 100%; }
.field input:focus, .field select:focus { outline: 2px solid var(--ink); outline-offset: 1px; }
.field input[aria-invalid="true"] { border-color: var(--red); }
.field__otp { font-size: 22px !important; letter-spacing: 0.3em; text-align: center; }
.field__error { margin: 0; color: var(--red-dark); font-size: 14px; font-weight: 600; }
.summary { margin: 0; background: #fff; border: 1px solid var(--ivory-line); border-radius: 18px; padding: 18px; font-size: 14px; }
.summary div { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; }
.summary dt { color: var(--muted-dark); }
.summary dd { margin: 0; font-weight: 700; text-align: right; }
.summary__total { border-top: 1px solid #EAE2D3; margin-top: 8px; padding-top: 10px !important; }
.summary__total dd { font-size: 16px; font-weight: 800; }
.step--done { align-items: center; text-align: center; padding-top: 24px; }
.done__icon { width: 72px; height: 72px; border-radius: 50%; background: var(--ink); color: var(--gold-light); display: flex; align-items: center; justify-content: center; }

/* Inner pages */
.page-hero { background: var(--deep); padding: 100px 0 64px; border-bottom: 1px solid var(--line); }
.page-hero--tall { padding: 160px 0 140px; }
.page-hero--tall .display { margin: 18px 0 32px; }
.page { min-height: 40vh; }
.entry__image { margin-bottom: 32px; border-radius: var(--radius); overflow: hidden; }
.entry__content { font-size: 17px; line-height: 1.8; color: #2A2F3A; }
.entry__content h2, .entry__content h3 { font-family: var(--serif); color: var(--ink); margin: 1.6em 0 0.5em; font-weight: 600; }
.entry__content h2 { font-size: 36px; }
.entry__content h3 { font-size: 28px; }
.entry__content a { color: var(--red-dark); }
.entry__content img { border-radius: 16px; }
.post-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 40px; }
.post-card a { display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: var(--ink); }
.post-card__image { border-radius: 18px; overflow: hidden; }
.post-card__date { font-size: 13px; color: var(--gold-dark); font-weight: 600; }
.post-card__title { font-family: var(--serif); font-size: 26px; font-weight: 600; line-height: 1.2; }
.pagination { margin-top: 40px; }
.pagination a, .pagination span { color: var(--ink); margin-right: 12px; }

/* Tablet and phone */
@media (max-width: 1080px) {
	.legacy { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
	.nav-toggle { display: flex; }
	.nav { position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; gap: 12px; background: var(--ink); padding: 20px 28px 28px; border-bottom: 1px solid var(--line); transform: translateY(-120%); visibility: hidden; transition: transform 0.4s var(--ease), visibility 0.4s; }
	.nav.is-open { transform: none; visibility: visible; }
	.nav__list { flex-direction: column; align-items: stretch; }
	.nav__list a { font-size: 18px; padding: 14px 0; border-radius: 0; border-bottom: 1px solid rgba(207, 174, 105, 0.15); }
	.explorer__panel { min-height: 480px; }
	.post-list { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
	.container { padding: 0 20px; }
	.section { padding: 80px 0; }
	.hero { height: auto; min-height: 100svh; }
	.hero__content { height: auto; min-height: 100svh; padding-top: 140px; padding-bottom: 104px; }
	body { padding-bottom: 80px; }
	.hero__meta { width: 100%; justify-content: space-between; }
	.counter { text-align: left; }
	.counter__num { font-size: 52px; }
	.legacy, .steps { grid-template-columns: minmax(0, 1fr); }
	.explorer__name { font-size: 26px; }
	.explorer__panel { min-height: 520px; }
	.rail { padding: 0 20px 80px; }
	.rail__item { flex-basis: 82vw; height: 420px; }
	.fab { right: 16px; bottom: 16px; left: 16px; }
	.brand__name { font-size: 24px; }
	.brand__sub { font-size: 9px; letter-spacing: 0.2em; }
	.drawer__panel { padding: 24px 20px; }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
	.ticker__track { animation: none; }
}
