@import url("https://fonts.googleapis.com/css2?family=Noto+Naskh+Arabic:wght@400;500;600;700&display=swap");

:root {
  --ivory: #f2ede3;
  --paper: #faf7f0;
  --ink: #211d1a;
  --burgundy: #68262d;
  --gold: #aa8958;
  --muted: #6f675e;
  --line: rgba(77, 59, 43, .22);
  --paper-texture:
    radial-gradient(circle at 18% 22%, rgba(91,67,48,.08) 0 .7px, transparent 1px),
    radial-gradient(circle at 71% 63%, rgba(91,67,48,.06) 0 .65px, transparent 1px),
    repeating-linear-gradient(96deg, rgba(126,97,70,.025) 0 1px, transparent 1px 7px),
    linear-gradient(135deg, #fbf9f4, #f3eee5);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--ivory); }
body {
  margin: 0;
  overflow-x: hidden;
  background: var(--ivory);
  color: var(--ink);
  font-family: "Noto Naskh Arabic", serif;
}
button { font: inherit; }
a { color: inherit; text-decoration: none; }

.film-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #0d0c0b;
  cursor: pointer;
  transition: opacity 1.1s ease, visibility 1.1s ease;
}
.film-gate--leave { opacity: 0; visibility: hidden; pointer-events: none; }
.opening-film {
  display: block;
  width: auto;
  height: 100%;
  aspect-ratio: 9 / 16;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  background: #0d0c0b;
  transition: opacity .35s ease;
}
.opening-film.film-hidden { opacity: 0; pointer-events: none; }
.parchment-film {
  position: absolute;
  inset: 0;
  display: block;
  width: auto;
  height: 100%;
  aspect-ratio: 512 / 910;
  max-width: 100%;
  max-height: 100%;
  margin: auto;
  object-fit: contain;
  object-position: center;
  opacity: 0;
  pointer-events: none;
  background: #ece9e3;
  transition: opacity .45s ease;
}
.parchment-film.film-visible { opacity: 1; }
.skip-film {
  position: absolute;
  z-index: 3;
  right: 50%;
  bottom: max(32px, calc(env(safe-area-inset-bottom) + 18px));
  width: max-content;
  max-width: calc(100% - 44px);
  padding: 11px 24px 13px;
  transform: translateX(50%);
  border: 1px solid rgba(104,38,45,.32);
  border-radius: 999px;
  color: var(--burgundy);
  background: rgba(250,247,240,.88);
  box-shadow: 0 8px 28px rgba(30,20,15,.16);
  backdrop-filter: blur(8px);
  cursor: pointer;
  font-size: 14px;
  transition: background .25s ease, transform .25s ease, opacity .25s ease;
}
.skip-film:hover { background: #fffaf1; transform: translateX(50%) translateY(-2px); }

.invitation {
  position: relative;
  min-height: 100vh;
  visibility: hidden;
  opacity: 0;
  direction: rtl;
  transition: opacity 1s ease .15s;
}
.invitation--open { visibility: visible; opacity: 1; }
.paper-grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: .55;
  pointer-events: none;
  background:
    radial-gradient(circle at 15% 25%, rgba(109,80,58,.12) 0 1px, transparent 1.4px),
    radial-gradient(circle at 75% 65%, rgba(109,80,58,.08) 0 1px, transparent 1.4px),
    linear-gradient(95deg, transparent 48%, rgba(126,97,70,.04) 50%, transparent 52%);
  background-size: 19px 19px, 27px 27px, 13px 100%;
}

.hero-section {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 28px;
}
.parchment-stage {
  position: relative;
  width: min(calc(100svh * 512 / 910), 100%);
  height: min(100svh, calc(100vw * 910 / 512));
  min-height: min(860px, 100svh);
  overflow: hidden;
  background: url("assets/parchment-open.jpg") center / contain no-repeat;
  box-shadow: 0 25px 80px rgba(54,38,28,.12);
}
.parchment-copy {
  position: absolute;
  top: 25.5%;
  right: 15%;
  bottom: 25.5%;
  left: 15%;
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}
.academic-emblem {
  position: relative;
  width: 64px;
  margin-bottom: 12px;
  color: var(--burgundy);
}
.academic-emblem::before,
.academic-emblem::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 30px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
}
.academic-emblem::before { right: calc(100% + 17px); }
.academic-emblem::after { left: calc(100% + 17px); transform: rotate(180deg); }
.academic-emblem svg { display: block; width: 100%; overflow: visible; }
.academic-emblem path,
.academic-emblem circle { fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.eyebrow, .section-kicker { margin: 0 0 22px; color: var(--burgundy); font-size: 14px; letter-spacing: .04em; }
.parchment-copy .eyebrow {
  margin-bottom: 10px;
  padding: 3px 18px 5px;
  border-block: 1px solid rgba(104,38,45,.32);
  font-size: 12px;
  font-weight: 600;
}
.inviting-line { max-width: 470px; margin: 0; font-size: clamp(19px, 3vw, 27px); line-height: 2; }
.parchment-copy .inviting-line {
  max-width: 355px;
  font-size: clamp(15px, 2.05vw, 19px);
  font-weight: 500;
  line-height: 1.75;
}
.ornament, .small-rule, .message-ornament { display: flex; align-items: center; justify-content: center; gap: 12px; width: min(270px, 72%); margin: 27px auto; color: var(--gold); }
.parchment-copy .ornament { width: min(230px, 72%); margin-block: 14px 11px; }
.ornament span, .small-rule span, .message-ornament span { height: 1px; flex: 1; background: var(--gold); opacity: .55; }
.ornament b { font-size: 8px; }
.parchment-copy h1 {
  margin: 0;
  color: var(--burgundy);
  font-size: clamp(29px, 4vw, 42px);
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}
.degree { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.scroll-cue { position: absolute; bottom: 6%; width: 24px; height: 40px; border: 1px solid rgba(104,38,45,.42); border-radius: 20px; }
.scroll-cue span { position: absolute; top: 8px; left: 50%; width: 3px; height: 3px; border-radius: 50%; background: var(--burgundy); animation: scrollDot 1.8s infinite; }
@keyframes scrollDot { 0% { opacity: 0; transform: translate(-50%,0); } 30% {opacity:1;} 100% {opacity:0; transform:translate(-50%,15px);} }

.thesis-section {
  position: relative;
  width: min(920px, calc(100% - 48px));
  min-height: 82svh;
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  margin: auto;
  padding: 120px 30px;
  text-align: center;
  background: var(--paper-texture);
}
.thesis-section h2, .details-heading h2, .venue-copy h2 {
  margin: 0;
  font-size: clamp(34px, 5.8vw, 65px);
  font-weight: 500;
  line-height: 1.65;
}
.small-rule { margin-block: 38px; }
.small-rule { font-size: 12px; }
.thesis-note { max-width: 630px; margin: 0; color: var(--muted); font-size: 17px; line-height: 2; }

.details-section {
  position: relative;
  padding: 120px 24px 145px;
  background:
    linear-gradient(rgba(239,232,220,.78), rgba(239,232,220,.78)),
    var(--paper-texture);
}
.details-heading { text-align: center; }
.details-grid {
  width: min(1000px, 100%);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 70px auto 0;
  border-block: 1px solid var(--line);
}
.details-grid article { min-height: 220px; display: flex; align-items: center; flex-direction: column; justify-content: center; padding: 30px; text-align: center; }
.details-grid article + article { border-right: 1px solid var(--line); }
.detail-icon { margin-bottom: 21px; color: var(--gold); font-size: 23px; }
.details-grid small { color: var(--burgundy); font-size: 14px; }
.details-grid strong { margin-top: 12px; font-size: 22px; font-weight: 500; }

.message-section {
  min-height: 72svh;
  display: grid;
  place-content: center;
  padding: 100px 24px;
  background:
    radial-gradient(circle at 50% 50%, rgba(170,137,88,.13), transparent 42%),
    #6a3035;
  color: #fffaf1;
  text-align: center;
}
.message-ornament { width: 170px; margin-bottom: 44px; color: #dbc29b; }
.message-ornament span { background: #dbc29b; }
.message-section blockquote { max-width: 820px; margin: 0; font-size: clamp(31px, 5vw, 55px); font-weight: 400; line-height: 1.9; }

.venue-section {
  width: min(1080px, calc(100% - 48px));
  min-height: 83svh;
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 58px;
  margin: auto;
  padding: 120px 0;
  background: var(--paper-texture);
  text-align: center;
}
.venue-copy { width: min(680px, 100%); margin: auto; }
.venue-copy > p:not(.section-kicker) { max-width: 520px; margin: 27px 0 36px; color: var(--muted); font-size: 17px; line-height: 2; }
.venue-copy > p:not(.section-kicker) { margin-inline: auto; }
.outline-button { display: inline-flex; align-items: center; gap: 18px; padding: 14px 26px; border: 1px solid var(--burgundy); color: var(--burgundy); transition: .25s ease; }
.outline-button b { font-family: sans-serif; font-weight: 400; }
.outline-button:hover { background: var(--burgundy); color: white; }
.university-logo-wrap {
  position: relative;
  width: min(210px, 48vw);
  padding-top: 30px;
  text-align: center;
}
.university-logo-wrap::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 72px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  transform: translateX(-50%);
}
.university-logo-wrap img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 10px 18px rgba(62,36,25,.10));
}

footer { padding: 110px 24px 100px; border-top: 1px solid var(--line); background: var(--paper-texture); text-align: center; }
.footer-symbol { width: 44px; height: 44px; display: grid; place-items: center; margin: 0 auto 28px; border: 1px solid var(--gold); border-radius: 50%; color: var(--burgundy); font-size: 12px; }
footer p { margin: 0 0 15px; color: var(--burgundy); font-size: 18px; }
footer h2 { margin: 0; font-size: 54px; font-weight: 500; }
footer span { display: block; margin-top: 17px; color: var(--muted); font-size: 13px; letter-spacing: .18em; }

.reveal {
  opacity: 0;
  transform: translateY(55px) scale(.985);
  filter: blur(3px);
  transition: opacity 1.05s ease, transform 1.05s cubic-bezier(.2,.75,.2,1), filter 1s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal.visible { filter: blur(0); }
.reveal > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .85s ease, transform .9s cubic-bezier(.2,.75,.2,1);
}
.reveal.visible > * { opacity: 1; transform: translateY(0); }
.reveal.visible > :nth-child(1) { transition-delay: .12s; }
.reveal.visible > :nth-child(2) { transition-delay: .27s; }
.reveal.visible > :nth-child(3) { transition-delay: .42s; }
.reveal.visible > :nth-child(4) { transition-delay: .57s; }
.thesis-section::before,
.details-section::before,
.venue-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 1px;
  height: 55px;
  background: linear-gradient(var(--gold), transparent);
  transform: translateX(-50%);
}
.parchment-copy > * { opacity: 0; transform: translateY(23px); }
.invitation--open .parchment-copy > * { animation: textReveal .85s cubic-bezier(.2,.75,.2,1) forwards; }
.invitation--open .parchment-copy > :nth-child(1) { animation-delay: .2s; }
.invitation--open .parchment-copy > :nth-child(2) { animation-delay: .35s; }
.invitation--open .parchment-copy > :nth-child(3) { animation-delay: .55s; }
.invitation--open .parchment-copy > :nth-child(4) { animation-delay: .75s; }
.invitation--open .parchment-copy > :nth-child(5) { animation-delay: .95s; }
.invitation--open .parchment-copy > :nth-child(6) { animation-delay: 1.12s; }
.invitation--open .parchment-copy > :nth-child(7) { animation-delay: 1.3s; }
@keyframes textReveal {
  from { opacity: 0; transform: translateY(23px); filter: blur(5px); }
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

@media (max-width: 700px) {
  .opening-film {
    width: min(100vw, calc(100svh * 9 / 16));
    height: min(100svh, calc(100vw * 16 / 9));
    aspect-ratio: 9 / 16;
    object-fit: contain;
    transform: none;
  }
  .parchment-film {
    width: min(100vw, calc(100svh * 512 / 910));
    height: min(100svh, calc(100vw * 910 / 512));
    aspect-ratio: 512 / 910;
    object-fit: contain;
    transform: none;
  }
  .hero-section { min-height: 100svh; padding: 0; }
  .parchment-stage {
    width: min(100vw, calc(100svh * 512 / 910));
    height: min(100svh, calc(100vw * 910 / 512));
    min-height: 0;
    box-shadow: none;
    background-size: contain;
  }
  .parchment-copy { top: 24%; right: 15%; bottom: 25%; left: 15%; }
  .academic-emblem { width: 52px; margin-bottom: 7px; }
  .academic-emblem::before, .academic-emblem::after { width: 25px; }
  .inviting-line { font-size: 19px; line-height: 1.9; }
  .parchment-copy h1 { font-size: clamp(27px, 7.7vw, 36px); }
  .parchment-copy .eyebrow { margin-bottom: 9px; }
  .parchment-copy .inviting-line { max-width: 300px; font-size: clamp(13px, 4vw, 16px); line-height: 1.7; }
  .parchment-copy .ornament { margin-block: 9px 7px; }
  .parchment-copy .degree { margin-top: 5px; }
  .scroll-cue { bottom: 5%; }
  .thesis-section { width: calc(100% - 36px); padding: 100px 18px; }
  .thesis-section h2 { font-size: 34px; line-height: 1.7; }
  .details-section { padding: 95px 20px; }
  .details-grid { grid-template-columns: 1fr; margin-top: 50px; }
  .details-grid article { min-height: 155px; }
  .details-grid article + article { border-right: 0; border-top: 1px solid var(--line); }
  .detail-icon { margin-bottom: 12px; }
  .message-section { min-height: 70svh; }
  .message-section blockquote { font-size: 31px; line-height: 1.9; }
  .venue-section { width: 100%; gap: 48px; padding: 100px 20px 85px; text-align: center; }
  .university-logo-wrap { width: min(185px, 48vw); }
  .venue-copy > p:not(.section-kicker) { margin-inline: auto; }
  footer { padding-block: 90px; }
}

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