/* ============================================================
   MASHINA STUDIO — Layout: header, footer, sections
   ============================================================ */

/* --- Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-6);
  padding-block: var(--sp-4);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 0;
  text-decoration: none;
}

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

.brand__mark {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.25rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.brand__tag {
  font-family: var(--font-mono);
  font-size: var(--size-label);
  color: var(--metal);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* --- Primary nav --- */
.site-nav { display: flex; gap: var(--sp-6); align-items: center; }

.site-nav a {
  font-family: var(--font-mono);
  font-size: var(--size-label);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-decoration: none;
  color: var(--ink-2);
  white-space: nowrap;
}

.site-nav a:hover { color: var(--signal); }

.site-nav a[aria-current="page"] {
  color: var(--signal);
}

/* The signal CTA keeps its white label — .site-nav a must not tint it,
   even when it's the current page (aria-current paints text crimson;
   on the crimson button that would make the label unreadable). */
.site-nav a[aria-current="page"].btn--signal {
  color: var(--white);
}

.site-nav a.btn--signal {
  color: var(--white);
}

.site-nav a.btn--signal:hover {
  color: var(--white);
}

/* --- Language switcher --- */
.lang-switch {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: var(--size-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  user-select: none;
}

.lang-switch a {
  color: var(--metal);
  text-decoration: none;
  transition: color var(--dur) var(--ease);
}

.lang-switch a:hover {
  color: var(--signal);
}

.lang-switch__active {
  color: var(--ink);
  font-weight: 700;
}

.lang-switch__sep {
  color: var(--line-dark);
  margin-inline: 4px;
}

/* --- Sections --- */
.section { padding-block: var(--sp-24); }

.section--tight { padding-block: var(--sp-16); }

.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-6);
  margin-bottom: var(--sp-12);
  /* Long taglines (e.g. the "Starting prices — …" label) must never force
     the head wider than the container: at ~800–1050px viewports the nowrap
     label overflowed to the right and the browser panned the whole page. */
  max-width: 100%;
}

.section__head--stacked {
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-2);
}

/* h2 keeps its size; the label side is the one that shrinks and wraps. */
.section__head h2 { flex-shrink: 0; }

.section__head .label {
  white-space: normal;
  min-width: 0;
}

/* --- Footer: the machine plate --- */
.site-footer {
  background: var(--deep);
  color: var(--paper);
  padding-block: var(--sp-10) var(--sp-6);
}

.site-footer a { color: var(--paper); }

.site-footer__grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: var(--sp-8);
  margin-bottom: var(--sp-8);
}

.site-footer .label { color: var(--metal); }

.site-footer__plate {
  border-top: 1px solid var(--line-dark);
  padding-top: var(--sp-4);
  display: flex;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
}

.site-footer__plate .label { color: var(--metal); }

/* --- Footer link lists (shared across all pages) --- */
.footer-links {
  list-style: none;
  padding: 0;
  margin-top: var(--sp-3);
  display: grid;
  gap: var(--sp-2);
}

.footer-links a {
  text-decoration: none;
  color: var(--paper);
  opacity: 0.85;
  transition: opacity var(--dur) var(--ease), color var(--dur) var(--ease);
}

.footer-links a:hover { opacity: 1; color: var(--signal); text-decoration: none; }



/* --- Responsive --- */
@media (max-width: 768px) {
  /* Current-page marker: visible on mobile where the red link
     alone is easy to miss. Plain links only, not the CTA button. */
  .site-nav a[aria-current="page"]:not(.btn) {
    color: var(--signal);
    border-bottom: 2px solid var(--signal);
    padding-bottom: 2px;
  }
  /* The signal CTA keeps its white label and pristine button padding */
  .site-nav a[aria-current="page"].btn--signal {
    color: var(--white);
  }
  .site-header__inner {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-2);
    padding-block: var(--sp-3);
  }
  .brand {
    order: 1;
  }
  .site-nav {
    order: 3;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-2);
    overflow-x: visible;
    border-top: 1px solid var(--line);
    padding-top: var(--sp-2);
    margin-top: var(--sp-1);
  }
  .site-nav a {
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    padding-block: var(--sp-1);
    white-space: nowrap;
  }
  .site-nav .btn--signal {
    position: absolute;
    top: var(--sp-3);
    right: var(--gutter);
    padding: 6px 12px;
    font-size: 0.75rem;
    line-height: 1.2;
  }
  .site-footer { padding-block: var(--sp-8) var(--sp-6); }
  .site-footer__grid { grid-template-columns: 1fr; gap: var(--sp-6); margin-bottom: var(--sp-6); }
  .section__head { flex-direction: column; align-items: flex-start; gap: var(--sp-3); }
}

@media (max-width: 360px) {
  .brand__tag { display: none; }
  .site-nav {
    gap: 4px;
  }
  .site-nav a {
    font-size: 0.6875rem;
    letter-spacing: 0.02em;
  }
  .site-nav .btn--signal {
    padding: 5px 10px;
    font-size: 0.7rem;
  }
}

