/* =============================================================
   site.css - shared design tokens, navigation, and footer
   used by every public-facing page (index, education, purchase,
   license-manager, success, cancel, unsubscribe).
   Keep this file small - page-specific styling stays per-page.
   ============================================================= */

/* --- Reset --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* --- Tokens --- */
:root {
  --ink: #111;
  --ink-2: #444;
  --muted: #888;
  --line: #ececec;
  --line-2: #f4f4f4;
  --bg: #fff;
  --card: #fafafa;
  --success: #166534;
  --success-bg: #f0fdf4;
  --error: #991b1b;
  --error-bg: #fef2f2;
}

html, body { background: var(--bg); }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

/* --- Layout --- */
.wrap        { max-width: 720px; width: 100%; margin: 0 auto; padding: 0 24px; }
.wrap--wide  { max-width: 960px; }

main { flex: 1; padding: 56px 0 40px; }

/* --- Navigation (sticky top bar) --- */
.nav {
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
/* Higher specificity (.nav-links .nav-download) so the inherited
   `.nav-links a { color: var(--ink-2) }` rule doesn't darken the
   label inside the black pill. */
.nav-links a.nav-download {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: #111;
  color: #fff;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
  transition: background 0.15s;
}
.nav-links a.nav-download:hover { background: #000; color: #fff; }
.nav-links a.nav-download::before {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M8 2v9m0 0l-3.5-3.5M8 11l3.5-3.5M3 13.5h10' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-size: contain;
}

/* Hero CTA row: prominent download buttons under the tagline so
   users don't have to scroll to find them. */
.hero-cta {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.hero-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  background: #111;
  color: #fff;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14.5px;
  transition: background 0.15s, transform 0.06s;
}
.hero-cta-btn:hover { background: #000; color: #fff; }
.hero-cta-btn:active { transform: translateY(1px); }
.hero-cta-btn--ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.hero-cta-btn--ghost:hover { background: var(--card); color: var(--ink); border-color: var(--ink); }
.hero-cta-meta {
  font-size: 12.5px;
  color: var(--muted);
  margin-left: 6px;
}
html { scroll-behavior: smooth; }
section[id] { scroll-margin-top: 72px; }
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.3px;
}
.nav-links {
  display: flex;
  gap: 22px;
  align-items: center;
}
.nav-links a {
  font-size: 13px;
  color: var(--ink-2);
  text-decoration: none;
  transition: color 0.15s;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a.active { color: var(--ink); font-weight: 500; }

/* --- Hamburger toggle (hidden on desktop) --- */
.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  padding: 0;
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, background 0.15s;
}
.nav-toggle:hover { border-color: var(--ink); background: var(--card); }
.nav-toggle-icon {
  position: relative;
  width: 18px;
  height: 12px;
  display: block;
}
.nav-toggle-icon span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.15s ease, top 0.2s ease;
}
.nav-toggle-icon span:nth-child(1) { top: 0; }
.nav-toggle-icon span:nth-child(2) { top: 5px; }
.nav-toggle-icon span:nth-child(3) { top: 10px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-icon span:nth-child(1) {
  top: 5px; transform: rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-icon span:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-icon span:nth-child(3) {
  top: 5px; transform: rotate(-45deg);
}

/* --- Footer (unified) --- */
.foot {
  border-top: 1px solid var(--line);
  padding: 22px 0;
}
.foot-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
}
.foot-inner a {
  color: var(--ink-2);
  text-decoration: none;
}
.foot-inner a:hover { color: var(--ink); }
.foot-links { display: flex; flex-wrap: wrap; gap: 18px; }

/* --- Section heading utilities --- */
.section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 18px;
}

/* --- Generic buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.btn:hover:not(:disabled) {
  border-color: var(--ink);
  background: var(--card);
}
.btn-primary {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.btn-primary:hover:not(:disabled) {
  background: #000;
  border-color: #000;
}
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.btn-block { width: 100%; }

/* --- Form inputs --- */
.input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  background: var(--bg);
  outline: none;
  transition: border-color 0.15s;
}
.input:focus { border-color: var(--ink); }
.input::placeholder { color: #b8b8b8; }

/* --- Spinner --- */
.spinner {
  display: inline-block;
  width: 12px; height: 12px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: site-spin 0.6s linear infinite;
  vertical-align: -1px;
  margin-right: 6px;
}
@keyframes site-spin { to { transform: rotate(360deg); } }

/* --- Inline messages --- */
.msg { font-size: 13px; margin-top: 10px; display: none; }
.msg.is-success { display: block; color: var(--success); }
.msg.is-error   { display: block; color: var(--error); }

/* --- Mobile: hamburger menu --- */
@media (max-width: 640px) {
  main { padding: 36px 0 28px; }
  .foot-inner { flex-direction: column; gap: 10px; text-align: center; }
  .foot-links { justify-content: center; row-gap: 8px; column-gap: 14px; }

  /* Reveal hamburger, collapse the inline links into a dropdown panel */
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 6px 0;
    background: var(--bg);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 8px 24px rgba(0,0,0,0.05);
    z-index: 50;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a {
    display: block;
    padding: 14px 24px;
    font-size: 15px;
    border-bottom: 1px solid var(--line-2);
    color: var(--ink);
  }
  .nav-links a:last-child { border-bottom: 0; }
  .nav-links a:hover { background: var(--card); }
  /* In the dropdown all items are visible - override prior tiny-screen hides */
  .nav-links .nav-github,
  .nav-links a[href="/license-manager"] { display: block; }
}
