/* ==========================================================================
   Layout — container, section rhythm, grid
   ========================================================================== */
.container{
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

section{
  position: relative;
  padding-block: var(--space-xxl);
}

[data-theme="dark"]{
  background: var(--color-bg-dark);
  color: var(--color-text-on-dark);
}

[data-theme="light"]{
  background: var(--color-bg);
  color: var(--color-text);
}

[data-theme="panel"]{
  background: var(--color-surface-panel);
  color: var(--color-text);
}

.section-head{
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.section-head h2{
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.05;
  max-width: 14ch;
}

.section-head p{
  max-width: 34ch;
  color: var(--color-muted);
}
section[data-theme="dark"] .section-head p{ color: var(--color-muted-on-dark); }

/* Generic responsive grid helpers */
.grid-4{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
}

@media (max-width: 1023px){
  .grid-4{ grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 639px){
  .grid-4{ grid-template-columns: 1fr; }
}

@media (max-width: 768px){
  section{ padding-block: var(--space-xl); }
}
