/* ============================================================
   Renovaré Style Guide — page layout & components
   ============================================================ */

html { scroll-behavior: smooth; overflow-x: hidden; }
image-slot { display: block; width: 100%; height: 100%; }
body { margin: 0; background: var(--neutral-bg); overflow-x: hidden; scroll-behavior: smooth; }
* { box-sizing: border-box; }

/* ---- Shell ---- */

.sg {
  display: flex;
  min-height: 100vh;
  background: var(--neutral-bg);
  font-family: var(--font-sans);
  color: var(--neutral-800);
}

@media (max-width: 760px) {
  .sg { flex-direction: column; }
}

@media (min-width: 761px) {
  .sg { flex-direction: row; }
}

/* ---- Nav ---- */

.sg-nav {
  flex-shrink: 0;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  background: var(--neutral-bg);
}

@media (max-width: 760px) {
  .sg-nav {
    width: 100%;
    height: auto;
    border-bottom: 1px solid var(--neutral-300);
    padding: 14px 20px;
    z-index: 20;
  }
}

@media (min-width: 761px) {
  .sg-nav {
    width: 196px;
    height: 100vh;
    overflow-y: auto;
    border-right: 1px solid var(--neutral-300);
    padding: 40px 24px;
    gap: 28px;
    z-index: 1;
  }
}

.sg-nav-desktop { display: none; }
.sg-nav-mobile { display: block; width: 100%; }

@media (min-width: 761px) {
  .sg-nav-desktop {
    display: flex;
    flex-direction: column;
    gap: 28px;
  }
  .sg-nav-mobile { display: none; }
}

.sg-nav-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.sg-nav-logo img {
  height: auto;
  width: 96px;
}

@media (min-width: 761px) {
  .sg-nav-logo img { width: 124px; }
}

.sg-nav-links {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sg-nav-link {
  padding: 9px 10px;
  border-radius: var(--radius);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  color: var(--neutral-700);
  background: transparent;
  transition: background var(--duration-fast) ease;
}

.sg-nav-link.is-active {
  color: var(--primary-500);
  font-weight: 700;
}

.sg-nav-mobile-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.sg-nav-menu-btn {
  all: unset;
  cursor: pointer;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.sg-nav-menu-btn span {
  width: 20px;
  height: 2px;
  background: var(--neutral-900);
  border-radius: 1px;
}

.sg-nav-mobile-panel {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 14px;
  margin-top: 14px;
  border-top: 1px solid var(--neutral-300);
}

.sg-nav-link--mobile {
  padding: 10px 6px;
  font-size: 16px;
}

/* ---- Main ---- */

.sg-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

@media (max-width: 760px) {
  .sg-main {
    max-width: 100%;
    padding: 32px 20px 80px;
    gap: 64px;
  }
}

@media (min-width: 761px) {
  .sg-main {
    max-width: 920px;
    padding: 88px 72px 140px;
    gap: 112px;
  }
}

/* ---- Sections ---- */

.sg-section {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.sg-section--hero {
  gap: 20px;
  position: relative;
}

.sg-hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sg-hero-icon {
  width: 52px;
  height: auto;
}

@media (min-width: 761px) {
  .sg-hero-icon { width: 72px; }
}

.sg-hero-title {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: var(--leading-tight);
  margin: 0;
  color: var(--neutral-900);
  max-width: 640px;
  font-size: 40px;
}

@media (min-width: 761px) {
  .sg-hero-title { font-size: 64px; }
}

.sg-brushstroke {
  position: absolute;
  width: calc(100vw);
  max-width: none;
  height: auto;
  pointer-events: none;
  z-index: 0;
  mix-blend-mode: multiply;
  opacity: var(--bs-opacity, 0.2);
  transform: scale(var(--bs-scale, 1));
  transform-origin: top center;
  top: max(var(--bs-offset-y, -40px), -10px);
  left: -20px;
}

@media (min-width: 761px) {
  .sg-brushstroke {
    top: var(--bs-offset-y, -40px);
    left: -268px;
  }
}

/* ---- Typography ---- */

.sg-heading {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 26px;
  margin: -14px 0 0 0;
  color: var(--neutral-900);
}

@media (min-width: 761px) {
  .sg-heading { font-size: 34px; }
}

.sg-lead {
  margin: 0;
  font-size: 17px;
  line-height: var(--leading-relaxed);
  color: var(--neutral-700);
  max-width: 560px;
}

.sg-body {
  margin: 0;
  font-size: 15px;
  line-height: var(--leading-relaxed);
  color: var(--neutral-700);
}

.sg-body--wide { max-width: 600px; }

.sg-body-sm {
  margin: 0;
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--neutral-600);
}

.sg-body-sm--wide { max-width: 620px; }
.sg-body-sm--ink { color: var(--neutral-700); }

.sg-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--primary-500);
  margin-bottom: 10px;
}

.sg-label--muted {
  color: var(--neutral-500);
  font-size: 11px;
  margin-bottom: 0;
}

.sg-label--do {
  color: var(--primary-700);
}

.sg-label--dont {
  color: var(--neutral-600);
}

.sg-label--inline { margin-bottom: 8px; }
.sg-label--flush { margin-bottom: 0; }

.sg-subheading {
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--neutral-800);
}

.sg-link {
  color: var(--primary-500);
  font-weight: var(--weight-semibold);
  text-decoration: none;
  border-bottom: 1px solid var(--primary-300);
}

