:root {
  color-scheme: dark;
  --black: #050806;
  --green: #0a1a12;
  --deep-green: #123a25;
  --ivory: #f1ecde;
  --muted: #a7aaa1;
  --gold: #c9a862;
  --red: #7f1622;
  --mouse-x: 50vw;
  --mouse-y: 50vh;
  font-family: "DM Sans", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--black);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ivory);
  background: var(--black);
}

a,
button {
  color: inherit;
}

button {
  font: inherit;
}

.fallback {
  display: grid;
  min-height: 100vh;
  margin: 0;
  place-items: center;
  font-family: "Instrument Serif", Georgia, serif;
}

.page {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(5, 8, 6, 0.12), rgba(5, 8, 6, 0.86)),
    var(--green);
}

.page::before {
  position: absolute;
  inset: 0;
  z-index: -2;
  content: "";
  background:
    linear-gradient(90deg, transparent 0 7.5%, rgba(0, 0, 0, 0.48) 7.5% 9%, transparent 9% 48%, rgba(127, 22, 34, 0.3) 48% 52%, transparent 52% 91%, rgba(0, 0, 0, 0.48) 91% 92.5%, transparent 92.5%),
    linear-gradient(0deg, transparent 0 7.5%, rgba(0, 0, 0, 0.5) 7.5% 9%, transparent 9% 48%, rgba(201, 168, 98, 0.09) 48% 52%, transparent 52% 91%, rgba(0, 0, 0, 0.5) 91% 92.5%, transparent 92.5%);
  background-size: 310px 310px;
  opacity: 0.72;
}

.page::after {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  content: "";
  box-shadow: inset 0 0 160px 36px rgba(0, 0, 0, 0.82);
}

.tartan {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.34;
  background:
    repeating-linear-gradient(90deg, transparent 0 77px, rgba(0, 0, 0, 0.4) 77px 82px, transparent 82px 92px, rgba(201, 168, 98, 0.08) 92px 94px),
    repeating-linear-gradient(0deg, transparent 0 77px, rgba(0, 0, 0, 0.42) 77px 82px, transparent 82px 92px, rgba(127, 22, 34, 0.28) 92px 95px);
  mix-blend-mode: multiply;
}

.pointer-light {
  position: fixed;
  top: 0;
  left: 0;
  z-index: -1;
  width: 620px;
  height: 620px;
  pointer-events: none;
  background: radial-gradient(circle, rgba(201, 168, 98, 0.1), transparent 66%);
  transform: translate(calc(var(--mouse-x) - 310px), calc(var(--mouse-y) - 310px));
  transition: opacity 500ms ease;
}

.hero-meta,
.footer {
  letter-spacing: 0.18em;
}

.hero {
  position: relative;
  display: grid;
  min-height: 100svh;
  align-items: center;
  justify-items: center;
  padding: 100px clamp(16px, 4vw, 64px) 88px;
}

.title {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  width: max-content;
  margin: 0;
  align-items: baseline;
  color: rgba(241, 236, 222, 0.68);
  font-family: "Instrument Serif", Georgia, serif;
  font-size: clamp(4.8rem, 15.4vw, 13.5rem);
  font-weight: 400;
  line-height: 0.72;
  letter-spacing: 0;
  white-space: nowrap;
  text-shadow: 0 18px 44px rgba(0, 0, 0, 0.42);
  transform: translate(-50%, -50%);
}

.title span {
  display: inline-block;
  opacity: 0;
  transform: translateY(38px);
  transition: opacity 1.2s ease, transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.title .title-greig {
  transition-delay: 220ms;
}

.title .title-dot {
  color: rgba(201, 168, 98, 0.72);
  transition-delay: 360ms;
}

.title .title-org {
  transition-delay: 440ms;
}

.is-loaded .title span {
  opacity: 1;
  transform: none;
}

.seal-wrap {
  position: relative;
  z-index: 2;
  display: grid;
  margin-top: 1vh;
  place-items: center;
  opacity: 0;
  transform: scale(0.78) rotate(-5deg);
  transition: opacity 1s ease 620ms, transform 1.3s cubic-bezier(0.16, 1, 0.3, 1) 620ms;
}

.is-loaded .seal-wrap {
  opacity: 1;
  transform: none;
}

.seal {
  --rx: 0deg;
  --ry: 0deg;
  position: relative;
  display: grid;
  width: clamp(210px, 25vw, 370px);
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 50%;
  outline: 0;
  place-items: center;
  color: var(--ivory);
  background: transparent;
  cursor: pointer;
  perspective: 900px;
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform 180ms ease;
}

.seal:focus-visible::after {
  position: absolute;
  inset: -13px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  content: "";
}

.seal-aura {
  position: absolute;
  inset: -19%;
  border: 1px solid rgba(201, 168, 98, 0.26);
  border-radius: 50%;
  transition: transform 1.1s cubic-bezier(0.16, 1, 0.3, 1), border-color 500ms ease;
}

.seal-aura i {
  position: absolute;
  top: -4px;
  left: calc(50% - 0.5px);
  width: 1px;
  height: 8px;
  background: rgba(201, 168, 98, 0.44);
  transform-origin: 0.5px calc((clamp(210px, 25vw, 370px) * 0.69) + 4px);
}

.seal-face {
  position: relative;
  display: grid;
  width: 82%;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid rgba(255, 239, 194, 0.44);
  border-radius: 50%;
  background:
    radial-gradient(circle at 48% 38%, #b8353f 0, #8b1b28 46%, #4e0913 78%);
  box-shadow:
    0 35px 70px rgba(0, 0, 0, 0.62),
    inset 0 0 0 8px rgba(54, 5, 11, 0.32),
    inset 0 0 34px rgba(255, 194, 137, 0.22),
    0 0 0 1px rgba(0, 0, 0, 0.7);
  place-items: center;
  transform-style: preserve-3d;
  transition: box-shadow 600ms ease, transform 600ms cubic-bezier(0.16, 1, 0.3, 1);
}

.seal-face::before {
  position: absolute;
  inset: 10px;
  z-index: 1;
  border: 1px dashed rgba(255, 228, 175, 0.26);
  border-radius: 50%;
  content: "";
}

.seal-face img {
  position: relative;
  z-index: 2;
  width: 84%;
  height: 84%;
  object-fit: contain;
  filter:
    sepia(0.72)
    saturate(0.66)
    brightness(1.24)
    contrast(1.18)
    drop-shadow(0 10px 9px rgba(38, 0, 5, 0.72));
  pointer-events: none;
  user-select: none;
}

.seal-shine {
  position: absolute;
  inset: -35% 12% 40% -18%;
  z-index: 3;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.22), transparent 65%);
  pointer-events: none;
  transform: rotate(-10deg);
}

