/* ============================================================
   DOUGLAS ANDRADE — BRAND BOOK
   Design System
   ============================================================ */

:root {
  /* Paleta */
  --color-primary: #0A0A0A;       /* Preto Forty Four */
  --color-bg: #FAFAF7;            /* Branco Polpa */
  --color-accent: #C29B5B;        /* Dourado Conquista */
  --color-text: #3A3A3A;          /* Grafite Suor */
  --color-muted: #6B6B6B;
  --color-border: #E5E3DC;
  --color-surface: #F2EFE6;
  --color-code-bg: #1A1A1A;

  /* Tipografia */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Menlo', monospace;

  /* Espaçamento */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;

  /* Layout */
  --sidebar-width: 280px;
  --content-max: 800px;

  /* Sombra */
  --shadow-sm: 0 1px 3px rgba(10,10,10,0.06), 0 1px 2px rgba(10,10,10,0.04);
  --shadow-md: 0 4px 12px rgba(10,10,10,0.08), 0 2px 4px rgba(10,10,10,0.04);
  --shadow-lg: 0 12px 32px rgba(10,10,10,0.12), 0 4px 8px rgba(10,10,10,0.06);
  --shadow-gold: 0 8px 24px rgba(194,155,91,0.18);

  /* Transição */
  --t-fast: 150ms ease;
  --t-normal: 250ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* ============================================================
   RESET
   ============================================================ */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

img, svg, video {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

/* ============================================================
   SIDEBAR
   ============================================================ */

.sidebar-toggle {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 60;
  width: 44px;
  height: 44px;
  background: var(--color-primary);
  color: var(--color-bg);
  border-radius: 6px;
  font-size: 1.4rem;
  box-shadow: var(--shadow-md);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10,10,10,0.55);
  z-index: 40;
  opacity: 0;
  transition: opacity var(--t-normal);
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--color-primary);
  color: var(--color-bg);
  padding: 2.5rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  z-index: 50;
  overflow-y: auto;
  border-right: 1px solid rgba(194,155,91,0.18);
}

.sidebar-brand {
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-brand h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  color: var(--color-bg);
  line-height: 1.1;
  margin-bottom: 0.35rem;
}

.sidebar-brand span {
  font-family: var(--font-body);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-accent);
  font-weight: 500;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  color: rgba(250,250,247,0.78);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  border-radius: 0 4px 4px 0;
  transition: all var(--t-fast);
}

.sidebar-nav a:hover {
  color: var(--color-accent);
  background: rgba(194,155,91,0.06);
}

.sidebar-nav a.active {
  color: var(--color-bg);
  border-left-color: var(--color-accent);
  background: rgba(194,155,91,0.1);
}

.sidebar-nav .nav-icon {
  font-size: 1.05rem;
  width: 1.4rem;
  display: inline-block;
}

.sidebar-footer {
  padding-top: 1.5rem;
  margin-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(250,250,247,0.45);
  text-align: center;
}

/* ============================================================
   MAIN WRAPPER & CONTENT
   ============================================================ */

.main-wrapper {
  padding-left: var(--sidebar-width);
  min-height: 100vh;
}

.main-content {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 4rem 2.5rem 6rem;
  background: var(--color-bg);
}

/* ============================================================
   TOOLBAR
   ============================================================ */

.toolbar {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-border);
}

.toolbar button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--color-text);
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  transition: all var(--t-fast);
}

.toolbar button:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background: rgba(194,155,91,0.04);
}

.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--color-primary);
  color: var(--color-bg);
  padding: 0.85rem 1.3rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 100;
  border-left: 3px solid var(--color-accent);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity var(--t-normal), transform var(--t-normal);
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   TIPOGRAFIA EDITORIAL
   ============================================================ */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--color-primary);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

h1 {
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  font-weight: 900;
  margin-bottom: 1.5rem;
  padding-bottom: 0.85rem;
  border-bottom: 3px solid var(--color-accent);
  letter-spacing: -0.03em;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  margin-top: 3rem;
  margin-bottom: 1.2rem;
}

h3 {
  font-size: clamp(1.25rem, 2.2vw, 1.45rem);
  color: var(--color-primary);
  margin-top: 2rem;
  margin-bottom: 0.8rem;
  font-weight: 700;
}

h4 {
  font-size: 1.15rem;
  margin-top: 1.6rem;
  margin-bottom: 0.6rem;
  color: var(--color-text);
}

