/* Leburić — shared tokens, type, nav, footer, reveal, page transition.
   The palette is driven by the time of day (core.js sets --bg/--ink/... from the hour in Prnjavor). */
:root {
  --navy: #142a44;
  --gold: #c79a3c;
  --gold-deep: #8a6417;
  --terra: #a8492a;
  --leaf: #2e5a3e;
  --paper: #f4f0e8;

  /* time-of-day tokens (overwritten by core.js) */
  --bg: #f4f0e8;
  --bg-2: #ebe5d9;
  --ink: #15202c;
  --muted: rgba(21, 32, 44, .66);
  --line: rgba(21, 32, 44, .16);
  --accent: #8a6417;
  --on-accent: #fff;

  --f-display: "Geologica", system-ui, sans-serif;
  --f-mono: "Martian Mono", ui-monospace, monospace;

  --t-xs: .75rem;
  --t-sm: .875rem;
  --t-base: clamp(1rem, .95rem + .25vw, 1.0625rem);
  --t-lg: clamp(1.125rem, 1rem + .6vw, 1.375rem);
  --t-xl: clamp(1.6rem, 1.2rem + 1.8vw, 2.6rem);
  --t-2xl: clamp(2.2rem, 1.4rem + 3.8vw, 4.6rem);
  --t-3xl: clamp(3rem, 1.6rem + 7vw, 8.5rem);

  --gutter: clamp(1rem, .5rem + 2.5vw, 2.5rem);
  --max: 1320px;
  --sec: clamp(4.5rem, 3rem + 6vw, 9rem);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --nav-h: 68px;
  --z-nav: 40;
  --z-menu: 50;
  --z-dialog: 100;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-display);
  font-size: var(--t-base);
  font-weight: 350;
  line-height: 1.6;
  font-variation-settings: "SHRP" 0;
  overflow-x: clip;
  transition: background-color .5s linear, color .5s linear;
}
img { display: block; max-width: 100%; height: auto; }
.ic { width: 1em; height: 1em; flex: none; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: var(--gold); color: #1a1206; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }
.mono { font-family: var(--f-mono); font-size: var(--t-xs); letter-spacing: .04em; text-transform: uppercase; font-weight: 400; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 200; background: var(--ink); color: var(--bg); padding: .7rem 1rem; border-radius: 8px; }
.skip:focus { top: 1rem; }

h1, h2, h3 { font-weight: 600; line-height: 1.02; letter-spacing: -.025em; margin: 0; text-wrap: balance; }
h2 { font-size: var(--t-2xl); }
h3 { font-size: var(--t-lg); letter-spacing: -.01em; line-height: 1.2; }
p { margin: 0; text-wrap: pretty; }
.kicker { display: flex; align-items: center; gap: .75rem; margin-bottom: 1.25rem; color: var(--muted); }
.kicker::before { content: ""; width: 28px; height: 1px; background: currentColor; }

/* ---------- buttons ---------- */
.btn {
  --b: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  min-height: 48px; padding: .75rem 1.35rem;
  border-radius: 999px; border: 1px solid var(--b);
  background: var(--b); color: var(--bg);
  font-weight: 500; text-decoration: none; line-height: 1;
  transition: transform .25s var(--ease), background-color .25s, color .25s;
  touch-action: manipulation;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--bg); }
