/* ============================================================================
   Aging In The Comfort Of Home® — Brand Guidelines (guidelines.aitcoh.com)
   Self-contained stylesheet. Tokens mirror brand/BRAND.md (canonical).
   ========================================================================== */

:root {
  /* Division palettes */
  --trust-blue-dark:  #1b477e;
  --trust-blue:       #255ea0;
  --trust-blue-light: #d9ecff;
  --dealer-green-dark:  #154440;
  --dealer-green:       #20605c;
  --dealer-green-light: #dff7c1;
  --legacy-plum-dark:  #4a204d;
  --legacy-plum:       #622c65;
  --legacy-plum-light: #fde8ff;

  /* Shared */
  --radiant-gold: #fdd841;
  --charcoal:     #333333;
  --gray:         #e0e0e0;
  --light-linen:  #fffce5;

  /* Page system (corporate / parent = Trust Blue) */
  --ink:        #1d2733;
  --ink-soft:   #51606f;
  --line:       #e4e9ef;
  --surface:    #ffffff;
  --surface-2:  #f6f8fb;
  --primary:    var(--trust-blue);
  --primary-dark: var(--trust-blue-dark);

  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --shadow-1: 0 1px 2px rgb(16 38 64 / .05), 0 2px 8px rgb(16 38 64 / .05);
  --shadow-2: 0 8px 24px rgb(16 38 64 / .08), 0 2px 6px rgb(16 38 64 / .05);
  --shadow-3: 0 18px 48px rgb(16 38 64 / .14);

  --sidebar-w: 256px;
  --maxw: 1080px;
  --ease: cubic-bezier(0.16, 1, 0.30, 1);

  --font-head: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--surface-2);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 700; line-height: 1.18; color: var(--ink); margin: 0 0 .5em; }
h2 { font-size: clamp(1.5rem, 3.2vw, 2.1rem); letter-spacing: -.01em; }
h3 { font-size: 1.18rem; font-weight: 600; }
p { margin: 0 0 1rem; }
a { color: var(--primary); }
em { font-style: italic; }
sup { font-size: .58em; vertical-align: super; line-height: 0; }
code, .mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .9em; }

