/* =========================================================
   EXOTICS BY RICK — matte black / off-white, ultra minimal
   Vertical, intimate, photo-anchored chat
   ========================================================= */

:root {
  --bg: #0a0a0a;            /* matte black (bottom) */
  --bg-2: #0f0f0f;
  --cream: #efece4;         /* off-white (top) */
  --cream-2: #e3dfd3;
  --line: #1d1d1d;
  --line-light: rgba(10, 10, 10, 0.12);
  --ink: #efece4;
  --ink-2: #d6d2c6;
  --ink-dark: #0a0a0a;
  --ink-dark-2: #3a3833;
  --muted: #8a8780;
  --muted-dark: #6b6862;
  --bubble-rick: #161616;
  --bubble-rick-line: #232323;
  --bubble-you: #efece4;
  --bubble-you-ink: #0a0a0a;
  --bubble-you-line: #28261f;
  --radius: 18px;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --shadow-soft: 0 30px 80px -30px rgba(0, 0, 0, 0.85);
  --shadow-avatar: 0 50px 100px -20px rgba(0, 0, 0, 0.7),
                   0 20px 40px -10px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 300;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Cinematic backdrop: matte black with a warm sub-gallery glow.
   Three layered "lights" give the page depth without any obvious gradient:
   - a soft top spotlight where the avatar floats
   - a deep vignette pulling focus toward center
   - a barely-there warm bias on one side, cool on the other (museum lighting) */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    /* Warm key light from upper center — where Rick's portrait sits */
    radial-gradient(
      ellipse 55% 45% at 50% 22%,
      rgba(255, 223, 186, 0.10) 0%,
      rgba(255, 223, 186, 0.05) 35%,
      transparent 70%
    ),
    /* Cool fill from lower right */
    radial-gradient(
      ellipse 60% 50% at 88% 90%,
      rgba(180, 200, 220, 0.045) 0%,
      transparent 70%
    ),
    /* Subtle warm bias from lower left */
    radial-gradient(
      ellipse 50% 40% at 8% 80%,
      rgba(230, 200, 160, 0.04) 0%,
      transparent 70%
    ),
    /* Deep vignette pulling focus to center */
    radial-gradient(
      ellipse 100% 100% at 50% 50%,
      transparent 30%,
      rgba(0, 0, 0, 0.55) 100%
    ),
    /* Base depth — almost imperceptible top-to-bottom darken */
    linear-gradient(180deg, #0d0d0d 0%, #060606 100%);
}

/* Cursor-tracking ambient light — a soft warm spotlight that follows
   the user's pointer. Created in JS, sits beneath all content. */
.ambient {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.9;
  background: radial-gradient(
    circle 600px at var(--mx, 50%) var(--my, 30%),
    rgba(255, 220, 180, 0.07) 0%,
    rgba(255, 220, 180, 0.03) 25%,
    transparent 60%
  );
  transition: opacity 1s ease;
}

/* Tactile film grain — keeps gradients from looking digital */
body::after {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  opacity: 0.06;
  mix-blend-mode: overlay;
  z-index: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.5 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* -------- Top bar (sticky, glass on matte black) -------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 36px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  background: linear-gradient(180deg, rgba(10,10,10,0.55), rgba(10,10,10,0.25));
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  white-space: nowrap;
}
.brand .mark { font-weight: 500; color: var(--ink); }
.brand .mark.light { color: var(--muted); font-weight: 400; }
.brand .divider { color: var(--muted); }
.nav { display: flex; gap: 26px; }
.nav-link {
  color: var(--ink-2); text-decoration: none;
  font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase;
  position: relative; padding-bottom: 2px;
  transition: color .25s ease;
}
.nav-link::after {
  content: ""; position: absolute;
  left: 0; bottom: -2px;
  width: 0; height: 1px; background: var(--ink);
  transition: width .35s ease;
}
.nav-link:hover { color: var(--ink); }
.nav-link:hover::after { width: 100%; }

/* -------- Stage -------- */
.stage {
  position: relative; z-index: 1;
  flex: 1;
  display: grid;
  place-items: start center;
  padding: clamp(28px, 6vh, 80px) 20px 60px;
}

/* -------- Contact card layout -------- */
.contact {
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Floating avatar */
.avatar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-bottom: 36px;
}
.avatar {
  position: relative;
  width: clamp(150px, 28vw, 220px);
  height: clamp(150px, 28vw, 220px);
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(180deg, #1a1a1a 0%, #0c0c0c 100%);
  border: 1px solid rgba(239, 236, 228, 0.08);
  box-shadow:
    0 0 0 1px rgba(239, 236, 228, 0.04),
    0 30px 70px -20px rgba(0, 0, 0, 0.9),
    0 0 80px rgba(255, 220, 180, 0.08);
  animation: float 6s ease-in-out infinite;
}
.avatar::after {
  /* subtle inner highlight rim */
  content: "";
  position: absolute; inset: 0;
  border-radius: 50%;
  box-shadow: inset 0 1px 0 rgba(239, 236, 228, 0.08), inset 0 -30px 60px rgba(0,0,0,0.5);
  pointer-events: none;
}
.avatar img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  filter: contrast(1.04) saturate(0.95);
}
.avatar img.missing { display: none; }
.avatar:has(img.missing)::before {
  content: "rick.jpg";
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: 10px; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--muted);
  background: repeating-linear-gradient(45deg, #0e0e0e 0 10px, #121212 10px 20px);
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

.status {
  display: inline-flex; align-items: center; gap: 9px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}
.status .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #7CFC9A;
  box-shadow: 0 0 0 4px rgba(124, 252, 154, 0.12);
  animation: pulse 2.2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.55; }
}

