:root {
  color-scheme: dark;
  --cream: #fff1dc;
  --panel: rgba(13, 8, 15, 0.74);
}

@font-face {
  font-family: "Mattone";
  src: url("./assets/fonts/mattone/Mattone-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Mattone";
  src: url("./assets/fonts/mattone/Mattone-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Mattone";
  src: url("./assets/fonts/mattone/Mattone-Black.woff2") format("woff2");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  width: 100%;
  min-height: 520vh;
  overflow-x: hidden;
  background: #08070a;
  color: var(--cream);
  font-family: Arial, "Helvetica Neue", sans-serif;
}

html.kiosk-preview,
html.kiosk-preview body,
body.kiosk-preview {
  height: 100%;
  min-height: 100%;
  overflow: hidden;
}

html.kiosk-preview:has(body.copy-options-preview),
html.kiosk-preview:has(body.copy-options-preview) body,
html.kiosk-preview.copy-options-preview,
html.kiosk-preview.copy-options-preview body,
body.kiosk-preview.copy-options-preview {
  height: auto;
  min-height: 520vh;
  overflow-x: hidden;
  overflow-y: auto;
}

.disturbance-test,
#previewCanvas,
#disturbanceCanvas {
  position: fixed;
  inset: 0;
}

.scroll-space {
  position: absolute;
  inset: 0;
  height: 520vh;
  pointer-events: none;
}

body.kiosk-preview .scroll-space {
  display: none;
}

body.kiosk-preview.copy-options-preview .scroll-space {
  display: block;
}

#previewCanvas {
  overflow: hidden;
  background:
    radial-gradient(circle at 70% 18%, rgba(255, 164, 202, 0.2), transparent 34%),
    radial-gradient(circle at 18% 74%, rgba(92, 170, 255, 0.16), transparent 34%),
    #08070a;
}

#disturbanceCanvas {
  z-index: 3;
  pointer-events: none;
  display: none;
}

canvas { display: block; }

.topbar {
  position: fixed;
  z-index: 8;
  inset: 0 0 auto;
  height: 62px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 clamp(18px, 4vw, 56px);
  color: rgba(255, 241, 220, 0.68);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  pointer-events: none;
}

.topbar a,
.topbar button {
  pointer-events: auto;
}

.topbar a {
  color: inherit;
  text-decoration: none;
}