h5, h6 {
  font-size: 1rem;
  margin-top: 1.4rem;
  margin-bottom: 0.5rem;
  color: var(--color-text);
}

p {
  margin-bottom: 1.2rem;
  color: var(--color-text);
}

strong, b {
  font-weight: 700;
  color: var(--color-primary);
}

em, i {
  font-style: italic;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--t-fast);
}

a:hover {
  border-bottom-color: var(--color-accent);
}

hr {
  border: none;
  height: 1px;
  background: var(--color-border);
  margin: 3rem 0;
}

/* ============================================================
   LISTAS
   ============================================================ */

ul, ol {
  margin: 1rem 0 1.5rem 1.5rem;
  padding-left: 0.5rem;
}

li {
  margin-bottom: 0.5rem;
  color: var(--color-text);
}

ul li::marker {
  color: var(--color-accent);
}

ol li::marker {
  color: var(--color-accent);
  font-weight: 600;
}

li > ul, li > ol {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

/* ============================================================
   BLOCKQUOTES
   ============================================================ */

blockquote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.2rem;
  line-height: 1.5;
  color: var(--color-primary);
  border-left: 4px solid var(--color-accent);
  background: var(--color-surface);
  padding: 1.5rem 1.8rem;
  margin: 2rem 0;
  border-radius: 0 4px 4px 0;
}

blockquote p {
  margin-bottom: 0.5rem;
  color: var(--color-primary);
}

blockquote p:last-child {
  margin-bottom: 0;
}

/* ============================================================
   CODE
   ============================================================ */

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--color-surface);
  color: var(--color-primary);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  border: 1px solid var(--color-border);
}

pre {
  background: var(--color-code-bg);
  color: var(--color-accent);
  padding: 1.3rem 1.5rem;
  border-radius: 6px;
  overflow-x: auto;
  margin: 1.5rem 0;
  font-size: 0.88rem;
  line-height: 1.6;
  border-left: 3px solid var(--color-accent);
}

pre code {
  background: transparent;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

/* ============================================================
   TABELAS
   ============================================================ */

.table-wrapper {
  overflow-x: auto;
  margin: 1.8rem 0;
  border-radius: 6px;
  border: 1px solid var(--color-border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

thead {
  background: var(--color-primary);
  color: var(--color-bg);
}

th {
  font-family: var(--font-body);
  font-weight: 600;
  text-align: left;
  padding: 0.9rem 1rem;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 2px solid var(--color-accent);
}

td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
  vertical-align: top;
}

tbody tr {
  transition: background var(--t-fast);
}

tbody tr:hover {
  background: var(--color-surface);
}

tbody tr:last-child td {
  border-bottom: none;
}

/* ============================================================
   IMAGENS
   ============================================================ */

img {
  border-radius: 4px;
  box-shadow: var(--shadow-md);
  margin: 1.5rem 0;
}

figure {
  margin: 2rem 0;
}

figcaption {
  font-size: 0.85rem;
  color: var(--color-muted);
  text-align: center;
  font-style: italic;
  margin-top: 0.5rem;
}

/* ============================================================
   INDEX — HERO
   ============================================================ */

.hero {
  text-align: center;
  padding: 4rem 0 5rem;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 4rem;
}

.hero .eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-muted);
  font-weight: 600;
  margin-bottom: 1.8rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--color-accent);
}

.hero h1 {
  font-size: clamp(2.8rem, 6vw, 4.5rem);
  font-weight: 900;
  letter-spacing: -0.035em;
  border: none;
  padding: 0;
  margin-bottom: 1rem;
  line-height: 1;
}

.hero .tagline {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.2rem, 2.5vw, 1.65rem);
  color: var(--color-accent);
  margin-bottom: 1.2rem;
  font-weight: 700;
}

.hero .subtitle {
  font-size: 1rem;
  color: var(--color-muted);
  max-width: 540px;
  margin: 0 auto;
  letter-spacing: 0.02em;
}

/* ============================================================
   RESUMO EXECUTIVO
   ============================================================ */

.summary {
  margin-bottom: 5rem;
}

.summary h2 {
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--color-accent);
  margin-bottom: 1.5rem;
  margin-top: 0;
}

.summary p {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--color-text);
}

.summary p:first-of-type::first-letter {
  font-family: var(--font-display);
  font-size: 3.5rem;
  font-weight: 900;
  float: left;
  line-height: 1;
  padding: 0.3rem 0.6rem 0 0;
  color: var(--color-primary);
}

