/* Gramo homepage composer — thread, attach, kind toggle, paywall. */

#gramo-studio,
.gramo-studio,
#gs-pay {
  --gs-bg: #090a10;
  --gs-cyan: #46d9e8;
  --gs-cyan-rgb: 70, 217, 232;
  --gs-violet: #8284ff;
  --gs-violet-rgb: 130, 132, 255;
  --gs-gold: #d4a853;
  --gs-gold-rgb: 212, 168, 83;
  --gs-gold-light: #e8c97a;
  --gs-text: #f2f3f8;
}

#gramo-studio,
.gramo-studio {
  width: min(760px, 100%);
  margin: 44px auto 0;
  text-align: left;
  scroll-margin-top: calc(var(--gramo-header-h, 56px) + 24px);
}

#gramo-studio > .prompt-card,
#gramo-studio #gs-form.prompt-card {
  width: 100%;
  margin-top: 0;
  overflow: hidden;
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  background: linear-gradient(165deg, rgba(255,255,255,.09), rgba(255,255,255,.03));
  border: 1px solid rgba(255,255,255,.14);
  box-shadow:
    0 28px 80px rgba(0,0,0,.42),
    0 0 80px rgba(var(--gs-cyan-rgb), .12),
    0 0 0 1px rgba(255,255,255,.05) inset;
}
#gramo-studio #gs-form.prompt-card:focus-within {
  border-color: rgba(var(--gs-cyan-rgb), .38);
  box-shadow:
    0 28px 80px rgba(0,0,0,.42),
    0 0 90px rgba(var(--gs-cyan-rgb), .22),
    0 0 0 1px rgba(var(--gs-cyan-rgb), .18) inset;
}

#gs-thread {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: min(48vh, 560px);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 2px 2px 16px;
  margin: 0 0 10px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}

#gs-thread:empty,
#gs-thread[hidden] {
  display: none;
}

.gs-row {
  display: flex;
  width: 100%;
  animation: gs-in 0.28s ease;
}

.gs-row-user { justify-content: flex-end; }
.gs-row-asst,
.gs-row-video,
.gs-row-error { justify-content: flex-start; }

.gs-bubble {
  max-width: min(86%, 540px);
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: -0.02em;
  white-space: pre-wrap;
  word-break: break-word;
}

.gs-row-user .gs-bubble {
  background: rgba(var(--gs-cyan-rgb), 0.14);
  border: 1px solid rgba(var(--gs-cyan-rgb), 0.2);
  color: #e8fbfe;
  border-bottom-right-radius: 6px;
}

.gs-row-asst .gs-bubble {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--gs-text);
  border-bottom-left-radius: 6px;
}

.gs-row-error .gs-bubble {
  background: rgba(255, 120, 100, 0.08);
  border: 1px solid rgba(255, 160, 140, 0.22);
  color: #ffc8bc;
  border-bottom-left-radius: 6px;
}

.gs-user-thumb {
  display: block;
  width: 56px;
  height: 56px;
  margin: 0 0 8px auto;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.gs-video-card {
  position: relative;
  width: min(280px, 72vw);
  aspect-ratio: 9 / 16;
  max-height: 56vh;
  border-radius: 22px;
  overflow: hidden;
  background: var(--gs-bg);
  box-shadow:
    0 0 0 1px rgba(var(--gs-gold-rgb), 0.42),
    0 0 0 2px rgba(var(--gs-cyan-rgb), 0.28),
    0 20px 50px rgba(0, 0, 0, 0.45);
}

.gs-video-card video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  background: var(--gs-bg);
}

.gs-video-card.is-generating {
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse at 50% 20%, rgba(var(--gs-cyan-rgb), 0.16), transparent 58%),
    radial-gradient(ellipse at 80% 90%, rgba(var(--gs-gold-rgb), 0.12), transparent 50%),
    var(--gs-bg);
}

.gs-gen-copy {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 0 18px;
  text-align: center;
  color: var(--gs-gold-light);
  font-size: 14px;
  font-weight: 620;
  letter-spacing: 0.02em;
}

.gs-gen-sub {
  display: block;
  margin-top: 8px;
  color: rgba(180, 184, 205, 0.62);
  font-size: 12px;
  font-weight: 500;
}

