/* Basic reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, sans-serif;
  color: #222;
  background-color: #f7f7f9;
  line-height: 1.6;
}

/* Layout helpers */
.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.four-cols {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* DESKTOP DEFAULTS – header & nav */
.site-header {
  position: relative;         /* anchor mobile dropdown */
  background: #ffffff;
  z-index: 100;
}

.site-header .header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
}

/* Logo */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: inherit;
  text-decoration: none;
  border-bottom: none;
}

.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ffffff;
  background-color: #1e4e8c;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  border-bottom: none;
}

.logo-text {
  font-weight: 600;
  font-size: 0.95rem;
  color: #222;
  border-bottom: none;
}

.logo:hover,
.logo:focus {
  text-decoration: none;
  border-bottom: none;
}

/* Desktop nav: horizontal list */
.nav {
  display: flex;
  gap: 1rem;
  font-size: 0.9rem;
  align-items: center;
}

/* Hamburger base – hidden on desktop */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  padding: 0.35rem;
  border: none;
  background: transparent;
  cursor: pointer;
}

.nav-toggle-bar {
  width: 22px;
  height: 2px;
  border-radius: 999px;
  background: #111827;
}

.nav-toggle-bar + .nav-toggle-bar {
  margin-top: 5px;
}

/* Nav links */
.nav a {
  text-decoration: none;
  color: #444;
  padding: 0.25rem 0.4rem;
  border-radius: 4px;
}

.nav a:hover {
  background-color: #eef2f8;
  color: #1e4e8c;
}

/* Active nav item */
.nav a[aria-current="page"] {
  background-color: #eef2f8;
  color: #1e4e8c;
  font-weight: 600;
}

.nav a[aria-current="page"]:hover {
  background-color: #e0e7f5;
  color: #1e4e8c;
}

/* Hero */
.hero {
  background-color: #f0f4fb;
  border-bottom: 1px solid #dde3f0;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.2fr);
  gap: 2rem;
  padding: 3rem 0;
}

.hero h1 {
  font-size: 2.2rem;
  line-height: 1.2;
  margin: 0 0 1rem;
  color: #12233a;
}

.hero p {
  margin: 0 0 1.5rem;
  color: #3b4251;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero-aside {
  display: flex;
  align-items: stretch;
}

.hero-card {
  background-color: #ffffff;
  border-radius: 12px;
  border: 1px solid #dde3f0;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.03);
}

.hero-card h2 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
}

/* Sections */
.section {
  padding: 3rem 0;
  background-color: #f7f7f9;
}

.section.muted {
  background-color: #ffffff;
}

.section-header {
  max-width: 640px;
  margin-bottom: 2rem;
}

.section-header h2 {
  margin: 0 0 0.5rem;
  font-size: 1.6rem;
  color: #1a2533;
}

.section-header p {
  margin: 0;
  color: #555;
  font-size: 0.98rem;
}

/* Grid */
.grid {
  display: grid;
  gap: 1.5rem;
}

.three-cols {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.two-cols {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* Cards & boxes */
.card {
  background-color: #ffffff;
  border-radius: 10px;
  border: 1px solid #e2e2e8;
  padding: 1.25rem 1.4rem;
}

.card h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1rem;
  color: #1a2533;
}

.card p {
  margin: 0;
  font-size: 0.95rem;
  color: #555;
}

.card.bare {
  background-color: transparent;
  border-style: dashed;
}

.highlight-box {
  background-color: #ffffff;
  border-radius: 10px;
  border: 1px solid #d0d7e6;
  padding: 1.25rem 1.4rem;
}

.highlight-box h3 {
  margin-top: 0;
}

/* Lists */
.bullet-list {
  padding-left: 1.1rem;
  margin: 0.5rem 0 0;
  font-size: 0.95rem;
  color: #555;
}

.bullet-list li + li {
  margin-top: 0.25rem;
}

/* Buttons & links */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.3rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn.primary {
  background-color: #1e4e8c;
  color: #ffffff;
  border-color: #1e4e8c;
}

.btn.primary:hover {
  background-color: #173b69;
  border-color: #173b69;
}

.btn.ghost {
  background-color: transparent;
  color: #1e4e8c;
  border-color: #c1d0ea;
}

.btn.ghost:hover {
  background-color: #eff3fb;
}

.text-link {
  font-size: 0.92rem;
  color: #1e4e8c;
  text-decoration: none;
}

.text-link:hover {
  text-decoration: underline;
}

/* News */
.news-list {
  display: grid;
  gap: 1rem;
}

.news-item {
  border-left: 3px solid #d0d7e6;
  padding-left: 1rem;
}

.news-item h3 {
  margin: 0 0 0.3rem;
  font-size: 1rem;
  color: #1a2533;
}

.news-item p {
  margin: 0;
  font-size: 0.93rem;
  color: #555;
}

.section-footer {
  margin-top: 1.5rem;
}

/* Footer */
.site-footer {
  background-color: #111827;
  color: #d1d5db;
  padding-top: 2rem;
  margin-top: 2rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #374151;
}

.footer-copy {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  max-width: 260px;
}

.site-footer .logo-text {
  color: #e5e7eb;
}

.site-footer .logo-mark {
  background-color: #2563eb;
}

.footer-right {
  display: flex;
  gap: 2rem;
}

.footer-col h4 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9ca3af;
}

