/* EUROGRUP · сторінка посилань. Токени взяті з основного сайту (WebEuroGrup). */

:root,
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #16181c;
  --bg-deep: #0f1013;
  --surface: rgba(35, 38, 44, 0.72);
  --surface-hover: rgba(46, 49, 56, 0.9);
  --text: #eceef1;
  --muted: #a5a9b2;
  --faint: #7d818b;
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.22);
  --red: #d40000;
  --red-hot: #ff2800;
  --red-deep: #a30000;
  --accent: #ff5a4a;
  --accent-tint: rgba(255, 90, 74, 0.12);
  --glow: rgba(212, 0, 0, 0.26);
  --grid-dot: rgba(255, 255, 255, 0.08);
  --shadow: 0 18px 40px -26px rgba(0, 0, 0, 0.85);
  --shadow-red: 0 18px 40px -20px rgba(212, 0, 0, 0.55);
}

:root[data-theme='light'] {
  color-scheme: light;
  --bg: #f5e9e1;
  --bg-deep: #ecdbd0;
  --surface: rgba(255, 250, 247, 0.82);
  --surface-hover: #fffaf7;
  --text: #22191a;
  --muted: #6e5f5d;
  --faint: #8f7d79;
  --line: rgba(74, 30, 34, 0.13);
  --line-strong: rgba(74, 30, 34, 0.3);
  --red: #7d1d2d;
  --red-hot: #9a2639;
  --red-deep: #5c1320;
  --accent: #7d1d2d;
  --accent-tint: rgba(125, 29, 45, 0.09);
  --glow: rgba(125, 29, 45, 0.13);
  --grid-dot: rgba(74, 30, 34, 0.13);
  --shadow: 0 18px 40px -28px rgba(74, 30, 34, 0.45);
  --shadow-red: 0 18px 40px -22px rgba(125, 29, 45, 0.6);
}

:root {
  --display: 'Literata', Georgia, 'Times New Roman', serif;
  --body: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;
  --radius: 14px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

p, ul, h1 { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; }
button { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.ico {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

/* ---------- фон: червоне світіння + сітка крапок, як на головному сайті ---------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(70% 42% at 50% -4%, var(--glow), transparent 72%),
    radial-gradient(45% 35% at 100% 100%, var(--glow), transparent 75%),
    var(--bg);
}
.bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 1px 1px, var(--grid-dot) 1px, transparent 0) 0 0 / 22px 22px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0.35) 55%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0.35) 55%, transparent 100%);
}

/* ---------- кнопки вгорі ---------- */
.topbar {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  left: 50%;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  width: min(100%, 600px);
  padding-inline: 18px;
  transform: translateX(-50%);
  pointer-events: none;
}
.round {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  cursor: pointer;
  pointer-events: auto;
  transition: border-color 0.25s var(--ease), color 0.25s var(--ease), transform 0.25s var(--ease);
}
.round .ico { width: 19px; height: 19px; }
.round:hover { border-color: var(--line-strong); color: var(--accent); transform: translateY(-1px); }

.ico--moon { display: none; }
:root[data-theme='light'] .ico--sun { display: none; }
:root[data-theme='light'] .ico--moon { display: block; }

/* ---------- сторінка ---------- */
.page {
  width: min(100%, 560px);
  margin-inline: auto;
  padding: max(36px, env(safe-area-inset-top)) 18px max(32px, env(safe-area-inset-bottom));
}

.profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.seal {
  position: relative;
  width: 168px;
  height: 168px;
  margin-bottom: 6px;
}
.seal::before {
  content: '';
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  background: var(--glow);
  filter: blur(26px);
}
.seal__img {
  position: relative;
  width: 100%;
  height: 100%;
  animation: seal-in 1.1s var(--ease) both;
}
.seal__img--light { display: none; }
:root[data-theme='light'] .seal__img--dark { display: none; }
:root[data-theme='light'] .seal__img--light { display: block; }

.wordmark svg {
  width: 196px;
  height: auto;
  fill: var(--text);
}

.eyebrow {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 12px;
  margin-top: 18px;
  font: 500 11.5px/1.4 var(--mono);
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--accent);
}
.eyebrow span { display: inline-flex; align-items: center; gap: 12px; white-space: nowrap; }
.eyebrow span + span::before {
  content: '';
  flex: none;
  width: 5px;
  height: 5px;
  background: currentColor;
  transform: rotate(45deg);
}
.eyebrow:empty { display: none; }

.lead {
  max-width: 420px;
  margin-top: 12px;
  font: 400 clamp(21px, 17px + 1.2vw, 25px)/1.25 var(--display);
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.lead em { font-style: italic; color: var(--accent); }
.lead:empty { display: none; }

/* ---------- соцмережі ---------- */
.socials {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
}
.socials:empty { display: none; }
.socials a {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
  transition: background-color 0.25s var(--ease), border-color 0.25s var(--ease), color 0.25s var(--ease), transform 0.25s var(--ease);
}
.socials a:hover {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  transform: translateY(-2px);
}
.socials .ico { width: 20px; height: 20px; stroke-width: 1.6; }

/* ---------- посилання ---------- */
.links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 34px;
}

.group {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 2px 2px;
  font: 500 11.5px/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}
.group:first-child { margin-top: 0; }
.group::before {
  content: '';
  flex: none;
  width: 6px;
  height: 6px;
  background: var(--accent);
  transform: rotate(45deg);
}
.group::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

.link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 70px;
  padding: 12px 16px 12px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  transition: background-color 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.link:hover {
  background: var(--surface-hover);
  border-color: var(--line-strong);
  transform: translateY(-2px);
}
.link:active { transform: translateY(0) scale(0.99); }

.link__ico {
  display: grid;
  place-items: center;
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 11px;
  background: var(--accent-tint);
  color: var(--accent);
}
.link__ico .ico { width: 21px; height: 21px; }

/* фірмовий логотип: кольорова плитка на всю клітинку */
.link__ico--brand {
  position: relative;
  overflow: hidden;
  background: none;
  transition: transform 0.25s var(--ease);
}
.link__ico--brand svg { width: 100%; height: 100%; }
.link__ico--brand::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px var(--line);
  pointer-events: none;
}
.link:hover .link__ico--brand { transform: scale(1.06) rotate(-3deg); }

.link__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.link__title {
  font-size: 16.5px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.005em;
}
.link__note {
  overflow: hidden;
  font-size: 14px;
  line-height: 1.4;
  color: var(--muted);
  text-overflow: ellipsis;
}

.link__badge {
  flex: none;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--red);
  font: 500 10.5px/1 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
}

