/* XEditor landing — Viktor Oddy layout + product design system (app tokens). */

:root {
  color-scheme: light;
  --bg: #ffffff;
  --soft: #f7f6f3;
  --text: #37352f;
  --muted: #9b9a97;
  --border: #e9e9e7;
  --border-soft: rgb(55 53 47 / 0.09);
  --hover: #f1f1ef;
  --accent: #2383e2;
  --accent-soft: rgb(35 131 226 / 0.12);
  --ink-dark: #37352f;
  --glass: rgb(255 255 255 / 0.72);
  /* Landing uses thin borders instead of drop shadows */
  --border-card: 1px solid var(--border);
  --border-strong: 1px solid rgb(55 53 47 / 0.14);
  --shadow-soft: none;
  --shadow-lg: none;
  --shadow-primary: none;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 32px;
  --radius-2xl: 40px;
  --pill: 999px;
  /* Exact stack from src/style.css (editor) */
  --font:
    Arad,
    Shabnam,
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    Helvetica,
    'Apple Color Emoji',
    Arial,
    sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --max: 1200px;
  /* Space reserved for fixed .bottom-nav (.xdc + Open webapp) */
  --bottom-nav-clearance: 5.75rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-family: var(--font);
  max-width: 100%;
  /* Single page scrollbar: only the root scrolls vertically.
     Setting overflow-x:hidden on both html+body makes overflow-y:auto on both → double bars. */
  overflow-x: clip;
  overflow-y: scroll;
}

html[dir='rtl'] {
  direction: rtl;
}

html[dir='rtl'] .hero,
html[dir='rtl'] .hero__logo,
html[dir='rtl'] .hero__title,
html[dir='rtl'] .hero__tag,
html[dir='rtl'] .hero__copy,
html[dir='rtl'] .hero__meta,
html[dir='rtl'] .project__text,
html[dir='rtl'] .carousel-head h2,
html[dir='rtl'] .feature-modal,
html[dir='rtl'] blockquote {
  text-align: start;
}

html[dir='rtl'] .btn__size {
  margin-left: 0;
  margin-inline-start: 0.15rem;
}

html[dir='rtl'] {
  font-feature-settings: 'ss01' 0;
}

