/* ---------- tokens (from the Lite UI Figma file) ---------- */
:root {
  --action-primary: #0958d9;
  --action-primary-hover: #0846ad;
  --action-primary-fg: #ffffff;
  --action-secondary: #fafafa;
  --action-secondary-border: #d4d4d4;
  --action-secondary-fg: #1a1a1a;

  --text-primary: #1a1a1a;
  --text-secondary: #525252;
  --text-tertiary: #737373;
  --text-brand: #0958d9;
  --text-success: #237804;

  --bg-canvas: #fafafa;
  --bg-surface: #ffffff;
  --bg-surface-2: #f5f5f5;
  --bg-surface-3: #e7e7e7;

  --border-default: #e7e7e7;
  --border-strong: #d4d4d4;

  --feedback-success-bg: #f6ffed;
  --feedback-success-border: #b7eb8f;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-3xl: 24px;
  --radius-full: 9999px;

  --shadow-1: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.1);
  --shadow-3: 0 4px 8px rgba(15, 23, 42, 0.1), 0 8px 16px rgba(15, 23, 42, 0.12);
  --shadow-5: 0 12px 24px rgba(15, 23, 42, 0.14), 0 24px 48px rgba(15, 23, 42, 0.16);

  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- reset ---------- */
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg-canvas);
  color: var(--text-primary);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
button { font: inherit; background: none; border: none; cursor: pointer; }

.wrap {
  width: 100%;
  max-width: 1312px;
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 64px);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--text-primary);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  z-index: 100;
}
.skip-link:focus { left: 20px; top: 20px; }

:focus-visible {
  outline: 2px solid var(--action-primary);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(250, 250, 250, 0.82);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  border-bottom: 1px solid var(--border-default);
}
.header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  height: 64px;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
  color: var(--text-secondary);
  justify-self: start;
  min-width: 0;
}
.mark { flex: none; }
.main-nav {
  display: flex;
  gap: 24px;
  justify-self: center;
}
.main-nav a {
  font-weight: 500;
  font-size: 1rem;
  color: var(--text-tertiary);
  transition: color 0.15s var(--ease-out-expo);
}
.main-nav a:hover { color: var(--text-primary); }
.header-inner > .btn { justify-self: end; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: 1.125rem;
  line-height: 18px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-1);
  white-space: nowrap;
  transition: background-color 0.15s var(--ease-out-expo), border-color 0.15s var(--ease-out-expo),
    transform 0.15s var(--ease-out-expo), box-shadow 0.15s var(--ease-out-expo);
}
.btn:active { transform: translateY(1px); }
.btn-m { height: 44px; padding: 12px 16px; }

.btn-primary { background: var(--action-primary); color: var(--action-primary-fg); }
.btn-primary:hover { background: var(--action-primary-hover); box-shadow: var(--shadow-3); }

.btn-secondary {
  background: var(--action-secondary);
  color: var(--action-secondary-fg);
  border: 1px solid var(--action-secondary-border);
}
.btn-secondary:hover { background: var(--bg-surface); box-shadow: var(--shadow-3); }

/* ---------- hero ---------- */
.hero {
  position: relative;
  padding-top: clamp(24px, 4vw, 40px);
  overflow: clip;
}
.hero-visual {
  position: relative;
  width: min(94%, 1400px);
  aspect-ratio: 2048 / 919;
  margin: 0 auto;
  transform: scale(1.16);
  transform-origin: top center;
}
.hero-visual img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: top;
  will-change: transform, opacity;
}
.hero-inner {
  position: relative;
  margin-top: clamp(-90px, -18vw, -60px);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.hero h1 {
  font-size: clamp(2.25rem, 4.6vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--text-primary);
}
.hero-sub {
  margin-top: 20px;
  max-width: 50ch;
  font-size: 1.125rem;
  line-height: 1.55;
  color: var(--text-secondary);
}
.hero-actions { margin-top: 28px; padding-bottom: clamp(48px, 6vw, 80px); }

/* ---------- features ---------- */
.features { padding: clamp(56px, 7vw, 96px) 0 clamp(24px, 4vw, 48px); }
.features h2,
.examples h2 {
  font-size: clamp(1.75rem, 3.2vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  text-align: center;
  margin-bottom: clamp(28px, 4vw, 40px);
}

.bento {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.bento-card {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  overflow: clip;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s var(--ease-out-expo), box-shadow 0.25s var(--ease-out-expo), border-color 0.25s var(--ease-out-expo);
}
.bento-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-3);
  border-color: var(--border-strong);
}
.bento-card-wide { grid-column: span 2; }

/* row 1 (wide compare card + typography card) must NOT be grid-stretched:
   stretch would inflate typography's card past its natural content height,
   and since JS below measures that height to size the compare card, a
   stretch↔JS feedback loop would inflate both. Both cards size to their
   own natural content; JS then makes the compare card match exactly. */
.bento-card-wide,
#typography-card {
  align-self: start;
}

.bento-media {
  position: relative;
  aspect-ratio: 16 / 10;
  padding: 16px;
  box-sizing: border-box;
  background: var(--bg-surface-2);
}
.bento-card-wide .bento-media { aspect-ratio: 869 / 380; padding-bottom: 0; }

