/* Logo */

.site-logo {
  display: inline-flex;
  line-height: 0;
}

/* Nav */

/* Sticky is applied to #nav-root (the header wrapper each page injects
   the partial into), not the <nav> it wraps: a sticky element needs its
   parent to be taller than itself for there to be any scroll range to
   stick within, and #nav-root's parent is <body> (the full page), while
   <nav> itself would be wrapped by #nav-root, which shrink-wraps tightly
   to nav's own height with zero extra room -- sticky on nav directly
   never visibly sticks. Background is opaque and unconditional (not just
   once scrolled) because a CSS-only sticky nav has no scroll-state to
   key off without JS -- several sections (home's hero gradient image,
   case study's gray "Final takeaway" section) scroll underneath it, and
   nav text/icons are styled dark-on-light, so it needs a solid light
   background at all times to stay readable. */
#nav-root {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--color-bg-primary);
  border-bottom: var(--border-default);
  transition: background-color 0.2s ease, border-bottom-color 0.2s ease;
}

/* Homepage-only: starts transparent over the hero gradient, switches to
   the exact opaque style above (unmodified) once nav-toggle.js adds
   .is-nav-solid past 100px of scroll -- scoped via the existing
   data-page attribute rather than a separate nav partial. */
body[data-page="home"] #nav-root:not(.is-nav-solid) {
  background: transparent;
  border-bottom-color: transparent;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: var(--space-small);
  position: relative;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-small);
}

.nav-icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  border-radius: var(--radius-pill);
  background: transparent;
  transition: background-color 0.2s ease;
}

.nav-icon-link:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.nav-icon-link img {
  width: 28px;
  height: 28px;
}

.nav-button {
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-pill);
  padding: 12px 16px;
  background: transparent;
  border: none;
  font-size: var(--body-size);
  font-weight: var(--body-weight);
  color: var(--color-text-nav-inactive);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.nav-button:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: var(--color-text-primary);
}

.nav-button.is-active {
  color: var(--color-text-primary);
  font-weight: 700;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 24px;
  height: 20px;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--color-text-primary);
}

@media (max-width: 900px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: absolute;
    top: calc(100% - var(--space-small));
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-smallest);
    background: var(--color-bg-primary);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: var(--space-small);
    display: none;
  }

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

  .nav-links .nav-button {
    justify-content: center;
  }
}

/* Buttons */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  border-radius: var(--radius-pill);
  padding: 12px 24px;
  background: var(--color-text-primary);
  color: var(--color-bg-primary);
  font-size: var(--body-size);
  font-weight: 700;
  line-height: var(--body-line-height);
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.btn-primary:hover {
  opacity: 0.85;
}

/* Tag pills */

.tag-pill {
  display: inline-flex;
  align-items: center;
  border: var(--border-strong);
  border-radius: var(--radius-chip);
  padding: 4px 8px;
  font-size: var(--body-small-size);
  font-weight: var(--body-small-strong-weight);
  line-height: var(--body-small-line-height);
}

/* Card */

.card {
  background: var(--color-bg-primary);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

/* Project card -- shared shell (used by the homepage "Recent work" cards
   and the case study "Other projects" cards). Base layout is the
   homepage's 12-col media/body split; the .project-card--compact
   modifier (case-study.css) overrides display for the title+CTA-only
   variant, inheriting this shell (background, radius, shadow, padding,
   accent strip) unchanged. */
.project-card {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  align-items: start;
  gap: var(--grid-gutter);
  background: var(--color-bg-primary);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: var(--space-medium) var(--space-medium) var(--space-medium)
    calc(var(--space-xsmall) + var(--space-large));
  text-decoration: none;
  color: inherit;
}

/* Accent strip: space-xsmall (16px) wide, full card height, flush to the
   card's left edge. Its rounded corner comes for free from the card's own
   overflow:hidden + border-radius clipping a plain rectangle, rather than
   radiusing the strip itself. Color is per-project via a modifier class,
   reusing existing tokens.md colors -- no new values. */
.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: var(--space-xsmall);
  height: 100%;
  background: var(--card-accent);
}

.project-card--deel {
  --card-accent: var(--color-bg-light-blue);
}

.project-card--glovo {
  --card-accent: var(--color-bg-light-green);
}

@media (max-width: 900px) {
  /* Top padding specifically raised to space-medium (40px) so the gap
     between the top accent strip (space-xsmall, 16px thick) and the
     card's own content start is a deliberate 24px (40 - 16), matching
     space-small -- rather than the 8px that fell out of the strip
     sharing the uniform space-small padding used on every other side. */
  .project-card {
    grid-template-columns: 1fr;
    padding: var(--space-medium) var(--space-small) var(--space-small);
  }

  /* Strip rotates to the top edge at the same breakpoint the homepage's
     media reorders above its body text. Full width, same space-xsmall
     (16px) thickness, flush to the top -- the uniform space-small (24px)
     card padding already clears it without any extra math. */
  .project-card::before {
    top: 0;
    left: 0;
    width: 100%;
    height: var(--space-xsmall);
  }
}
