@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 600;
  font-display: optional;
  src: url("/fonts/bricolage-600.woff2") format("woff2");
}

@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 700;
  font-display: optional;
  src: url("/fonts/bricolage-700.woff2") format("woff2");
}

:root {
  color-scheme: dark;
  font-family: Inter, "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  background: #030b13;
  color: #f0f4f5;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body,
p,
h1 {
  margin: 0;
}

.dive {
  --gutter: clamp(1.5rem, 5.4vw, 6.5rem);
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: max(100svh, 31rem);
  overflow: clip;
  align-items: center;
  padding: 6rem var(--gutter);
}

.dive-scene,
.dive-scene::after,
#submarine-canvas,
.dive-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.dive-scene {
  overflow: hidden;
}

.dive-poster {
  object-fit: cover;
  object-position: 78% center;
}

#submarine-canvas {
  display: block;
  visibility: hidden;
  cursor: grab;
  touch-action: none;
}

#submarine-canvas:active {
  cursor: grabbing;
}

#submarine-canvas:focus-visible {
  outline: 2px solid #b5d4d8;
  outline-offset: -3px;
}

[data-ready="true"] #submarine-canvas {
  visibility: visible;
}

[data-ready="true"] .dive-poster {
  visibility: hidden;
}

.dive-scene::after {
  background:
    linear-gradient(90deg, #020911df, #0209117d 23%, transparent 50%),
    linear-gradient(
      180deg,
      #020911a8,
      transparent 18%,
      transparent 86%,
      #02091155
    );
  content: "";
  pointer-events: none;
}

.dive-header {
  position: absolute;
  z-index: 1;
  inset: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(1.3rem, 3.8vh, 2.5rem) var(--gutter);
}

.wordmark {
  font-size: 1.125rem;
  font-weight: 670;
  letter-spacing: -0.035em;
}

.preview-label {
  color: #b6c7cd;
  font-size: 0.6875rem;
  font-weight: 450;
  letter-spacing: 0.14em;
}

.dive-copy {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: start;
  gap: 0.8rem;
  width: min(100%, 23rem);
  padding-block: 1rem;
  animation: appear 570ms ease-out both;
}

h1 {
  font-size: clamp(2.25rem, 4.35vw, 5.5rem);
  font-weight: 550;
  letter-spacing: -0.045em;
  line-height: 1.18;
  text-wrap: balance;
}

.dive-hint {
  color: #bdd0d5;
  font-size: 0.8125rem;
}

.dive-embedded .dive {
  --gutter: calc(max(0px, (100vw - 1440px) / 2) + clamp(22px, 6vw, 96px));
  min-height: clamp(40rem, 51vw, 48rem);
  padding-block: 3.25rem;
  font-family:
    "Bricolage Grotesque", "PingFang SC", "Microsoft YaHei", system-ui,
    sans-serif;
}

.dive-embedded .dive-header {
  display: none;
}

.dive-embedded .dive-copy {
  width: min(100%, 25rem);
}

.dive-embedded h1 {
  font-size: clamp(2.55rem, 4.7vw, 5rem);
  font-weight: 700;
  line-height: 1.05;
  text-wrap: initial;
}

.dive-model {
  color: #a8c6ce;
  font-size: 0.8rem;
  font-weight: 650;
}

.dive-embedded .dive-scene::after {
  background:
    linear-gradient(0deg, #0b1720, #0b172000 19%),
    linear-gradient(90deg, #020911e8, #020911b5 22%, transparent 53%);
}

.dive-embedded .dive-poster {
  object-position: center;
}

.dive-embedded .dive-scene:not([data-ready="true"])::after {
  opacity: 0;
}

.dive-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.475rem;
}

button {
  display: inline-flex;
  margin: 0;
  min-height: 3rem;
  align-items: center;
  gap: 0.67rem;
  border: 1px solid #829fa976;
  border-radius: 0.3rem;
  padding: 0.6rem 1rem;
  background: #11222db0;
  color: #f0f4f5;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  transition:
    background-color 230ms,
    border-color 230ms,
    color 230ms;
}

button:enabled {
  cursor: pointer;
}

button:enabled:hover,
button[aria-pressed="true"] {
  border-color: #d5e5e6;
  background: #d5e5e6;
  color: #071620;
}

button:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 2px solid #d5e5e6;
  outline-offset: 4px;
}

button:disabled {
  opacity: 0.6;
}

#scene-status {
  color: #b6c7cd;
  font-size: 0.875rem;
  min-height: 1.25rem;
}

.edit-form {
  display: grid;
  width: 100%;
  gap: 0.6rem;
  margin-top: 1.15rem;
  padding-top: 1rem;
  border-top: 1px solid #7f9aa54e;
}

.edit-form label {
  color: #d7e7e9;
  font-size: 0.84rem;
  font-weight: 650;
}

textarea {
  display: block;
  width: 100%;
  min-height: 4.2rem;
  resize: vertical;
  border: 1px solid #829fa976;
  border-radius: 0.32rem;
  padding: 0.65rem 0.7rem;
  background: #06121cd9;
  color: #f0f4f5;
  font: inherit;
  font-size: 0.9rem;
  line-height: 1.45;
}

textarea::placeholder {
  color: #9fb3bf;
}

.dive-primary {
  border-color: #b9dadd;
  background: #c4dfe0;
  color: #071620;
}

#preview-login {
  color: #c4dfe0;
  font-size: 0.85rem;
  text-underline-offset: 0.22em;
}

@keyframes appear {
  from {
    opacity: 0;
    transform: translateY(9px);
  }
}

@media (max-width: 900px) and (orientation: portrait) {
  .dive {
    --gutter: clamp(1.25rem, 6vw, 3rem);
    --stage-height: clamp(20rem, 56svh, 38rem);
    min-height: 100svh;
    align-items: start;
    padding-block: calc(var(--stage-height) - 2rem) 2rem;
  }

  .dive-scene {
    height: var(--stage-height);
  }

  .dive-poster {
    object-position: 82% 49%;
  }

  .dive-scene::after {
    background:
      linear-gradient(180deg, #030b137a, transparent 23%),
      linear-gradient(0deg, #030b13 0%, #030b1300 32%);
  }

  .dive-copy {
    gap: 0.72rem;
    width: 100%;
  }

  h1 {
    font-size: clamp(2.1rem, 8.15vw, 4.2rem);
  }

  button {
    min-height: 2.8rem;
    padding-inline: 0.79rem;
  }
}

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

  button {
    transition: none;
  }
}

@media (min-width: 761px) {
  .dive-embedded .dive-scene {
    height: 100%;
  }
}

@media (max-width: 760px) {
  .dive-embedded .dive {
    --stage-height: clamp(16rem, 78vw, 25rem);
    min-height: auto;
    align-items: start;
    padding-block: calc(var(--stage-height) - 1.5rem) 2rem;
    background: #0b1720;
  }

  .dive-embedded .dive-scene {
    height: var(--stage-height);
  }

  .dive-embedded .dive-scene::after {
    background: linear-gradient(0deg, #0b1720, transparent 36%);
  }

  .dive-embedded .dive-copy {
    width: 100%;
  }

  .dive-embedded .edit-form {
    margin-top: 0.65rem;
  }

  .dive-embedded h1 {
    font-size: clamp(2.05rem, 7.6vw, 3.25rem);
  }
}
