/* ==========================================================================
   АТЕЉЕ — проширени систем
   Три нова писма (Literata, Nunito, Unbounded) и четири нове боје
   из базе UI/UX Pro Max скила. Сва писма су локална (раде без интернета).
   ========================================================================== */

:root {
  --font-head: "Literata", Georgia, "Times New Roman", "Noto Serif", serif;
  --font-body: "Nunito", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --font-num: "Unbounded", "Literata", Georgia, serif;

  /* нове боје: индиго, небо, маслина, магента */
  --indigo: #4f4fa5;
  --sky: #2f7fa8;
  --olive: #6f7f3c;
  --magenta: #b3437a;
}

/* ---------- Писма ---------- */

body {
  font-family: var(--font-body);
}

h1,
h2,
h3,
h4,
.quote p {
  font-family: var(--font-head);
}

.hero h1 {
  font-weight: 600;
  letter-spacing: -0.025em;
}

.sec-head h2,
.page-head h1,
.lesson h2,
.big-cta h2,
.about h2 {
  font-weight: 600;
  letter-spacing: -0.015em;
}

.lead,
.card p,
.lesson-body {
  font-weight: 400;
}

/* бројеви и ситна слова: Unbounded */
.stat-num {
  font-family: var(--font-num);
  font-weight: 500;
  font-size: 1.95rem;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
}

.kicker,
.stat-label,
.foot-title,
.tool-title {
  font-family: var(--font-num);
  font-weight: 500;
}

.kicker {
  font-size: 0.62rem;
  letter-spacing: 0.12em;
}

.stat-label {
  font-size: 0.64rem;
  letter-spacing: 0.08em;
}

.foot-title,
.tool-title {
  font-size: 0.66rem;
  letter-spacing: 0.1em;
}

/* рукописно писмо остаје за акценте */
.brand-name,
.hand,
.readout,
.art-caption,
.sketch-title,
.figure figcaption,
.term summary::after {
  font-family: var(--font-hand);
}

/* ---------- Нове боје у постојећем систему ---------- */

.ticker-track i {
  background: var(--red);
}
.ticker-track i:nth-child(8n + 2) {
  background: var(--orange);
}
.ticker-track i:nth-child(8n + 3) {
  background: var(--yellow);
}
.ticker-track i:nth-child(8n + 4) {
  background: var(--green);
}
.ticker-track i:nth-child(8n + 5) {
  background: var(--teal);
}
.ticker-track i:nth-child(8n + 6) {
  background: var(--blue);
}
.ticker-track i:nth-child(8n + 7) {
  background: var(--indigo);
}
.ticker-track i:nth-child(8n + 8) {
  background: var(--magenta);
}

.alpha button.is-active {
  background: var(--indigo);
  border-color: var(--indigo);
}

.alpha button:hover {
  border-color: var(--indigo);
  color: var(--indigo);
}

.chip-btn[aria-pressed="true"],
.chip-btn.is-active,
.tool-btn.is-active {
  background: var(--indigo);
  border-color: var(--indigo);
}

.term[open] summary::after {
  color: var(--magenta);
}

/* боје картика/ознака остају као код области; додатне се користе
   у радионицама, речнику и профилу */
.balance-stage .center-line {
  border-left-color: rgba(79, 79, 165, 0.45);
}

.pf-avatar {
  color: #fff;
}

/* трака са 12 боја не сме да развуче картицу на уским екранима */
.swatch-row {
  flex-wrap: wrap;
}

/* ==========================================================================
   УВОДНА АНИМАЦИЈА — лист папира са оловком која црта назив
   ========================================================================== */

body.intro-lock {
  overflow: hidden;
}

.intro {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background-color: var(--paper);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.045'/%3E%3C/svg%3E"),
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 160px 160px, 26px 26px, 26px 26px;
  box-shadow: 0 24px 60px rgba(34, 38, 46, 0.18);
  transform: translateY(0);
  transition: transform 0.72s cubic-bezier(0.72, 0, 0.24, 1);
  will-change: transform;
}

.intro.is-lifting {
  transform: translateY(-102%);
}

.intro-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 22px;
}

.intro-art {
  display: block;
  width: min(460px, 82vw, 50vh);
  height: auto;
  overflow: visible;
}

.intro-guide {
  fill: none;
  stroke: var(--line);
  stroke-width: 2;
  stroke-dasharray: 6 9;
  opacity: 0;
  animation: intro-guide-in 0.5s 0.1s ease-out forwards;
}

.intro-line {
  fill: none;
  stroke: var(--red);
  stroke-width: 4.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.intro-pencil {
  opacity: 0;
  transition: opacity 0.2s ease;
}

.intro.is-drawing .intro-pencil {
  opacity: 1;
}

.intro.is-named .intro-pencil {
  opacity: 0;
  transition: opacity 0.25s ease;
}

.intro-name {
  display: inline-block;
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: clamp(1.8rem, 6vw, 3.2rem);
  line-height: 1.05;
  letter-spacing: 0.01em;
  color: var(--ink);
  clip-path: inset(-0.2em 100% -0.25em 0);
}

.intro.is-named .intro-name {
  animation: intro-write 0.62s cubic-bezier(0.33, 0.8, 0.2, 1) forwards;
}

.intro-tag {
  margin-top: 10px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0;
}

.intro.is-named .intro-tag {
  animation: intro-fade-in 0.5s 0.34s ease-out forwards;
}

.intro-dots {
  display: flex;
  gap: 11px;
  margin-top: 20px;
}

.intro-dots i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  opacity: 0;
  transform: scale(0.4);
}

.intro-dots i:nth-child(1) {
  background: var(--red);
}

.intro-dots i:nth-child(2) {
  background: var(--yellow);
}

.intro-dots i:nth-child(3) {
  background: var(--blue);
}

.intro.is-named .intro-dots i {
  animation: intro-dot 0.4s cubic-bezier(0.2, 1.5, 0.4, 1) forwards;
}

.intro.is-named .intro-dots i:nth-child(2) {
  animation-delay: 0.09s;
}

.intro.is-named .intro-dots i:nth-child(3) {
  animation-delay: 0.18s;
}

.intro-load {
  position: absolute;
  left: 50%;
  bottom: 9vh;
  transform: translateX(-50%);
  width: min(230px, 62vw);
  height: 3px;
  border-radius: 3px;
  background: rgba(34, 38, 46, 0.12);
  overflow: hidden;
}

.intro-load i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--red), var(--yellow), var(--green), var(--blue));
}

.intro.is-loading .intro-load i {
  width: 100%;
  transition: width 0.54s ease-in-out;
}

/* страница се „слета“ кад се лист подигне */
#main.intro-settle {
  animation: intro-settle 0.62s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes intro-guide-in {
  to { opacity: 1; }
}

@keyframes intro-write {
  to { clip-path: inset(-0.2em 0 -0.25em 0); }
}

@keyframes intro-fade-in {
  to { opacity: 1; }
}

@keyframes intro-dot {
  to { opacity: 1; transform: scale(1); }
}

@keyframes intro-settle {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 520px) {
  .intro-load {
    bottom: 7vh;
  }
  .intro-dots {
    margin-top: 14px;
  }
}