.sg-quote {
  border-left: 2px solid var(--primary-500);
  padding: 4px 0 4px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sg-quote-text {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 19px;
  font-style: italic;
  color: var(--neutral-800);
  line-height: var(--leading-normal);
}

.sg-code {
  font-family: monospace;
  font-size: 13px;
  background: var(--neutral-200);
  padding: 1px 5px;
  border-radius: 3px;
}

/* ---- Grids ---- */

.sg-grid-2,
.sg-grid-3 {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
}

@media (min-width: 761px) {
  .sg-grid-2 { grid-template-columns: 1fr 1fr; }
  .sg-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
}

.sg-grid-3--tight { margin-top: -12px; }

/* ---- Cards ---- */

.sg-card {
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius);
  padding: 24px;
  background: var(--neutral-100);
}

.sg-card--stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sg-card--type {
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sg-card--do {
  border-color: var(--primary-200);
  padding: 22px;
  background: var(--primary-100);
}

.sg-card--dont {
  padding: 22px;
}

.sg-card--dark {
  border-color: var(--primary-900);
  background: var(--primary-900);
}

.sg-card--clip { overflow: hidden; }

.sg-list {
  margin: 0;
  padding-left: 18px;
  font-size: var(--text-sm);
  line-height: 1.7;
  color: var(--neutral-700);
}

/* ---- Logo cards ---- */

.sg-logo-card {
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--neutral-100);
  display: flex;
  flex-direction: column;
}

.sg-logo-preview {
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--neutral-100);
  padding: 20px;
}

.sg-logo-preview--dark { background: var(--primary-700); }

.sg-logo-preview img {
  max-width: 80%;
  max-height: 80%;
}

.sg-logo-preview--wide img { max-width: 82%; }

.sg-logo-preview--seal img {
  max-width: 50%;
  max-height: 90%;
}

.sg-logo-preview--icon img {
  max-width: 42%;
  max-height: 75%;
}

.sg-logo-footer {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--neutral-300);
}

.sg-logo-variant {
  font-size: 13px;
  font-weight: 500;
  color: var(--neutral-700);
}

.sg-logo-variant--nowrap { white-space: nowrap; }

.sg-logo-downloads {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

.sg-download-link {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: 0.02em;
  color: var(--primary-500);
  text-decoration: none;
  border-bottom: 2px solid var(--primary-500);
  padding-bottom: 1px;
}

.sg-logo-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

/* ---- Color swatches ---- */

.sg-color-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sg-color-group-header {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-width: 620px;
}

.sg-color-group-title {
  font-size: 13px;
  font-weight: var(--weight-bold);
  color: var(--neutral-800);
}

.sg-color-group-note {
  font-size: 13px;
  color: var(--neutral-600);
  line-height: 1.55;
}

.sg-swatch-grid--lg {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
}

.sg-swatch-grid--sm {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 10px;
}

.sg-swatch-btn {
  all: unset;
  cursor: pointer;
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--neutral-100);
}

.sg-swatch-btn--lg {
  display: flex;
  flex-direction: column;
}

.sg-swatch-btn--sm {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
}

.sg-swatch-fill {
  background: var(--swatch-hex);
}

.sg-swatch-fill--lg {
  height: 88px;
  border-bottom: 1px solid var(--neutral-300);
}

.sg-swatch-fill--sm {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border-radius: 3px;
  border: 1px solid var(--neutral-300);
}

.sg-swatch-meta {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sg-swatch-label {
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--neutral-800);
}

.sg-swatch-caption {
  font-size: var(--text-2xs);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--neutral-500);
}

.sg-swatch-hex {
  font-size: 11px;
  font-family: monospace;
  color: var(--neutral-600);
  margin-top: 2px;
}

.sg-swatch-meta--sm {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  padding: 0;
}

.sg-swatch-caption--sm {
  font-size: var(--text-2xs);
  font-weight: var(--weight-bold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--neutral-600);
}

.sg-swatch-hex--sm {
  font-size: var(--text-2xs);
  font-family: monospace;
  color: var(--neutral-500);
  margin-top: 0;
}

/* ---- Type samples ---- */

.sg-type-label {
  font-size: 11px;
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--neutral-500);
}

.sg-type-display {
  font-family: var(--font-display);
  font-size: 52px;
  line-height: var(--leading-tight);
  color: var(--neutral-900);
}

.sg-type-serif {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 19px;
  line-height: var(--leading-relaxed);
  color: var(--neutral-800);
  max-width: 560px;
}

.sg-type-sans {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: var(--leading-relaxed);
  color: var(--neutral-700);
  max-width: 560px;
}

.sg-type-weights {
  display: flex;
  gap: 18px;
  margin-top: 6px;
}

.sg-type-weight {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--neutral-600);
}

.sg-type-weight--400 { font-weight: 400; }
.sg-type-weight--500 { font-weight: 500; }
.sg-type-weight--600 { font-weight: 600; }
.sg-type-weight--700 { font-weight: 700; }

/* ---- Imagery cards ---- */

.sg-media-card {
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--neutral-100);
  display: flex;
  flex-direction: column;
}

.sg-media-card img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
}

.sg-media-card-body { padding: 18px 20px; }

/* ---- Brushstroke demos ---- */

.sg-brush-demo {
  position: relative;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.sg-brush-demo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sg-brush-demo--light img {
  opacity: 0.35;
  mix-blend-mode: multiply;
}

.sg-brush-demo--dark img {
  opacity: 0.28;
  mix-blend-mode: screen;
}

.sg-brush-demo-text {
  position: relative;
  font-family: var(--font-display);
  font-size: 40px;
}

.sg-brush-demo-text--light { color: var(--neutral-900); }
.sg-brush-demo-text--dark { color: var(--neutral-100); }

.sg-body strong { font-weight: 600; }

.sg-toast-wrap {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 50;
}

.sg-toast {
  background: var(--neutral-900);
  color: var(--neutral-100);
  font-size: 13px;
  font-weight: 500;
  padding: 10px 16px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
