/* ============================================================================
   markee.sbang.dev — Soft Modern landing page.
   Light + dark via prefers-color-scheme; tokens mirror the app's theme.css.
   ============================================================================ */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/inter-400.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/inter-600.woff2") format("woff2");
}
@font-face {
  font-family: "Orbit";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/orbit-400.woff2") format("woff2");
}

:root {
  color-scheme: light dark;

  /* Light tokens — match Resources/web/theme.css */
  --surface: #fafbfc;
  --surface-2: #f1f2f5;
  --surface-3: #eef0f3;
  --fg: #2b2d34;
  --fg-strong: #0f1014;
  --fg-muted: #5a5c64;
  --fg-dim: #6c6e75;
  --accent: #a85428;
  --on-accent: #ffffff;
  --accent-soft: rgba(168, 84, 40, 0.07);
  --accent-glow: rgba(168, 84, 40, 0.22);
  --hairline: rgba(0, 0, 0, 0.06);
  --shadow-card: 0 12px 32px rgba(15, 16, 20, 0.08), 0 2px 6px rgba(15, 16, 20, 0.04);

  --max-width: 1180px;
  --radius-card: 12px;
  --radius-button: 8px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --surface: #1c1d22;
    --surface-2: #16171b;
    --surface-3: #26272d;
    --fg: #cfd1d8;
    --fg-strong: #f4f5f8;
    --fg-muted: #9ea0a8;
    --fg-dim: #8b8d96;
    --accent: #f3a26e;
    --on-accent: #151515;
    --accent-soft: rgba(243, 162, 110, 0.05);
    --accent-glow: rgba(243, 162, 110, 0.18);
    --hairline: rgba(255, 255, 255, 0.04);
    --shadow-card: 0 16px 40px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.3);
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--surface);
  color: var(--fg);
  font-family: "Inter", -apple-system, "SF Pro Text", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

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

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 120ms ease;
}
a:hover { border-bottom-color: var(--accent); }

/* Body-text links need a non-color affordance (WCAG: don't rely on color
   alone to indicate links). Underline anchors that live inside flowing
   prose; nav / button / brand-mark anchors are explicitly opted out. */
p a, li a, dd a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, var(--accent) 55%, transparent);
}
p a:hover, li a:hover, dd a:hover {
  text-decoration-color: var(--accent);
}

code, pre {
  font-family: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;
  font-size: 0.92em;
}
code {
  background: var(--surface-3);
  padding: 0.12em 0.4em;
  border-radius: 4px;
  color: var(--accent);
}
pre {
  background: var(--surface-3);
  padding: 16px 20px;
  border-radius: 10px;
  overflow-x: auto;
  line-height: 1.55;
}
pre code { background: transparent; padding: 0; color: var(--fg); }

h1, h2, h3 {
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--fg-strong);
  margin: 0;
}
h1 { font-size: clamp(2.4rem, 4.5vw, 3.6rem); line-height: 1.05; }
h2 { font-size: clamp(1.6rem, 2.5vw, 2.1rem); line-height: 1.15; }
h3 { font-size: 1.15rem; line-height: 1.3; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 28px;
}

.section { padding: 88px 0; }
@media (max-width: 768px) {
  .section { padding: 56px 0; }
}

/* ---- Site header --------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--hairline);
}

.site-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--accent);
  border-bottom: none;
  min-height: 44px;
  padding: 4px 0;
}
.brand-name {
  font-family: "Orbit", -apple-system, system-ui, sans-serif;
  font-weight: 500;
  font-size: 2.25rem;
  color: var(--fg-strong);
  letter-spacing: -0.005em;
  line-height: 1;
}

.site-nav {
  display: flex;
  gap: 12px;
}
.site-nav a {
  color: var(--fg-muted);
  font-size: 0.95rem;
  font-weight: 500;
  border-bottom: none;
  padding: 10px 8px;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.site-nav a:hover { color: var(--fg-strong); }

@media (max-width: 540px) {
  .site-nav a:nth-child(3) { display: none; } /* hide "Changelog" link on phone widths */
  .site-nav { gap: 4px; }
  .site-nav a { padding: 10px 6px; }

  .hero-install-icon { width: 140px; height: 140px; }
  .hero-install-name { font-size: 1.15rem; }

  pre { font-size: 0.78rem; padding: 14px 16px; }

  .install-steps > li { gap: 14px; }
}

/* ---- Hero ---------------------------------------------------------------- */
.hero { padding: 64px 0 96px; }

.hero-row {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 56px;
  align-items: stretch;
}

@media (max-width: 960px) {
  .hero-row {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  /* Stacked hero: constrain the copy column to the install card's width and
     center it, so tablet widths get the same tidy block as phones instead of
     a left-stranded card with dead space beside it. */
  .hero-copy {
    max-width: 460px;
    margin-inline: auto;
    width: 100%;
  }
  .hero-install { margin-top: 0; }
}

.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.hero-intro h1 { margin-bottom: 24px; }
.hero-sub {
  font-size: 1.15rem;
  line-height: 1.25;
  color: var(--fg-muted);
  margin: 0;
  max-width: 32ch;
}
.hero-ctas { display: flex; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }

/* Install card — natural compact size; the parent .hero-copy centers it
   vertically so the column-match still works without forcing dead space
   inside the card. icon → CTAs → version/meta, all centered. */
.hero-install {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 28px;
  padding: 32px 28px;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  max-width: 460px;
}
.hero-install-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding-bottom: 15px;
}
.hero-install-icon {
  display: block;
  border-radius: 28px;
}
.hero-install-name {
  font-family: "Orbit", -apple-system, system-ui, sans-serif;
  font-size: 1.3rem;
  color: var(--fg-strong);
  margin: 0;
  letter-spacing: -0.005em;
  line-height: 1;
}
.hero-install-ctas { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.hero-install-ctas .btn {
  padding: 10px 22px;
  font-size: 0.95rem;
}
.hero-install-meta {
  font-size: 0.85rem;
  color: var(--fg-muted);
  margin: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 12px 22px;
  border-radius: var(--radius-button);
  font-weight: 600;
  font-size: 0.97rem;
  border: 1px solid transparent;
  border-bottom: none;
  transition: transform 100ms ease, background 120ms ease, border-color 120ms ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
}
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000 12%); }

