/* Shared UI primitives — loaded last so every page uses the same foundation. */
:where(a, button) { font: inherit; }
:where(a, button):focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 4px;
}
/* One wide grid for every desktop page and section. */
.section-wrap,
.about-wrap,
.contact-wrap,
.portfolio-page .page-content {
  width: min(var(--page-max), 90%) !important;
  max-width: none;
  margin-inline: auto;
}
/* Header and navigation */
.masthead {
  min-height: 96px !important;
  padding: 20px var(--page-inline) !important;
  border-bottom: 1px solid var(--color-line) !important;
  background: color-mix(in srgb, var(--color-paper) 96%, transparent) !important;
}
.masthead .wordmark {
  font-family: var(--font-display) !important;
  font-size: 1.875rem !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  letter-spacing: -.04em !important;
}
.masthead .site-nav { gap: 1.75rem !important; }
.masthead .site-nav > a {
  padding-block: .65rem;
  font-size: var(--text-sm) !important;
  font-weight: 500;
  line-height: 1.2;
  text-decoration-thickness: 1px;
  text-underline-offset: .4rem;
}
.language-switch {
  min-height: 2.25rem;
  padding: .1875rem !important;
  border: 1px solid var(--color-line) !important;
  border-radius: var(--radius-pill) !important;
}
.language-switch button {
  min-width: 2.25rem;
  min-height: 1.75rem;
  padding: .35rem .55rem !important;
  border-radius: var(--radius-pill) !important;
  font-size: .6875rem !important;
  font-weight: 700 !important;
}
/* Labels and supporting copy */
.eyebrow {
  margin-bottom: var(--space-4);
  font-family: var(--font-body);
  font-size: var(--text-label) !important;
  font-weight: 700 !important;
  line-height: 1.4;
  letter-spacing: var(--tracking-label) !important;
  text-transform: uppercase;
}
.lead,
.about-lead,
.contact-lead {
  font-family: var(--font-body);
  font-size: var(--text-lead);
  line-height: var(--leading-body);
}
/* Links and controls */
.text-link,
.board-open,
.email-cta small {
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: .01em;
}
.text-link,
.contact-footer-panel a {
  text-decoration-thickness: 1px;
  text-underline-offset: .45rem;
}
.menu-toggle {
  width: var(--control-height) !important;
  height: var(--control-height) !important;
  border: 1px solid var(--color-line) !important;
  border-radius: 50% !important;
}
/* Surfaces and media */
.project-board,
.conversation-grid article,
.contribution,
.contact-note,
.about-portrait {
  border-radius: var(--radius-md);
}
.project-card-image,
.screen {
  border-radius: var(--radius-sm);
}
.project-board,
.conversation-grid article,
.contribution {
  border-color: var(--color-line);
}
/* Footer rhythm */
.site-footer {
  min-height: 76px;
  padding: 24px var(--page-inline) !important;
  align-items: center;
  border-top: 1px solid var(--color-line) !important;
  font-size: .75rem !important;
  line-height: 1.5;
}
.site-footer a { text-underline-offset: .3rem; }
@media (max-width: 700px) {
  .section-wrap,
.about-wrap,
.contact-wrap,
.portfolio-page .page-content { width: 88% !important; }
  .masthead {
    min-height: 78px !important;
    padding-block: 16px !important;
  }
  .masthead .wordmark { font-size: 1.5625rem !important; }
  .masthead .site-nav > a {
    padding-block: 1rem;
    font-family: var(--font-display);
    font-size: 1.9375rem !important;
    font-weight: 600;
  }
  .site-footer { display: block; min-height: 0; }
}
/* Align hero edge content with the same grid used by the navbar and sections. */
.page-home .hero .introduction { left: var(--page-inline) !important; }
.page-home .hero .point-of-view { right: var(--page-inline) !important; }
/* Consistent, more generous space between repeated components. */
.project-collection,
.conversation-grid {
  gap: var(--grid-gap) !important;
}
.section-heading,
.split,
.contact-grid {
  column-gap: clamp(4rem, 7vw, 7.5rem) !important;
}
/* Desktop masthead: role left, wordmark centered, navigation right. */
@media (min-width:701px) {
  .masthead .role {
    display: block !important;
    flex: 0 0 auto;
    color: var(--color-ink);
    font-size: .75rem;
    font-weight: 500;
    line-height: 1.3;
  }
  .masthead .wordmark {
    position: absolute !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
  }
  .masthead .site-nav { margin-left: auto !important; }
}
@media (max-width:700px) {
  .masthead .role { display: none !important; }
  .masthead .wordmark {
    position: static !important;
    transform: none !important;
  }
}
@media (max-width:700px) {
  .masthead .site-nav .language-switch {
    border-color: rgba(255, 250, 245, .55) !important;
    background: rgba(255, 255, 255, .06);
  }
  .masthead .site-nav .language-switch button {
    color: #fffaf5 !important;
  }
  .masthead .site-nav .language-switch button[aria-pressed="true"] {
    background: #fffaf5 !important;
    color: var(--color-accent-deep) !important;
  }
}
/* Fixed desktop masthead tracks prevent movement between pages and languages. */
@media (min-width:701px) {
  .masthead .role {
    width: 8rem;
    white-space: nowrap;
  }
  .masthead .site-nav {
    display: grid !important;
    grid-template-columns: max-content max-content max-content 5rem;
    gap: 1rem !important;
    align-items: center;
  }
  .masthead .site-nav > a { text-align: center; }
  .masthead .language-switch {
    width: 5rem;
    justify-content: center;
    margin-left: .5rem !important;
  }
}
/* Stable language control: both language states occupy identical cells. */
.masthead .language-switch {
  box-sizing: border-box;
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 5rem !important;
  min-width: 5rem !important;
  max-width: 5rem !important;
  height: 2.25rem;
  margin: 0 !important;
  padding: .1875rem !important;
  gap: 2px;
  flex: 0 0 auto;
}
.masthead .language-switch button {
  box-sizing: border-box;
  display: grid;
  place-items: center;
  width: 100%;
  min-width: 0;
  height: 1.75rem;
  margin: 0;
  padding: 0 !important;
  line-height: 1;
}
@media (min-width:701px) {
  .masthead .language-switch {
    flex-basis: 5rem;
    margin-left: .5rem !important;
  }
}
.masthead .site-nav > a[aria-current="page"] {
  color: var(--color-accent);
  text-decoration: underline;
  text-decoration-color: currentColor;
  text-decoration-thickness: 2px;
  text-underline-offset: .45rem;
}
/* Keep the logo and links in separate flex slots on tablet-sized screens. */
@media (min-width:701px) and (max-width:1100px) {
  .masthead { gap:1.5rem !important; }
  .masthead .role { display:none !important; }
  .masthead .wordmark {
    position:static !important;
    left:auto !important;
    transform:none !important;
    flex:0 0 auto;
  }
  .masthead .site-nav { flex:0 0 auto; gap:.75rem !important; }
}
