/* Totesoft documentation shell.
   Palette matches Totesoft/legal css/policy.css so the docs, the legal centre
   and the marketing site read as one family. Layered on top of the Primer
   theme stylesheet, which still styles the markdown body itself. */

:root {
  --espresso: #3a2112;
  --espresso-soft: #4a2e1b;
  --tan: #8a6a4c;
  --tan-light: #cdb59a;
  --cream: #f5f1e6;
  --card: #ffffff;
  --edge: #e6dcc9;

  --topbar-h: 60px;
  --sidebar-w: 264px;
  --font: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

body {
  margin: 0;
  background: var(--card);
  color: var(--espresso-soft);
  font-family: var(--font);
}

a { color: var(--tan); }
a:hover { color: var(--espresso); }

/* ---------- top bar ---------- */

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--topbar-h);
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 20px;
  background: var(--espresso);
  color: var(--cream);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--cream);
  text-decoration: none;
  min-width: 0;
}
.brand:hover { color: #fff; }
.brand-mark { flex: none; width: 44px; height: 32px; object-fit: contain; }

.brand-text { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.brand-name { font-size: 18px; font-weight: 700; letter-spacing: .01em; }
.brand-sub {
  font-size: 13px;
  color: var(--tan-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-link {
  margin-left: auto;
  color: var(--tan-light);
  text-decoration: none;
  font-size: 14px;
  white-space: nowrap;
}
.topbar-link:hover { color: #fff; }

/* ---------- menu toggle ---------- */

/* Focusable but invisible, so keyboard users can toggle the menu. */
.nav-toggle {
  position: fixed;
  top: 14px;
  left: 20px;
  width: 34px;
  height: 34px;
  margin: 0;
  z-index: 31;
  opacity: 0;
}
.nav-toggle:focus-visible ~ .topbar .nav-button {
  outline: 2px solid var(--tan-light);
  outline-offset: 2px;
}

.nav-button {
  flex: none;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  cursor: pointer;
}
.nav-button:hover { background: rgba(255, 255, 255, .12); }

/* Three bars drawn from one element. */
.nav-button-bars,
.nav-button-bars::before,
.nav-button-bars::after {
  content: "";
  display: block;
  width: 18px;
  height: 2px;
  background: var(--cream);
  border-radius: 2px;
}
.nav-button-bars { position: relative; }
.nav-button-bars::before { position: absolute; top: -6px; }
.nav-button-bars::after  { position: absolute; top: 6px; }

/* ---------- layout ---------- */

.shell {
  display: flex;
  align-items: flex-start;
  padding-top: var(--topbar-h);
}

.sidebar {
  position: sticky;
  top: var(--topbar-h);
  flex: none;
  width: var(--sidebar-w);
  max-height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  padding: 22px 8px 40px 20px;
  border-right: 1px solid var(--edge);
  background: var(--cream);
}

.content {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 860px;
  padding: 34px 32px 72px;
}

/* Primer styles the markdown itself; just keep headings on-brand. */
.content h1, .content h2, .content h3 { color: var(--espresso); }
.content h1 { margin-top: 0; }

/* ---------- sidebar contents ---------- */

.nav-platform { margin-bottom: 26px; }

.nav-platform-title {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--tan);
}

.nav-product {
  display: block;
  padding: 5px 10px;
  border-radius: 6px;
  color: var(--espresso);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
}
.nav-product:hover { background: rgba(138, 106, 76, .12); }
.nav-product.is-current { color: var(--espresso); }

.nav-links {
  margin: 2px 0 14px;
  padding: 0 0 0 10px;
  list-style: none;
  border-left: 1px solid var(--edge);
}
.nav-links a {
  display: block;
  padding: 4px 10px;
  border-radius: 6px;
  color: var(--espresso-soft);
  font-size: 13.5px;
  line-height: 1.45;
  text-decoration: none;
}
.nav-links a:hover { background: rgba(138, 106, 76, .12); color: var(--espresso); }
.nav-links a.is-active {
  background: var(--espresso);
  color: var(--cream);
  font-weight: 600;
}

/* ---------- homepage ---------- */

.hero-logo {
  display: block;
  width: auto;
  height: 132px;
  margin: 0 0 18px;
}

.hero {
  padding: 6px 0 26px;
  border-bottom: 1px solid var(--edge);
  margin-bottom: 30px;
}
.hero-title { margin: 0 0 8px; font-size: 34px; line-height: 1.15; color: var(--espresso); }
.hero-lede  { margin: 0; font-size: 17px; line-height: 1.6; color: var(--tan); max-width: 62ch; }

.platform { margin-bottom: 40px; }
.platform-head { margin-bottom: 16px; }
.platform-title {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--tan);
}
.platform-blurb { margin: 4px 0 0; font-size: 15px; color: var(--espresso-soft); }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 18px;
}

.card {
  display: flex;
  flex-direction: column;
  padding: 18px;
  border: 1px solid var(--edge);
  border-radius: 10px;
  background: var(--card);
}
.card:hover { border-color: var(--tan-light); }

.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.card-icon { flex: none; width: 48px; height: 48px; object-fit: contain; border-radius: 8px; }
.card-title { margin: 0; font-size: 18px; color: var(--espresso); }
.card-title a { color: inherit; text-decoration: none; }
.card-title a:hover { text-decoration: underline; }
.card-tagline { margin: 2px 0 0; font-size: 13px; color: var(--tan); }
.card-summary { margin: 0 0 14px; font-size: 14.5px; line-height: 1.6; }

.card-links { margin: 0 0 14px; padding: 0; list-style: none; }
.card-links li { margin-bottom: 5px; }
.card-links a { font-size: 14px; text-decoration: none; }
.card-links a:hover { text-decoration: underline; }

.card-more {
  margin-top: auto;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.card-more:hover { text-decoration: underline; }

/* ---------- footer ---------- */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  padding: 18px 32px;
  border-top: 1px solid var(--edge);
  background: var(--cream);
  color: var(--tan);
  font-size: 13.5px;
}
.site-footer a { color: var(--tan); text-decoration: none; }
.site-footer a:hover { color: var(--espresso); text-decoration: underline; }

/* ---------- collapsing ---------- */

.scrim { display: none; }

/* Wide screens: menu shown, toggle hides it. */
@media (min-width: 900px) {
  .site-footer { padding-left: calc(var(--sidebar-w) + 32px); }
  .nav-toggle:checked ~ .shell .sidebar { display: none; }
  .nav-toggle:checked ~ .site-footer { padding-left: 32px; }
}

/* Narrow screens: menu hidden, toggle slides it in over the content. */
@media (max-width: 899px) {
  .sidebar {
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    bottom: 0;
    max-height: none;
    z-index: 25;
    transform: translateX(-100%);
    transition: transform .18s ease;
  }
  .nav-toggle:checked ~ .shell .sidebar { transform: translateX(0); }
  .nav-toggle:checked ~ .shell .scrim {
    display: block;
    position: fixed;
    inset: var(--topbar-h) 0 0 0;
    z-index: 20;
    background: rgba(58, 33, 18, .38);
  }
  .content { padding: 26px 20px 60px; }
  .hero-logo { height: 104px; }
  .hero-title { font-size: 28px; }
  .brand-sub { display: none; }
  .site-footer { padding: 18px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar { transition: none; }
}
