:root {
  --paper: #f4f0e7;
  --paper-raised: #fffdf8;
  --paper-deep: #e8e0d5;
  --ink: #101112;
  --ink-soft: #4e4b46;
  --muted: #746f66;
  --line: #d7cec1;
  --line-strong: #b3a697;
  --oxblood: #9f261f;
  --oxblood-dark: #741812;
  --gold: #d7a933;
  --success: #2f795a;
  --danger: #a72727;
  --focus: #9f261f;
  --toolbar: #0c0d0e;
  --toolbar-line: #27282a;
  --text: var(--ink);
  --muted-strong: var(--ink-soft);
  --surface: var(--paper-raised);
  --surface-raised: var(--paper-raised);
  --surface-muted: var(--paper-deep);
  --border: var(--line);
  --border-soft: var(--line);
  --accent: var(--oxblood);
  --accent-strong: var(--oxblood-dark);
  --radius: 6px;
  --radius-sm: 4px;
  --shadow-soft: 0 18px 38px rgba(28, 22, 15, 0.1);
  --shadow-card: 0 8px 22px rgba(28, 22, 15, 0.08);
  --toolbar-height: 64px;
  --toast-offset: 12px;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu,
    Cantarell, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Space Grotesk", "Inter", system-ui, -apple-system,
    "Segoe UI", Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

*::selection {
  background: #ecdcae;
  color: var(--ink);
}

html {
  min-width: 320px;
  background: var(--paper);
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.5;
  color-scheme: light;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button svg,
a svg,
.route-notice svg {
  display: block;
  width: 1.2rem;
  height: 1.2rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: -80px;
  left: 16px;
  z-index: 300;
  padding: 10px 14px;
  background: var(--paper-raised);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  font-weight: 700;
  transition: top 160ms ease;
}

.skip-link:focus {
  top: 12px;
}

.site-toolbar {
  position: sticky;
  top: 0;
  z-index: 120;
  min-height: var(--toolbar-height);
  padding: 0 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--toolbar);
  color: #fff;
  border-bottom: 1px solid var(--toolbar-line);
}

.site-toolbar__brand {
  min-width: 0;
  flex: 0 1 auto;
}

.site-toolbar__actions {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.site-toolbar__page-tools {
  min-width: 0;
  display: flex;
  justify-content: flex-end;
}

.site-toolbar__right {
  flex: 0 0 auto;
}

.brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
}

.logo {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #f7f7f4;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
}

.wordmark {
  overflow: hidden;
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.96rem;
  font-weight: 750;
  letter-spacing: 0;
  text-overflow: ellipsis;
  text-transform: none;
  white-space: nowrap;
}

.session-badge {
  min-height: 38px;
  max-width: 220px;
  padding: 2px 10px 2px 2px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #424447;
  border-radius: 6px;
  color: #fff;
  text-decoration: none;
}

.session-badge:hover {
  border-color: #77797c;
}

.session-badge__avatar {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  background: #2a2c2f;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 750;
}

.session-badge__avatar svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.session-badge__text {
  min-width: 0;
  overflow: hidden;
  color: #e7e5df;
  font-size: 0.8rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-badge__cta,
.btn-primary,
.not-found__cta {
  min-height: 42px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid var(--oxblood);
  border-radius: 5px;
  background: var(--oxblood);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease;
}

.session-badge__cta {
  min-height: 36px;
  padding: 0 12px;
  border-color: #535559;
  background: transparent;
  font-size: 0.8rem;
}

.session-badge__cta:hover {
  border-color: #fff;
  background: #202123;
}

.btn-primary:hover,
.not-found__cta:hover {
  border-color: var(--oxblood-dark);
  background: var(--oxblood-dark);
}

.btn-primary:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.btn-primary svg {
  width: 18px;
  height: 18px;
}

.muted {
  color: var(--muted);
}

.route-main {
  width: min(1040px, 100%);
  margin: 0 auto;
  padding: 48px 18px 72px;
}

.route-intro {
  max-width: 680px;
  margin-bottom: 32px;
}

.route-kicker,
.eyebrow {
  margin: 0 0 7px;
  color: var(--oxblood);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: uppercase;
}

.route-intro h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1.08;
  letter-spacing: 0;
}

.route-intro > p:last-child {
  max-width: 580px;
  margin: 10px 0 0;
  color: var(--ink-soft);
}

.ceremony-list {
  display: grid;
  gap: 12px;
}

.ceremony-row {
  position: relative;
  min-height: 132px;
  display: grid;
  grid-template-columns: 106px minmax(0, 1fr) 42px;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--paper-raised);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.ceremony-row::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 4px;
  background: var(--oxblood);
}