.bento-media-frame {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  overflow: hidden;
  background: var(--bg-surface-2);
}
.bento-media-frame > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
}

.bento-media-full {
  padding: 0;
  background: var(--bg-surface-2);
}
.bento-media-full > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
}

/* Desktop & Mobile typography drives row 1's height: sized to its own
   content (full image, natural ratio) instead of a cropped fixed box */
#typography-card .bento-media-full {
  aspect-ratio: auto;
}
#typography-card .bento-media-full > img {
  height: auto;
  object-fit: contain;
}
.bento-caption {
  border-top: 1px solid var(--border-default);
  padding: 16px;
}
.bento-caption h3 {
  font-size: 1.375rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.45;
  color: var(--text-primary);
}
.bento-caption p {
  margin-top: 4px;
  font-size: 1.125rem;
  line-height: 1.55;
  color: var(--text-primary);
}

/* theme compare slider */
.compare { cursor: ew-resize; user-select: none; }
.compare-base { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.compare-reveal {
  position: absolute;
  inset: 0;
  width: 50%;
  overflow: hidden;
}
.compare-reveal img {
  position: absolute;
  inset: 0;
  width: var(--compare-img-w, 100%);
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: top;
}
.compare-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.12);
  transform: translateX(-1px);
}
.compare-handle-grip {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
  box-shadow: var(--shadow-3);
}

/* ---------- examples / gallery ---------- */
.examples { padding: clamp(24px, 4vw, 48px) 0 clamp(64px, 8vw, 96px); }
.gallery {
  position: relative;
  mask-image: linear-gradient(to right, transparent 0, black 40px, black calc(100% - 40px), transparent 100%);
}
.gallery-track {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding: 4px clamp(20px, 5vw, 64px) 20px;
  scrollbar-width: none;
}
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-item {
  flex: none;
  width: min(78vw, 620px);
  margin: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- cta ---------- */
.cta-section { padding: 0 0 clamp(56px, 8vw, 96px); }
.cta-card {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-3xl);
  padding: clamp(56px, 9vw, 96px) 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  overflow: clip;
}
.cta-card h2 {
  position: relative;
  font-size: clamp(1.75rem, 3.2vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.03em;
}
.cta-card p { position: relative; font-size: 1.125rem; color: var(--text-primary); max-width: 50ch; }
.cta-card .btn { position: relative; margin-top: 8px; }

/* animated aurora background */
.cta-aurora {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.cta-aurora-blob {
  position: absolute;
  width: 56%;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(60px);
  will-change: transform;
}
.cta-aurora-blob-1 {
  top: -22%;
  left: -8%;
  width: 66%;
  background: radial-gradient(circle, rgba(9, 88, 217, 0.48) 0%, rgba(9, 88, 217, 0) 70%);
  animation: aurora-drift-1 24s ease-in-out infinite;
}
.cta-aurora-blob-2 {
  top: -5%;
  right: -12%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.34) 0%, rgba(59, 130, 246, 0) 70%);
  animation: aurora-drift-2 28s ease-in-out infinite;
}
.cta-aurora-blob-3 {
  bottom: -28%;
  left: 26%;
  background: radial-gradient(circle, rgba(8, 70, 173, 0.3) 0%, rgba(8, 70, 173, 0) 70%);
  animation: aurora-drift-3 32s ease-in-out infinite;
}
@keyframes aurora-drift-1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(10%, 8%) scale(1.1); }
  66% { transform: translate(-6%, 12%) scale(0.94); }
}
@keyframes aurora-drift-2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-14%, 10%) scale(1.12); }
}
@keyframes aurora-drift-3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  40% { transform: translate(8%, -10%) scale(1.06); }
  75% { transform: translate(-10%, -4%) scale(0.92); }
}

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--border-default); padding: 28px 0 40px; }
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  justify-content: space-between;
  align-items: center;
  font-size: 1rem;
  color: var(--text-tertiary);
  font-weight: 500;
}
.made-by { display: flex; align-items: center; gap: 8px; color: var(--text-primary); }
.made-by a { display: inline-flex; align-items: center; gap: 8px; color: var(--text-brand); }
.made-by a:hover { text-decoration: underline; }

/* ---------- reveal motion ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s var(--ease-out-expo), transform 0.7s var(--ease-out-expo);
}
[data-reveal].is-visible { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  .btn, .bento-card, .gallery-item { transition: none; }
  .cta-aurora-blob { animation: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .bento { grid-template-columns: repeat(2, 1fr); }
  .bento-card-wide { grid-column: span 2; }
  .main-nav { display: none; }
  .header-inner { grid-template-columns: auto auto; justify-content: space-between; }
}

@media (max-width: 640px) {
  .bento { grid-template-columns: 1fr; }
  .bento-card-wide { grid-column: span 1; }
  .bento-card-wide .bento-media { aspect-ratio: 16/11; }
  .hero-sub br { display: none; }

  .hero-visual { width: 100%; transform: scale(1.22); transform-origin: top center; }
  .hero h1 { font-size: 1.75rem; }
  .hero-inner { margin-top: -20px; }
}
