/* The welcome card on the home page: an ID card in the Iris security print, front in the local language,
   back in English. Sizes follow the card's width (cqw), with pixel floors so small print stays readable. */
.ac { --hue: #FF48B0; --ink: #1d1b26; --soft: color-mix(in srgb, var(--hue) 14%, #fff); position: relative; width: 100%; aspect-ratio: 85.6 / 54;
  border-radius: 4.4cqw; overflow: hidden; color: var(--ink); word-break: keep-all; overflow-wrap: anywhere; font-family: var(--font); text-align: left; line-height: 1.15;
  box-shadow: 0 2.5cqw 6cqw -2.5cqw rgba(20,16,40,.45), inset 0 0 0 1px rgba(0,0,0,.06); }
.ac > * { position: absolute; }
.ac dl, .ac dd, .ac p { margin: 0; }
.ac-head, .ac-brand { display: none; }
.ac-photo img { width: 100%; display: block; }
.ac-welcome { display: block; font-weight: 800; letter-spacing: -.01em; }
.ac-welcome-en { display: block; margin-top: .6cqw; font-weight: 600; opacity: .7; font-size: max(2.6cqw, 11px); }
.ac-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 1.8cqw 3cqw; }
.ac-fields dt { font-size: max(1.9cqw, 8.5px); font-weight: 700; letter-spacing: .02em; opacity: .62; white-space: nowrap; }
.ac-fields dt i { font-style: normal; }
.ac-fields dd { margin-top: .3cqw; font-size: max(3.1cqw, 12px); font-weight: 700; }
.ac-head { justify-content: space-between; align-items: center; }
.ac-title-en { display: none; }
.ac-title { font-weight: 800; font-size: max(2.6cqw, 10px); letter-spacing: .04em; }
.ac-no { font-weight: 700; font-size: max(1.9cqw, 8.5px); letter-spacing: .14em; opacity: .85; }

/* The card as a 3D object: tilt, glare and holographic foil; tap to spin it over */
.idc { container-type: inline-size; width: 100%; perspective: 1500px; -webkit-tap-highlight-color: transparent; cursor: pointer; user-select: none; touch-action: pan-y; }
.idc-rot { position: relative; aspect-ratio: 85.6 / 54; transform-style: preserve-3d; will-change: transform;
  transform: rotateX(var(--rx, 0deg)) rotateY(calc(var(--ry, 0deg) + var(--flip, 0deg))); }