.gs-gen-pulse {
  position: absolute;
  inset: -20%;
  background:
    conic-gradient(from 180deg, transparent, rgba(var(--gs-cyan-rgb), 0.22), transparent 40%);
  animation: gs-spin 3.6s linear infinite;
}

#gs-attach.gs-attach,
.gs-attach {
  display: none;
  position: relative;
  width: 72px;
  height: 72px;
  margin: 10px 10px 0;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #05060a;
}

#gs-attach.is-on,
#gs-attach:not(.hidden):not([hidden]) {
  display: block;
}

#gs-attach.hidden,
#gs-attach[hidden] { display: none !important; }

#gs-attach-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

#gs-attach-x,
.gs-attach-x {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 99px;
  background: rgba(9, 10, 16, 0.78);
  color: #f2f3f8;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

#gramo-studio .gs-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

#gramo-studio .gs-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(180, 184, 205, 0.88);
  display: grid;
  place-items: center;
  cursor: pointer;
}

#gramo-studio .gs-icon:hover {
  border-color: rgba(var(--gs-cyan-rgb), 0.4);
  color: var(--gs-cyan);
}

#gramo-studio .gs-kind {
  display: inline-flex;
  flex-shrink: 0;
  padding: 2px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.28);
}

#gramo-studio .gs-kind-btn {
  border: 0;
  background: transparent;
  color: rgba(180, 184, 205, 0.68);
  font-size: 12px;
  font-weight: 620;
  letter-spacing: 0.02em;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  line-height: 1.2;
}

#gramo-studio .gs-kind-btn.is-on[data-kind="human"] {
  background: rgba(var(--gs-cyan-rgb), 0.16);
  color: var(--gs-cyan);
}

#gramo-studio .gs-kind-btn.is-on[data-kind="pet"] {
  background: rgba(var(--gs-gold-rgb), 0.18);
  color: var(--gs-gold-light);
}

#gramo-studio #gs-hint.prompt-hint {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#gs-input.prompt-input,
#gramo-studio textarea.gs-input {
  display: block;
  width: 100%;
  resize: none;
  min-height: 64px;
  max-height: 180px;
  overflow-y: auto;
  outline: none;
  font-family: inherit;
}

#gs-input.prompt-input::placeholder {
  color: rgba(180, 184, 205, 0.42);
}

#gs-file { display: none !important; }

#gs-form.is-busy #gs-send,
#gs-form.is-busy #gs-photo,
#gs-form.is-busy .gs-kind-btn {
  opacity: 0.45;
  pointer-events: none;
}

#gs-pay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 16px 16px 20px;
}

#gs-pay.is-open { display: flex; }

.gs-pay-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 110%, rgba(var(--gs-cyan-rgb), .16), transparent 46%),
    radial-gradient(ellipse at 80% 0%, rgba(var(--gs-violet-rgb), .16), transparent 42%),
    rgba(4, 5, 9, .78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.gs-pay-sheet {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  max-height: min(88vh, 760px);
  overflow: auto;
  padding: 26px 22px 20px;
  border-radius: 28px 28px 22px 22px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.1), rgba(255,255,255,.03) 38%, rgba(10,12,20,.72));
  border: 1px solid rgba(255,255,255,.16);
  box-shadow:
    0 30px 90px rgba(0,0,0,.55),
    0 0 0 1px rgba(255,255,255,.05) inset,
    0 0 90px rgba(var(--gs-cyan-rgb), .1);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
}
.gs-pay-sheet::before {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  right: -70px;
  top: -90px;
  border-radius: 50%;
  background: rgba(var(--gs-cyan-rgb), .28);
  filter: blur(40px);
  pointer-events: none;
}
.gs-pay-sheet::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  left: -50px;
  top: 80px;
  border-radius: 50%;
  background: rgba(var(--gs-gold-rgb), .16);
  filter: blur(36px);
  pointer-events: none;
}

.gs-pay-kicker {
  position: relative;
  margin: 0 0 10px;
  color: rgba(232, 201, 122, .92);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
}

.gs-pay-sheet h3 {
  position: relative;
  margin: 0;
  font-size: 32px;
  letter-spacing: -.045em;
  font-weight: 640;
  color: var(--gs-text);
}

.gs-pay-lead {
  position: relative;
  margin: 10px 0 0;
  color: rgba(180, 184, 205, .86);
  font-size: 14px;
  line-height: 1.55;
}

