/* ═══ Astro · osnovni stil (Observatory + Living Sky) ═══ */

:root {
  --bg: #0B0E24;
  --bg-2: #12103A;
  --panel: rgba(255, 255, 255, .045);
  --panel-2: rgba(255, 255, 255, .07);
  --line: rgba(255, 255, 255, .10);
  --line-2: rgba(255, 255, 255, .16);
  --gold: #E3C47A;
  --gold-2: #F3DCA0;
  --gold-soft: rgba(227, 196, 122, .12);
  --gold-line: rgba(227, 196, 122, .35);
  --text: #ECE8F7;
  --head: #F4EEDD;
  --dim: #C8C2E2;
  --muted: #A9A3C9;
  --faint: #8C86B0;
  --ok: #8FE3B5;
  --warn: #FFB38A;
  --info: #7FB8FF;
  --ink: #1A1438;

  --serif: 'Marcellus', Georgia, serif;
  --sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --r-sm: 12px;
  --r: 20px;
  --r-lg: 28px;
  --sidebar: 260px;
  --tabbar: 84px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--gold); }
a:hover { color: var(--gold-2); }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ─── Nebo u pozadini ─── */
.sky { position: fixed; inset: 0; z-index: -1; overflow: hidden; transition: background 1.2s ease; }
.sky[data-sky="night"] { background: radial-gradient(ellipse 120% 70% at 50% 0%, #241B57 0%, #0B0E24 60%); }
.sky[data-sky="dusk"]  { background: linear-gradient(180deg, #0A0B2A 0%, #1B1650 50%, #3A2462 80%, #5A3368 100%); }
.sky[data-sky="dawn"]  { background: linear-gradient(180deg, #141A44 0%, #2E2E66 55%, #5B4A7E 85%, #8A6A8C 100%); }
.sky[data-sky="day"]   { background: radial-gradient(ellipse 120% 70% at 50% 0%, #26306E 0%, #111538 65%); }
.stars { position: absolute; inset: 0; }
.star { position: absolute; border-radius: 50%; background: #fff; animation: twinkle 3.4s ease-in-out infinite; }
@keyframes twinkle { 0%, 100% { opacity: .2 } 50% { opacity: 1 } }

/* ─── Raspored: sidebar (desktop) + tab bar (telefon) ─── */
.app { min-height: 100vh; display: flex; }
.main {
  flex: 1; min-width: 0;
  padding: 32px 40px 48px;
  display: flex; flex-direction: column; gap: 24px;
}
.sidebar {
  width: var(--sidebar); flex-shrink: 0;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  padding: 28px 16px; background: rgba(13, 15, 43, .92);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 22px;
}
.sidebar__brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; text-decoration: none; }
.sidebar__sign {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--gold);
  display: flex; align-items: center; justify-content: center; color: var(--gold); font-size: 20px;
}
.sidebar__name { font-family: var(--serif); font-size: 20px; color: var(--head); }
.sidebar__tag { font-size: 12px; color: var(--muted); }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-group__label {
  padding: 0 12px 6px; font-size: 11px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--faint);
}
.nav-link {
  min-height: 40px; display: flex; align-items: center; gap: 10px; padding: 0 12px;
  border-radius: 10px; text-decoration: none; font-size: 14px; font-weight: 500; color: #BDB7DA;
  transition: background .2s, color .2s;
}
.nav-link:hover { background: rgba(255, 255, 255, .07); color: var(--head); }
.nav-link__glyph { width: 18px; text-align: center; color: var(--faint); }
.nav-link.is-active { background: rgba(227, 196, 122, .12); color: var(--head); font-weight: 700; }
.nav-link.is-active .nav-link__glyph { color: var(--gold); }
.nav-link__soon { margin-left: auto; font-size: 10px; color: var(--faint); letter-spacing: .06em; }
.sidebar__foot { margin-top: auto; padding: 0 12px; }
.sidebar__foot a { font-size: 13px; color: var(--faint); text-decoration: none; }

.tabbar { display: none; }

@media (max-width: 959px) {
  .sidebar { display: none; }
  .main { padding: 52px 16px calc(var(--tabbar) + var(--safe-b) + 24px); gap: 14px; }
  .tabbar {
    display: flex; position: fixed; left: 12px; right: 12px; bottom: calc(10px + var(--safe-b));
    height: 64px; z-index: 20; border-radius: 32px;
    background: rgba(21, 18, 58, .95); border: 1px solid var(--line-2);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    justify-content: space-around; align-items: center;
  }
  .tab {
    min-width: 56px; height: 52px; display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 3px; text-decoration: none; color: var(--muted);
    font-size: 11px; font-weight: 700; background: none; border: 0; font-family: var(--sans); cursor: pointer;
  }
  .tab__glyph { font-size: 19px; line-height: 1; }
  .tab.is-active { color: var(--gold); }
}

/* „Više” – meni preko celog ekrana na telefonu */
.sheet { position: fixed; inset: 0; z-index: 30; background: rgba(5, 6, 20, .6); display: flex; align-items: flex-end; }
.sheet__panel {
  width: 100%; max-height: 82vh; overflow-y: auto;
  padding: 18px 16px calc(24px + var(--safe-b));
  border-radius: 28px 28px 0 0; background: #110F33; border-top: 1px solid var(--line-2);
  display: flex; flex-direction: column; gap: 18px;
}
.sheet__handle { align-self: center; width: 40px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .3); }
.sheet__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sheet__item {
  min-height: 80px; padding: 10px 6px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  text-decoration: none; color: var(--text); font-size: 12px; font-weight: 700; text-align: center;
}
.sheet__item span:first-child { font-size: 22px; color: var(--gold); }

/* ─── Tipografija ─── */
.kicker { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.kicker--gold { color: var(--gold); }
.h1 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 40px; line-height: 1.15; color: var(--head); }
.h2 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 24px; color: var(--head); }
.lead { margin: 0; font-size: 16px; line-height: 1.65; color: var(--dim); }
.muted { color: var(--muted); }
@media (max-width: 959px) { .h1 { font-size: 30px; } .h2 { font-size: 21px; } }

/* ─── Komponente ─── */
.card { padding: 22px 24px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); }
.card--gold { background: linear-gradient(150deg, rgba(58, 36, 112, .7), rgba(21, 18, 58, .7)); border-color: var(--gold-line); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

.btn {
  height: 48px; padding: 0 22px; border-radius: 24px; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--gold); color: var(--ink); font-family: var(--sans); font-weight: 700; font-size: 15px;
  text-decoration: none; transition: background .2s;
}
.btn:hover { background: var(--gold-2); color: var(--ink); }
.btn--ghost { background: transparent; color: var(--gold); border: 1px solid var(--gold-line); }
.btn--ghost:hover { background: var(--gold-soft); color: var(--gold-2); }
.btn--block { width: 100%; }

.chip { display: inline-flex; padding: 5px 12px; border-radius: 12px; background: rgba(255, 255, 255, .08); font-size: 13px; font-weight: 600; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.input {
  height: 50px; padding: 0 18px; border-radius: 14px; border: 1px solid var(--line-2);
  background: #0B0A26; color: var(--head); font-size: 18px; font-family: var(--sans); width: 100%;
}
.input:focus { outline: none; border-color: var(--gold); }

.alert { padding: 12px 16px; border-radius: 14px; font-size: 14px; }
.alert--error { background: rgba(255, 179, 138, .12); border: 1px solid rgba(255, 179, 138, .4); color: #FFD3BB; }

/* ─── Ulaz ─── */
.gate { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; position: relative; overflow: hidden; }
.gate__orbit {
  position: absolute; width: min(720px, 120vw); aspect-ratio: 1; border-radius: 50%;
  border: 1px solid rgba(227, 196, 122, .15); animation: orbit 120s linear infinite;
}
.gate__planet { position: absolute; border-radius: 50%; }
.gate__card {
  position: relative; width: 100%; max-width: 420px; padding: 44px 36px 34px; border-radius: var(--r-lg);
  background: rgba(18, 16, 58, .85); border: 1px solid var(--gold-line); box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
  display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center;
}
.gate__sign {
  width: 76px; height: 76px; border-radius: 50%; border: 1px solid var(--gold); color: var(--gold);
  display: flex; align-items: center; justify-content: center; font-size: 34px; box-shadow: 0 0 40px rgba(227, 196, 122, .27);
}
.gate__card .field { align-self: stretch; text-align: left; }
.gate__foot { position: absolute; bottom: calc(20px + var(--safe-b)); left: 0; right: 0; text-align: center; font-size: 13px; color: var(--faint); }
@keyframes orbit { to { transform: rotate(360deg); } }

/* ─── Smanjeno kretanje ─── */
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
[data-reduce-motion="1"] *, [data-reduce-motion="1"] *::before { animation: none !important; }
[x-cloak]{display:none!important}
