/* Berth by Four Labs — Fullscreen Live Harbour Guest Gate & Owner Portal */
@font-face {
  font-family: "IBM Plex Sans";
  src: url("/guest-assets/plex.woff2") format("woff2");
  font-display: swap;
}

:root {
  --bg: #07111a;
  --panel: rgba(10, 21, 32, 0.88);
  --panel-solid: #102130;
  --text: #eef4f9;
  --muted: #b0c3d2;
  --dim: #8199ad;
  --line: rgba(136, 178, 208, 0.22);
  --line-strong: rgba(103, 198, 230, 0.42);
  --accent: #67c6e6;
  --hover: #96dcf2;
  --on-accent: #06202b;
  --live: #5ee0b4;
  --error: #ffac9d;
  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { overflow-x: clip; margin: 0; padding: 0; }

body {
  min-height: 100svh;
  background: radial-gradient(1100px 680px at 78% 12%, rgba(25, 68, 98, 0.34), transparent 70%), var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}

body.is-visit {
  height: 100svh;
  overflow: hidden;
}

/* ── Fullscreen seamless 3D background video & exact-frame instant poster ─ */
.bg-stage {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100svh;
  z-index: 0;
  overflow: hidden;
  background: radial-gradient(900px 600px at 60% 35%, #0e2638 0%, #07111a 75%);
  pointer-events: none;
}

.bg-poster,
.bg-poster img,
.bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bg-video {
  opacity: 0;
  transition: opacity 0.6s ease-out;
}
.bg-video.is-ready {
  opacity: 1;
}

/* Light edge vignette only: leaves center 60%+ of the 3D harbour completely vivid */
.bg-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(6, 15, 23, 0.64) 0%,
    rgba(6, 15, 23, 0.08) 18%,
    rgba(6, 15, 23, 0.06) 58%,
    rgba(6, 15, 23, 0.72) 84%,
    rgba(6, 15, 23, 0.92) 100%
  );
}

/* ── Fullscreen overlay layout (/visit) ────────────────────────────────── */
.stage-overlay {
  position: relative;
  z-index: 1;
  height: 100svh;
  width: 100%;
  padding: 0 clamp(18px, 4vw, 48px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.page-shell {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 clamp(18px, 4.5vw, 56px);
  display: flex;
  flex-direction: column;
}

.portal-head,
.portal-foot,
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.portal-head {
  padding: 16px 0;
}
body:not(.is-visit) .portal-head {
  border-bottom: 1px solid var(--line);
}

a {
  color: var(--accent);
  text-underline-offset: 4px;
  transition: color 140ms ease;
}
a:hover { color: var(--hover); }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
  min-height: 44px;
}
.brand-mark {
  display: block;
  border-radius: 7px;
  border: 1px solid rgba(103, 198, 230, 0.35);
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}
.brand-text strong {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.025em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.65);
}
.brand-text small {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
}

.head-links {
  display: flex;
  align-items: center;
  gap: 18px;
}
.head-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}
.head-contact {
  padding: 0 15px;
  min-height: 38px !important;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(8, 20, 31, 0.68);
  color: var(--text) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  white-space: nowrap;
}
.head-contact:hover {
  border-color: var(--accent);
  background: rgba(15, 36, 52, 0.86);
}
.head-subtle {
  color: var(--muted) !important;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
}
.head-subtle:hover {
  color: var(--text) !important;
}

/* ── Bottom floating Hero Dock (leaves live 3D harbour unobstructed) ───── */
.hero-dock-wrap {
  flex: 1;
  display: flex;
  align-items: flex-end;
  padding-bottom: clamp(14px, 2.5vh, 28px);
}

.hero-dock {
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
}

.hero-copy {
  max-width: 660px;
}

.live-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(8, 20, 31, 0.74);
  border: 1px solid rgba(94, 224, 180, 0.42);
  color: #c8f7e6;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
  backdrop-filter: blur(10px);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 8px rgba(94, 224, 180, 0.9);
}

h1, h2, p { margin: 0; }
h1, h2 { text-wrap: balance; }

.hero-copy h1 {
  font-size: clamp(32px, 4.2vw, 54px);
  line-height: 1.02;
  letter-spacing: -0.036em;
  font-weight: 600;
  text-shadow: 0 4px 22px rgba(0, 0, 0, 0.75);
}
.hero-copy h1 span {
  color: var(--accent);
}

.hero-sub {
  margin-top: 10px;
  font-size: clamp(15px, 1.4vw, 18px);
  color: #d0dfeb;
  max-width: 56ch;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8);
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ── Buttons & Inputs ──────────────────────────────────────────────────── */
input, select, button, .btn-request {
  font: inherit;
  min-height: 48px;
  border-radius: 10px;
  padding: 10px 18px;
}

button {
  border: 1px solid transparent;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  cursor: pointer;
  transition: background-color 140ms ease, transform 90ms ease, box-shadow 140ms ease;
}
button:hover { background: var(--hover); }
button:active { transform: translateY(1px); }
button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  background: var(--panel-solid);
  color: var(--muted);
}

.btn-hero {
  padding: 12px 26px;
  border-radius: 999px;
  font-size: 16px;
  box-shadow: 0 10px 30px rgba(103, 198, 230, 0.28);
  white-space: nowrap;
}

.btn-request {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  background: rgba(10, 24, 36, 0.76);
  border: 1px solid rgba(94, 224, 180, 0.48);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background-color 150ms ease, border-color 150ms ease, transform 90ms ease;
  white-space: nowrap;
}
.btn-request:hover {
  color: #ffffff;
  background: rgba(20, 52, 54, 0.86);
  border-color: rgba(94, 224, 180, 0.78);
}
.btn-request:active { transform: translateY(1px); }