.ceremony-row:hover {
  border-color: #817567;
  box-shadow: var(--shadow-card);
  transform: translateY(-1px);
}

.ceremony-row__year {
  height: 100%;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--paper-raised);
  font-family: var(--font-display);
  font-size: 1.42rem;
  font-weight: 700;
}

.ceremony-row__copy {
  min-width: 0;
  padding: 22px 24px;
  display: grid;
  gap: 3px;
}

.ceremony-row__meta {
  color: var(--oxblood);
  font-size: 0.68rem;
  font-weight: 750;
  text-transform: uppercase;
}

.ceremony-row__copy strong {
  font-family: var(--font-display);
  font-size: 1.35rem;
  line-height: 1.15;
}

.ceremony-row__copy small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.84rem;
}

.ceremony-row__arrow {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink-soft);
}

.ceremony-row:hover .ceremony-row__arrow {
  border-color: var(--oxblood);
  color: var(--oxblood);
}

.auth-login-page .site-toolbar__actions {
  display: none;
}

.login-page {
  min-height: calc(100vh - var(--toolbar-height));
  padding: 48px 18px 88px;
  display: grid;
  place-items: center;
  background: var(--paper);
}

.login-card {
  width: min(440px, 100%);
  padding: 38px 34px;
  display: grid;
  gap: 24px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper-raised);
  box-shadow: var(--shadow-soft);
  text-align: center;
}

.login-mark {
  width: 46px;
  height: 46px;
  margin: 0 auto;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--paper-raised);
  font-family: var(--font-display);
  font-weight: 700;
}

.login-eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
  text-transform: uppercase;
}

.login-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1.12;
  letter-spacing: 0;
}

.login-actions {
  display: flex;
  justify-content: center;
}

.login-actions .session-badge__cta {
  width: 100%;
  min-height: 50px;
  border-color: var(--oxblood);
  background: var(--oxblood);
  font-size: 0.92rem;
}

.login-actions .session-badge__cta:hover {
  border-color: var(--oxblood-dark);
  background: var(--oxblood-dark);
}

.login-cta__mark {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 3px;
  background: #fff;
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 800;
}

.account-main {
  width: min(840px, 100%);
}

.account-card {
  padding: 28px;
  display: grid;
  gap: 26px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--paper-raised);
  box-shadow: var(--shadow-card);
}

.account-card__header {
  display: flex;
  align-items: center;
  gap: 15px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.account-avatar {
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: var(--ink);
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
}

.account-card__label {
  margin: 0 0 2px;
  color: var(--oxblood);
  font-size: 0.68rem;
  font-weight: 750;
  text-transform: uppercase;
}

.account-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.28rem;
  line-height: 1.15;
}

.account-card__header .muted {
  margin: 3px 0 0;
  font-size: 0.8rem;
}

.account-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 16px;
}

.account-form .form-field:first-child,
.account-form .form-actions {
  grid-column: 1 / -1;
}

.form-field {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.form-field label {
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 700;
}

.field-help {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.form-field input,
.form-field textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  outline: 0;
  background: #fff;
  color: var(--ink);
}

.form-field input:focus,
.form-field textarea:focus {
  border-color: var(--oxblood);
  box-shadow: 0 0 0 2px rgba(159, 38, 31, 0.13);
}

.form-actions {
  padding-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
}

.form-actions .muted {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 0.8rem;
}

.account-identifier {
  color: var(--ink-soft);
  font-weight: 700;
}

.logout-form {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
}

.logout-button {
  min-height: 40px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--danger);
  font-weight: 700;
  cursor: pointer;
}

