:root {
  --ink-0: #14201a;
  --ink-1: #1b2b22;
  --ink-2: #24382c;
  --cream-0: #f4f1e6;
  --cream-1: #d8d3bf;
  --cream-2: #a3a08f;
  --granite: #8a877e;
  --granite-light: #b8b5aa;
  --moss: #5f7a52;
  --moss-bright: #7f9e6c;
  --serif: "Iowan Old Style", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --maxw: 1160px;
  --line-10: rgba(244, 241, 230, 0.1);
  --line-20: rgba(244, 241, 230, 0.2);
  --line-40: rgba(244, 241, 230, 0.4);
}

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

body {
  background: var(--ink-1);
  color: var(--cream-0);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3, .serif {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.18;
}

h1 {
  font-size: 42px;
  margin-bottom: 16px;
}

h2 {
  font-size: 32px;
  margin-bottom: 14px;
  margin-top: 24px;
}

h3 {
  font-size: 20px;
  margin-bottom: 12px;
  margin-top: 18px;
}

p {
  margin-bottom: 12px;
}

.kicker {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--moss-bright);
  display: block;
  margin-bottom: 8px;
}

.kicker::after {
  content: "";
  display: block;
  width: 44px;
  height: 1px;
  background: var(--moss-bright);
  margin-top: 12px;
}

.btn {
  display: inline-block;
  padding: 12px 26px;
  font-size: 13px;
  letter-spacing: 0.05em;
  text-decoration: none;
  border-radius: 2px;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.btn-moss {
  background: var(--moss);
  color: var(--cream-0);
  font-weight: 600;
}

.btn-moss:hover {
  background: var(--moss-bright);
}

.btn-ghost {
  border: 1px solid var(--line-40);
  color: var(--cream-0);
  background: transparent;
}

.btn-ghost:hover {
  border-color: var(--cream-0);
}

input,
textarea {
  background: var(--ink-2);
  border: 1px solid var(--line-20);
  color: var(--cream-0);
  border-radius: 2px;
  padding: 10px 12px;
  font-family: var(--sans);
  transition: all 0.2s ease;
}

input:focus,
textarea:focus {
  border-color: var(--line-40);
}

:focus-visible {
  outline: 2px solid var(--moss-bright);
  outline-offset: 2px;
}

.pill {
  display: inline-block;
  background: var(--ink-2);
  color: var(--cream-1);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
}

/* Header */
.header {
  background: var(--ink-0);
  border-bottom: 1px solid var(--line-10);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

.logo {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  color: var(--cream-0);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  color: var(--cream-1);
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 0.05em;
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: var(--moss-bright);
}

.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 4px;
  background: none;
  border: none;
}

.mobile-menu {
  display: none;
}

.hamburger span {
  width: 20px;
  height: 2px;
  background: var(--cream-0);
  transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(8px, 8px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(8px, -8px);
}

/* Hero Section */
.hero {
  position: relative;
  height: 500px;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(20, 32, 26, 0.4);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: var(--cream-0);
  max-width: 600px;
  padding: 0 24px;
}

.hero h1 {
  font-size: 48px;
  margin-bottom: 16px;
  line-height: 1.2;
}

.hero p {
  font-size: 18px;
  margin-bottom: 32px;
  line-height: 1.6;
  color: var(--cream-1);
}

/* Grid Layouts */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-bottom: 32px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
  margin-bottom: 32px;
}

.grid-item {
  padding: 24px;
  background: var(--ink-2);
  border-radius: 4px;
  border: 1px solid var(--line-10);
}

.grid-item h3 {
  margin-top: 0;
}

/* Cards - Dois Caminhos */
.card {
  background: var(--ink-2);
  border: 1px solid var(--line-10);
  border-radius: 4px;
  padding: 24px;
  transition: all 0.3s ease;
}

.card:hover {
  border-color: var(--line-20);
  background: rgba(36, 56, 44, 0.8);
}

.card-title {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--cream-0);
}

.card-text {
  color: var(--cream-1);
  font-size: 14px;
  line-height: 1.6;
}

/* Gallery */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  cursor: pointer;
  aspect-ratio: 1;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(20, 32, 26, 0.95);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 40px 20px;
  animation: fadeIn 0.3s ease;
}

.lightbox.active {
  display: flex;
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
}

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: none;
  border: none;
  color: var(--cream-0);
  font-size: 28px;
  cursor: pointer;
  z-index: 10;
  transition: color 0.2s ease;
}

.lightbox-close:hover {
  color: var(--moss-bright);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--cream-0);
  font-size: 32px;
  cursor: pointer;
  transition: color 0.2s ease;
  z-index: 10;
  padding: 10px;
}

.lightbox-nav:hover {
  color: var(--moss-bright);
}

.lightbox-prev {
  left: -60px;
}

.lightbox-next {
  right: -60px;
}

/* Data Table */
.data {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 32px;
}

.data th {
  background: var(--ink-2);
  color: var(--cream-0);
  padding: 12px;
  text-align: left;
  font-weight: 600;
  border-bottom: 1px solid var(--line-20);
  font-size: 12px;
  letter-spacing: 0.05em;
}