body,
body.xeditor-type {
  position: relative;
  margin: 0;
  min-height: 100vh;
  max-width: 100%;
  overflow-x: clip;
  overflow-y: visible;
  font-family: var(--font);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* Headings / UI use the same family (weights from @font-face) */
h1,
h2,
h3,
h4,
.btn,
.hero__logo,
.partner__title,
.carousel-head h2 {
  font-family: var(--font);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

code {
  font-family: var(--mono);
  font-size: 0.9em;
  padding: 0.1em 0.35em;
  border-radius: 6px;
  background: var(--soft);
}

em {
  font-style: normal;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.page {
  max-width: 100%;
  overflow-x: clip;
  padding-bottom: 7rem;
}

/* Animations */
@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.reveal {
  opacity: 0;
}

.reveal.is-in {
  animation: fadeInUp 0.8s ease-out forwards;
}

@keyframes marquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.65rem;
  border-radius: var(--pill);
  border: 1px solid transparent;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 550;
  cursor: pointer;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    transform 0.18s cubic-bezier(0.32, 0.72, 0, 1),
    opacity 0.18s ease;
  will-change: transform;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0) scale(0.98);
  transition-duration: 0.08s;
}

.btn--primary {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}

.btn--primary:hover {
  background: #2c2a26;
  border-color: #2c2a26;
}

.btn--secondary {
  background: #fff;
  color: var(--text);
  border-color: var(--border);
}

.btn--secondary:hover {
  background: var(--hover);
  border-color: rgb(55 53 47 / 0.18);
}

.btn--on-dark {
  background: #fff;
  color: var(--text);
  border-color: rgb(255 255 255 / 0.9);
}

.btn--on-dark:hover {
  background: var(--soft);
}

.btn--ghost-on-dark {
  background: transparent;
  color: #fff;
  border-color: rgb(255 255 255 / 0.28);
}

.btn--ghost-on-dark:hover {
  background: rgb(255 255 255 / 0.1);
  border-color: rgb(255 255 255 / 0.45);
}

.btn--cta {
  padding: 0.45rem 1.25rem 0.45rem 0.45rem;
}

.btn--download {
  gap: 0.55rem;
}

.btn__size {
  display: inline-flex;
  align-items: center;
  margin-left: 0.15rem;
  padding: 0.12em 0.5em;
  border-radius: var(--pill);
  font-size: 0.78em;
  font-weight: 600;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
  opacity: 0.85;
  background: rgb(0 0 0 / 0.08);
}

.btn--on-dark .btn__size,
.btn--primary .btn__size {
  background: rgb(255 255 255 / 0.16);
  opacity: 0.95;
}

.btn--ghost-on-dark .btn__size {
  background: rgb(255 255 255 / 0.12);
}

.btn--compact {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

.btn__icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: block;
  /* SVG uses currentColor — tint to match button text */
  filter: none;
}

/* WebXDC favicon PNG — keep original colors on all button variants */
.btn--primary .btn__icon--on-dark,
.btn--on-dark .btn__icon,
.btn .btn__icon {
  filter: none;
}

.btn__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.partner__actions {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

/* 1. First screen — hero + marquee centered in the area above the bottom nav */
.first-screen {
  --first-screen-pad-top: 0.75rem;
  box-sizing: border-box;
  height: 100vh;
  height: 100dvh;
  height: 100svh;
  max-height: 100vh;
  max-height: 100dvh;
  max-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  /* Center hero+marquee within the padded box (bottom pad = bottom-nav height) */
  justify-content: center;
  padding-top: var(--first-screen-pad-top);
  padding-bottom: var(--bottom-nav-clearance);
  margin-bottom: 0;
  overflow: hidden;
  gap: 1.1rem;
}

.hero {
  max-width: 440px;
  width: 100%;
  margin: 0 auto;
  padding: 0 1.5rem;
  flex: 0 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  /* Never a second scrollbar — page root owns scrolling */
  overflow: visible;
}

@media (min-width: 768px) {
  .hero {
    padding: 0 1.5rem;
  }
}

@media (max-height: 780px) {
  .hero__copy {
    gap: 0.7rem;
  }

  .first-screen {
    gap: 0.75rem;
  }
}

/* Stack like page icon + title in the app */
.hero__logo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.65rem;
  margin: 0 0 1.15rem;
  color: var(--text);
}

.hero__logo-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 0.65rem;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.hero__logo-text {
  font-size: clamp(32px, 5vw, 44px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

/* Looks like a plain text block in the editor (no pill chrome) */
.hero__tag {
  display: block;
  margin: 0 0 0.85rem;
  padding: 0;
  max-width: 28rem;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: -0.01em;
  color: var(--text);
  background: none;
  border: 0;
  border-radius: 0;
}

@media (min-width: 768px) {
  .hero__tag {
    font-size: 1.05rem;
    line-height: 1.6;
  }
}

.hero__title {
  margin: 0;
  font-size: clamp(32px, 5vw, 44px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text);
}

.hero__copy {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 1.25rem;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text);
}

@media (min-width: 768px) {
  .hero__copy {
    margin-top: 1.5rem;
    font-size: 1rem;
  }
}

.hero__copy p {
  margin: 0;
}

/* Typed paragraphs — height reserved via JS min-height (no layout jump) */
.hero__type {
  position: relative;
}

.hero__type.is-typing::after {
  content: '';
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 1px;
  vertical-align: -0.1em;
  background: var(--accent);
  animation: heroCaret 1s step-end infinite;
}

.hero__type.is-done::after {
  display: none;
}

@keyframes heroCaret {
  50% {
    opacity: 0;
  }
}

/* Peer presence cursors (landing demo) — page-absolute, scroll with content */
.presence-layer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  max-width: 100%;
  /* height set in JS to match document scroll height only */
  min-height: 100%;
  z-index: 45;
  pointer-events: none;
  overflow: hidden; /* never contribute to horizontal page scroll */
}

.excal-cursor {
  position: absolute;
  top: 0;
  left: 0;
  will-change: transform;
  pointer-events: none;
  transition: transform 0.55s cubic-bezier(0.22, 0.7, 0.2, 1);
}

.excal-arrow {
  display: block;
  filter: drop-shadow(0 1px 1px rgb(0 0 0 / 0.12));
}

.excal-name {
  position: absolute;
  top: 16px;
  left: 6px;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 3px 6px;
  border-radius: 8px;
  background: var(--cursor-color, #2383e2);
  border: 1px solid #ffffff;
  color: #1e1e1e;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.hero__actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

@media (min-width: 640px) {
  .hero__actions {
    flex-direction: row;
    gap: 1rem;
  }
}

.hero__meta {
  margin: 1rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.hero__meta a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* 2. Marquee — immediately after the hero block */
.first-screen .marquee {
  width: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  flex: 0 0 auto;
  flex-shrink: 0;
  transform: none;
}

.marquee {
  width: 100%;
  overflow: hidden;
  /* Keep the strip LTR so RTL pages don't park the track off-screen. */
  direction: ltr;
}

.marquee__track {
  display: flex;
  align-items: stretch;
  width: max-content;
  direction: ltr;
  animation: marquee 30s linear infinite;
}

@media (max-width: 768px) {
  .marquee__track {
    animation-duration: 12s;
  }
}

/* Sized so hero + strip fit in first viewport above bottom nav */
.marquee__track img {
  flex: 0 0 auto;
  height: clamp(110px, 16vh, 180px);
  width: auto;
  aspect-ratio: 16 / 10;
  margin: 0 0.65rem;
  border-radius: 1rem;
  object-fit: contain;
  object-position: top center;
  background: var(--soft);
  border: var(--border-card);
  cursor: zoom-in;
}

@media (min-width: 768px) {
  .marquee__track img {
    height: clamp(130px, 17vh, 200px);
  }
}

@media (min-width: 1100px) {
  .marquee__track img {
    height: clamp(140px, 18vh, 220px);
  }
}

@media (max-height: 700px) {
  .marquee__track img {
    height: clamp(96px, 14vh, 140px);
  }
}

/*
 * Phones (incl. iPhone SE 375×667): first screen was height:100vh + overflow:hidden
 * while .hero could shrink (min-height:0). Marquee then painted over the last
 * paragraphs. Do not change tablet/desktop first-screen lock.
 */
@media (max-width: 480px) {
  .first-screen {
    height: auto;
    max-height: none;
    min-height: 0;
    overflow: visible;
    justify-content: flex-start;
    gap: 0.85rem;
    padding-top: 0.45rem;
  }

  .hero {
    flex: 0 0 auto;
    flex-basis: auto;
    height: auto;
    max-height: none;
    min-height: 0;
    overflow: visible;
    padding: 0 1.15rem 0.35rem;
  }

  .hero__logo {
    flex-direction: row;
    align-items: center;
    gap: 0.6rem;
    margin: 0 0 0.5rem;
  }

  .hero__logo-icon {
    width: 2.5rem;
    height: 2.5rem;
  }

  .hero__logo-text {
    font-size: 1.7rem;
  }

  .hero__tag {
    margin: 0 0 0.4rem;
    font-size: 0.92rem;
    line-height: 1.4;
  }

  .hero__title {
    font-size: 1.7rem;
    line-height: 1.15;
  }

  .hero__copy {
    margin-top: 0.6rem;
    gap: 0.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
  }

  .hero__meta {
    margin: 0.5rem 0 0;
    font-size: 0.8rem;
  }

  .first-screen .marquee {
    /* Keep strip below version/meta; hero overflow must not cover it */
    margin-top: 1.15rem;
  }

  .first-screen .marquee__track img {
    height: 88px;
    margin: 0 0.45rem;
    border-radius: 0.75rem;
  }
}

/* 3. Quote — starts after first screen, with space for the quote mark */
.quote-section {
  padding: 5rem 0 0;
  width: 100%;
  scroll-margin-top: 1rem;
}

@media (min-width: 768px) {
  .quote-section {
    padding-top: 5.5rem;
  }
}

.quote-section__inner {
  max-width: 42rem;
  margin: 0 auto;
  padding: 0 1.5rem;
  text-align: center;
}

.quote-mark-wrap {
  display: flex;
  justify-content: center;
  margin: 0 0 1.25rem;
  min-height: 2rem;
}

.quote-mark {
  color: var(--text);
  display: block;
}

.quote-section blockquote {
  margin: 0;
  font-size: clamp(28px, 4.5vw, 44px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--text);
}

.quote-author {
  margin: 1.5rem 0 0;
  font-size: 0.875rem;
  font-style: italic;
  color: var(--muted);
}

.logo-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 1rem 1.75rem;
  margin-top: 2.5rem;
  font-size: 1.1rem;
  font-weight: 550;
  color: var(--text);
}

.logo-row__link {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.85rem 0.45rem 0.55rem;
  border-radius: var(--pill);
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  text-decoration: none;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    transform 0.18s cubic-bezier(0.32, 0.72, 0, 1);
}

.logo-row__link:hover {
  background: var(--hover);
  border-color: rgb(55 53 47 / 0.18);
  transform: translateY(-2px);
}

.logo-row__link:active {
  transform: translateY(0) scale(0.98);
}

.logo-row__icon {
  width: 1.55rem;
  height: 1.55rem;
  flex-shrink: 0;
  object-fit: contain;
  border-radius: 6px;
  display: block;
}

.parallax-wrap {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  margin: 2.75rem auto 0;
  padding: 0 1.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.parallax-img {
  display: block;
  width: 100%;
  max-width: min(64rem, 100%);
  margin-inline: auto;
  aspect-ratio: 16 / 10;
  height: auto;
  object-fit: contain;
  object-position: center center;
  background: var(--soft);
  border-radius: 1.15rem;
  border: var(--border-card);
  will-change: transform;
  cursor: zoom-in;
}

@media (min-width: 900px) {
  .parallax-wrap {
    padding: 0 2rem;
  }
}

@media (min-width: 1200px) {
  .parallax-img {
    max-width: 72rem;
  }
}

/* 4. Pricing / download cards */
.pricing {
  width: 100%;
  padding: 3rem 1.5rem;
}

.pricing__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  max-width: 56rem;
  margin-inline: auto;
  justify-content: center;
}

@media (min-width: 768px) {
  .pricing__grid {
    grid-template-columns: 1fr 1fr;
  }
}

.price-card {
  border-radius: var(--radius-2xl);
  padding: 1.5rem 2rem 2.25rem;
}

@media (min-width: 768px) {
  .price-card {
    padding: 1.75rem 2.25rem 2.5rem;
  }
}

.price-card h3 {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 550;
}

.price-card > p {
  margin: 0.75rem 0 0;
  font-size: 0.95rem;
  line-height: 1.55;
  opacity: 0.85;
}

.price-card__price {
  margin-top: 2rem;
}

.price-card__price strong {
  display: block;
  font-size: 1.5rem;
  font-weight: 600;
}

.price-card__price span {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.875rem;
  opacity: 0.75;
}

.price-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.price-card--dark {
  background: var(--text);
  color: #f7f6f3;
  border: 1px solid rgb(55 53 47 / 0.9);
}

.price-card--light {
  background: #fff;
  color: var(--text);
  border: var(--border-card);
}

/* 5. Carousel */
.carousel-section {
  width: 100%;
  padding: 5rem 0;
}

.carousel,
.carousel__track {
  direction: ltr;
}

.carousel-head {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.25rem;
  max-width: var(--max);
  width: 100%;
  margin: 0 auto 1.5rem;
  padding: 0 1.5rem;
  text-align: left;
}

.carousel-head h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text);
}

.pill {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  border-radius: var(--pill);
  background: var(--soft);
  font-size: 0.85rem;
  color: var(--muted);
}

/* Prev/next sit beside the heading (right side) */
.carousel-head .carousel__nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  margin: 0;
  padding: 0;
  max-width: none;
}

