/* ==================================================================
   Variables
   ================================================================== */
:root {
  /* Color palette */
  --color-background: #0f1722; /* deep slate blue / charcoal */
  --color-surface: #111827;
  --color-surface-alt: #1f2933;
  --color-text: #e5e7eb; /* light gray text */
  --color-text-muted: #9ca3af;
  --color-border: #2d3748;

  --color-primary: #1f4f7a; /* deep slate blue */
  --color-primary-soft: rgba(31, 79, 122, 0.1);
  --color-primary-strong: #163554;

  --color-accent-sandstone: #c49a6c; /* earthy sandstone */
  --color-accent-green: #1f6f4a;     /* forest green */
  --color-accent-copper: #b87436;    /* copper-bronze */

  --color-success: #22c55e;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;

  --color-neutral-50: #f9fafb;
  --color-neutral-100: #f3f4f6;
  --color-neutral-200: #e5e7eb;
  --color-neutral-300: #d1d5db;
  --color-neutral-400: #9ca3af;
  --color-neutral-500: #6b7280;
  --color-neutral-600: #4b5563;
  --color-neutral-700: #374151;
  --color-neutral-800: #1f2933;
  --color-neutral-900: #111827;

  /* Typography */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji",
    "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  --font-mono: "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;

  --font-size-xs: 0.75rem;   /* 12px */
  --font-size-sm: 0.875rem;  /* 14px */
  --font-size-md: 1rem;      /* 16px */
  --font-size-lg: 1.125rem;  /* 18px */
  --font-size-xl: 1.25rem;   /* 20px */
  --font-size-2xl: 1.5rem;   /* 24px */
  --font-size-3xl: 1.875rem; /* 30px */
  --font-size-4xl: 2.25rem;  /* 36px */

  --line-height-tight: 1.15;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.7;

  /* Spacing scale (0–96px) */
  --space-0: 0;
  --space-1: 0.25rem;  /* 4px */
  --space-2: 0.5rem;   /* 8px */
  --space-3: 0.75rem;  /* 12px */
  --space-4: 1rem;     /* 16px */
  --space-5: 1.25rem;  /* 20px */
  --space-6: 1.5rem;   /* 24px */
  --space-8: 2rem;     /* 32px */
  --space-10: 2.5rem;  /* 40px */
  --space-12: 3rem;    /* 48px */
  --space-16: 4rem;    /* 64px */
  --space-20: 5rem;    /* 80px */
  --space-24: 6rem;    /* 96px */

  /* Radius */
  --radius-sm: 0.25rem;  /* 4px */
  --radius-md: 0.5rem;   /* 8px */
  --radius-lg: 0.75rem;  /* 12px */
  --radius-xl: 1rem;     /* 16px */
  --radius-full: 9999px;

  /* Shadows (subtle, technical; avoid overly soft/glowy) */
  --shadow-xs: 0 0 0 1px rgba(15, 23, 42, 0.8);
  --shadow-sm: 0 8px 18px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 16px 40px rgba(0, 0, 0, 0.45);

  /* Transitions */
  --transition-fast: 120ms ease-out;
  --transition-normal: 180ms ease-out;
  --transition-slow: 260ms ease-out;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --transition-fast: 0ms;
    --transition-normal: 0ms;
    --transition-slow: 0ms;
  }
}

/* ==================================================================
   Reset / Normalize
   ================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  margin: 0;
  padding: 0;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
}

h1, h2, h3, h4, h5, h6,
p, figure, blockquote,
dl, dd {
  margin: 0;
}

ul[class],
ol[class] {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  text-decoration: none;
  color: inherit;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

input,
button,
textarea,
select {
  margin: 0;
  font: inherit;
  color: inherit;
}

button {
  border: none;
  background: none;
  padding: 0;
}

textarea {
  resize: vertical;
}

/* Remove default focus outlines; reintroduce with :focus-visible */
:focus {
  outline: none;
}

/* ==================================================================
   Base Styles
   ================================================================== */
body {
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--font-size-md);
  line-height: var(--line-height-normal);
  background-color: var(--color-background);
  color: var(--color-text);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

main {
  display: block;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: var(--line-height-tight);
  color: #f9fafb;
}

h1 {
  font-size: clamp(2.25rem, 4vw, 3rem);
  letter-spacing: 0.02em;
  margin-bottom: var(--space-4);
}

