:root {
  color-scheme: dark;
  --bg: #080b09;
  --ink: #f3eadb;
  --muted: rgba(243, 234, 219, 0.62);
  --accent: #b88a4a;
  --wall-shadow: rgba(0, 0, 0, 0.58);
  --plate-a: #171a17;
  --plate-b: #0d0f0d;
  --plate-line: rgba(243, 234, 219, 0.13);
  --halo: rgba(184, 138, 74, 0.18);
  --font-body: Manrope, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Arial, sans-serif;
  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  font-family: var(--font-body);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: inherit;
  transition: background 680ms ease, color 680ms ease;
}

body.is-on {
  color-scheme: light;
  --bg: #eee7db;
  --ink: #18130e;
  --muted: rgba(24, 19, 14, 0.62);
  --accent: #8f6130;
  --wall-shadow: rgba(91, 73, 51, 0.2);
  --plate-a: #f7f2e9;
  --plate-b: #d8d0c2;
  --plate-line: rgba(24, 19, 14, 0.18);
  --halo: rgba(143, 97, 48, 0.18);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  transition: opacity 680ms ease;
}

body::before {
  opacity: 1;
  background:
    radial-gradient(circle at 50% 59%, var(--halo), transparent 18%),
    linear-gradient(120deg, #050605 0%, #0b100d 56%, #12100c 100%);
}

body::after {
  opacity: 0;
  background:
    radial-gradient(circle at 50% 58%, rgba(255, 255, 255, 0.68), transparent 21%),
    radial-gradient(circle at 18% 18%, rgba(143, 97, 48, 0.07), transparent 24%),
    linear-gradient(120deg, #f5efe5 0%, #e6dccd 100%);
}

body.is-on::before {
  opacity: 0;
}

body.is-on::after {
  opacity: 1;
}

h1,
p {
  margin-top: 0;
}

.switch-page {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: clamp(18px, 5vw, 70px);
  isolation: isolate;
}

.wall-switch {
  position: relative;
  z-index: 3;
  width: clamp(54px, 5vw, 72px);
  height: clamp(128px, 17svh, 172px);
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  transform: translateY(9svh);
  -webkit-tap-highlight-color: transparent;
}

.switch-plate {
  position: absolute;
  inset: 0;
  display: block;
  border: 1px solid var(--plate-line);
  border-radius: inherit;
  overflow: hidden;
  background:
    linear-gradient(100deg, rgba(255, 255, 255, 0.12), transparent 28%, rgba(0, 0, 0, 0.12) 78%),
    linear-gradient(180deg, var(--plate-a), var(--plate-b));
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.18),
    inset 0 -12px 32px rgba(0, 0, 0, 0.16),
    16px 22px 58px var(--wall-shadow);
  transition:
    background 680ms ease,
    border-color 680ms ease,
    box-shadow 680ms ease,
    transform 360ms ease;
}

.wall-switch:active .switch-plate {
  transform: scale(0.985);
}

.switch-half {
  position: absolute;
  left: 0;
  width: 100%;
  height: 50%;
  transition: transform 520ms cubic-bezier(0.22, 1, 0.36, 1);
}

.switch-half--top {
  top: 0;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.16), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(0, 0, 0, 0.08));
  transform: translateY(1.2%);
}

.switch-half--bottom {
  bottom: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(340deg, rgba(255, 255, 255, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.18));
  transform: translateY(-1.2%);
}

body.is-on .switch-half--top {
  transform: translateY(-1.2%);
}

body.is-on .switch-half--bottom {
  transform: translateY(1.2%);
}

.switch-rim {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.22),
    inset 7px 0 16px rgba(255, 255, 255, 0.08),
    inset -9px 0 18px rgba(0, 0, 0, 0.2);
}

.switch-light {
  position: absolute;
  left: 50%;
  bottom: -10px;
  width: 46%;
  height: 18px;
  border-radius: 999px;
  opacity: 0;
  background: var(--accent);
  filter: blur(13px);
  transform: translateX(-50%);
  transition: opacity 680ms ease, transform 680ms ease;
}

body.is-on .switch-light {
  opacity: 0.75;
  transform: translateX(-50%) translateY(10px) scaleX(1.25);
}

.message {
  position: absolute;
  left: calc(50% - min(28vw, 390px));
  top: calc(50% - min(20vw, 230px));
  width: min(430px, calc(100vw - 40px));
  opacity: 0;
  transform: translate3d(-18px, 18px, 0) scale(0.985);
  filter: blur(10px);
  pointer-events: none;
  transform-origin: left center;
  transition:
    opacity 560ms ease,
    filter 680ms ease,
    transform 760ms cubic-bezier(0.16, 1, 0.3, 1);
}

body.is-on .message {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  filter: blur(0);
  transition-delay: 220ms;
}

.eyebrow {
  margin-bottom: 12px;
  color: var(--accent);
  font-family: var(--font-body);
  font-size: 0.69rem;
  font-weight: 800;
  line-height: 1.1;
  text-transform: uppercase;
}

h1 {
  max-width: 11ch;
  margin-bottom: 18px;
  font-family: var(--font-display);
  font-size: clamp(2.45rem, 3.8vw, 4.3rem);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: 0;
}

.message p:not(.eyebrow) {
  max-width: 390px;
  margin-bottom: 0;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: clamp(1rem, 1.08vw, 1.12rem);
  font-weight: 500;
  line-height: 1.66;
}

@media (max-width: 680px) {
  .switch-page {
    place-items: start center;
    padding-top: 48svh;
  }

  .wall-switch {
    width: clamp(58px, 17vw, 72px);
    height: clamp(136px, 38vw, 168px);
    transform: translateY(0);
  }

  .message {
    left: 22px;
    top: calc(50% - 238px);
    width: min(330px, calc(100vw - 44px));
  }

  h1 {
    max-width: 11ch;
    font-size: clamp(2.3rem, 9.8vw, 3.05rem);
  }

  .message p:not(.eyebrow) {
    max-width: min(300px, calc(100vw - 44px));
    font-size: 0.98rem;
  }
}

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