:root {
  color-scheme: dark;
  --bg: #09090b;
  --bg-soft: #111113;
  --bg-lift: #1c1c1f;
  --accent: #f5f5f5;
  --accent-soft: rgba(255, 255, 255, 0.08);
  --text-primary: #fafafa;
  --text-muted: #a1a1aa;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --shadow: 0 40px 80px -40px rgba(9, 9, 11, 0.9);
  --radius-lg: 32px;
  --radius-sm: 20px;
  --max-width: 1440px;
  --transition: 160ms ease;
  /* header + hero spacing (default desktop/tabs) */
  --header-h: 84px;
  --hero-gap: 24px;
  /* temporary multiplier for hero top spacing */
  --hero-space-multiplier: 1.8;
  font-size: 17px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: "Plus Jakarta Sans", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  overflow-x: hidden; /* absolute guard: never allow horizontal scroll */
}

a {
  color: inherit;
}

a.button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.9rem 1.6rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--accent);
  color: #09090b;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 18px 32px -24px rgba(255, 255, 255, 0.65);
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}

.button:hover,
a.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 32px 64px -32px rgba(255, 255, 255, 0.75);
}

a.button.secondary,
.button.secondary {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border);
  box-shadow: none;
}

a.button.secondary:hover,
.button.secondary:hover {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.06);
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 10;
  backdrop-filter: blur(12px);
  background: rgba(9, 9, 11, 0.78);
  border-bottom: 1px solid var(--border);
  overflow-x: clip;
}

.site-header__inner {
  margin: 0 auto;
  max-width: var(--max-width);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.brand img {
  height: 40px;
  width: auto;
}

/* Make footer logo large without affecting header */
.site-footer .brand img {
  height: clamp(80px, 12vw, 180px);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.product-hunt-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.product-hunt-badge__image {
  width: 180px;
  height: auto;
  max-width: 100%;
}

.language-toggle {
  position: relative;
  z-index: 50; /* ensure container stacks above neighbors */
}

.language-toggle__button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: rgba(250, 250, 250, 0.82);
  padding: 0.4rem 0.75rem;
  font-size: 0.9rem;
  cursor: pointer;
  transition: color var(--transition), transform var(--transition);
}

.language-toggle__button:hover,
.language-toggle__button[aria-expanded="true"] {
  color: rgba(250, 250, 250, 0.92);
}

.language-toggle__icon {
  display: inline-flex;
  width: 1rem;
  height: 1rem;
  justify-content: center;
  align-items: center;
  color: rgba(209, 213, 219, 0.8);
}

.language-toggle__icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
}

.language-toggle__label {
  font-weight: 600;
  letter-spacing: 0.048em;
}

.language-toggle__chevron {
  font-size: 0.72rem;
  color: rgba(209, 213, 219, 0.8);
  margin-left: 0.1rem;
}

.language-toggle__menu {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 0.5rem;
  z-index: 1000; /* draw above header content on mobile too */
  border-radius: 18px;
  background: rgba(17, 17, 19, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  min-width: 12rem;
  padding: 0.4rem;
  box-shadow: var(--shadow);
  display: grid;
  gap: 0.25rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.language-toggle__menu.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.language-toggle__option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.9rem;
  border-radius: 12px;
  background: transparent;
  border: none;
  color: rgba(228, 228, 231, 0.85);
  font-size: 0.94rem;
  cursor: pointer;
  width: 100%;
  transition: background var(--transition), color var(--transition);
}

.language-toggle__option strong {
  font-size: 0.8rem;
  letter-spacing: 0.08rem;
  text-transform: uppercase;
  color: rgba(161, 161, 170, 0.6);
}

.language-toggle__option:hover,
.language-toggle__option[aria-current="true"] {
  background: rgba(255, 255, 255, 0.08);
}

.language-toggle__option[aria-current="true"] span {
  color: rgba(250, 250, 250, 0.9);
}

.language-toggle__option[aria-current="true"] strong {
  color: rgba(250, 250, 250, 0.85);
}

main {
  margin: 0 auto;
  max-width: var(--max-width);
  padding: 0 1.5rem 5.25rem;
}

main > section {
  margin-bottom: clamp(4.5rem, 7.5vw, 7rem);
}

main > section:last-of-type {
  margin-bottom: 0;
}


.hero {
  position: relative;
  z-index: 0;
  display: grid;
  gap: clamp(1.75rem, 3vw, 2.5rem);
  padding: calc((var(--header-h) + var(--hero-gap)) * var(--hero-space-multiplier)) 0 3.75rem;
  overflow: visible;
}

.hero::before {
  content: "";
  position: absolute;
  top: -20%;
  left: 50%;
  width: 150vw;
  height: 128%;
  transform: translateX(-50%);
  background-image: repeating-linear-gradient(108deg, rgba(255, 255, 255, 0.16) 0px, rgba(255, 255, 255, 0.16) 2px, transparent 2px, transparent 64px);
  opacity: 0.38;
  pointer-events: none;
  z-index: 0;
}

.hero::after {
  content: "";
  position: absolute;
  left: var(--cursor-x, 50%);
  top: var(--cursor-y, 50%);
  transform: translate(-50%, -50%);
  width: clamp(320px, 36vw, 520px);
  height: clamp(320px, 36vw, 520px);
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.32) 0%, rgba(255, 255, 255, 0.14) 40%, rgba(255, 255, 255, 0) 70%);
  filter: blur(36px);
  transition: opacity 0.35s ease, transform 0.3s ease;
  opacity: 0;
  pointer-events: none;
  z-index: 0;
}

