/* Try page: pick a sample design, watch it fly into the upload field, get read, open in 3D.
   Builds on app.css (colours, header, buttons). Logical properties only (RTL needs no overrides). */
[hidden] { display: none !important; }

.try-top {
  padding-block: clamp(1.75rem, 5vw, 3.5rem) clamp(1.75rem, 5vw, 3rem);
  border-block-end: 1px solid var(--line);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
}
.try-top h1 { max-inline-size: 22ch; }
/* the intro and the field beside the designs on a wide screen, the designs right under them on a phone (owner 2026-10-29:
   on a small screen the designs were below the fold) */
.try-grid { display: grid; gap: clamp(1.75rem, 4vw, 2.5rem); align-items: start; }
@media (min-width: 60em) {
  .try-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .try-intro .slot { --slot-w: clamp(7rem, 34%, 12rem); }
}
.try-top .gallery { padding-block: 0; }
.try-top .cards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 13.5rem), 1fr)); gap: 0.9rem; margin-block-start: 1rem; }
.try-top .card-body { padding: 0.6rem 0.85rem 0.7rem; }
/* a phone: the field without its empty picture until a design flies in, and the designs two by two, so they start on the
   first screen */
@media (max-width: 40em) {
  .try-intro .slot[data-state="idle"] { grid-template-columns: minmax(0, 1fr); }
  .try-intro .slot[data-state="idle"] .slot-frame { display: none; }
  .try-top .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
  .try-top .card-body { padding: 0.45rem 0.6rem 0.55rem; }
  .try-top .card-title { font-size: 0.92rem; }
  .try-top .card-meta { display: none; }
  .try-top .card-go { margin-block-start: 0.15rem; font-size: 0.9rem; }
  .try-top .gallery-lead { display: none; }
}
/* "I have my own plan": a quiet link, so the designs keep the eye */
.slot-own { color: var(--accent); font-weight: 650; text-decoration: underline; text-underline-offset: 0.2em; }
.slot-own::after { content: " →"; }
[dir="rtl"] .slot-own::after { content: " ←"; }

/* ---------- The upload field (receives the chosen design) ---------- */