.idc { position: relative; }
.idc-shadow { position: absolute; left: 6%; right: 6%; top: 10%; bottom: -2%; border-radius: 5cqw; background: rgba(20, 16, 40, .42); filter: blur(4cqw); transform: translate(var(--sx, 0px), calc(var(--sy, 0px) + 3cqw)); pointer-events: none; }
.idc-face { position: absolute; inset: 0; border-radius: 4.4cqw; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; transform: translateZ(.6px); }
.idc-face.back { transform: rotateY(180deg) translateZ(.6px); }
/* A thin edge so it reads as a card, not a sticker */
.idc-edge { position: absolute; inset: 0; border-radius: 4.4cqw; background: #d9d4cb; transform: translateZ(-.6px); }
.idc-face > [data-face] { position: absolute; inset: 0; }
.idc .ac { width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; box-shadow: none; }
/* Glare: a light that follows the pointer */
.idc-glare { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: overlay; opacity: var(--o, .35);
  background: radial-gradient(farthest-corner circle at var(--gx, 50%) var(--gy, 30%), rgba(255,255,255,.85) 0%, rgba(255,255,255,.25) 28%, rgba(0,0,0,.28) 95%); }
/* Holographic foil: a rainbow band that only shows near the light, like a security overlay */
.idc-foil { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: color-dodge; opacity: calc(var(--o, .35) * .55);
  background: repeating-linear-gradient(115deg, rgba(255,72,176,.0) 0%, rgba(255,119,201,.55) 4%, rgba(120,190,255,.55) 8%, rgba(120,255,200,.5) 12%, rgba(255,230,120,.5) 16%, rgba(255,72,176,.0) 20%);
  background-size: 260% 260%; background-position: var(--fx, 50%) var(--fy, 50%);
  -webkit-mask-image: radial-gradient(circle at var(--gx, 50%) var(--gy, 30%), #000 0%, rgba(0,0,0,.6) 30%, transparent 62%); mask-image: radial-gradient(circle at var(--gx, 50%) var(--gy, 30%), #000 0%, rgba(0,0,0,.6) 30%, transparent 62%); }
@media (prefers-reduced-motion: reduce) { .idc-rot { transform: rotateY(var(--flip, 0deg)); } }

/* Iris: rainbow print, a rosette and wavy lines (patterns come from card.js), the app icon as a faint second photo */
.ac[class*="ac--sec-"] { color: #1f2430; }
.ac[class*="ac--sec-"] > * { z-index: 1; }
.ac[class*="ac--sec-"] .ac-head { display: flex; align-items: flex-end; }
.ac[class*="ac--sec-"] .ac-title { display: flex; flex-direction: column; gap: .3cqw; }
.ac[class*="ac--sec-"] .ac-title-en { display: block; font-style: normal; font-size: max(1.8cqw, 8px); font-weight: 700; letter-spacing: .16em; text-transform: uppercase; opacity: .6; }
.ac[class*="ac--sec-"] .ac-welcome { color: #1f2430; }
.ac[class*="ac--sec-"] .ac-photo { overflow: hidden; display: grid; place-items: end center; }
.ac[class*="ac--sec-"] .ac-photo img { width: 122%; margin-bottom: -6cqw; }
.ac[class*="ac--sec-"] .ac-fields { right: 5cqw; }
.ac--sec-iris { background: linear-gradient(90deg, #DDEFEA 0%, #F4EBD6 52%, #F1DDE4 100%); }
.ac--sec-iris::before { content: ""; position: absolute; right: -10cqw; top: -14cqw; width: 58cqw; height: 58cqw; background: var(--sec-rosette-blue) center / contain no-repeat; opacity: .28; }
.ac--sec-iris::after { content: ""; position: absolute; inset: 0; background: var(--sec-waves-blue) 0 0 / 34cqw auto; opacity: .16; }
.ac--sec-iris .ac-head { left: 4.5cqw; right: 4.5cqw; top: 3.4cqw; padding-bottom: 1.4cqw; border-bottom: 1px solid rgba(31,36,48,.25); }
.ac--sec-iris .ac-photo { left: 4.5cqw; top: 14cqw; width: 24cqw; height: 30cqw; border-radius: 1.2cqw; background: rgba(255,255,255,.7); box-shadow: inset 0 0 0 1px rgba(31,36,48,.18); }
.ac--sec-iris .ac-hello { left: 32cqw; right: 21cqw; top: 14cqw; }
.ac--sec-iris .ac-welcome { font-size: max(5cqw, 15px); }
.ac--sec-iris .ac-fields { left: 32cqw; bottom: 5cqw; }
.ac--sec-iris .ac-brand { display: block; right: 5.5cqw; top: 14.5cqw; width: 13cqw; height: 13cqw; font-size: 0; border-radius: 3cqw; background: url(../img/icon.png) center / cover no-repeat; opacity: .38; filter: saturate(.7); box-shadow: 0 0 0 1px rgba(31,36,48,.08); }

/* Phone-size cards: no pixel floors (they made text collide); English sub-labels go (the back is English) */
@container (max-width: 440px) {
  .ac .ac-fields dt { font-size: 2.4cqw; } .ac .ac-fields dt i { display: none; }
  .ac .ac-fields dd { font-size: 3.5cqw; white-space: nowrap; }
  .ac .ac-fields { gap: 1.6cqw 2.4cqw; }
  .ac .ac-welcome-en { font-size: 2.9cqw; }
  .ac .ac-title { font-size: 2.9cqw; } .ac .ac-no { font-size: 2.2cqw; }
  .ac[class*="ac--sec-"] .ac-welcome { font-size: 5.2cqw; }
  .ac[class*="ac--sec-"] .ac-title-en { font-size: 1.9cqw; }
}
