/* Organic Chemistry AI — marketing site
   Palette from the App Store icon and DESIGN.md
   accent #1B6B54 · background #F4F7F5 · text #13241C · muted #5C6E66 */

@font-face {
  font-family: "Space Grotesk";
  src: url("../assets/fonts/space-grotesk-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("../assets/fonts/space-grotesk-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("../assets/fonts/space-grotesk-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("../assets/fonts/space-grotesk-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --accent: #1b6b54;
  --accent-pressed: #155a46;
  --accent-soft: #e9f2ed;
  --bg: #f4f7f5;
  --bg-card: #ffffff;
  --text: #13241c;
  --muted: #5c6e66;
  --line: rgba(19, 36, 28, 0.1);
  --shadow: 0 18px 50px rgba(27, 107, 84, 0.12);
  --radius: 20px;
  --nav-h: 64px;
  --max: 1120px;
  --font: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent: #5ebf9a;
    --accent-pressed: #4aa888;
    --accent-soft: #16352c;
    --bg: #0b1210;
    --bg-card: #14201b;
    --text: #e8f3ee;
    --muted: #9bb0a7;
    --line: rgba(232, 243, 238, 0.1);
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.4);
  }
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 12px);
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-pressed); }

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--accent);
  color: #fff;
  padding: 8px 12px;
  z-index: 100;
}
.skip:focus { left: 8px; }

.wrap {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* ---- Nav ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: saturate(1.4) blur(16px);
  -webkit-backdrop-filter: saturate(1.4) blur(16px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--line);
}
.nav {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}
.brand img {
  width: 36px;
  height: 36px;
  border-radius: 9px;
}
.brand-name {
  font-weight: 600;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.brand-sub {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 400;
  letter-spacing: 0;
}
.nav-links {
  display: none;
  gap: 1.15rem;
  margin-left: auto;
}
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
}
.nav-links a:hover { color: var(--text); }
.nav-cta { margin-left: auto; }
.menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  margin-left: auto;
}
.menu-btn span,
.menu-btn span::before,
.menu-btn span::after {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  position: relative;
}
.menu-btn span::before,
.menu-btn span::after {
  content: "";
  position: absolute;
  left: 0;
}
.menu-btn span::before { top: -6px; }
.menu-btn span::after { top: 6px; }

.drawer {
  display: none;
  border-top: 1px solid var(--line);
  background: var(--bg);
  padding: 0.75rem 0 1rem;
}
.drawer.open { display: block; }
.drawer a {
  display: block;
  padding: 0.7rem 0;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  min-height: 44px;
}

@media (min-width: 860px) {
  .nav-links { display: flex; }
  .nav-cta { margin-left: 0; }
  .menu-btn { display: none; }
  .drawer { display: none !important; }
}

/* ---- Buttons / badge ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.65rem 1.15rem;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-pressed); color: #fff; }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}
.store-badge img {
  height: 48px;
  width: auto;
}
.store-badge { display: inline-block; line-height: 0; }

/* ---- Hero ---- */
.hero {
  padding: 2.5rem 0 3.5rem;
}
.hero-grid {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}
.hero-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.hero h1 {
  margin: 0.85rem 0 0.75rem;
  font-size: clamp(2rem, 5.4vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
  font-weight: 700;
}
.lede {
  margin: 0 0 1.4rem;
  color: var(--muted);
  font-size: 1.08rem;
  max-width: 38rem;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.4rem;
}
.chip {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--accent-pressed);
  background: var(--accent-soft);
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
}
@media (prefers-color-scheme: dark) {
  .chip { color: var(--accent); }
}

.phone {
  justify-self: center;
  width: min(100%, 280px);
  filter: drop-shadow(0 24px 40px rgba(19, 36, 28, 0.18));
}
.phone img {
  width: 100%;
  height: auto;
  border-radius: 28px;
}

@media (min-width: 900px) {
  .hero { padding: 3.5rem 0 4.5rem; }
  .hero-grid {
    grid-template-columns: 1.05fr 0.95fr;
    gap: 3rem;
  }
  .phone { width: 320px; }
}

