/* Avlija · public site
   Serbian community brand: wine + navy + kilim geometry on warm white */

:root {
  --bg: #faf8f6;
  --bg-deep: #f3efe9;
  --surface: #ffffff;
  --text: #1a1820;
  --muted: #5a5560;
  --faint: #8a8490;
  --wine: #9b2c3e;
  --wine-pressed: #7a2230;
  --wine-soft: #f6e6e9;
  --navy: #2a3048;
  --ornament: #b8957a;
  --border: #e8e2dc;
  --radius: 12px;
  --font-display: "Outfit", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --max: 42rem;
  --pad: clamp(1.15rem, 4vw, 2rem);
  --chrome-pad-y: 0.75rem;
  --chrome-row-min: 2.1rem;
}

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

html {
  scroll-behavior: smooth;
}

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

body[data-page="home"] {
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--bg);
}

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

a {
  color: var(--wine);
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--wine-pressed);
}

/* —— Language switch —— */

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.12rem;
  padding: 0.18rem;
  border-radius: 999px;
  border: 1px solid rgba(42, 48, 72, 0.14);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 6px 20px rgba(42, 48, 72, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.lang-switch__btn {
  appearance: none;
  border: 0;
  margin: 0;
  min-width: 2.35rem;
  min-height: 1.8rem;
  padding: 0.22rem 0.5rem;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.lang-switch__btn:hover {
  color: var(--navy);
}

.lang-switch__btn.is-active {
  background: var(--wine);
  color: #fff;
}

/* —— Home —— */

.home {
  position: relative;
  height: 100dvh;
  max-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  background: #ffffff;
}

/* App stripe — header shows more of the ribbon */
.home__banner {
  position: relative;
  z-index: 0;
  grid-column: 1;
  grid-row: 1;
  width: 100%;
  height: clamp(7.5rem, 18vh, 11rem);
  padding-top: env(safe-area-inset-top, 0px);
  overflow: hidden;
  background: #ffffff;
  pointer-events: none;
}

.home__banner img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center center;
  /* Shift up without changing zoom */
  transform: translateY(-24%);
}

.home__chrome {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: calc(var(--chrome-row-min) + 2 * var(--chrome-pad-y));
  padding: max(var(--chrome-pad-y), env(safe-area-inset-top, 0px)) var(--pad)
    var(--chrome-pad-y);
}

.home__chrome .lang-switch {
  flex-shrink: 0;
  margin-left: auto;
}

.home__mark-cyr {
  margin: 0;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--navy);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.home__main {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.5rem var(--pad);
  gap: clamp(0.4rem, 1.1dvh, 0.85rem);
  min-height: 0;
}

.home__kicker {
  margin: 0 0 0.55rem;
  max-width: 22rem;
  padding: 0 0.5rem;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.45;
  text-align: center;
  text-transform: uppercase;
  color: var(--wine);
  animation: rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* App wordmark — wordmark-avlija.png (no Uđi) */
.home__wordmark {
  width: min(280px, 68vw);
  height: auto;
  margin-top: 0.35rem;
  animation: rise 0.95s cubic-bezier(0.22, 1, 0.36, 1) 0.06s both;
}

.home__motif {
  width: 9px;
  height: 9px;
  margin: 0.15rem 0 0.05rem;
  background: var(--wine);
  transform: rotate(45deg);
  animation: motif-in 1s cubic-bezier(0.22, 1, 0.36, 1) 0.14s both;
}

.home__tagline {
  margin: 0;
  max-width: 22rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.28rem, 3vw, 1.65rem);
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--navy);
  animation: rise 0.95s cubic-bezier(0.22, 1, 0.36, 1) 0.16s both;
}

.home__sub {
  margin: 0;
  max-width: 26rem;
  font-size: clamp(0.95rem, 2vw, 1.05rem);
  line-height: 1.45;
  color: #2c2833;
  animation: rise 0.95s cubic-bezier(0.22, 1, 0.36, 1) 0.22s both;
}

.home__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
  margin-top: 0.55rem;
  animation: rise 0.95s cubic-bezier(0.22, 1, 0.36, 1) 0.28s both;
}