.btn-hero-sec {
  padding: 12px 22px;
  border-radius: 999px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ── Footer & Pause Control ────────────────────────────────────────────── */
.portal-foot {
  border-top: 1px solid rgba(136, 178, 208, 0.16);
  padding: 10px 0 max(12px, env(safe-area-inset-bottom));
  flex-wrap: wrap;
  gap: 12px;
}

.foot-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
}
.foot-note {
  font-size: 12.5px;
  color: var(--dim);
}
.foot-links a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
}
.foot-links a:hover { color: var(--accent); }

.bg-toggle {
  min-height: 34px;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(10, 22, 34, 0.72);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  backdrop-filter: blur(10px);
}
.bg-toggle:hover {
  background: rgba(18, 37, 54, 0.9);
  color: var(--text);
  border-color: var(--line-strong);
}

/* ── Native Top-Layer Guest Code Modal (<dialog>) ──────────────────────── */
.guest-dialog {
  margin: auto;
  padding: 0;
  width: min(460px, calc(100vw - 28px));
  max-height: calc(100svh - 32px);
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: rgba(9, 20, 31, 0.92);
  color: var(--text);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.72), 0 1px 0 rgba(255, 255, 255, 0.06) inset;
  backdrop-filter: blur(22px) saturate(1.3);
  -webkit-backdrop-filter: blur(22px) saturate(1.3);
  overflow-y: auto;

  opacity: 0;
  transition-property: opacity, transform, display, overlay;
  transition-duration: 0.24s;
  transition-timing-function: ease-out;
  transition-behavior: allow-discrete;

  @media (prefers-reduced-motion: no-preference) {
    transform: translateY(10px) scale(0.97);
  }
  @media (prefers-reduced-motion: reduce) {
    transition-duration: 0.1s;
  }
}

.guest-dialog::backdrop {
  background-color: rgba(4, 11, 18, 0);
  backdrop-filter: blur(0px);
  transition-property: background-color, backdrop-filter, display, overlay;
  transition-duration: 0.24s;
  transition-timing-function: ease-out;
  transition-behavior: allow-discrete;
}

.guest-dialog[open]:not([data-closing]) {
  opacity: 1;

  @starting-style {
    opacity: 0;
  }

  @media (prefers-reduced-motion: no-preference) {
    transform: translateY(0) scale(1);

    @starting-style {
      transform: translateY(10px) scale(0.97);
    }
  }

  &::backdrop {
    background-color: rgba(4, 11, 18, 0.62);
    backdrop-filter: blur(6px);

    @starting-style {
      background-color: rgba(4, 11, 18, 0);
      backdrop-filter: blur(0px);
    }
  }
}

.dialog-panel {
  padding: clamp(22px, 4vw, 30px);
}

.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
}

.dialog-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.dialog-brand h2 {
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: -0.025em;
}
.dialog-sub {
  font-size: 13.5px;
  color: var(--muted);
  margin-top: 2px;
}

.dialog-close {
  flex: none;
  width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  color: var(--muted);
}
.dialog-close:hover {
  background: rgba(255, 255, 255, 0.13);
  color: var(--text);
}

label {
  display: block;
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 500;
  color: #d6e4ef;
}

input, select {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(5, 14, 22, 0.84);
  color: var(--text);
  transition: border-color 140ms ease, background-color 140ms ease;
}
input:focus, select:focus {
  border-color: var(--accent);
  background: rgba(5, 14, 22, 0.96);
}
input[aria-invalid="true"] {
  border-color: var(--error);
}

.guest-form .btn-primary,
#owner .btn-primary {
  width: 100%;
  margin-top: 12px;
}

#message {
  margin: 12px 0 0;
  font-size: 14px;
  color: var(--error);
  overflow-wrap: anywhere;
}
#message:empty { margin: 0; }

.request-block {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.request-kicker {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
}
.dialog-panel .btn-request {
  width: 100%;
  background: rgba(94, 224, 180, 0.13);
}
.request-alt {
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}
.small {
  margin-top: 16px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--dim);
}

/* ── Owner management page ─────────────────────────────────────────────── */
.owner {
  flex: 1;
  max-width: 820px;
  width: 100%;
  margin: 0 auto;
  padding: clamp(28px, 6vh, 64px) 0;
}
.owner h1 { font-size: clamp(32px, 4vw, 48px); letter-spacing: -0.035em; }
.owner h2 { font-size: 22px; letter-spacing: -0.02em; }
.lead { color: var(--muted); font-size: 17px; margin: 12px 0 24px; }
#owner { max-width: 380px; margin-top: 28px; }
#create, .share { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
#create div:first-child { flex: 1; min-width: 180px; }
.section-head { margin-top: 32px; }
.quiet { background: transparent; color: var(--text); border: 1px solid var(--line); font-weight: 500; }
.quiet:hover { background: var(--panel-solid); }
.code-row { padding: 20px 0; border-bottom: 1px solid var(--line); }
.code-row h3 { margin: 0; overflow-wrap: anywhere; font-size: 20px; }
.code-row p { color: var(--muted); margin: 4px 0; }
.share { margin-top: 12px; align-items: center; }
.share code { color: var(--accent); font-size: 16px; }

/* ── Mobile & compact refinements ──────────────────────────────────────── */
@media (max-width: 768px) {
  .head-links .head-subtle { display: none; }
  .hero-dock {
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
  }
  .hero-copy h1 span { display: block; }
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .btn-hero,
  .btn-hero-sec {
    width: 100%;
    text-align: center;
  }
  .foot-note { display: none; }
  #create button { width: 100%; }
  .section-head { flex-wrap: wrap; }
}
