/* Landing page — yellow hero with a cursor-tracking robot.
   Shares the colour tokens defined in style.css (:root). */

:root {
  --hero-yellow: #ffc91f;
  /* Matches the robot: dark visor body, neon accent */
  --robot-ink: #171a21;
  --robot-neon: #29c6ff;
}

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body.landing {
  position: relative;
  background: white;
}

/* ---- Hero ---- */

.hero-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  transition: transform 0.25s ease, background 0.2s ease, padding 0.2s ease;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 22px 32px;
}

/* Away on the way down, back on the way up. */
.hero-nav.is-hidden { transform: translateY(-100%); }

/* Past the hero the bar sits over dark sections, where its dark text would
   vanish — so once it leaves the top it carries its own background. */
.hero-nav.is-stuck {
  padding: 12px 32px;
  background: var(--hero-yellow);
  box-shadow: 0 8px 24px -14px rgba(0, 0, 0, 0.55);
}

.hero-logo {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text);
  text-decoration: none;
}

.hero-logo-caret {
  display: none;
  flex-shrink: 0;
  width: 12px;
  height: 12px;
}

.hero-nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-left: auto;
}

.hero-nav-login {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  opacity: 0.8;
}

.hero-nav-login:hover { opacity: 1; }

.hero-nav-links a {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  opacity: 0.8;
}

.hero-nav-links a:hover { opacity: 1; }

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(24px, 7vw, 100px);
  padding: 120px 32px 90px;
  background: var(--hero-yellow);
  overflow: hidden;
}

/* Covers the whole viewport as the cursor nears the chat box, leaving only
   the box itself (higher z-index) lit. Opacity is driven by landing.js. */
/* No CSS transition here on purpose: landing.js already eases the value every
   frame, and a transition would restart on each update and never catch up. */
.hero-dim {
  position: fixed;
  inset: 0;
  z-index: 5;
  background: #000;
  opacity: 0;
  pointer-events: none;
}

/* Sits above .hero-dim (z-index 5) — the robot itself stays below and dims
   with the page, but its light still reaches the viewer. */
.robot-core-halo {
  position: fixed;
  z-index: 6;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(255, 241, 184, 0.72) 26%,
    rgba(255, 194, 72, 0.38) 52%,
    rgba(255, 157, 28, 0) 74%);
  opacity: 0;
  pointer-events: none;
}

.hero-chatbox {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(440px, 100%);
  padding: 21px 22px;
  background: white;
  border: none;
  border-radius: 18px;
  box-shadow: 0 18px 40px -22px rgba(0, 0, 0, 0.5);
  font-family: inherit;
  font-size: 1rem;
  color: #7a7a7a;
  text-align: left;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hero-chatbox:hover {
  transform: translateY(-3px);
  box-shadow: 0 30px 60px -24px rgba(0, 0, 0, 0.6);
}

.hero-chatbox-placeholder {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero-chatbox-send {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--robot-ink);
  color: var(--robot-neon);
}

.hero-robot {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  width: min(440px, 56vw);
}

.hero-robot svg {
  display: block;
  width: 100%;
  height: auto;
}

/* Pivot near the neck, not the middle of the head, so turning reads as the
   robot looking around rather than the head sliding sideways. */
#robot-head {
  transform-box: fill-box;
  transform-origin: 50% 100%;
}

#robot-pupils,
#robot-core-glow {
  transform-box: fill-box;
  transform-origin: center;
}

.hero-badge {
  position: absolute;
  z-index: 2;
  bottom: 34px;
  left: 50%;
  transform: translateX(-50%);
  padding: 9px 20px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 999px;
  color: var(--text);
  font-size: 0.83rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .hero {
    flex-direction: column;
    gap: 40px;
    padding-top: 110px;
  }

  .hero-robot { width: min(280px, 70vw); }
  .hero-badge { display: none; }
}

/* On phones the wordmark is gone, so the logo doubles as the menu button:
   the links drop out of the bar into a panel that opens directly beneath it —
   anchored left, where the finger actually tapped. */
