:root {
  --ma-bg: #ffffff;
  --ma-text: #0a0a0a;
  --ma-muted: #5a5a5a;
  --ma-line: #cfcfcf;
  --ma-accent: #102a96;
  --ma-panel: #2f3438;
  --ma-soft: #f0f0f0;
  --ma-font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --ma-font-body: "Avenir Next", "Segoe UI", Candara, "Gill Sans", sans-serif;
  --ma-pad: clamp(1.25rem, 3vw, 2.5rem);
  --ma-gap: clamp(1rem, 2.5vw, 2rem);
  --ma-nav-h: 4.5rem;
  --ma-col-pad-x: 128px;
  /* Breakpoints: mobile ≤968 | tablet 969–1399 | desktop mid 1400–1639 | desktop ≥1640 */
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body.madapper {
  margin: 0;
  min-height: 100%;
  background: var(--ma-bg);
  color: var(--ma-text);
  font-family: var(--ma-font-body);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body.madapper a {
  color: inherit;
  text-decoration: none;
}

body.madapper a:hover {
  color: var(--ma-accent);
}

.ma-shell {
  min-height: 100vh;
  padding: 0 var(--ma-pad);
}

.ma-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--ma-nav-h);
  padding: 0 var(--ma-pad);
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  gap: 0;
  z-index: 30;
  background: transparent;
}

.ma-main {
  height: 100vh;
  max-height: 1080px;
  padding: 16px 0;
}

.ma-nav__left,
.ma-nav__right {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  padding: 0 var(--ma-col-pad-x);
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}

.ma-nav__left .ma-nav__link,
.ma-nav__right .ma-nav__link {
  justify-self: start;
}

.ma-nav__right {
  grid-template-columns: 1fr 1fr auto;
  justify-items: start;
}

.ma-nav__right .ma-lang,
.ma-nav__right .ma-nav__toggle {
  justify-self: end;
}

.ma-nav__link.is-active {
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.35em;
}

.ma-nav__logo {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.ma-nav__logo .ma-logo {
  position: relative;
  z-index: 2;
}

.ma-nav__logo img,
.ma-logo img {
  display: block;
  width: 6rem;
  height: auto;
  filter: invert(1);
  margin-top: -0.5rem;
}

/* White half-circle behind nav logo (readability over panel) */
.ma-nav:not(.ma-nav--home) .ma-nav__logo::before {
  content: "";
  position: absolute;
  left: 50%;
  top: calc(50% - 15px);
  width: 9rem;
  height: 4.8rem;
  background: var(--ma-bg);
  border-radius: 0 0 30rem 30rem;
  transform: translate(-50%, -20%);
  z-index: 1;
  pointer-events: none;
}

.ma-nav--home .ma-nav__logo {
  visibility: hidden;
  pointer-events: none;
}

.ma-nav__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 6px;
  width: auto;
  height: auto;
  padding: 12px;
  background: #fff;
  border: 0;
  cursor: pointer;
}

.ma-nav__toggle-line {
  display: block;
  width: 1.35rem;
  height: 2px;
  background: #000;
}

.ma-nav__toggle-line--short {
  width: 0.675rem;
}

.ma-panel__brand {
  display: none;
}