.topbar button,
.node-nav button,
.copy-layout-nav button {
  height: 32px;
  border: 1px solid rgba(255, 241, 220, 0.2);
  background: rgba(255, 241, 220, 0.07);
  color: rgba(255, 241, 220, 0.76);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.brand-mark {
  position: fixed;
  z-index: 7;
  left: clamp(22px, 4.2vw, 62px);
  top: clamp(22px, 4vh, 38px);
  color: rgba(255, 241, 220, 0.86);
  font-family: "Mattone", Arial, "Helvetica Neue", sans-serif;
  font-size: clamp(13px, 1.15vw, 16px);
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  font-variant-ligatures: none;
  text-shadow: 0 12px 36px rgba(0, 0, 0, 0.54);
  pointer-events: none;
  opacity: 0;
  transition: opacity 360ms ease;
}

body[data-active-stop="A"] .brand-mark,
body[data-active-stop="B"] .brand-mark,
body[data-active-stop="C"] .brand-mark,
body[data-active-stop="CPlus"] .brand-mark {
  opacity: 1;
}

.copy-layer {
  position: fixed;
  z-index: 5;
  left: clamp(22px, 6vw, 92px);
  bottom: clamp(74px, 8vh, 96px);
  width: min(700px, calc(100vw - 44px));
  pointer-events: none;
  text-shadow: 0 10px 34px rgba(0, 0, 0, 0.72), 0 1px 0 rgba(255, 255, 255, 0.08);
  opacity: 0.86;
  transition: left 420ms ease, right 420ms ease, top 420ms ease, bottom 420ms ease, width 420ms ease, opacity 260ms ease, transform 420ms ease;
}

.copy-layer::before {
  display: none;
}

.copy-layer p {
  margin: 0;
  color: rgba(255, 244, 226, 0.96);
  font-size: clamp(17px, 1.42vw, 24px);
  line-height: 1.35;
  font-family: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  font-weight: 600;
}

.copy-layer p:first-child {
  display: inline-block;
  margin: 0 0 14px;
  padding: 0;
  border-bottom: 0;
  color: rgba(255, 244, 226, 0.98);
  font-size: clamp(17px, 1.35vw, 24px);
  line-height: 1.25;
  font-weight: 650;
  text-transform: none;
  letter-spacing: 0;
  transform: translateY(0);
}

.copy-layer p:first-child::after {
  content: "";
  display: block;
  width: 5.5em;
  height: 1px;
  margin-top: 8px;
  background: rgba(255, 244, 226, 0.74);
}

body[data-copy-layout="1"][data-active-stop="C"] .copy-layer h1 {
  max-width: 20ch;
  font-size: clamp(32px, 3.8vw, 66px);
}

.copy-layer h1 {
  margin: 0;
  color: #fff4df;
  max-width: 15ch;
  font-family: "Mattone", Arial, "Helvetica Neue", sans-serif;
  font-size: clamp(34px, 4.25vw, 74px);
  line-height: 1.03;
  font-weight: 900;
  letter-spacing: 0;
}

body[data-active-stop="D"] .copy-layer {
  opacity: 0;
}

body.kiosk-preview[data-active-stop="D"] .copy-layer {
  left: clamp(26px, 5vw, 72px);
  bottom: clamp(86px, 11vh, 132px);
  width: min(620px, calc(100vw - 52px));
  opacity: 0.9;
}

body.kiosk-preview[data-active-stop="D"] .copy-layer p:first-child,
body.kiosk-preview[data-active-stop="D"] .copy-layer p:last-child {
  display: none;
}

body.kiosk-preview[data-active-stop="D"] .copy-layer h1 {
  max-width: none;
  color: rgba(255, 241, 220, 0.92);
  font-size: clamp(36px, 5.2vw, 86px);
  line-height: 1.02;
  font-weight: 900;
  text-transform: none;
  white-space: nowrap;
  letter-spacing: 0;
  word-spacing: 0.08em;
  font-variant-ligatures: none;
}

body[data-active-stop="CPlus"] .copy-layer {
  left: 50%;
  right: auto;
  top: 50%;
  bottom: auto;
  width: min(680px, calc(100vw - 44px));
  transform: translate(-50%, -50%);
  text-align: center;
  opacity: 0.82;
}

body[data-active-stop="CPlus"] .copy-layer h1 {
  margin: 0;
  font-size: clamp(36px, 5.8vw, 86px);
  line-height: 1.02;
}

body[data-copy-layout="2"] .copy-layer {
  left: auto;
  right: clamp(24px, 6vw, 96px);
  bottom: clamp(92px, 13vh, 150px);
  width: min(780px, calc(100vw - 48px));
  display: grid;
  grid-template-columns: minmax(190px, 0.38fr) minmax(360px, 1fr);
  gap: clamp(20px, 3vw, 48px);
  align-items: end;
  text-align: left;
  opacity: 0.92;
}

body[data-copy-layout="2"] .copy-layer::before {
  display: none;
}

body[data-copy-layout="2"] .copy-layer p:first-child {
  border-bottom: 0;
  border-right: 0;
  padding: 0;
  margin: 0;
  text-align: left;
  font-size: clamp(17px, 1.5vw, 26px);
  line-height: 1.28;
}

body[data-copy-layout="2"] .copy-layer h1 {
  max-width: 15.5ch;
  font-size: clamp(32px, 3.9vw, 68px);
  line-height: 1.02;
  font-weight: 700;
}

body[data-copy-layout="3"] .copy-layer {
  left: clamp(22px, 4vw, 60px);
  right: clamp(22px, 4vw, 60px);
  bottom: clamp(42px, 6vh, 70px);
  width: auto;
  transform: none;
  display: grid;
  grid-template-columns: minmax(210px, 0.5fr) minmax(330px, 1fr);
  gap: clamp(20px, 4vw, 58px);
  align-items: center;
  text-align: left;
  opacity: 0.94;
}

body[data-copy-layout="3"] .copy-layer::before {
  display: none;
}

body[data-copy-layout="3"] .copy-layer p:first-child {
  margin: 0;
  border-bottom: 0;
  border-top: 0;
  padding-top: 0;
  transform: translateY(-8px);
  font-size: clamp(17px, 1.55vw, 27px);
  line-height: 1.28;
}

body[data-copy-layout="3"] .copy-layer h1 {
  position: relative;
  max-width: 16ch;
  font-size: clamp(35px, 4.35vw, 76px);
  line-height: 1.02;
  font-weight: 900;
  transform: translateY(12px);
}

body[data-copy-layout="3"] .copy-layer h1::before {
  content: attr(data-copy-ghost);
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  color: rgba(255, 232, 210, 0.16);
  transform: translate(0.055em, 0.055em);
  filter: blur(1px);
  pointer-events: none;
}

body[data-copy-layout="2"][data-active-stop="CPlus"] .copy-layer,
body[data-copy-layout="3"][data-active-stop="CPlus"] .copy-layer {
  left: 50%;
  right: auto;
  top: 50%;
  bottom: auto;
  display: block;
  width: min(680px, calc(100vw - 44px));
  transform: translate(-50%, -50%);
  text-align: center;
}

body[data-active-stop="CPlus"] .copy-layer p:first-child {
  display: none;
}

.copy-layout-nav {
  position: fixed;
  z-index: 8;
  right: clamp(14px, 2vw, 30px);
  bottom: 22px;
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 8px;
  padding: 8px;
  background: rgba(11, 7, 15, 0.42);
  border: 1px solid rgba(255, 241, 220, 0.14);
  backdrop-filter: blur(14px);
}

.copy-layout-nav button.active {
  border-color: rgba(255, 205, 232, 0.82);
  background: rgba(255, 143, 211, 0.22);
  color: #fff4df;
}

.node-nav {
  position: fixed;
  z-index: 8;
  left: 50%;
  bottom: 22px;
  display: grid;
  grid-template-columns: repeat(5, minmax(72px, auto));
  gap: 8px;
  padding: 8px;
  transform: translateX(-50%);
  background: rgba(11, 7, 15, 0.48);
  border: 1px solid rgba(255, 241, 220, 0.18);
  backdrop-filter: blur(14px);
}

.node-nav button.active {
  border-color: rgba(255, 205, 232, 0.82);
  background: rgba(255, 143, 211, 0.24);
  color: #fff4df;
}

.panel {
  position: fixed;
  z-index: 8;
  right: clamp(14px, 2vw, 30px);
  top: 80px;
  width: min(360px, calc(100vw - 28px));
  max-height: calc(100svh - 124px);
  overflow: auto;
  padding: 16px;
  border: 1px solid rgba(255, 241, 220, 0.18);
  background: var(--panel);
  backdrop-filter: blur(16px);
}

.panel-title {
  margin-bottom: 14px;
  color: rgba(255, 241, 220, 0.8);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.control-grid {
  display: grid;
  gap: 12px;
}

.control {
  display: grid;
  grid-template-columns: 76px 1fr 42px;
  align-items: center;
  gap: 10px;
  color: rgba(255, 241, 220, 0.72);
  font-size: 12px;
}

.control input { width: 100%; accent-color: #ff9cc6; }

.control output {
  text-align: right;
  color: rgba(255, 241, 220, 0.64);
  font-variant-numeric: tabular-nums;
}

textarea {
  width: 100%;
  height: 150px;
  margin-top: 14px;
  resize: none;
  border: 1px solid rgba(255, 241, 220, 0.14);
  background: rgba(5, 4, 8, 0.5);
  color: rgba(255, 241, 220, 0.76);
  font: 11px/1.45 Consolas, monospace;
}

.status {
  position: fixed;
  z-index: 8;
  left: clamp(18px, 4vw, 56px);
  top: 80px;
  color: rgba(255, 241, 220, 0.7);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

body.clean-preview .copy-layer,
body.clean-preview .node-nav,
body.clean-preview .panel,
body.clean-preview .status,
body.clean-preview .topbar {
  opacity: 0;
  pointer-events: none;
}

body.clean-preview .copy-layer,
body.clean-preview .brand-mark,
body.clean-preview .copy-layout-nav {
  opacity: 1;
  pointer-events: auto;
}

body.clean-preview[data-active-stop="D"] .copy-layer {
  opacity: 0;
}

body.kiosk-preview .topbar,
body.kiosk-preview .node-nav,
body.kiosk-preview .panel,
body.kiosk-preview .status,
body.kiosk-preview .copy-layout-nav {
  display: none;
}

body.kiosk-preview .copy-layer,
body.kiosk-preview .brand-mark {
  opacity: 1;
  pointer-events: none;
}

body.kiosk-preview.copy-options-preview .copy-layout-nav {
  display: grid;
  opacity: 1;
  pointer-events: auto;
}

body.clean-preview.water-tune-preview .panel,
body.clean-preview.water-tune-preview .status {
  opacity: 1;
  pointer-events: auto;
}

body.kiosk-preview[data-active-stop="D"] .copy-layer {
  opacity: 0.86;
}

@media (max-width: 760px) {
  .copy-layer,
  body[data-copy-layout="2"] .copy-layer,
  body[data-copy-layout="3"] .copy-layer {
    left: 22px;
    right: auto;
    bottom: 86px;
    width: calc(100vw - 44px);
    transform: none;
    text-align: left;
    display: block;
  }

  body[data-copy-layout="2"] .copy-layer p:first-child,
  body[data-copy-layout="3"] .copy-layer p:first-child {
    margin: 0 0 14px;
    padding: 0 0 10px;
    border-right: 0;
    border-top: 0;
    border-bottom: 1px solid rgba(255, 241, 220, 0.34);
    text-align: left;
    transform: none;
  }

  body[data-copy-layout="3"] .copy-layer h1 {
    transform: none;
  }

  .copy-layout-nav {
    right: 12px;
    bottom: 12px;
    grid-template-columns: repeat(3, 1fr);
  }

  .copy-layout-nav button {
    min-width: 58px;
  }
}
