/* =============================================================
   Shadow Dreams · početna stranica (qr.shadowdreams.net)
   Svetla, prirodna paleta; isti fontovi kao javna deklaracija.
   ============================================================= */

:root {
  --bg:        #f5f7f2;
  --surface:   #ffffff;
  --ink:       #2a2438;
  --ink-2:     #5b5768;
  --muted:     #8a8696;
  --sage:      #5f7658;
  --sage-dark: #4b5f45;
  --sage-2:    #8fa382;
  --sage-soft: #e9efe4;
  --rose:      #c2887a;
  --gold:      #bd9b5b;
  --line:      rgba(42, 36, 56, .09);
  --shadow:    0 1px 2px rgba(42, 36, 56, .04), 0 8px 24px -12px rgba(42, 36, 56, .18);
  --shadow-up: 0 2px 4px rgba(42, 36, 56, .05), 0 16px 32px -14px rgba(42, 36, 56, .26);
  --radius:    18px;
  --glow-1:    rgba(143, 163, 130, .22);
  --glow-2:    rgba(194, 136, 122, .14);
  --hover-soft: #dfe8d8;
  --row-hover: #f7f9f5;
  --chip-bg:   rgba(255, 255, 255, .7);
  --lot-bg:    linear-gradient(160deg, #eef3ea, #e6ede0);
  --lot-line:  rgba(95, 118, 88, .16);
  --error:     #a3443a;
  --backdrop:  rgba(42, 36, 56, .38);
  --botanic-op: .45;
  --logo-filter: none;
  color-scheme: light;
  --ease:      cubic-bezier(.2, .7, .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: 'Work Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background:
    radial-gradient(ellipse 70% 45% at 85% -5%, var(--glow-1), transparent 70%),
    radial-gradient(ellipse 60% 40% at -10% 105%, var(--glow-2), transparent 70%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; }
:focus-visible { outline: 2px solid var(--sage); outline-offset: 3px; border-radius: 6px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* linije listova u pozadini */
.botanic {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  color: var(--sage-2);
  opacity: var(--botanic-op);
  pointer-events: none;
  z-index: 0;
}

/* -------------------------------------------------------------
   Raspored
   ------------------------------------------------------------- */
.page {
  position: relative; z-index: 1;
  width: 100%; max-width: 460px;
  margin: 0 auto;
  padding: max(40px, env(safe-area-inset-top)) 20px max(28px, env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 28px;
}

/* -------------------------------------------------------------
   Zaglavlje
   ------------------------------------------------------------- */
.hero { text-align: center; }
.hero-logo {
  display: block;
  width: min(190px, 52vw);
  aspect-ratio: 1 / .45;
  object-fit: contain;
  margin: 0 auto 16px;
  filter: var(--logo-filter);
}
.hero-tag {
  margin: 0;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.6rem;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -.01em;
}
.hero-tag em { font-style: italic; color: var(--sage); }
.hero-text { margin: 8px 0 0; color: var(--ink-2); font-size: .98rem; }

.kinds {
  list-style: none;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
  margin: 18px 0 0; padding: 0;
}
.kinds li {
  padding: 5px 13px;
  border-radius: 99px;
  background: var(--chip-bg);
  border: 1px solid var(--line);
  font-size: .82rem; font-weight: 500;
  color: var(--ink-2);
}

/* -------------------------------------------------------------
   Kartice sa linkovima
   ------------------------------------------------------------- */
.links { display: grid; gap: 12px; }

.link-card {
  display: flex; align-items: center; gap: 16px;
  width: 100%;
  padding: 16px 18px 16px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--ink);
  font: inherit; text-align: left; text-decoration: none;
  cursor: pointer;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s;
  -webkit-tap-highlight-color: transparent;
}
.link-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-up); border-color: rgba(95, 118, 88, .3); }
.link-card:active { transform: translateY(0) scale(.99); }

.link-icon {
  flex: none;
  display: grid; place-items: center;
  width: 52px; height: 52px;
  border-radius: 15px;
  background: var(--sage-soft);
  font-size: 1.45rem;
  color: var(--sage);
  --fa-primary-color: var(--sage);
  --fa-secondary-color: var(--sage-2);
  --fa-secondary-opacity: .55;
  transition: background .2s;
}
.link-card:hover .link-icon { background: var(--hover-soft); }

.link-text { display: grid; gap: 1px; min-width: 0; }
.link-title { font-weight: 600; font-size: 1.02rem; }
.link-sub { font-size: .86rem; color: var(--muted); }

.link-arrow {
  margin-left: auto;
  font-size: .85rem;
  color: var(--muted);
  transition: transform .2s var(--ease), color .2s;
}
.link-card:hover .link-arrow { transform: translateX(3px); color: var(--sage); }
.link-card.loading .link-arrow { animation: spin .8s linear infinite; color: var(--sage); }

@keyframes spin { to { transform: rotate(360deg); } }

/* -------------------------------------------------------------
   Provera deklaracije
   ------------------------------------------------------------- */
.lot {
  padding: 20px;
  border-radius: var(--radius);
  background: var(--lot-bg);
  border: 1px solid var(--lot-line);
}
.lot-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.lot-icon {
  flex: none;
  display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--surface);
  font-size: 1.15rem;
  --fa-primary-color: var(--sage);
  --fa-secondary-color: var(--gold);
  --fa-secondary-opacity: .7;
}
.lot h2 {
  margin: 0;
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  font-size: 1.2rem;
  letter-spacing: -.01em;
}
.lot p { margin: 2px 0 0; font-size: .88rem; color: var(--ink-2); }

.lot-form {
  display: flex; gap: 8px;
  padding: 5px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  transition: border-color .2s, box-shadow .2s;
}
.lot-form:focus-within { border-color: var(--sage-2); box-shadow: 0 0 0 4px rgba(143, 163, 130, .22); }
.lot-form input {
  flex: 1; min-width: 0;
  padding: 10px 12px;
  border: 0; outline: 0;
  background: transparent;
  font: 500 1.02rem/1.2 ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  letter-spacing: .04em;
  color: var(--ink);
}
.lot-form input::placeholder { color: var(--muted); font-weight: 400; letter-spacing: .02em; }
.lot-form button {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 0 18px;
  border: 0; border-radius: 10px;
  background: var(--sage);
  color: #fff;
  font: 600 .95rem 'Work Sans', sans-serif;
  cursor: pointer;
  transition: background .2s;
}
.lot-form button:hover { background: var(--sage-dark); }
.lot-form button i { font-size: .8rem; }
.lot-form.loading button i { animation: spin .8s linear infinite; }
.lot-form.loading button i::before { content: "\f110"; }

.lot-msg { min-height: 1.3em; margin: 8px 2px 0; font-size: .84rem; color: var(--ink-2); }
.lot-msg:empty { margin: 0; min-height: 0; }
.lot-msg.error { color: var(--error); }
.lot.shake .lot-form { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

/* -------------------------------------------------------------
   Podnožje
   ------------------------------------------------------------- */
.foot { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: .78rem; color: var(--muted); padding-top: 4px; }

/* -------------------------------------------------------------
   Kontakt (donji panel na telefonu, prozor na računaru)
   ------------------------------------------------------------- */
.sheet {
  width: 100%; max-width: 460px;
  margin: auto auto 0;
  padding: 0;
  border: 0;
  border-radius: 24px 24px 0 0;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 -10px 40px rgba(42, 36, 56, .2);
}
.sheet::backdrop { background: var(--backdrop); backdrop-filter: blur(3px); }
.sheet[open] { animation: sheet-up .32s var(--ease); }
.sheet[open]::backdrop { animation: fade .3s ease; }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

.sheet-inner { padding: 10px 20px max(22px, env(safe-area-inset-bottom)); }
.sheet-inner::before {
  content: ''; display: block;
  width: 40px; height: 4px; margin: 0 auto 12px;
  border-radius: 4px; background: var(--line);
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.sheet-head h2 { margin: 0; font-family: 'Fraunces', Georgia, serif; font-weight: 500; font-size: 1.4rem; }
.sheet-close {
  display: grid; place-items: center;
  width: 38px; height: 38px;
  border: 0; border-radius: 50%;
  background: var(--sage-soft); color: var(--ink-2);
  cursor: pointer;
}
.sheet-close:hover { background: var(--hover-soft); color: var(--ink); }

.contact-list { list-style: none; margin: 0; padding: 0; }
.contact-list li + li { border-top: 1px solid var(--line); }
.contact-list a {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 4px;
  text-decoration: none;
  border-radius: 10px;
  word-break: break-word;
}
.contact-list a:hover { background: var(--row-hover); }
.contact-list small { display: block; font-size: .74rem; color: var(--muted); letter-spacing: .02em; }
.c-icon {
  flex: none;
  display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--sage-soft);
  color: var(--sage);
  --fa-primary-color: var(--sage);
  --fa-secondary-color: var(--sage-2);
  --fa-secondary-opacity: .55;
}

.sheet-actions { display: grid; gap: 8px; margin-top: 16px; }
.btn-primary, .btn-quiet {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px;
  border-radius: 14px;
  font: 600 1rem 'Work Sans', sans-serif;
  text-decoration: none;
  cursor: pointer;
}
.btn-primary {
  border: 0;
  background: var(--sage); color: #fff;
  --fa-primary-color: #fff;
  --fa-secondary-color: #fff;
  --fa-secondary-opacity: .5;
}
.btn-primary:hover { background: var(--sage-dark); }
.btn-quiet { border: 1px solid var(--line); background: transparent; color: var(--ink-2); }
.btn-quiet:hover { background: var(--row-hover); color: var(--ink); }

@media (min-width: 640px) {
  .page { padding-top: 72px; gap: 32px; }
  .hero-tag { font-size: 1.85rem; }
  .sheet { margin: auto; border-radius: 24px; box-shadow: 0 30px 80px rgba(42, 36, 56, .25); }
  .sheet-inner::before { display: none; }
  .sheet-inner { padding: 22px 24px 24px; }
}

/* -------------------------------------------------------------
   Uvodna animacija
   ------------------------------------------------------------- */
.intro-logo { display: none; }

body.intro .intro-logo {
  position: fixed; inset: 0; z-index: 10;
  display: grid; place-items: center;
  background: var(--bg);
  transition: opacity .6s ease .1s, visibility 0s linear .7s;
}
body.intro .intro-logo img {
  width: min(300px, 78vw);
  aspect-ratio: 1 / .45;
  object-fit: contain;
  animation: intro-in .9s var(--ease) both;
}
@keyframes intro-in { from { opacity: 0; transform: scale(.94); filter: blur(4px); } }

body.intro.ready .intro-logo { opacity: 0; visibility: hidden; }
body.intro.ready .intro-logo img { transform: translateY(-18vh) scale(.85); transition: transform .7s var(--ease); }

body.intro .page > * { opacity: 0; transform: translateY(14px); }
body.intro.ready .page > * {
  opacity: 1; transform: none;
  transition: opacity .6s ease, transform .6s var(--ease);
}
body.intro.ready .page > :nth-child(1) { transition-delay: .15s; }
body.intro.ready .page > :nth-child(2) { transition-delay: .25s; }
body.intro.ready .page > :nth-child(3) { transition-delay: .35s; }
body.intro.ready .page > :nth-child(4) { transition-delay: .45s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  body.intro .intro-logo { display: none; }
  body.intro .page > * { opacity: 1; transform: none; }
}

/* ispravke */
.hero-tag em { display: block; }
@media (min-width: 640px) { .botanic { opacity: .32; } }
.link-card:hover .link-arrow { transform: translate(2px, -2px); }

/* -------------------------------------------------------------
   Noćna varijanta (20–6 h ili ručno)
   ------------------------------------------------------------- */
[data-theme="dark"] {
  --bg:        #16131c;
  --surface:   #211d29;
  --ink:       #ece9f1;
  --ink-2:     #b4aec0;
  --muted:     #847e92;
  --sage:      #9cb890;
  --sage-dark: #b2cba6;
  --sage-2:    #7d9771;
  --sage-soft: rgba(156, 184, 144, .12);
  --rose:      #d39a8c;
  --gold:      #d2b07a;
  --line:      rgba(255, 255, 255, .08);
  --shadow:    0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px -14px rgba(0, 0, 0, .6);
  --shadow-up: 0 2px 4px rgba(0, 0, 0, .35), 0 18px 36px -14px rgba(0, 0, 0, .75);
  --glow-1:    rgba(90, 120, 84, .20);
  --glow-2:    rgba(120, 90, 150, .18);
  --hover-soft: rgba(156, 184, 144, .2);
  --row-hover: rgba(255, 255, 255, .04);
  --chip-bg:   rgba(255, 255, 255, .04);
  --lot-bg:    linear-gradient(160deg, #222a22, #1c221d);
  --lot-line:  rgba(156, 184, 144, .16);
  --error:     #f0897f;
  --backdrop:  rgba(5, 4, 8, .6);
  --botanic-op: .2;
  --logo-filter: brightness(0) invert(1);
  color-scheme: dark;
}
[data-theme="dark"] .lot-form button,
[data-theme="dark"] .btn-primary { color: #142012; --fa-primary-color: #142012; --fa-secondary-color: #142012; }
[data-theme="dark"] .lot-icon { background: var(--surface); }
[data-theme="dark"] .sheet { box-shadow: 0 -10px 40px rgba(0, 0, 0, .5); }
[data-theme="dark"] .intro-logo img { filter: var(--logo-filter); }

.theme-anim body, .theme-anim body * {
  transition: background-color .4s ease, color .4s ease, border-color .4s ease !important;
}

/* neupadljiv prekidač teme u podnožju */
.theme-toggle {
  display: inline-grid; place-items: center;
  width: 30px; height: 30px; padding: 0;
  border: 1px solid transparent; border-radius: 50%;
  background: transparent; color: var(--muted);
  cursor: pointer; opacity: .7;
  transition: opacity .2s, color .2s, border-color .2s, background .2s;
}
.theme-toggle:hover { opacity: 1; color: var(--ink); border-color: var(--line); background: var(--surface); }
.theme-toggle .i-sun { display: none; }
[data-theme="dark"] .theme-toggle .i-sun { display: block; }
[data-theme="dark"] .theme-toggle .i-moon { display: none; }

/* -------------------------------------------------------------
   Sertifikat starog zanata
   ------------------------------------------------------------- */
.craft {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 18px 16px 14px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.craft::after {
  content: '';
  position: absolute; inset: 0 auto 0 0; width: 3px;
  background: linear-gradient(180deg, var(--gold), var(--rose));
  opacity: .7;
}
.craft-seal {
  flex: none;
  width: 76px; height: 76px;
  transform: rotate(-8deg);
  filter: drop-shadow(0 4px 8px rgba(42, 36, 56, .14));
}
.craft-wax  { fill: var(--seal-wax); }
.craft-ring { fill: none; stroke: var(--seal-line); stroke-width: 1.2; opacity: .6; }
.craft-hand { stroke: var(--seal-hand); }
.craft-text { min-width: 0; }
.craft-kicker {
  margin: 0 0 3px;
  font-size: .68rem; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--gold-ink);
}
.craft h2 {
  margin: 0;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.12rem; font-weight: 500;
  line-height: 1.25;
  letter-spacing: -.01em;
}
.craft-text p:last-child { margin: 4px 0 0; font-size: .86rem; line-height: 1.45; color: var(--ink-2); }

:root {
  --seal-wax:  #ecdcc4;
  --seal-line: #a8844a;
  --seal-hand: #8a6a35;
  --gold-ink:  #94733c;
}
[data-theme="dark"] {
  --seal-wax:  #3a3226;
  --seal-line: #d2b07a;
  --seal-hand: #e2c58f;
  --gold-ink:  #d2b07a;
}
body.intro.ready .page > :nth-child(5) { transition-delay: .55s; }

@media (max-width: 360px) {
  .craft { align-items: flex-start; }
  .craft-seal { width: 60px; height: 60px; }
}
.craft-no {
  fill: var(--seal-hand);
  font-family: 'Fraunces', Georgia, serif;
  font-size: 9.5px; font-weight: 600;
  letter-spacing: .3px;
}
.craft-seal { width: 80px; height: 80px; }

/* ispravke: manji logo i razmak */
.page { gap: 22px; }
@media (min-width: 640px) { .page { padding-top: 56px; gap: 26px; } }
