:root {
  --bg-canvas: #0d2a33;
  --bg-surface: #163c45;
  --bg-surface-alt: #10252b;
  --text-primary: #e0f2f1;
  --text-muted: #93b4bc;
  --accent-primary: #ff6f59;
  --accent-hover: #fa553c;
  --border-subtle: rgba(224, 242, 241, 0.18);
  --border-strong: rgba(224, 242, 241, 0.4);
  --shadow-panel: 0 10px 30px rgba(0, 0, 0, 0.35);
  --font-serif: Georgia, "Times New Roman", serif;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Consolas, monospace;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.6;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-color: var(--bg-canvas);
}

.skip-link {
  position: absolute;
  top: -999px;
  left: 1rem;
  background: var(--accent-primary);
  color: #0d2a33;
  padding: 0.5rem 1rem;
  font-weight: 700;
  z-index: 1000;
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
}

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

a:hover, a:focus-visible {
  color: #ffffff;
}

:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 3px;
}

/* Site Header */
.site-header {
  position: relative;
  width: 100%;
  background: transparent;
  border-bottom: 1px solid var(--border-subtle);
  padding: 12px 1.5rem;
  transition: background-color 0.25s ease;
  z-index: 200;
}

.site-header.scrolled {
  background-color: var(--bg-canvas);
}

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

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
  margin-right: auto;
}

.brand-mark {
  display: inline-block;
  width: 14px;
  height: 14px;
  background-color: var(--accent-primary);
  border-radius: 0;
}

.brand-name {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

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

.nav-list {
  display: flex;
  list-style: none;
  gap: 1.25rem;
}

.nav-link {
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-primary);
  text-decoration: none;
  padding: 0.35rem 0.2rem;
  border-bottom: 2px solid transparent;
}

.nav-link:hover, .nav-link[aria-current="page"] {
  border-bottom-color: var(--accent-primary);
  color: #ffffff;
}

.mobile-nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 0.4rem 0.75rem;
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
}

/* Layout containers */
main {
  flex: 1 0 auto;
  width: 100%;
}

.section-wrapper {
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 4.5rem) 1.5rem;
}

.reading-column {
  max-width: 72ch;
  margin: 0 auto;
}

/* Hero Section */
.hero-console {
  position: relative;
  min-height: 75vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 1.5rem;
  background-color: #06161b;
  overflow: hidden;
}

.hero-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.38;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(13, 42, 51, 0.6) 0%, rgba(9, 24, 30, 0.95) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 860px;
  margin: 0 auto;
}

.hero-tag {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent-primary);
  margin-bottom: 1rem;
  display: inline-block;
  background: rgba(13, 42, 51, 0.8);
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--border-subtle);
}

.hero-h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.2rem, 5.5vw, 3.8rem);
  font-weight: 400;
  line-height: 1.15;
  color: #ffffff;
  margin-bottom: 1.5rem;
  text-wrap: balance;
}

.hero-lead {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--text-muted);
  max-width: 68ch;
  margin: 0 auto 2rem;
  line-height: 1.65;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0.85rem 1.75rem;
  border-radius: 0;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 48px;
}

.btn-primary {
  background-color: var(--accent-primary);
  color: #0d2a33;
  border: 2px solid var(--accent-primary);
}

.btn-primary:hover, .btn-primary:focus-visible {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #06161b;
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 2px solid var(--border-strong);
}

.btn-outline:hover, .btn-outline:focus-visible {
  border-color: var(--accent-primary);
  color: #ffffff;
  background: rgba(255, 111, 89, 0.08);
}

.btn-petrol {
  background-color: #0d2a33;
  color: #e0f2f1;
  border: 2px solid #0d2a33;
}

.btn-petrol:hover {
  background-color: #06161b;
  color: #ffffff;
}

/* Stat strip */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1px;
  background-color: var(--border-subtle);
  border: 1px solid var(--border-subtle);
  margin: 2.5rem 0;
}

.stat-cell {
  background-color: var(--bg-surface);
  padding: 1.25rem 1.5rem;
}

.stat-num {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  color: var(--accent-primary);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Headings */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 400;
  color: #ffffff;
  line-height: 1.25;
}

h2 {
  font-size: clamp(1.75rem, 3.2vw, 2.5rem);
  margin-bottom: 1rem;
}

h3 {
  font-size: clamp(1.25rem, 2vw, 1.6rem);
  margin-bottom: 0.75rem;
}

p {
  margin-bottom: 1.25rem;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}

.lead-p {
  font-size: 1.15rem;
  line-height: 1.7;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
}

/* Grid & Cards (0px radius, borderless panels, lift on hover) */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.habitat-panel {
  background-color: var(--bg-surface);
  border: 0;
  border-radius: 0;
  box-shadow: var(--shadow-panel);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.habitat-panel:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.55);
}

.panel-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background-color: #081a20;
}

.panel-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  display: block;
}

.panel-body {
  padding: 1.75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.panel-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-primary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}

.panel-title {
  margin-bottom: 0.75rem;
  color: #ffffff;
}

