:root {
  --carolina: #7BAFD4;        /* Carolina Blue */
  --carolina-deep: #4B9CD3;   /* UNC primary blue */
  --carolina-pale: #E4F0F9;
  --navy: #13294B;            /* UNC navy */
  --navy-soft: #24406B;
  --ink: #1B2433;
  --muted: #55627A;
  --paper: #FFFFFF;
  --bg: #F6FAFD;
  --line: #CFE2F1;
  --purple: #7B4FB0;          /* epilepsy awareness */
  --radius: 14px;
  --shadow: 0 10px 30px rgba(19, 41, 75, .12);
  --serif: "Libre Baskerville", Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
  --script: "Great Vibes", "Snell Roundhand", cursive;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 18px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--navy-soft); text-underline-offset: 3px; }
a:hover { color: var(--carolina-deep); }
h1, h2, h3 { font-family: var(--serif); color: var(--navy); line-height: 1.2; margin: 0 0 .5em; }
h2 { font-size: clamp(1.7rem, 4vw, 2.4rem); text-align: center; }
h2 .script { display: block; font-size: 1.35em; color: var(--carolina-deep); font-weight: 400; line-height: 1; margin-bottom: .1em; }
.script { font-family: var(--script); font-weight: 400; }
.center { text-align: center; }
.small { font-size: .9rem; }

