@import url("https://fonts.googleapis.com/css2?family=PT+Sans:wght@400&family=PT+Sans+Narrow:wght@400&display=swap");
/* #84 WiK Codex — Homepage visual prototype v3 (2026-10-11)
   Loaded AFTER css/styles.css; all overrides are scoped to body.home-page.
   No CSS gap property is used. No calculator/database/Tips styles are changed. */

body.home-page {
  background: #0c1111;
  color: #eae8e3;
}

body.home-page::before { content: none; }

.home-page .home-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-color: #121a18;
  background-image: url("../assets/bg/top-restoration-bg.webp");
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center top;
}

/* The left side protects copy; the lower vignette gives the cards contrast.
   The underlying medieval landscape remains visible through the glass. */
.home-page .home-backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(6, 11, 11, 0.62) 0%, rgba(7, 11, 11, 0.25) 48%, rgba(7, 11, 11, 0.03) 86%),
    linear-gradient(180deg, rgba(7, 10, 11, 0.2) 0%, rgba(7, 10, 11, 0.04) 25%, rgba(8, 13, 12, 0.19) 48%, rgba(4, 8, 9, 0.37) 100%);
}

.home-page .page-shell {
  position: relative;
  z-index: 1;
  max-width: 43.5em;
  padding-top: 0.55rem;
  padding-bottom: 1.5rem;
}

