/* ===== Reset & Base ===== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --color-primary: #2d6a4f;
  --color-primary-dark: #1b4332;
  --color-primary-light: #40916c;
  --color-accent: #52b788;
  --color-accent-light: #95d5b2;
  --color-bg: #fafcfa;
  --color-surface: #ffffff;
  --color-text: #1a1a2e;
  --color-text-muted: #555b6e;
  --color-border: #d8e2dc;
  --color-code-bg: #1e1e2e;
  --color-code-text: #cdd6f4;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
  --radius: 10px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Cascadia Code", "Fira Code", "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;
  --max-width: 1100px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.7;
  font-size: 16px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

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

img {
  max-width: 100%;
  height: auto;
}

/* ===== Navigation ===== */
.navbar {
  background: var(--color-primary-dark);
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
}

.navbar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.navbar .brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #fff;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.navbar .brand img {
  height: 36px;
  width: auto;
}

.navbar .brand:hover {
  color: var(--color-accent-light);
}

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

.nav-links a {
  color: rgba(255, 255, 255, 0.85);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  margin: 5px 0;
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

/* ===== Hero Section ===== */
.hero {
  background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 50%, var(--color-primary-light) 100%);
  color: #fff;
  padding: 4rem 2rem;
  text-align: center;
}

.hero h1 {
  font-size: 2.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
}

.hero p {
  font-size: 1.2rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ===== Page Header (for inner pages) ===== */
.page-header {
  background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
  color: #fff;
  padding: 2.5rem 2rem;
}

.page-header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

/* ===== Breadcrumbs ===== */
.breadcrumbs {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 2rem 0;
  font-size: 0.85rem;
}

.breadcrumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0;
  margin: 0;
}

.breadcrumbs li {
  display: flex;
  align-items: center;
  color: var(--color-text-muted);
}

.breadcrumbs li + li::before {
  content: "/";
  margin-right: 0.4rem;
  color: var(--color-border);
}

.breadcrumbs a {
  color: var(--color-primary);
  font-weight: 500;
}

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

.page-header h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.page-header p {
  opacity: 0.85;
  margin-top: 0.5rem;
  font-size: 1.05rem;
}

/* ===== Main Content ===== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 2rem;
  flex: 1;
}

/* ===== Section Headings ===== */
.section-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid var(--color-accent);
  display: inline-block;
}

/* ===== Feature Cards ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

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

.card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  margin-bottom: 0.5rem;
}

.card .badge {
  display: inline-block;
  background: var(--color-accent-light);
  color: var(--color-primary-dark);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  margin-bottom: 0.75rem;
  width: fit-content;
}

.card p {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  flex: 1;
}

.card .card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-primary);
}

.card .card-link:hover {
  color: var(--color-accent);
}

.card .card-link::after {
  content: "→";
  transition: transform 0.2s;
}

.card .card-link:hover::after {
  transform: translateX(3px);
}

/* ===== Code Block ===== */
.code-block {
  background: var(--color-code-bg);
  color: var(--color-code-text);
  border-radius: var(--radius);
  padding: 1.5rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.8;
  box-shadow: var(--shadow-sm);
  margin: 1rem 0;
}

.code-block code {
  white-space: pre;
}

/* ===== Content Sections ===== */
.content-section {
  margin-bottom: 2rem;
}

.content-section h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  margin-bottom: 0.75rem;
}

.content-section h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.5rem;
}

.content-section p {
  color: var(--color-text-muted);
  margin-bottom: 0.75rem;
}

.content-section ul {
  list-style: none;
  padding: 0;
}

.content-section ul li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--color-border);
}

.content-section ul li:last-child {
  border-bottom: none;
}

.content-section ul li a {
  font-weight: 500;
}

/* ===== Contact Card ===== */
.contact-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 500px;
  box-shadow: var(--shadow-sm);
}

.contact-card h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  margin-bottom: 0.75rem;
}

.contact-card p {
  color: var(--color-text-muted);
}

.contact-card a {
  font-weight: 600;
}

/* ===== Related Projects ===== */
.related-projects {
  margin-top: 1rem;
}

.related-projects iframe {
  border: none;
  border-radius: var(--radius);
  width: 100%;
  height: 220px;
}

/* ===== Footer ===== */
.site-footer {
  background: var(--color-primary-dark);
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
  padding: 1.5rem 2rem;
  font-size: 0.85rem;
  margin-top: auto;
}

.site-footer a {
  color: var(--color-accent-light);
}

.site-footer a:hover {
  color: #fff;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--color-primary-dark);
    flex-direction: column;
    padding: 1rem;
    box-shadow: var(--shadow-md);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    padding: 0.75rem 1rem;
  }

  .hero {
    padding: 3rem 1.5rem;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero p {
    font-size: 1.05rem;
  }

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

  .container {
    padding: 1.5rem 1rem;
  }

  .page-header {
    padding: 2rem 1.5rem;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.75rem;
  }

  .card {
    padding: 1.25rem;
  }
}
