:root {
  /* Habitat Lineage Palette */
  --bg-canvas: #0b0b0d;
  --bg-surface: #1a1a1e;
  --text-primary: #ffffff;
  --text-muted: #c0c4cc;
  --accent-primary: #dc2626;
  --accent-hover: #b91c1c;

  /* Typography */
  --font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  
  /* Advanced UI Micro-Interactions & Depth */
  --ease-kinetic: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-elevation: 0 12px 32px -4px rgba(0, 0, 0, 0.5);
  --glass-backdrop: blur(16px) saturate(180%);
}

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

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

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

p {
  margin-bottom: 1.5rem;
}

a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.3s var(--ease-kinetic);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* Header - Static Flow (Moves up on scroll) */
header {
  position: static;
  width: 100%;
  padding: 2rem 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: transparent;
  z-index: 100;
}

.brand {
  font-size: 1.25rem;
  font-weight: bold;
  letter-spacing: 1px;
  color: var(--text-primary);
}

.desktop-nav {
  display: none;
}

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

.desktop-nav a {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.desktop-nav a:hover {
  color: var(--accent-primary);
}

.mobile-nav-toggle {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  display: block;
}

.mobile-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: var(--bg-surface);
  padding: 2rem;
  box-shadow: var(--shadow-elevation);
  z-index: 99;
}

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

.mobile-menu ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.mobile-menu a {
  display: block;
  padding: 0.5rem 0;
  font-size: 1.1rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

/* Buttons */
.btn-primary {
  display: inline-block;
  background: var(--accent-primary);
  color: #fff;
  padding: 1rem 2rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
  border: none;
  cursor: pointer;
  border-radius: 0; /* Square corners */
  transition: background 0.3s var(--ease-kinetic), transform 0.3s var(--ease-kinetic);
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: #fff;
  transform: translateY(-2px);
}

.btn-link {
  display: inline-block;
  color: var(--text-primary);
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 1px;
  position: relative;
  padding-bottom: 0.25rem;
}

.btn-link::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 2px;
  bottom: 0;
  left: 0;
  background-color: var(--accent-primary);
  transform: scaleX(0);
  transform-origin: bottom right;
  transition: transform 0.3s var(--ease-kinetic);
}

.btn-link:hover::after {
  transform: scaleX(1);
  transform-origin: bottom left;
}

/* Hero Section */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 5%;
  margin-top: -85px; /* Pull up to account for static header */
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
}

.hero-bg img {
  width: 100%;
  height: 100%;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(11,11,13,0.4) 0%, rgba(11,11,13,0.9) 100%);
  z-index: -1;
}

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

.hero h1 {
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
}

/* Layout Blocks */
.lead-block {
  max-width: 900px;
  margin: 5rem auto;
  padding: 0 5%;
  text-align: center;
  font-size: 1.25rem;
}

.grid-wrapper {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  padding: 0 5%;
  max-width: 1200px;
  margin: 0 auto 5rem;
}

/* Translucent Cards */
.card {
  background: rgba(26, 26, 30, 0.6);
  backdrop-filter: var(--glass-backdrop);
  -webkit-backdrop-filter: var(--glass-backdrop);
  padding: 2.5rem;
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 0;
  transition: transform 0.3s var(--ease-kinetic), box-shadow 0.3s var(--ease-kinetic);
}

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

.card img {
  width: 100%;
  height: 240px;
  margin-bottom: 1.5rem;
  border-radius: 0;
}

.card h3 {
  font-size: 1.5rem;
}

/* Background Blocks */
.accent-bg {
  background-color: var(--accent-primary);
  color: #fff;
  padding: 6rem 5%;
  text-align: center;
}

.accent-bg h2 {
  color: #fff;
  font-size: 2.5rem;
}

.accent-bg p {
  color: rgba(255,255,255,0.9);
  max-width: 700px;
  margin: 0 auto 2rem;
}

/* Avatars & Badges (Round Corners Rule) */
.avatar {
  border-radius: 50%;
  width: 80px;
  height: 80px;
  object-fit: cover;
  margin-bottom: 1rem;
}

.badge {
  display: inline-block;
  background: rgba(255,255,255,0.1);
  padding: 0.25rem 1rem;
  border-radius: 50px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 1rem;
}

/* Page Standard Layout */
.page-header {
  padding: 6rem 5% 3rem;
  text-align: center;
  background: var(--bg-surface);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.page-header h1 {
  font-size: 3rem;
  max-width: 800px;
  margin: 0 auto;
}

.content-wrapper {
  max-width: 800px;
  margin: 4rem auto;
  padding: 0 5%;
}

.content-wrapper h2 {
  font-size: 2rem;
  margin-top: 3rem;
}

/* Timeline */
.timeline {
  position: relative;
  max-width: 800px;
  margin: 4rem auto;
  padding: 0 5%;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  left: 5%;
  width: 2px;
  height: 100%;
  background: rgba(255,255,255,0.1);
}

.timeline-item {
  position: relative;
  padding-left: 3rem;
  margin-bottom: 3rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-primary);
}

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

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.form-control {
  width: 100%;
  padding: 1rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-primary);
  font-family: var(--font-family);
  border-radius: 0;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-primary);
}

textarea.form-control {
  min-height: 200px;
  resize: vertical;
}

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

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}

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

th {
  color: var(--text-primary);
  font-weight: bold;
}

/* Scroll Reveals */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.7s var(--ease-kinetic);
}

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

/* Footer */
footer {
  background: #000;
  padding: 4rem 5% 2rem;
  border-top: 1px solid rgba(255,255,255,0.05);
}

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

.footer-col h4 {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}

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

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

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

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

.footer-bottom {
  text-align: left;
  border-top: 1px solid rgba(255,255,255,0.05);
  padding-top: 2rem;
  font-size: 0.8rem;
  color: rgba(192, 196, 204, 0.5);
  max-width: 1200px;
  margin: 0 auto;
}

/* Media Queries */
@media (min-width: 769px) {
  .desktop-nav {
    display: block;
  }
  .mobile-nav-toggle {
    display: none;
  }
  .timeline::before {
    left: 50%;
  }
  .timeline-item {
    width: 50%;
    padding-left: 0;
    padding-right: 3rem;
    text-align: right;
  }
  .timeline-item:nth-child(even) {
    margin-left: 50%;
    padding-right: 0;
    padding-left: 3rem;
    text-align: left;
  }
  .timeline-item::before {
    left: auto;
    right: -6px;
  }
  .timeline-item:nth-child(even)::before {
    left: -6px;
  }
}

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