:root {
  --mt-header-h: 72px;
  --mt-page-w: 1120px;
  --mt-measure: 760px;
  --color-bg: #fff9f6;
  --color-ink: #1a1a1a;
  --color-muted: #5c534e;
  --color-line: #e8d9d2;
  --color-primary: #ff7675;
  --color-primary-soft: #ff9999;
  --color-accent: #c0392b;
  --color-accent-hover: #922b21;
  --color-on-accent: #ffffff;
  --color-card: #ffffff;
  --font-display: "Playfair Display", Georgia, serif;
  --font-body: "Source Sans 3", "Source Sans Pro", "Segoe UI", sans-serif;
  --radius: 0;
  --space-sm: 12px;
  --space-md: 24px;
  --space-lg: 48px;
  --space-xl: 72px;
}

[hidden] { display: none !important; }

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

html, body {
  max-width: 100%;
  overflow-x: clip;
  margin: 0;
}

html { scroll-padding-top: var(--mt-header-h); }

body {
  padding-top: var(--mt-header-h);
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.65;
}

img, video, iframe {
  max-width: 100%;
  height: auto;
  display: block;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.2;
  font-weight: 700;
  margin: 0 0 0.6em;
}

p { margin: 0 0 1em; }

a:not(.mt-btn) { color: var(--color-accent); }
a:not(.mt-btn):hover { color: var(--color-accent-hover); }

.mt-container {
  width: 100%;
  max-width: var(--mt-page-w);
  margin: 0 auto;
  padding-inline: 20px;
}

.mt-prose {
  max-width: var(--mt-measure);
}

.mt-section {
  padding-block: var(--space-lg);
  border-top: 1px solid var(--color-line);
}

.mt-section--title {
  font-size: clamp(1.5rem, 2.4vw, 2rem);
}

.mt-section--lead,
.mt-lead {
  color: var(--color-muted);
  font-size: 1.08rem;
}

.mt-kicker {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-primary);
  margin: 0 0 12px;
}

.mt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.mt-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  min-height: var(--mt-header-h);
  background: var(--color-bg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.mt-header--row {
  min-height: var(--mt-header-h);
  display: flex;
  align-items: center;
  gap: 20px;
}

.mt-header--logo {
  display: flex;
  align-items: center;
  color: var(--color-ink);
  text-decoration: none;
  flex-shrink: 0;
}

.mt-header--logo svg {
  width: 180px;
  height: 40px;
  display: block;
}

.mt-header a:not(.mt-btn),
.mt-header a:not(.mt-btn):visited {
  color: var(--color-ink);
  text-decoration: none;
  font-weight: 600;
}

.mt-nav {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 14px;
  margin-left: auto;
  min-width: 0;
}

.mt-nav a {
  white-space: nowrap;
  font-size: 0.92rem;
  border-bottom: 2px solid transparent;
  padding-bottom: 2px;
}

.mt-nav a.is-active,
.mt-nav a:hover {
  border-bottom-color: var(--color-primary);
}

.mt-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0 11px;
  flex-shrink: 0;
  border: 1px solid var(--color-line);
  background: var(--color-card);
  color: var(--color-ink);
  cursor: pointer;
  border-radius: var(--radius);
}

.mt-burger span {
  display: block;
  flex: 0 0 2px;
  width: 100%;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
}

.mt-overlay,
.mt-drawer {
  display: none;
}

.mt-utility {
  background: #fff0eb;
  border-bottom: 1px solid var(--color-line);
  font-size: 0.85rem;
  color: var(--color-muted);
}

.mt-utility--row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  justify-content: space-between;
  padding-block: 8px;
  min-width: 0;
}

.mt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border-radius: var(--radius);
  border: 2px solid transparent;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.98rem;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  position: relative;
  isolation: isolate;
  background: transparent;
  color: var(--color-ink);
  box-shadow: inset 0 -2px 0 var(--color-primary);
  transition: color 0.2s, background 0.2s, box-shadow 0.2s;
}

.mt-btn:hover,
.mt-btn:focus-visible,
.mt-btn:active {
  color: var(--color-accent);
  background: transparent;
  box-shadow: inset 0 -3px 0 var(--color-accent);
}

