:root {
  color-scheme: light dark;
  --bg: #fbfbfa;
  --fg: #171717;
  --tag: #5d6065;
  --meta: #73767c;
  --surface: #ffffff;
  --surface-muted: #f1f1ee;
  --line: #d8d8d3;
  --accent: #0f7a55;
  --accent-hover: #0a6747;
  --accent-soft: #e9f6f0;
  --blue: #2563eb;
  --warning: #9a6500;
  --danger: #b42318;
  --focus-ring: rgba(15, 122, 85, 0.26);
  --shadow: rgba(20, 20, 18, 0.18);
  --demo-bg: #e9ece5;
  --demo-desktop-overlay: linear-gradient(180deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.04));
  --demo-desktop-wallpaper: image-set(
    url("wallpapers/tahoe-light-800.jpg") 1x,
    url("wallpapers/tahoe-light-1280.jpg") 2x
  );
  --chat-bg: #ffffff;
  --chat-sidebar-bg: #f9f9f9;
  --chat-text-muted: #5f5f5f;
  --chat-pill-bg: #f4f4f4;
  --font-rounded: ui-rounded, "SF Pro Rounded", "SF Pro Text", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --space-2xs: 0.5rem;
  --space-xs: 0.8rem;
  --space-sm: 1.1rem;
  --space-md: 1.45rem;
  --space-lg: 1.9rem;
  --space-xl: 2.5rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101010;
    --fg: #f4f4f2;
    --tag: #b5b5af;
    --meta: #969690;
    --surface: #181816;
    --surface-muted: #20201d;
    --line: #3a3a35;
    --accent: #45d18d;
    --accent-hover: #6cdea5;
    --accent-soft: #12261e;
    --blue: #7aa7ff;
    --warning: #f1b45a;
    --danger: #ff7d72;
    --focus-ring: rgba(69, 209, 141, 0.3);
    --shadow: rgba(0, 0, 0, 0.55);
    --demo-bg: #191c1b;
    --demo-desktop-overlay: linear-gradient(180deg, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.32));
    --demo-desktop-wallpaper: image-set(
      url("wallpapers/tahoe-dark-800.jpg") 1x,
      url("wallpapers/tahoe-dark-1280.jpg") 2x
    );
    --chat-bg: #212121;
    --chat-sidebar-bg: #171717;
    --chat-text-muted: #c7c7c7;
    --chat-pill-bg: #2f2f2f;
  }
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 4rem auto 3rem;
  padding: 0 1.5rem;
  max-width: 920px;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-rounded);
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.hero {
  max-width: 42rem;
  margin: 0 auto;
}

.icon {
  display: block;
  width: 128px;
  height: 128px;
  margin-bottom: var(--space-md);
  border-radius: 22.37%;
  box-shadow: 0 12px 30px var(--shadow);
}

h1 {
  margin: 0 0 var(--space-xs);
  font-size: 2.8rem;
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: 0;
}

.tag {
  margin: 0;
  color: var(--tag);
}

.lede {
  color: var(--fg);
  font-size: 1.28rem;
  line-height: 1.38;
  font-weight: 500;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
  margin: 0 0 var(--space-md);
}

.download,
.buy {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0 1.45rem;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
}

.download {
  background: var(--fg);
  color: var(--bg);
}

.download:hover {
  opacity: 0.88;
}

.buy {
  border: 1px solid var(--line);
  color: var(--fg);
}

.buy:hover {
  border-color: var(--tag);
}

.download:active,
.buy:active,
button:active {
  transform: translateY(1px);
}

.download:focus-visible,
.buy:focus-visible,
button:focus-visible,
.site-footer-link:focus-visible,
.wozi-footer-social-link:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

.meta {
  margin: 0;
  color: var(--meta);
  font-size: 0.92rem;
  line-height: 1.45;
}

.meta-item {
  white-space: nowrap;
}

.meta-separator {
  display: inline-block;
  margin: 0 0.46rem;
  color: var(--line);
  font-size: 0.58em;
  line-height: 1;
  transform: translateY(-0.04em);
}

.meta-break {
  display: none;
}

.demo-desktop {
  width: min(52rem, calc(100vw - 3rem));
  margin: var(--space-xl) 0 var(--space-lg);
  margin-left: 50%;
  padding: clamp(1rem, 3.4vw, 2rem);
  overflow: hidden;
  transform: translateX(-50%);
  border: 1px solid var(--line);
  border-radius: 16px;
  background-color: var(--demo-bg);
  background-image: var(--demo-desktop-overlay), var(--demo-desktop-wallpaper);
  background-position: center;
  background-size: cover;
}

