:root {
  --shell-ink: #1C2421;
  --shell-muted: #4A5D54;
  --shell-brand: #0B7285;
  --shell-stroke: #EAE3D5;
  --shell-hover: rgba(11, 114, 133, 0.06);
  --shell-focus: rgba(16, 152, 173, 0.18);
  --shell-shadow: 0 4px 10px rgba(11, 114, 133, 0.2);
  --shell-transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.container {
  width: min(1160px, calc(100% - 2.5rem));
  margin: 0 auto;
}

.site-header {
  padding: 1.5rem 0;
  border-bottom: 1px solid rgba(234, 227, 213, 0.65);
  margin-bottom: 2rem;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
}

.brand {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: var(--shell-ink);
  text-decoration: none;
  transition: color var(--shell-transition);
}

.brand:hover {
  color: var(--shell-brand);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.nav a {
  text-decoration: none;
  color: var(--shell-muted);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.2;
  padding: 0.52rem 1rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  transition: var(--shell-transition);
}

.nav a:hover {
  background: var(--shell-hover);
  color: var(--shell-brand);
}

.nav a:focus-visible,
.footer-links a:focus-visible,
.brand:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--shell-focus);
}

.nav a.active,
.nav a[aria-current="page"] {
  background: var(--shell-brand);
  color: #ffffff;
  border-color: var(--shell-brand);
  box-shadow: var(--shell-shadow);
}

.submenu-toggle {
  display: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--shell-muted);
  border-radius: 999px;
  padding: 0.45rem 0.6rem;
  font-size: 0.72rem;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
  transition: var(--shell-transition);
}

.has-submenu .submenu-toggle:hover {
  color: var(--shell-brand);
  background: var(--shell-hover);
}

.submenu {
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0;
  min-width: 220px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.4rem;
  border: 1px solid var(--shell-stroke);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(11, 114, 133, 0.12);
  opacity: 0;
  transform: translateY(5px);
  pointer-events: none;
  transition: opacity var(--shell-transition), transform var(--shell-transition);
}

.has-submenu:hover .submenu,
.has-submenu:focus-within .submenu {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.submenu-link {
  display: block;
  border-radius: 8px;
  padding: 0.48rem 0.62rem;
  color: var(--shell-muted);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.25;
}

.submenu-link:hover {
  background: var(--shell-hover);
  color: var(--shell-brand);
}

.submenu-link.active,
.submenu-link[aria-current="page"] {
  background: rgba(11, 114, 133, 0.1);
  color: var(--shell-brand);
}

.site-footer {
  padding: 2rem 0 3rem;
  color: var(--shell-muted);
  font-size: 0.95rem;
  text-align: center;
  border-top: 1px solid var(--shell-stroke);
  margin-top: 2rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.9rem 1.25rem;
  margin: 0 0 0.9rem;
}

.footer-links a {
  color: var(--shell-brand);
  text-decoration: none;
  font-weight: 600;
}

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

@media (max-width: 820px) {
  .container {
    width: min(1160px, calc(100% - 1.5rem));
  }

  .site-header {
    padding: 1.25rem 0;
  }

  .topbar {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .nav {
    justify-content: center;
    gap: 0.45rem;
  }

  .nav-item {
    flex-wrap: wrap;
    justify-content: center;
  }

  .nav a {
    padding: 0.45rem 0.85rem;
    font-size: 0.86rem;
  }

  .has-submenu .submenu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.43rem 0.58rem;
  }

  .has-submenu .submenu {
    position: static;
    min-width: 0;
    width: 100%;
    margin-top: 0.25rem;
    box-shadow: none;
    border-radius: 10px;
    opacity: 0;
    transform: none;
    pointer-events: none;
    display: none;
  }

  .has-submenu:hover .submenu,
  .has-submenu:focus-within .submenu {
    opacity: 0;
    pointer-events: none;
  }

  .has-submenu.open .submenu {
    display: flex;
    opacity: 1;
    pointer-events: auto;
  }

  .has-submenu.open .submenu-toggle {
    background: rgba(11, 114, 133, 0.08);
    color: var(--shell-brand);
    border-color: rgba(11, 114, 133, 0.2);
  }
}