a.mt-btn__primary,
a.mt-btn__primary:visited,
button.mt-btn__primary {
  color: var(--color-on-accent);
  background: var(--color-accent);
  border-color: var(--color-accent);
  box-shadow: none;
}

a.mt-btn__primary:hover,
a.mt-btn__primary:focus-visible,
a.mt-btn__primary:active,
button.mt-btn__primary:hover,
button.mt-btn__primary:focus-visible,
button.mt-btn__primary:active {
  color: var(--color-on-accent);
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
  box-shadow: none;
}

.mt-header a.mt-btn__primary,
.mt-header a.mt-btn__primary:visited {
  color: var(--color-on-accent);
}

.mt-hero a.mt-btn,
.mt-hero a.mt-btn:visited {
  color: var(--color-ink);
}

.mt-hero a.mt-btn__primary,
.mt-hero a.mt-btn__primary:visited {
  color: var(--color-on-accent);
}

.mt-cta a.mt-btn__primary,
.mt-cta a.mt-btn__primary:visited {
  color: var(--color-on-accent);
}

.mt-hero {
  padding-block: var(--space-xl) var(--space-lg);
  background:
    linear-gradient(180deg, #fff0eb 0%, var(--color-bg) 70%);
  border-bottom: 1px solid var(--color-line);
}

.mt-hero--grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 40px;
  align-items: center;
}

.mt-hero--title {
  font-size: clamp(1.9rem, 4vw, 3rem);
  max-width: 18ch;
}

.mt-hero--figs {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin: 24px 0;
}

.mt-hero--figs dt {
  color: var(--color-muted);
  font-size: 0.85rem;
  margin: 0;
}

.mt-hero--figs dd {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 700;
  line-height: 1;
  color: var(--color-accent);
}

.mt-hero--text {
  color: var(--color-muted);
  max-width: 52ch;
}

.mt-hero--still {
  max-height: 420px;
  width: auto;
  border: 1px solid var(--color-line);
  background: var(--color-card);
}

.mt-app--badges {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-primary);
}

.mt-app--head {
  display: flex;
  gap: 20px;
  align-items: center;
  margin: 16px 0 20px;
  min-width: 0;
}

.mt-app--icon {
  width: 96px;
  height: 96px;
  border-radius: 22%;
  object-fit: contain;
  flex-shrink: 0;
  border: 1px solid var(--color-line);
}

.mt-app--meta { min-width: 0; }

.mt-app--name {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0 0 6px;
}

.mt-app--dev {
  color: var(--color-muted);
  margin: 0;
  overflow-wrap: anywhere;
}

.mt-app--facts {
  margin: 0 0 16px;
  padding-left: 1.2em;
}

.mt-app--facts li { margin-bottom: 6px; }

.mt-app--note,
.mt-app--checked {
  color: var(--color-muted);
}

.mt-stills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 220px));
  justify-content: center;
  gap: 20px;
}

.mt-stills figure { margin: 0; }

.mt-stills img {
  width: 100%;
  height: auto;
  border: 1px solid var(--color-line);
  background: var(--color-card);
}

.mt-desk--quote {
  margin: 0;
  padding: 24px 0 24px 20px;
  border-left: 3px solid var(--color-primary);
  font-family: var(--font-display);
  font-size: 1.25rem;
  line-height: 1.45;
}

.mt-desk--quote p:first-child::first-letter {
  font-size: 2.4em;
  float: left;
  line-height: 0.85;
  padding-right: 8px;
  color: var(--color-accent);
}

.mt-compare--list {
  margin: 0;
  padding-left: 1.2em;
}

.mt-compare--list li { margin-bottom: 12px; }

.mt-articles--list,
.mt-log {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
}

.mt-articles--item,
.mt-log--item {
  padding: 18px 0;
  border-bottom: 1px solid var(--color-line);
  min-width: 0;
}

.mt-articles--item a,
.mt-log--title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--color-ink);
}

.mt-articles--item a:hover,
.mt-log--title:hover {
  color: var(--color-accent);
}

.mt-articles--item p,
.mt-log--excerpt {
  margin: 8px 0;
  color: var(--color-muted);
}