/* Header: no decorative frame; preserve the existing language menu logic. */
.home-page .site-header { min-height: 3.35rem; }
.home-page .brand-mark { width: 2.85rem; height: 2.85rem; margin-right: 0.52rem; }
.home-page .brand-kicker {
  color: var(--gold-2);
  font-size: 0.56rem;
  font-weight: 550;
  letter-spacing: 0.085em;
}
.home-page .brand-title {
  color: #edeae2;
  font-size: 0.84rem;
  font-weight: 540;
  letter-spacing: 0.005em;
}
.home-page .language-toggle {
  min-height: 2.75rem;
  padding: 0 0.55rem;
  background: rgba(15, 21, 20, 0.25);
  color: #e0d4be;
  font-size: 0.78rem;
  font-weight: 500;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.home-page .language-icon { stroke-width: 1.5; }
.home-page .language-menu {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(20, 27, 25, 0.86);
  backdrop-filter: blur(20px) saturate(115%);
  -webkit-backdrop-filter: blur(20px) saturate(115%);
}
.home-page .language-option { font-weight: 500; }
.home-page .language-option.is-active { background: #c6a575; color: #131511; }
.home-page .language-toggle:focus-visible,
.home-page .language-option:focus-visible { outline: 2px solid #d3b586; outline-offset: 2px; }

/* Hero: the image is on the fixed page backdrop, NOT in this section.
   This keeps the restored church/village visible at the top on mobile. */
.home-page .main-content { margin-top: 0; }
.home-page .hero {
  width: 100%;
  min-height: clamp(150px, 20svh, 204px);
  margin: 0;
  padding: 0 0.35rem 0.7rem;
  background: transparent;
  border: 0;
  box-shadow: none;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
}
.home-page .hero-surface {
  width: 100%;
  max-width: none;
  padding: 0;
}
.home-page .hero-kicker{
  color: var(--gold-2);
  font-size: 0.62rem;
  font-weight: 550;
  line-height: 1.35;
  letter-spacing: 0.19em;
}
.home-page .hero-title {
  max-width: none;
  margin: 0.56rem 0 0;
  color: #f0eee9;
  font-size: clamp(1.36rem, 5.95vw, 1.60rem);
  font-family: "Marcellus", Georgia, serif;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
}
.home-page .hero-text {
  width: 100%;
  max-width: 28rem;
  margin: 0.65rem 0 0;
  color: #dadbd4;
  font-size: 0.77rem;
  font-weight: 420;
  line-height: 1.6;
  white-space: normal;
  overflow-wrap: break-word;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.65);
}
html[lang="ja"] .home-page .hero-text {
  white-space: nowrap;
}

/* Tool navigation: glass surfaces with a fine top reflection, not gold boxes. */
.home-page .tool-section { margin-top: 0.3rem; }

.home-page .tool-list { margin-top: 0.85rem; }
/* Mask the frosted-glass layer so the icon window shows the original backdrop. */
.home-page .tool-card,
.home-page .tool-card.is-primary {
  --icon-frame: 3.15rem;
  --icon-offset: 0.76rem;
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  min-height: 5.1rem;
  padding: 0.68rem 0.76rem;
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 1.16rem;
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  color: #eae8e3;
  box-shadow: 0 0.7rem 1.5rem rgba(0, 0, 0, 0.18);
  text-decoration: none;
  transform: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}
.home-page .tool-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(145deg, rgba(239, 245, 232, 0.11) 0%, rgba(220, 234, 224, 0.035) 40%, rgba(26, 38, 33, 0.07) 90%),
    rgba(13, 20, 19, 0.40);
  -webkit-backdrop-filter: blur(16px) saturate(118%);
  backdrop-filter: blur(16px) saturate(118%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
  -webkit-mask-image:
  linear-gradient(#000 0 0),
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Crect width='100' height='100' rx='24' fill='black'/%3E%3C/svg%3E");
  -webkit-mask-size: 100% 100%, var(--icon-frame) var(--icon-frame);
  -webkit-mask-position: 0 0, var(--icon-offset) center;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-composite: xor;
  mask-image:
  linear-gradient(#000 0 0),
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Crect width='100' height='100' rx='24' fill='black'/%3E%3C/svg%3E");
  mask-size: 100% 100%, var(--icon-frame) var(--icon-frame);
  mask-position: 0 0, var(--icon-offset) center;
  mask-repeat: no-repeat;
  mask-composite: exclude;
}
.home-page .tool-card > * { position: relative; z-index: 1; }
.home-page .tool-card + .tool-card { margin-top: 0.72rem; }
.home-page .tool-card:hover,
.home-page .tool-card:active {
  border-color: rgba(255, 255, 255, 0.09);
  box-shadow: 0 0.9rem 1.8rem rgba(0, 0, 0, 0.22);
  transform: translateY(-1px);
}
.home-page .tool-card:hover::before,
.home-page .tool-card:active::before { background-color: rgba(16, 23, 22, 0.50); }
.home-page .tool-card:focus-visible {
  outline: 2px solid #d3b586;
  outline-offset: 3px;
}
.home-page .tool-icon {
  flex: 0 0 var(--icon-frame);
  width: var(--icon-frame);
  height: var(--icon-frame);
  margin-right: 0.78rem;
  padding: 0.46rem;
  border: 0;
border-radius: 0;
background: transparent;
box-shadow: none;
  color: #c6a575;
  font-size: inherit;
  font-weight: 500;
}
.home-page .tool-icon img { width: 100%; height: 100%; object-fit: contain; }
.home-page .tool-body { min-width: 0; padding-right: 0.42rem; }
.home-page .tool-title {
  color: #f0eee9;
  font-size: 0.89rem;
  font-weight: 520;
  line-height: 1.30;
  letter-spacing: 0.005em;
  overflow-wrap: break-word;
  word-break: normal;
}
.home-page .tool-desc {
  margin-top: 0.2rem;
  color: #c0c7c0;
  font-size: 0.73rem;
  font-weight: 400;
  line-height: 1.40;
  overflow-wrap: break-word;
  word-break: normal;
}
.home-page .tool-action {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  min-height: 2.75rem;
  margin-left: 0.25rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #d8c9ad;
  font-size: 0;
  font-weight: 350;
}
.home-page .tool-action::after { content: "›"; font-size: 1.72rem; line-height: 1; font-weight: 300; }
.home-page .tool-card:hover .tool-action,
.home-page .tool-card:focus-visible .tool-action,
.home-page .tool-card:active .tool-action { background: transparent; color: #e4d4b4; }

/* Subordinate footer text: all original disclaimers remain in HTML. */
.home-page .site-footer { margin-top: 2.2rem; color: rgba(234, 232, 227, 0.6); font-weight: 450; }
.home-page .site-footer-disclaimer { color: rgba(228, 231, 220, 0.53); font-size: 0.625rem; line-height: 1.5; }

/* Language-specific typography */
html[lang="en"] .home-page .tool-title {
  text-transform: none;
  font-size: 0.89rem;
  letter-spacing: 0.005em;
}

html[lang="es"] .home-page .tool-title {
  font-size: 0.89rem;
  letter-spacing: 0;
}

/* Russian typography */
html[lang="ru"] .home-page .hero-text {
  font-family: "PT Sans", sans-serif;
  font-size: 0.74rem;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0;
}

html[lang="ru"] .home-page .section-title {
  font-size: 0.96rem;
  line-height: 1.25;
  letter-spacing: 0;
}

html[lang="ru"] .home-page .tool-title {
  font-family: "PT Sans Narrow", sans-serif;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.28;
  letter-spacing: 0;
}

html[lang="ru"] .home-page .tool-desc {
  font-family: "PT Sans", sans-serif;
  font-size: 0.73rem;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0;
}

html[lang="ru"] .home-page .language-current {
  letter-spacing: 0;
}

html[lang="ru"] .home-page .hero-kicker,
html[lang="ru"] .home-page .section-kicker {
  letter-spacing: 0.08em;
}

@media (max-width: 380px) {
  .home-page .page-shell { padding-left: 0.83rem; padding-right: 0.83rem; }
  .home-page .hero { min-height: clamp(148px, 20svh, 176px); padding-left: 0.2rem; }
  .home-page .hero-title { font-size: 1.36rem; letter-spacing: 0.035em; }
  .home-page .tool-card,
  .home-page .tool-card.is-primary { --icon-frame: 3rem; --icon-offset: 0.68rem; padding-left: 0.68rem; padding-right: 0.68rem; }
  .home-page .tool-icon { margin-right: 0.68rem; }
  .home-page .tool-title { font-size: 0.87rem; }
  .home-page .tool-desc { font-size: 0.71rem; }
}

/* Desktop: expand the fixed portrait artwork across the entire viewport.
   The mobile composition is unchanged; desktop uses cover with a subtle
   overlay to prevent the bright sky from competing with the navigation. */
@media (min-width: 700px) {
  .home-page .home-backdrop {
    background-size: cover;
    background-position: center top;
  }
  .home-page .home-backdrop::after {
    background:
      linear-gradient(90deg, rgba(4, 10, 10, 0.72) 0%, rgba(4, 10, 10, 0.34) 42%, rgba(4, 10, 10, 0.34) 70%, rgba(4, 10, 10, 0.62) 100%),
      linear-gradient(180deg, rgba(4, 8, 8, 0.15), rgba(4, 8, 8, 0.38) 100%);
  }
  .home-page .page-shell { padding-left: 1.45rem; padding-right: 1.45rem; }
  .home-page .hero { min-height: 210px; }
  .home-page .hero-title { font-size: 1.82rem; }
  .home-page .hero-text { font-size: 0.84rem; }
}

@media (prefers-reduced-motion: reduce) {
  .home-page .tool-card,
  .home-page .tool-card.is-primary { transition: none; }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .home-page .tool-card::before { background: rgba(24, 31, 29, 0.9); }
}