.demo-stage {
  position: relative;
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  width: min(720px, 100%);
  aspect-ratio: 720 / 560;
  min-height: 0;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
  border-radius: 10px;
  background: var(--chat-bg);
  box-shadow: 0 18px 54px var(--shadow), 0 4px 14px rgba(0, 0, 0, 0.14);
  font-family:
    ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica,
    "Apple Color Emoji", Arial, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol";
}

.chat-sidebar {
  padding: 14px 8px;
  border-right: 1px solid var(--line);
  background: var(--chat-sidebar-bg);
}

.chat-brand {
  margin: 0 0 14px 6px;
  color: var(--fg);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
}

.chat-item {
  margin: 0 0 8px;
  overflow: hidden;
  padding: 8px;
  border-radius: 8px;
  color: var(--chat-text-muted);
  font-size: 12px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-item.is-active {
  background: var(--chat-pill-bg);
  color: var(--fg);
}

.chat-main {
  position: relative;
  min-width: 0;
  padding: 0;
}

.chat-message {
  position: absolute;
  max-width: 335px;
  margin: 0;
  color: var(--fg);
  font-size: 13px;
  line-height: 1.28;
}

.chat-message-user {
  right: 32px;
  top: 58px;
  padding: 10px 14px;
  border-radius: 18px;
  background: var(--chat-pill-bg);
  white-space: nowrap;
}

.chat-message-assistant {
  left: 46px;
  top: 122px;
  max-width: 330px;
}

.chat-message-secondary {
  top: 180px;
}

.demo-stage #cgpt-history-exporter {
  position: absolute;
  right: 16px;
  bottom: 16px;
  width: min(364px, calc(100% - 2rem));
  max-height: min(720px, calc(100% - 2rem));
  z-index: 1;
}

.demo-stage #cgpt-history-exporter button:active {
  transform: none;
}

.features,
.screenshots,
.legal {
  margin: 4.5rem 0 0;
}

.section-heading {
  margin: 0 0 0.3rem;
  color: var(--fg);
  font-size: 1rem;
  line-height: 1.3;
  font-weight: 800;
  letter-spacing: 0;
}

.section-intro {
  max-width: 34rem;
  margin: 0 0 var(--space-sm);
  color: var(--meta);
  font-size: 0.92rem;
  line-height: 1.45;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-sm);
}

.feature-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  padding: var(--space-md);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--fg);
}

.card-title {
  margin: 0 0 var(--space-xs);
  font-size: 1rem;
  line-height: 1.3;
  font-weight: 800;
  letter-spacing: 0;
}

.card-copy {
  margin: 0;
  color: var(--meta);
  font-size: 0.92rem;
  line-height: 1.45;
}

.privacy-note {
  margin: var(--space-sm) 0 0;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--meta);
  font-size: 0.92rem;
  line-height: 1.45;
}

.privacy-note strong {
  color: var(--fg);
}

.legal-note {
  margin: var(--space-sm) 0 0;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--meta);
  font-size: 0.92rem;
  line-height: 1.45;
}

.screenshot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-sm);
}

.screenshot-card {
  min-width: 0;
  margin: 0;
  padding: var(--space-xs);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.screenshot-card img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
  border-radius: 6px;
  background: var(--surface);
}

.screenshot-card figcaption {
  padding: 0.7rem 0.2rem 0.1rem;
  color: var(--tag);
  font-size: 0.86rem;
  font-weight: 700;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem 1.1rem;
  margin-top: 2.4rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--line);
  color: var(--meta);
}

.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.75rem;
  font-size: 0.92rem;
}

.site-footer-link {
  color: inherit;
  text-decoration: none;
}

.site-footer-link:hover {
  color: var(--fg);
  text-decoration: underline;
}

.wozi-footer-social {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  gap: 0.55rem;
  margin-left: auto;
  color: var(--meta);
}

.wozi-footer-link {
  color: inherit;
  text-decoration: none;
}

.wozi-footer-social-link {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 50%;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.wozi-footer-social-link:hover {
  border-color: var(--line);
  background: var(--surface-muted);
  color: var(--fg);
}

.wozi-footer-social-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.wozi-footer-social-icon--github {
  width: 24px;
  height: 24px;
}

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

.page {
  max-width: 660px;
}

.top-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 2.4rem;
  color: var(--fg);
  font-size: 1rem;
  font-weight: 800;
  text-decoration: none;
}

