/* ============================================================
   SWEDBANK — Atrodi savu vietu · stili (v3, pēc pārstrādātā Figma)
   Bāze 1080×1920: 1cqw = 10.8 px, 1cqh = 19.2 px.
   ============================================================ */

@font-face {
  font-family: "Swedbank Headline";
  src: local("Swedbank Headline Bold"), local("SwedbankHeadline-Bold"),
       url("assets/fonts/SwedbankHeadline-Bold.otf") format("opentype");
  font-weight: 700; font-display: swap;
}
@font-face {
  font-family: "Swedbank Headline";
  src: local("Swedbank Headline Black"), local("SwedbankHeadline-Black"),
       url("assets/fonts/SwedbankHeadline-Black.otf") format("opentype");
  font-weight: 900; font-display: swap;
}

:root {
  --par-x: 0; --par-y: 0; --bg-x: 0px; --bg-y: 0px;
  --cream: #FDF6EE;
  --orange: #FF5F00;
  --orange-2: #F4641C;
  --orange-text: #FB4F00;
  --teal: #31A3AE;
  --purple: #C5569A;
  --mint: #BBEAD9;
  --pink: #F8DBF5;
  --ink: #512B2B;
  --grid: rgba(81, 43, 43, .16);
  --radius: 1.85cqw;              /* 20 px dizainā */
  --font: "Swedbank Headline", "Avenir Next", "Helvetica Neue", Arial, sans-serif;
  --ease-out: cubic-bezier(.22, .9, .3, 1);
  --ease-spring: cubic-bezier(.34, 1.45, .5, 1);
  --paper: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .10 0'/></filter><rect width='240' height='240' filter='url(%23n)'/></svg>");
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--cream);
  color: #fff;
  font-family: var(--font);
  font-weight: 700;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  display: grid; place-items: center;
  background-image:
    linear-gradient(to right, var(--grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: var(--cell, 31px) var(--cell, 31px);
  background-position: calc(50% + var(--bg-x)) calc(0px + var(--bg-y));
}

.stage {
  position: relative;
  height: 100dvh;
  width: min(100vw, calc(100dvh * 9 / 16));
  container-type: size;
  user-select: none; -webkit-user-select: none;
}
.screen { position: absolute; inset: 0; display: none; }
.screen.active { display: block; }
#screen-start, #screen-quiz { perspective: 120cqw; perspective-origin: 50% 45%; }
#screen-start { z-index: 4; }
#screen-quiz { z-index: 3; }
#screen-result, #screen-detail { z-index: 2; }

/* ---------- kartīte = oranža papīra lapa ---------- */
.card {
  --dx: 0px; --dy: 0px; --rz: 0deg; --ry: 0deg; --rx: 0deg; --depth: 0; --lift: 1;
  --pk: calc(1 - var(--depth) * .3);
  --ppx: calc(var(--par-x) * .6cqw * var(--pk));
  --ppy: calc(var(--par-y) * .45cqw * var(--pk));
  position: absolute;
  left: 6.94cqw; top: 9.58cqh;
  width: 86.16cqw; height: 76.68cqh;
  border-radius: var(--radius);
  background: linear-gradient(160deg, var(--orange) 0%, var(--orange) 70%, var(--orange-2) 100%);
  box-shadow:
    calc(var(--par-x) * -.5cqw) calc(2.4cqh + var(--par-y) * -.25cqh) 3.4cqh rgba(81, 43, 43, .20),
    calc(var(--par-x) * -.15cqw) .5cqh .9cqh rgba(81, 43, 43, .10);
  touch-action: none;
  cursor: grab;
  transform:
    translate3d(calc(var(--dx) + var(--ppx)), calc(var(--dy) + var(--ppy) + var(--depth) * 1.6cqh), calc(var(--depth) * -7cqw))
    rotateZ(var(--rz)) rotateY(var(--ry)) rotateX(var(--rx))
    scale(var(--lift));
  transition: transform .6s var(--ease-spring);
  will-change: transform;
}
.card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: var(--paper); background-size: 240px 240px;
  mix-blend-mode: multiply; opacity: .55; pointer-events: none;
}
.card.dragging { cursor: grabbing; transition: none; box-shadow: 0 4cqh 5cqh rgba(81,43,43,.26), 0 .8cqh 1.4cqh rgba(81,43,43,.12); }
.card.tilting:not(.dragging) { transition: transform .25s ease-out; }
.card.flying { pointer-events: none; z-index: 30 !important; }