.link__arrow {
  flex: none;
  width: 18px;
  height: 18px;
  color: var(--faint);
  transition: transform 0.25s var(--ease), color 0.25s var(--ease);
}
.link:hover .link__arrow { color: var(--accent); transform: translate(2px, -2px); }

/* головна (червона) кнопка */
.link--featured {
  overflow: hidden;
  border-color: transparent;
  background: var(--red);
  color: #fff;
  box-shadow: var(--shadow-red);
}
.link--featured:hover { background: var(--red-deep); border-color: transparent; }
.link--featured .link__ico { background: rgba(255, 255, 255, 0.16); color: #fff; }
.link--featured .link__note { color: rgba(255, 255, 255, 0.78); }
.link--featured .link__arrow,
.link--featured:hover .link__arrow { color: #fff; }
.link--featured .link__badge { background: #fff; color: var(--red); }
.link--featured::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -40%;
  width: 30%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.16), transparent);
  transform: skewX(-18deg);
  animation: shine 5.5s var(--ease) 1.6s infinite;
  pointer-events: none;
}

.noscript { margin-top: 30px; text-align: center; color: var(--muted); }

/* ---------- футер ---------- */
.footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 44px;
  font: 400 11.5px/1.5 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}
.footer__mark { width: 26px; height: 26px; fill: var(--red); opacity: 0.9; }

/* ---------- сповіщення ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 20;
  padding: 12px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--bg-deep);
  box-shadow: var(--shadow);
  font-size: 14px;
  color: var(--text);
  opacity: 0;
  transform: translate(-50%, 12px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
  pointer-events: none;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- поява ---------- */
.rise { animation: rise 0.7s var(--ease) both; animation-delay: calc(var(--i, 0) * 55ms + 120ms); }

@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes seal-in { from { opacity: 0; transform: scale(0.88) rotate(-25deg); } }
@keyframes shine { 0% { left: -40%; } 28%, 100% { left: 130%; } }

@media (max-width: 420px) {
  .page { padding-inline: 14px; }
  .topbar { padding-inline: 14px; }
  .seal { width: 148px; height: 148px; }
  .wordmark svg { width: 176px; }
  .eyebrow { font-size: 10.5px; letter-spacing: 0.08em; gap: 6px 9px; }
  .eyebrow span { gap: 9px; }
  .link { gap: 12px; min-height: 66px; padding: 10px 14px 10px 10px; }
  .link__ico { width: 42px; height: 42px; }
  .link__title { font-size: 16px; }
  .link__note { font-size: 13.5px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