.ma-lang {
  display: inline-flex;
  gap: 0.35rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ma-lang a.is-active {
  font-weight: 700;
}

.ma-layout {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0;
  align-items: stretch;
  height: 100%;
  position: relative;
}

.ma-layout--split .ma-col--right {
  grid-column: span 2;
}

.ma-layout--split::before {
  content: "";
  position: absolute;
  top: 10%;
  bottom: auto;
  height: 80%;
  left: 33.333%;
  width: 1px;
  background: var(--ma-text);
  transform: translateX(-50%);
  pointer-events: none;
}

.ma-col {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.ma-col--left {
  padding: calc(var(--ma-nav-h) + 0.5rem) var(--ma-col-pad-x) 2rem;
}

.ma-col--center {
  align-items: stretch;
  justify-content: stretch;
  align-self: stretch;
  position: relative;
}

.ma-col--right {
  padding: calc(var(--ma-nav-h) + 0.5rem) var(--ma-col-pad-x) 2rem;
  position: relative;
}

/* Project detail: centered column content */
body.project .ma-col--left {
  justify-content: center;
}

body.project .ma-col--left .ma-prose {
  max-width: 100%;
}

body.project .ma-col--left .ma-prose p {
  margin: 0;
  line-height: 1.6;
}

body.project .ma-col--right {
  justify-content: center;
}

.ma-title {
  margin: 0;
  font-family: var(--ma-font-display);
  font-size: clamp(2.2rem, 4.5vw, 48px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.ma-rule {
  width: 10rem;
  height: 1px;
  background: var(--ma-line);
  border: 0;
  margin: 4rem 0;
}

.ma-prose {
  max-width: 34rem;
  color: var(--ma-text);
  font-size: 0.98rem;
}

.ma-prose p {
  margin: 0 0 1rem;
}

.ma-cta {
  display: inline-block;
  margin-top: 0.75rem;
  font-weight: 700;
}

.ma-cta:hover {
  color: var(--ma-accent);
}

.ma-panel {
  width: 100%;
  height: 100%;
  background: var(--ma-panel);
  color: #fff;
  border-radius: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: none;
}

.ma-panel__logo {
  width: 90%;
  height: 90%;
  object-fit: contain;
  display: block;
}

.ma-panel__media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ma-panel__intro {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: auto;
  height: 100%;
  max-width: none;
  object-fit: contain;
  padding: 0;
  box-sizing: border-box;
}

.ma-panel::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 32%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.35) 45%, transparent 100%);
  pointer-events: none;
  z-index: 1;
}

.ma-panel__controls {
  position: absolute;
  left: 50%;
  bottom: 3%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.75rem;
  padding: 0;
  width: auto;
  font-size: 16px;
  color: #fff;
  z-index: 2;
}

.ma-panel__controls button:not(.ma-panel__frame),
.ma-panel__controls a {
  background: transparent;
  border: 0;
  color: inherit;
  font: inherit;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0.35rem 0.5rem;
}

.ma-panel__center {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 0;
  height: auto;
  flex-shrink: 0;
  padding: 0;
}

.ma-panel__progress {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(90deg);
  pointer-events: none;
  overflow: visible;
  display: none;
}

.ma-panel__progress-track {
  stroke: rgba(255, 255, 255, 0.5);
  stroke-width: 2.5;
}

.ma-panel__progress-bar {
  stroke: #fff;
  stroke-width: 2.5;
  stroke-linecap: butt;
}

.is-autoplay-off .ma-panel__progress-bar,
.is-autoplay-off .ma-panel__open-ring-bar {
  opacity: 0;
}

.ma-panel__dot {
  width: 1.35rem;
  height: 1.35rem;
  border: 2.5px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  box-sizing: border-box;
}

.ma-panel__open {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0 !important;
  border-radius: 999px;
  padding: 1rem 3rem !important;
  white-space: nowrap;
  color: #fff;
  background: transparent;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.ma-panel__open-label {
  position: relative;
  z-index: 1;
}

.ma-panel__open-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 0;
}

.ma-panel__open-ring-track,
.ma-panel__open-ring-bar {
  fill: none;
  stroke-width: 2.5;
  vector-effect: non-scaling-stroke;
}

.ma-panel__open-ring-track {
  stroke: rgba(255, 255, 255, 0.5);
}

.ma-panel__open-ring-bar {
  stroke: #fff;
  stroke-linecap: butt;
}

.ma-panel__open:hover {
  background: #fff;
  color: #000;
}

.ma-panel__open:hover .ma-panel__open-ring {
  opacity: 0;
}

/* Projects overview: Open Project defaults to hover look at 50% opacity */
body.projects .ma-panel__open {
  background: #fff;
  color: #000;
  opacity: 0.5;
  transition: color 0.15s ease, background-color 0.15s ease, opacity 0.15s ease;
}

body.projects .ma-panel__open:hover {
  opacity: 1;
}

.ma-panel__open.is-inert {
  color: transparent;
  pointer-events: none;
  cursor: default;
}

.ma-panel__open.is-inert:hover {
  background: transparent;
  color: transparent;
}

.ma-panel__open.is-inert:hover .ma-panel__open-ring {
  opacity: 1;
}

.ma-panel__frame {
  position: relative;
  z-index: 1;
  width: 1.85rem;
  height: 1.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  cursor: pointer;
  pointer-events: auto;
}

.ma-panel__frame-icon {
  display: block;
  width: 0.85rem;
  height: 0.85rem;
}

.ma-panel__gallery {
  display: none;
}

.featherlight {
  background: rgba(0, 0, 0, 0.8) !important;
}

.featherlight .featherlight-content {
  position: relative;
  background: #fff;
  padding: 36px;
  border: 0;
  margin: 0 auto 2.75rem;
  max-height: calc(92vh - 3.25rem);
  max-width: min(90vw, 1400px);
  overflow: visible !important;
}

.featherlight .featherlight-image {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: calc(92vh - 3.25rem - 72px);
}

.featherlight .featherlight-close-icon {
  position: absolute;
  top: 4px;
  right: 6px;
  z-index: 9999;
  width: 2.25rem;
  height: 2.25rem;
  line-height: 2.25rem;
  font-size: 1.45rem;
  font-family: Arial, sans-serif;
  font-weight: 400;
  color: #111;
  background: transparent;
  border: 0;
  border-radius: 0;
  text-align: center;
  padding: 0;
}

.featherlight-swipe-aware .featherlight-next,
.featherlight-swipe-aware .featherlight-previous,
.featherlight .featherlight-next,
.featherlight .featherlight-previous {
  display: block !important;
  position: absolute !important;
  top: auto !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0.2rem 0 !important;
  background: transparent !important;
  border: 0;
  border-radius: 0;
  color: #fff !important;
  font-family: var(--ma-font-body);
  z-index: 2;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.featherlight .featherlight-previous {
  left: 0 !important;
  right: auto !important;
  bottom: -2.35rem !important;
}

.featherlight .featherlight-next {
  right: 0 !important;
  left: auto !important;
  bottom: -2.35rem !important;
}

.featherlight .featherlight-next > span,
.featherlight .featherlight-previous > span {
  display: inline-flex !important;
  align-items: center;
  gap: 0.4rem;
  position: static !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  width: auto !important;
  margin: 0 !important;
  font-size: 0.95rem !important;
  line-height: 1 !important;
  letter-spacing: 0.01em;
  text-shadow: none;
  color: #fff;
  font-style: normal;
  font-weight: 400;
}

.featherlight .ma-fl-arrow {
  display: inline-block !important;
  font-style: normal;
  font-size: 1.35em !important;
  line-height: 1;
  font-weight: 400;
  transform: translateY(-0.04em);
}

.featherlight-first-slide.featherlight-last-slide .featherlight-next,
.featherlight-first-slide.featherlight-last-slide .featherlight-previous,
.featherlight-loading .featherlight-next,
.featherlight-loading .featherlight-previous {
  display: none !important;
}

@media (max-width: 968px) {
  .featherlight .featherlight-content {
    width: 100%;
    max-width: 100vw;
    max-height: 100vh;
    margin: 0;
    padding: 0;
    background: transparent;
  }

  .featherlight .featherlight-image {
    width: auto;
    max-width: 100vw;
    max-height: 100vh;
    margin: 0 auto;
  }

  .featherlight .featherlight-close-icon {
    position: fixed !important;
    top: 0.65rem !important;
    right: 0.65rem !important;
    width: 2.75rem;
    height: 2.75rem;
    line-height: 2.75rem;
    font-size: 1.7rem;
    color: #fff;
  }

  .featherlight .featherlight-previous,
  .featherlight .featherlight-next {
    position: fixed !important;
    top: auto !important;
    bottom: 1.15rem !important;
  }

  .featherlight .featherlight-previous {
    left: 1.15rem !important;
  }

  .featherlight .featherlight-next {
    right: 1.15rem !important;
  }

  .featherlight .featherlight-next > span,
  .featherlight .featherlight-previous > span {
    font-size: 1rem !important;
  }

  .featherlight .ma-fl-arrow {
    font-size: 1.25em !important;
  }
}

.ma-panel__autoplay {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  z-index: 36;
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
  border: 1.5px solid rgba(255, 255, 255, 0.85) !important;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.25) !important;
  color: #fff;
  cursor: pointer;
  pointer-events: auto;
}

.ma-panel__autoplay-icon {
  position: relative;
  display: block;
  width: 0.85rem;
  height: 0.85rem;
}

.ma-panel__autoplay-triangle {
  position: absolute;
  left: 0.12rem;
  top: 50%;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0.34rem 0 0.34rem 0.55rem;
  border-color: transparent transparent transparent currentColor;
  transform: translateY(-50%);
}

.ma-panel__autoplay-x {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.ma-panel__autoplay-x span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1.05rem;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
}

.ma-panel__autoplay-x span:first-child {
  transform: translate(-50%, -50%) rotate(40deg);
}

.ma-panel__autoplay-x span:last-child {
  transform: translate(-50%, -50%) rotate(-40deg);
}

.ma-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ma-list__label {
  margin: 0 0 0.85rem;
  font-size: 0.9rem;
  color: var(--ma-muted);
}

.ma-list__item {
  margin: 0 0 0.65rem;
  font-weight: 700;
}

.ma-list__item a {
  display: inline-block;
}

.ma-list__item.is-active {
  position: relative;
}

.ma-list__item.is-active::before {
  content: "";
  position: absolute;
  left: -1.25rem;
  top: 50%;
  width: 0.85rem;
  height: 2px;
  background: var(--ma-accent);
  transform: translateY(-50%);
}

.ma-meta {
  display: grid;
  gap: 1.75rem;
}

/* Tablet + mobile: max 2 meta items side by side */
@media (max-width: 1399px) {
  .ma-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.ma-meta__label {
  margin: 0 0 0.4rem;
  font-size: 1rem;
  font-weight: 300;
  color: var(--ma-text);
}

.ma-meta__value {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
}

.ma-project-brand {
  margin-top: 2.5rem;
  max-width: 18rem;
}

.ma-project-brand__frame {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 7.5rem;
  padding: 1.5rem;
  background: transparent;
  border: 1px solid #c8c8c8;
}

.ma-project-brand__frame img,
.ma-project-brand__frame .ma-card__logo {
  display: block;
  max-width: 100%;
  max-height: 4.5rem;
  width: auto;
  height: auto;
  object-fit: contain;
}

.ma-project-brand__links {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.ma-project-brand__links a {
  font-weight: 700;
  font-size: 0.95rem;
}

.ma-project-brand__links a:hover {
  color: var(--ma-accent);
}

.ma-card {
  margin-top: auto;
  padding: 1rem 1.1rem;
  background: var(--ma-soft);
  border-radius: 0.35rem;
  max-width: 18rem;
}

.ma-card__label {
  margin: 0 0 0.65rem;
  font-size: 0.85rem;
  font-weight: 700;
}

.ma-card__logo {
  max-width: 100%;
  height: auto;
}

.ma-accordion {
  border-top: 0;
}

.ma-accordion__item {
  border-bottom: 1px solid var(--ma-text);
}

.ma-accordion__item:last-child {
  border-bottom: 0;
}

.ma-accordion__trigger {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 0;
  background: transparent;
  border: 0;
  text-align: left;
  font-family: var(--ma-font-display);
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  font-weight: 700;
  cursor: pointer;
  color: inherit;
}

.ma-accordion__panel {
  display: none;
  padding: 0 0 1.25rem;
  max-width: 36rem;
  color: var(--ma-muted);
}

.ma-accordion__item.is-open .ma-accordion__panel {
  display: block;
}

.ma-contact-details {
  margin: 1.25rem 0 1.75rem;
  display: grid;
  gap: 0.85rem;
}

.ma-contact-line {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.ma-contact-line__icon {
  display: inline-flex;
  flex-shrink: 0;
  color: var(--ma-text);
}

.ma-contact-line__value,
.ma-contact-line .js-contact-obfuscator {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.ma-contact-line__value:hover {
  color: var(--ma-accent);
}

.ma-contact-line__copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin: 0;
  padding: 0.25rem;
  border: 0;
  background: transparent;
  color: var(--ma-text);
  cursor: pointer;
}

.ma-contact-line__copy:hover,
.ma-contact-line__copy.is-copied {
  color: var(--ma-accent);
}

.ma-form {
  position: relative;
  display: grid;
  gap: 1rem;
  max-width: 28rem;
}

body.contact .ma-form {
  max-width: none;
}

.ma-form-message {
  padding: 0.95rem 1.1rem;
  border: 1.5px solid;
  margin: 0 0 1.5rem;
}

.ma-form-message p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.45;
}

.ma-form-message--success {
  border-color: #1f7a3a;
  background: rgba(31, 122, 58, 0.14);
  color: #145c2b;
}

.ma-form-message--error {
  border-color: #b42318;
  background: rgba(180, 35, 24, 0.14);
  color: #8a1c14;
}

.ma-form-message--warning {
  border-color: #a15c00;
  background: rgba(161, 92, 0, 0.14);
  color: #7a4500;
}

.ma-form__loading {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  background: rgba(255, 255, 255, 0.78);
}

.ma-form.is-submitting .ma-form__loading {
  display: flex;
}

.ma-form.is-submitting form {
  pointer-events: none;
  opacity: 0.4;
}

.ma-form__spinner {
  width: 2rem;
  height: 2rem;
  border: 2.5px solid rgba(10, 10, 10, 0.15);
  border-top-color: var(--ma-accent);
  border-radius: 50%;
  animation: ma-spin 0.7s linear infinite;
}

.ma-form__loading-text {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

@keyframes ma-spin {
  to {
    transform: rotate(360deg);
  }
}

body.contact .ma-form form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 2rem;
  row-gap: 1.25rem;
}

body.contact .ma-form form > * {
  grid-column: 1 / -1;
}

body.contact .ma-form .form-field:has([name="data[name]"]),
body.contact .ma-form .form-field:has([name="data[email]"]) {
  grid-column: auto;
}

.ma-form .form-field,
.ma-form .form-group {
  display: grid;
  gap: 0.35rem;
}

.ma-form label,
.ma-form .form-label {
  font-size: 0.9rem;
}

.ma-form input[type="text"],
.ma-form input[type="email"],
.ma-form textarea,
.ma-form .form-input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--ma-line);
  background: transparent;
  padding: 0.55rem 0;
  font: inherit;
  color: inherit;
  border-radius: 0;
}

.ma-form input:focus,
.ma-form textarea:focus,
.ma-form .form-input:focus {
  outline: none;
  border-bottom-color: var(--ma-accent);
}

.ma-form textarea {
  min-height: 8rem;
  resize: vertical;
}

.ma-form button,
.ma-form .button,
.ma-form [type="submit"] {
  justify-self: start;
  margin-top: 0.5rem;
  border: 1.5px solid var(--ma-text);
  background: transparent;
  color: var(--ma-text);
  padding: 0.55rem 1.2rem;
  font: inherit;
  cursor: pointer;
}

.ma-form button:hover,
.ma-form .button:hover,
.ma-form [type="submit"]:hover {
  border-color: var(--ma-accent);
  color: var(--ma-accent);
}

.ma-footer {
  position: absolute;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  padding: 0.15rem 0 0.15rem 1rem;
  border-left: 1px solid var(--ma-line);
  font-size: 0.8rem;
  text-align: right;
}

.ma-footer a {
  white-space: nowrap;
}

body.home .ma-footer {
  right: var(--ma-col-pad-x);
  bottom: 2rem;
  z-index: 2;
}

.ma-legal {
  max-width: 42rem;
  padding-top: 1rem;
}

.ma-legal h2,
.ma-legal h3 {
  font-family: var(--ma-font-display);
}

.ma-legal p {
  white-space: pre-line;
}

body.legal .ma-main {
  height: auto;
  min-height: 100vh;
  max-height: none;
}

body.legal .ma-layout {
  height: auto;
  min-height: calc(100vh - 2rem);
  align-items: start;
}

body.legal .ma-col--left,
body.legal .ma-col--right {
  justify-content: flex-start;
}

body.legal .ma-col--right .ma-legal {
  max-width: none;
  padding-top: 0;
}

.ma-mobile-nav {
  display: none;
}

/* Desktop mid: 1400px – 1639px */
@media (min-width: 1400px) and (max-width: 1639px) {
  :root {
    --ma-col-pad-x: 64px;
  }
}

/* Tablet: 969px – 1399px */
@media (min-width: 969px) and (max-width: 1399px) {
  :root {
    --ma-col-pad-x: 48px;
    --ma-nav-h: 4rem;
  }

  .ma-shell {
    padding: 0 16px;
  }

  /* All 4 nav links above the text column (not split) */
  .ma-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.75rem;
    left: 16px;
    right: auto;
    width: calc((100vw - 32px) / 2);
    height: auto;
    min-height: var(--ma-nav-h);
    padding: 0.75rem var(--ma-col-pad-x);
    padding-right: 0.75rem;
    box-sizing: border-box;
  }

  .ma-nav__left,
  .ma-nav__right {
    display: contents;
  }

  .ma-nav__link {
    font-size: 0.85rem;
  }

  .ma-nav__logo {
    display: flex;
    order: -1;
    visibility: visible;
    pointer-events: auto;
    margin-right: 0.25rem;
  }

  .ma-nav--home .ma-nav__logo {
    visibility: visible;
    pointer-events: auto;
  }

  .ma-nav__logo img,
  .ma-logo img {
    width: 4.5rem;
    margin-top: 0;
  }

  .ma-nav:not(.ma-nav--home) .ma-nav__logo::before {
    display: none;
  }

  .ma-nav__toggle {
    display: none;
  }

  .ma-title {
    font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  }

  .ma-rule {
    width: 7rem;
    margin: 3rem 0;
  }

  .ma-meta__value {
    font-size: 1.25rem;
  }

  .ma-accordion__trigger {
    font-size: clamp(1.15rem, 2vw, 1.5rem);
  }

  .ma-panel__controls {
    gap: 2rem;
    font-size: 14px;
  }

  .ma-col--left,
  .ma-col--right {
    padding-bottom: 20vh;
  }

  /* 2-column: content left (centered), panel right; meta/list bottom-left */
  .ma-layout:not(.ma-layout--split) {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr;
    align-items: stretch;
  }

  .ma-layout:not(.ma-layout--split) .ma-col--left {
    grid-column: 1;
    grid-row: 1;
    justify-content: center;
  }

  .ma-layout:not(.ma-layout--split) .ma-col--center {
    grid-column: 2;
    grid-row: 1;
  }

  .ma-layout:not(.ma-layout--split) .ma-col--right {
    grid-column: 1;
    grid-row: 1;
    justify-content: flex-end;
    padding-top: 0;
    z-index: 1;
    pointer-events: none;
  }

  .ma-layout:not(.ma-layout--split) .ma-col--right a {
    pointer-events: auto;
  }

  /* Tablet: footer stays inside text column */
  .ma-footer,
  body.home .ma-col--left .ma-footer {
    position: absolute;
    right: var(--ma-col-pad-x);
    bottom: 2rem;
    left: auto;
  }

  body.home .ma-col--left {
    position: relative;
  }

  body.home .ma-home-recent {
    display: none;
  }

  body.home .ma-col--right {
    display: none;
  }
}