.slot {
  --slot-w: clamp(7.5rem, 34vw, 16rem);
  display: grid;
  grid-template-columns: var(--slot-w) minmax(0, 1fr);
  gap: clamp(0.9rem, 3vw, 1.75rem);
  align-items: center;
  max-inline-size: 44rem;
  margin-block-start: clamp(1.5rem, 4vw, 2.25rem);
  padding: clamp(0.75rem, 2.5vw, 1.25rem);
  border: 2px dashed var(--control);
  border-radius: var(--radius);
  background: var(--raised);
}
.slot:focus { outline: none; }
.slot[data-state="busy"] { border-style: solid; border-color: var(--ink); }
.slot-frame {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1.5px dashed var(--control);
  border-radius: var(--radius);
  background: var(--sheet);
  color: var(--control);
}
.slot[data-state="busy"] .slot-frame { border-style: solid; border-color: var(--line); }
.slot-icon { inline-size: 38%; block-size: auto; }
.slot[data-state="busy"] .slot-icon { opacity: 0; }
.slot-img { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; object-fit: contain; background: #ffffff; }
.slot-scan {
  position: absolute; inset-inline: 0; inset-block-start: -35%; block-size: 35%; display: none;
  background: linear-gradient(transparent, rgb(198 40 40 / 0.3), transparent);
}
.slot[data-reading] .slot-scan { display: block; animation: slot-scan 1.6s ease-in-out infinite; }
@keyframes slot-scan { to { inset-block-start: 100%; } }

.slot-idle, .slot-busy { display: grid; gap: 0.5rem; justify-items: start; min-inline-size: 0; }
.slot[data-state="busy"] .slot-idle, .slot[data-state="idle"] .slot-busy { display: none; }
.slot-title { font-size: clamp(1.1rem, 1rem + 0.6vw, 1.4rem); font-weight: 750; line-height: 1.2; }
.slot-hint { color: var(--muted); }
.slot-status { font-weight: 650; }

.bar {
  inline-size: 100%; block-size: 0.7rem; overflow: hidden;
  border: 1.5px solid var(--control); border-radius: 999px; background: var(--sheet);
}
.bar-fill { display: block; inline-size: 0; block-size: 100%; background: var(--accent); transition: inline-size 0.5s ease; }
.chips { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0; padding: 0; list-style: none; }
.chips li {
  padding: 0.1rem 0.7rem; border: 1px solid var(--line); border-radius: 999px;
  color: var(--muted); font-size: 0.82rem; line-height: 1.5;
}
.chips li[data-state="done"] { color: var(--ink); background: var(--paper-alt); }
.chips li[data-state="now"] { color: var(--ink); border-color: var(--accent); font-weight: 650; }

/* the card's picture while it flies to the field */
.fly {
  position: fixed; inset: 0 auto auto 0; z-index: 40; margin: 0; pointer-events: none; transform-origin: 0 0;
  overflow: hidden; border: 1.5px solid var(--line); border-radius: var(--radius); background: #ffffff;
  box-shadow: 0 16px 34px rgb(0 0 0 / 0.3);
}
.fly img { display: block; inline-size: 100%; block-size: 100%; object-fit: contain; }

/* ---------- Gallery ---------- */

.gallery, .own { padding-block: clamp(2rem, 6vw, 3.5rem); }
.gallery:focus { outline: none; }
.gallery h2, .own h2 { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.2rem); font-weight: 750; letter-spacing: -0.015em; }
:lang(ar) .gallery h2, :lang(ar) .own h2 { letter-spacing: 0; }
.gallery-lead { margin-block-start: 0.5rem; color: var(--muted); }
.gallery-msg { margin-block-start: 1rem; color: var(--muted); }
.gallery-msg:empty { display: none; }

.cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); gap: 1.1rem;
  margin: 1.5rem 0 0; padding: 0; list-style: none;
}
.card {
  display: grid; inline-size: 100%; margin: 0; padding: 0; overflow: hidden; text-align: start; cursor: pointer;
  border: 1.5px solid var(--control); border-radius: var(--radius); background: var(--raised); color: inherit; font: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card { box-shadow: 0 1px 2px rgb(29 31 35 / 0.06), 0 6px 18px -12px rgb(29 31 35 / 0.25); }
.card:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 12px 24px -14px rgb(29 31 35 / 0.35); }
.card-thumb {
  display: block; position: relative; aspect-ratio: 4 / 3; overflow: hidden;
  border-block-end: 1.5px solid var(--line); background: #ffffff;
}
.card-thumb img { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; object-fit: contain; }
.card-body { display: grid; gap: 0.15rem; padding: 0.8rem 1rem 0.9rem; }
.card-title { font-weight: 700; font-size: 1.05rem; line-height: 1.3; overflow-wrap: anywhere; }
.card-meta { color: var(--muted); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.card-go { margin-block-start: 0.35rem; color: var(--accent); font-weight: 650; }
.card-go::after { content: " →"; }
[dir="rtl"] .card-go::after { content: " ←"; }
.card.is-picked .card-thumb img { opacity: 0; }
.gallery[inert] .card:not(.is-picked) { opacity: 0.5; }
.gallery[inert] .card { cursor: progress; }
.gallery[inert] .card:hover { transform: none; border-color: var(--control); box-shadow: none; }

/* ---------- Your own plan ---------- */

.own { border-block-start: 1px solid var(--line); background: var(--paper-alt); }
.own-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; }
.own-lead { margin-block-start: 0.4rem; color: var(--muted); max-inline-size: 36rem; }

@media (prefers-reduced-motion: reduce) {
  .slot[data-reading] .slot-scan { animation: none; inset-block-start: 35%; }
  .bar-fill, .card { transition: none; }
  .card:hover { transform: none; }
}