.skip { position: absolute; left: -999px; top: 0; background: var(--navy); color: #fff; padding: .5rem 1rem; z-index: 100; }
.skip:focus { left: 1rem; }

/* ---------- Gingham ---------- */
.gingham, .footer {
  background-color: #fff;
  background-image:
    linear-gradient(90deg, rgba(123,175,212,.55) 50%, transparent 50%),
    linear-gradient(rgba(123,175,212,.55) 50%, transparent 50%);
  background-size: 36px 36px;
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--navy);
  border-bottom: 4px solid var(--carolina);
}
.nav { max-width: 1120px; margin: 0 auto; padding: .6rem 16px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { font-family: var(--script); font-size: 1.9rem; color: #fff; text-decoration: none; line-height: 1; }
.brand:hover { color: var(--carolina); }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 1.4rem; }
.nav ul a { color: #fff; text-decoration: none; font-weight: 600; letter-spacing: .04em; font-size: .95rem; text-transform: uppercase; }
.nav ul a:hover { color: var(--carolina); }
.nav-toggle { display: none; background: transparent; color: #fff; border: 1px solid var(--carolina); border-radius: 8px; padding: .35rem .8rem; font: 600 .95rem var(--sans); }

/* ---------- Hero ---------- */
.hero { position: relative; padding: clamp(24px, 6vw, 72px) 16px; overflow: hidden; }
.hero .gingham { position: absolute; inset: 0; z-index: 0; }
.hero-card {
  position: relative; z-index: 1;
  max-width: 1040px; margin: 0 auto;
  background: var(--paper);
  border: 3px solid var(--navy);
  outline: 2px solid var(--carolina); outline-offset: -12px;
  border-radius: 6px;
  box-shadow: var(--shadow);
  display: grid; grid-template-columns: minmax(220px, 340px) 1fr; gap: clamp(20px, 4vw, 48px);
  padding: clamp(24px, 4vw, 48px);
  align-items: center;
}
.portrait { margin: 0; border-radius: 10px; overflow: hidden; box-shadow: 0 0 0 6px var(--carolina-pale), var(--shadow); }
.portrait img { width: 100%; height: auto; }
.hero-text { text-align: center; }
.eyebrow { font-family: var(--serif); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--navy); margin: 0; font-size: clamp(1.1rem, 2.6vw, 1.6rem); }
.script.big { font-size: clamp(3.6rem, 10vw, 6.2rem); color: var(--navy); margin: .1em 0 .15em; line-height: 1.05; }
.hero h1 { font-size: clamp(1.4rem, 3.4vw, 2.1rem); text-transform: uppercase; letter-spacing: .03em; margin-bottom: .2em; }
.dates { font-family: var(--serif); font-weight: 700; color: var(--navy-soft); letter-spacing: .06em; margin: 0 0 1.2rem; }
.verse { margin: 0 auto 1.6rem; max-width: 34em; font-family: var(--serif); font-style: italic; color: var(--muted); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 1rem 0; }
.cta-row { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: center; }

/* ---------- Buttons ---------- */
.btn { display: inline-block; padding: .8rem 1.4rem; border-radius: 999px; font-weight: 700; text-decoration: none; letter-spacing: .02em; transition: transform .15s, background .15s; }
.btn:hover { transform: translateY(-1px); }
.btn.primary { background: var(--navy); color: #fff; }
.btn.primary:hover { background: var(--navy-soft); color: #fff; }
.btn.ghost { border: 2px solid var(--carolina-deep); color: var(--navy); background: #fff; }
.btn.ghost:hover { background: var(--carolina-pale); color: var(--navy); }

/* ---------- Sections ---------- */
.section { padding: clamp(48px, 8vw, 88px) 16px; }
.section.alt { background: var(--carolina-pale); }
.wrap { max-width: 1120px; margin: 0 auto; }
.wrap.narrow { max-width: 760px; }
.lede { text-align: center; color: var(--muted); max-width: 40em; margin: 0 auto 2rem; }

/* ---------- Video ---------- */
.video-shell {
  position: relative; aspect-ratio: 16 / 9; width: 100%; max-width: 960px; margin: 0 auto;
  background: var(--navy); border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 0 0 6px #fff, 0 0 0 9px var(--carolina), var(--shadow);
}
.video-shell iframe, .video-shell video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.video-placeholder { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; color: #fff; padding: 16px;
  background: radial-gradient(circle at 50% 40%, var(--navy-soft), var(--navy)); }
.video-placeholder .script { font-size: clamp(2.4rem, 7vw, 4rem); color: var(--carolina); margin: 0; line-height: 1.1; }
.video-placeholder p { margin: .3rem 0; }
.video-links { text-align: center; margin-top: 1.6rem; }

/* ---------- Services ---------- */
.services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 1.5rem; }
.service { background: #fff; border-radius: var(--radius); padding: 0 1.4rem 1.4rem; text-align: center; box-shadow: var(--shadow); border-top: 6px solid var(--navy); position: relative; }
.service h3 { display: inline-block; background: var(--carolina-deep); color: #fff; font-size: 1rem; letter-spacing: .18em; text-transform: uppercase; padding: .45rem 1.2rem; margin: -1px 0 1rem; border-radius: 0 0 8px 8px; }
.service .when { font-weight: 700; color: var(--navy); margin: 0 0 .8rem; }
.service .where { margin: 0 0 .8rem; }
.service .note { font-style: italic; color: var(--muted); font-size: .95rem; margin: 0 0 .8rem; }
.service .map { font-weight: 600; font-size: .95rem; }
.service.past { opacity: .72; }
.service.past::after { content: "Held"; position: absolute; top: 12px; right: 12px; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.attire { text-align: center; margin-top: 2rem; color: var(--muted); }

/* ---------- About ---------- */
#about p { font-size: 1.08rem; }
#about p:first-of-type::first-letter { font-family: var(--serif); float: left; font-size: 3.4em; line-height: .9; padding: .05em .12em 0 0; color: var(--carolina-deep); }
#about .center { margin-top: 2rem; }

/* ---------- Gallery ---------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.thumb { all: unset; cursor: pointer; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform .15s; }
.thumb:hover, .thumb:focus-visible { transform: translateY(-3px); outline: 3px solid var(--carolina); }
.thumb img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: top; }
.thumb span { padding: .8rem 1rem; font-size: .95rem; color: var(--navy); font-weight: 600; }

/* ---------- Lightbox ---------- */
.lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; }
.lightbox::backdrop { background: rgba(10, 22, 42, .92); }
.lightbox[open] { display: grid; place-items: center; }
.lightbox figure { margin: 0; max-width: min(92vw, 1200px); text-align: center; }
.lightbox img { max-height: 82vh; width: auto; margin: 0 auto; border-radius: 6px; }
.lightbox figcaption { color: #fff; margin-top: .6rem; }
.lightbox button { position: fixed; background: rgba(255,255,255,.12); color: #fff; border: 0; border-radius: 50%; width: 48px; height: 48px; font-size: 2rem; line-height: 1; cursor: pointer; }
.lightbox button:hover { background: var(--carolina-deep); }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
.lb-download { position: fixed; bottom: 16px; right: 16px; color: #fff; font-weight: 600; }

/* ---------- Legacy ---------- */
.legacy { background: linear-gradient(180deg, #fff, var(--carolina-pale)); text-align: center; }
.legacy .ribbon { display: flex; justify-content: center; margin-bottom: .5rem; }
.legacy h2 .script { color: var(--purple); }
.give { margin: 2rem 0; }
.give-btn { background: var(--purple); color: #fff; font-size: 1.1rem; padding: 1rem 2rem; }
.give-btn:hover { background: #5f3a8f; color: #fff; }
.give-note { color: var(--muted); margin-top: .8rem; }
.mail-gift { display: inline-block; text-align: left; background: #fff; border-left: 5px solid var(--purple); border-radius: 8px; padding: 1rem 1.4rem; box-shadow: var(--shadow); }
.mail-gift p { margin: 0; }

/* ---------- Support tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-top: 1.5rem; }
.tile { background: #fff; border-radius: var(--radius); padding: 1.4rem 1.6rem; box-shadow: var(--shadow); border-left: 6px solid var(--carolina-deep); }
.tile h3 { font-size: 1.15rem; }
.tile p { margin: 0 0 .6rem; }
.tile a { font-weight: 600; }

/* ---------- Footer ---------- */
.footer { text-align: center; padding: 48px 16px; border-top: 4px solid var(--navy); }
.footer p { display: inline-block; background: #fff; margin: 0; padding: .2rem 1.2rem; }
.footer .script { font-size: clamp(2rem, 5vw, 2.8rem); color: var(--navy); border-radius: 8px 8px 0 0; }
.footer .small { display: block; width: fit-content; margin: 0 auto; color: var(--muted); border-radius: 0 0 8px 8px; padding-bottom: .5rem; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav ul { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 0; background: var(--navy); border-bottom: 4px solid var(--carolina); }
  .nav ul.open { display: flex; }
  .nav ul a { display: block; padding: .9rem 16px; border-top: 1px solid rgba(255,255,255,.1); }
  .hero-card { grid-template-columns: 1fr; outline-offset: -8px; }
  .portrait { max-width: 280px; margin: 0 auto; }
  .services, .tiles { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .btn, .thumb { transition: none; } }