.panel-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  flex-grow: 1;
  margin-bottom: 1.25rem;
}

.panel-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-subtle);
  padding-top: 1rem;
}

/* Coral Blocks (full width, petrol text) */
.coral-block {
  background-color: var(--accent-primary);
  color: #0d2a33;
  padding: clamp(2.5rem, 5vw, 4rem) 1.5rem;
  margin: 3rem 0;
}

.coral-container {
  max-width: 1280px;
  margin: 0 auto;
}

.coral-block h2, .coral-block h3, .coral-block p, .coral-block .stat-num {
  color: #0d2a33;
}

.coral-block .coral-lead {
  font-size: 1.15rem;
  font-weight: 500;
  color: #1a424e;
  max-width: 75ch;
  margin-bottom: 1.5rem;
}

.coral-block .stat-strip {
  border-color: rgba(13, 42, 51, 0.25);
  background-color: rgba(13, 42, 51, 0.25);
}

.coral-block .stat-cell {
  background-color: #ff8573;
}

.coral-block .stat-label {
  color: #0d2a33;
  font-weight: 600;
}

/* Horizontal Split Card */
.split-card {
  display: grid;
  grid-template-columns: 1fr;
  background-color: var(--bg-surface);
  margin-bottom: 2rem;
  box-shadow: var(--shadow-panel);
}

@media (min-width: 769px) {
  .split-card {
    grid-template-columns: 1fr 1fr;
  }
}

.split-card.reverse {
  direction: rtl;
}

.split-card.reverse > * {
  direction: ltr;
}

.split-media {
  aspect-ratio: 16 / 10;
  width: 100%;
  height: 100%;
}

.split-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.split-content {
  padding: clamp(1.5rem, 3vw, 2.5rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Data Table Wrapper */
.table-scroll {
  width: 100%;
  overflow-x: auto;
  margin: 2rem 0;
  border: 1px solid var(--border-subtle);
}

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

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

.data-table th {
  background-color: var(--bg-surface-alt);
  color: var(--accent-primary);
  font-family: var(--font-mono);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
}

.data-table tr:hover td {
  background-color: rgba(22, 60, 69, 0.6);
}

/* Accordion details */
details.field-accordion {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  margin-bottom: 0.75rem;
  padding: 0;
}

details.field-accordion summary {
  padding: 1.15rem 1.5rem;
  cursor: pointer;
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  list-style: none;
}

details.field-accordion summary::-webkit-details-marker {
  display: none;
}

details.field-accordion summary::after {
  content: "+";
  font-family: var(--font-mono);
  font-size: 1.25rem;
  color: var(--accent-primary);
}

details.field-accordion[open] summary::after {
  content: "−";
}

details.field-accordion .accordion-body {
  padding: 0 1.5rem 1.5rem 1.5rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
  margin-top: 0.5rem;
  padding-top: 1rem;
}

/* Form Styles */
.console-form {
  background-color: var(--bg-surface);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border: 1px solid var(--border-subtle);
}

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

.form-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.4rem;
  color: var(--text-primary);
}

.form-control {
  width: 100%;
  background-color: var(--bg-canvas);
  border: 1px solid var(--border-strong);
  border-radius: 0;
  padding: 0.75rem 1rem;
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 1rem;
}

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

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

.draft-output-panel {
  margin-top: 2rem;
  background-color: var(--bg-surface-alt);
  border: 1px solid var(--border-subtle);
  padding: 1.5rem;
}

.output-preview {
  white-space: pre-wrap;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: #c9e8ea;
  background-color: #08171d;
  padding: 1rem;
  margin: 1rem 0;
  min-height: 100px;
  border-left: 3px solid var(--accent-primary);
}

/* Site Footer */
.site-footer {
  background-color: #08171d;
  border-top: 1px solid var(--border-subtle);
  padding: 3.5rem 1.5rem 2rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

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

.footer-col h4 {
  font-size: 1.1rem;
  color: #ffffff;
  margin-bottom: 1rem;
  letter-spacing: 0.05em;
}

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

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

.footer-bottom {
  max-width: 1280px;
  margin: 0 auto;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(224, 242, 241, 0.08);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-size: 0.82rem;
}

.footer-legal-copy {
  line-height: 1.5;
}

/* Responsive Overrides */
@media (max-width: 900px) {
  .primary-nav {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    background-color: #0b2229;
    border-bottom: 2px solid var(--accent-primary);
    padding: 1.5rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.7);
    flex-direction: column;
    align-items: flex-start;
  }

  .primary-nav.is-active {
    display: flex;
  }

  .nav-list {
    flex-direction: column;
    width: 100%;
    gap: 0.75rem;
  }

  .nav-link {
    display: block;
    padding: 0.5rem 0;
    font-size: 1rem;
  }

  .mobile-nav-toggle {
    display: inline-block;
  }
}

@media (max-width: 600px) {
  .hero-console {
    min-height: 60vh;
    padding: 3rem 1rem;
  }

  .btn {
    width: 100%;
  }

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

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