@media (max-width: 700px) {
  .hero-nav {
    align-items: flex-start;
    padding: 16px 20px;
  }

  /* Comfortable tap target around the mark */
  .hero-logo {
    padding: 8px 10px 8px 8px;
    margin: -8px 0 0 -8px;
    border-radius: 12px;
  }

  .hero-logo[aria-expanded="true"] { background: rgba(0, 0, 0, 0.08); }

  .hero-logo-caret {
    display: block;
    transition: transform 0.16s ease;
  }

  /* Clear of the logo so the panel never sits on top of what opened it */

  .hero-logo[aria-expanded="true"] .hero-logo-caret { transform: rotate(180deg); }

  .hero-nav-links {
    position: absolute;
    top: 72px;
    left: 16px;
    right: auto;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    min-width: 190px;
    padding: 6px;
    background: white;
    border-radius: 14px;
    box-shadow: 0 20px 44px -18px rgba(0, 0, 0, 0.6);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
  }

  .hero-nav-links.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .hero-nav-links a {
    padding: 13px 14px;
    border-radius: 10px;
    font-size: 0.95rem;
    opacity: 1;
  }

  .hero-nav-links a + a { border-top: 1px solid #f0ede5; }

  .hero-nav-login {
    margin-left: auto;
    padding: 9px 16px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 999px;
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-nav-links,
  .hero-nav { transition: none; }
}

/* ---- Shared section scaffolding ---- */

.section-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 32px;
}

.section-head {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 56px;
}

.section-head h2 {
  margin: 0 0 14px;
  font-size: clamp(1.6rem, 3.2vw, 2.2rem);
  line-height: 1.2;
}

.section-head p {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.6;
}

/* Off-screen but readable by search engines and screen readers — the hero is
   intentionally wordless, so the page's H1 lives here. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---- Benefits (dark) ---- */

/* Fills the viewport so it reads as its own screen before the yellow one */
.section-dark {
  display: flex;
  align-items: center;
  min-height: 100vh;
  background: #16181d;
  color: #e9e7f0;
  padding: 60px 0 84px;
}

/* Tighter than elsewhere: the chat sits right below and should land high in
   the viewport when someone arrives from the hero. */
.section-dark .section-head { margin-bottom: 32px; }
.section-dark .section-head h2 { font-size: clamp(1.4rem, 2.6vw, 1.85rem); }

.section-dark .section-inner { width: 100%; }

.section-dark .section-head h2 { color: #ffffff; }
.section-dark .section-head p { color: #a9adb8; }

.benefit-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.benefit {
  padding: 24px 22px 26px;
  background: #1d2027;
  border: 1px solid #2a2e37;
  border-radius: 18px;
}

.benefit h3 {
  margin: 0 0 10px;
  font-size: 1.02rem;
  line-height: 1.3;
  color: var(--hero-yellow);
}

.benefit p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.6;
  color: #b7bbc6;
}

/* Sends the visitor from the dark screen to the pricing screen below. */
.upgrade {
  margin-top: 34px;
  text-align: center;
}

.upgrade-btn {
  display: inline-block;
  padding: 20px 48px;
  background: var(--hero-yellow);
  color: var(--ink);
  border-radius: 14px;
  font-size: 1.15rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 16px 34px -20px rgba(255, 201, 31, 0.9);
  transition: transform 0.15s ease, background 0.15s ease;
}

.upgrade-btn:hover { background: #ffd75a; transform: translateY(-2px); }

/* Billing switch — annual is the default because it's the cheaper, headline
   price; monthly adds 3 zł. Display only: the amount actually charged comes
   from the Stripe price the checkout uses. */
/* One switch per card, sitting directly above that card's button. The filled
   pill slides between the two halves instead of blinking on and off, so the
   control reads as a slider rather than a pair of buttons. */
.billing-toggle {
  position: relative;
  display: flex;
  margin-bottom: 12px;
  padding: 3px;
  background: rgba(0, 0, 0, 0.07);
  border-radius: 999px;
}

.billing-thumb {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc(50% - 3px);
  border-radius: 999px;
  background: var(--ink);
  transition: transform 0.24s cubic-bezier(0.4, 0, 0.2, 1);
}

.billing-toggle[data-period="monthly"] .billing-thumb {
  transform: translateX(100%);
}

.billing-opt {
  position: relative;
  z-index: 1;
  flex: 1;
  padding: 8px 4px;
  background: none;
  border: none;
  border-radius: 999px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  opacity: 0.55;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.billing-opt.is-active {
  color: var(--hero-yellow);
  opacity: 1;
}

.plan-featured .billing-toggle { background: rgba(255, 255, 255, 0.08); }
.plan-featured .billing-thumb { background: var(--hero-yellow); }
.plan-featured .billing-opt { color: #d8dae1; }
.plan-featured .billing-opt.is-active { color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  .billing-thumb { transition: none; }
}

/* ---- Free trial chat (inside the dark section) ---- */

/* First thing in the section — a visitor arriving from the hero chat box
   should land on somewhere to type, not on copy. */
.trial {
  max-width: 780px;
  margin: 0 auto 40px;
  background: var(--ink-soft);
  border: 1px solid var(--ink-line);
  border-radius: 20px;
  overflow: hidden;
}

.trial-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 20px 24px;
  border-bottom: 1px solid var(--ink-line);
}

.trial-head h3 {
  margin: 0;
  font-size: 1.05rem;
  color: white;
}

.trial-window {
  min-height: 150px;
  max-height: 380px;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.trial-msg {
  max-width: 88%;
  padding: 13px 16px;
  border-radius: 14px;
  font-size: 0.93rem;
  line-height: 1.55;
}

.trial-msg p { margin: 0; white-space: pre-wrap; }

.trial-msg.assistant {
  align-self: flex-start;
  background: #262a33;
  color: #d6d9e0;
  border-bottom-left-radius: 4px;
}

.trial-msg.user {
  align-self: flex-end;
  background: var(--hero-yellow);
  color: var(--ink);
  font-weight: 500;
  border-bottom-right-radius: 4px;
}

.trial-msg.error {
  align-self: flex-start;
  background: #3a2326;
  color: #f0b4b4;
}

.trial-sources {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #363b45;
  font-size: 0.8rem;
}

.trial-sources summary {
  cursor: pointer;
  color: var(--hero-yellow);
  font-weight: 600;
}

.trial-citation { margin-top: 10px; }

.trial-citation-label {
  font-weight: 600;
  color: #b7bbc6;
  margin-bottom: 3px;
}

.trial-citation blockquote {
  margin: 0;
  padding: 8px 12px;
  border-left: 3px solid var(--hero-yellow);
  background: #1b1e25;
  color: #a9adb8;
  font-size: 0.78rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.trial-form {
  display: flex;
  gap: 10px;
  padding: 18px 24px;
  border-top: 1px solid var(--ink-line);
}

#trial-input {
  flex: 1;
  min-width: 0;
  padding: 13px 16px;
  background: #12151b;
  border: 1px solid #363b45;
  border-radius: 12px;
  color: white;
  font-family: inherit;
  font-size: 0.95rem;
}

#trial-input::placeholder { color: #7d828d; }
#trial-input:focus { outline: none; border-color: var(--hero-yellow); }

#trial-send {
  padding: 0 24px;
  background: var(--hero-yellow);
  color: var(--ink);
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.93rem;
  cursor: pointer;
}

#trial-send:hover { background: #ffd75a; }
#trial-send:disabled { opacity: 0.55; cursor: not-allowed; }

.trial-cta {
  padding: 22px 24px 26px;
  border-top: 1px solid var(--ink-line);
  text-align: center;
}

.trial-cta p {
  margin: 0 0 16px;
  font-size: 0.93rem;
  line-height: 1.55;
  color: #b7bbc6;
}

.trial-cta-link {
  display: inline-block;
  margin-left: 16px;
  color: #b7bbc6;
  font-size: 0.9rem;
  font-weight: 600;
}

@media (max-width: 600px) {
  .trial-form { flex-direction: column; }
  #trial-send { padding: 13px; }
  .trial-cta-link { display: block; margin: 14px 0 0; }
}

/* ---- Pricing (yellow) ---- */

.section-pricing {
  display: flex;
  align-items: center;
  min-height: 100vh;
  background: var(--hero-yellow);
  color: var(--text);
  padding: 64px 0 80px;
}

.section-pricing .section-inner { width: 100%; }
.section-pricing .section-head { margin-bottom: 34px; }

.section-pricing .section-head h2 { color: var(--text); }
.section-pricing .section-head p { color: #6b5a2a; }

.plan-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  align-items: start;
}

.plan {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 32px 28px 30px;
  background: white;
  border: 1px solid #e6d9ae;
  border-radius: 20px;
  box-shadow: 0 24px 50px -40px rgba(0, 0, 0, 0.6);
}

/* Lifted and darkened so the eye lands on it first */
.plan-featured {
  background: #16181d;
  border-color: #16181d;
  padding-top: 44px;
  transform: translateY(-14px);
}

.plan-badge {
  position: absolute;
  top: 16px;
  left: 28px;
  padding: 5px 12px;
  background: var(--hero-yellow);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #16181d;
}

.plan h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--violet);
}

.plan-featured h3 { color: var(--hero-yellow); }

.plan-amount {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
}

.plan-featured .plan-amount { color: white; }

.plan-per {
  margin-left: 4px;
  font-size: 0.85rem;
  font-weight: 400;
  color: #7a7a7a;
}

.plan-featured .plan-per { color: #9aa0ac; }

.plan-for {
  margin: 10px 0 0;
  font-size: 0.86rem;
  line-height: 1.5;
  color: #6c6c6c;
}

.plan-featured .plan-for { color: #a9adb8; }

.plan-list {
  flex: 1;
  list-style: none;
  margin: 22px 0 26px;
  padding: 0;
}

.plan-list li {
  position: relative;
  padding: 9px 0 9px 24px;
  font-size: 0.9rem;
  border-bottom: 1px solid #f0ede5;
}

.plan-featured .plan-list li {
  color: #d8dae1;
  border-bottom-color: #2a2e37;
}

.plan-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--gold);
  font-weight: 700;
}

.plan-featured .plan-list li::before { color: var(--hero-yellow); }

.plan-btn {
  display: block;
  padding: 13px;
  border-radius: 12px;
  background: white;
  border: 1.5px solid var(--violet-light);
  color: var(--violet);
  font-size: 0.94rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease;
}

.plan-btn:hover { background: #f3f0fa; transform: translateY(-2px); }

.plan-btn-primary {
  background: var(--gold);
  border-color: var(--gold);
  color: white;
}

.plan-btn-primary:hover { background: var(--gold-light); border-color: var(--gold-light); }

/* ---- FAQ (own dark screen) ---- */

/* Ten questions stacked would overflow a screen, so they run in two columns
   on desktop; `align-content` keeps them from stretching when collapsed. */
.faq {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 20px;
  align-content: start;
}

.faq-item {
  height: fit-content;
  background: #1d2027;
  border: 1px solid var(--ink-line);
  border-radius: 14px;
  padding: 15px 20px;
}

.faq-item[open] { background: #22262e; }

.faq-item summary {
  cursor: pointer;
  font-size: 0.94rem;
  font-weight: 600;
  color: white;
  line-height: 1.4;
}

.faq-item summary::marker { color: var(--hero-yellow); }

.faq-item p {
  margin: 12px 0 0;
  font-size: 0.89rem;
  line-height: 1.65;
  color: #b7bbc6;
}

.section-faq .section-head { margin-bottom: 30px; }

.landing-footer {
  text-align: center;
  padding: 32px;
  font-size: 0.82rem;
  color: #888;
  border-top: 1px solid #e2ddd0;
}

.landing-footer a { color: var(--violet-light); }

@media (max-width: 1100px) {
  .benefit-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 780px) {
  .faq { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .benefit-grid, .plan-grid { grid-template-columns: 1fr; }
  .plan-featured { transform: none; }
  .section-dark, .section-pricing { padding: 72px 0 78px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-chatbox,
  .plan-btn { transition: none; }
}