/* ============================================================
   MANIFESTO
   ============================================================ */

.manifesto {
  background: var(--color-primary);
  color: var(--color-bg);
  padding: 4rem 3rem;
  border-radius: 6px;
  margin: 5rem -1rem;
  position: relative;
  overflow: hidden;
}

.manifesto::before {
  content: '"';
  position: absolute;
  top: -2rem;
  left: 1rem;
  font-family: var(--font-display);
  font-size: 12rem;
  color: var(--color-accent);
  opacity: 0.18;
  line-height: 1;
}

.manifesto .label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-accent);
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.manifesto p {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.15rem, 2.2vw, 1.4rem);
  line-height: 1.55;
  color: var(--color-bg);
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
}

.manifesto .signature {
  font-family: var(--font-body);
  font-style: normal;
  font-size: 0.85rem;
  color: var(--color-accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 1.5rem;
  font-weight: 600;
}

/* ============================================================
   CARDS GRID
   ============================================================ */

.docs-section {
  margin-top: 5rem;
}

.docs-section .section-label {
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-accent);
  font-weight: 600;
  margin-bottom: 0.5rem;
  display: block;
}

.docs-section h2 {
  margin-top: 0;
  margin-bottom: 2.5rem;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.doc-card {
  display: block;
  padding: 2rem 1.8rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  text-decoration: none;
  color: inherit;
  transition: all var(--t-normal);
  position: relative;
  overflow: hidden;
}

.doc-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--t-normal);
}

.doc-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-gold);
  border-color: var(--color-accent);
}

.doc-card:hover::before {
  transform: scaleX(1);
}

.doc-card .card-icon {
  font-size: 1.8rem;
  margin-bottom: 1rem;
  display: block;
}

.doc-card h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--color-primary);
  margin: 0 0 0.6rem;
  letter-spacing: -0.01em;
}

.doc-card p {
  font-size: 0.93rem;
  color: var(--color-muted);
  line-height: 1.55;
  margin-bottom: 1.2rem;
}

.doc-card .card-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-accent);
  letter-spacing: 0.04em;
  transition: gap var(--t-fast);
}

.doc-card:hover .card-cta {
  gap: 0.6rem;
}

/* ============================================================
   FOOTER
   ============================================================ */

.site-footer {
  margin-top: 6rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
  text-align: center;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-muted);
  font-weight: 500;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 900px) {
  .sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform var(--t-normal);
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  body.sidebar-open .sidebar-overlay {
    display: block;
    opacity: 1;
  }

  .main-wrapper {
    padding-left: 0;
  }

  .main-content {
    padding: 4.5rem 1.3rem 4rem;
  }

  .hero {
    padding: 2rem 0 3rem;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }

  .manifesto {
    padding: 3rem 1.5rem;
    margin: 3rem 0;
  }

  blockquote {
    padding: 1.2rem 1.3rem;
    font-size: 1.05rem;
  }

  table {
    font-size: 0.85rem;
  }

  th, td {
    padding: 0.6rem 0.7rem;
  }
}

@media (min-width: 1100px) {
  .cards-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ============================================================
   PRINT
   ============================================================ */

@media print {
  body {
    background: white;
    color: black;
    font-size: 11pt;
  }

  .sidebar,
  .sidebar-toggle,
  .sidebar-overlay,
  .toolbar,
  .toast,
  .site-footer {
    display: none !important;
  }

  .main-wrapper {
    padding-left: 0;
  }

  .main-content {
    max-width: 100%;
    padding: 0;
    background: white;
  }

  h1, h2, h3, h4, h5, h6 {
    color: black;
    page-break-after: avoid;
  }

  h1 {
    border-bottom-color: black;
  }

  a {
    color: black;
    text-decoration: underline;
  }

  blockquote {
    background: transparent;
    border-left-color: black;
    color: black;
  }

  blockquote p {
    color: black;
  }

  thead {
    background: black;
    color: white;
  }

  pre {
    background: #f0f0f0;
    color: black;
    border-left-color: black;
  }

  .manifesto {
    background: white;
    color: black;
    border: 2px solid black;
  }

  .manifesto p,
  .manifesto .label,
  .manifesto .signature {
    color: black;
  }

  .doc-card {
    page-break-inside: avoid;
    border: 1px solid #999;
  }

  img {
    max-width: 100%;
    page-break-inside: avoid;
  }
}