.gs-pay-bal {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 18px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  color: rgba(242,243,248,.88);
  font-size: 13px;
}
.gs-pay-bal::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 99px;
  background: var(--gs-cyan);
  box-shadow: 0 0 12px rgba(var(--gs-cyan-rgb), .9);
}

.gs-packs {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gs-pack {
  text-align: left;
  width: 100%;
  padding: 16px 16px 14px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(4, 5, 8, .38);
  color: inherit;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, transform .2s ease, box-shadow .2s ease;
}
.gs-pack:hover {
  transform: translateY(-1px);
  border-color: rgba(255,255,255,.2);
}
.gs-pack.is-rec {
  border-color: rgba(var(--gs-gold-rgb), .42);
  background: linear-gradient(165deg, rgba(var(--gs-gold-rgb), .14), rgba(4,5,8,.35));
}
.gs-pack.is-on {
  border-color: rgba(var(--gs-cyan-rgb), .7);
  background: linear-gradient(165deg, rgba(var(--gs-cyan-rgb), .16), rgba(4,5,8,.4));
  box-shadow:
    0 0 0 1px rgba(var(--gs-cyan-rgb), .25),
    0 12px 32px rgba(var(--gs-cyan-rgb), .12);
}

.gs-pack-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.gs-pack-price {
  font-size: 22px;
  font-weight: 720;
  letter-spacing: -.03em;
  color: #fff;
}

.gs-pack-points {
  font-size: 14px;
  font-weight: 680;
  color: var(--gs-gold-light);
}

.gs-pack-badge {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .06em;
  color: #1a1406;
  background: linear-gradient(135deg, #f3d78a, var(--gs-gold));
}

.gs-costs {
  position: relative;
  margin: 16px 0 0;
  padding: 4px 2px 0;
  list-style: none;
  color: rgba(180, 184, 205, .78);
  font-size: 13px;
}

.gs-costs li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(242, 243, 248, .08);
}

.gs-costs b { color: var(--gs-text); font-weight: 650; }

.gs-pay-actions {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 18px;
}

.gs-pay-confirm {
  width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 15px 18px;
  font-size: 15px;
  font-weight: 720;
  color: #061016;
  background: linear-gradient(135deg, #7ef0fb 0%, var(--gs-cyan) 48%, #e8c97a 140%);
  box-shadow:
    0 0 28px rgba(var(--gs-cyan-rgb), .42),
    0 8px 22px rgba(0,0,0,.28);
  cursor: pointer;
}
.gs-pay-confirm:hover { filter: brightness(1.06); }
.gs-pay-confirm:disabled {
  opacity: .38;
  cursor: default;
  box-shadow: none;
  filter: none;
}

.gs-pay-later {
  width: 100%;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  padding: 12px 18px;
  background: transparent;
  color: rgba(180, 184, 205, .88);
  cursor: pointer;
}

@keyframes gs-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@keyframes gs-spin {
  to { transform: rotate(360deg); }
}

@media (min-width: 720px) {
  #gs-pay {
    align-items: center;
    padding: 24px;
  }
  .gs-pay-sheet { border-radius: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  .gs-row { animation: none; }
  .gs-gen-pulse { animation: none; }
}

#gramo-studio .hidden,
#gs-pay .hidden { display: none !important; }

#gs-form.gs-enter { cursor: pointer; }
#gs-form.gs-enter #gs-input {
  pointer-events: none;
  user-select: none;
  color: rgba(180,184,205,.42);
  min-height: 64px;
  margin: 0;
  padding: 22px 24px 20px;
}
#gs-form.gs-enter .gs-kind,
#gs-form.gs-enter .gs-kind-btn {
  cursor: pointer;
  pointer-events: none;
}
#gs-form.gs-enter .gs-kind-btn {
  color: rgba(180, 184, 205, 0.78);
  background: transparent;
}


/* Homepage enter card — generative glass */
#gramo-studio {
  position: relative;
  isolation: isolate;
}
#gramo-studio::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -48px -36px -28px;
  background:
    radial-gradient(ellipse 55% 70% at 18% 35%, rgba(70,217,232,.22), transparent 62%),
    radial-gradient(ellipse 50% 55% at 92% 85%, rgba(232,201,122,.16), transparent 64%),
    radial-gradient(ellipse 40% 45% at 70% 0%, rgba(130,132,255,.12), transparent 58%);
  filter: blur(6px);
  pointer-events: none;
}

