/* LMNOP site shell — shared atmosphere, header, footer */
:root {
  --morph: 0;
  --sunset: 0;
  --flash: 0;
  --ink: #111111;
  --paper: #ffffff;
  --mute: #444444;
  --line: #111111;
  --accent: #6e1423;
  --soft: #dddddd;
  --foot: #666666;
  --pad-x: max(20px, env(safe-area-inset-left));
  --pad-r: max(20px, env(safe-area-inset-right));
  --pad-b: max(14px, env(safe-area-inset-bottom));
  --pad-t: max(12px, env(safe-area-inset-top));
}

canvas#field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: calc(var(--morph) * 0.45);
}

.grade {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(
      ellipse 90% 70% at 70% 18%,
      rgba(110, 20, 35, calc(var(--morph) * 0.1)),
      transparent 55%
    ),
    linear-gradient(
      180deg,
      rgba(255, 255, 255, calc(1 - var(--morph) * 0.75)) 0%,
      rgba(232, 228, 220, calc(var(--morph) * 0.28)) 50%,
      rgba(18, 17, 15, calc(var(--morph) * 0.32)) 100%
    );
  mix-blend-mode: multiply;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: calc(var(--morph) * 0.12);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

.sunset {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: calc(var(--sunset) + var(--flash) * 0.65);
  background:
    radial-gradient(
      ellipse 70% 55% at 50% 42%,
      rgba(255, 248, 230, 0.95) 0%,
      rgba(255, 196, 110, 0.55) 28%,
      rgba(196, 78, 42, 0.28) 52%,
      rgba(80, 24, 18, 0.12) 72%,
      transparent 100%
    ),
    linear-gradient(
      105deg,
      rgba(40, 18, 12, 0.15) 0%,
      rgba(255, 170, 70, 0.25) 42%,
      rgba(255, 245, 220, 0.55) 58%,
      rgba(210, 90, 40, 0.22) 78%,
      rgba(30, 12, 10, 0.18) 100%
    );
  mix-blend-mode: screen;
  filter: blur(calc(10px + var(--sunset) * 20px));
  transform: scale(1.06);
}

body[data-shell*="no-sunset"] .sunset,
body[data-shell*="no-sunset"] .sunset-cast {
  display: none !important;
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(
    ellipse 78% 68% at 50% 42%,
    transparent 38%,
    rgba(18, 14, 12, calc(var(--morph) * 0.16 + var(--sunset) * 0.08 + var(--flash) * 0.1)) 100%
  );
}

::selection {
  background: rgba(110, 20, 35, 0.18);
  color: #111;
}

/* Shared site header — stationery rule, LMNOP | accent action */
.site-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 48px;
  padding: 0;
  border-bottom: 1.5px solid var(--line);
  margin-top: 2px;
  flex-shrink: 0;
  position: relative;
  z-index: 5;
  background: transparent;
}

.site-top a {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  line-height: 1.2;
  text-decoration: none;
  padding: 14px 0;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  color: inherit;
}

.site-top a.brand {
  color: var(--ink);
}

.site-top a.action {
  color: var(--accent);
  border-bottom: 1.5px solid var(--accent);
  padding-bottom: 12px;
  margin-bottom: -1px;
}

.site-top a.action[hidden] {
  display: none !important;
}

.site-top .site-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

/* Shared site footer — legal + partners (omit on deck) */
.site-foot {
  flex-shrink: 0;
  width: 100%;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--soft);
  position: relative;
  z-index: 5;
}

.site-foot .legal {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 8px;
  line-height: 1.45;
  color: var(--foot);
  letter-spacing: 0.01em;
}

.site-foot .partners {
  margin-top: 4px;
  text-align: center;
}

.site-foot .partners a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  font-family: Helvetica, Arial, sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1.5px solid var(--accent);
  padding: 10px 1px 6px;
  transition: opacity 0.25s ease;
}

.site-foot .partners a:hover {
  opacity: 0.7;
}

@media (min-width: 720px) {
  .site-foot .legal {
    font-size: 9px;
    line-height: 1.48;
  }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --morph: 0.15 !important;
    --sunset: 0 !important;
    --flash: 0 !important;
  }
}
