/* ==========================================================================
   Crisper Corporation — shared design system (MS-style, original code)
   Used by every page of the site. Do NOT add page-specific CSS here.
   ========================================================================== */

/* ---------- 1. Tokens & reset ---------- */
:root {
  --blue: #0078d4;
  --blue-dark: #0067b8;
  --blue-deeper: #005a9e;
  --blue-light: #e8f3fb;
  --blue-tint: #f0f7fd;
  --bg: #ffffff;
  --bg-gray: #f5f5f5;
  --bg-dark: #2f2f2f;
  --text: #1a1a1a;
  --text-gray: #616161;
  --text-light: #e8e8e8;
  --border: #e6e6e6;
  --green: #107c10;
  --orange: #d83b01;
  --red: #a4262c;
  --shadow: 0 2px 6px rgba(0, 0, 0, .08);
  --shadow-hover: 0 10px 28px rgba(0, 0, 0, .16);
  --radius: 4px;
  --font: "Segoe UI", "Segoe UI Variable", -apple-system, BlinkMacSystemFont,
    "Inter", Roboto, "Helvetica Neue", Arial, "PingFang SC",
    "Microsoft YaHei", sans-serif;
  --mono: "Cascadia Code", Consolas, "Courier New", monospace;
  --container: 1240px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-deeper); }