h2 {
  font-size: clamp(1.875rem, 3vw, 2.25rem);
  margin-bottom: var(--space-3);
}

h3 {
  font-size: 1.5rem;
  margin-bottom: var(--space-2);
}

h4 {
  font-size: 1.25rem;
  margin-bottom: var(--space-2);
}

h5 {
  font-size: 1.125rem;
  margin-bottom: var(--space-1);
}

h6 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-1);
}

p {
  margin-bottom: var(--space-3);
  color: var(--color-text);
}

p.lead {
  font-size: var(--font-size-lg);
  line-height: var(--line-height-relaxed);
  color: var(--color-neutral-100);
}

strong {
  font-weight: 600;
}

code, pre {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

pre {
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background-color: #020617;
  overflow-x: auto;
}

/* Links */
a {
  color: var(--color-accent-sandstone);
  text-decoration: none;
  transition: color var(--transition-fast),
    text-decoration-color var(--transition-fast),
    background-color var(--transition-fast);
}

a:hover {
  color: var(--color-accent-copper);
}

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

/* Lists */
ul,
ol {
  margin-left: 1.25rem;
  margin-bottom: var(--space-3);
}

li + li {
  margin-top: 0.25rem;
}

/* ==================================================================
   Accessibility & Motion
   ================================================================== */
:focus-visible {
  outline: 2px solid var(--color-accent-green);
  outline-offset: 3px;
}

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

/* Screen-reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==================================================================
   Utilities
   ================================================================== */
/* Container */
.container {
  width: 100%;
  margin-right: auto;
  margin-left: auto;
  padding-right: var(--space-4);
  padding-left: var(--space-4);
  max-width: 1120px; /* suitable for detailed diagrams & content */
}

@media (min-width: 1280px) {
  .container {
    max-width: 1200px;
  }
}

/* Layout helpers */
.flex {
  display: flex;
}

.inline-flex {
  display: inline-flex;
}

.flex-row {
  flex-direction: row;
}

.flex-column {
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

.items-center {
  align-items: center;
}

.items-start {
  align-items: flex-start;
}

.items-end {
  align-items: flex-end;
}

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

.justify-between {
  justify-content: space-between;
}

.justify-end {
  justify-content: flex-end;
}

.gap-sm {
  gap: var(--space-2);
}

.gap-md {
  gap: var(--space-4);
}

.gap-lg {
  gap: var(--space-6);
}

.grid {
  display: grid;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-6);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-6);
}

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

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.mt-0 { margin-top: 0; }
.mt-sm { margin-top: var(--space-2); }
.mt-md { margin-top: var(--space-4); }
.mt-lg { margin-top: var(--space-6); }
.mt-xl { margin-top: var(--space-8); }

.mb-0 { margin-bottom: 0; }
.mb-sm { margin-bottom: var(--space-2); }
.mb-md { margin-bottom: var(--space-4); }
.mb-lg { margin-bottom: var(--space-6); }
.mb-xl { margin-bottom: var(--space-8); }

.py-section {
  padding-top: var(--space-16);
  padding-bottom: var(--space-16);
}

@media (max-width: 768px) {
  .py-section {
    padding-top: var(--space-10);
    padding-bottom: var(--space-10);
  }
}

/* ==================================================================
   Components
   ================================================================== */
/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.3rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-weight: 500;
  font-size: var(--font-size-sm);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  background-color: var(--color-primary);
  color: #f9fafb;
  box-shadow: var(--shadow-xs);
  transition:
    background-color var(--transition-normal),
    border-color var(--transition-normal),
    color var(--transition-normal),
    box-shadow var(--transition-fast),
    transform var(--transition-fast);
}

.btn:hover {
  background-color: var(--color-primary-strong);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-xs);
}

.btn:focus-visible {
  outline: 2px solid var(--color-accent-copper);
  outline-offset: 3px;
}

.btn--secondary {
  background-color: transparent;
  color: var(--color-accent-sandstone);
  border-color: var(--color-accent-sandstone);
}

.btn--secondary:hover {
  background-color: rgba(196, 154, 108, 0.08);
}

.btn--ghost {
  background-color: transparent;
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn--ghost:hover {
  background-color: rgba(15, 23, 34, 0.9);
}

.btn--danger {
  background-color: var(--color-danger);
}

.btn--danger:hover {
  background-color: #b91c1c;
}

.btn[disabled],
.btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  box-shadow: none;
  transform: none;
}