.circle-btn {
  position: relative;
  z-index: 3;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    transform 0.18s cubic-bezier(0.32, 0.72, 0, 1);
}

.circle-btn:hover {
  background: var(--hover);
  border-color: rgb(55 53 47 / 0.2);
  transform: scale(1.08);
}

.circle-btn:active {
  background: var(--soft);
  transform: scale(0.96);
}

.carousel__viewport {
  overflow: hidden;
  width: 100%;
}

.carousel__track {
  display: flex;
  gap: 1.5rem;
  padding: 0 1.5rem;
  will-change: transform;
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-card {
  flex: 0 0 calc(100% - 3rem);
  max-width: 427.5px;
  background: #fff;
  border-radius: var(--radius-xl);
  border: var(--border-card);
  padding: 2rem 1.5rem;
  overflow: hidden;
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    transform 0.2s cubic-bezier(0.32, 0.72, 0, 1),
    background 0.2s ease;
}

.carousel-card:hover {
  border-color: rgb(55 53 47 / 0.18);
  transform: translateY(-3px);
  background: #fff;
}

.carousel-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.carousel-card--source-hidden {
  opacity: 0 !important;
  pointer-events: none !important;
}

@media (min-width: 768px) {
  .carousel-card {
    flex: 0 0 427.5px;
    border-radius: var(--radius-2xl);
    padding: 2rem 2.5rem 2rem 2.5rem;
  }
}

.carousel-card img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: contain;
  object-position: top center;
  background: var(--soft);
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  pointer-events: none;
  user-select: none;
}