.hero.has-pointer::after {
  opacity: 0.4;
}

.hero__copy {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.hero__eyebrow {
  letter-spacing: 0.4rem;
  text-transform: uppercase;
  font-size: 0.88rem;
  color: rgba(161, 161, 170, 0.6);
}

.hero__title {
  font-size: clamp(2.6rem, 5vw, 3.85rem);
  line-height: 1.08;
  margin: 0;
}

.hero__lead {
  margin: 0;
  color: rgba(161, 161, 170, 0.72);
  font-size: 1.14rem;
  max-width: 50ch;
  line-height: 1.64;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  align-items: center;
}

.hero__cta .button {
  min-width: 220px;
  width: auto;
}

.hero__media {
  position: relative;
  border-radius: var(--radius-lg);
  background: var(--bg-lift);
  overflow: hidden;
  box-shadow: var(--shadow);
  z-index: 1;
}

.hero__media video {
  display: block;
  width: 100%;
  height: auto;
}

.hero__copy {
  position: relative;
  z-index: 1;
}

.grid-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: clamp(1.25rem, 2vw, 1.75rem);
  padding: 4rem 0;
}

.card {
  background: linear-gradient(136deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 220px;
  transition: border var(--transition), transform var(--transition);
}

.card p {
  color: rgba(161, 161, 170, 0.72);
  line-height: 1.62;
  font-size: 1.04rem;
}

.card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
}

.section-heading {
  text-align: center;
  font-size: clamp(2.2rem, 4.4vw, 3rem);
  margin: 0;
}

.workflow-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: clamp(1.25rem, 2.5vw, 1.75rem);
  padding: 3.5rem 0 4rem;
}

.workflow-step {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.04);
  min-height: 210px;
}

.workflow-step span {
  display: inline-block;
  font-size: 0.82rem;
  letter-spacing: 0.35rem;
  text-transform: uppercase;
  color: rgba(161, 161, 170, 0.6);
}

.workflow-step h3 {
  margin: 1rem 0 0.6rem;
  font-size: 1.2rem;
}

.workflow-step p {
  margin: 0;
  color: rgba(161, 161, 170, 0.72);
  line-height: 1.62;
}

.workflow-note {
  max-width: 52rem;
  margin: 0.6rem auto 0;
  text-align: center;
  color: rgba(161, 161, 170, 0.75);
  font-size: 0.98rem;
}

.personas-intro {
  margin: 0 auto;
  max-width: 52rem;
  text-align: center;
  padding: 1rem 0 2.5rem;
}

.personas-intro .section-heading {
  font-size: clamp(2rem, 3.6vw, 3.2rem);
}

.personas-intro p {
  color: rgba(161, 161, 170, 0.72);
  line-height: 1.64;
  font-size: 1.08rem;
}

.personas-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.5rem, 2.4vw, 2.1rem);
}

.persona-card {
  padding: 1.8rem;
  border-radius: 26px;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.025));
  border: 1px solid rgba(255, 255, 255, 0.08);
  min-height: 210px;
  display: grid;
  align-content: start;
  gap: 0.9rem;
  transition: border var(--transition), transform var(--transition), background var(--transition);
  box-shadow: 0 26px 36px -32px rgba(0, 0, 0, 0.6);
}

.persona-card:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.035));
  transform: translateY(-4px);
}

.persona-card h3 {
  margin: 0;
}

.persona-card p {
  color: rgba(161, 161, 170, 0.74);
  line-height: 1.62;
}

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

