:root {
  --bg-canvas: #eef7f2;
  --bg-surface: rgba(255, 255, 255, 0.85);
  --text-primary: #1f2937;
  --text-muted: #374151;
  --accent-primary: #14532d;
  --border-subtle: rgba(20, 83, 45, 0.15);
  
  --font-head: Georgia, "Times New Roman", serif;
  --font-body: system-ui, -apple-system, sans-serif;
  
  --ease-kinetic: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-elevation: 0 12px 32px -4px rgba(20, 83, 45, 0.15);
  --glass-backdrop: blur(16px) saturate(180%);
}

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

body {
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-wrap: anywhere;
  hyphens: auto;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-head);
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 1rem;
  font-weight: 700;
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }

a {
  color: var(--accent-primary);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: opacity 0.3s ease;
}

a:hover {
  opacity: 0.8;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  border-radius: 0; /* Square corners */
}

/* Square sections */
section, div, article {
  border-radius: 0;
}

/* Round badges/avatars */
.badge, .avatar {
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Header */
header {
  background-color: var(--bg-canvas);
  border-bottom: 1px solid var(--border-subtle);
  position: relative; /* Scrolls out of view */
  z-index: 100;
}

.header-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: bold;
  text-decoration: none;
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-desktop {
  display: none;
}

.nav-desktop ul {
  list-style: none;
  display: flex;
  gap: 2rem;
  margin: 0;
  padding: 0;
}

.nav-desktop a {
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 500;
  border-bottom: 2px solid transparent;
  padding-bottom: 2px;
  transition: all 0.3s ease;
}

.nav-desktop a:hover {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
  text-decoration: none;
}

.menu-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-primary);
  cursor: pointer;
  padding: 0.5rem;
}

.nav-mobile {
  display: none;
  background-color: var(--bg-surface);
  backdrop-filter: var(--glass-backdrop);
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  border-bottom: 1px solid var(--border-subtle);
  padding: 1rem 2rem;
  box-shadow: var(--shadow-elevation);
}

.nav-mobile.active {
  display: block;
  animation: slideDown 0.3s var(--ease-kinetic);
}

.nav-mobile ul {
  list-style: none;
}

.nav-mobile li {
  margin-bottom: 1rem;
}

.nav-mobile a {
  display: block;
  font-size: 1.25rem;
  text-decoration: none;
  color: var(--text-primary);
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  background-color: var(--accent-primary);
  color: #ffffff;
  padding: 0.875rem 1.75rem;
  text-decoration: none;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform 0.3s var(--ease-kinetic), box-shadow 0.3s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-elevation);
  opacity: 1;
}

/* Layout Utilities */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

.container-narrow {
  max-width: 800px; /* Long form copy cap ~ 70ch */
  margin: 0 auto;
  padding: 4rem 2rem;
}

/* Background Patterns */
.bg-grid-pattern {
  position: relative;
}

.bg-grid-pattern::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(var(--border-subtle) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-subtle) 1px, transparent 1px);
  background-size: 30px 30px;
  opacity: 0.4;
  z-index: -1;
}

.bg-dot-pattern {
  position: relative;
}

.bg-dot-pattern::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--border-subtle) 2px, transparent 2px);
  background-size: 24px 24px;
  z-index: -1;
}

/* Hero Section */
.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: center;
  padding: 4rem 2rem;
  max-width: 1280px;
  margin: 0 auto;
}

.hero-content {
  max-width: 600px;
}

.hero-image {
  aspect-ratio: 16/9;
  width: 100%;
  box-shadow: var(--shadow-elevation);
}

/* Bento Grid */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 3rem;
}

.bento-card {
  background: var(--bg-surface);
  backdrop-filter: var(--glass-backdrop);
  border: 1px solid var(--border-subtle);
  padding: 2rem;
  transition: transform 0.4s var(--ease-kinetic), box-shadow 0.4s ease;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.bento-card:hover {
  transform: translateY(-5px) scale(1.01);
  box-shadow: var(--shadow-elevation);
}

.bento-card img {
  width: 100%;
  aspect-ratio: 4/3;
  margin-bottom: 1.5rem;
}

.bento-card h3 {
  margin-bottom: 0.75rem;
}

/* Data Tables */
.table-wrapper {
  overflow-x: auto;
  margin: 2rem 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-surface);
  backdrop-filter: var(--glass-backdrop);
  border: 1px solid var(--border-subtle);
}

th, td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

th {
  background: rgba(20, 83, 45, 0.05);
  font-family: var(--font-head);
  font-weight: 600;
}

/* Tabbed Interface */
.tabs {
  margin: 3rem 0;
}

.tab-list {
  display: flex;
  gap: 1rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 2rem;
  overflow-x: auto;
}

.tab-btn {
  background: none;
  border: none;
  padding: 1rem 1.5rem;
  font-family: var(--font-head);
  font-size: 1.125rem;
  cursor: pointer;
  color: var(--text-muted);
  border-bottom: 3px solid transparent;
  white-space: nowrap;
}

.tab-btn.active {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
  font-weight: bold;
}

.tab-panel {
  display: none;
  animation: fadeIn 0.4s var(--ease-kinetic);
}

.tab-panel.active {
  display: block;
}

/* Tool Form */
.tool-container {
  background: var(--bg-surface);
  backdrop-filter: var(--glass-backdrop);
  border: 1px solid var(--border-subtle);
  padding: 2.5rem;
  margin-top: 2rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-subtle);
  background: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-body);
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: 2px solid var(--accent-primary);
  outline-offset: -1px;
}

.output-panel {
  display: none;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
}

.output-panel.visible {
  display: block;
}

#outputText {
  width: 100%;
  min-height: 150px;
  background: #f8faf9;
  border: 1px solid var(--border-subtle);
  padding: 1rem;
  font-family: monospace;
  margin-bottom: 1rem;
  resize: vertical;
}

.tool-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-secondary {
  background: transparent;
  color: var(--accent-primary);
  border: 1px solid var(--accent-primary);
  padding: 0.875rem 1.75rem;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: var(--accent-primary);
  color: #fff;
}

/* Footer */
footer {
  background: #ffffff;
  border-top: 1px solid var(--border-subtle);
  padding: 4rem 2rem 2rem;
  margin-top: 4rem;
}

.footer-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.footer-col h4 {
  font-size: 1.125rem;
  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);
}

.footer-col a:hover {
  text-decoration: underline;
  color: var(--accent-primary);
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.legal-address {
  font-style: normal;
  color: var(--text-muted);
}

/* Animations & Interactivity */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s var(--ease-kinetic);
}

.reveal.reveal-visible {
  opacity: 1;
  transform: translateY(0);
}

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

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

/* Responsive */
@media (min-width: 769px) {
  .nav-desktop {
    display: flex;
    align-items: center;
  }
  .menu-btn {
    display: none;
  }
  .header-container {
    justify-content: flex-start;
    gap: 3rem;
  }
  .hero {
    grid-template-columns: 1fr 1fr;
  }
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

@media (min-width: 1024px) {
  .bento-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .span-2 {
    grid-column: span 2;
  }
  .span-3 {
    grid-column: span 3;
  }
}

.content-block {
  margin-bottom: 2.5rem;
}
.content-block p {
  margin-bottom: 1.25rem;
}
.content-block ul {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}
.content-block li {
  margin-bottom: 0.5rem;
}

@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}
