/* The app's own type and frame (app/src/styles/tokens.css, docs/DESIGN_SYSTEM.md): black, Jost
   light for the name, Inter light for the sentence, Inter Tight capitals for everything small. */
@font-face {
  font-family: 'Jost';
  font-weight: 300;
  font-display: swap;
  src: url('/fonts/jost-latin-300-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-weight: 300;
  font-display: swap;
  src: url('/fonts/inter-latin-300-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter Tight';
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/inter-tight-latin-400-normal.woff2') format('woff2');
}

:root {
  color-scheme: dark;
  --bg: #000000;
  --text: #ededea;
  --muted: #9a9a97;
  --faint: #6c6c69;
  --rule: #2a2a2a;
  --warning: #d99a76;
  --t1-size: 11.5px;
  --t1-color: #efefe8;
  --t2-size: 11px;
  --t2-color: #8c8c88;
  --hud-x: 28px;
  --hud-top: calc(24px + env(safe-area-inset-top));
  --hud-bottom: calc(24px + env(safe-area-inset-bottom));
  --inset: clamp(24px, 6.2vw, 112px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (max-width: 700px) {
  :root {
    --t1-size: 12px;
    --t2-size: 11.5px;
    --hud-x: 20px;
    --hud-top: calc(20px + env(safe-area-inset-top));
    --hud-bottom: calc(20px + env(safe-area-inset-bottom));
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Inter', -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-weight: 300;
}

.t1,
.t2 {
  font-family: 'Inter Tight', 'Helvetica Neue', Arial, sans-serif;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
}
.t1 {
  font-size: var(--t1-size);
  color: var(--t1-color);
}
.t2 {
  font-size: var(--t2-size);
  color: var(--t2-color);
}

button {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

#map {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  transition: opacity 2.4s var(--ease);
}
#map.on {
  opacity: 1;
}

.hud {
  position: fixed;
  pointer-events: none;
}
.hud > * {
  pointer-events: auto;
}
.hud.top {
  top: var(--hud-top);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  z-index: 25;
}
.hud.foot {
  bottom: var(--hud-bottom);
  left: var(--hud-x);
  right: var(--hud-x);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 25;
}

/* Centered Top Brand Cluster */
.brand-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  padding: 4px 16px;
  user-select: none;
  -webkit-user-select: none;
}
.brand-title {
  font-family: 'Inter Tight', 'Inter', -apple-system, sans-serif;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: #ffffff;
  line-height: 1.1;
  text-indent: 0.32em;
}
.brand-sub {
  font-family: 'Inter Tight', 'Inter', -apple-system, sans-serif;
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.58);
  line-height: 1.1;
  margin-top: 3px;
  text-indent: 0.24em;
  transition: color 0.3s var(--ease);
}
.brand-center:hover .brand-sub,
.brand-center:focus-visible .brand-sub {
  color: rgba(255, 255, 255, 0.9);
}

/* Hover reveal panel under top header */
.brand-hover-panel {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 7px;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.hud.top:hover .brand-hover-panel,
.hud.top:focus-within .brand-hover-panel,
.brand-hover-panel.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.top-support-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: 'Inter Tight', sans-serif;
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  padding: 3px 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(6px);
  transition: all 0.25s var(--ease);
}
.top-support-link:hover {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
}

.social-mini {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

/* Footer elements */
.foot-label {
  font-family: 'Inter Tight', 'Inter', -apple-system, sans-serif;
  font-size: 9.5px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #6a6a66;
  text-decoration: none;
  transition: color 0.25s var(--ease);
}
button.foot-label {
  appearance: none;
  background: none;
  border: 0;
  padding: 6px 0;
  cursor: pointer;
}
button.foot-label:hover,
button.foot-label:focus-visible {
  color: #ffffff;
}

.foot-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.support-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: 'Inter Tight', sans-serif;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #efefe8;
  text-decoration: none;
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(8px);
  transition: all 0.25s var(--ease);
}
.support-btn:hover,
.support-btn:focus-visible {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
  transform: translateY(-1px);
}
.support-btn svg,
.top-support-link svg {
  transition: transform 0.25s var(--ease);
}
.support-btn:hover svg,
.top-support-link:hover svg {
  transform: translate(1px, -1px);
}

.foot-socials {
  display: flex;
  align-items: center;
  gap: 8px;
}
.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #6a6a66;
  text-decoration: none;
  padding: 3px;
  border-radius: 4px;
  transition: color 0.25s var(--ease), transform 0.25s var(--ease);
}
.social-link:hover,
.social-link:focus-visible {
  color: #ffffff;
  transform: translateY(-1px);
}

main {
  position: fixed;
  left: 50%;
  bottom: calc(var(--hud-bottom) + clamp(36px, 8vh, 80px));
  transform: translate(-50%, 0);
  width: min(440px, calc(100% - 40px));
  opacity: 0;
  animation: rise 1.6s var(--ease) 0.5s forwards;
  transition: opacity 1.8s var(--ease), transform 1.8s var(--ease), filter 1.8s var(--ease);
  z-index: 10;
  text-align: center;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translate(-50%, 12px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

main.vanish {
  animation: none !important;
  opacity: 0 !important;
  transform: translate(-50%, 28px) scale(0.96) !important;
  filter: blur(8px) !important;
  pointer-events: none !important;
  visibility: hidden;
  transition: opacity 1.4s var(--ease), transform 1.4s var(--ease), filter 1.4s var(--ease), visibility 1.4s !important;
}

/* The Seeps' names, as the map sets them: small capitals beside each droplet. */
#labels {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.seep-label {
  position: absolute;
  left: 0;
  top: 0;
  max-width: 130px;
  line-height: 1.35;
  font-family: 'Inter Tight', 'Helvetica Neue', Arial, sans-serif;
  font-size: var(--t2-size);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--t2-color);
  opacity: 0;
  will-change: transform, opacity;
}
.seep-label.read {
  margin-top: -1px;
  font-size: var(--t1-size);
  color: #ffffff;
}

.form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  width: 100%;
}
.form-header label {
  margin-bottom: 0;
}