.carousel-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  font-weight: 650;
}

.carousel-card p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text);
}

.carousel-card__more {
  display: inline-block;
  margin-top: 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
}

/* Morph expand overlay → feature modal */
body.carousel-morph-open {
  overflow: hidden;
}

.carousel-morph-backdrop {
  position: fixed;
  inset: 0;
  z-index: 94;
  margin: 0;
  padding: 0;
  border: none;
  background: rgb(15 15 15 / 0);
  cursor: zoom-out;
  transition: background 0.4s cubic-bezier(0.32, 0.72, 0, 1);
  -webkit-tap-highlight-color: transparent;
}

.carousel-morph-backdrop.is-visible {
  background: rgb(15 15 15 / 0.5);
}

.feature-modal {
  display: flex;
  flex-direction: column;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 0;
  cursor: default;
  box-sizing: border-box;
  backface-visibility: hidden;
  -webkit-font-smoothing: antialiased;
  box-shadow: none;
  color: var(--text);
}

.feature-modal__close {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  z-index: 2;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: #fff;
  color: var(--text);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition:
    background 0.15s ease,
    transform 0.15s ease,
    border-color 0.15s ease;
}

.feature-modal__close:hover {
  background: var(--hover);
  border-color: rgb(55 53 47 / 0.2);
  transform: scale(1.06);
}

