:root {
  --paper: #f4f1ea;
  --paper-quiet: #ebe7dc;
  --ink: #22201d;
  --ink-muted: #6c665d;
  --earth: #8e6f50;
  --water: #536f7c;
  --moss: #6f7760;
  --line: rgba(62, 68, 59, 0.2);
  --active: #3c4f57;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 20%, rgba(255, 255, 255, 0.72), transparent 34%),
    linear-gradient(135deg, var(--paper), #f9f7f1 48%, var(--paper-quiet));
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  opacity: 0.34;
  background-image:
    linear-gradient(rgba(47, 42, 36, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47, 42, 36, 0.025) 1px, transparent 1px);
  background-size: 38px 38px, 38px 38px;
  mix-blend-mode: multiply;
}

#territory-canvas {
  position: fixed;
  inset: 0;
  display: block;
  width: 100vw;
  height: 100vh;
}

.site-menu {
  position: fixed;
  top: clamp(1rem, 2.5vw, 2.2rem);
  left: clamp(1rem, 3vw, 2.8rem);
  z-index: 35;
}

.menu-button,
.subscription-submit,
.subscription-close {
  font: inherit;
}

.menu-button {
  border: 1px solid rgba(60, 79, 87, 0.38);
  border-radius: 999px;
  padding: 0.52rem 0.82rem;
  background: rgba(244, 241, 234, 0.72);
  color: var(--active);
  cursor: pointer;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(0.6rem, 0.82vw, 0.72rem);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  box-shadow: 0 0 18px rgba(244, 241, 234, 0.62);
  transition:
    background 240ms ease,
    border-color 240ms ease,
    color 240ms ease;
}

.menu-button:hover,
.menu-button:focus-visible {
  border-color: rgba(177, 40, 32, 0.45);
  background: rgba(249, 247, 241, 0.92);
  color: #b12820;
  outline: none;
}

.compass-rose {
  position: fixed;
  top: clamp(1.15rem, 3vw, 2.6rem);
  right: clamp(1.1rem, 3vw, 2.8rem);
  z-index: 30;
  width: clamp(4.4rem, 8vw, 7.2rem);
  height: clamp(4.4rem, 8vw, 7.2rem);
  color: rgba(60, 79, 87, 0.72);
  opacity: 0.78;
  pointer-events: none;
  isolation: isolate;
  filter: drop-shadow(0 0 12px rgba(244, 241, 234, 0.88));
  animation: compass-float 9200ms ease-in-out infinite;
}

.compass-rose svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.compass-ring,
.compass-axis {
  fill: none !important;
  stroke: currentColor;
  stroke-width: 1.1;
}

.compass-ring-inner,
.compass-axis-soft {
  opacity: 0.44;
  stroke-width: 0.75;
}

.compass-card {
  fill: rgba(60, 79, 87, 0.12);
  stroke: rgba(60, 79, 87, 0.28);
  stroke-width: 0.75;
}

.compass-needle {
  transform: rotate(45deg);
  transform-origin: 60px 60px;
  fill: rgba(177, 40, 32, 0.54);
  stroke: rgba(87, 58, 50, 0.62);
  stroke-width: 0.8;
}

.compass-needle circle {
  fill: rgba(244, 241, 234, 0.9);
}

.compass-rose text {
  fill: rgba(60, 79, 87, 0.68);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.compass-mobile-label {
  display: none;
}

@keyframes compass-float {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }

  50% {
    transform: translate3d(-0.18rem, 0.28rem, 0);
  }
}

.site-shell {
  position: relative;
  z-index: 2;
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(1.2rem, 1fr) minmax(0, 62rem) minmax(11rem, 20rem) minmax(1.2rem, 1fr);
  align-items: center;
  gap: clamp(1.5rem, 4vw, 5rem);
  padding: clamp(1.25rem, 3vw, 3rem) 0;
}

.statement {
  grid-column: 2;
  max-width: 60rem;
}

.time-marker {
  max-width: 34rem;
  margin: 0 0 0.85rem;
  color: var(--active);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(0.58rem, 0.86vw, 0.74rem);
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.35;
  text-align: left;
  text-shadow:
    0 0 10px rgba(244, 241, 234, 0.88),
    0 0 18px rgba(244, 241, 234, 0.72);
  text-transform: uppercase;
}

