:root {
  color-scheme: light;
  font-family: "Crimson Text", serif;
  background: #f5f4ef;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Crimson Text", serif;
  color: #111;
  background:
    radial-gradient(circle at center, rgba(0, 0, 0, 0.03), transparent 45%),
    #f5f4ef;
  overflow-x: hidden;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: -35%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.08;
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='.9'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

a:focus-visible {
  outline: 2px solid #111;
  outline-offset: 3px;
}

/* Homepage */
.home-page {
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-y: auto;
}

.home-page::before {
  opacity: 0.1;
  animation: grain-drift 7s steps(9) infinite;
  will-change: transform;
}

.home-page .page {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 24px;
  text-align: center;
}

.logo {
  position: relative;
  width: min(950px, 90vw);
  margin: 0 auto 16px;
  animation: logo-drift 8s ease-in-out infinite;
  isolation: isolate;
}

.logo img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  max-height: 40vh;
  height: auto;
  object-fit: contain;
  filter: contrast(1.04) drop-shadow(1px 2px 0 rgba(17, 17, 17, 0.08));
}

.logo::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(245, 244, 239, 0.95) 0 0.7px, transparent 1px),
    radial-gradient(circle, rgba(245, 244, 239, 0.7) 0 0.55px, transparent 0.9px);
  background-size: 7px 7px, 11px 11px;
  background-position: 0 0, 3px 4px;
  -webkit-mask: url("lscoimg.png") center / contain no-repeat;
  mask: url("lscoimg.png") center / contain no-repeat;
  opacity: 0.28;
  mix-blend-mode: screen;
  animation: logo-sand-shift 3.8s steps(10) infinite;
  will-change: background-position, opacity;
}

.home-portrait {
  position: relative;
  width: clamp(140px, 13vw, 180px);
  aspect-ratio: 1;
  margin: 0 auto 24px;
  overflow: hidden;
  border: 2px solid rgba(17, 17, 17, 0.82);
  border-radius: 50%;
  background: #ebe9e2;
  box-shadow: 0 10px 28px rgba(17, 17, 17, 0.1);
  animation: portrait-drift 7s ease-in-out infinite;
}

.home-portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 57%;
  filter: saturate(0.88) contrast(1.04);
}

.home-portrait::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background-image: radial-gradient(circle, rgba(245, 244, 239, 0.5) 0 0.6px, transparent 0.9px);
  background-size: 8px 8px;
  opacity: 0.22;
  mix-blend-mode: screen;
  animation: portrait-sand-shift 4s steps(9) infinite;
}

.home-introduction {
  width: min(760px, calc(100% - 32px));
  margin: 0 auto 34px;
}

.home-introduction p {
  margin: 0;
}

.home-statement {
  font-size: clamp(1.05rem, 1.8vw, 1.3rem);
  line-height: 1.6;
}