/* Mobile: ≤968px */
@media (max-width: 968px) {
  .ma-rule {
    margin: 2rem 0;
  }

  .ma-prose {
    max-width: 100%;
  }

  body.contact .ma-form form {
    grid-template-columns: 1fr;
  }

  body.contact .ma-form .form-field:has([name="data[name]"]),
  body.contact .ma-form .form-field:has([name="data[email]"]) {
    grid-column: 1 / -1;
  }

  .ma-shell {
    --ma-shell-pad-x: 12px;
    padding: 0 var(--ma-shell-pad-x);
  }

  .ma-main {
    padding: 6px 0;
    height: auto;
    min-height: 0;
  }

  .ma-nav {
    grid-template-columns: 1fr auto;
    padding: 0;
    height: 0;
    overflow: visible;
    pointer-events: none;
  }

  .ma-nav__left {
    display: none;
  }

  .ma-nav__right {
    display: flex;
    position: static;
    padding: 0;
    justify-content: flex-end;
    align-items: center;
    gap: 1rem;
  }

  .ma-nav__right .ma-nav__link {
    display: none;
  }

  .ma-nav__logo {
    visibility: hidden;
    pointer-events: none;
  }

  .ma-nav--home .ma-nav__logo {
    visibility: hidden;
  }

  .ma-nav:not(.ma-nav--home) .ma-nav__logo::before {
    display: none;
  }

  .ma-nav__toggle {
    display: flex;
    position: fixed;
    top: 0;
    right: 0;
    z-index: 35;
    pointer-events: auto;
    padding: 20px 24px 12px 12px;
  }

  body.home .ma-col--center {
    position: relative;
  }

  body.home .ma-panel__autoplay {
    position: fixed;
    top: 3.35rem;
    right: 1.25rem;
    z-index: 36;
    pointer-events: auto;
  }

  body.project .ma-panel__frame {
    width: 2rem;
    height: 2rem;
  }

  .ma-panel__brand {
    display: none;
  }

  .ma-layout,
  .ma-layout--split {
    grid-template-columns: 1fr;
    min-height: auto;
    height: auto;
  }

  .ma-layout--split .ma-col--right {
    grid-column: auto;
  }

  .ma-layout--split::before {
    display: none;
  }

  .ma-col--left,
  .ma-col--right {
    padding: 1rem var(--ma-pad) 2rem;
  }

  .ma-col--center {
    order: -1;
    margin: 0 0 32px;
  }

  .ma-panel {
    width: 100%;
    height: 70vh;
    min-height: 70vh;
  }

  .ma-footer {
    position: static;
    margin-top: 2.5rem;
    align-self: flex-end;
  }

  /* Home mobile: panel first, opaque content below */
  body.home .ma-col--center {
    order: 1;
    margin: 0;
    width: 100%;
    position: relative;
    z-index: 1;
  }

  body.home .ma-panel {
    height: 70vh;
    min-height: 70vh;
  }

  body.home .ma-col--left {
    order: 2;
    height: auto;
    min-height: 70vh;
    /* Full-bleed bg under shell pad, but same content inset as project pages */
    margin: 0 calc(var(--ma-shell-pad-x) * -1);
    width: calc(100% + (var(--ma-shell-pad-x) * 2));
    padding: 1rem calc(var(--ma-shell-pad-x) + var(--ma-pad)) 8rem;
    background: var(--ma-bg);
    position: relative;
    z-index: 1;
    justify-content: flex-start;
  }

  body.home .ma-title {
    padding-top: 10vh;
    font-size: 32px;
  }

  body.home .ma-col--right {
    display: none;
  }

  body.home .ma-home-recent {
    display: none;
  }

  body.home .ma-col--left .ma-footer {
    position: absolute;
    margin-top: 0;
    right: calc(var(--ma-shell-pad-x) + var(--ma-pad));
    bottom: 1.25rem;
  }

  body.home .ma-panel__logo {
    display: none;
  }

  .ma-mobile-nav {
    display: none;
    position: fixed;
    inset: 0;
    background: #fff;
    z-index: 40;
    padding: 2.5rem 24px 1.5rem;
    flex-direction: column;
  }

  .ma-mobile-nav.is-open {
    display: flex;
  }

  .ma-mobile-nav__close {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 41;
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    padding: 20px 24px 12px 12px;
    background: #fff;
    border: 0;
    cursor: pointer;
  }

  .ma-mobile-nav__close-icon {
    position: relative;
    display: block;
    width: 1.35rem;
    height: 1.35rem;
  }

  .ma-mobile-nav__close-icon::before,
  .ma-mobile-nav__close-icon::after {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 2px;
    background: #000;
  }

  .ma-mobile-nav__close-icon::before {
    transform: translateY(-50%) rotate(45deg);
  }

  .ma-mobile-nav__close-icon::after {
    transform: translateY(-50%) rotate(-45deg);
  }

  .ma-mobile-nav__logo {
    display: block;
    width: 9.375rem;
    margin: 0.5rem 0 0;
  }

  .ma-mobile-nav__logo img {
    display: block;
    width: 100%;
    height: auto;
    filter: brightness(0);
  }

  .ma-mobile-nav__rule {
    width: 4rem;
    margin: 1.25rem 0 1.75rem;
  }

  .ma-mobile-nav__links {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
  }

  .ma-mobile-nav__links a {
    font-size: 1.35rem;
    font-family: var(--ma-font-display);
    font-weight: 700;
    color: var(--ma-text);
    text-decoration: none;
  }

  .ma-mobile-nav__legal {
    margin-top: auto;
    margin-right: 0;
    align-self: flex-end;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.35rem;
    padding: 0.15rem 0 0.15rem 1rem;
    border-left: 1px solid var(--ma-line);
    text-align: right;
  }

  .ma-mobile-nav__legal a {
    font-size: 0.8rem;
    color: var(--ma-text);
    text-decoration: none;
  }

  body.ma-nav-open {
    overflow: hidden;
  }

  body.ma-nav-open .ma-nav__toggle {
    visibility: hidden;
  }
}