@media (max-width: 700px) {
  .personas-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.faq {
  max-width: 58rem;
  margin: clamp(4.5rem, 6.5vw, 5.6rem) auto 0;
  padding: clamp(0.1rem, 0.6vw, 0.4rem) 0 clamp(3.2rem, 4.6vw, 3.6rem);
  display: flex;
  flex-direction: column;
  gap: clamp(0.6rem, 1.1vw, 0.9rem);
}

.faq-item {
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
  padding: 1.3rem 1.75rem;
  text-align: left;
  display: grid;
  gap: 0.9rem;
  cursor: pointer;
  transition: border var(--transition), background var(--transition), transform var(--transition);
  font: inherit;
  color: inherit;
}

.faq-item:hover,
.faq-item[aria-expanded="true"] {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.055);
  transform: translateY(-2px);
}

.faq-item__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.faq-item__question {
  font-size: 1.2rem;
  font-weight: 600;
}

.faq-item__chevron {
  font-size: 1rem;
  color: rgba(161, 161, 170, 0.6);
  transition: transform 0.25s ease;
}

.faq-item[aria-expanded="true"] .faq-item__chevron {
  transform: rotate(-180deg);
}

.faq-item__content {
  display: none;
  color: rgba(161, 161, 170, 0.74);
  line-height: 1.68;
}

.faq-item[aria-expanded="true"] .faq-item__content {
  display: block;
}

/* Mobile: ensure FAQ content wraps within the card */
@media (max-width: 700px) {
  .faq-item__content,
  .faq-item__content p,
  .faq-item__content li {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .faq-item__content pre,
  .faq-item__content code {
    white-space: pre-wrap; /* allow wrapping while preserving newlines */
    overflow-wrap: anywhere; /* break long tokens like URLs */
    word-break: break-word; /* Safari fallback */
    max-width: 100%;
  }
}

.cta {
  max-width: 52rem;
  margin: clamp(5rem, 7vw, 6rem) auto 0;
  text-align: center;
  padding: 3.25rem clamp(1.75rem, 4vw, 3rem);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(16, 16, 18, 0.82));
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 32px 56px -44px rgba(0, 0, 0, 0.8);
  display: grid;
  gap: 1.2rem;
}

.cta p {
  color: rgba(161, 161, 170, 0.72);
  font-size: 1.08rem;
  line-height: 1.62;
}

.cta .button {
  width: fit-content;
  margin: 0 auto;
  min-width: 240px;
}

/* CTA button – stylish hover animation */
.cta .button {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: transform 220ms ease, box-shadow 220ms ease, background 220ms ease;
}

.cta .button:hover {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 24px 48px -28px rgba(255, 255, 255, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.32) inset;
}

/* fast sharp shine */
.cta .button::before {
  content: "";
  position: absolute;
  top: -30%;
  left: -60%;
  width: 28%;
  height: 160%;
  background: linear-gradient(100deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.95) 50%, rgba(255,255,255,0) 100%);
  transform: translateX(-180%) skewX(-20deg);
  filter: blur(0.5px);
  opacity: 0;
  pointer-events: none;
}

.cta .button:hover::before {
  animation: buttonShine 520ms cubic-bezier(.17,.67,.2,1) forwards;
}

/* sparkle pop */
.cta .button::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%) scale(0.3) rotate(20deg);
  background:
    radial-gradient(circle at 50% 50%, rgba(255,255,255,0.95) 0 32%, rgba(255,255,255,0) 60%),
    linear-gradient(transparent 45%, rgba(255,255,255,0.95) 50%, transparent 55%),
    linear-gradient(90deg, transparent 45%, rgba(255,255,255,0.95) 50%, transparent 55%);
  mix-blend-mode: screen;
  opacity: 0;
  pointer-events: none;
}

.cta .button:hover::after {
  animation: sparklePop 420ms cubic-bezier(.2,.7,.2,1) 120ms forwards;
}

@keyframes buttonShine {
  0% { transform: translateX(-180%) skewX(-20deg); opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { transform: translateX(220%) skewX(-20deg); opacity: 0; }
}

@keyframes sparklePop {
  0%   { opacity: 0; transform: translateY(-50%) scale(0.2) rotate(25deg); }
  40%  { opacity: 1; transform: translate(-2px,-12px) scale(1) rotate(0deg); }
  100% { opacity: 0; transform: translate(6px,-20px) scale(0.65) rotate(-15deg); }
}

@media (prefers-reduced-motion: reduce) {
  .cta .button, .cta .button::before, .cta .button::after { transition: none; animation: none !important; }
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: clamp(3.5rem, 6vw, 4.5rem) 1.5rem clamp(4rem, 6vw, 5rem);
  background: rgba(9, 9, 11, 0.85);
}

.site-footer__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  text-align: center;
}

