/* Artwork gallery — Figma "Desktop - 2" (node 4:104), without the site menu. */

@font-face {
  font-family: 'Source Sans 3';
  src: url('fonts/SourceSans3-VariableFont_wght.ttf') format('truetype');
  font-weight: 200 900;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('fonts/Inter-VariableFont.ttf') format('truetype');
  font-weight: 100 900;
  font-display: swap;
}

/* Roboto Medium, self-hosted (no request to Google). */
@font-face {
  font-family: 'Roboto';
  src: url('fonts/Roboto-Medium-latin-ext.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Roboto';
  src: url('fonts/Roboto-Medium-latin.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
  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 {
  --ag-bg: #ffffff;
  --ag-ink: #000000;
  /* Figma "Desktop - 4" (1440 × 1024): wire top at 66px, canvas bottom at 811px,
     144px of wall above the 69px name bar. */
  --ag-top: clamp(32px, 6.45vh, 66px);
  --ag-gap-bottom: clamp(24px, 14.06vh, 144px);
  /* Cards: white, no frame; sections are separated by a fine grey line (--ag-line). */
  --ag-card-bg: #ffffff;
  --ag-line: #e2e2e2;
}

html,
body {
  margin: 0;
  background: var(--ag-bg);
  color: var(--ag-ink);
}

.ag {
  position: relative;
  display: flex;
  flex-direction: column;
  height: max(620px, 100svh);
  /* clip (not hidden): a hidden box can still be scrolled sideways by focus/scrollIntoView. */
  overflow: hidden;
  overflow: clip;
  font-family: 'Source Sans 3', system-ui, sans-serif;
  color: var(--ag-ink);
  background: var(--ag-bg);
  -webkit-tap-highlight-color: transparent;
}

/* `hidden` must win over the display values below (e.g. the flex price form). */
[hidden] {
  display: none !important;
}

/* ---------- Logo (Figma 13:508: 80.67 × 31 at 32, 19) ---------- */

.ag-logo {
  position: absolute;
  top: 19px;
  left: 32px;
  z-index: 300;
  display: block;
  line-height: 0;
  transition: opacity 150ms ease;
}

.ag-logo:hover {
  opacity: 0.6;
}

.ag-logo:focus-visible {
  outline: 2px solid var(--ag-ink);
  outline-offset: 4px;
  border-radius: 4px;
}

.ag-logo img {
  display: block;
  max-width: none;
}

/* ---------- Language switch (CZ / EN), top right, level with the logo ---------- */

.ag-lang {
  position: absolute;
  top: 19px;
  right: 32px;
  z-index: 300;
  display: flex;
  align-items: center;
  gap: 2px;
  height: 31px;
  font-family: 'Source Sans 3', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1;
  color: var(--ag-ink);
}

.ag-lang__btn {
  padding: 6px 4px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: 0.04em;
  opacity: 0.45;
  cursor: pointer;
  transition: opacity 150ms ease;
}

.ag-lang__btn:hover,
.ag-lang__btn[aria-pressed='true'] {
  opacity: 1;
}

.ag-lang__btn[aria-pressed='true'] {
  font-weight: 700;
}

.ag-lang__btn:focus-visible {
  outline: 2px solid var(--ag-ink);
  outline-offset: 1px;
}

.ag-lang__sep {
  opacity: 0.3;
}

/* ---------- Wall ---------- */

.ag-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  padding: var(--ag-top) 0 var(--ag-gap-bottom);
  touch-action: pan-y;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.ag-stage.is-dragging {
  cursor: grabbing;
}

.ag-track {
  position: absolute;
  inset: 0;
}

.ag-slide {
  position: absolute;
  left: 50%;
  top: var(--ag-cy, 50%);
  will-change: transform, opacity;
  opacity: 0;
}

.ag-slide:not(.is-active) {
  cursor: pointer;
}

/* The big canvas opens the detail page. */
.ag-slide.is-active .ag-art {
  cursor: zoom-in;
}

/* Rotates around the nail (set from JS) — the pendulum swing. */
.ag-swing {
  position: relative;
  width: 100%;
  height: 100%;
  will-change: transform;
}

.ag-art {
  position: relative;
  width: 100%;
  height: 100%;
  background: #f2f2f2;
  /* Painting on a wall: soft contact shadow + longer cast shadow that follows the swing (--ag-sx). */
  box-shadow:
    calc(var(--ag-sx, 0) * 1px) 2px 4px rgba(0, 0, 0, 0.1),
    calc(var(--ag-sx, 0) * 3px + 4px) 18px 26px -10px rgba(0, 0, 0, 0.28),
    calc(var(--ag-sx, 0) * 6px + 10px) 40px 60px -24px rgba(0, 0, 0, 0.22);
}

.ag-art img.ag-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 500ms ease;
  -webkit-user-drag: none;
  user-select: none;
}

.ag-art img.ag-img.is-loaded {
  opacity: 1;
}

/* Canvas edge highlight / shade from the design (2px). --ag-inv = 1 / slide scale (set in JS),
   so the edge stays 2px on screen while a canvas grows or shrinks. */
.ag-art::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow:
    inset calc(-2px * var(--ag-inv, 1)) calc(-2px * var(--ag-inv, 1)) calc(2px * var(--ag-inv, 1)) 0 rgba(0, 0, 0, 0.25),
    inset calc(2px * var(--ag-inv, 1)) calc(2px * var(--ag-inv, 1)) 0 0 rgba(255, 255, 255, 0.25);
}

/* Wire + pin (Figma Group 8, 212 × 27.2) — the same one on every canvas, scaled with it.
   Half as strong as in Figma so the hanging stays subtle. */
.ag-hanger {
  position: absolute;
  left: 50%;
  bottom: calc(100% - 1px);
  display: block;
  max-width: none;
  pointer-events: none;
  transform: translateX(-50%) scale(var(--ag-hanger-scale, 1));
  transform-origin: 50% 100%;
  opacity: 0.45;
}

/* ---------- Timeline (right edge) ---------- */

.ag-timeline {
  position: absolute;
  top: var(--ag-top);
  bottom: var(--ag-gap-bottom);
  right: 0;
  z-index: 150;
  width: 132px;
  cursor: pointer;
  touch-action: none;
  /* Soft white veil so the ticks stay readable over the faded neighbour canvas. */
  background: linear-gradient(to left, rgba(255, 255, 255, 0.92) 45%, rgba(255, 255, 255, 0));
  -webkit-user-select: none;
  user-select: none;
}

.ag:not(.is-ready) .ag-timeline {
  visibility: hidden;
}

.ag-tl-axis {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 22px;
  width: 1px;
  background: #e4e4e4;
}

/* A tick = invisible hit area + a line growing to the left of the axis (width set from JS). */
.ag-tl-tick {
  position: absolute;
  right: 22px;
  width: 80px;
  height: 10px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  transform: translateY(-50%);
  outline: none;
}

.ag-tl-tick span {
  position: absolute;
  right: 0;
  top: 50%;
  width: 6px;
  height: 1px;
  background: #000;
  opacity: 0.3;
  transform: translateY(-50%);
  transform-origin: right center;
}

.ag-tl-tick.is-active span {
  opacity: 1;
}

.ag-tl-tick:focus-visible span {
  outline: 2px solid #000;
  outline-offset: 3px;
}

.ag-tl-year {
  position: absolute;
  right: 58px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  color: #000;
  opacity: 0.35;
  white-space: nowrap;
  pointer-events: none;
  transform: translateY(-50%);
  transform-origin: right center;
}

.ag-tl-year.is-active {
  opacity: 1;
}

/* Artwork name next to the magnified tick while hovering. */
.ag-tl-name {
  position: absolute;
  right: 58px;
  max-width: 170px;
  padding: 3px 7px;
  border-radius: 6px;
  background: #090909;
  color: #fff;
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-50%);
  transition: opacity 150ms ease;
}