.btn--gold { --b: var(--gold); color: #1d1405; }
.btn svg { width: 18px; height: 18px; flex: none; }
.link-arrow { display: inline-flex; gap: .5rem; align-items: center; font-weight: 500; text-decoration: none; border-bottom: 1px solid var(--line); padding-bottom: .2rem; transition: gap .25s var(--ease), border-color .25s; }
.link-arrow:hover { gap: .85rem; border-color: var(--ink); }

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: var(--z-nav);
  height: var(--nav-h);
  display: flex; align-items: center;
  transition: background-color .4s, box-shadow .4s, transform .4s var(--ease);
}
.nav.is-scrolled { background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(14px) saturate(1.2); box-shadow: 0 1px 0 var(--line); }
.nav .wrap { display: flex; align-items: center; gap: 1.5rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; line-height: 1; }
.brand-mark { width: 34px; height: 30px; color: var(--gold); flex: none; }
.brand-word { display: grid; }
.brand-word b { font-size: 1.15rem; font-weight: 700; letter-spacing: .06em; }
.brand-word span { font-family: var(--f-mono); font-size: .58rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-top: .2rem; }
.nav-links { display: flex; gap: 1.6rem; margin-left: auto; list-style: none; padding: 0; margin-block: 0; }
.nav-links a { text-decoration: none; font-weight: 450; position: relative; padding-block: .5rem; }
.nav-links a::after { content: ""; position: absolute; left: 0; right: 0; bottom: .2rem; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform .35s var(--ease); }
.nav-links a:hover::after, .nav-links a[aria-current="page"]::after { transform: scaleX(1); transform-origin: left; }
.clock-chip { display: inline-flex; align-items: center; gap: .5rem; padding: .45rem .75rem; border: 1px solid var(--line); border-radius: 999px; white-space: nowrap; }
.clock-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 30%, transparent); }
.nav .btn { min-height: 44px; padding-inline: 1.1rem; }
.lang-link { display: inline-grid; place-items: center; min-width: 44px; height: 44px; margin-right: -.75rem; border-radius: 50%; text-decoration: none; border: 1px solid transparent; transition: border-color .25s; }
.lang-link:hover { border-color: var(--line); }
.menu-lang { text-decoration: none; justify-self: start; padding: .4rem 0; border-bottom: 1px solid var(--line); }
.menu-btn { display: none; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; background: transparent; place-items: center; }
.menu-btn span { display: block; width: 16px; height: 1.5px; background: currentColor; box-shadow: 0 5px 0 currentColor; transform: translateY(-2.5px); }

.menu {
  position: fixed; inset: 0; z-index: var(--z-menu);
  background: var(--bg); color: var(--ink);
  padding: calc(var(--nav-h) + 2rem) var(--gutter) 2rem;
  display: flex; flex-direction: column; gap: 2rem;
  clip-path: circle(0 at calc(100% - 42px) 34px);
  transition: clip-path .6s var(--ease), visibility 0s .6s;
  visibility: hidden;
}
.menu.is-open { clip-path: circle(150% at calc(100% - 42px) 34px); visibility: visible; transition: clip-path .7s var(--ease); }
.menu ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; }
.menu a.big { font-size: var(--t-2xl); font-weight: 600; text-decoration: none; letter-spacing: -.03em; }
.menu-close { position: absolute; top: 12px; right: var(--gutter); width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: transparent; font-size: 1.4rem; line-height: 1; }
.menu-foot { margin-top: auto; display: grid; gap: .75rem; }

@media (max-width: 900px) {
  .nav-links, .nav .clock-chip, .nav .lang-link { display: none; }
  .nav .btn { margin-left: auto; }
  .menu-btn { display: grid; }
}
@media (max-width: 420px) {
  .nav .btn { padding-inline: .9rem; font-size: .9rem; }
  .brand-word span { display: none; }
}

/* ---------- sections ---------- */
.sec { padding-block: var(--sec); }
.sec-head { display: grid; gap: 1rem; margin-bottom: clamp(2rem, 1rem + 3vw, 4rem); max-width: 46rem; }
.sec-head p { color: var(--muted); font-size: var(--t-lg); line-height: 1.5; }

.frame { position: relative; overflow: hidden; border-radius: 6px; background: var(--bg-2); }
.frame img { width: 100%; height: 100%; object-fit: cover; }
.r34 { aspect-ratio: 3 / 4; }
.r43 { aspect-ratio: 4 / 3; }
.r11 { aspect-ratio: 1; }

/* reveal */
.js [data-rv] { opacity: 0; transform: translateY(24px); transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: var(--d, 0s); }
.js [data-rv].in { opacity: 1; transform: none; }