button { font-family: inherit; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- 2. Typography ---------- */
h1, h2, h3, h4 { line-height: 1.2; font-weight: 600; }
h1 { font-size: 40px; }
h2 { font-size: 28px; }
h3 { font-size: 20px; }
h4 { font-size: 16px; }
@media (max-width: 640px) {
  h1 { font-size: 28px; } h2 { font-size: 22px; } h3 { font-size: 18px; }
  /* iOS Safari: inputs under 16px trigger auto-zoom on focus */
  .searchbox input, input[type="search"], input[type="text"], textarea { font-size: 16px; }
  .card-desc, .doc-row .doc-row-desc, .promo-item p, .steps li p { font-size: 14px; }
}
.lead { font-size: 17px; color: var(--text-gray); }
.text-gray { color: var(--text-gray); }
.text-center { text-align: center; }
.mt-1 { margin-top: 12px; } .mt-2 { margin-top: 24px; } .mt-3 { margin-top: 40px; }
.mb-1 { margin-bottom: 12px; } .mb-2 { margin-bottom: 24px; } .mb-3 { margin-bottom: 40px; }

/* ---------- 3. Top navigation ---------- */
.topnav {
  position: sticky; top: 0; z-index: 100;
  background: #fff; border-bottom: 1px solid var(--border);
}
.topnav-inner { display: flex; align-items: center; gap: 20px; height: 56px; }

.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-tile {
  width: 28px; height: 28px; border-radius: 6px; flex: 0 0 auto;
  background: linear-gradient(135deg, var(--blue), var(--blue-deeper));
  color: #fff; font-weight: 700; font-size: 16px;
  display: inline-flex; align-items: center; justify-content: center;
}
.brand-name { font-weight: 600; font-size: 17px; letter-spacing: -.02em; }

.mainnav { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.nav-item {
  position: relative; display: inline-block;
  color: var(--text); font-size: 14px; padding: 8px 12px;
  border-radius: var(--radius); cursor: pointer; background: none; border: none;
}
.nav-item:hover { background: var(--bg-gray); }
.nav-item > a { color: inherit; display: inline-block; }
.nav-item .caret { font-size: 10px; margin-left: 4px; color: var(--text-gray); }

.drop {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 200px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 8px 0; display: none; z-index: 90;
}
.has-drop:hover .drop, .has-drop:focus-within .drop { display: block; }
.drop a {
  display: block; padding: 8px 18px; font-size: 14px; color: var(--text);
}
.drop a:hover { background: var(--blue-light); color: var(--blue-deeper); }
.drop .drop-head {
  display: block; padding: 10px 18px 4px; font-size: 11px; font-weight: 600;
  text-transform: none; color: var(--text-gray);
}
.nav-item.active > a { color: var(--blue); font-weight: 600; }

.nav-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.nav-icon-btn {
  width: 36px; height: 36px; border: none; background: none; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text); cursor: pointer;
}
.nav-icon-btn:hover { background: var(--bg-gray); color: var(--blue); }

.nav-burger { display: none; }
.nav-burger { width: 40px; height: 40px; border: none; background: none; cursor: pointer; padding: 10px; }
.nav-burger span { display: block; height: 2px; background: var(--text); margin: 5px 0; transition: .2s; }

@media (max-width: 960px) {
  .nav-burger { display: block; }
  .mainnav {
    position: absolute; top: 56px; left: 0; right: 0;
    background: #fff; border-bottom: 1px solid var(--border);
    display: none; flex-direction: column; align-items: stretch;
    padding: 8px 16px 16px; margin: 0; box-shadow: var(--shadow);
  }
  .mainnav.open { display: flex; }
  .nav-item { padding: 12px 8px; border-bottom: 1px solid var(--bg-gray); }
  .drop {
    position: static; display: none; box-shadow: none; border: none;
    padding: 4px 0 4px 16px; min-width: 0;
  }
  .has-drop.open .drop { display: block; }
  .has-drop:hover .drop { display: none; }
  .has-drop.open:hover .drop { display: block; }
}

/* ---------- 4. Buttons, badges, chips ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; font-size: 15px; font-weight: 600; cursor: pointer;
  border-radius: var(--radius); border: 2px solid transparent;
  text-decoration: none; transition: background .15s, color .15s, box-shadow .15s;
  line-height: 1.2;
}
.btn-primary { background: var(--blue-dark); color: #fff; }
.btn-primary:hover { background: var(--blue-deeper); color: #fff; box-shadow: var(--shadow); }
.btn-light { background: #fff; color: var(--blue-deeper); }
.btn-light:hover { background: var(--blue-light); color: var(--blue-deeper); }
.btn-outline { background: transparent; color: var(--text); border-color: #8a8a8a; }
.btn-outline:hover { border-color: var(--blue); color: var(--blue); }
.btn-white-outline { background: transparent; color: #fff; border-color: #fff; }
.btn-white-outline:hover { background: rgba(255,255,255,.14); color: #fff; }
.btn-lg { padding: 14px 30px; font-size: 16px; }
.btn-sm { padding: 6px 14px; font-size: 13px; }

.badge {
  display: inline-block; padding: 2px 9px; border-radius: 10px;
  font-size: 12px; font-weight: 600; color: var(--green);
  background: rgba(16, 124, 16, .1); white-space: nowrap;
}
.badge.blue { color: var(--blue); background: var(--blue-light); }
.badge.orange { color: var(--orange); background: rgba(216,59,1,.1); }
.badge.gray { color: var(--text-gray); background: var(--bg-gray); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 6px 16px; border-radius: 16px; border: 1px solid var(--border);
  font-size: 13px; color: var(--text); cursor: pointer; background: #fff;
  text-decoration: none; display: inline-block;
}
.chip:hover { border-color: var(--blue); color: var(--blue); }
.chip.active { background: var(--blue); border-color: var(--blue); color: #fff; }

/* ---------- 5. Hero ---------- */
.hero {
  background: linear-gradient(180deg, var(--blue-deeper) 0%, var(--blue) 100%);
  color: #fff; padding: 72px 0 76px;
}
.hero .eyebrow {
  display: inline-block; font-size: 13px; font-weight: 600; letter-spacing: .04em;
  padding: 4px 12px; border: 1px solid rgba(255,255,255,.55); border-radius: 14px;
  margin-bottom: 18px; text-transform: none;
}
.hero h1 { font-size: 44px; max-width: 720px; margin-bottom: 14px; letter-spacing: -.02em; }
.hero p { font-size: 17px; max-width: 640px; color: var(--text-light); margin-bottom: 26px; }
.hero .hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-compact { padding: 44px 0 46px; }
.hero-compact h1 { font-size: 32px; }
.hero-compact p { font-size: 16px; margin-bottom: 0; }
@media (max-width: 640px) {
  .hero { padding: 44px 0 48px; }
  .hero h1 { font-size: 30px; }
  .hero p { font-size: 15px; }
}

/* hero slider dots */
.hero-slider { position: relative; }
.hero-slide { display: none; }
.hero-slide.active { display: block; animation: heroFade .4s ease; }
@keyframes heroFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.hero-dots { display: flex; gap: 8px; margin-top: 26px; }
.hero-dots button {
  width: 26px; height: 4px; border: none; border-radius: 2px; cursor: pointer;
  background: rgba(255,255,255,.35); padding: 0;
}
.hero-dots button.active { background: #fff; }

/* ---------- 6. Sections ---------- */
.section { padding: 48px 0; }
.section-gray { background: var(--bg-gray); }
.section-tint { background: var(--blue-tint); }
.section-head { margin-bottom: 28px; }
.section-title { font-size: 28px; font-weight: 600; margin-bottom: 6px; letter-spacing: -.01em; }
.section-sub { color: var(--text-gray); font-size: 15px; max-width: 640px; }
.section-head .more { float: right; font-size: 14px; font-weight: 600; margin-top: 6px; }

/* ---------- 7. Cards ---------- */
.card-grid {
  display: grid; gap: 20px;
  grid-template-columns: repeat(4, 1fr);
}
@media (max-width: 1080px) { .card-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 820px)  { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .card-grid { grid-template-columns: 1fr; } }

.card {
  display: block; background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px; text-decoration: none; color: var(--text);
  transition: box-shadow .18s, transform .18s, border-color .18s;
}
.card:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); border-color: #d4d4d4; color: var(--text); }
.card-icon {
  width: 48px; height: 48px; border-radius: 8px; color: #fff; font-size: 22px;
  font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.card-title { font-size: 17px; font-weight: 600; display: block; margin-bottom: 4px; }
.card-desc { font-size: 14px; color: var(--text-gray); display: block; line-height: 1.5; }
.card-meta { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 13px; color: var(--text-gray); }
.rating { color: var(--orange); font-weight: 600; }

/* app/program card (data-driven, anchor-based) */
.app-card, .program-card { padding: 20px; }
.app-card .card-icon { width: 56px; height: 56px; font-size: 26px; }
.program-card .card-icon { width: 52px; height: 52px; font-size: 24px; }

/* tile cards for branch navigation */
.tile-card {
  display: flex; flex-direction: column; gap: 10px; position: relative; overflow: hidden;
}
.tile-card .tile-icon {
  width: 44px; height: 44px; border-radius: 8px;
  background: var(--blue-tint); color: var(--blue-deeper);
  display: inline-flex; align-items: center; justify-content: center;
}
.tile-card .tile-icon svg { width: 24px; height: 24px; }
.tile-card h3 { font-size: 18px; }
.tile-card p { font-size: 14px; color: var(--text-gray); }
.tile-card .tile-link { font-size: 14px; font-weight: 600; margin-top: auto; }

/* ---------- 8. Search box ---------- */
.searchbox {
  display: flex; align-items: center; gap: 10px; max-width: 560px;
  background: #fff; border-radius: var(--radius); padding: 0 14px;
  border: 2px solid transparent; box-shadow: var(--shadow);
}
.searchbox:focus-within { border-color: var(--blue); }
.searchbox svg { width: 18px; height: 18px; color: var(--text-gray); flex: 0 0 auto; }
.searchbox input {
  flex: 1; border: none; outline: none; font-size: 15px; font-family: inherit;
  padding: 12px 0; background: transparent; color: var(--text);
}

/* ---------- 9. Tables ---------- */
.table-wrap { overflow-x: auto; }
table.table {
  width: 100%; border-collapse: collapse; table-layout: fixed;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 14px;
}
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { background: var(--bg-gray); font-weight: 600; color: var(--text); }
.table tr:last-child td { border-bottom: none; }
.table td:first-child { font-weight: 600; width: 30%; }

/* ---------- 10. Docs / Learn layout ---------- */
.docs-layout { display: grid; grid-template-columns: 260px 1fr; gap: 40px; padding: 36px 0 60px; align-items: start; }
@media (max-width: 900px) { .docs-layout { grid-template-columns: 1fr; } }

.docs-sidebar { position: sticky; top: 76px; max-height: calc(100vh - 90px); overflow-y: auto; }
.docs-sidebar .side-head { font-size: 13px; font-weight: 700; color: var(--text-gray); margin: 18px 0 6px; text-transform: none; letter-spacing: .03em; }
.docs-sidebar .side-head:first-child { margin-top: 0; }
.side-link {
  display: block; padding: 7px 10px; border-radius: var(--radius); font-size: 14px;
  color: var(--text); margin-bottom: 2px;
}
.side-link:hover { background: var(--blue-light); color: var(--blue-deeper); }
.side-link.active { background: var(--blue); color: #fff; font-weight: 600; }

.breadcrumb { font-size: 13px; color: var(--text-gray); margin: 22px 0 18px; display: flex; flex-wrap: wrap; gap: 6px; }
.breadcrumb a { color: var(--blue); }
.breadcrumb .sep { color: #a0a0a0; }

/* article prose */
.article h1 { font-size: 34px; margin: 4px 0 8px; letter-spacing: -.02em; }
.article .doc-meta { font-size: 13px; color: var(--text-gray); margin-bottom: 26px; }
.article h2 { font-size: 24px; margin: 34px 0 12px; }
.article h3 { font-size: 19px; margin: 26px 0 10px; }
.article p { margin: 12px 0; color: #2b2b2b; }
.article ul, .article ol { margin: 12px 0 12px 24px; }
.article li { margin: 6px 0; }
.article code {
  font-family: var(--mono); font-size: .92em; background: var(--bg-gray);
  padding: 2px 6px; border-radius: 3px;
}
.article pre {
  background: var(--bg-dark); color: #e8e8e8; padding: 16px 18px;
  border-radius: var(--radius); overflow-x: auto; margin: 16px 0; font-size: 13.5px;
}
.article pre code { background: none; color: inherit; padding: 0; }
.article table { width: 100%; border-collapse: collapse; table-layout: fixed; margin: 16px 0; font-size: 14px; }
.article table th, .article table td { border: 1px solid var(--border); padding: 10px 12px; text-align: left; }
.article table th { background: var(--bg-gray); }
.article blockquote { border-left: 4px solid var(--blue); background: var(--blue-tint); padding: 12px 18px; margin: 16px 0; color: var(--text); border-radius: 0 var(--radius) var(--radius) 0; }
.article img { margin: 16px 0; border: 1px solid var(--border); border-radius: var(--radius); }

.callout { border-left: 4px solid var(--blue); background: var(--blue-tint); padding: 14px 18px; margin: 18px 0; border-radius: 0 var(--radius) var(--radius) 0; font-size: 14px; }
.callout.green { border-color: var(--green); background: rgba(16,124,16,.06); }
.callout.orange { border-color: var(--orange); background: rgba(216,59,1,.06); }

/* doc article row (list pages) */
.doc-row {
  display: block; background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 22px; margin-bottom: 12px;
  color: var(--text); transition: box-shadow .15s, border-color .15s;
}
.doc-row:hover { box-shadow: var(--shadow); border-color: #c9c9c9; color: var(--text); }
.doc-row .doc-row-title { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.doc-row .doc-row-title .tag-arrow { color: var(--blue); margin-left: 6px; }
.doc-row .doc-row-desc { font-size: 14px; color: var(--text-gray); }
.doc-row .doc-row-meta { font-size: 12.5px; color: #999; margin-top: 8px; }

/* ---------- 11. List rows (download / program lists) ---------- */
.promo-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 760px) { .promo-list { grid-template-columns: 1fr; } }
.promo-item {
  display: flex; gap: 14px; align-items: flex-start; background: #fff;
  border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px;
}
.promo-item .promo-tag { font-size: 12px; font-weight: 700; color: var(--orange); }
.promo-item h4 { font-size: 16px; margin: 2px 0 4px; }
.promo-item p { font-size: 14px; color: var(--text-gray); }

/* ---------- 12. Footer ---------- */
.footer { background: var(--bg-gray); border-top: 1px solid var(--border); margin-top: 60px; }
.footer-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 28px; padding: 44px 0 30px;
}
@media (max-width: 900px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-col h4 { font-size: 15px; font-weight: 600; margin-bottom: 12px; }
.footer-col a { display: block; color: var(--text-gray); font-size: 14px; padding: 4px 0; }
.footer-col a:hover { color: var(--blue); text-decoration: underline; }
.footer-brand-col .brand { margin-bottom: 12px; }
.footer-brand-col p { font-size: 14px; color: var(--text-gray); max-width: 260px; }
.footer-bottom {
  display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center;
  border-top: 1px solid var(--border); padding: 16px 0 22px;
  font-size: 14px; color: var(--text-gray);
}
.footer-bottom .right { margin-left: auto; display: flex; gap: 18px; }
.footer-bottom a { color: var(--text-gray); }
.footer-bottom a:hover { color: var(--blue); text-decoration: underline; }

/* ---------- 13. Toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px);
  background: #323232; color: #fff; padding: 12px 22px; border-radius: var(--radius);
  font-size: 14px; box-shadow: var(--shadow-hover); opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s; z-index: 200; max-width: 90vw; text-align: center;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 14. Misc ---------- */
.feature-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 820px) { .feature-strip { grid-template-columns: 1fr; } }
.feature-item h3 { font-size: 17px; margin-bottom: 6px; }
.feature-item p { font-size: 14px; color: var(--text-gray); }

.steps { counter-reset: step; list-style: none; margin: 16px 0; }
.steps li { counter-increment: step; position: relative; padding: 0 0 18px 44px; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  width: 28px; height: 28px; border-radius: 50%; background: var(--blue);
  color: #fff; font-weight: 700; font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center;
}
.steps li h4 { margin-bottom: 4px; }
.steps li p { font-size: 14px; color: var(--text-gray); }

.avatar-tile {
  width: 56px; height: 56px; border-radius: 50%; color: #fff; font-size: 20px;
  font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
}