/* ---------------------------------------------------------------- Layout */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; align-self: start;
  height: 100vh; overflow-y: auto;
  background: linear-gradient(180deg, var(--trust-blue-dark), #143461 60%, #102a52);
  color: #dce8f6; padding: 22px 18px 32px;
  display: flex; flex-direction: column; gap: 6px;
}
.sb-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 18px; }
.sb-brand img { width: 42px; height: 42px; background: var(--light-linen); border-radius: 11px; padding: 4px; }
.sb-brand strong { display: block; font-family: var(--font-head); font-weight: 800; color: #fff; font-size: 1rem; letter-spacing: .02em; }
.sb-brand span { font-size: .72rem; color: #9fc0e6; letter-spacing: .04em; text-transform: uppercase; }

.sb-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; color: #7ba3d4; margin: 16px 0 6px; font-weight: 700; }
.sb-nav a {
  display: flex; align-items: center; gap: 9px;
  color: #cfe0f3; text-decoration: none; font-size: .92rem;
  padding: 8px 11px; border-radius: 9px; transition: background .15s, color .15s;
}
.sb-nav a:hover { background: rgb(255 255 255 / .08); color: #fff; }
.sb-nav a.active { background: var(--radiant-gold); color: var(--charcoal); font-weight: 600; }
.sb-nav a .n { font-variant-numeric: tabular-nums; opacity: .65; font-size: .8rem; min-width: 16px; }
.sb-nav a.active .n { opacity: .9; }
.sb-foot { margin-top: auto; padding-top: 18px; font-size: .74rem; color: #8fb1da; }

/* ---------------------------------------------------------------- Mobile top */
.mtop {
  display: none; position: sticky; top: 0; z-index: 200;
  align-items: center; gap: 12px; padding: 11px 16px;
  background: var(--trust-blue-dark); color: #fff;
}
.mtop button { background: rgb(255 255 255 / .14); color: #fff; border: 0; border-radius: 8px; padding: 8px 12px; font-size: .9rem; font-weight: 600; }
.mtop .mt-title { font-family: var(--font-head); font-weight: 700; font-size: .95rem; }
.scrim { display: none; position: fixed; inset: 0; background: rgb(10 24 44 / .5); z-index: 190; }

/* ---------------------------------------------------------------- Main */
.main { min-width: 0; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }

.hero {
  background: radial-gradient(120% 140% at 85% -10%, rgb(253 216 65 / .22), transparent 55%),
              linear-gradient(160deg, var(--trust-blue-dark), var(--trust-blue));
  color: #fff; padding: 64px 0 56px; position: relative; overflow: hidden;
}
.hero .wrap { position: relative; z-index: 1; }
.hero-logo { height: 92px; width: auto; margin-bottom: 22px; filter: drop-shadow(0 6px 18px rgb(0 0 0 / .25)); }
.hero .eyebrow { text-transform: uppercase; letter-spacing: .16em; font-size: .76rem; font-weight: 700; color: var(--radiant-gold); margin-bottom: 14px; }
.hero h1 { color: #fff; font-size: clamp(2rem, 5vw, 3rem); font-weight: 800; max-width: 17ch; letter-spacing: -.015em; }
.hero h1 em { font-style: italic; }
.hero p.lede { font-size: 1.12rem; color: #e4eefc; max-width: 60ch; margin-top: 6px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-head); font-weight: 600; font-size: .92rem;
  padding: 11px 18px; border-radius: var(--radius-md); border: 1.5px solid transparent;
  text-decoration: none; cursor: pointer; transition: transform .15s var(--ease), box-shadow .15s, background .15s;
  background: rgb(255 255 255 / .12); color: #fff; border-color: rgb(255 255 255 / .28);
}
.btn:hover { transform: translateY(-1px); }
.btn.gold { background: var(--radiant-gold); color: var(--charcoal); border-color: var(--radiant-gold); box-shadow: 0 6px 18px rgb(253 216 65 / .35); }
.btn.solid { background: #fff; color: var(--trust-blue-dark); border-color: #fff; }
.btn.ghost { background: var(--surface); color: var(--primary); border-color: var(--line); box-shadow: var(--shadow-1); }
.btn.sm { padding: 8px 13px; font-size: .85rem; }

/* ---------------------------------------------------------------- Sections */
section.block { padding: 56px 0; border-top: 1px solid var(--line); }
section.block:first-of-type { border-top: 0; }
.sec-eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .74rem; font-weight: 700; color: var(--primary); margin-bottom: 8px; }
.sec-intro { color: var(--ink-soft); max-width: 68ch; font-size: 1.05rem; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1); padding: 22px;
}
.grid { display: grid; gap: 18px; }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }

/* Callout */
.callout { border-left: 4px solid var(--radiant-gold); background: var(--light-linen); border-radius: 0 12px 12px 0; padding: 16px 20px; margin: 18px 0; }
.callout.blue { border-color: var(--trust-blue); background: var(--trust-blue-light); }
.callout strong { font-family: var(--font-head); }

/* ---------------------------------------------------------------- Division tabs */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 20px; }
.tab {
  font-family: var(--font-head); font-weight: 600; font-size: .9rem;
  padding: 9px 16px; border-radius: 999px; border: 1.5px solid var(--line);
  background: var(--surface); color: var(--ink-soft); cursor: pointer; transition: all .15s;
}
.tab[data-div="products"].active { background: var(--trust-blue); border-color: var(--trust-blue); color: #fff; }
.tab[data-div="dealerships"].active { background: var(--dealer-green); border-color: var(--dealer-green); color: #fff; }
.tab[data-div="programs"].active { background: var(--legacy-plum); border-color: var(--legacy-plum); color: #fff; }
.tab:not(.active):hover { border-color: var(--ink-soft); color: var(--ink); }

.panel { display: none; }
.panel.active { display: block; animation: fade .25s var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.panel-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.panel-head h3 { font-size: 1.4rem; font-weight: 700; }
.panel-tagline { font-style: italic; color: var(--ink-soft); }
.panel-meta { color: var(--ink-soft); margin-bottom: 16px; }

/* ---------------------------------------------------------------- Swatches */
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.swatch {
  border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden;
  background: var(--surface); cursor: pointer; text-align: left; padding: 0;
  font: inherit; transition: transform .15s var(--ease), box-shadow .15s;
}
.swatch:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.swatch .chip { height: 78px; display: flex; align-items: flex-end; justify-content: flex-end; padding: 8px; }
.swatch .chip .copyhint { font-size: .66rem; font-weight: 700; background: rgb(0 0 0 / .28); color: #fff; padding: 2px 7px; border-radius: 999px; opacity: 0; transition: opacity .15s; }
.swatch:hover .chip .copyhint { opacity: 1; }
.swatch .meta { padding: 10px 12px; }
.swatch .meta .name { font-family: var(--font-head); font-weight: 600; font-size: .86rem; }
.swatch .meta .hex { font-family: ui-monospace, Menlo, monospace; font-size: .8rem; color: var(--ink-soft); text-transform: uppercase; }
.swatch .meta .use { font-size: .76rem; color: var(--ink-soft); margin-top: 3px; }

/* ---------------------------------------------------------------- Logo cards */
.logo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.logo-card { border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); display: flex; flex-direction: column; }
.logo-preview { display: flex; align-items: center; justify-content: center; min-height: 130px; padding: 18px; }
.logo-preview.on-light { background: var(--surface); }
.logo-preview.on-dark { background: var(--trust-blue-dark); }
.logo-preview.on-dark.dealerships { background: var(--dealer-green-dark); }
.logo-preview.on-dark.programs { background: var(--legacy-plum-dark); }
.logo-preview.on-linen { background: var(--light-linen); }
.logo-preview img { max-width: 100%; max-height: 92px; }
.logo-foot { border-top: 1px solid var(--line); padding: 11px 13px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.logo-foot .lf-label { font-size: .78rem; color: var(--ink-soft); }
.logo-foot .lf-label b { display: block; font-family: var(--font-head); font-weight: 600; color: var(--ink); font-size: .82rem; }
.dl {
  display: inline-flex; align-items: center; gap: 5px; flex: none;
  font-family: var(--font-head); font-weight: 600; font-size: .78rem;
  padding: 6px 11px; border-radius: 8px; text-decoration: none;
  background: var(--trust-blue-light); color: var(--trust-blue-dark); border: 1px solid transparent; transition: background .15s;
}
.dl:hover { background: var(--trust-blue); color: #fff; }

/* ---------------------------------------------------------------- Type specimen */
.specimen { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; background: var(--surface); }
.specimen .big { font-size: clamp(2.2rem, 6vw, 3.4rem); line-height: 1.05; margin: 4px 0 14px; }
.specimen .alpha { color: var(--ink-soft); font-size: 1.1rem; word-spacing: 3px; }
.weights { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 14px; color: var(--ink-soft); }
.weights span { font-size: 1.05rem; }

/* ---------------------------------------------------------------- Rules columns */
.do-dont { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dd { border-radius: var(--radius-lg); padding: 18px 20px; border: 1px solid var(--line); }
.dd.do { background: #f1faf3; border-color: #c9ead2; }
.dd.dont { background: #fdf2f2; border-color: #f3d0d0; }
.dd h4 { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.dd.do h4 { color: #1d7a3d; }
.dd.dont h4 { color: #b6322b; }
.dd ul { margin: 0; padding-left: 18px; }
.dd li { margin-bottom: 7px; }

.taglist { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 8px; }
.taglist .t { font-size: .82rem; padding: 5px 11px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); }
.taglist.ban .t { background: #fdf2f2; border-color: #f3d0d0; color: #a32d27; text-decoration: line-through; text-decoration-color: rgb(163 45 39 / .5); }
.taglist.cta .t { background: var(--light-linen); border-color: #f0e3a8; color: #6b5a08; font-weight: 600; }

table.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; margin: 10px 0; }
table.tbl th, table.tbl td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.tbl th { font-family: var(--font-head); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); }
table.tbl td .mono { background: var(--surface-2); padding: 1px 6px; border-radius: 5px; }

/* ---------------------------------------------------------------- Library / download cards */
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.lib-card {
  display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: inherit;
  border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px;
  background: var(--surface); box-shadow: var(--shadow-1); transition: transform .15s var(--ease), box-shadow .15s, border-color .15s;
}
.lib-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: var(--primary); }
.lib-card .ic { width: 40px; height: 40px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; margin-bottom: 6px; }
.lib-card.products .ic { background: var(--trust-blue-light); }
.lib-card.dealerships .ic { background: var(--dealer-green-light); }
.lib-card.programs .ic { background: var(--legacy-plum-light); }
.lib-card.icons .ic { background: var(--light-linen); }
.lib-card h3 { font-size: 1.05rem; font-weight: 700; margin: 0; }
.lib-card .sub { font-size: .86rem; color: var(--ink-soft); }
.lib-card .go { margin-top: auto; font-family: var(--font-head); font-weight: 600; font-size: .82rem; color: var(--primary); padding-top: 8px; }

.dl-row { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-1); }
.dl-row .ic { font-size: 1.4rem; }
.dl-row .info { flex: 1; min-width: 0; }
.dl-row .info b { font-family: var(--font-head); }
.dl-row .info span { display: block; font-size: .84rem; color: var(--ink-soft); }

/* ---------------------------------------------------------------- Footer */
footer.site { background: var(--trust-blue-dark); color: #cfe0f3; padding: 40px 0 48px; margin-top: 20px; }
footer.site .wrap { display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; align-items: center; }
footer.site strong { color: #fff; font-family: var(--font-head); }
footer.site a { color: var(--radiant-gold); }
footer.site .fnote { font-size: .82rem; max-width: 52ch; }

/* ---------------------------------------------------------------- Toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--charcoal); color: #fff; padding: 11px 20px; border-radius: 999px;
  font-family: var(--font-head); font-weight: 600; font-size: .88rem; box-shadow: var(--shadow-3);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s var(--ease); z-index: 600;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------------------------------------------------------------- Responsive */
@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .mtop { display: flex; }
  .sidebar {
    position: fixed; top: 0; left: 0; z-index: 200; width: 280px;
    transform: translateX(-100%); transition: transform .25s var(--ease);
  }
  .sidebar.open { transform: none; }
  .scrim.show { display: block; }
  .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; }
  .do-dont { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 18px; }
  .hero { padding: 44px 0 40px; }
}

@media print {
  .sidebar, .mtop, .scrim, .hero-actions, .dl, .tab { display: none !important; }
  .shell { grid-template-columns: 1fr; }
  .panel { display: block !important; }
  section.block { padding: 22px 0; }
}
