/* Midnight Hearts: shared layer for pennygachi.men and every project site.
   Fonts, studio bar, buttons, skip link and footer live here. Each site keeps its
   own palette by overriding the --mh-* colors after this file is loaded. */

/* Cuprum: SIL OFL 1.1, subset to Latin and Cyrillic (fonts/OFL.txt) */
@font-face {
  font-family: "Cuprum";
  src: url("fonts/cuprum-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Cuprum";
  src: url("fonts/cuprum-bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --mh-bg: #0f1226;
  --mh-surface: #181c3a;
  --mh-line: #2a3058;
  --mh-text: #eceef7;
  --mh-muted: #a6adc8;
  --mh-accent: #eceef7;
  --mh-on-accent: #0f1226;
  --mh-bar-bg: var(--mh-bg);
  --mh-foot-bg: var(--mh-bg);
  --mh-radius: 6px;

  --mh-font: "Cuprum", "Arial Narrow", sans-serif;
  --mh-mono: "Cascadia Mono", Consolas, ui-monospace, monospace;
  --mh-page: 75rem;
  --mh-gutter: clamp(16px, 4vw, 40px);

  /* One type scale for every site, body is 1.1875rem */
  --mh-lead: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  --mh-h3: 1.5rem;
  --mh-h2: clamp(2rem, 1.5rem + 1.8vw, 2.75rem);
}

/* ---------- skip link ---------- */

.mh-skip {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 8px 14px;
  border-radius: var(--mh-radius);
  background: var(--mh-accent);
  color: var(--mh-on-accent);
  font: 700 1.0625rem/1.3 var(--mh-font);
  text-decoration: none;
}
.mh-skip:focus { top: 12px; }

/* ---------- studio bar: home link and every project, current one marked ---------- */

.mh-bar {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 48px;
  padding-inline: var(--mh-gutter);
  background: var(--mh-bar-bg);
  border-bottom: 1px solid var(--mh-line);
  color: var(--mh-muted);
  font: 400 1.0625rem/1.2 var(--mh-font);
  letter-spacing: 0;
}
.mh-bar a {
  color: inherit;
  text-decoration: none;
}
.mh-bar a:hover { color: var(--mh-text); }
.mh-bar :focus-visible {
  outline: 2px solid var(--mh-accent);
  outline-offset: -2px;
  border-radius: 2px;
}

.mh-bar__home {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  color: var(--mh-text) !important;
  font-weight: 700;
}
.mh-heart {
  width: 18px;
  height: 18px;
  flex: none;
  fill: currentColor;
}

.mh-bar__list {
  position: relative;
  display: flex;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent);
  mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent);
}
.mh-bar__list::-webkit-scrollbar { display: none; }
.mh-bar__list a {
  position: relative;
  display: block;
  padding: 14px 10px;
  white-space: nowrap;
}
.mh-bar__list a[aria-current="page"] { color: var(--mh-text); }
.mh-bar__list a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 0;
  height: 2px;
  background: var(--mh-accent);
}

@media (min-width: 66rem) {
  .mh-bar__list {
    margin-left: auto;
    -webkit-mask-image: none;
    mask-image: none;
  }
}

/* ---------- buttons ---------- */

.mh-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.mh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 22px;
  border: 1px solid var(--mh-line);
  border-radius: var(--mh-radius);
  background: var(--mh-surface);
  color: var(--mh-text);
  font: 700 1.1875rem/1.1 var(--mh-font);
  letter-spacing: 0;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color 0.15s, border-color 0.15s, filter 0.15s;
}
.mh-btn:hover {
  border-color: var(--mh-muted);
  color: var(--mh-text);
}
.mh-btn:active { transform: translateY(1px); }
.mh-btn:focus-visible {
  outline: 2px solid var(--mh-accent);
  outline-offset: 3px;
}
.mh-btn--primary {
  border-color: var(--mh-accent);
  background: var(--mh-accent);
  color: var(--mh-on-accent);
}
.mh-btn--primary:hover {
  border-color: var(--mh-accent);
  color: var(--mh-on-accent);
  filter: brightness(1.12);
}
.mh-btn--primary:focus-visible { outline-color: var(--mh-text); }
.mh-btn svg {
  width: 1.1em;
  height: 1.1em;
  flex: none;
  fill: currentColor;
}
.mh-btn small {
  font-size: 0.85em;
  font-weight: 400;
  opacity: 0.8;
}

/* ---------- footer: the product's own note, then the whole studio ---------- */

.mh-foot {
  background: var(--mh-foot-bg);
  color: var(--mh-muted);
  border-top: 1px solid var(--mh-line);
  font: 400 1.0625rem/1.5 var(--mh-font);
  letter-spacing: 0;
}
.mh-foot__in {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 40px;
  max-width: calc(var(--mh-page) + 2 * var(--mh-gutter));
  margin: 0 auto;
  padding: 48px var(--mh-gutter) 40px;
}
@media (min-width: 52rem) {
  .mh-foot__in { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); column-gap: 64px; }
}
.mh-foot p {
  max-width: 38rem;
  margin: 0;
}
.mh-foot p + p { margin-top: 0.6em; }
.mh-foot a {
  color: var(--mh-text);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
.mh-foot a:hover { text-decoration-thickness: 2px; }
.mh-foot :focus-visible {
  outline: 2px solid var(--mh-accent);
  outline-offset: 3px;
  border-radius: 2px;
}
.mh-foot__links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
}

.mh-foot__nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 28px 32px;
}
.mh-foot__nav h2 {
  margin: 0 0 10px;
  color: var(--mh-text);
  font: 700 1.0625rem/1.3 var(--mh-font);
  letter-spacing: 0;
}
.mh-foot__nav ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.mh-foot__nav a {
  color: var(--mh-muted);
  text-decoration: none;
}
.mh-foot__nav a:hover {
  color: var(--mh-text);
  text-decoration: underline;
}
.mh-foot__nav a[aria-current="page"] { color: var(--mh-text); }

.mh-foot__copy {
  grid-column: 1 / -1;
  max-width: none !important;
  padding-top: 20px;
  border-top: 1px solid var(--mh-line);
  font-size: 1rem;
}

@media (prefers-reduced-motion: reduce) {
  .mh-btn { transition: none; }
  .mh-btn:active { transform: none; }
}