.logout-button:hover {
  border-color: #d7aaa7;
  background: #fff8f7;
}

.logout-button svg {
  width: 18px;
  height: 18px;
}

.not-found-main {
  min-height: calc(100vh - var(--toolbar-height));
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  align-items: center;
  gap: 48px;
}

.not-found__code {
  color: var(--paper-deep);
  font-family: var(--font-display);
  font-size: 8rem;
  font-weight: 700;
  line-height: 0.8;
}

.not-found__content {
  max-width: 560px;
}

.not-found__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 2.2rem;
  line-height: 1.08;
  letter-spacing: 0;
}

.not-found__summary {
  margin: 12px 0 0;
  color: var(--ink-soft);
}

.not-found__quote {
  margin: 28px 0;
  padding: 16px 0 16px 18px;
  border-left: 3px solid var(--gold);
}

.not-found__quote-text {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1rem;
  line-height: 1.45;
}

.not-found__quote-source {
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.75rem;
}

.not-found__cta svg {
  width: 18px;
  height: 18px;
}

.admin-main {
  width: min(760px, 100%);
}

.route-notice {
  min-height: 104px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--paper-raised);
}

.route-notice__icon {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: var(--ink);
  color: #fff;
}

.route-notice strong {
  font-family: var(--font-display);
}

.route-notice p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.toast-stack {
  position: fixed;
  top: calc(env(safe-area-inset-top) + var(--toolbar-height) + var(--toast-offset));
  left: 50%;
  z-index: 200;
  width: min(420px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  gap: 10px;
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  padding: 14px 16px;
  border: 1px solid #3c3d3e;
  border-radius: 6px;
  background: #151617;
  color: #fff;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.24);
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.is-dismissed {
  opacity: 0;
  transform: translateY(-8px);
}

.toast-title {
  margin: 0 0 2px;
  font-weight: 700;
}

.toast-body {
  margin: 0;
  color: #d7d3cb;
  font-size: 0.82rem;
}

.toast--danger {
  border-color: #bc4a45;
  background: #431b19;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 700px) {
  :root {
    --toolbar-height: 72px;
  }

  .site-toolbar {
    padding-right: 30px;
    padding-left: 30px;
  }

  .route-main {
    padding: 64px 30px 88px;
  }
}

@media (max-width: 699px) {
  .wordmark {
    font-size: 0.88rem;
  }

  .session-badge {
    width: 38px;
    padding: 2px;
    border-radius: 50%;
  }

  .session-badge__avatar {
    border-radius: 50%;
  }

  .session-badge__text {
    display: none;
  }

  .route-main {
    padding-top: 38px;
  }

  .route-intro {
    margin-bottom: 24px;
  }

  .route-intro h1 {
    font-size: 1.7rem;
  }

  .ceremony-row {
    min-height: 116px;
    grid-template-columns: 70px minmax(0, 1fr) 34px;
  }

  .ceremony-row__year {
    font-size: 0.98rem;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
  }

  .ceremony-row__copy {
    padding: 18px 14px;
  }

  .ceremony-row__copy strong {
    font-size: 1.08rem;
  }

  .ceremony-row__copy small {
    font-size: 0.76rem;
  }

  .ceremony-row__arrow {
    width: 30px;
    height: 30px;
  }

  .login-card {
    padding: 32px 24px;
  }

  .login-title {
    font-size: 1.75rem;
  }

  .account-card {
    padding: 22px 18px;
  }

  .account-form {
    grid-template-columns: 1fr;
  }

  .account-form .form-field:first-child,
  .account-form .form-actions {
    grid-column: auto;
  }

  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .form-actions .btn-primary {
    width: 100%;
  }

  .not-found-main {
    grid-template-columns: 1fr;
    align-content: center;
    gap: 18px;
  }

  .not-found__code {
    font-size: 5rem;
  }

  .not-found__title {
    font-size: 1.75rem;
  }
}

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