.btn-ghost {
  background: transparent;
  color: var(--fg-strong);
  border-color: var(--hairline);
}
.btn-ghost:hover { border-color: var(--fg-muted); }

.hero-art { position: relative; }
/* The hero screenshots are captured with ⌘⇧4 → Space → window, which bakes
   the macOS window shadow into the PNG itself (the transparent margin around
   the visible window carries it). Don't overlay our own border-radius,
   border, or heavy shadow — they clip into the captured shadow and create
   the asymmetric halo. A very subtle additive shadow is all that's needed
   to seat the image against the surface. */
.hero-art picture, .hero-art img {
  border: none;
  border-radius: 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
  background: transparent;
}
.hero-glow {
  position: absolute;
  inset: 6% 4% 4% 4%;
  background: radial-gradient(55% 45% at 50% 55%, var(--accent-glow), transparent 72%);
  filter: blur(36px);
  z-index: -1;
  pointer-events: none;
  opacity: 0.55;
}

/* ---- Why Markee band ----------------------------------------------------- */
.why {
  padding: 72px 0;
  background: var(--surface-2);
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}

.why-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 36px;
}
@media (max-width: 880px) {
  .why-grid { grid-template-columns: 1fr; gap: 28px; }
}

.why-card h2 {
  font-size: 1.15rem;
  line-height: 1.3;
  margin: 14px 0 8px;
  letter-spacing: -0.005em;
}
.why-card p {
  color: var(--fg-muted);
  font-size: 0.97rem;
  line-height: 1.65;
  margin: 0;
}

.why-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
}

kbd {
  display: inline-block;
  padding: 1px 6px;
  font-family: ui-monospace, "SF Mono", monospace;
  font-size: 0.82em;
  background: var(--surface-3);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  color: var(--fg-strong);
}

/* ---- Section header ------------------------------------------------------ */
.section-header { text-align: center; margin-bottom: 56px; }
.section-header h2 { max-width: 22ch; margin: 8px auto 0; }
.kicker {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0;
}

/* ---- Feature gallery ----------------------------------------------------- */
.features { padding: 96px 0; }

.feature-row {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 56px;
  align-items: center;
  margin-bottom: 88px;
}
.feature-row:last-child { margin-bottom: 0; }

.feature-row-reverse .feature-art { order: 2; }
.feature-row-reverse .feature-copy { order: 1; }

@media (max-width: 880px) {
  .feature-row, .feature-row-reverse {
    grid-template-columns: 1fr;
    gap: 24px;
    margin-bottom: 56px;
  }
  .feature-row-reverse .feature-art,
  .feature-row-reverse .feature-copy { order: initial; }
}

.feature-art { margin: 0; }
.feature-art img {
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--hairline);
  background: var(--surface-3);
  min-height: 180px;
}

.feature-copy h3 { font-size: 1.4rem; margin-bottom: 12px; }
.feature-copy p {
  color: var(--fg-muted);
  font-size: 1.02rem;
  line-height: 1.65;
  margin: 0;
}

.feature-inline {
  margin: 22px 0 0;
  max-width: 300px;
}
.feature-inline img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-card);
  border: 1px solid var(--hairline);
  background: var(--surface-3);
}
.feature-inline figcaption {
  margin-top: 8px;
  font-size: 0.86rem;
  color: var(--fg-muted);
}

/* ---- Install ------------------------------------------------------------- */
.install {
  background: var(--surface-2);
  padding: 96px 0;
  border-top: 1px solid var(--hairline);
}
.install-wrap { max-width: 780px; margin: 0 auto; }

.install-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 36px;
}
.install-steps > li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.install-body { min-width: 0; }

.install-num {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.95rem;
}

.install-body h3 { font-size: 1.15rem; margin-bottom: 8px; }
.install-body p { color: var(--fg-muted); margin: 0 0 12px; }
.install-body .btn { margin-top: 8px; }

.install-options {
  margin: 0 0 12px;
  padding-left: 20px;
  color: var(--fg-muted);
}
.install-options li { margin: 6px 0; }

.install-source {
  margin-top: 48px;
  text-align: center;
  color: var(--fg-muted);
  font-size: 0.95rem;
}

/* ---- Footer -------------------------------------------------------------- */
.site-footer {
  padding: 32px 0 48px;
  border-top: 1px solid var(--hairline);
  font-size: 0.9rem;
  color: var(--fg-dim);
}
.site-footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-meta { margin: 0; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.footer-nav a {
  color: var(--fg-muted);
  border-bottom: none;
  padding: 10px 0;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.footer-nav a:hover { color: var(--fg-strong); }

/* ---- Reveal-on-scroll ---------------------------------------------------- */
/* Default state is visible — JS adds .reveal-armed to opt into the animation,
   then .is-visible on intersect. If JS fails or stalls, content stays shown. */
.reveal.reveal-armed {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 500ms ease, transform 500ms ease;
}
.reveal.reveal-armed.is-visible {
  opacity: 1;
  transform: none;
}

/* Respect users who don't want motion. */
@media (prefers-reduced-motion: reduce) {
  .reveal.reveal-armed { opacity: 1; transform: none; transition: none; }
}
