/* NAOS Pro exhibition quiz. Made for a tablet on a stand (landscape or portrait), and fine on phones and desktops.
   Two parts: the skin photo with the NAOS Pro logo as a band across the top, and a warm cream panel with the content
   below (in landscape, in two columns). No outlines or coloured borders: cards are white on cream with soft shadows. */

@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(fonts/montserrat-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(fonts/montserrat-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ink: #10252e;
  --ink-2: #3c4f57;
  --muted: #7a8a90;
  --teal: #00455e;          /* NAOS Pro */
  --teal-2: #003447;
  --cream: #fbf8f5;
  --sand: #f2ebe5;
  --sand-2: #e6dbd2;
  --white: #fff;
  --yellow: #ffcc00;        /* the NAOS flower */
  --right: #1b9466;
  --right-bg: #e3f3eb;
  --right-ink: #0d5539;
  --wrong: #d4493f;
  --wrong-bg: #fbe9e6;
  --wrong-ink: #85261f;

  --shadow-1: 0 1px 2px rgba(16, 37, 46, .05), 0 8px 22px rgba(16, 37, 46, .06);
  --shadow-2: 0 2px 6px rgba(16, 37, 46, .06), 0 20px 48px rgba(16, 37, 46, .11);
  --font: 'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --ease: cubic-bezier(.22, .8, .24, 1);
  --pad-x: clamp(22px, 6.4vmin, 92px);
  --pad-y: clamp(22px, 5.4vmin, 76px);
  --vpad: clamp(18px, 4.2vmin, 56px);

  /* type follows the screen: about 19 px on a 1180 × 820 tablet, 14 px on a phone, 22 px at most */
  font-size: clamp(14px, calc(1.1vmin + .35vw + 6px), 22px);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  font-kerning: normal;
  /* Montserrat would switch to Bulgarian letter shapes for lang="bg"; keep the familiar ones */
  font-feature-settings: "locl" 0;
  /* kiosk: no selecting, no callouts, no pull-to-refresh, no double-tap zoom */
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  touch-action: manipulation;
}
img { display: block; max-width: 100%; -webkit-user-drag: none; user-select: none; pointer-events: none; }
button { font: inherit; color: inherit; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
b, strong { font-weight: 700; }

/* ---------- the two parts: the photo band across the top, the content below ---------- */
.app {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-rows: var(--band) minmax(0, 1fr);
  background: var(--cream);
  --band: 29dvh;
  transition: grid-template-rows .9s var(--ease);
}
.app[data-screen="intro"] { --band: 37dvh; }
.app[data-screen="outro"] { --band: 30dvh; }

/* ---------- the skin photo ---------- */
.visual { position: relative; overflow: hidden; isolation: isolate; background: #c99f89; min-width: 0; min-height: 0; }
.visual .photo {
  position: absolute; inset: 0;
  width: 100%; height: 100%; max-width: none;
  object-fit: cover; object-position: 60% 46%;
  transform-origin: 60% 46%;
  animation: breathe 40s ease-in-out infinite alternate;
}
@keyframes breathe { from { transform: scale(1.03); } to { transform: scale(1.14); } }
/* shade at the top (logo), along the bottom (caption) and deepest in the lower left, under the big number */
.visual::after {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(44, 22, 12, .4) 0%, rgba(44, 22, 12, 0) 34%),
    linear-gradient(0deg, rgba(44, 22, 12, .5) 0%, rgba(44, 22, 12, .16) 40%, rgba(44, 22, 12, 0) 66%),
    radial-gradient(70% 120% at 0% 100%, rgba(44, 22, 12, .3) 0%, rgba(44, 22, 12, 0) 70%);
}
.visual .logo { position: absolute; z-index: 3; top: var(--vpad); left: var(--vpad); height: 2.5rem; width: auto; }

/* the NAOS flower turns slowly on the right of the start screen's photo */
.visual .flower {
  position: absolute; z-index: 2;
  width: min(36%, 44vmin); right: 3%; bottom: -30%;
  opacity: 0;
  transition: opacity .9s var(--ease);
  animation: turn 140s linear infinite;
}
.app[data-screen="intro"] .flower { opacity: .5; }
@keyframes turn { to { rotate: 360deg; } }

/* a question's product stands in the middle of the band */
.visual .product {
  position: absolute; z-index: 2;
  left: 50%; top: 55%;
  height: 80%; width: auto;
  translate: -50% -50%;
  filter: drop-shadow(0 1.6vmin 2.4vmin rgba(48, 22, 10, .42));
  opacity: 0; scale: .9;
  transition: opacity .6s var(--ease), scale .9s var(--ease);
}
.app.has-product .product { opacity: 1; scale: 1; }

/* the caption: the number (or the score) large in the lower left, the topic on the right, on one baseline */
.caption {
  position: absolute; z-index: 3; left: var(--vpad); right: var(--vpad); bottom: var(--vpad);
  display: flex; align-items: last baseline; justify-content: space-between; gap: 2rem;
  color: #fff;
}
.caption > * { animation: rise .8s var(--ease) both; }
/* the number follows the band's height */
.cap-num {
  display: flex; align-items: baseline; gap: .1em; margin: 0;
  font-size: clamp(3.4rem, calc(var(--band) * .42), 9rem); line-height: .8;
  text-shadow: 0 2px 28px rgba(40, 18, 8, .2);
}
.cap-num b { font-weight: 200; letter-spacing: -.05em; }
.cap-num span { font-size: max(1rem, .2em); font-weight: 500; letter-spacing: .02em; opacity: .78; }
.cap-topic {
  margin: 0; max-width: 17ch;
  font-size: 1.45rem; font-weight: 600; line-height: 1.22; letter-spacing: -.01em; text-align: right; text-wrap: balance;
  text-shadow: 0 1px 14px rgba(40, 18, 8, .35);
  animation-delay: .08s;
}
@keyframes rise { from { opacity: 0; transform: translateY(2.2vmin); } to { opacity: 1; transform: none; } }

/* ---------- the content panel and its screens ---------- */
.panel { position: relative; min-width: 0; min-height: 0; container-type: inline-size; }
.screen {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  padding: var(--pad-y) var(--pad-x);
  padding-bottom: max(var(--pad-y), env(safe-area-inset-bottom));
  overflow-x: hidden; overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  opacity: 0; visibility: hidden;
  transform: translate3d(0, 2.4vmin, 0);
  transition: opacity .35s var(--ease), transform .45s var(--ease), visibility 0s linear .45s;
}
.screen::-webkit-scrollbar { display: none; }
.screen.is-active {
  opacity: 1; visibility: visible; transform: none;
  transition: opacity .55s var(--ease) .12s, transform .7s var(--ease) .12s, visibility 0s;
}
/* centred when it fits, scrollable from the top when it does not (small phones) */
.inner { margin: auto 0; width: 100%; max-width: 40rem; }

.eyebrow {
  display: flex; align-items: center; gap: .65rem;
  margin: 0 0 1.4rem;
  font-size: .82rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
  color: var(--teal);
}
.eyebrow::before { content: ''; flex: none; width: 1.3rem; height: 1.3rem; background: url(img/flower.svg) center / contain no-repeat; }
.eyebrow.plain::before { display: none; }

.display { margin: 0 0 1.4rem; font-size: min(3.9rem, 8.6cqi); font-weight: 300; line-height: 1.04; letter-spacing: -.035em; color: var(--ink); text-wrap: balance; }
.display b { font-weight: 700; color: var(--teal); }
.lead { margin: 0 0 2.6rem; max-width: 30ch; font-size: 1.35rem; font-weight: 500; line-height: 1.5; color: var(--ink-2); text-wrap: pretty; }

/* buttons: teal pill, the arrow in its own circle */
.btn {
  position: relative;
  display: inline-flex; align-items: center; gap: 1.1rem;
  height: 4.2rem; padding: 0 .6rem 0 2rem;
  border: 0; border-radius: 999px;
  background: var(--teal); color: #fff;
  font-size: 1.12rem; font-weight: 700; letter-spacing: .01em; white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 .4rem 1rem rgba(0, 69, 94, .18), 0 1rem 2.4rem rgba(0, 69, 94, .2);
  transition: transform .2s var(--ease), background-color .2s, box-shadow .2s var(--ease);
}
.btn .ico { display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: 50%; background: rgba(255, 255, 255, .14); transition: transform .3s var(--ease); }
.btn .ico svg { width: 1.25rem; height: 1.25rem; }
.btn:active { transform: scale(.97); background: var(--teal-2); }
.btn-start { height: 4.9rem; padding-left: 2.5rem; font-size: 1.3rem; gap: 1.4rem; }
.btn-start .ico { width: 3.7rem; height: 3.7rem; }
.btn-start::after { content: ''; position: absolute; inset: 0; border-radius: inherit; animation: pulse 2.6s var(--ease) infinite; pointer-events: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(0, 69, 94, .32); } 75%, 100% { box-shadow: 0 0 0 1.4rem rgba(0, 69, 94, 0); } }
@media (hover: hover) {
  .btn:hover { background: var(--teal-2); }
  .btn:hover .ico { transform: translateX(.2rem); }
}
:focus-visible { outline: 3px solid var(--teal); outline-offset: 4px; }
:focus:not(:focus-visible) { outline: none; }

/* ---------- start ---------- */
.topics { margin: 3.4rem 0 0; padding: 0; list-style: none; display: grid; gap: .9rem; }
.topics-title { margin: 3.4rem 0 1rem; font-size: .82rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.topics-title + .topics { margin-top: 0; }
.topics li { display: flex; align-items: baseline; gap: 1rem; font-size: 1.08rem; font-weight: 600; color: var(--ink-2); }
.topics .n { flex: none; width: 1.8rem; font-size: .85rem; font-weight: 800; color: var(--teal); font-variant-numeric: tabular-nums; }

/* ---------- a question ---------- */
.q { margin: 0 0 2.2rem; font-size: min(2.3rem, 5.7cqi); font-weight: 500; line-height: 1.2; letter-spacing: -.022em; color: var(--ink); text-wrap: pretty; }
.answers { display: grid; gap: .9rem; margin: 0; padding: 0; list-style: none; }
.answer {
  display: flex; align-items: center; gap: 1.15rem;
  width: 100%; min-height: 5rem;
  padding: 1.05rem 1.6rem 1.05rem 1.05rem;
  border: 0; border-radius: 1.25rem;
  background: var(--white);
  font-size: 1.26rem; font-weight: 600; line-height: 1.3; text-align: left; color: var(--ink);
  cursor: pointer;
  box-shadow: var(--shadow-1);
  transition: transform .2s var(--ease), box-shadow .25s var(--ease), background-color .3s var(--ease), color .3s, opacity .4s var(--ease);
}
.answer .key {
  position: relative; flex: none;
  display: grid; place-items: center;
  width: 2.8rem; height: 2.8rem; border-radius: 50%;
  background: var(--sand); color: var(--ink);
  font-size: 1.05rem; font-weight: 800;
  transition: background-color .3s var(--ease), color .3s;
}
.answer .key svg { position: absolute; inset: 0; margin: auto; width: 1.7rem; height: 1.7rem; opacity: 0; scale: .4; transition: opacity .25s, scale .4s var(--ease); }
.answer:active { transform: scale(.985); background: #fdfbf9; }
@media (hover: hover) {
  .answer:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); }
  .answer:hover .key { background: var(--sand-2); }
}
.is-answered .answer { pointer-events: none; }
.answer.is-right { background: var(--right-bg); color: var(--right-ink); box-shadow: none; }
.answer.is-wrong { background: var(--wrong-bg); color: var(--wrong-ink); box-shadow: none; animation: shake .5s var(--ease); }
.answer.is-right .key { background: var(--right); color: transparent; }
.answer.is-wrong .key { background: var(--wrong); color: transparent; }
.answer.is-right .key svg, .answer.is-wrong .key svg { opacity: 1; scale: 1; color: #fff; }
.is-answered .answer:not(.is-right):not(.is-wrong) { opacity: .38; box-shadow: none; }
@keyframes shake {
  20% { transform: translateX(-1vmin); } 40% { transform: translateX(.8vmin); }
  60% { transform: translateX(-.5vmin); } 80% { transform: translateX(.25vmin); }
}

/* ---------- correct / wrong ---------- */
.verdict { display: flex; align-items: center; gap: 1.2rem; margin: 0 0 1.8rem; }
.verdict .badge {
  flex: none; display: grid; place-items: center;
  width: 4rem; height: 4rem; border-radius: 50%;
  color: #fff;
  animation: pop .7s var(--ease) both;
}
.verdict .badge svg { width: 62%; height: 62%; }
.verdict .badge use { stroke-dasharray: 60; stroke-dashoffset: 60; animation: draw .55s var(--ease) .28s forwards; }
.verdict.is-right .badge { background: var(--right); box-shadow: 0 .8rem 2rem rgba(27, 148, 102, .3); }
.verdict.is-wrong .badge { background: var(--wrong); box-shadow: 0 .8rem 2rem rgba(212, 73, 63, .28); }
.verdict h2 { margin: 0; font-size: min(2.9rem, 7cqi); font-weight: 600; line-height: 1.05; letter-spacing: -.03em; }
@keyframes pop { from { transform: scale(.3); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } to { transform: scale(1); } }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* the right answer: just type, no card and no labels. The answer is marked with a stroke of NAOS yellow that sweeps
   in like a highlighter (every line with the same small overhang), and the explanation reads as plain text below. */
.fb-lead { margin: 0 0 .5rem; font-size: 1.22rem; font-weight: 500; line-height: 1.4; color: var(--ink-2); }
.fb-lead b { font-weight: 800; color: var(--ink); }
.fb-answer { margin: 0; font-size: min(2.1rem, 5.6cqi); font-weight: 600; line-height: 1.24; letter-spacing: -.022em; color: var(--ink); text-wrap: pretty; }
.fb-answer mark {
  color: inherit;
  padding: 0 .12em; margin: 0 -.12em;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
  background: linear-gradient(180deg, transparent 58%, rgba(255, 204, 0, .45) 58%, rgba(255, 204, 0, .45) 94%, transparent 94%) 0 0 / 0 100% no-repeat;
  animation: highlight 1.1s cubic-bezier(.5, 0, .2, 1) .55s forwards;
}
@keyframes highlight { to { background-size: 100% 100%; } }
.explain { margin: 1.5rem 0 0; max-width: 46ch; font-size: 1.14rem; font-weight: 500; line-height: 1.62; color: var(--ink-2); text-wrap: pretty; }
/* where there is room, the text hangs from the verdict's title, with the ✓ / ✗ standing out on the left */
@container (min-width: 520px) { .fb-body, #feedback .foot { margin-left: 5.2rem; } }

.foot { display: flex; align-items: center; gap: 1.6rem; margin-top: 2.3rem; }
.timer { flex: 1; height: 3px; border-radius: 99px; background: var(--sand-2); overflow: hidden; }
.timer i { display: block; height: 100%; background: var(--teal); border-radius: inherit; transform-origin: left; animation: countdown var(--t, 6s) linear forwards; }
@keyframes countdown { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ---------- result ---------- */
.out-title { margin: 0 0 1rem; font-size: min(3.5rem, 8.6cqi); font-weight: 300; line-height: 1.04; letter-spacing: -.035em; }
.out-title b { font-weight: 700; color: var(--teal); }
.recap { display: grid; gap: .7rem; margin: 2.2rem 0 2.6rem; padding: 0; list-style: none; }
.recap li { display: flex; align-items: center; gap: 1rem; padding: .85rem 1.2rem .85rem .85rem; border-radius: 1.1rem; background: var(--white); box-shadow: var(--shadow-1); font-size: 1.05rem; font-weight: 600; color: var(--ink-2); }
.recap .dot { flex: none; display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 50%; color: #fff; }
.recap .dot svg { width: 1.35rem; height: 1.35rem; }
.recap .is-right .dot { background: var(--right); }
.recap .is-wrong .dot { background: var(--wrong); }
.recap .n { flex: none; font-size: .85rem; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 1rem 1.6rem; }
.actions .auto { font-size: .95rem; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }

.noscript { position: absolute; inset: 40% 2rem auto; font-size: 1.3rem; }

/* ---------- landscape: the content in two columns under the band, the heading on the left ---------- */
@media (orientation: landscape) and (min-width: 720px) {
  :root { --pad-y: clamp(20px, 4.6vmin, 64px); }
  .inner {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); column-gap: clamp(2.5rem, 6.5cqi, 7rem);
    align-items: start;
    max-width: 70rem; margin: auto;
  }
  /* each column sizes its own type */
  .col-a, .col-b { min-width: 0; container-type: inline-size; }
  #intro .inner { grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); align-items: center; }
  #question .inner { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
  #feedback .inner { grid-template-columns: minmax(0, .78fr) minmax(0, 1.5fr); }
  #outro .inner { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; }

  .display { font-size: min(3.7rem, 10.4cqi); }
  .lead { margin: 0; }
  /* the start screen: the title and lead on the left; on the right the three topics, then the button */
  #intro .col-b { display: flex; flex-direction: column; align-items: flex-start; }
  #intro .topics-title { margin-top: 0; }
  #intro .btn-start { order: 1; margin-top: 2.4rem; }
  .q { margin: 0; font-size: min(2.6rem, 8.3cqi); }
  .cap-num { font-size: clamp(3.4rem, calc(var(--band) * .46), 9rem); }
  .verdict { flex-direction: column; align-items: flex-start; gap: 1.3rem; margin: 0; }
  .verdict h2 { font-size: min(3rem, 13cqi); }
  #feedback .fb-body, #feedback .foot { margin-left: 0; }
  .fb-answer { font-size: min(2.1rem, 5.8cqi); }
  .explain { margin-top: 1.3rem; }
  .foot { margin-top: 2rem; }
  .out-title { font-size: min(3.5rem, 12cqi); }
  .recap { margin: 0 0 2.2rem; }
}

/* ---------- portrait ---------- */
@media (orientation: portrait) {
  /* portrait tablets get bigger type: the content panel is wide and tall */
  :root { font-size: clamp(14px, calc(1.9vmin + 4px), 23px); }
  .app { --band: 30dvh; }
  .app[data-screen="intro"] { --band: 34dvh; }
  .app[data-screen="outro"] { --band: 30dvh; }
  .lead { margin-bottom: 2.2rem; }
  .topics-title { margin-top: 2.6rem; }
  .visual .flower { width: min(44%, 36vmin); right: -4%; bottom: -18%; }
  .cap-topic { font-size: 1.4rem; max-width: 16ch; }
  .app.has-product .cap-topic { max-width: 12ch; }
  .inner { max-width: 44rem; margin-left: auto; margin-right: auto; }
}

/* squarer portrait tablets (iPad 3:4): a taller photo on the start screen, and the topic list left out to make room */
@media (orientation: portrait) and (min-aspect-ratio: 2/3) {
  .app[data-screen="intro"] { --band: 38dvh; }
  .app[data-screen="outro"] { --band: 26dvh; }
  #intro .topics-title, #intro .topics { display: none; }
}

/* phones */
@media (max-width: 640px) and (orientation: portrait) {
  .app { --band: 23dvh; }
  .app[data-screen="intro"] { --band: 33dvh; }
  .app[data-screen="outro"] { --band: 25dvh; }
  .visual .logo { height: 1.9rem; }
  .caption { gap: 1rem; }
  .cap-topic { font-size: 1.05rem; max-width: 13ch; }
  .app.has-product .cap-topic { max-width: 9ch; }
  .visual .product { height: 74%; }
  .lead { font-size: 1.18rem; margin-bottom: 2rem; }
  .q { margin-bottom: 1.5rem; }
  .answer { min-height: 4rem; font-size: 1.08rem; border-radius: 1rem; }
  .answer .key { width: 2.4rem; height: 2.4rem; }
  .verdict h2 { font-size: 2.2rem; }
  .verdict .badge { width: 3.2rem; height: 3.2rem; }
  .fb-lead { font-size: 1.08rem; }
  .fb-answer { font-size: 1.5rem; }
  .explain { margin-top: 1.2rem; font-size: 1.04rem; }
  .btn { height: 3.8rem; font-size: 1.02rem; }
  .btn .ico { width: 2.7rem; height: 2.7rem; }
  .btn-start { height: 4.3rem; }
  .btn-start .ico { width: 3.2rem; height: 3.2rem; }
  .foot { gap: 1rem; margin-top: 2rem; }
}

/* short landscape screens (phones on their side, small laptop windows) */
@media (orientation: landscape) and (max-height: 560px) {
  :root { font-size: 13px; }
  .app { --band: 28dvh; }
  .app[data-screen="intro"] { --band: 36dvh; }
  .app[data-screen="outro"] { --band: 32dvh; }
  .visual .logo { height: 2rem; }
  .cap-topic { font-size: 1.2rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .timer i { animation-duration: var(--t, 6s) !important; }
}