.home__note {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  color: #6a6570;
  animation: rise 0.95s cubic-bezier(0.22, 1, 0.36, 1) 0.34s both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes motif-in {
  from {
    opacity: 0;
    transform: rotate(45deg) scale(0.4);
  }
  to {
    opacity: 1;
    transform: rotate(45deg) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .home__kicker,
  .home__wordmark,
  .home__motif,
  .home__tagline,
  .home__sub,
  .home__ctas,
  .home__note {
    animation: none !important;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.85rem;
  padding: 0.7rem 1.35rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease,
    transform 0.15s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn--primary {
  background: var(--wine);
  color: #fff;
}

.btn--primary:hover {
  background: var(--wine-pressed);
  color: #fff;
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.72);
  color: var(--navy);
  border-color: rgba(42, 48, 72, 0.16);
}

.btn--ghost:hover {
  border-color: var(--navy);
  color: var(--navy);
}

.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.home__footer {
  position: relative;
  z-index: 1;
  padding: 0.35rem var(--pad) calc(0.75rem + env(safe-area-inset-bottom, 0px));
  text-align: center;
}

.site-footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1.1rem;
  justify-content: center;
  margin-bottom: 0.4rem;
}

.site-footer__nav a {
  color: #4a4550;
  text-decoration: none;
  font-size: 0.84rem;
  font-family: var(--font-display);
  font-weight: 500;
}

.site-footer__nav a:hover {
  color: var(--wine);
}

.site-footer__copy {
  margin: 0;
  font-size: 0.75rem;
  color: var(--faint);
}

@media (max-width: 640px) {
  .home__banner {
    height: clamp(6rem, 16vh, 8.5rem);
  }

  .home__mark-cyr {
    font-size: 0.78rem;
    letter-spacing: 0.1em;
  }
}

@media (min-width: 1100px) {
  .home__banner {
    height: clamp(8rem, 17vh, 11.5rem);
  }
}

/* —— Legal pages —— */

.legal-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.legal-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem;
  min-height: calc(var(--chrome-row-min) + 2 * var(--chrome-pad-y));
  padding: max(var(--chrome-pad-y), env(safe-area-inset-top, 0px)) var(--pad)
    var(--chrome-pad-y);
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.legal-header__brand {
  display: contents;
}

.legal-header__back {
  justify-self: start;
  grid-column: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  min-height: 2.1rem;
  padding: 0.35rem 0.85rem 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(42, 48, 72, 0.12);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 0.84rem;
  color: var(--navy);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease,
    transform 0.15s ease;
}

.legal-header__mark-link {
  grid-column: 2;
  justify-self: center;
  align-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 2.1rem;
  line-height: 0;
}

.legal-header__mark {
  width: 4.5rem;
  height: auto;
  max-width: none;
  display: block;
}

.legal-header .lang-switch {
  grid-column: 3;
  justify-self: end;
}

.legal-header__back::before {
  content: "←";
  font-size: 0.92em;
  opacity: 0.72;
  transition: transform 0.18s ease;
}

.legal-header__back:hover {
  color: var(--wine);
  border-color: rgba(155, 44, 62, 0.28);
  background: #fff;
}

.legal-header__back:hover::before {
  transform: translateX(-2px);
}

.legal-header__back:active {
  transform: scale(0.98);
}

.legal-main {
  flex: 1;
  width: min(100%, var(--max));
  margin: 0 auto;
  padding: 2rem var(--pad) 3rem;
}

.legal-main h1 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.65rem, 4vw, 2rem);
  letter-spacing: -0.02em;
  color: var(--navy);
}

.legal-meta {
  margin: 0 0 1.75rem;
  font-size: 0.875rem;
  color: var(--faint);
}

.notice {
  margin: 0 0 1.75rem;
  padding: 0.9rem 1rem;
  border-radius: var(--radius);
  background: var(--wine-soft);
  color: var(--wine-pressed);
  font-size: 0.9rem;
}

.legal-main h2 {
  margin: 1.75rem 0 0.55rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.15rem;
  color: var(--text);
}

.legal-main h3 {
  margin: 1.15rem 0 0.45rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.02rem;
  color: var(--navy);
}

.legal-main p,
.legal-main li {
  color: var(--muted);
}

.legal-main a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(42, 48, 72, 0.22);
  text-underline-offset: 0.18em;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.legal-main a:hover {
  color: var(--wine);
  text-decoration-color: rgba(155, 44, 62, 0.45);
}

.legal-main ul {
  margin: 0 0 0.85rem;
  padding-left: 1.2rem;
}

.legal-main li + li {
  margin-top: 0.35rem;
}

.placeholder {
  display: inline;
  padding: 0.05em 0.35em;
  border-radius: 4px;
  background: #fff4d6;
  color: #9a6700;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88em;
}

.site-footer {
  position: relative;
  z-index: 1;
  padding: 1.25rem var(--pad) calc(1.25rem + env(safe-area-inset-bottom, 0px));
  text-align: center;
}

/* Language blocks — html[lang] set early to avoid flash */
[data-lang] {
  display: none;
}

html:not([lang="de"]) [data-lang="sr"],
html[lang="de"] [data-lang="de"] {
  display: block !important;
}
