/* Main Stylesheet - CS/IS 260 */

:root {
  --bg-page: #f5f3ee;
  --bg-surface: #ffffff;
  --bg-subtle: #ebe7de;
  --ink-primary: #1a211e;
  --ink-secondary: #4a5550;
  --ink-muted: #6c7772;
  --accent-forest: #1f4e3d;
  --accent-rust: #a63d2b;
  --accent-amber: #b87324;
  --border-hairline: #d6d1c7;
  --radius: 6px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-page);
  color: var(--ink-primary);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* Header */
.site-header {
  background-color: var(--accent-forest);
  color: #f7f6f2;
  padding: 16px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 3px solid var(--accent-amber);
}

.brand {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.tagline {
  font-size: 0.85rem;
  color: #cbd8d2;
  font-weight: 500;
}

/* Page layout */
.layout-container {
  max-width: 1200px;
  margin: 32px auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 32px;
  align-items: start;
}

/* Sidebar */
.sidebar {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius);
  padding: 18px 14px;
  position: sticky;
  top: 24px;
}

.sidebar h3 {
  margin: 0 0 12px 10px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-muted);
}

.sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar li + li {
  margin-top: 2px;
}

.sidebar a {
  display: block;
  padding: 8px 12px;
  text-decoration: none;
  color: var(--ink-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 4px;
  border-left: 3px solid transparent;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.sidebar a:hover {
  background-color: var(--bg-page);
  color: var(--ink-primary);
}

.sidebar a.active {
  background-color: #eaf0ed;
  color: var(--accent-forest);
  font-weight: 700;
  border-left-color: var(--accent-forest);
}

/* Main content */
.content {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius);
  padding: 40px 48px;
  box-shadow: 0 1px 3px rgba(26, 33, 30, 0.04);
}

/* Typography & hero */
.hero {
  border-bottom: 2px solid var(--ink-primary);
  padding-bottom: 20px;
  margin-bottom: 28px;
}

.hero h1 {
  margin: 0 0 8px 0;
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--ink-primary);
}

.byline {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent-forest);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.lead {
  font-size: 1.12rem;
  color: var(--ink-secondary);
  background: var(--bg-page);
  border-left: 4px solid var(--accent-forest);
  padding: 18px 22px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 24px 0 36px 0;
}

h2 {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 38px 0 12px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-hairline);
  color: var(--ink-primary);
}

h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 8px 0;
}

p {
  margin: 0 0 16px 0;
}

a {
  color: var(--accent-forest);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--accent-rust);
}

/* Figures */
figure {
  margin: 24px 0;
  padding: 12px;
  background: var(--bg-page);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius);
}

figure img {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  border-radius: 4px;
}

figcaption {
  margin-top: 10px;
  font-size: 0.83rem;
  color: var(--ink-muted);
  font-style: italic;
}

/* Hazard cards */
.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
  margin: 20px 0 32px 0;
}

.card {
  background: var(--bg-page);
  border: 1px solid var(--border-hairline);
  border-top: 4px solid var(--accent-rust);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card h3 {
  color: var(--accent-rust);
  font-size: 1.15rem;
}

.card p {
  font-size: 0.94rem;
  color: var(--ink-secondary);
}

.card figure {
  margin: 12px 0 0 0;
  padding: 8px;
  background: var(--bg-surface);
}

.card figure img {
  height: 170px;
}

/* Environmental impact list */
.impact {
  list-style: none;
  padding: 0;
  margin: 16px 0 32px 0;
  display: grid;
  gap: 14px;
}

.impact > li {
  background: var(--bg-page);
  border: 1px solid var(--border-hairline);
  border-left: 4px solid var(--accent-amber);
  border-radius: var(--radius);
  padding: 16px 20px;
}

.impact > li h3 {
  color: var(--ink-primary);
  margin-bottom: 6px;
}

.impact ul {
  padding-left: 20px;
  margin: 0;
  color: var(--ink-secondary);
}

/* Process steps */
.steps {
  list-style: none;
  counter-reset: step-counter;
  padding: 0;
  margin: 18px 0 32px 0;
}

.steps li {
  counter-increment: step-counter;
  position: relative;
  padding: 12px 16px 12px 48px;
  margin-bottom: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius);
}

.steps li::before {
  content: counter(step-counter);
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  background: var(--accent-forest);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 0.92rem;
}

th {
  background-color: var(--accent-forest);
  color: #ffffff;
  font-weight: 600;
  padding: 12px 14px;
  border: 1px solid var(--accent-forest);
}

td {
  padding: 11px 14px;
  border: 1px solid var(--border-hairline);
  color: var(--ink-secondary);
}

tr:nth-child(even) td {
  background-color: var(--bg-page);
}

/* Forms */
input[type="text"],
input[type="email"],
input[type="number"],
select,
textarea {
  width: 100%;
  max-width: 520px;
  padding: 10px 12px;
  margin-top: 6px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--ink-primary);
  background: var(--bg-page);
  border: 1px solid var(--border-hairline);
  border-radius: 4px;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent-forest);
  background: #ffffff;
}

button,
input[type="submit"] {
  background-color: var(--accent-forest);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

button:hover,
input[type="submit"]:hover {
  background-color: #163a2d;
}

/* Timeline & FAQ */
.history-box {
  background: var(--bg-page);
  border: 1px solid var(--border-hairline);
  border-left: 5px solid var(--accent-forest);
  border-radius: var(--radius);
  padding: 24px;
  margin: 20px 0;
}

.hist-icon {
  font-size: 2.2rem;
  margin-bottom: 8px;
}

input[type="range"] {
  width: 100%;
  max-width: 420px;
  accent-color: var(--accent-forest);
  margin: 10px 0 14px 0;
}

details {
  background: var(--bg-page);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 12px;
}

summary {
  cursor: pointer;
  color: var(--ink-primary);
}

details p {
  margin-top: 10px;
  color: var(--ink-secondary);
}

hr {
  border: none;
  border-top: 1px solid var(--border-hairline);
  margin: 28px 0;
}

/* Mobile */
@media (max-width: 860px) {
  .layout-container {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
  }
  .cards {
    grid-template-columns: 1fr;
  }
  .content {
    padding: 24px 20px;
  }
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}