* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  color-scheme: light;
  --bg: #edf3f3;
  --surface: #ffffff;
  --ink: #17323a;
  --muted: #64777d;
  --line: rgba(23, 50, 58, 0.13);
  --coral: #f5675c;
  --coral-strong: #e9564d;
  --teal: #187d8e;
  --dark-ink: #17323a;
  --success: #267660;
  --danger: #c3443d;
}

html,
body {
  width: 100%;
  min-width: 320px;
  min-height: 100%;
  background: var(--bg);
}

body {
  overflow: hidden;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

.experience {
  position: relative;
  width: 100%;
  height: 100svh;
  min-height: 620px;
  overflow: hidden;
  background:
    linear-gradient(126deg, rgba(245, 103, 92, 0.17) 0 18%, transparent 18.1%),
    linear-gradient(308deg, rgba(24, 125, 142, 0.14) 0 19%, transparent 19.1%),
    linear-gradient(180deg, #f8fbfa 0%, #e7f0f1 100%);
  background-attachment: fixed;
}

.experience::before,
.experience::after {
  content: "";
  position: absolute;
  z-index: 1;
  pointer-events: none;
}

.experience::before {
  inset: 0;
  background: linear-gradient(
    112deg,
    transparent 0 38%,
    rgba(255, 255, 255, 0.54) 38.1% 53%,
    transparent 53.1%
  );
}

.experience::after {
  right: -12vw;
  bottom: -48vh;
  width: 40vw;
  height: 110vh;
  background: rgba(255, 255, 255, 0.34);
  border-left: 1px solid rgba(24, 125, 142, 0.08);
  transform: rotate(17deg);
}

.site-header {
  position: absolute;
  z-index: 5;
  top: 0;
  left: 50%;
  width: min(1180px, calc(100% - 64px));
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  transform: translateX(-50%);
}

.brand {
  display: block;
  text-decoration: none;
}

.brand-logo {
  display: block;
  width: 210px;
  height: auto;
}

.event-label {
  color: var(--muted);
  font-size: 12px;
}

.hero {
  position: relative;
  width: 100%;
  height: 100%;
}

.hero-copy {
  position: absolute;
  z-index: 4;
  top: 112px;
  left: 50%;
  width: min(620px, calc(100% - 40px));
  text-align: center;
  transform: translateX(-50%);
  pointer-events: none;
}

.hero-copy h1 {
  color: var(--ink);
  font-size: 38px;
  line-height: 1.2;
  font-weight: 760;
}

.hero-copy p {
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.scene-wrap {
  position: absolute;
  z-index: 2;
  inset: 0;
  cursor: grab;
  touch-action: manipulation;
}

.scene-wrap.is-hovering {
  cursor: pointer;
}

.scene-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
  outline: 0;
}

.draw-controls {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: 46px;
  width: min(360px, calc(100% - 40px));
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translateX(-50%);
}

.draw-button {
  width: 190px;
  height: 52px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  color: #ffffff;
  background: var(--coral);
  border: 1px solid rgba(200, 66, 57, 0.18);
  border-radius: 6px;
  box-shadow: 0 14px 34px rgba(214, 77, 67, 0.22);
  cursor: pointer;
  font-size: 15px;
  font-weight: 760;
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.draw-button:hover:not(:disabled) {
  background: var(--coral-strong);
  box-shadow: 0 17px 42px rgba(214, 77, 67, 0.3);
  transform: translateY(-2px);
}

.draw-button:active:not(:disabled) {
  transform: translateY(0);
}

.draw-button:disabled {
  cursor: wait;
  opacity: 0.66;
}

.button-dot {
  width: 7px;
  height: 7px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.18);
}

.draw-status {
  min-height: 20px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

.draw-status.is-success { color: var(--success); }
.draw-status.is-error { color: var(--danger); }

.result-dialog {
  width: min(420px, calc(100% - 32px));
  margin: auto;
  padding: 42px 36px 34px;
  color: var(--dark-ink);
  background: var(--surface);
  border: 0;
  border-radius: 8px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.5);
  text-align: center;
}

.result-dialog[open] {
  animation: dialog-enter 320ms cubic-bezier(0.16, 1, 0.3, 1);
}

.result-dialog::backdrop {
  background: rgba(20, 46, 53, 0.58);
  backdrop-filter: blur(9px);
}

.dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #68717b;
  background: transparent;
  border: 0;
  border-radius: 5px;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.dialog-close:hover {
  color: var(--dark-ink);
  background: #eff2f4;
}

.result-label {
  color: var(--coral-strong);
  font-size: 11px;
  font-weight: 760;
}

.result-dialog h2 {
  margin-top: 12px;
  font-size: 24px;
  line-height: 1.3;
}

.result-number {
  display: block;
  margin: 26px 0 20px;
  color: var(--teal);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 54px;
  line-height: 1;
  font-weight: 820;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  white-space: nowrap;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.result-note {
  color: #68717b;
  font-size: 13px;
  line-height: 1.75;
}

.draw-button:focus-visible,
.dialog-close:focus-visible,
.brand:focus-visible {
  outline: 3px solid rgba(240, 150, 150, 0.42);
  outline-offset: 3px;
}

@keyframes dialog-enter {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 700px) {
  .experience {
    min-height: 560px;
  }

  .site-header {
    width: calc(100% - 32px);
    height: 64px;
  }

  .brand-logo {
    width: 170px;
  }

  .event-label {
    display: none;
  }

  .hero-copy {
    top: 88px;
  }

  .hero-copy h1 {
    font-size: 30px;
  }

  .hero-copy p {
    max-width: 310px;
    margin: 10px auto 0;
    font-size: 13px;
  }

  .draw-controls {
    bottom: max(26px, env(safe-area-inset-bottom));
  }

  .draw-button {
    width: min(100%, 320px);
  }

  .result-dialog {
    padding: 40px 24px 26px;
  }

  .result-number {
    font-size: 44px;
  }
}

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