.kicker {
  margin: 0 0 clamp(2rem, 5vh, 4.2rem);
  color: var(--ink-muted);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(0.68rem, 1.2vw, 0.78rem);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  max-width: 100%;
  margin: 0;
  font-size: var(--statement-font-size, 10.6rem);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0;
}

h1.is-long-text {
  line-height: 1.35;
}

.statement-footer {
  display: grid;
  gap: 0.22rem;
  margin-top: clamp(1.8rem, 4vh, 3.2rem);
  color: var(--active);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(0.62rem, 0.9vw, 0.78rem);
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.35;
  text-transform: uppercase;
  text-shadow:
    0 0 10px rgba(244, 241, 234, 0.88),
    0 0 18px rgba(244, 241, 234, 0.72);
}

h1 > span {
  display: block;
  opacity: 0;
  transform: translateY(0.55em);
  filter: blur(8px);
  transition:
    opacity 1800ms ease,
    transform 1800ms cubic-bezier(0.19, 1, 0.22, 1),
    filter 1800ms ease;
}

h1 > span.is-visible {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

h1 > span.is-flickering {
  animation: text-flicker 720ms steps(1, end);
}

h1 > span.is-hiding {
  opacity: 0;
  transform: translateY(-0.18em);
  filter: blur(12px);
}

h1 > span.is-phrase-flickering {
  animation: phrase-flicker 420ms steps(1, end) 3;
}

h1 > span.is-interfering {
  animation: text-interference 1100ms steps(2, end);
}

.char {
  display: inline-block;
  opacity: 1;
  transform: translate(0, 0);
  transition:
    opacity 360ms ease,
    transform 520ms cubic-bezier(0.19, 1, 0.22, 1),
    filter 360ms ease;
  will-change: opacity, transform, filter;
}

.char.is-glitching {
  animation: char-interference 260ms steps(2, end) infinite;
}

.char.is-hidden {
  opacity: 0;
  transform: translateY(-0.42em) scale(0.92);
  filter: blur(9px);
}

@keyframes text-flicker {
  0%,
  100% {
    opacity: 1;
    filter: blur(0);
  }

  12% {
    opacity: 0.46;
    filter: blur(3px);
  }

  21% {
    opacity: 0.92;
    filter: blur(0.5px);
  }

  33% {
    opacity: 0.62;
    filter: blur(2px);
  }

  49% {
    opacity: 1;
    filter: blur(0);
  }

  64% {
    opacity: 0.72;
    filter: blur(1.5px);
  }

  78% {
    opacity: 0.96;
    filter: blur(0);
  }
}

@keyframes phrase-flicker {
  0%,
  100% {
    opacity: 1;
    filter: blur(0);
  }

  22% {
    opacity: 0.22;
    filter: blur(6px);
  }

  36% {
    opacity: 1;
    filter: blur(0);
  }

  62% {
    opacity: 0.4;
    filter: blur(3px);
  }

  76% {
    opacity: 0.94;
    filter: blur(0);
  }
}

@keyframes text-interference {
  0%,
  100% {
    transform: translateY(0);
    filter: blur(0);
    text-shadow: none;
  }

  18% {
    transform: translateX(-0.018em);
    filter: blur(1.5px);
    text-shadow: 0.045em 0 rgba(83, 111, 124, 0.24);
  }

  44% {
    transform: translateX(0.024em);
    filter: blur(0.5px);
    text-shadow: -0.035em 0 rgba(142, 111, 80, 0.2);
  }

  71% {
    transform: translateX(-0.012em);
    filter: blur(2px);
    text-shadow:
      0.026em 0 rgba(83, 111, 124, 0.18),
      -0.02em 0 rgba(142, 111, 80, 0.16);
  }
}

@keyframes char-interference {
  0%,
  100% {
    transform: translate(0, 0);
    opacity: 1;
  }

  35% {
    transform: translate(-0.08em, 0.03em);
    opacity: 0.55;
  }

  68% {
    transform: translate(0.06em, -0.02em);
    opacity: 0.86;
  }
}

.route-panel {
  position: relative;
  z-index: 3;
  grid-column: 3;
  justify-self: start;
  width: min(100%, 21rem);
  margin: 26vh 0 0;
}

.route-clock {
  display: block;
  margin: 0 0 1.05rem;
  color: #b12820;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(1.08rem, 1.56vw, 1.36rem);
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1;
  text-shadow:
    0 0 10px rgba(244, 241, 234, 0.9),
    0 0 18px rgba(244, 241, 234, 0.72);
}

.route-list {
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--ink-muted);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(0.54rem, 0.78vw, 0.68rem);
  font-weight: 600;
  letter-spacing: 0.1em;
  line-height: 1.45;
  text-shadow:
    0 0 10px rgba(244, 241, 234, 0.9),
    0 0 18px rgba(244, 241, 234, 0.7);
  text-transform: uppercase;
}