@property --dy { syntax: "<length>"; inherits: false; initial-value: 0px; }
@property --dx { syntax: "<length>"; inherits: false; initial-value: 0px; }
@property --ry { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@property --rx { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@property --rz { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

@keyframes float {
  0%, 100% { --dy: 0px; --ry: -1.5deg; --rx: .6deg; }
  50%      { --dy: -.7cqh; --ry: 1.5deg; --rx: -.6deg; }
}
.card.floating { animation: float 5s ease-in-out infinite; }
@keyframes wiggle {
  0%, 100% { --dx: 0px; --rz: 0deg; }
  30% { --dx: 3cqw; --rz: 2.2deg; }
  70% { --dx: -2.4cqw; --rz: -1.8deg; }
}
.card.wiggle { animation: wiggle 1.1s var(--ease-out) 1; }

/* ---------- sākuma kartīte ---------- */
.start-card {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 3.96cqh 5cqw calc(15.46cqw + 7cqh);
}
.start-card > * { position: relative; z-index: 1; }
.logo { width: 38.33cqw; height: auto; }
.start-title {
  margin: 4.2cqh 0 0; font-weight: 900;
  font-size: 10.19cqw; line-height: 1.13;
  width: 75.46cqw; white-space: pre-line;
}
.start-lead { margin: 3cqh 0 0; width: 67.13cqw; font-size: 4.17cqw; line-height: 1.3; }
.hint-box {
  margin-top: auto;
  width: 71.76cqw; min-height: 8.28cqh;
  display: flex; align-items: center; justify-content: center;
  padding: 1cqh 3cqw;
  background: var(--teal);
  font-size: 3.7cqw; line-height: 1.32;
}
.disclaimer {
  position: absolute; left: 7cqw; right: 7cqw; bottom: 2.4cqh; margin: 0;
  text-align: center; color: var(--ink);
  font-size: 2.4cqw; line-height: 1.45; opacity: .75;
  transform: translate(calc(var(--par-x) * .2cqw), calc(var(--par-y) * .15cqw));
}
.disclaimer a { color: var(--orange-text); text-decoration: none; white-space: nowrap; }
.disclaimer a:hover { text-decoration: underline; }
#screen-start.leaving .disclaimer, #screen-start.leaving .controls-start { opacity: 0; transition: opacity .4s; }

/* ievadanimācija: lapa ceļas no guļus (klonētas joslas), īstā kartīte pagaidām paslēpta */
/* īstā kartīte animācijas laikā ir caurspīdīga, bet joprojām satverama —
   tāpēc pirmais pieskāriens uzreiz sāk vilkšanu, nevis tikai pārtrauc animāciju */
#screen-start.rising > #start-card { box-shadow: none; }
.rise-layer {
  position: absolute; inset: 0; z-index: 40;
  perspective: 135cqw; perspective-origin: 50% 58%;
  pointer-events: none;
}
.rise-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.rise-shadow {
  position: absolute; background: rgba(81, 43, 43, .5);
  filter: blur(2.2cqw); border-radius: 50%;
  transform-origin: 50% 0; opacity: 0;
}

/* atruna parādās, kad lapa jau nostājusies */
#screen-start .disclaimer { opacity: 0; transition: opacity .7s var(--ease-out); }
#screen-start.opened .disclaimer { opacity: .75; transition-delay: 1.5s; }

/* ---------- bultu pogas ---------- */
.controls { position: absolute; display: flex; justify-content: space-between; }
.controls-start { left: 7.5cqw; right: 7.55cqw; bottom: 3.86cqh; }
.arrow-btn {
  appearance: none; border: 0; padding: 0; margin: 0; background: transparent; cursor: pointer;
  width: 15.46cqw; height: 15.46cqw; border-radius: 50%;
  transition: transform .15s ease-out;
  -webkit-tap-highlight-color: transparent;
}
.arrow-btn img { display: block; width: 100%; height: 100%; }
.arrow-btn.flip img { transform: scaleX(-1); }
.arrow-btn:hover { transform: scale(1.06); }
.arrow-btn:active { transform: scale(.92); transition-duration: .05s; }
.arrow-btn:focus-visible { outline: .4cqw solid #fff; outline-offset: .5cqw; }

/* ---------- jautājumu kartītes ---------- */
.stack { position: absolute; inset: 0; }
.q-card { z-index: calc(10 - var(--depth)); }
.q-card.behind { pointer-events: none; filter: brightness(calc(1 - var(--depth) * .06)); }
@keyframes cardEnter { from { opacity: 0; --dy: 3cqh; } to { opacity: 1; --dy: 0px; } }
.q-card.enter { animation: cardEnter .6s var(--ease-out) both; }

.q-card .logo {
  position: absolute; left: 50%; top: 3.96cqh;
  transform: translateX(-50%);
}
.q-card .statement {
  /* noenkurots pēc centra: dizaina 4 rindu teksts trāpa 1:1, īsāki paliek līdzsvarā */
  position: absolute; left: 50%; top: 29.9cqh;
  transform: translate(-50%, -50%);
  width: 64.63cqw; margin: 0; text-align: center;
  font-weight: 900; font-size: 6.11cqw; line-height: 1.2;
  text-shadow: 0 .2cqh .6cqh rgba(120, 40, 0, .18);
  transition: opacity .35s;
}
@keyframes textIn { from { opacity: 0; transform: translate(-50%, calc(-50% + 1.6cqh)); } to { opacity: 1; transform: translate(-50%, -50%); } }
.q-card.is-top .statement { animation: textIn .4s var(--ease-out) both; }
.q-card .counter {
  position: absolute; left: 0; right: 0; top: 67.6cqh;
  text-align: center; font-size: 3cqw; letter-spacing: .08em; opacity: .5;
}

.stamp {
  position: absolute; top: 12.5cqh;
  padding: .8cqh 2.4cqw; border: .9cqw solid;
  font-weight: 900; font-size: 5cqw; letter-spacing: .04em;
  opacity: 0; pointer-events: none; z-index: 2;
  background: rgba(255,255,255,.08);
}
.stamp-yes { right: 6cqw; color: var(--pink); border-color: var(--pink); transform: rotate(12deg); }
.stamp-no  { left: 6cqw;  color: var(--mint); border-color: var(--mint); transform: rotate(-12deg); }

.controls-quiz {
  --p-yes: 0; --p-no: 0;
  left: 14.44cqw; right: 14.44cqw; top: 69.95cqh;
  z-index: 20;
  transform: translate(calc(var(--par-x) * .6cqw), calc(var(--par-y) * .45cqw));
  transition: opacity .5s;
}
.control {
  display: flex; flex-direction: column; align-items: center; gap: 1.56cqh;
  transform: scale(calc(1 + var(--p) * .12)) translateY(calc(var(--p) * -.5cqh));
  transition: transform .2s ease-out;
}
#ctl-no  { --p: var(--p-no); }
#ctl-yes { --p: var(--p-yes); }
.control-label { font-size: 2.96cqw; letter-spacing: .03em; opacity: calc(.8 + var(--p) * .2); }

/* ---------- rezultāts ---------- */
.result-kicker {
  position: absolute; left: 0; right: 0; top: 13.54cqh; margin: 0;
  text-align: center; color: var(--orange-text); font-size: 5.56cqw;
}
.result-name-box {
  position: absolute; left: 50%; top: 18.18cqh;
  transform: translateX(-50%);
  max-width: 92cqw;
  background: var(--orange);
  padding: .63cqh 5.56cqw;
  display: flex; align-items: center; justify-content: center;
}
.result-name {
  margin: 0; color: #fff; font-weight: 900;
  font-size: 12.96cqw; line-height: 1.05; white-space: nowrap;
}
.result-quote {
  position: absolute; left: 50%; top: 30.89cqh; transform: translateX(-50%);
  margin: 0; width: 68.98cqw; text-align: center;
  color: var(--orange-text); font-size: 5.56cqw; line-height: 1.25;
}
.animal-box {
  position: absolute; left: 50%; top: 35.73cqh;
  width: 73.89cqw; height: 42.24cqh;
  transform: translate(calc(-50% + var(--par-x) * 1cqw), calc(var(--par-y) * .7cqw));
}
.animal { display: block; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 1.4cqh 1.6cqh rgba(81,43,43,.18)); }
.animal.flip { transform: scaleX(-1); }
#result-animal { opacity: 0; }
#screen-result.ready #result-animal { opacity: 1; }

/* ---------- pogas ---------- */
.cta {
  display: flex; align-items: center; justify-content: center; gap: 2.31cqw;
  background: var(--teal); color: #fff; border: 0; cursor: pointer;
  font: inherit; font-weight: 700; font-size: 5.56cqw; line-height: 1.25;
  text-decoration: none;
  border-radius: 100cqw;
  padding: 1.04cqh 0;
  transition: transform .15s ease-out, filter .15s;
}
.cta:hover { filter: brightness(1.06); }
.cta:active { transform: scale(.98); transition-duration: .05s; }
.cta-arrow { width: 7.04cqw; height: auto; transition: transform .25s var(--ease-spring); }
.cta:hover .cta-arrow { transform: translateX(.8cqw); }

/* dalīšanās — tirkīza kontūra */
.cta-secondary {
  background: transparent; color: var(--teal);
  border: .46cqw solid var(--teal);
  font-size: 4.2cqw; gap: 2cqw; padding: .8cqh 4cqw;
}
.cta-secondary:hover { background: rgba(49, 163, 174, .08); filter: none; }
.cta-secondary:disabled { opacity: .6; cursor: default; }
.share-icon { width: 4.6cqw; height: 4.6cqw; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.share-thumb {
  width: 4.6cqw; height: 8.2cqw; object-fit: cover; object-position: top;
  border: .28cqw solid var(--teal); background: var(--cream);
  transform: rotate(6deg);
}

/* atklāšana pēc locīšanas */
.reveal { opacity: 0; translate: 0 1.4cqh; transition: opacity .7s var(--ease-out), translate .7s var(--ease-out); }
.ready .reveal { opacity: 1; translate: 0 0; }
.ready .result-kicker   { transition-delay: .1s; }
.ready .result-name-box { transition-delay: .25s; }
.ready .result-quote    { transition-delay: .4s; }

/* ---------- detaļas ---------- */
@keyframes fadeUp { from { opacity: 0; translate: 0 2cqh; } to { opacity: 1; translate: 0 0; } }
#screen-detail.active > * { animation: fadeUp .6s var(--ease-out) both; }
#screen-detail.active > :nth-child(2) { animation-delay: .08s; }
#screen-detail.active > :nth-child(3) { animation-delay: .16s; }
#screen-detail.active > :nth-child(4) { animation-delay: .24s; }
#screen-detail.active > :nth-child(5) { animation-delay: .3s; }
#screen-detail.active > :nth-child(6) { animation-delay: .36s; }

.detail-desc {
  position: absolute; left: 16.02cqw; top: 13.54cqh; width: 53.61cqw; margin: 0;
  color: var(--orange-text); font-size: 4.63cqw; line-height: 1.3;
  transform: translate(calc(var(--par-x) * .3cqw), calc(var(--par-y) * .2cqw));
}
.detail-animal-box {
  position: absolute; left: 60.46cqw; top: 17.24cqh;
  width: 57.22cqw; height: 32.71cqh;
  z-index: 2;
  transform: translate(calc(var(--par-x) * 1cqw), calc(var(--par-y) * .7cqw));
}
.jobs-box {
  position: absolute; left: 6.85cqw; top: 32.6cqh;
  width: 86.2cqw; min-height: 33.33cqh;
  padding: 3.12cqh 5cqw 3cqh 9.17cqw;
  background: var(--purple);
  border-radius: var(--radius);
  transform: translate(calc(var(--par-x) * .45cqw), calc(var(--par-y) * .3cqw));
}
.jobs-title { margin: 0 0 1.5cqh; font-weight: 900; font-size: 5.56cqw; }
.jobs { margin: 0; padding: 0 0 0 4.4cqw; font-size: 4.63cqw; line-height: 1.4; }
.jobs li { padding-left: .4cqw; }
#btn-vacancies {
  position: absolute; left: 50%; top: 62.97cqh; transform: translateX(-50%);
  width: 69.07cqw; z-index: 3;
}
.sticker { position: absolute; left: 50%; top: 73.28cqh; width: 69.64cqw; transform: translateX(-50%); }
.detail-footer {
  position: absolute; left: 0; right: 0; bottom: 2.2cqh;
  display: flex; flex-direction: column; align-items: center; gap: 1.6cqh;
}
.link-btn {
  appearance: none; background: none; border: 0; padding: .4cqh 1cqw; cursor: pointer;
  font: inherit; font-size: 2.9cqw; color: var(--ink); opacity: .7;
  text-decoration: underline; text-underline-offset: .3em;
}
.link-btn:hover { opacity: 1; }

/* ---------- LOCĪŠANAS SLĀNIS (origami + lapas atvēršana) ---------- */
.fold-layer {
  position: absolute; inset: 0; z-index: 50;
  perspective: 95cqw; perspective-origin: 50% 42%;
  transform-style: preserve-3d;
  pointer-events: none;
}
.fold-layer > * { position: absolute; }
.paper::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: var(--paper); background-size: 240px 240px;
  mix-blend-mode: multiply; opacity: .55; pointer-events: none;
}
.fold-layer .sheet { transition: box-shadow .5s; }
.fold-layer .flap { transform-style: preserve-3d; will-change: transform; }
.fold-layer .face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden; }
.fold-layer .face .gloss { position: absolute; inset: 0; opacity: 0; }
.fold-layer .table-shadow { filter: blur(1.6cqw); opacity: 0; background: rgba(70, 25, 0, .35); }
.fold-layer .fold-shadow { opacity: 0; }
.fold-layer .morph { will-change: clip-path, transform; background: var(--orange); }
.fold-layer .morph-shadow { filter: blur(2cqw); background: rgba(81,43,43,.22); opacity: 0; }

.skip-hint {
  position: absolute; left: 0; right: 0; bottom: 3cqh; z-index: 60;
  text-align: center; color: var(--ink); font-size: 2.8cqw; opacity: 0;
  transition: opacity .8s; pointer-events: none;
}
.skip-hint.on { opacity: .55; }
.noscript { font-family: system-ui, sans-serif; padding: 2rem; text-align: center; color: var(--ink); }
.noscript a { color: var(--orange-text); }

@media (prefers-reduced-motion: reduce) {
  .card, .reveal, .arrow-btn, .cta { transition-duration: .01s !important; }
  .card.floating, .card.wiggle, .q-card.enter, .q-card.is-top .statement { animation: none !important; }
}
