/* Pendi site styles: layout, components, sections, motion. */

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: clamp(1.15rem, 5vw, 2.5rem);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 60;
  background: var(--brand);
  color: var(--on-brand);
  padding: 0.6rem 1rem;
  border-radius: var(--r-sm);
  transition: top 0.2s var(--ease);
}
.skip:focus {
  top: 1rem;
}

/* ---- Header ---- */
.site-head {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: saturate(180%) blur(14px);
  background: color-mix(in oklch, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--hairline);
}
.site-head__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 66px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 1.22rem;
}
.brand__mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  box-shadow: var(--shadow);
}
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.langsw {
  display: inline-flex;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 2px;
  font-size: 0.8rem;
  font-weight: 600;
}
.langsw a {
  padding: 0.28rem 0.62rem;
  border-radius: 999px;
  color: var(--muted);
}
.langsw a[aria-current="true"] {
  background: var(--brand);
  color: var(--on-brand);
}
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}
.icon-btn:hover {
  background: var(--bg-tint);
}
.icon-btn:active {
  transform: scale(0.94);
}
.icon-btn .sun {
  display: none;
}
.icon-btn .moon {
  display: block;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-btn .sun {
    display: block;
  }
  :root:not([data-theme="light"]) .icon-btn .moon {
    display: none;
  }
}
:root[data-theme="dark"] .icon-btn .sun {
  display: block;
}
:root[data-theme="dark"] .icon-btn .moon {
  display: none;
}
:root[data-theme="light"] .icon-btn .sun {
  display: none;
}
:root[data-theme="light"] .icon-btn .moon {
  display: block;
}

/* ---- Buttons ---- */
.btn {
  --pad: 0.82rem 1.35rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: var(--pad);
  border-radius: 999px;
  font-weight: 640;
  font-size: 0.98rem;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.18s var(--ease), box-shadow 0.24s var(--ease),
    background 0.2s var(--ease);
}
.btn-primary {
  background: var(--brand);
  color: var(--on-brand);
  box-shadow: var(--shadow-brand);
}
.btn-primary:hover {
  background: var(--brand-strong);
  transform: translateY(-2px);
}
.btn-primary:active {
  transform: translateY(0);
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--hairline);
}
.btn-ghost:hover {
  background: var(--bg-tint);
  transform: translateY(-2px);
}
.btn-sm {
  --pad: 0.55rem 0.95rem;
  font-size: 0.9rem;
}

/* ---- Hero ---- */
.hero {
  position: relative;
  padding-block: clamp(2.5rem, 6vw, 5rem) clamp(3rem, 7vw, 5.5rem);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -30% -10% auto -10%;
  height: 70%;
  background: radial-gradient(
      60% 80% at 78% 20%,
      oklch(0.6 0.22 293.5 / 0.16),
      transparent 70%
    ),
    radial-gradient(
      50% 70% at 20% 0%,
      oklch(0.82 0.16 82 / 0.12),
      transparent 70%
    );
  pointer-events: none;
  z-index: -1;
}
.hero__grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: clamp(2rem, 5vw, 4rem);
}
.tagpill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 620;
  color: var(--muted);
  border: 1px solid var(--hairline);
  background: var(--surface);
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
}
.tagpill .dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent);
}
.hero h1 {
  font-size: clamp(2.35rem, 1.4rem + 4.4vw, 4.25rem);
  margin-top: 1.1rem;
}
.hero h1 em {
  font-style: normal;
  color: var(--brand);
}
.hero__sub {
  color: var(--muted);
  font-size: clamp(1.05rem, 1rem + 0.4vw, 1.22rem);
  max-width: 34ch;
  margin-top: 1.15rem;
}
.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.8rem;
}
.hero__note {
  margin-top: 1.05rem;
  font-size: 0.86rem;
  color: var(--muted);
}

/* Brand hero visual: the app tile, an amber spark, calling rings. */
.stage {
  position: relative;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}
.stage__tile {
  width: min(74%, 320px);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-brand);
  z-index: 2;
}
.stage__ring {
  position: absolute;
  border: 1.5px solid oklch(0.6 0.2 293.5 / 0.35);
  border-radius: 50%;
  inset: 50%;
  translate: -50% -50%;
}
.ring-1 {
  width: 86%;
  aspect-ratio: 1;
}
.ring-2 {
  width: 104%;
  aspect-ratio: 1;
  border-color: oklch(0.6 0.2 293.5 / 0.2);
}
.spark {
  position: absolute;
  z-index: 3;
  right: 16%;
  top: 30%;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 6px oklch(0.82 0.16 82 / 0.22),
    0 8px 22px oklch(0.82 0.16 82 / 0.5);
}

/* ---- Section shells ---- */
.section {
  padding-block: clamp(3rem, 7vw, 5.5rem);
}
.section__head {
  max-width: 40ch;
  margin-bottom: clamp(1.6rem, 3vw, 2.6rem);
}
.section__head h2 {
  font-size: clamp(1.7rem, 1.2rem + 2vw, 2.6rem);
}
.section__head p {
  color: var(--muted);
  margin-top: 0.75rem;
  font-size: 1.06rem;
}

/* ---- Motion ---- */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    animation: rise 0.7s var(--ease) both;
  }
  @supports (animation-timeline: view()) {
    .reveal {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 26%;
    }
  }
  .spark {
    animation: pulse 2.6s ease-in-out infinite;
  }
  .stage__tile {
    animation: float 7s ease-in-out infinite;
  }
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(26px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 6px oklch(0.82 0.16 82 / 0.22),
      0 8px 22px oklch(0.82 0.16 82 / 0.5);
  }
  50% {
    box-shadow: 0 0 0 12px oklch(0.82 0.16 82 / 0),
      0 8px 22px oklch(0.82 0.16 82 / 0.5);
  }
}
@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* ---- Responsive ---- */
@media (max-width: 860px) {
  .hero__grid {
    grid-template-columns: 1fr;
    gap: 2.2rem;
  }
  .stage {
    order: -1;
    max-width: 360px;
    margin-inline: auto;
  }
  .feature--lead {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 620px) {
  .features {
    grid-template-columns: 1fr;
  }
  .hero__sub {
    max-width: none;
  }
  /* Keep the ES/EN switch visible on phones. Free the space by dropping
     the header text button; the hero and signup section carry the CTA. */
  .head-cta {
    display: none;
  }
}