.welcome-badge {
  opacity: 0;
  transform: translateY(3px);
  color: #ffffff;
  letter-spacing: 0.2em;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
  pointer-events: none;
}
.welcome-badge.visible {
  opacity: 1;
  transform: translateY(0);
}

.line {
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--rule);
  transition: border-color 0.6s var(--ease);
  width: 100%;
}
.line:focus-within {
  border-color: var(--faint);
}
.line.wrong {
  border-color: var(--warning);
}
.line.success {
  border-color: #ffffff;
}

input[type='email'] {
  flex: 1;
  min-width: 0;
  appearance: none;
  background: transparent;
  border: 0;
  border-radius: 0;
  outline: none;
  padding: 12px 0 12px;
  font: inherit;
  font-size: 18px;
  font-weight: 300;
  letter-spacing: 0.02em;
  color: var(--text);
  caret-color: #ffffff;
}
input[type='email']:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  transition: background-color 9999s;
}

#join button {
  padding: 12px 0 12px 14px;
  margin-right: -2px;
  font-size: 12px;
  letter-spacing: 0.2em;
  font-weight: 500;
  transition: color 0.4s var(--ease), opacity 0.4s var(--ease);
}
#join button:hover,
#join button:focus-visible {
  color: #ffffff;
  outline: none;
}
#join button:disabled {
  opacity: 0.65;
  cursor: default;
}

.trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

#say {
  margin: 16px auto 0;
  text-align: center;
  font-size: 13px;
  letter-spacing: 0.1em;
  line-height: 1.5;
  min-height: 1.6em;
  color: var(--t2-color);
  transition: color 0.6s var(--ease), opacity 0.6s var(--ease);
}
#say.lit {
  color: #ffffff;
}
#say.wrong {
  color: var(--warning);
}

#leave {
  margin-top: 22px;
  padding: 6px 0;
  border-bottom: 1px solid var(--faint);
}

dialog {
  max-width: min(420px, calc(100% - 36px));
  padding: 28px 28px 22px;
  background: #0d0d0d;
  color: var(--muted);
  border: 1px solid var(--rule);
  font-size: 14px;
  line-height: 1.6;
}
dialog::backdrop {
  background: rgb(0 0 0 / 0.7);
  backdrop-filter: blur(6px);
}
dialog p {
  margin: 0 0 14px;
}
dialog p.t1 {
  margin-bottom: 18px;
}
dialog form {
  margin-top: 22px;
  text-align: right;
}

:focus-visible {
  outline: 1px solid var(--faint);
  outline-offset: 4px;
}

@media (max-width: 700px) {
  main {
    bottom: calc(var(--hud-bottom) + clamp(28px, 6vh, 56px));
    width: min(380px, calc(100% - 32px));
  }
  input[type='email'] {
    font-size: 17px;
  }
  .brand-title {
    font-size: 11px;
    letter-spacing: 0.28em;
  }
  .brand-sub {
    font-size: 8.5px;
    letter-spacing: 0.20em;
  }
  .foot-actions {
    gap: 8px;
  }
  .foot-socials {
    gap: 6px;
  }
  .support-btn {
    padding: 3.5px 8px;
    font-size: 8.5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  main {
    animation: none;
    opacity: 1;
    transform: translate(-50%, 0);
  }
  #map {
    transition: none;
  }
}
