/* components.css: the page's building blocks, in page order. The phone mock-ups are in phone.css. */

/* ---------- icons (Material Symbols Rounded, self-hosted subset) ---------- */
.ms {
  font-family: "Material Symbols Rounded"; font-weight: normal; font-style: normal;
  font-size: 24px; line-height: 1; letter-spacing: normal; text-transform: none;
  display: inline-block; white-space: nowrap; direction: ltr; user-select: none;
  font-variation-settings: "FILL" 0, "wght" 500, "GRAD" 0, "opsz" 24;
  -webkit-font-feature-settings: "liga"; font-feature-settings: "liga";
}
.ms.fill { font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24; }

/* ---------- buttons and store badges ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; border: 0; cursor: pointer;
  text-decoration: none; font: 700 15px/1 var(--font); border-radius: 999px; padding: 13px 20px;
  transition: transform 0.15s, background 0.15s;
}
.btn:active { transform: scale(0.97); }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: #5f8669; }

/* The badges are the stores' own art: 52px tall, unmodified, Apple first (README). */
.stores { display: flex; flex-wrap: wrap; gap: 16px; }
.badge { display: inline-block; line-height: 0; border-radius: 9px; transition: transform 0.15s; }
.badge:hover { transform: translateY(-2px); }
.badge img { display: block; height: 52px; width: auto; }