.mt-log--date,
.mt-articles--item time {
  font-size: 0.85rem;
  color: var(--color-muted);
}

.mt-cta {
  background: #fff0eb;
  text-align: left;
}

.mt-footer {
  background: #2b1d1b;
  color: #f6ece8;
  padding-block: 48px 32px;
}

.mt-footer a:not(.mt-btn),
.mt-footer a:not(.mt-btn):visited {
  color: #f6ece8;
}

.mt-footer--grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px;
  margin-bottom: 28px;
}

.mt-footer--brand {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin: 0 0 10px;
}

.mt-footer--heading {
  font-weight: 700;
  margin: 0 0 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.8rem;
  color: var(--color-primary-soft);
}

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

.mt-footer--list li { margin-bottom: 8px; }

.mt-footer--link {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
}

.mt-footer--about,
.mt-footer--legal {
  color: #d9c7c1;
  font-size: 0.95rem;
}

.mt-cookie { display: none; }

.mt-cookie:not([hidden]) {
  display: flex;
  flex-direction: column;
  position: fixed;
  z-index: 110;
  right: 16px;
  bottom: 16px;
  left: auto;
  max-width: 360px;
  gap: 12px;
  padding: 16px;
  background: var(--color-card);
  color: var(--color-ink);
  border: 1px solid var(--color-line);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  border-radius: var(--radius);
}

.mt-cookie a,
.mt-cookie a:visited { color: var(--color-accent); }

.mt-cookie--actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mt-cookie .mt-btn {
  min-height: 44px;
  box-shadow: none;
}

.mt-cookie button.mt-btn__primary,
.mt-cookie button.mt-btn__primary:hover {
  color: var(--color-on-accent);
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.mt-cookie button.mt-btn__primary:hover {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
}

.mt-crumbs {
  margin: 8px 0 24px;
  font-size: 0.85rem;
}

.mt-crumbs--list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
  color: var(--color-muted);
}

.mt-crumbs--item:not(:last-child)::after {
  content: "/";
  margin-left: 6px;
  color: var(--color-line);
}

.mt-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: mtstep;
}

.mt-steps > li {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--color-line);
}

.mt-check {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
}

.mt-check li {
  position: relative;
  padding: 10px 0 10px 32px;
  border-bottom: 1px solid var(--color-line);
  min-width: 0;
}

.mt-check li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 16px;
  width: 14px;
  height: 8px;
  border-left: 2px solid var(--color-accent);
  border-bottom: 2px solid var(--color-accent);
  transform: rotate(-45deg);
}

.mt-article--intro::first-letter {
  font-family: var(--font-display);
  font-size: 3.2em;
  float: left;
  line-height: 0.85;
  padding-right: 10px;
  color: var(--color-accent);
}

.mt-series {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--color-line);
}

.mt-series--label {
  font-size: 0.85rem;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.mt-series--row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.mt-series--link,
.mt-series--index {
  min-width: 0;
  overflow-wrap: anywhere;
  text-decoration: none;
  color: var(--color-ink);
  border: 1px solid var(--color-line);
  padding: 12px;
  background: var(--color-card);
}

.mt-series--link:hover,
.mt-series--index:hover {
  border-color: var(--color-primary);
}

.mt-series--link__empty {
  color: var(--color-muted);
  border-style: dashed;
}

.mt-series--index {
  text-align: center;
  font-weight: 700;
  color: var(--color-accent);
}

.mt-faq--item {
  border: 1px solid var(--color-line);
  margin-bottom: 8px;
  background: var(--color-card);
}

.mt-faq--item summary {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}

.mt-faq--item summary::-webkit-details-marker { display: none; }

.mt-faq--item summary::after {
  content: "+";
  font-size: 1.2rem;
  color: var(--color-accent);
}

.mt-faq--item[open] summary::after { content: "–"; }

.mt-faq--item p {
  margin: 0;
  padding: 0 16px 16px;
  color: var(--color-muted);
}

.mt-form--field {
  margin-bottom: 16px;
  min-width: 0;
}

.mt-form label {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
}

.mt-form input,
.mt-form textarea,
.mt-search--input {
  width: 100%;
  max-width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  background: var(--color-card);
  font: inherit;
  color: var(--color-ink);
}

.mt-form textarea { min-height: 140px; resize: vertical; }

.mt-form--error { color: var(--color-accent); font-size: 0.9rem; margin: 6px 0 0; }

.mt-form--ok {
  margin-top: 12px;
  color: #1e6b3a;
}

.mt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.mt-table th,
.mt-table td {
  border: 1px solid var(--color-line);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  min-width: 0;
  overflow-wrap: anywhere;
}

.mt-table th { background: #fff0eb; }

.mt-glossary dt {
  font-weight: 700;
  margin-top: 16px;
}

.mt-glossary dd {
  margin: 4px 0 0;
  color: var(--color-muted);
}

.mt-alpha {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0 24px;
}

.mt-alpha a {
  min-width: 36px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-line);
  text-decoration: none;
  color: var(--color-ink);
}

.mt-search--label {
  display: block;
  font-weight: 700;
  margin-bottom: 8px;
}

.mt-search--list {
  list-style: none;
  margin: 16px 0 24px;
  padding: 0;
}

.mt-search--list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--color-line);
}