.ag-tl-name.is-visible {
  opacity: 1;
}

.ag-message {
  position: absolute;
  left: 50%;
  top: var(--ag-cy, 50%);
  margin: 0;
  transform: translate(-50%, -50%);
  font-size: 17px;
  opacity: 0.6;
}

/* ---------- Bottom bar (Figma "Desktop - 4" / Frame 7): name + year, links to the detail ---------- */

.ag-bar {
  /* Always on the bottom edge of the screen, also when the wall is taller than the window
     (low screens, phones) and in an embed. */
  position: sticky;
  bottom: 0;
  z-index: 200;
  flex: none;
  margin-top: auto; /* pushed to the bottom when the wall is shorter than the screen (phones) */
  background: var(--ag-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 16px;
  border-top: 1px solid #d9d9d9;
  color: inherit;
  text-align: center;
  text-decoration: none;
  line-height: normal;
}

.ag:not(.is-ready) .ag-bar {
  visibility: hidden;
}

.ag-bar:focus-visible {
  outline: 2px solid #090909;
  outline-offset: -4px;
}

.ag-title,
.ag-year {
  /* Fixed lines: the bar is 69px even before the first caption fills in, so the wall
     is measured at its final height (Figma: 10 + 24 + 24 + 10 + 1px border). */
  min-height: 24px;
  line-height: 24px;
}

.ag-title {
  max-width: 100%;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 20px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ag-year {
  font-size: 17px;
}

/* Cards (used by the detail page). */
.ag-card {
  display: flex;
  flex: 1 1 0;
  align-items: center;
  min-width: 0;
  min-height: 131px;
  padding: 20px;
  box-sizing: border-box;
  border-radius: 12px;
  background: var(--ag-card-bg);
}

.ag-card--action {
  justify-content: center;
}

.ag-text {
  margin: 0;
  font-size: 17px;
  font-weight: 400;
  line-height: normal;
  white-space: nowrap;
}

.ag-text:empty {
  display: none;
}

.ag-meta {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.ag-action {
  width: min(513px, 100%);
}

/* Caption swap: out quickly, in with a small stagger. */
.ag-bar > * {
  transition:
    opacity 380ms ease,
    transform 520ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.ag-bar > :nth-child(2) { transition-delay: 40ms; }

.ag-bar.is-out > * {
  opacity: 0;
  transform: translateY(-6px);
  transition-duration: 160ms;
  transition-delay: 0ms;
}

.ag-bar.is-pre > * {
  opacity: 0;
  transform: translateY(10px);
  transition: none;
}

/* "Zajímá vás cena?" + one line of explanation above the e-mail field. */
.ag-price-head {
  flex: 1 1 100%;
  margin-bottom: 4px;
}

.ag-price-title {
  margin: 0 0 2px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 20px;
  font-weight: 700;
  line-height: normal;
}

.ag-price-sub {
  margin: 0;
  font-size: 15px;
  line-height: 1.4;
  opacity: 0.6;
}

/* ---------- Price form (Figma "Newsletter": Text field M + Button S + opt-in) ---------- */

.ag-price {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: 100%;
}

/* Figma: field 240.5px, button 264.5px out of 513. */
.ag-price .ag-field {
  flex: 240.5 1 0;
}

.ag-price .ag-button {
  flex: 264.5 1 0;
}

/* Newsletter opt-in (never pre-ticked) + privacy link — Figma "Souhlas s odběrem novinek". */
.ag-consent {
  display: flex;
  flex-basis: 100%;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 14px;
  margin-top: 7px; /* 8px gap + 7 = Figma's 15px */
  font-size: 12px;
  line-height: 18px;
  color: #59616e;
}

.ag-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

/* Checkbox from Figma: 16px, 1px #a6adb8 border, 3px radius; black when ticked. */
.ag-check input {
  appearance: none;
  -webkit-appearance: none;
  display: grid;
  place-items: center;
  flex: none;
  width: 16px;
  height: 16px;
  margin: 0;
  border: 1px solid #a6adb8;
  border-radius: 3px;
  background: #ffffff;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease;
}

.ag-check input::after {
  content: '';
  width: 8px;
  height: 4px;
  margin-top: -2px;
  border: solid #ffffff;
  border-width: 0 0 1.6px 1.6px;
  transform: rotate(-45deg);
  opacity: 0;
}

.ag-check input:checked {
  border-color: #090909;
  background: #090909;
}

.ag-check input:checked::after {
  opacity: 1;
}

.ag-check input:focus-visible {
  outline: 2px solid #090909;
  outline-offset: 2px;
}

.ag-privacy,
.ag-dialog__fine a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  opacity: 0.8;
}

.ag-privacy:hover,
.ag-dialog__fine a:hover {
  opacity: 1;
}

.ag-field {
  display: flex;
  flex: 1 1 0;
  align-items: center;
  gap: 8px;
  min-width: 160px;
  height: 40px;
  padding: 0 12px;
  box-sizing: border-box;
  border: 1px solid #c1c7cd;
  border-radius: 12px;
  background: #ffffff;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.ag-field:focus-within {
  border-color: #4d5358;
}

.ag-field.is-invalid {
  border-color: #da1e28;
  box-shadow: 0 0 0 1px #da1e28;
}

.ag-field__icon {
  flex: none;
  display: block;
}

.ag-field input {
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 15px;
  color: var(--ag-ink);
  outline: none;
  text-overflow: ellipsis;
}

.ag-field input::placeholder {
  color: #94999f;
  font-size: 12px;
  opacity: 1;
}

.ag-dialog .ag-field input::placeholder {
  font-size: 15px;
  color: rgba(0, 0, 0, 0.26);
}

.ag-button {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  margin: 0;
  padding: 10px 12px;
  box-sizing: border-box;
  border: 0;
  border-radius: 12px;
  background: #090909;
  color: #ffffff;
  font-family: 'Roboto', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.5px;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 150ms ease, transform 120ms ease;
}

.ag-button:hover {
  background: #2b2b2b;
}

.ag-button:active {
  transform: translateY(1px);
}

.ag-button:focus-visible {
  outline: 2px solid #090909;
  outline-offset: 2px;
}

.ag-button[disabled] {
  cursor: progress;
  opacity: 0.7;
}

.ag-status {
  margin: 0;
  font-size: 17px;
  line-height: 40px;
  text-align: center;
}

/* Revealed price + "Mám zájem" */
.ag-price-result {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
  text-align: center;
}

/* Revealed price: big, with "vč. DPH" beside it; the button sits full-width below. */
.ag-price-amount {
  margin: 0;
  font-size: 17px;
  line-height: normal;
  white-space: nowrap;
}

.ag-price-amount strong {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.ag-price-result .ag-button {
  width: 100%;
}

.ag-price-note {
  opacity: 0.55;
}

.ag-interest-sent {
  margin: 0;
  font-size: 15px;
  opacity: 0.6;
  white-space: nowrap;
}

/* Honeypot — off-screen, not focusable, not announced. */
.ag-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* ---------- "Mám zájem" dialog (Text field M / Button S from Figma) ---------- */

.ag-dialog {
  width: min(420px, calc(100vw - 32px));
  max-height: calc(100svh - 32px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: #ffffff;
  color: var(--ag-ink);
  font-family: 'Source Sans 3', system-ui, sans-serif;
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.08);
}

.ag-dialog::backdrop {
  background: rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(3px);
}

.ag-dialog[open] {
  animation: ag-dialog-in 260ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

@keyframes ag-dialog-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
}

.ag-dialog__body {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 28px 24px 22px;
}

.ag-dialog__close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: none;
  color: #4d5358;
  cursor: pointer;
}

.ag-dialog__close:hover {
  background: #f2f4f8;
}

/* "Díky!" state: centred, animated check, confetti (leads.js). */
.ag-dialog__done {
  align-items: center;
  padding-top: 36px;
  text-align: center;
}

.ag-dialog__done .ag-done-text {
  max-width: 30ch;
  margin-top: 6px;
  color: #4d5358;
}

.ag-done-icon {
  margin-bottom: 14px;
  color: #090909;
  line-height: 0;
  animation: ag-done-pop 520ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.ag-done-icon__ring {
  stroke-dasharray: 183;
  stroke-dashoffset: 183;
  animation: ag-done-draw 520ms ease-out 80ms forwards;
}

.ag-done-icon__check {
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  animation: ag-done-draw 360ms ease-out 480ms forwards;
}

@keyframes ag-done-pop {
  from {
    transform: scale(0.6);
    opacity: 0;
  }
}

@keyframes ag-done-draw {
  to {
    stroke-dashoffset: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ag-done-icon,
  .ag-done-icon__ring,
  .ag-done-icon__check {
    animation: none;
    stroke-dashoffset: 0;
  }
}

.ag-confetti {
  position: fixed;
  inset: 0;
  z-index: 10;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
}

.ag-dialog__title {
  margin: 0;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 20px;
  font-weight: 700;
  line-height: normal;
}

.ag-dialog__art {
  margin: 4px 0 20px;
  font-size: 17px;
  line-height: normal;
}

.ag-dialog__art strong {
  font-weight: 700;
}

.ag-dialog__label {
  margin: 0 0 6px;
  font-size: 15px;
  line-height: normal;
}

.ag-dialog__label span {
  opacity: 0.5;
}

.ag-dialog .ag-field {
  flex: none;
  margin-bottom: 14px;
}

.ag-textarea {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-height: 84px;
  margin: 0 0 18px;
  padding: 10px 12px;
  border: 1px solid #c1c7cd;
  border-radius: 12px;
  background: #ffffff;
  font: inherit;
  font-size: 15px;
  line-height: 1.35;
  color: var(--ag-ink);
  resize: vertical;
  outline: none;
  transition: border-color 150ms ease;
}

.ag-textarea::placeholder {
  color: rgba(0, 0, 0, 0.26);
}

.ag-textarea:focus {
  border-color: #4d5358;
}

.ag-button--wide {
  width: 100%;
}

.ag-dialog__check {
  margin: 0 0 18px;
  font-size: 15px;
}

.ag-dialog__error {
  margin: -6px 0 12px;
  font-size: 14px;
  color: #da1e28;
}

.ag-dialog__fine {
  margin: 12px 0 0;
  font-size: 13px;
  text-align: center;
  color: rgba(0, 0, 0, 0.5);
}

.ag-dialog__fine a {
  opacity: 1;
}

.ag-dialog__done .ag-dialog__art {
  margin-bottom: 22px;
}

.ag-hint {
  display: block;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  opacity: 0.6;
}

.ag-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Narrower screens ---------- */

@media (max-width: 760px) {
  .ag {
    height: auto;
    min-height: 100svh;
  }

  .ag-lang {
    right: 12px;
  }

  .ag-timeline {
    display: none;
  }

  .ag-stage {
    flex: none;
    height: min(128vw, 70svh);
    padding: 56px 0 28px;
  }

  .ag-bar {
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }

  .ag-card {
    flex: none; /* a 0 basis in a column would collapse the card's height */
    min-height: 0;
    padding: 16px;
  }

  /* Bottom sheet on phones. */
  .ag-dialog {
    width: 100%;
    max-width: none;
    margin: auto 0 0;
    border-radius: 16px 16px 0 0;
  }

  .ag-dialog__body {
    padding-bottom: max(22px, env(safe-area-inset-bottom));
  }
}