/* ---------- facts list ---------- */
.facts { list-style: none; padding: 0; margin: 0; display: grid; }
.facts li { display: grid; grid-template-columns: 2.25rem 1fr auto; align-items: center; gap: .75rem; padding-block: .95rem; border-top: 1px solid var(--line); }
.facts li:last-child { border-bottom: 1px solid var(--line); }
.facts svg { width: 22px; height: 22px; color: var(--accent); }
.facts b { font-weight: 500; }
.facts .mono { color: var(--muted); }

/* ---------- footer ---------- */
.foot { padding-block: clamp(3.5rem, 2rem + 5vw, 6rem) 2rem; border-top: 1px solid var(--line); }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2.5rem; }
.foot-word { font-size: clamp(3.2rem, 2rem + 6vw, 7.5rem); font-weight: 700; letter-spacing: .02em; line-height: .9; }
.foot-word small { display: block; font-size: var(--t-sm); font-weight: 400; letter-spacing: 0; color: var(--muted); margin-top: 1rem; }
.foot .foot-h { font-size: var(--t-xs); font-weight: 400; letter-spacing: .04em; line-height: 1.4; margin: 0 0 .9rem; font-weight: 400; color: var(--muted); }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.foot a { text-decoration: none; }
.foot a:hover { text-decoration: underline; text-underline-offset: 3px; }
.foot-bottom { margin-top: 3rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; color: var(--muted); }
.foot-bottom a.foot-credit { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--accent); padding-bottom: 1px; transition: color .25s; }
.foot-bottom a.foot-credit:hover { color: var(--accent); text-decoration: none; }
@media (max-width: 760px) { .foot-bottom { flex-direction: column; } }
@media (max-width: 820px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-grid > :first-child { grid-column: 1 / -1; } }

/* ---------- mobile call bar ---------- */
.callbar { display: none; }
@media (max-width: 700px) {
  .callbar {
    position: fixed; z-index: 30; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom));
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
    padding: 6px; border-radius: 999px;
    background: color-mix(in srgb, var(--ink) 92%, transparent); color: var(--bg);
    backdrop-filter: blur(10px);
    transform: translateY(140%); transition: transform .5s var(--ease);
  }
  .callbar.is-on { transform: none; }
  .callbar a { min-height: 46px; display: flex; align-items: center; justify-content: center; gap: .5rem; border-radius: 999px; text-decoration: none; font-weight: 500; }
  .callbar a:last-child { background: var(--gold); color: #1d1405; }
  .callbar svg { width: 18px; height: 18px; }
  .foot { padding-bottom: 6rem; }
}

/* ---------- cross-document page transition: the "next hour" opens as a circle from the clock ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .45s var(--ease) both; }
::view-transition-new(root) { animation: vt-in .75s var(--ease) both; }
@keyframes vt-out { to { opacity: .4; transform: scale(.985); } }
@keyframes vt-in { from { clip-path: circle(0 at calc(100% - 180px) 34px); } to { clip-path: circle(160% at calc(100% - 180px) 34px); } }

/* ---------- inner page head ---------- */
.page-head { padding-top: calc(var(--nav-h) + clamp(3rem, 2rem + 5vw, 7rem)); padding-bottom: clamp(2.5rem, 1.5rem + 3vw, 4.5rem); display: grid; gap: 1.25rem; }
.page-head h1 { font-size: var(--t-3xl); font-weight: 650; letter-spacing: -.045em; line-height: .9; }
.page-lede { font-size: var(--t-lg); color: var(--muted); max-width: 36rem; line-height: 1.5; }

/* ---------- chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chips label { position: relative; }
.chips input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chips span { display: inline-flex; align-items: center; min-height: 44px; padding: .5rem 1rem; border: 1px solid var(--line); border-radius: 999px; transition: background-color .2s, color .2s; }
.chips input:checked + span { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chips input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .js [data-rv] { opacity: 1; transform: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}