.feature-modal__img {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(42vh, 420px);
  aspect-ratio: 16 / 10;
  object-fit: contain;
  object-position: top center;
  background: var(--soft);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  pointer-events: none;
}

.feature-modal__body {
  padding: 1.25rem 1.5rem 1.6rem;
  text-align: left;
}

.feature-modal__title {
  margin: 0 0 0.45rem;
  padding-right: 2rem;
  font-size: clamp(1.3rem, 2.4vw, 1.7rem);
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.feature-modal__lead {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 550;
  line-height: 1.5;
  color: var(--text);
}

.feature-modal__detail {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  line-height: 1.65;
  color: rgb(55 53 47 / 0.82);
}

.feature-modal__points {
  margin: 0;
  padding: 0 0 0 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text);
}

.feature-modal__points li::marker {
  color: var(--accent);
}

@media (max-width: 640px) {
  .feature-modal__body {
    padding: 1rem 1.1rem 1.35rem;
  }

  .feature-modal__img {
    max-height: min(36vh, 280px);
  }
}

/* 6. Projects / tour */
.projects {
  max-width: var(--max);
  margin: 0 auto;
  padding: 3rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 4rem;
}

@media (min-width: 768px) {
  .projects {
    gap: 5rem;
  }
}

.project__text {
  margin-left: 5rem;
}

@media (min-width: 768px) {
  .project__text {
    margin-left: 7rem;
  }
}