/* -------- Chat thread -------- */
.thread {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 40px;
}

.msg {
  max-width: 82%;
  padding: 11px 16px;
  border-radius: 20px;
  font-size: 15.5px;
  line-height: 1.45;
  word-wrap: break-word;
  position: relative;
  animation: bubble-in .35s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes bubble-in {
  from { opacity: 0; transform: translateY(6px) scale(.97); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

.msg.rick {
  align-self: flex-start;
  background: var(--bubble-rick);
  border: 1px solid var(--bubble-rick-line);
  color: var(--ink);
  border-bottom-left-radius: 6px;
}
/* tail on the very first Rick bubble — points toward the avatar */
.msg.rick.first::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 22px;
  width: 14px;
  height: 14px;
  background: var(--bubble-rick);
  border-left: 1px solid var(--bubble-rick-line);
  border-top: 1px solid var(--bubble-rick-line);
  transform: rotate(45deg);
  border-top-left-radius: 4px;
}

.msg.you {
  align-self: flex-end;
  background: var(--bubble-you);
  color: var(--bubble-you-ink);
  border-bottom-right-radius: 6px;
  font-weight: 400;
}

/* Blinking cursor inside a typing message */
.msg .caret {
  display: inline-block;
  width: 6px;
  height: 1em;
  vertical-align: -2px;
  margin-left: 2px;
  background: currentColor;
  opacity: 0.6;
  animation: caret 1s steps(1) infinite;
}
@keyframes caret {
  50% { opacity: 0; }
}

/* Typing dots bubble (between Rick messages) */
.typing {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 14px 16px;
  background: var(--bubble-rick);
  border: 1px solid var(--bubble-rick-line);
  border-radius: 20px;
  border-bottom-left-radius: 6px;
  align-self: flex-start;
  animation: bubble-in .25s ease both;
}
.typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--muted);
  animation: blink 1.2s infinite ease-in-out;
}
.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes blink {
  0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-2px); }
}

/* -------- Input dock -------- */
.dock {
  margin-top: 18px;
  width: 100%;
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 5px 5px 5px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-2);
  transition: border-color .2s ease, background .2s ease, opacity .3s ease;
}
.dock:focus-within {
  border-color: #2e2e2e;
  background: #141414;
}
.dock input {
  flex: 1;
  border: 0; outline: none;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: 15px;
  font-weight: 300;
  padding: 12px 0;
}
.dock input::placeholder { color: var(--muted); }
.dock input:disabled { opacity: 0.6; }
.dock button {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 0;
  background: var(--ink);
  color: var(--bg);
  display: grid; place-items: center;
  cursor: pointer;
  transition: transform .15s ease, background .2s ease, opacity .2s ease;
}
.dock button:hover:not(:disabled) { transform: translateX(1px); background: #fff; }
.dock button:disabled { opacity: 0.35; cursor: not-allowed; }
.dock.done { opacity: 0.4; pointer-events: none; }

/* -------- Final CTA row -------- */
.cta-row {
  margin-top: 22px;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  animation: rise .6s ease both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.cta {
  display: flex; flex-direction: column; gap: 4px;
  padding: 18px 20px;
  border-radius: 14px;
  text-decoration: none;
  border: 1px solid var(--line);
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.cta:hover { transform: translateY(-2px); }
.cta .cta-label {
  font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase; font-weight: 500;
}
.cta .cta-sub { font-size: 11px; color: var(--muted); letter-spacing: 0.04em; }
.cta.primary {
  background: var(--ink); color: var(--bg); border-color: var(--ink);
}
.cta.primary .cta-sub { color: rgba(10,10,10,0.55); }
.cta.primary:hover { background: #fff; border-color: #fff; }
.cta.ghost { background: transparent; color: var(--ink); }
.cta.ghost:hover { border-color: var(--ink-2); }

/* -------- Footer -------- */
.foot {
  position: relative; z-index: 1;
  display: flex; justify-content: space-between; align-items: center;
  padding: 22px 36px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase;
}

/* -------- Responsive -------- */
@media (max-width: 640px) {
  .topbar { padding: 16px 18px; }
  .nav { gap: 16px; }
  .nav-link { font-size: 11px; letter-spacing: 0.18em; }
  .brand { font-size: 10.5px; letter-spacing: 0.22em; gap: 8px; }
  .stage { padding: 28px 18px 50px; }
  .foot { padding: 18px 20px; flex-direction: column; gap: 6px; text-align: center; }
  .cta-row { grid-template-columns: 1fr; }
  .avatar-wrap { margin-bottom: 28px; }
  .msg { font-size: 15px; }
}
@media (max-width: 420px) {
  .topbar { padding: 14px 14px; }
  .brand { font-size: 9.5px; letter-spacing: 0.18em; gap: 6px; }
  .nav { gap: 12px; }
  .nav-link { font-size: 10px; letter-spacing: 0.12em; }
}
@media (max-width: 360px) {
  .brand { font-size: 9px; letter-spacing: 0.14em; gap: 5px; }
  .nav { gap: 10px; }
  .nav-link { font-size: 9.5px; letter-spacing: 0.1em; }
}

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