.home-schedule {
  margin-top: 18px !important;
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  font-style: italic;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.home-live-links {
  margin-top: 8px !important;
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  font-style: italic;
}

.home-live-links a {
  color: #111;
  text-decoration: none;
}

.text-arrow::after {
  content: "\00a0\2197\fe0e";
  font-family: "Crimson Text", "Times New Roman", serif;
  font-style: normal;
  font-variant-emoji: text;
}

nav {
  max-width: 1500px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 22px 34px;
}

nav a {
  color: #111;
  text-decoration: none;
  font-size: 1.35rem;
  font-style: italic;
  letter-spacing: 1px;
  padding: 6px 14px;
  border: 3px solid transparent;
  border-radius: 6px;
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

nav a:hover,
nav a:focus-visible {
  border-color: #111;
  background: rgba(255, 255, 255, 0.35);
  outline: none;
}

.sand-letter {
  display: inline-block;
  animation: letter-drift var(--duration, 3.2s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
  transform-origin: 50% 70%;
}

.sand-visual {
  display: inline;
}

.sand-word {
  display: inline-block;
  white-space: nowrap;
}

.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;
}

.sand-v0 { --duration: 2.70s; --delay: -0.15s; --drift-x: 0.65px; --drift-x-reverse: -0.65px; }
.sand-v1 { --duration: 2.87s; --delay: -0.54s; --drift-x: -0.65px; --drift-x-reverse: 0.65px; }
.sand-v2 { --duration: 3.04s; --delay: -0.93s; --drift-x: 0.55px; --drift-x-reverse: -0.55px; }
.sand-v3 { --duration: 3.21s; --delay: -1.32s; --drift-x: -0.55px; --drift-x-reverse: 0.55px; }
.sand-v4 { --duration: 3.38s; --delay: -1.71s; --drift-x: 0.75px; --drift-x-reverse: -0.75px; }
.sand-v5 { --duration: 3.55s; --delay: -2.10s; --drift-x: -0.75px; --drift-x-reverse: 0.75px; }
.sand-v6 { --duration: 3.72s; --delay: -2.49s; --drift-x: 0.45px; --drift-x-reverse: -0.45px; }
.sand-v7 { --duration: 3.89s; --delay: -2.88s; --drift-x: -0.45px; --drift-x-reverse: 0.45px; }

nav a:hover .sand-letter,
nav a:focus-visible .sand-letter,
.action-link:hover .sand-letter,
.action-link:focus-visible .sand-letter,
.back:hover .sand-letter,
.back:focus-visible .sand-letter {
  animation-duration: 0.7s;
}

/* Interior pages */
.content-page {
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-y: auto;
}

.content-page .page {
  position: relative;
  z-index: 1;
  width: min(700px, calc(100% - 60px));
  padding: 60px 0;
}

.content-page h1 {
  margin: 0 0 40px;
  font-size: 3rem;
  font-weight: normal;
  font-style: italic;
}

.content-page p {
  margin: 0 0 28px;
  font-size: 1.15rem;
  line-height: 2;
}

.back,
.action-link {
  display: inline-block;
  color: #111;
  text-decoration: none;
  font-style: italic;
  border: 2px solid transparent;
  transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

.back {
  margin-top: 30px;
  padding: 6px 12px;
}

.action-link {
  padding: 12px 18px;
  border-color: #111;
}

.action-page .back {
  margin-top: 48px;
}

.action-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.back:hover,
.back:focus-visible,
.action-link:hover,
.action-link:focus-visible {
  color: #f5f4ef;
  background: #111;
  border-color: #111;
  outline: none;
}

/* Error page */
.error-page {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
}

.error-message {
  position: relative;
  z-index: 1;
  max-width: 540px;
}

.error-message .error-code {
  margin: 0 0 12px;
  font-size: 1rem;
  font-style: italic;
  letter-spacing: 0.12em;
}

.error-message h1 {
  margin: 0 0 24px;
  font-size: clamp(2.2rem, 8vw, 4rem);
  font-weight: normal;
  font-style: italic;
}

.error-message p {
  font-size: 1.15rem;
  line-height: 1.8;
}

@keyframes grain-drift {
  0% { transform: translate3d(-2%, -1%, 0) rotate(0deg); }
  20% { transform: translate3d(2%, 1%, 0) rotate(0.25deg); }
  40% { transform: translate3d(-1%, 2%, 0) rotate(-0.2deg); }
  60% { transform: translate3d(3%, -2%, 0) rotate(0.15deg); }
  80% { transform: translate3d(-2%, 1%, 0) rotate(-0.25deg); }
  100% { transform: translate3d(-2%, -1%, 0) rotate(0deg); }
}

@keyframes logo-drift {
  0%, 100% {
    transform: translate3d(0, 0, 0) rotate(-0.08deg);
  }
  50% {
    transform: translate3d(0, -3px, 0) rotate(0.08deg);
  }
}

@keyframes logo-sand-shift {
  0%, 100% { background-position: 0 0, 3px 4px; opacity: 0.22; }
  25% { background-position: 10px -7px, -5px 12px; opacity: 0.34; }
  50% { background-position: -8px 13px, 14px -6px; opacity: 0.25; }
  75% { background-position: 15px 5px, -11px -9px; opacity: 0.31; }
}

@keyframes portrait-drift {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, -3px, 0); }
}

@keyframes portrait-sand-shift {
  0%, 100% { background-position: 0 0; opacity: 0.18; }
  50% { background-position: 12px -8px; opacity: 0.28; }
}

@keyframes letter-drift {
  0%, 100% {
    transform: translate3d(0, 0, 0) rotate(0deg);
    opacity: 1;
    text-shadow: 0 0 0 rgba(17, 17, 17, 0);
  }
  30% {
    transform: translate3d(var(--drift-x, 0.5px), -0.6px, 0) rotate(0.35deg);
    opacity: 0.88;
    text-shadow: -0.6px 0.5px 0 rgba(17, 17, 17, 0.22);
  }
  65% {
    transform: translate3d(var(--drift-x-reverse, -0.5px), 0.5px, 0) rotate(-0.3deg);
    opacity: 0.96;
    text-shadow: 0.6px -0.4px 0 rgba(17, 17, 17, 0.15);
  }
}

@media (max-width: 800px) {
  .home-page .page {
    padding: 24px 14px;
  }

  .logo {
    width: 96vw;
    margin-bottom: 18px;
  }

  .logo img {
    max-height: 38vh;
  }

  .home-portrait {
    width: clamp(132px, 38vw, 175px);
    margin-bottom: 24px;
  }

  .home-introduction {
    width: min(100% - 18px, 620px);
    margin-bottom: 28px;
  }

  .home-statement {
    line-height: 1.5;
  }

  nav {
    gap: 12px 18px;
  }

  nav a {
    font-size: 1rem;
  }

  .content-page .page {
    width: min(100% - 40px, 700px);
    padding: 40px 0;
  }

  .content-page h1 {
    font-size: 2rem;
  }

  .content-page p {
    font-size: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-page::before,
  .logo,
  .logo::after,
  .home-portrait,
  .home-portrait::after,
  .sand-letter {
    animation: none;
  }
}