.project__text h3 {
  margin: 0;
  font-size: clamp(1.4rem, 2.5vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.project__text p {
  margin: 0.5rem 0 0;
  font-size: 0.95rem;
  color: rgb(55 53 47 / 0.7);
}

@media (min-width: 768px) {
  .project__text p {
    font-size: 1rem;
  }
}

.project__img {
  width: 100%;
  margin-top: 1.5rem;
  aspect-ratio: 16 / 10;
  height: auto;
  border-radius: 1rem;
  border: var(--border-card);
  object-fit: contain;
  object-position: top center;
  background: var(--soft);
  cursor: zoom-in;
}

/* 7. Partner */
.partner {
  width: 100%;
  padding: 3rem 1.5rem;
}

.partner__stage {
  position: relative;
  max-width: 80rem;
  margin: 0 auto;
  padding: 8rem 1.5rem;
  border-radius: var(--radius-2xl);
  background: #fff;
  border: var(--border-card);
  overflow: hidden;
  text-align: center;
}

.partner__title {
  position: relative;
  z-index: 2;
  margin: 0 0 2.5rem;
  font-size: clamp(40px, 7vw, 80px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--text);
}

.partner__stage .btn {
  position: relative;
  z-index: 2;
}

.partner-ghost {
  position: absolute;
  z-index: 1;
  pointer-events: none;
  animation: ghostOut 1s ease forwards;
  user-select: none;
}

/* Screenshot-style ghost (legacy); emoji trail is the default for this section */
.partner-ghost:not(.partner-ghost--emoji) {
  width: 8rem;
  height: 6rem;
  object-fit: cover;
  border-radius: 0.75rem;
  border: var(--border-card);
}

.partner-ghost--emoji {
  display: grid;
  place-items: center;
  width: auto;
  height: auto;
  line-height: 1;
  font-size: 2rem;
}

@media (min-width: 768px) {
  .partner-ghost:not(.partner-ghost--emoji) {
    width: 11rem;
    height: 8rem;
  }

  .partner-ghost--emoji {
    font-size: 2.4rem;
  }
}

@keyframes ghostOut {
  from {
    opacity: 1;
    scale: 1;
  }
  to {
    opacity: 0;
    scale: 0.55;
  }
}

/* 8. Footer */
.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.site-footer__inner {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

@media (min-width: 768px) {
  .site-footer__inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
  }
}

.site-footer__links {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
}

.site-footer__arrow {
  font-size: 1.25rem;
  line-height: 1.4;
}

.site-footer__links nav {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.site-footer__links a {
  font-size: 1rem;
  color: var(--text);
  transition: opacity 0.15s ease;
}

.site-footer__links a:hover {
  opacity: 0.7;
}

.site-footer__links {
  display: flex;
  gap: 2rem;
}

/* 9. Copyright */
.copyright {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  color: var(--text);
}

/* 10. Bottom nav — full-size CTAs; shadow only (no border) on this bar */
.bottom-nav {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  z-index: 50;
  transform: translateX(-50%) translateY(0);
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.5rem 0.6rem;
  border-radius: var(--pill);
  background: #fff;
  border: none;
  box-shadow:
    0 4px 24px rgb(15 15 15 / 0.12),
    0 1px 4px rgb(15 15 15 / 0.06);
  opacity: 1;
  pointer-events: auto;
  max-width: calc(100vw - 1.25rem);
  box-sizing: border-box;
  transition:
    opacity 0.28s ease,
    transform 0.32s cubic-bezier(0.32, 0.72, 0, 1),
    visibility 0.32s;
  will-change: transform, opacity;
}

.bottom-nav.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-50%) translateY(1.25rem);
}

.bottom-nav .btn {
  /* Match primary landing buttons — ignore .btn--compact shrinkage on phones */
  flex: 0 0 auto;
  flex-shrink: 0;
  white-space: nowrap;
  padding: 0.7rem 1.65rem;
  font-size: 0.92rem;
  line-height: 1.25;
  min-height: 2.75rem;
  box-sizing: border-box;
}

.bottom-nav .btn--compact {
  padding: 0.7rem 1.65rem;
  font-size: 0.92rem;
}

.bottom-nav .btn__icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

@media (max-width: 380px) {
  /* Still full control size; only tighten outer gap slightly on very narrow phones */
  .bottom-nav {
    gap: 0.5rem;
    padding: 0.45rem 0.5rem;
    bottom: max(1rem, env(safe-area-inset-bottom));
  }
}

/* ── Lightbox ──────────────────────────────────────────── */

body.lightbox-open {
  overflow: hidden;
}

.lb {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3.25rem 0.75rem 1.25rem;
  box-sizing: border-box;
  opacity: 0;
  transition: opacity 0.28s ease;
  pointer-events: none;
  overflow: hidden;
}

@media (min-width: 720px) {
  .lb {
    padding: 3.5rem 4.5rem 2rem;
  }
}

.lb[hidden] {
  display: none !important;
}

.lb.lb--visible {
  opacity: 1;
  pointer-events: auto;
}

.lb-overlay {
  position: absolute;
  inset: 0;
  background: rgb(0 0 0 / 0.82);
  cursor: pointer;
}

.lb-outer {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: auto;
  max-width: min(1100px, calc(100vw - 1.5rem));
  margin: 0 auto;
  box-sizing: border-box;
}

@media (min-width: 720px) {
  .lb-outer {
    max-width: min(1100px, calc(100vw - 6rem));
  }
}

.lb-container {
  position: relative;
  width: 120px;
  height: 80px;
  max-width: min(1100px, calc(100vw - 1.5rem));
  max-height: min(calc(100vh - 6rem), calc(100dvh - 6rem));
  margin: 0 auto;
  background: #111;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 0.2);
  box-sizing: border-box;
}

@media (min-width: 720px) {
  .lb-container {
    max-width: min(1100px, calc(100vw - 6rem));
    max-height: calc(100vh - 7.5rem);
  }
}

.lb-image {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center center;
  margin: 0 auto;
  opacity: 0;
  border: 0;
  vertical-align: middle;
  background: #111;
  /* Allow browser/gesture pinch on the photo itself */
  touch-action: manipulation;
  -webkit-user-drag: none;
  user-select: none;
}

/* Edge controls — always visible (carousel-style circle buttons) */
.lb-prev,
.lb-next,
.lb-close {
  position: fixed;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  margin: 0;
  padding: 0;
  border: 1px solid rgb(255 255 255 / 0.28);
  border-radius: 50%;
  background: rgb(255 255 255 / 0.12);
  color: #fff;
  font-size: 1.85rem;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    transform 0.18s cubic-bezier(0.32, 0.72, 0, 1);
}

.lb-prev span,
.lb-next span,
.lb-close span {
  display: block;
  transform: translateY(-1px);
  user-select: none;
  transition: transform 0.18s cubic-bezier(0.32, 0.72, 0, 1);
}

.lb-prev:hover,
.lb-next:hover,
.lb-close:hover {
  background: rgb(255 255 255 / 0.24);
  border-color: rgb(255 255 255 / 0.55);
}

.lb-prev:active,
.lb-next:active,
.lb-close:active {
  background: rgb(255 255 255 / 0.3);
}

.lb-prev:focus-visible,
.lb-next:focus-visible,
.lb-close:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.lb-prev {
  left: max(0.75rem, env(safe-area-inset-left));
  top: 50%;
  transform: translateY(-50%);
}

.lb-next {
  right: max(0.75rem, env(safe-area-inset-right));
  top: 50%;
  transform: translateY(-50%);
}

.lb-prev:hover {
  transform: translateY(-50%) scale(1.1);
}

.lb-prev:hover span {
  transform: translateY(-1px) translateX(-1px);
}

.lb-next:hover {
  transform: translateY(-50%) scale(1.1);
}

.lb-next:hover span {
  transform: translateY(-1px) translateX(1px);
}

.lb-prev:active,
.lb-next:active {
  transform: translateY(-50%) scale(0.96);
}

.lb-close {
  top: max(0.75rem, env(safe-area-inset-top));
  right: max(0.75rem, env(safe-area-inset-right));
  font-size: 1.65rem;
}

.lb-close:hover {
  transform: scale(1.1) rotate(90deg);
}

.lb-close:active {
  transform: scale(0.96) rotate(90deg);
}

.lb-prev[hidden],
.lb-next[hidden] {
  display: none;
}

.lb-loader {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  background: #fff;
  z-index: 2;
}

.lb-loader--on {
  display: grid;
}

.lb-loader-inner {
  width: 32px;
  height: 32px;
  border: 3px solid #e9e9e7;
  border-top-color: #2383e2;
  border-radius: 50%;
  animation: lb-spin 0.7s linear infinite;
}

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

.lb-data {
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 0.75rem 0.25rem 0.15rem;
  color: #ccc;
  font-size: 0.85rem;
  line-height: 1.4;
  text-align: center;
  box-sizing: border-box;
}

.lb-details {
  min-height: 1.2em;
}

.lb-caption {
  font-weight: 500;
  color: #eee;
}

.lb-number {
  margin-top: 0.25rem;
  font-size: 0.78rem;
  color: #999;
}

@media (max-width: 720px) {
  .lb {
    /* Leave bottom clear for prev/next so the photo is free to pinch-zoom */
    padding: 3rem 0.75rem 5.25rem;
  }

  .lb-container {
    /* Keep the image away from bottom controls */
    max-height: min(calc(100vh - 9.5rem), calc(100dvh - 9.5rem));
  }

  .lb-image {
    /* Prefer pinch/pan gestures over browser link handling */
    touch-action: pan-x pan-y pinch-zoom;
  }

  .lb-prev,
  .lb-next,
  .lb-close {
    width: 2.75rem;
    height: 2.75rem;
    font-size: 1.45rem;
  }

  .lb-close {
    font-size: 1.4rem;
    top: max(0.5rem, env(safe-area-inset-top));
    right: max(0.5rem, env(safe-area-inset-right));
  }

  /* Prev / next sit at bottom corners — not mid-screen over the image */
  .lb-prev,
  .lb-next {
    top: auto;
    bottom: max(0.85rem, env(safe-area-inset-bottom));
    transform: none;
  }

  .lb-prev {
    left: max(1rem, env(safe-area-inset-left));
  }

  .lb-next {
    right: max(1rem, env(safe-area-inset-right));
  }

  .lb-prev:hover,
  .lb-next:hover {
    transform: scale(1.08);
  }

  .lb-prev:active,
  .lb-next:active {
    transform: scale(0.96);
  }

  .lb-prev:hover span,
  .lb-next:hover span {
    transform: translateY(-1px);
  }

  .lb-data {
    padding: 0.45rem 0.5rem 0.1rem;
    font-size: 0.8rem;
  }
}

/* ── Versions page (minimal) ───────────────────────────── */

.page--versions {
  min-height: 100vh;
  padding: 0 0 3rem;
  background: var(--bg);
}

.ver-top {
  max-width: 40rem;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.9rem;
}

.ver-back,
.ver-webapp {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
  transition: color 0.15s ease;
}

.ver-back__icon {
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
}

.ver-back:hover,
.ver-webapp:hover {
  color: var(--text);
}

.ver-main {
  max-width: 40rem;
  margin: 0 auto;
  padding: 2rem 1.25rem 0;
}

.ver-title {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 650;
  letter-spacing: -0.03em;
  color: var(--text);
}

.ver-lead {
  margin: 0.5rem 0 1.5rem;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--muted);
}