/* ---- Sections ---- */
.section { padding: 4rem 0; }
.section-alt { background: color-mix(in srgb, var(--accent-soft) 55%, var(--bg)); }
.kicker {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.5rem;
}
.section h2 {
  margin: 0 0 0.6rem;
  font-size: clamp(1.55rem, 3vw, 2.1rem);
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.section-lead {
  margin: 0 0 2rem;
  color: var(--muted);
  max-width: 40rem;
}

.cards {
  display: grid;
  gap: 1rem;
}
@media (min-width: 700px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 980px) {
  .cards.three { grid-template-columns: repeat(3, 1fr); }
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem 1.4rem 1.45rem;
  box-shadow: 0 1px 0 rgba(19, 36, 28, 0.03);
}
.card h3 {
  margin: 0 0 0.45rem;
  font-size: 1.08rem;
  letter-spacing: -0.02em;
}
.card p { margin: 0; color: var(--muted); font-size: 0.96rem; }
.card .problem {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.35rem;
}

.steps {
  display: grid;
  gap: 1rem;
}
@media (min-width: 800px) {
  .steps { grid-template-columns: repeat(3, 1fr); }
}
.step {
  padding: 0.2rem 0.2rem 0;
}
.step-num {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  margin-bottom: 0.85rem;
}
.step h3 { margin: 0 0 0.4rem; font-size: 1.08rem; }
.step p { margin: 0; color: var(--muted); }

/* ---- Gallery ---- */
.gallery {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 0.75rem;
  -webkit-overflow-scrolling: touch;
}
.gallery figure {
  margin: 0;
  flex: 0 0 min(72vw, 220px);
  scroll-snap-align: start;
}
.gallery img {
  width: 100%;
  border-radius: 22px;
  box-shadow: var(--shadow);
}
.gallery figcaption {
  margin-top: 0.55rem;
  font-size: 0.82rem;
  color: var(--muted);
}
@media (min-width: 900px) {
  .gallery {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    overflow: visible;
    padding-bottom: 0;
  }
  .gallery figure { flex: none; }
}

/* ---- Use cases / guides ---- */
.list-cards {
  display: grid;
  gap: 0.85rem;
}
@media (min-width: 700px) {
  .list-cards { grid-template-columns: 1fr 1fr; }
}
.list-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.15rem 1.2rem;
  text-decoration: none;
  color: inherit;
}
.list-card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.list-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1.02rem;
  color: var(--text);
}
.list-card p { margin: 0; color: var(--muted); font-size: 0.92rem; }
.list-card .more {
  display: inline-block;
  margin-top: 0.55rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
}

.guide-grid {
  display: grid;
  gap: 1.15rem;
}
@media (min-width: 720px) {
  .guide-grid { grid-template-columns: 1fr 1fr; }
}
.guide-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  min-height: 100%;
}
.guide-card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.guide-card img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  background: var(--accent-soft);
}
.guide-card-body { padding: 1.15rem 1.2rem 1.3rem; }
.guide-card-body h3 {
  margin: 0 0 0.4rem;
  font-size: 1.08rem;
  letter-spacing: -0.02em;
  color: var(--text);
}
.guide-card-body p { margin: 0; color: var(--muted); font-size: 0.92rem; }
.guide-card .more {
  display: inline-block;
  margin-top: 0.7rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
}
@media (min-width: 900px) {
  .guide-card.featured {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1.2fr 0.9fr;
    align-items: stretch;
  }
  .guide-card.featured img { aspect-ratio: auto; height: 100%; min-height: 280px; }
  .guide-card.featured .guide-card-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2rem 2.1rem;
  }
  .guide-card.featured h2 { font-size: 1.55rem; margin: 0 0 0.5rem; letter-spacing: -0.03em; }
}

.article-hero {
  margin: 1.1rem 0 1.5rem;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.article-hero img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

/* ---- FAQ ---- */
.faq details {
  border-bottom: 1px solid var(--line);
  padding: 0.35rem 0;
}
.faq summary {
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  color: var(--accent);
  font-size: 1.3rem;
  font-weight: 400;
}
.faq details[open] summary::after { content: "–"; }
.faq .panel {
  padding: 0 0 1rem;
  color: var(--muted);
}
.faq .panel p { margin: 0 0 0.6rem; }
.learn {
  font-weight: 600;
  font-size: 0.92rem;
}

/* ---- CTA band ---- */
.cta-band {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 1.75rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
  justify-content: space-between;
}
.cta-band h2 { margin: 0; }
.cta-band p { margin: 0.4rem 0 0; color: var(--muted); }
.cta-icon {
  width: 72px;
  height: 72px;
  border-radius: 18px;
}

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 2.25rem 0 5.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.footer-grid {
  display: grid;
  gap: 1.25rem;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.15rem;
}
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--text); }
@media (min-width: 700px) {
  .footer-grid {
    grid-template-columns: 1.2fr 1fr;
    align-items: start;
  }
}

/* ---- Sticky mobile download ---- */
.sticky-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: none;
  padding: 0.65rem 1rem calc(0.65rem + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  justify-content: center;
}
.sticky-cta.visible { display: flex; }
@media (min-width: 860px) {
  .sticky-cta { display: none !important; }
}

/* ---- Guide articles ---- */
.crumbs {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 1.25rem 0 0;
}
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); }
.article {
  max-width: 42rem;
  margin: 0 auto;
  padding: 1rem 0 3rem;
}
.article h1 {
  font-size: clamp(1.85rem, 4vw, 2.5rem);
  letter-spacing: -0.035em;
  line-height: 1.15;
  margin: 0.9rem 0 0.85rem;
}
.article h2 {
  font-size: 1.3rem;
  letter-spacing: -0.02em;
  margin: 2rem 0 0.6rem;
}
.article h3 {
  font-size: 1.05rem;
  margin: 1.4rem 0 0.4rem;
}
.article p, .article li { color: var(--text); }
.article .muted, .article .lede { color: var(--muted); }
.article ul, .article ol { padding-left: 1.2rem; }
.article li { margin: 0.35rem 0; }
.article figure {
  margin: 1.5rem 0;
}
.article figure img {
  width: min(280px, 100%);
  margin-inline: auto;
  border-radius: 22px;
  box-shadow: var(--shadow);
}
.article figcaption {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 0.6rem;
}
.related { margin-top: 2.5rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