.footer-col a {
  display: block;
  font-size: 0.9rem;
  color: #e5e7eb;
  text-decoration: none;
  margin-bottom: 0.25rem;
}

.footer-col a:hover {
  text-decoration: underline;
}

.footer-bottom {
  padding: 0.9rem 0 1.5rem;
  font-size: 0.8rem;
  color: #9ca3af;
}

/* Responsive tweaks */
@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }

  .grid.three-cols {
    grid-template-columns: 1fr 1fr;
  }

  .grid.four-cols {
    grid-template-columns: 1fr 1fr;
  }

  .site-header .header-inner {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

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

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

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

/* Mobile padding fix */
@media (max-width: 768px) {

  /* show hamburger on mobile */
  .nav-toggle {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    padding: 0.35rem;
    background: transparent;
    border: none;
    cursor: pointer;
  }

  .nav-toggle-bar {
    width: 22px;
    height: 2px;
    background: #111827;
    border-radius: 999px;
  }

  .nav-toggle-bar + .nav-toggle-bar {
    margin-top: 5px;
  }

  .site-header .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;

    display: none;              /* hidden until toggled open */
    flex-direction: column;
    gap: 0;                     /* kill desktop gap */
    align-items: stretch;       /* full-width items */

    padding: 0.5rem 1rem 0.75rem;
    margin: 0;
    background: #ffffff;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.18);
    z-index: 50;
  }

  /* open state */
  .site-header .nav.is-open {
    display: flex;
  }

  .site-header .nav a {
    display: block;
    width: 100%;
    padding: 0.7rem 0;
    margin: 0;

    text-align: left;           /* not centred */
    border-radius: 0;           /* no little pill */
    background: transparent;    /* clean background */
    border-bottom: 1px solid rgba(148,163,184,0.3);
  }

  .site-header .nav a:last-child {
    border-bottom: none;
  }

  /* Optional: nicer hover / current state on mobile */
  .site-header .nav a:hover {
    background: #f3f4f6;
  }

  .site-header .nav a[aria-current="page"] {
    font-weight: 600;
    color: #1e4e8c;
    background: #f3f4f6;
  }
}

@media (max-width: 640px) {
  .grid.four-cols,
  .grid.three-cols,
  .grid.two-cols {
    grid-template-columns: 1fr;
  }

  .hero-inner {
    padding: 2.25rem 0;
  }

  .nav {
    justify-content: flex-start;
  }
}

/* Force logo to never be underlined */
a.logo,
a.logo:link,
a.logo:visited,
a.logo:hover,
a.logo:focus,
a.logo * {
  text-decoration: none !important;
  border-bottom: none !important;
}

.hero.architecture { background-color: #f0f4fb; border-left: 4px solid #1e4e8c; }
.hero.crabok       { background-color: #edf7f5; border-left: 4px solid #2f7f6f; }
.hero.maturity     { background-color: #f5f0fb; border-left: 4px solid #6b4fb8; }
.hero.certification{ background-color: #fef9ec; border-left: 4px solid #d9a441; }
.hero.about        { background-color: #f2f4f7; border-left: 4px solid #5b6b80; }
.hero.home         { background-color: #e9edf2; border-left: 4px solid #4b5565; }

.page-architecture::before,
.page-crabok::before,
.page-maturity::before,
.page-certification::before,
.page-about::before,
.page-home::before {
  content: "";
  display: block;
  height: 4px;
}

.page-architecture::before { background-color: #1e4e8c; }
.page-crabok::before       { background-color: #2f7f6f; }
.page-maturity::before     { background-color: #6b4fb8; }
.page-certification::before{ background-color: #d9a441; }
.page-about::before        { background-color: #5b6b80; }
.page-home::before         { background-color: #4b5565; }

.section.alt {
  background-color: #f1f3f6;
}

.architecture-figure {
  text-align: center;
  margin: 2rem 0;
}

.architecture-figure img.responsive-diagram {
  max-width: 100%;
  height: auto;
}

.architecture-figure figcaption {
  font-size: 0.9rem;
  color: #555;
  margin-top: 0.5rem;
}

.card h4,
.card h3 {
  margin-top: 1rem;      /* or 0.75rem if you want it tighter */
  margin-bottom: 0.5rem;
}

.card h4:first-child,
.card h3:first-child {
  margin-top: 0;   /* avoids double-padding at the start of the card */
}