.data td {
  padding: 12px;
  border-bottom: 1px solid var(--line-10);
  color: var(--cream-1);
}

.data tr:hover {
  background: var(--ink-2);
}

/* Badge */
.badge {
  display: inline-block;
  background: var(--moss);
  color: var(--cream-0);
  padding: 4px 12px;
  border-radius: 2px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.badge-concept {
  background: var(--granite);
  color: var(--cream-0);
}

/* Footer */
.footer {
  background: var(--ink-0);
  color: var(--cream-1);
  padding: 40px 0 20px;
  border-top: 1px solid var(--line-10);
  margin-top: 60px;
}

.footer-content {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

.footer p {
  font-size: 12px;
  line-height: 1.6;
  color: var(--cream-2);
  margin-bottom: 8px;
}

.footer a {
  color: var(--moss-bright);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer a:hover {
  color: var(--cream-0);
}

.footer-disclaimer {
  font-size: 11px;
  color: var(--granite);
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line-10);
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.in {
  opacity: 1;
  transform: none;
}

/* Responsive */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 1024px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .gallery {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}

@media (max-width: 720px) {
  .nav-links {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .mobile-menu {
    position: absolute;
    top: 60px;
    right: 0;
    left: 0;
    background: var(--ink-0);
    border-bottom: 1px solid var(--line-10);
    padding: 20px 24px;
    list-style: none;
    display: none;
    flex-direction: column;
    gap: 16px;
    z-index: 99;
    animation: slideInDown 0.3s ease;
  }

  .mobile-menu.active {
    display: flex;
  }

  .mobile-menu a {
    color: var(--cream-1);
    text-decoration: none;
    font-size: 14px;
    display: block;
  }

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

  .hero {
    height: 300px;
  }

  .hero h1 {
    font-size: 32px;
  }

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

  h1 {
    font-size: 28px;
  }

  h2 {
    font-size: 22px;
  }

  .lightbox-nav {
    top: 20px;
  }

  .lightbox-prev {
    left: 10px;
  }

  .lightbox-next {
    right: 10px;
  }

  .lightbox-close {
    top: 10px;
    right: 10px;
  }
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Portal (login + authenticated shell) */
.btn-gold {
  background: var(--moss);
  color: var(--cream-0);
  font-weight: 600;
}

.btn-gold:hover {
  background: var(--moss-bright);
}

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 360px;
  background: var(--ink-2);
  border: 1px solid var(--line-10);
  border-radius: 4px;
  padding: 32px;
}

.login-card .logo {
  display: block;
  margin-bottom: 4px;
}

.login-card .sub {
  color: var(--cream-2);
  font-size: 13px;
  margin-bottom: 20px;
}

.alert {
  background: var(--ink-1);
  border: 1px solid var(--line-20);
  color: var(--cream-1);
  border-radius: 2px;
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 16px;
}

.alert.error {
  border-color: var(--granite);
  color: var(--cream-0);
}

.form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form label {
  font-size: 12px;
  color: var(--cream-2);
  margin-top: 8px;
}

.form input {
  width: 100%;
}

.form .actions {
  margin-top: 16px;
}

.form-note {
  font-size: 12px;
  color: var(--cream-2);
  margin-top: 12px;
}

.form-note a {
  color: var(--moss-bright);
}

/* Authenticated app shell */
.app {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 220px;
  flex: 0 0 220px;
  background: var(--ink-0);
  border-right: 1px solid var(--line-10);
  display: flex;
  flex-direction: column;
  padding: 24px 20px;
}

.sidebar .logo {
  margin-bottom: 24px;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.sidebar nav a {
  color: var(--cream-1);
  text-decoration: none;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 2px;
  transition: all 0.2s ease;
}

.sidebar nav a:hover {
  background: var(--ink-2);
  color: var(--cream-0);
}

.sidebar nav a.active {
  background: var(--ink-2);
  color: var(--moss-bright);
  font-weight: 600;
}

.sidebar .foot {
  font-size: 12px;
  color: var(--cream-2);
  border-top: 1px solid var(--line-10);
  padding-top: 16px;
  line-height: 1.8;
}

.sidebar .foot a {
  text-decoration: none;
}

.content {
  flex: 1;
  padding: 40px;
  max-width: 960px;
}

.pagehead {
  margin-bottom: 24px;
}

.pagehead .kicker {
  margin-bottom: 4px;
}

.pagehead h1 {
  margin: 0;
}

.docviewer {
  width: 100%;
  min-height: 75vh;
  border: 1px solid var(--line-10);
  border-radius: 2px;
  background: var(--cream-0);
}

.prose {
  color: var(--cream-1);
  font-size: 15px;
  line-height: 1.7;
  max-width: 720px;
}

.prose p {
  margin-bottom: 16px;
}

.prose h2, .prose h3 {
  font-family: var(--serif);
  color: var(--cream-0);
  margin: 24px 0 12px;
}

.prose ul, .prose ol {
  margin: 0 0 16px 20px;
}

.prose li {
  margin-bottom: 6px;
}

.prose a {
  color: var(--moss-bright);
}

.prose strong {
  color: var(--cream-0);
}

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

  .sidebar {
    width: auto;
    flex: none;
  }

  .content {
    padding: 24px;
  }
}