.route-list li {
  position: relative;
  margin: 0 0 0.48rem;
  opacity: 0;
  transform: translateX(-0.8rem);
  transition:
    opacity 1300ms ease,
    color 1300ms ease,
    transform 1300ms cubic-bezier(0.19, 1, 0.22, 1);
}

.route-list li[data-depth="0"] {
  color: var(--active);
  font-weight: 700;
}

.route-list li[data-depth="0"]:not(:first-child) {
  margin-top: 0.72rem;
}

.route-list li[data-depth="1"] {
  margin-left: 0.9rem;
}

.route-list li[data-depth="2"] {
  margin-left: 1.75rem;
}

.route-list li::before {
  position: absolute;
  top: 0.62em;
  left: -1.35rem;
  width: 0.5rem;
  height: 0.5rem;
  border: 1px solid currentColor;
  border-radius: 50%;
  content: "";
  opacity: 0.7;
}

.route-list li.is-visible {
  opacity: 0.72;
  transform: translateX(0);
}

.route-list li.is-current {
  color: var(--active);
  opacity: 1;
}

.subscription-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 1.2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms ease;
}

.subscription-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.subscription-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(34, 32, 29, 0.22);
  backdrop-filter: blur(5px);
}

.subscription-dialog {
  position: relative;
  width: min(100%, 31rem);
  padding: clamp(1.25rem, 4vw, 2rem);
  border: 1px solid rgba(60, 79, 87, 0.28);
  background: rgba(244, 241, 234, 0.94);
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(34, 32, 29, 0.18);
}

.subscription-close {
  position: absolute;
  top: 0.62rem;
  right: 0.72rem;
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
  font-size: 1.8rem;
  line-height: 1;
}

