:root {
  color-scheme: light;
  font: 16px/1.5 system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: #18251f;
  background: #f1f3ed;
  --ink: #18251f;
  --muted: #526359;
  --line: #d4dcd2;
  --paper: #fcfdfa;
  --lime: #d6f589;
  --gutter: clamp(1.125rem, 4vw, 3.5rem);
}

*, *::before, *::after {
  box-sizing: border-box;
}

body { margin: 0; }

main {
  max-width: 70rem;
  padding: var(--gutter);
  margin: auto;
}

h1, h2, p { margin-block-start: 0; }

h1 {
  margin-block-end: 1rem;
  font-size: clamp(2.45rem, 5.25vw, 5rem);
  line-height: .99;
  letter-spacing: -.065em;
}

h2 { line-height: 1.2; letter-spacing: -.025em; }

.brand, .eyebrow {
  color: #355045;
  font-size: .72rem;
  font-weight: 750;
  letter-spacing: .15em;
  text-transform: uppercase;
}

button, input { font: inherit; }

:where(.welcome-copy, .share-controls, .videos, .account-page) button,
.button, input[type="email"], input[type="text"], input[type="url"] {
  min-height: 2.75rem;
  border: 1px solid var(--line);
  border-radius: .65rem;
}

:where(.welcome-copy, .share-controls, .videos, .account-page) button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  padding: .65rem 1rem;
  color: var(--ink);
  background: var(--paper);
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}

