/* Wix Madefor (SIL OFL 1.1, see /fonts/OFL.txt), self-hosted so no visitor data
   goes to a font CDN. Variable weight 400–800; Cyrillic + Latin subsets only. */
@font-face { font-family: 'Wix Madefor Display'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url('/fonts/wix-madefor-display-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Wix Madefor Display'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url('/fonts/wix-madefor-display-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Wix Madefor Display'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url('/fonts/wix-madefor-display-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Wix Madefor Text'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url('/fonts/wix-madefor-text-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Wix Madefor Text'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url('/fonts/wix-madefor-text-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Wix Madefor Text'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url('/fonts/wix-madefor-text-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* Brand palette: light blue + brown on cream; night + caramel in dark mode. */
:root {
  --bg: #F6F1EA;
  --ink: #4A2D20;
  --muted: #6E5444;
  --line: #E2D6C8;
  --sky: #9CCFEC;
  --focus: #2A6E9C;

  --mark-inf: #3B87BA;
  --mark-stem: #4A2D20;

  --panel: #9CCFEC;
  --panel-ink: #4A2D20;
  --panel-inf: #4A2D20;
  --panel-stem: #4A2D20;

  --pill-bg: #9CCFEC;
  --pill-ink: #4A2D20;
  --highlight: #9CCFEC;
  --highlight-ink: #4A2D20;

  --display: 'Wix Madefor Display', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --text: 'Wix Madefor Text', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #22170F;
    --ink: #F6F1EA;
    --muted: #CDBBA8;
    --line: #3A2B20;
    --focus: #9CCFEC;

    --mark-inf: #9CCFEC;
    --mark-stem: #C99566;

    --panel: #2E2119;
    --panel-ink: #E9DCCB;
    --panel-inf: #9CCFEC;
    --panel-stem: #C99566;

    --pill-bg: #9CCFEC;
    --pill-ink: #22170F;
    --highlight: #9CCFEC;
    --highlight-ink: #22170F;
  }
}

/* Only one language is visible at a time; lang.js sets <html lang> before paint. */
html[lang="bg"] .l-en,
html[lang="en"] .l-bg { display: none; }

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 6px;
}

/* The Ф∞ mark lives once in <defs> and is drawn with <use>; each placement
   sets the colours, including the knockout colour that fakes the over/under gaps. */
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.mk-i { fill: var(--mk-inf); }
.mk-s { fill: var(--mk-stem); }
.mk-k { fill: var(--mk-k); }
.mk-halo { stroke: var(--mk-k); stroke-width: 14; stroke-linejoin: round; }
.mk-seam { stroke: var(--mk-inf); stroke-width: 0.8; stroke-linejoin: round; }

.page {
  min-height: 100vh;
  min-height: 100svh;
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(16px, 3vw, 32px) clamp(16px, 4vw, 48px);
  display: flex;
  flex-direction: column;
  gap: clamp(24px, 4vw, 48px);
}

/* Header */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  --mk-inf: var(--mark-inf);
  --mk-stem: var(--mark-stem);
  --mk-k: var(--bg);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  color: inherit;
  text-decoration: none;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.375rem;
  letter-spacing: -0.01em;
}
.brand-mark { width: 46px; height: 30px; flex: none; }

.lang {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
}
.lang button {
  min-width: 48px;
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: 600 0.875rem/1 var(--display);
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.lang button:hover { background: var(--line); }
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

/* Hero: copy on the left, the light-blue panel with the mark on the right. */
.hero {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  align-items: center;
  gap: clamp(24px, 5vw, 72px);
}

.panel {
  --mk-inf: var(--panel-inf);
  --mk-stem: var(--panel-stem);
  --mk-k: var(--panel);
  order: 2;
  position: relative;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  border-radius: clamp(24px, 3vw, 40px);
  background: var(--panel);
  color: var(--panel-ink);
  overflow: hidden;
}
.hero-mark { width: 76%; height: auto; overflow: visible; }

.panel-label {
  position: absolute;
  font: 600 0.8125rem/1 var(--display);
  letter-spacing: 0.06em;
}
.panel-label--top { top: clamp(18px, 2.2vw, 28px); left: clamp(20px, 2.4vw, 30px); }

.copy {
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 2vw, 24px);
  max-width: 42rem;
}

.kicker {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  padding: 9px 15px 9px 13px;
  border-radius: 999px;
  background: var(--pill-bg);
  color: var(--pill-ink);
  font: 600 0.875rem/1.1 var(--display);
}
.kicker::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: currentColor;
}

h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.5rem, 1.3rem + 3.2vw, 4.25rem);
  line-height: 1.04;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.lede {
  margin: 0;
  max-width: 34em;
  color: var(--muted);
  font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
  text-wrap: pretty;
}

.contact {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 8px 0 0;
}
.contact-label { color: var(--muted); font-size: 0.9375rem; }
.contact-link {
  align-self: flex-start;
  padding: 0 3px;
  margin-left: -3px;
  color: var(--ink);
  font: 600 clamp(1.375rem, 1.1rem + 1vw, 1.875rem)/1.25 var(--display);
  text-decoration: none;
  background-image: linear-gradient(var(--highlight), var(--highlight));
  background-repeat: no-repeat;
  background-position: 0 92%;
  background-size: 100% 0.3em;
  transition: background-size 0.25s ease, color 0.25s ease;
}
.contact-link:hover,
.contact-link:focus-visible { background-size: 100% 100%; color: var(--highlight-ink); }

.notfound { flex: 1; justify-content: center; }

/* Footer */
.bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.875rem;
}

/* Phones and narrow tablets: the panel moves above the copy and gets shorter. */
@media (max-width: 860px) {
  .hero { grid-template-columns: minmax(0, 1fr); align-items: start; align-content: start; }
  .panel { order: 0; aspect-ratio: 16 / 10; }
  .hero-mark { width: 64%; }
  .copy { max-width: none; }
}
@media (max-width: 380px) {
  .brand { font-size: 1.2rem; gap: 10px; }
  .brand-mark { width: 40px; height: 26px; }
}

/* The small animation: the ∞ draws itself with one pen stroke, then the Ф stem
   grows out of the crossing. Masks hold the reveal; the shapes stay static. */
.draw { fill: none; stroke: #fff; stroke-linecap: round; stroke-dasharray: 1 1; stroke-dashoffset: 0; }
.draw-inf { stroke-width: 64; }
.draw-stem { stroke-width: 40; }

@media (prefers-reduced-motion: no-preference) {
  .draw-inf { animation: draw 2.2s cubic-bezier(0.65, 0, 0.35, 1) 0.35s both; }
  .draw-stem { animation: draw 0.8s cubic-bezier(0.3, 0, 0.2, 1) 2.3s both; }
  .kicker::before { animation: breathe 2.8s ease-in-out infinite; }
  .copy > * { animation: rise 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .copy > :nth-child(2) { animation-delay: 0.08s; }
  .copy > :nth-child(3) { animation-delay: 0.16s; }
  .copy > :nth-child(4) { animation-delay: 0.24s; }
}

@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes breathe { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.35; transform: scale(0.7); } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
