/* Pedro Coelho — Business Systems Notes
   Modern, Authoritative Editorial Design System
   Self-contained, fast, zero external dependencies */

:root {
  --bg-primary: #fdfdfc;
  --bg-surface: #ffffff;
  --bg-muted: #f5f5f2;
  --bg-card: #ffffff;
  --bg-highlight: #f0f4f8;

  --text-main: #18181b;
  --text-muted: #52525b;
  --text-subtle: #71717a;
  --text-inverse: #ffffff;

  --border-light: #e4e4e7;
  --border-medium: #d4d4d8;
  --border-accent: #2563eb;

  --primary: #0f172a;
  --primary-hover: #1e293b;
  --accent: #2563eb;
  --accent-light: #eff6ff;
  --success: #15803d;
  --warning: #b45309;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --max-width: 1140px;
  --reading-width: 740px;
}

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

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.65;
  font-weight: 400;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--primary);
  font-family: var(--font-sans);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

h1 { font-size: 2.5rem; margin-bottom: 1.25rem; }
h2 { font-size: 1.85rem; margin-top: 2rem; margin-bottom: 1rem; }
h3 { font-size: 1.35rem; margin-top: 1.5rem; margin-bottom: 0.75rem; }

p {
  margin-bottom: 1.25rem;
  color: var(--text-main);
  font-size: 1.05rem;
}

p.lead {
  font-size: 1.25rem;
  color: var(--text-muted);
  line-height: 1.6;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

a:hover {
  color: var(--primary);
  text-decoration-thickness: 2px;
}

/* Layout */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.container-reading {
  max-width: var(--reading-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

/* Header & Navigation */
header.site-header {
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(8px);
  background-color: rgba(255, 255, 255, 0.94);
}

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.5rem;
}

.brand {
  display: flex;
  flex-direction: column;
  text-decoration: none;
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.01em;
}

.brand-subtitle {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-subtle);
}

nav.main-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

nav.main-nav a {
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 0.5rem 0.25rem;
  position: relative;
}

nav.main-nav a:hover,
nav.main-nav a.active {
  color: var(--primary);
}

nav.main-nav a.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--accent);
}

.mobile-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  color: var(--text-main);
  cursor: pointer;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--text-inverse);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  color: var(--text-inverse);
  text-decoration: none;
}

.btn-secondary {
  background-color: var(--bg-surface);
  color: var(--text-main);
  border-color: var(--border-medium);
}

.btn-secondary:hover {
  background-color: var(--bg-muted);
  color: var(--primary);
  text-decoration: none;
}

.btn-outline {
  background: transparent;
  border-color: var(--border-medium);
  color: var(--text-main);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  text-decoration: none;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 9999px;
  background-color: var(--bg-muted);
  color: var(--text-muted);
}

.badge-blue {
  background-color: var(--accent-light);
  color: var(--accent);
}

/* Hero Section */
.hero {
  padding: 4rem 0 3rem;
  border-bottom: 1px solid var(--border-light);
  background: linear-gradient(180deg, var(--bg-surface) 0%, var(--bg-primary) 100%);
}

.hero-tagline {
  margin-bottom: 1rem;
}

.hero h1 {
  font-size: 2.75rem;
  line-height: 1.15;
  margin-bottom: 1.25rem;
  max-width: 820px;
}

.hero p.lead {
  max-width: 720px;
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

/* Feature Grid */
.section {
  padding: 4rem 0;
}

.section-header {
  margin-bottom: 2.5rem;
}

.section-header h2 {
  margin-top: 0;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}

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

/* Card Component */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  height: 100%;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-medium);
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: var(--text-subtle);
}

.card h3 {
  font-size: 1.25rem;
  margin-top: 0;
  margin-bottom: 0.75rem;
  line-height: 1.35;
}

.card h3 a {
  color: var(--primary);
  text-decoration: none;
}

.card h3 a:hover {
  color: var(--accent);
}

.card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.card-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Callout Box */
.callout {
  background-color: var(--bg-muted);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 1.5rem 1.75rem;
  margin: 2rem 0;
}

.callout-info {
  background-color: var(--accent-light);
  border-left-color: var(--accent);
}

.callout-title {
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--primary);
  font-size: 1.05rem;
}

.callout p:last-child {
  margin-bottom: 0;
}

/* Author Box */
.author-box {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  box-shadow: var(--shadow-sm);
}

.author-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0f172a 0%, #2563eb 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 2rem;
  font-weight: 700;
  flex-shrink: 0;
}

