/* Match the reference's max-w-7xl (80rem) content container. */
:root {
  --page-width: 80rem;
  --page-gutter: 1rem;
}

.hero,
.section,
footer {
  width: 100%;
  max-width: var(--page-width);
  margin-inline: auto;
  padding-inline: var(--page-gutter);
}

.header {
  padding-inline: max(var(--page-gutter), calc((100% - var(--page-width)) / 2 + var(--page-gutter)));
}

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

.studio-grid > *,
.pricing-grid > *,
.feature-grid article > * {
  min-width: 0;
}

/* Keep long FAQ answers readable inside the wider section. */
.faq-list {
  width: 100%;
  max-width: 56rem;
  margin-inline: auto;
}

#languageButton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 40px;
  min-height: 40px;
  padding-block: 0;
  line-height: 1.4;
  white-space: nowrap;
}

#currentLanguage {
  display: block;
  line-height: 20px;
}

#languageButton .chevron {
  display: grid;
  place-items: center;
  align-self: center;
  flex: 0 0 14px;
  width: 14px;
  height: 20px;
  line-height: 0;
  color: var(--muted);
  transition: transform 150ms ease;
}

#languageButton .chevron svg {
  display: block;
  width: 12px;
  height: 8px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#languageButton[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
}

.language-menu {
  top: calc(100% + 8px);
}

.account-control {
  position: relative;
  flex: 0 1 auto;
  min-width: 0;
}

.account-trigger {
  display: flex;
  align-items: center;
  gap: 7px;
  max-width: 128px;
  min-height: 36px;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
}

.account-trigger span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-trigger svg {
  width: 12px;
  height: 8px;
  color: var(--muted);
}

.account-trigger[aria-expanded="true"] svg { transform: rotate(180deg); }

.account-menu {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 6px);
  z-index: 20;
  width: max-content;
  min-width: 128px;
  max-width: min(240px, calc(100vw - 32px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 2px 6px #0002;
  text-align: center;
  font-size: 14px;
}

.account-menu > * {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  min-height: 40px;
  padding: 8px 13px;
  overflow-wrap: anywhere;
}

.account-menu > * + * { border-top: 1px solid var(--line); }
.account-menu .account-menu-balance { color: var(--accent); }
.account-menu-balance svg { width: 16px; height: 16px; }
.account-menu a:hover, .account-menu button:hover { background: var(--soft); }
.account-menu :focus-visible { outline-offset: -3px; }

@media (max-width: 640px) {
  .header {
    gap: 12px;
  }

  .studio-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  #languageButton {
    gap: 6px;
    height: 36px;
    min-height: 36px;
  }

  .account-trigger { max-width: 96px; font-size: 12px; }
}

@media (max-width: 480px) {
  .header .credits-button {
    display: none;
  }

  #currentLanguage {
    max-width: 72px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (prefers-reduced-motion: reduce) {
  #languageButton .chevron {
    transition: none;
  }
}