:where(.welcome-copy, .share-controls, .videos, .account-page) button:not(:disabled):hover,
.button:hover { border-color: #789184; background: #e9efe7; }

button:disabled { opacity: .55; cursor: default; }

:focus-visible { outline: 3px solid #528366; outline-offset: 3px; }

a { color: #264d3b; text-underline-offset: .2em; }

input[type="email"], input[type="text"], input[type="url"] {
  padding: .65rem .85rem;
  background: #f6f8f3;
  color: var(--ink);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .65rem;
}

.shell {
  width: min(calc(100% - 2 * var(--gutter)), 74rem);
  margin-inline: auto;
}

.site-header, .site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.site-header { min-height: 5.25rem; }

.site-nav, .wordmark {
  display: flex;
  align-items: center;
  gap: .65rem;
}

.wordmark {
  color: var(--ink);
  font-size: 1.16rem;
  font-weight: 760;
  letter-spacing: -.045em;
  text-decoration: none;
}

.wordmark-icon {
  display: grid;
  place-items: center;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: .7rem;
  background: #20382e;
  color: var(--lime);
}

.wordmark-icon svg { width: 1.2rem; height: 1.2rem; }

.nav-link {
  padding: .65rem .4rem;
  color: var(--ink);
  font-size: .92rem;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}

.nav-link:hover { text-decoration: underline; }

.button-dark, button.button-dark {
  border-color: #20382e;
  background: #20382e;
  color: #fcfff9;
  white-space: nowrap;
}

.button-dark:hover, button.button-dark:not(:disabled):hover {
  border-color: #355747;
  background: #355747;
}

.call-shell { padding: clamp(1.25rem, 5vw, 4rem) 0 2rem; }

.welcome {
  display: grid;
  grid-template-columns: 1.04fr 1fr;
  padding: .7rem;
  border: 1px solid var(--line);
  border-radius: 1.75rem;
  background: var(--paper);
  box-shadow: 0 1rem 4rem #1a362011, 0 .1rem .35rem #1a362007;
}

.welcome-copy {
  align-self: center;
  min-width: 0;
  padding: clamp(1.5rem, 4.5vw, 4.2rem);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: 1.2rem;
}

.eyebrow-mark {
  width: .5rem;
  height: .5rem;
  border-radius: 50%;
  background: #638768;
  box-shadow: 0 0 0 3px #e7eee3;
}

#invite-code {
  text-transform: none;
}

.welcome-intro {
  max-width: 33ch;
  margin-bottom: 1.65rem;
  color: var(--muted);
  font-size: clamp(1rem, 1.5vw, 1.12rem);
  line-height: 1.6;
}

.call-actions { margin-bottom: .85rem; }

button.button-primary {
  min-height: 3.15rem;
  padding-inline: 1.1rem 1.3rem;
  border-color: #b8d775;
  background: var(--lime);
  color: #1c2d20;
}

button.button-primary:not(:disabled):hover { border-color: #8eac52; background: #c9eb78; }
.button-primary svg { width: 1.25rem; height: 1.25rem; }

.call-status {
  display: flex;
  align-items: baseline;
  gap: .45rem;
  min-height: 1.5rem;
  margin: 0;
  color: var(--muted);
  font-size: .88rem;
}

.call-status::before {
  content: "";
  flex: 0 0 .36rem;
  height: .36rem;
  border-radius: 50%;
  background: #6b8776;
  transform: translateY(-.08rem);
}

.invite-art {
  display: grid;
  align-content: space-between;
  gap: .5rem;
  min-width: 0;
  min-height: 25rem;
  padding: clamp(.95rem, 2.1vw, 1.6rem);
  border-radius: 1.2rem;
  background: radial-gradient(ellipse at center, #294638, #182a22 77%);
  color: #c6d9c9;
}

.art-top, .art-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  color: #b7cbbd;
  font: 600 clamp(.59rem, 1vw, .72rem)/1.4 ui-monospace, monospace;
  letter-spacing: .12em;
}

.art-top i {
  display: inline-block;
  width: .42rem;
  height: .42rem;
  margin-right: .28rem;
  border-radius: 50%;
  background: var(--lime);
}

.art-diagram { display: block; width: min(100%, 29rem); margin: auto; }

.site-footer {
  padding: 1rem 0 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .77rem;
}

.site-footer span:first-child { font-weight: 750; letter-spacing: .1em; }

.call-shell.in-call .welcome { grid-template-columns: minmax(0, 1fr); }
.call-shell.in-call .welcome-copy { padding: clamp(1rem, 2.5vw, 2rem); }
.call-shell.in-call h1 { font-size: clamp(2rem, 4vw, 3rem); }
.call-shell.in-call .invite-art, .call-shell.in-call .welcome-intro, .call-shell.in-call #open-invite { display: none; }

button.button-danger { border-color: #e6c7c3; background: #faeeeb; color: #8b322e; }
button.button-danger:not(:disabled):hover { border-color: #c67d75; background: #f7ddd8; }

.call-panel {
  margin-top: 1rem;
  padding: clamp(1rem, 2.5vw, 2rem);
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  background: var(--paper);
}

.call-panel label { font-weight: 700; }
.muted { color: var(--muted); }

.share-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .6rem;
  margin-top: .7rem;
}

#invite { flex: 1 1 15rem; min-width: 0; }
#share-status { margin: .45rem 0 0; color: var(--muted); }
#share-status:empty { display: none; }

#scene-viewport {
  height: clamp(18rem, 65vh, 36rem);
  border-radius: .8rem;
  overflow: hidden;
  color-scheme: dark;
}

.videos {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

.call-shell.has-scene .videos {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  max-width: 34rem;
}

/* Keep the video laid out for inline playback while WebGL draws its frames. */
.guest-call.has-scene .videos {
  position: absolute;
  width: 16rem;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

/* A tap, double tap or long press anywhere on the call page neither zooms the page nor
   selects text and opens the Copy, Look Up, Translate menu (November 10, 2026), before a
   call as well as in one. Pinch zoom still works; text fields stay selectable. */
body.call-page {
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
body.call-page input,
body.call-page textarea { user-select: text; -webkit-user-select: text; -webkit-touch-callout: default; }

/* Microphone, camera and end call as glyphs in the upper left corner for the whole call, over the
   page and over a full screen scene (November 11, 2026). The header gives up that corner. */
body.in-call .site-header { visibility: hidden; }
.call-glyphs {
  position: fixed;
  top: max(.6rem, env(safe-area-inset-top));
  left: max(.6rem, env(safe-area-inset-left));
  z-index: 60;
  display: flex;
  gap: .45rem;
}
.call-glyphs[hidden] { display: none; }
.glyph-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid rgba(148, 163, 184, .55);
  border-radius: 50%;
  background: rgba(15, 23, 42, .82);
  color: #e2e8f0;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-touch-callout: none;
}
.glyph-button svg { width: 1.35rem; height: 1.35rem; }
.glyph-button .glyph-off { display: none; }
.glyph-button[aria-pressed="true"] { border-color: #f1f5f9; background: #f1f5f9; color: #8b322e; }
.glyph-button[aria-pressed="true"] .glyph-off { display: inline; }
.glyph-button.glyph-end { border-color: #e88b80; background: #c0392b; color: #fff; }
.glyph-button:active { filter: brightness(1.25); }

body:has(.scene-fullscreen) { overflow: hidden; overscroll-behavior: none; }
.scene-fullscreen #scene {
  position: fixed;
  inset: 0;
  z-index: 50;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.scene-fullscreen #scene-title { display: none; }
.scene-fullscreen #scene-viewport { height: 100%; height: 100dvh; border-radius: 0; }
.scene-fullscreen .call-actions {
  position: fixed;
  top: max(.45rem, env(safe-area-inset-top));
  left: calc(max(.6rem, env(safe-area-inset-left)) + 9.9rem);
  right: calc(max(.45rem, env(safe-area-inset-right)) + clamp(7.5rem, 30vw, 15rem) + 3.5rem);
  z-index: 51;
  margin: 0;
  pointer-events: none;
}

.scene-fullscreen .call-actions button {
  min-height: 32px;
  padding: .25rem .65rem;
  font-size: .75rem;
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-touch-callout: none;
}

.scene-touch { --touch-bottom: max(2rem, calc(env(safe-area-inset-bottom) + .8rem)); }
.scene-touch [data-model_scene_control="fullscreen"] {
  top: max(.45rem, env(safe-area-inset-top)) !important;
  right: calc(max(.45rem, env(safe-area-inset-right)) + clamp(7.5rem, 30vw, 15rem) + .4rem) !important;
  width: 44px !important;
  height: 44px !important;
}

@media (pointer: coarse) {
  .scene-touch [data-model_scene_control="compass"] { display: none; }
  .scene-viewpoints {
    position: absolute;
    z-index: 35;
    top: max(.45rem, env(safe-area-inset-top));
    right: max(.45rem, env(safe-area-inset-right));
    width: clamp(7.5rem, 30vw, 15rem);
  }
  .scene-viewpoints button {
    display: block;
    width: 100%;
    min-height: 44px;
    padding: .35rem .55rem;
    background: #101b25;
    color: #e2e8f0;
    border: 1px solid #64748b;
    border-radius: .4rem;
    font: 16px system-ui, sans-serif;
    touch-action: manipulation;
    overflow-wrap: anywhere;
  }
  .scene-viewpoints-list {
    max-height: min(60dvh, 24rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
    margin-top: .25rem;
  }
  .scene-viewpoints-list button[aria-pressed="true"] {
    border-color: #9ddeba;
  }
}

.scene-touch [data-model_scene_control="avatar"] {
  top: max(.45rem, env(safe-area-inset-top));
  right: max(.45rem, env(safe-area-inset-right)) !important;
  bottom: auto !important;
  max-width: clamp(7.5rem, 30vw, 15rem) !important;
}

.scene-touch [data-model_scene_control="slide_show"] {
  right: auto !important;
  left: 50%;
  bottom: calc(var(--touch-bottom) + .5rem) !important;
  transform: translateX(-50%);
}
.scene-stick {
  position: absolute;
  bottom: var(--touch-bottom);
  z-index: 34;
  display: grid;
  width: clamp(70px, 22vmin, 104px);
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid #eff9ff82;
  border-radius: 50%;
  background: #101b255c;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.scene-stick-move { left: max(14px, env(safe-area-inset-left)); }
.scene-stick-look { right: max(14px, env(safe-area-inset-right)); }
.scene-stick-knob {
  width: 43%;
  aspect-ratio: 1;
  border: 1px solid #eff9ff9c;
  border-radius: 50%;
  background: #eff9ff52;
  pointer-events: none;
}

figure {
  min-width: 0;
  margin: 0;
  padding: .5rem;
  border-radius: 1rem;
  background: #20382e;
}

video {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: .65rem;
  background: #111c17;
  object-fit: contain;
}

figcaption { padding: .45rem .4rem .2rem; color: #e2eee5; font-size: .87rem; }
figure button { margin: .4rem; }

.account-page { max-width: 40rem; }

.account-page h1 { font-size: clamp(2.4rem, 6vw, 3.5rem); }

.account-card {
  padding: clamp(1.2rem, 4vw, 2.5rem);
  border: 1px solid var(--line);
  border-radius: 1.4rem;
  background: var(--paper);
  box-shadow: 0 1rem 4rem #1a362011;
}

#account-status:empty { display: none; }

.account-page form { margin: 1rem 0; }

#account-email {
  display: block;
  width: 100%;
  margin: .4rem 0 .8rem;
}

#square-card {
  color-scheme: light;
  margin-bottom: .8rem;
}

.consent {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  margin: 1rem 0;
}

[hidden] { display: none !important; }

@media (max-width: 47rem) {
  .welcome { grid-template-columns: minmax(0, 1fr); }
  .welcome-copy { padding: 1.75rem 1.3rem; }
  .invite-art { min-height: 0; }
  .art-diagram { width: min(100%, 20rem); }
  .call-shell { padding-top: .6rem; }
}

@media (max-width: 29rem) {
  .site-header { min-height: 4.5rem; gap: .45rem; }
  .site-nav { gap: .35rem; }
  .site-nav .button { padding-inline: .65rem; font-size: .9rem; }
  .wordmark { gap: .42rem; font-size: 1.05rem; }
  .wordmark-icon { width: 1.85rem; height: 1.85rem; }
  .videos { grid-template-columns: minmax(0, 1fr); }
}