/* Form controls */
.input,
select,
textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background-color: #020617;
  color: var(--color-text);
  font-size: var(--font-size-sm);
  line-height: 1.4;
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    background-color var(--transition-fast);
}

.input::placeholder,
textarea::placeholder {
  color: var(--color-text-muted);
}

.input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: var(--color-accent-green);
  box-shadow: 0 0 0 1px var(--color-accent-green);
}

input[readonly],
textarea[readonly] {
  background-color: #020617;
  opacity: 0.9;
}

input[disabled],
textarea[disabled],
select[disabled] {
  cursor: not-allowed;
  opacity: 0.6;
}

label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 500;
  margin-bottom: 0.35rem;
  color: var(--color-neutral-100);
}

.form-group {
  margin-bottom: var(--space-4);
}

.form-help {
  margin-top: 0.25rem;
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

.form-error {
  margin-top: 0.25rem;
  font-size: var(--font-size-xs);
  color: var(--color-danger);
}

/* Card - for service summaries, case studies, etc. */
.card {
  position: relative;
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at top left, rgba(196, 154, 108, 0.12), transparent 55%),
    linear-gradient(135deg, #020617, #020617 30%, #020617 100%);
  border: 1px solid rgba(148, 163, 184, 0.28);
  box-shadow: var(--shadow-sm);
  padding: var(--space-5);
}

.card--surface-alt {
  background: linear-gradient(135deg, #020617, #020617 40%, #020617 100%);
}

.card-header {
  margin-bottom: var(--space-3);
}

.card-title {
  font-size: var(--font-size-xl);
  margin-bottom: 0.25rem;
}

.card-subtitle {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.card-body {
  font-size: var(--font-size-sm);
  color: var(--color-text);
}

/* Subtle border-top accent useful for technical content blocks */
.card--accent::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 2px;
  border-radius: var(--radius-full) var(--radius-full) 0 0;
  background: linear-gradient(90deg, var(--color-accent-green), var(--color-accent-copper));
}

/* Badges - for service tags, disciplines (Geotechnical, Environmental, etc.) */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  background-color: rgba(15, 23, 42, 0.8);
}

.badge--primary {
  border-color: rgba(31, 79, 122, 0.9);
  color: var(--color-accent-sandstone);
}

.badge--success {
  border-color: var(--color-accent-green);
  color: #bbf7d0;
}

/* Tables - for reporting figures, borehole logs, etc. */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
}

.table thead {
  background-color: #020617;
}

.table th,
.table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid rgba(51, 65, 85, 0.9);
}

.table th {
  font-weight: 600;
  text-align: left;
  color: var(--color-neutral-100);
}

.table tbody tr:nth-child(even) {
  background-color: rgba(15, 23, 42, 0.7);
}

.table tbody tr:hover {
  background-color: rgba(15, 23, 42, 0.95);
}

/* Callout / alert - for key notices, compliance, etc. */
.callout {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.14), rgba(15, 23, 42, 0.96));
  font-size: var(--font-size-sm);
}

.callout--warning {
  border-color: rgba(234, 179, 8, 0.9);
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.12), rgba(15, 23, 42, 0.96));
}

.callout--danger {
  border-color: rgba(239, 68, 68, 0.9);
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.12), rgba(15, 23, 42, 0.96));
}

/* Hero overlay utility for imagery of fieldwork, drilling, etc. */
.hero-overlay {
  position: relative;
}

.hero-overlay::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top left, rgba(31, 79, 122, 0.45), transparent 60%),
    linear-gradient(to bottom, rgba(15, 23, 42, 0.65), rgba(15, 23, 42, 0.95));
  pointer-events: none;
}

.hero-overlay > * {
  position: relative;
  z-index: 1;
}

/* Tagline / chip for discipline descriptors */
.chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-muted);
  border: 1px solid rgba(148, 163, 184, 0.7);
  background-color: rgba(15, 23, 42, 0.9);
}

.chip--primary {
  border-color: rgba(31, 79, 122, 1);
  color: var(--color-accent-sandstone);
}

/* Footer base styling (for contact info & credentials) */
.footer-base {
  border-top: 1px solid rgba(51, 65, 85, 0.9);
  padding-top: var(--space-8);
  padding-bottom: var(--space-8);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}