#gramo-studio #gs-form.prompt-card.gs-enter {
  position: relative;
  padding: 7px;
  border-radius: 32px;
  overflow: hidden;
  background: linear-gradient(165deg, rgba(255,255,255,.11), rgba(255,255,255,.03));
  border: 1px solid rgba(255,255,255,.16);
  backdrop-filter: blur(32px) saturate(1.25);
  -webkit-backdrop-filter: blur(32px) saturate(1.25);
  box-shadow:
    0 32px 90px rgba(0,0,0,.48),
    0 0 0 1px rgba(255,255,255,.06) inset,
    0 1px 0 rgba(255,255,255,.2) inset;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
#gramo-studio #gs-form.prompt-card.gs-enter::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    radial-gradient(ellipse 75% 50% at 10% -15%, rgba(70,217,232,.3), transparent 55%),
    radial-gradient(ellipse 50% 40% at 100% 120%, rgba(232,201,122,.2), transparent 58%);
  opacity: 1;
}
#gramo-studio #gs-form.prompt-card.gs-enter::after {
  content: "";
  position: absolute;
  top: 0;
  left: -45%;
  width: 42%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.1), transparent);
  transform: skewX(-20deg);
  animation: gs-sheen 8s ease-in-out infinite;
  pointer-events: none;
}
@keyframes gs-sheen {
  0%, 58% { left: -45%; opacity: 0; }
  68% { opacity: 1; }
  100% { left: 115%; opacity: 0; }
}
#gramo-studio #gs-form.gs-enter:hover {
  transform: translateY(-2px);
  border-color: rgba(126,240,251,.38);
  box-shadow:
    0 36px 100px rgba(0,0,0,.5),
    0 0 70px rgba(70,217,232,.16),
    0 0 0 1px rgba(255,255,255,.08) inset;
}

#gramo-studio #gs-form.gs-enter .prompt-inner {
  gap: 10px;
  min-height: 0;
}
#gramo-studio #gs-form.gs-enter .prompt-compose {
  background: rgba(6, 8, 14, .38);
  border: 1px solid rgba(255,255,255,.06);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}
#gramo-studio #gs-form.gs-enter #gs-input,
#gramo-studio #gs-form.gs-enter .prompt-input {
  color: rgba(242,243,248,.52);
  font-weight: 450;
  letter-spacing: -.034em;
  font-size: clamp(17px, 2.05vw, 22px);
}

#gramo-studio #gs-form.gs-enter .gs-kind {
  background: rgba(255,255,255,.045);
  border-color: rgba(255,255,255,.12);
  gap: 0;
}
#gramo-studio #gs-form.gs-enter .gs-kind-btn {
  background: transparent;
  font-weight: 620;
}
#gramo-studio #gs-form.gs-enter .gs-kind-btn:first-child { color: #8ef3fb; }
#gramo-studio #gs-form.gs-enter .gs-kind-btn:last-child { color: #ead08a; }

#gramo-studio #gs-form.gs-enter #gs-hint {
  color: rgba(180,184,205,.62);
  letter-spacing: .02em;
}

#gramo-studio #gs-form.gs-enter .send {
  width: 44px;
  height: 44px;
  background: linear-gradient(145deg, #b6f7fc 0%, #46d9e8 48%, #e8c97a 130%);
  box-shadow:
    0 0 0 1px rgba(255,255,255,.28) inset,
    0 8px 22px rgba(70,217,232,.28);
}

.hero-inner .chips .chip {
  min-height: 48px;
  border-radius: 999px;
  background: linear-gradient(165deg, rgba(255,255,255,.07), rgba(255,255,255,.02));
  border: 1px solid rgba(255,255,255,.1);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: transform .18s ease, border-color .18s ease;
}
.hero-inner .chips .chip:hover {
  transform: translateY(-1px);
  border-color: rgba(126,240,251,.32);
  color: #f2f3f8;
}

@media (prefers-reduced-motion: reduce) {
  #gramo-studio #gs-form.prompt-card.gs-enter::after { animation: none; display: none; }
}