.subscription-kicker {
  margin: 0 0 0.7rem;
  color: var(--ink-muted);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.subscription-dialog h2 {
  margin: 0 2rem 1.4rem 0;
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 500;
  line-height: 1;
}

.subscription-form {
  display: grid;
  gap: 1rem;
}

.subscription-form label {
  display: grid;
  gap: 0.36rem;
  color: var(--active);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.subscription-form input[type="text"],
.subscription-form input[type="email"] {
  width: 100%;
  border: 1px solid rgba(60, 79, 87, 0.3);
  border-radius: 0;
  padding: 0.72rem 0.78rem;
  background: rgba(255, 255, 255, 0.46);
  color: var(--ink);
  font: 600 1rem/1.2 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.subscription-form input:focus-visible {
  border-color: rgba(177, 40, 32, 0.66);
  outline: 2px solid rgba(177, 40, 32, 0.18);
  outline-offset: 2px;
}

.subscription-consent {
  display: flex !important;
  grid-template-columns: none;
  align-items: start;
  gap: 0.58rem !important;
  color: var(--ink-muted) !important;
  letter-spacing: 0.04em !important;
  line-height: 1.35;
  text-transform: none !important;
}

.subscription-consent input {
  margin-top: 0.1rem;
}

.subscription-honeypot {
  position: absolute;
  left: -100vw;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.subscription-submit {
  border: 1px solid rgba(177, 40, 32, 0.52);
  padding: 0.82rem 1rem;
  background: #b12820;
  color: #fffaf2;
  cursor: pointer;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.subscription-submit:disabled {
  cursor: wait;
  opacity: 0.62;
}

.subscription-status {
  min-height: 1.2em;
  margin: 0;
  color: var(--active);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.35;
}

@media (max-width: 780px) {
  body {
    overflow: auto;
  }

  .site-shell {
    min-height: 100svh;
    grid-template-columns: minmax(1rem, 1fr) minmax(0, 92vw) minmax(1rem, 1fr);
    align-content: center;
    gap: 2rem;
  }

  .compass-rose {
    top: 1rem;
    right: 1rem;
    width: 4.2rem;
    height: 4.2rem;
    min-width: 4.2rem;
    min-height: 4.2rem;
    color: rgba(34, 32, 29, 0.82);
    opacity: 0.82;
  }

  .site-menu {
    top: auto;
    right: 1rem;
    bottom: 1rem;
    left: auto;
  }

  .menu-button {
    padding: 0.58rem 0.78rem;
    background: rgba(244, 241, 234, 0.9);
  }

  .compass-rose svg {
    display: none;
  }

  .compass-rose::before {
    position: absolute;
    inset: 0.62rem;
    border: 1.6px solid rgba(60, 79, 87, 0.72);
    border-radius: 50%;
    background:
      linear-gradient(90deg, transparent calc(50% - 0.8px), rgba(60, 79, 87, 0.68) calc(50% - 0.8px), rgba(60, 79, 87, 0.68) calc(50% + 0.8px), transparent calc(50% + 0.8px)),
      linear-gradient(0deg, transparent calc(50% - 0.8px), rgba(60, 79, 87, 0.68) calc(50% - 0.8px), rgba(60, 79, 87, 0.68) calc(50% + 0.8px), transparent calc(50% + 0.8px));
    content: "";
  }

  .compass-rose::after {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0.55rem;
    height: 2.7rem;
    background: linear-gradient(180deg, rgba(177, 40, 32, 0.72), rgba(177, 40, 32, 0.18));
    clip-path: polygon(50% 0, 100% 48%, 56% 100%, 44% 100%, 0 48%);
    content: "";
    transform: translate(-50%, -50%) rotate(45deg);
    transform-origin: center;
  }

  .compass-mobile-label {
    position: absolute;
    display: block;
    color: rgba(34, 32, 29, 0.82);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1;
  }

  .compass-mobile-label-n {
    top: -0.08rem;
    left: 50%;
    transform: translateX(-50%);
  }

  .compass-mobile-label-e {
    top: 50%;
    right: -0.08rem;
    transform: translateY(-50%);
  }

  .compass-mobile-label-s {
    bottom: -0.08rem;
    left: 50%;
    transform: translateX(-50%);
  }

  .compass-mobile-label-o {
    top: 50%;
    left: -0.08rem;
    transform: translateY(-50%);
  }

  .compass-ring,
  .compass-axis {
    stroke-width: 2;
  }

  .compass-ring-inner,
  .compass-axis-soft {
    stroke-width: 1.35;
  }

  .compass-card,
  .compass-needle {
    stroke-width: 1.15;
  }

  .compass-rose text {
    font-size: 12px;
  }

  .statement,
  .route-panel {
    grid-column: 2;
  }

  h1 {
    max-width: 100%;
    line-height: 1.35;
  }

  h1.is-long-text {
    line-height: 1.35;
  }

  .statement-footer {
    margin-top: 1.5rem;
    font-size: clamp(0.5rem, 2vw, 0.64rem);
    letter-spacing: 0.07em;
  }

  .time-marker {
    max-width: 34ch;
    margin-bottom: 0.7rem;
    font-size: clamp(0.5rem, 1.8vw, 0.64rem);
    letter-spacing: 0.08em;
  }

  .route-panel {
    width: auto;
    margin: 2.5rem 0 0 1.35rem;
  }

  .route-clock {
    font-size: clamp(1.02rem, 4.8vw, 1.36rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .compass-rose {
    animation: none;
  }

  h1 > span,
  .route-list li {
    transition-duration: 1ms;
  }

  h1 > span.is-flickering,
  h1 > span.is-phrase-flickering,
  h1 > span.is-interfering,
  .char.is-glitching {
    animation: none;
  }
}