.footer-links {
  display: flex;
  gap: 1.35rem;
  flex-wrap: wrap;
  justify-content: center;
  color: rgba(161, 161, 170, 0.7);
  font-size: 1.02rem;
}

.footer-links a {
  color: inherit;
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--text-primary);
}

small {
  color: rgba(161, 161, 170, 0.7);
}

@media (min-width: 960px) {
  :root { --header-h: 84px; --hero-gap: 28px; }
  .hero {
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.2fr);
    align-items: center;
    column-gap: clamp(2.25rem, 3vw, 3rem);
  }

  /* Header order: language → download → product hunt */
  .header-actions {
    flex-wrap: nowrap;
  }
  .header-actions .language-toggle { order: 1; }
  .header-actions .header-download { order: 2; }
  .header-actions .product-hunt-badge { order: 3; }

  /* Match PH badge height to Download button */
  .header-actions .product-hunt-badge__image {
    height: 44px;
    width: auto;
  }

  .hero__lead {
    font-size: 1.2rem;
  }

  .hero__media {
    max-width: 760px;
  }
}

@media (max-width: 768px) {
  .header-download {
    display: none !important;
  }
  /* Prevent overflow on larger phones too */
  .site-header__inner {
    gap: 0.75rem;
    flex-wrap: wrap;
  }
  .brand { min-width: 0; }
  .brand img { height: 30px; }
  .header-actions {
    flex-wrap: wrap;
    min-width: 0;
  }
  .header-actions .product-hunt-badge__image { width: 160px; }
}

@media (max-width: 640px) {
  :root { --header-h: 62px; --hero-gap: 16px; --hero-space-multiplier: 1.35; }
  .site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    /* allow dropdown to overflow cleanly on iOS Safari */
    overflow: visible;
  }
  .site-header__inner {
    padding: 1.1rem 0.75rem;
    gap: 0.5rem; /* tighten logo-buttons spacing */
    flex-wrap: wrap;
    max-width: 100%;
    overflow: visible; /* allow dropdowns to escape header inner */
  }
  .brand { flex: 1 1 auto; min-width: 0; }
  .brand { flex: 0 0 auto; min-width: auto; margin-left: 0.8rem; }
  .brand img { height: 24px; display: block; }
  .header-actions {
    gap: 0.4rem;
    flex-wrap: wrap;
    justify-content: flex-end;
    min-width: 0;
    width: auto; /* allow sharing row with logo */
    max-width: 100%;
    flex: 1 1 auto;
  }
  .header-actions a,
  .header-actions button,
  .header-actions img { max-width: 100%; min-width: 0; }
  .header-actions .product-hunt-badge__image {
    width: clamp(100px, 36vw, 130px);
  }
  /* Make header language + PH buttons smaller */
  .site-header .language-toggle__button {
    padding: 0.28rem 0.55rem;
    font-size: 0.82rem;
    gap: 0.35rem;
  }
  .site-header .language-toggle__icon {
    width: 0.9rem;
    height: 0.9rem;
  }
  .site-header .language-toggle__chevron {
    font-size: 0.62rem;
  }
  .site-header .product-hunt-badge__image {
    width: clamp(96px, 34vw, 124px);
  }
  /* Smaller footer logo on mobile */
  .site-footer .brand img {
    height: clamp(48px, 12vw, 72px);
  }
  /* Anchor the language menu to the viewport on small screens */
  .language-toggle__menu {
    position: fixed;
    right: 0.75rem;
    top: calc(var(--header-h) + 6px);
    margin-top: 0;
  }
  .hero {
    padding-top: calc((var(--header-h) + var(--hero-gap)) * var(--hero-space-multiplier));
    text-align: center;
    justify-items: center;
    gap: 1.5rem;
  }
  .hero__copy {
    align-items: center;
    text-align: center;
  }
  .hero__title {
    font-size: 2.4rem;
  }
  .hero__lead {
    font-size: 1.08rem;
    max-width: 36ch;
  }
  .hero__cta {
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 1.2rem;
  }
  .hero__cta .button {
    width: min(100%, 320px);
    justify-content: center;
  }
  .hero__cta .product-hunt-badge {
    justify-content: center;
  }
  .hero__cta .product-hunt-badge__image {
    width: min(100%, 180px);
  }
}

/* Very narrow devices */
@media (max-width: 360px) {
  .site-header .product-hunt-badge__image {
    width: 100px;
  }
}

/* Extra safety: ensure hidden on large phones/landscape */
@media (max-width: 820px) {
  .site-header .header-download {
    display: none !important;
  }
}