.author-bio h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1.35rem;
}

.author-role {
  color: var(--text-subtle);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.author-links {
  display: flex;
  gap: 1rem;
  margin-top: 1.25rem;
}

/* Editorial / Article Styling */
.article-header {
  padding: 3.5rem 0 2rem;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 2.5rem;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: center;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  color: var(--text-subtle);
}

.article-content {
  font-family: var(--font-sans);
  font-size: 1.1rem;
  line-height: 1.75;
  color: #27272a;
}

.article-content h2 {
  font-size: 1.75rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-light);
}

.article-content h3 {
  font-size: 1.35rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.article-content ul, 
.article-content ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.article-content li {
  margin-bottom: 0.5rem;
}

.article-content blockquote {
  border-left: 3px solid var(--border-medium);
  padding-left: 1.25rem;
  margin: 1.75rem 0;
  font-style: italic;
  color: var(--text-muted);
}

/* Data Table */
.table-wrapper {
  overflow-x: auto;
  margin: 2rem 0;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  text-align: left;
}

table.data-table th,
table.data-table td {
  padding: 0.9rem 1.2rem;
  border-bottom: 1px solid var(--border-light);
}

table.data-table th {
  background-color: var(--bg-muted);
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

table.data-table tr:last-child td {
  border-bottom: none;
}

table.data-table tr:hover td {
  background-color: rgba(0, 0, 0, 0.015);
}

/* Template Card / Code Box */
.template-box {
  background-color: var(--bg-muted);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 1.5rem;
  margin: 1.5rem 0;
  font-family: var(--font-sans);
  position: relative;
}

.template-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-light);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--primary);
}

.copy-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: 4px;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.copy-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Checklist UI */
.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-light);
}

.checklist-item input[type="checkbox"] {
  margin-top: 0.25rem;
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--accent);
  cursor: pointer;
}

.checklist-text {
  flex-grow: 1;
}

.checklist-title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--primary);
}

.checklist-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  margin-bottom: 0;
}

/* Transparency / Footer */
footer.site-footer {
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-light);
  padding: 4rem 0 2rem;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-brand p {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 400px;
  margin-top: 0.75rem;
}

.footer-col h4 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-subtle);
  margin-bottom: 1.25rem;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 0.75rem;
}

.footer-col a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.footer-col a:hover {
  color: var(--primary);
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-subtle);
  flex-wrap: wrap;
  gap: 1rem;
}

.disclosure-banner {
  background-color: var(--bg-muted);
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  padding: 0.85rem 0;
  font-size: 0.825rem;
  color: var(--text-subtle);
  text-align: center;
}

/* Responsive Media Queries */
@media (max-width: 900px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 680px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
  .hero h1 { font-size: 2.15rem; }

  .mobile-toggle {
    display: block;
  }

  nav.main-nav {
    display: none;
    position: absolute;
    top: 4.5rem;
    left: 0;
    right: 0;
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-medium);
    flex-direction: column;
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
    gap: 1rem;
  }

  nav.main-nav.open {
    display: flex;
  }

  .grid-3, .grid-2 {
    grid-template-columns: 1fr;
  }

  .author-box {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .author-links {
    justify-content: center;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
}


/* Focus, compact navigation and local interaction feedback. */
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.copy-status { margin: 0.75rem 0 0; font-size: 0.9rem; color: var(--text-muted); }
table caption { padding: 0.8rem 1rem; text-align: left; font-weight: 600; }
.copy-btn { display: none; }
.js-enabled .copy-btn { display: inline-block; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
@media (max-width: 1100px) {
  .mobile-toggle { display: none; }
  .nav-wrapper { height: auto; min-height: 4.5rem; flex-wrap: wrap; }
  nav.main-nav { display: flex; position: static; width: 100%; flex-wrap: wrap; gap: 0.5rem 1rem; padding: 0.5rem 0; box-shadow: none; }
  .js-enabled .nav-wrapper { height: 4.5rem; flex-wrap: nowrap; }
  .js-enabled .mobile-toggle { display: block; }
  .js-enabled nav.main-nav { display: none; position: absolute; top: 4.5rem; left: 0; right: 0; background: var(--bg-surface); border-bottom: 1px solid var(--border-medium); flex-direction: column; padding: 1rem; box-shadow: var(--shadow-lg); gap: 0.5rem; max-height: calc(100vh - 4.5rem); overflow-y: auto; }
  .js-enabled nav.main-nav.open { display: flex; }
}