.mt-js .mt-reveal {
  filter: blur(6px);
  opacity: 0.35;
  transition: filter 0.55s ease, opacity 0.55s ease;
}

.mt-js .mt-reveal.mt-reveal__in {
  filter: none;
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .mt-js .mt-reveal {
    filter: none;
    opacity: 1;
    transition: none;
  }
}

@media (max-width: 1100px) {
  :root { --mt-header-h: 56px; }
  .mt-nav { gap: 10px; }
  .mt-nav a { font-size: 0.84rem; }
}

@media (max-width: 900px) {
  :root { --mt-header-h: 56px; }

  .mt-nav { display: none; }

  .mt-header--row {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .mt-burger {
    display: flex;
    order: 99;
    margin-left: auto;
  }

  .mt-header--logo svg {
    width: 126px;
    height: 28px;
    max-width: calc(100vw - 150px);
  }

  .mt-overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
  }

  .mt-drawer {
    display: block;
    position: fixed;
    z-index: 210;
    background: var(--color-bg);
    overflow-y: auto;
    visibility: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s;
  }

  .mt-drawer__sheet {
    inset: 0;
    height: 100vh;
    height: 100dvh;
    padding: 72px 24px 32px;
    opacity: 0;
  }

  .mt-drawer a {
    display: block;
    padding: 14px 20px;
    font-size: 1.35rem;
    color: var(--color-ink);
    text-decoration: none;
    border-bottom: 1px solid var(--color-line);
  }

  .mt-drawer a:not(.mt-btn) { color: var(--color-ink); }

  .mt-drawer--close {
    position: absolute;
    top: 12px;
    right: 16px;
    width: 44px;
    height: 44px;
    border: 1px solid var(--color-line);
    background: var(--color-card);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
  }

  .mt-drawer--store {
    margin-top: 20px;
    text-align: center;
  }

  body.nav-open { overflow: hidden; }
  body.nav-open .mt-drawer__sheet {
    visibility: visible;
    opacity: 1;
  }
  body.nav-open .mt-overlay { display: none; }

  .mt-hero--grid { grid-template-columns: minmax(0, 1fr); }
  .mt-hero--still {
    max-height: 320px;
    justify-self: center;
  }

  .mt-footer--grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mt-series--row { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  :root { --mt-header-h: 52px; }
  .mt-container { padding-inline: 16px; }
  .mt-section { padding-block: 40px; }
  .mt-actions { flex-direction: column; align-items: stretch; }
  .mt-actions .mt-btn { white-space: normal; }
}

@media (max-width: 520px) {
  .mt-app--head { flex-direction: column; align-items: flex-start; }
  .mt-app--icon { width: 72px; height: 72px; }
  .mt-cookie:not([hidden]) {
    left: 12px;
    right: 12px;
    bottom: 12px;
    max-width: none;
  }
  .mt-footer--grid { grid-template-columns: 1fr; }
}

@media (min-width: 901px) {
  .mt-burger,
  .mt-overlay,
  .mt-drawer {
    display: none !important;
  }
}