.ver-lead__meta {
  display: inline;
}

.ver-lead strong {
  color: var(--text);
  font-weight: 600;
}

.ver-lead a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ver-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.ver-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.ver-table th,
.ver-table td {
  padding: 0.7rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.ver-table thead th {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: var(--soft);
}

.ver-table tbody tr:last-child th,
.ver-table tbody tr:last-child td {
  border-bottom: 0;
}

.ver-table tbody tr:hover {
  background: var(--hover);
}

.ver-row__tag {
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--text);
}

.ver-row--latest .ver-row__tag {
  color: var(--text);
}

.ver-latest {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.1em 0.45em;
  border-radius: var(--pill);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  vertical-align: middle;
}

.ver-table a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 550;
}

.ver-table a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ver-row__notes a {
  color: var(--muted);
  font-weight: 500;
}

.ver-row__notes a:hover {
  color: var(--text);
}

.ver-foot {
  margin: 1.25rem 0 0;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--muted);
}

.ver-foot code {
  font-size: 0.9em;
}

.versions-empty {
  margin: 0;
  padding: 1.25rem;
  border: 1px dashed var(--border);
  border-radius: 10px;
  color: var(--muted);
  text-align: center;
  font-size: 0.95rem;
}

@media (max-width: 520px) {
  .ver-table th,
  .ver-table td {
    padding: 0.6rem 0.55rem;
    font-size: 0.85rem;
  }
}