.top-link-icon {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border-radius: 7px;
}

.top-link:hover {
  opacity: 0.82;
}

.page h1 {
  font-size: 2.1rem;
  line-height: 1.15;
}

.updated {
  margin: 0 0 1.6rem;
  color: var(--meta);
  font-size: 0.92rem;
}

.page .lede {
  margin: 0 0 1.4rem;
  font-size: 1.12rem;
  line-height: 1.5;
}

.page h2 {
  margin: 2.2rem 0 0.7rem;
  font-size: 1.32rem;
  line-height: 1.25;
  letter-spacing: 0;
}

.page p {
  margin: 0 0 1rem;
}

.page ul {
  margin: 0 0 1rem;
  padding-left: 1.35rem;
}

.page li {
  margin: 0 0 0.5rem;
}

.page li::marker {
  color: var(--meta);
}

.link,
.link:visited {
  color: var(--accent);
  text-decoration: none;
}

.link:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

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

@media (max-width: 700px) {
  body {
    max-width: 560px;
    margin: 3.25rem auto 2.5rem;
    padding: 0 1.35rem;
  }

  .hero {
    max-width: 32rem;
  }

  .icon {
    width: 112px;
    height: 112px;
  }

  h1 {
    font-size: 2.45rem;
    line-height: 1.08;
  }

  .lede {
    max-width: 30rem;
    font-size: 1.12rem;
    line-height: 1.45;
  }

  .demo-desktop {
    width: 100%;
    margin-top: var(--space-lg);
    margin-bottom: var(--space-md);
    margin-left: 0;
    padding: 0.7rem;
    transform: none;
  }

  .demo-stage {
    grid-template-columns: 1fr;
    aspect-ratio: 720 / 760;
  }

  .chat-sidebar {
    display: none;
  }

  .chat-message {
    font-size: 12px;
  }

  .chat-message-assistant {
    left: 28px;
    top: 104px;
    max-width: min(58%, 230px);
  }

  .chat-message-secondary {
    display: none;
  }

  .demo-stage #cgpt-history-exporter {
    right: 16px;
    bottom: 16px;
    left: auto;
    width: min(364px, calc(100% - 32px));
    max-height: calc(100% - 32px);
  }

  .actions {
    gap: var(--space-sm);
  }

  .download,
  .buy {
    min-height: 46px;
    padding: 0 1.25rem;
  }

  .meta-break {
    display: block;
  }

  .features,
  .screenshots,
  .legal {
    margin-top: 3.5rem;
  }

  .feature-grid,
  .screenshot-grid {
    grid-template-columns: 1fr;
  }

  .feature-card {
    padding: var(--space-sm);
  }

  .site-footer,
  .wozi-footer-social {
    justify-content: flex-start;
    margin-left: 0;
  }
}

@media (max-width: 560px) {
  body {
    max-width: none;
    margin-right: 0;
    margin-left: 0;
  }

  .demo-stage #cgpt-history-exporter {
    right: 12px;
    left: auto;
    bottom: 12px;
    width: min(330px, calc(100% - 24px));
    max-height: calc(100% - 24px);
  }
}

@media (max-width: 430px) {
  body {
    margin: 2.25rem auto 2rem;
    padding: 0 1.1rem;
  }

  .hero {
    max-width: 22rem;
    margin-right: auto;
    margin-left: auto;
  }

  .icon {
    width: 96px;
    height: 96px;
    margin-bottom: var(--space-sm);
  }

  h1 {
    margin-bottom: var(--space-2xs);
    font-size: 2.2rem;
  }

  .lede {
    font-size: 1.06rem;
    line-height: 1.44;
  }

  .demo-desktop {
    width: 100%;
    margin: var(--space-lg) 0 var(--space-md);
    padding: 0.65rem;
    border-radius: 14px;
  }

  .demo-stage {
    aspect-ratio: 720 / 760;
  }

  .chat-main {
    padding: 0;
  }

  .chat-message {
    max-width: 82%;
  }

  .actions {
    align-items: stretch;
    margin-bottom: var(--space-md);
  }

  .download,
  .buy {
    width: 100%;
  }

  .meta {
    font-size: 0.84rem;
  }

  .meta-break {
    display: block;
  }

  .wozi-footer-social-link {
    width: 32px;
    height: 32px;
  }

  .page h1 {
    font-size: 1.7rem;
  }
}