/* Shown instead of the store badges until the app is out. Not a link. */
.store-soon {
  position: relative; /* above the banner's background icon */
  display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.3em; min-height: 52px;
  padding: 12px 22px; border: 1px solid rgba(255, 255, 255, 0.28); border-radius: 26px;
  color: #fff; font-size: 1rem; line-height: 1.35;
}
.cta-box .store-soon { margin-top: 0; color: #fff; font-size: 1rem; }

/* ---------- orbit (hero, right side) ---------- */
/* Approved variant "F.1". Mechanics matter, do not simplify (README "Orbit"): each ring spins
   with the individual `rotate` property; each word wrapper is rotate(angle) translateX(radius);
   the pill inside counter-spins so it stays upright. Style rules must target the DIRECT child
   pill (`.word > span`), otherwise the icon span inside the pill is moved as well. */
.orbit { position: relative; left: 20px; min-height: clamp(360px, 70vw, 580px); }
.orbit::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 640px; height: 640px; margin: -320px 0 0 -320px;
  background: radial-gradient(closest-side, rgba(84, 119, 95, 0.24), transparent 72%); pointer-events: none;
}
.hub {
  position: absolute; left: 50%; top: 50%; width: 108px; height: 108px; margin: -54px 0 0 -54px;
  border-radius: 32px; background: var(--green); display: grid; place-items: center;
  box-shadow: 0 0 0 12px rgba(84, 119, 95, 0.18), 0 0 0 26px rgba(84, 119, 95, 0.09);
}
.hub .ms { font-size: 54px; color: #fff; }

.ring {
  position: absolute; left: 50%; top: 50%;
  width: calc(var(--R) * 2); height: calc(var(--R) * 2); margin: calc(var(--R) * -1) 0 0 calc(var(--R) * -1);
  border-radius: 50%; border: 1.5px dashed rgba(156, 197, 168, 0.26);
  animation: spin var(--t) linear infinite;
}
.ring.is-reverse, .ring.is-reverse .word > span { animation-direction: reverse; }
.word { position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform: rotate(var(--a)) translateX(var(--R)); }
.word > span {
  position: absolute; left: 0; top: 0; translate: -50% -50%; transform: rotate(calc(var(--a) * -1));
  white-space: nowrap; display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px 6px 9px; border-radius: 999px; background: var(--floating);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  font-family: "DM Mono", ui-monospace, monospace; font-weight: 500; font-size: 12.5px;
  letter-spacing: 0.1em; text-transform: uppercase;
  animation: unspin var(--t) linear infinite;
}
.word.is-green > span { background: var(--green-deep); color: var(--green-hi); }
.word > span .ms { font-size: 16px; color: var(--green-hi); }
@keyframes spin { to { rotate: 360deg; } }
@keyframes unspin { to { rotate: -360deg; } }

/* The pills must not swing over the headline's last line at the ring's 9 o'clock position:
   re-check these numbers if the headline or the column widths change. */
@media (min-width: 981px) and (max-width: 1240px) { .orbit { transform: scale(0.84); } }
/* At 981-1079px the 0.84 orbit pokes up to 22px past the screen edge while it turns. */
@media (min-width: 981px) and (max-width: 1079px) { .orbit { transform: scale(0.74); } }
@media (max-width: 640px) { .orbit { left: 0; transform: scale(0.6); } }
/* The outer pills swing out to ~(228 + 62)px from the centre. Scaled 0.6 that needs a 348px-wide screen,
   so below that the orbit shrinks one more step (this was clipped on 320-360px phones in the mockup). */
@media (max-width: 350px) { .orbit { transform: scale(0.5); } }
@media (max-width: 300px) { .orbit { transform: scale(0.45); } }

/* ---------- "Za studente": tabs + phone deck ---------- */
.tour { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 680px); gap: clamp(24px, 4vw, 64px); align-items: center; }
.tabs { display: grid; gap: 8px; }
.tab {
  display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 4px 16px; text-align: left;
  padding: 16px 20px; border: 0; border-radius: var(--radius); background: none; cursor: pointer;
  transition: background 0.25s;
}
.tab:hover { background: #262826; }
.tab:focus-visible { outline-offset: 0; }
.tab-ico {
  grid-row: span 2; width: 48px; height: 48px; border-radius: 15px;
  background: var(--floating); display: grid; place-items: center; color: var(--ink2);
  transition: background 0.25s, color 0.25s;
}
.tab-title { font-size: var(--step-h3); font-weight: 800; letter-spacing: -0.02em; align-self: center; }
.tab-text { display: none; color: var(--ink2); font-size: 15px; max-width: 36em; }
.tab-points { display: none; grid-column: 2; margin-top: 10px; margin-bottom: 2px; gap: 7px; }
.tab-points > span { display: flex; gap: 8px; font-size: 14px; color: var(--ink); }
.tab-points .ms { font-size: 18px; color: var(--green-hi); margin-top: 2px; }
.tab[aria-selected="true"] { background: var(--floating); }
.tab[aria-selected="true"] .tab-ico { background: var(--green); color: #fff; }
.tab[aria-selected="true"] .tab-ico .ms { font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24; }
.tab[aria-selected="true"] .tab-text { display: block; }
.tab[aria-selected="true"] .tab-points { display: grid; }

.tour-stage { position: relative; display: grid; gap: 14px; min-width: 0; }
.tabchips { display: none; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.tabchips::-webkit-scrollbar { display: none; }
.tabchips button {
  flex: none; display: inline-flex; align-items: center; gap: 6px; border: 0; cursor: pointer;
  padding: 9px 14px 9px 10px; border-radius: 999px; background: var(--floating); color: var(--ink2);
  font-weight: 700; font-size: 14px; transition: background 0.25s, color 0.25s;
}
.tabchips button .ms { font-size: 18px; }
.tabchips button[aria-pressed="true"] { background: var(--green); color: #fff; }

/* Rules are scoped under `.deck` on purpose: phone.css loads after this file and its `.phone`
   (position: relative, box-shadow) would otherwise win at equal specificity. */
/* The deck: the picked phone comes to the front, the others fan out behind (layout maths in js/deck.js).
   Never put big shadows or a glow behind it: overflow:hidden clips them into a dark rectangle.
   Height 700 and top 34 keep the rotated corners of the side phones uncropped. */
.deck { position: relative; height: calc(700px * var(--phone-zoom, 1)); overflow: hidden; --shift: 0px; }
.deck .deck-phone {
  position: absolute; left: 50%; top: 34px; margin-left: -150px; cursor: pointer;
  transform: translateX(calc(var(--x, 0px) + var(--shift))) translateY(calc(var(--a, 0) * 12px)) rotate(var(--r, 0deg)) scale(var(--s, 1));
  filter: brightness(var(--b, 1)); opacity: var(--op, 1);
  transition: transform 0.75s cubic-bezier(0.22, 0.9, 0.24, 1), filter 0.5s ease, opacity 0.5s ease, z-index 0s 0.16s;
  will-change: transform;
  box-shadow: 0 0 0 1.5px #3c3e3c;
}
.deck .deck-phone.active { cursor: default; box-shadow: 0 0 0 1.5px #4a4d4a; }
.deck-phone:not(.active) .screen { pointer-events: none; }
.deck-phone:not(.active):hover { filter: brightness(calc(var(--b, 1) + 0.15)); }
.deck-phone[data-far="1"] { pointer-events: none; }

/* ---------- hand-drawn hint notes ---------- */
.note {
  position: absolute; z-index: 15; display: grid; justify-items: start; pointer-events: none;
  color: var(--ink); font: 600 24px/1.02 "Caveat", "Segoe Print", "Bradley Hand", cursive;
}
.note svg { width: 128px; height: 86px; overflow: visible; margin-left: 6px; }
.note .dots { fill: none; stroke: currentColor; stroke-width: 3.4; stroke-linecap: round; stroke-dasharray: 0.1 7.5; }
.note .head { fill: none; stroke: currentColor; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.note-deck { right: -24px; top: -64px; }
.note-finder { left: calc(50% + 172px); top: 48px; }

/* ---------- Pronađi ---------- */
.finder-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.finder-phone { position: relative; display: flex; justify-content: center; }

/* Flat items, no filled box behind them (a box was deliberately rejected). */
.trust { display: grid; gap: 10px; padding: 0; list-style: none; }
.trust li { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 2px 14px; padding: 16px 18px; border-radius: 18px; background: var(--page); }
.trust-ico {
  grid-row: span 2; width: 40px; height: 40px; border-radius: 12px;
  background: var(--green-soft); color: var(--green-hi); display: grid; place-items: center; font-size: 21px;
}
.trust b { font-size: 16px; }
.trust p { color: var(--ink2); font-size: 14.5px; }

/* ---------- Gradovi ---------- */
.cities-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 32px; }
#gradovi .lead { max-width: none; }
.count-title { display: flex; align-items: baseline; gap: 0.3em; }
.bignum {
  font-size: clamp(4rem, 3rem + 5vw, 7.5rem); font-weight: 800; line-height: 0.9; letter-spacing: -0.05em;
  color: var(--green-hi); font-variant-numeric: tabular-nums;
}
.city-art { flex: none; margin-top: -30px; margin-right: 56px; }
.city-art svg { display: block; width: min(40vw, 330px); height: auto; }
/* All 39 chips look identical: do not highlight "big" cities. */
.cities { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; list-style: none; }
.cities li { padding: 8px 14px; border-radius: 999px; background: var(--floating); color: var(--ink2); font-weight: 600; font-size: 14px; }

/* ---------- Za oglašivače ---------- */
.prov { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.kinds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 28px; padding: 0; list-style: none; }
.kind { padding: 18px 16px; border-radius: 18px; background: var(--page); display: grid; align-content: start; gap: 8px; }
.kind .ms { color: var(--green-hi); font-size: 26px; }
.kind b { font-size: 16px; }
.kind p { color: var(--ink2); font-size: 13.5px; line-height: 1.45; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; counter-reset: step; }
.steps li {
  position: relative; counter-increment: step; display: grid; align-content: start;
  grid-template-columns: 44px minmax(0, 1fr); gap: 4px 16px; padding: 0 0 44px;
}
.steps li:last-child { padding-bottom: 0; }
/* Equal heights so both connector lines have the same length. */
.steps li:not(:last-child) { min-height: 130px; }
.steps li:not(:last-child)::after {
  content: ""; position: absolute; left: 21px; top: 52px; bottom: 8px; width: 2px; border-radius: 2px;
  background: linear-gradient(var(--green-deep), var(--green-soft));
}
.steps li::before {
  content: counter(step); grid-row: span 2; width: 44px; height: 44px; border-radius: 50%;
  background: var(--floating); color: var(--green-hi); font-weight: 800; font-size: 18px;
  display: grid; place-items: center;
}
.steps strong { font-size: 17px; }
.steps p { color: var(--ink2); font-size: 15px; }
.plus-demo {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 9px;
  background: var(--green); color: #fff; vertical-align: -6px; margin: 0 2px;
}
.plus-demo .ms { font-size: 18px; }

/* ---------- Pitanja ---------- */
/* The speech bubble is rotated 18deg: at ~1100px its corner pokes 1px past the viewport and
   would add a horizontal scrollbar. `clip` (not `hidden`) keeps this section from becoming a scroll container. */
#pitanja { overflow-x: clip; }
.faq-layout { display: grid; grid-template-columns: minmax(0, 820px) minmax(0, 1fr); gap: clamp(24px, 5vw, 64px); align-items: center; }
.faq-art { display: grid; place-items: center; align-self: start; }
.faq-art svg { width: min(100%, 220px); height: auto; margin-top: -48px; transform: rotate(18deg); }
.faq { max-width: 820px; display: grid; gap: 10px; }
.faq details { background: var(--floating); border-radius: 18px; }
.faq summary {
  list-style: none; cursor: pointer; padding: 20px 22px; font-weight: 700; font-size: 17px;
  display: flex; gap: 16px; align-items: center; justify-content: space-between;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .ms { transition: transform 0.2s; color: var(--ink2); flex: none; }
.faq details[open] summary .ms { transform: rotate(180deg); }
.faq details p { padding: 0 22px 22px; color: var(--ink2); max-width: 62ch; }

/* ---------- responsive ---------- */
/* Without room beside the phones (below 1280px for Pronađi, 1200px for the tour), each note sits above
   its phone instead, nudged right so the arrow points down at the phone's top. `position: relative`
   (not static) keeps the note above the phones where they overlap. */
/* The arrow's head points left on desktop (towards the phone beside it); above the phone it is turned
   so the head points down at the phone. */
@media (max-width: 1279px) { .note-finder svg { rotate: -65deg; margin-top: 16px; } }
@media (max-width: 1199px) { .note-deck svg { rotate: -65deg; margin-top: 16px; } }
@media (max-width: 1279px) {
  .finder-phone { flex-direction: column; align-items: center; }
  .note-finder { position: relative; inset: auto; translate: calc(90px * var(--phone-zoom, 1)) 0; margin-bottom: 14px; } /* no gap above this phone, unlike the deck */
}
@media (max-width: 1199px) {
  .note-deck { position: relative; inset: auto; justify-self: center; translate: calc(90px * var(--phone-zoom, 1)) 0; margin-bottom: -50px; }
}

/* Tour stacks earlier than the rest: below ~1100px the 680px deck squeezes the tab text into a
   ~240px column. Stacked order: chips, the selected tab's text, then the phones (the stage wrapper
   steps aside so its chips and deck can be ordered around the tab list). */
@media (max-width: 1100px) {
  .tour { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .tour-stage { display: contents; }
  .tabchips { display: flex; order: 1; }
  .tabs { order: 2; }
  .note-deck { order: 3; }
  .deck { order: 4; margin-top: 6px; }
  .tab:not([aria-selected="true"]) { display: none; }
  .tab { padding-inline: 14px; }
}

@media (max-width: 1000px) {
  /* Stacked: the speech bubbles sit to the right of the heading and the list takes the full width
     (the wrapper of heading + list steps aside so they can be placed in the grid). */
  .faq-layout { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "head art" "faq faq"; gap: 0 16px; align-items: center; }
  .faq-main { display: contents; }
  .faq-main .section-head { grid-area: head; }
  .faq { grid-area: faq; max-width: none; }
  .faq-art { grid-area: art; align-self: center; margin-bottom: clamp(36px, 5vw, 56px); }
  .faq-art svg { width: clamp(76px, 20vw, 140px); margin: 0 6px 0 0; }
}

@media (max-width: 900px) {
  /* tour: tab chips above the phones; only the active tab's text shows */
  .finder-grid, .prov { grid-template-columns: minmax(0, 1fr); }
  /* Stacked: the skyline sits to the right of "39 gradova" (spanning the eyebrow and title rows, on
     the title's baseline), the lead runs full width below. The heading wrapper steps aside so its
     parts can be placed in the grid. */
  .cities-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "eyebrow art" "title art" "lead lead"; gap: 14px 12px; }
  .cities-head .section-head { display: contents; }
  .cities-head .eyebrow { grid-area: eyebrow; }
  .cities-head .count-title { grid-area: title; }
  .cities-head .lead { grid-area: lead; }
  .city-art { grid-area: art; align-self: end; margin: 0 0 4px; }
  .city-art svg { width: clamp(64px, 26vw, 240px); }
}

@media (max-width: 560px) { .kinds { grid-template-columns: minmax(0, 1fr); } }
/* The three tour chips must fit side by side on 360px phones (the row scrolls sideways otherwise). */
/* Phones: the chips are centred in their row (auto margins, not justify-content, so a row that has
   to scroll never cuts off the first chip). Wider stacked layouts keep them left-aligned. */
@media (max-width: 399px) {
  .tabchips button:first-child { margin-left: auto; }
  .tabchips button:last-child { margin-right: auto; }
}
@media (max-width: 379px) {
  .tabchips { gap: 6px; }
  .tabchips button { gap: 5px; padding: 8px 11px 8px 8px; font-size: 13.5px; }
}
@media (max-width: 340px) {
  .tabchips { gap: 5px; }
  .tabchips button { gap: 4px; padding: 7px 9px 7px 7px; font-size: 13px; }
  .tabchips button .ms { font-size: 16px; }
}
/* Narrow phones: no room beside "39 gradova", so the skyline sits beside the eyebrow instead. */
@media (max-width: 420px) {
  .cities-head { grid-template-areas: "eyebrow art" "title title" "lead lead"; }
  .city-art { margin: 0; }
  .city-art svg { width: clamp(96px, 34vw, 140px); }
}