.seal:hover .seal-face {
  box-shadow:
    0 42px 82px rgba(0, 0, 0, 0.68),
    inset 0 0 0 8px rgba(54, 5, 11, 0.3),
    inset 0 0 40px rgba(255, 194, 137, 0.3),
    0 0 0 1px rgba(0, 0, 0, 0.7);
  transform: translateZ(12px);
}

.seal.is-open .seal-aura {
  border-color: rgba(201, 168, 98, 0.66);
  transform: rotate(22.5deg) scale(1.08);
}

.seal.is-open .seal-face {
  box-shadow:
    0 42px 82px rgba(0, 0, 0, 0.68),
    0 0 90px rgba(201, 168, 98, 0.16),
    inset 0 0 0 8px rgba(54, 5, 11, 0.3),
    inset 0 0 46px rgba(255, 210, 155, 0.34);
}

.motto {
  position: absolute;
  bottom: clamp(86px, 10vh, 120px);
  z-index: 3;
  display: grid;
  width: 100%;
  justify-items: center;
  pointer-events: none;
}

.motto p {
  margin: 0;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 650ms ease, transform 650ms cubic-bezier(0.16, 1, 0.3, 1);
}

.motto-gaelic {
  color: var(--gold);
  font-size: clamp(0.65rem, 1.1vw, 0.8rem);
  font-weight: 600;
  letter-spacing: 0.32em;
}

.motto-english {
  margin-top: 6px !important;
  font-family: "Instrument Serif", Georgia, serif;
  font-size: clamp(1.1rem, 2vw, 1.45rem);
  font-style: italic;
}

.motto-open .motto p {
  opacity: 1;
  transform: none;
}

.motto-open .motto-english {
  transition-delay: 90ms;
}

.hero-meta {
  position: absolute;
  bottom: 42px;
  left: 0;
  display: flex;
  width: 100%;
  justify-content: center;
  gap: clamp(22px, 6vw, 90px);
  color: rgba(241, 236, 222, 0.42);
  font-size: 0.55rem;
  font-weight: 600;
}

.footer {
  position: absolute;
  bottom: 0;
  left: 0;
  z-index: 5;
  display: flex;
  width: 100%;
  justify-content: flex-end;
  padding: 0 clamp(20px, 4.5vw, 72px) 18px;
  color: rgba(241, 236, 222, 0.34);
  font-size: 0.48rem;
  font-weight: 600;
}

.footer a {
  text-decoration: none;
  transition: color 200ms ease;
}

.footer a:hover,
.footer a:focus-visible {
  color: var(--ivory);
}

@media (max-width: 720px) {
  .title {
    top: 42%;
    flex-wrap: wrap;
    width: 100%;
    justify-content: center;
    font-size: clamp(4.7rem, 24vw, 8.2rem);
    line-height: 0.7;
  }

  .title-org {
    flex-basis: auto;
  }

  .seal-wrap {
    margin-top: 10vh;
  }

  .seal {
    width: clamp(210px, 62vw, 300px);
  }

  .seal-aura i {
    transform-origin: 0.5px calc((clamp(210px, 62vw, 300px) * 0.69) + 4px);
  }

  .motto {
    bottom: 104px;
  }

  .hero-meta {
    bottom: 58px;
    gap: 18px;
  }

  .hero-meta span:nth-child(2) {
    display: none;
  }

  .footer {
    padding-bottom: 16px;
  }

}

@media (max-height: 720px) and (min-width: 721px) {
  .seal {
    width: 240px;
  }

  .seal-aura i {
    transform-origin: 0.5px calc((240px * 0.69) + 4px);
  }

  .title {
    font-size: min(15.4vw, 10rem);
  }

  .motto {
    bottom: 82px;
  }
}

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

  .pointer-light {
    display: none;
  }
}
