/* Justido Digital Business Card — "stephan-blob" variant. Forked from
   card.css: same Ember tokens + masthead/person/divisions/CTA/tiles/QR layout,
   but the card surface is translucent "smoked glass" over a fixed, full-
   viewport WebGL blob canvas (#blob-bg, stephan-blob.js). The full-card
   copper glaze sweep is dropped — the blob is the light source now — and
   pointer tilt is dialed way down; the blob's churn carries the motion.
   PLN-103: blob is high-center (core behind the name) → scrim is now
   top-light/bottom-heavy; adds the living layer (tap ripples · embers ·
   save shockwave/sparks) + press-squish + gyro holo-foil hook. */

/* ── Tokens ─────────────────────────────────────────────────── */
:root {
  --color-bg:           #17120F;
  --color-bg-alt:       #201913;
  --color-bg-alt-2:     #1B140F;
  --color-text:         #F3E8D8;
  --color-text-warm:    #E8DCC8;
  --color-text-muted:   #9A8770;
  --color-accent:       #C85B40;
  --color-accent-hover: #E8855F;
  --color-accent-press-1: #B14E36;
  --color-accent-press-2: #A3462F;
  --color-border:       #392C22;
  --font-display: 'Bricolage Grotesque', system-ui, sans-serif;
  --font-body:    'Hanken Grotesk', system-ui, sans-serif;
  --ease-premium: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── Reset ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--color-bg); }

/* ── Keyframes ───────────────────────────────────────────────── */
@keyframes wmWipe {
  from { clip-path: inset(0 100% 0 0); transform: scale(.98); }
  to   { clip-path: inset(0 0 0 0);    transform: scale(1);   }
}
@keyframes ruleGrow {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}
@keyframes nameIn {
  from { filter: blur(8px); transform: scale(1.04); opacity: 0; }
  to   { filter: blur(0);   transform: scale(1);    opacity: 1; }
}
@keyframes nameInWithShadow {
  from { filter: blur(8px) drop-shadow(0 6px 14px rgba(0,0,0,0)); transform: scale(1.04); opacity: 0; }
  to   { filter: blur(0)   drop-shadow(0 6px 14px rgba(0,0,0,.5)); transform: scale(1);    opacity: 1; }
}
@keyframes blockIn {
  from { filter: blur(6px); transform: scale(.97); opacity: 0; }
  to   { filter: blur(0);   transform: scale(1);   opacity: 1; }
}
@keyframes riseIn {
  from { transform: translateY(12px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
@keyframes pulse {
  0%   { transform: scale(1);     }
  45%  { transform: scale(1.012); }
  100% { transform: scale(1);     }
}
@keyframes drawCheck {
  to { stroke-dashoffset: 0; }
}
@keyframes foilShimmer {
  0%   { background-position: 130% 0; }
  100% { background-position: -30% 0; }
}
@keyframes dotIgnite {
  0%   { opacity: 0; transform: scale(.4);   text-shadow: 0 0 0 rgba(232,133,95,0); }
  45%  { opacity: 1; transform: scale(1.4);  text-shadow: 0 0 16px rgba(232,133,95,.9); color: #FBC9A3; }
  100% { opacity: 1; transform: scale(1);    text-shadow: 0 0 6px rgba(232,133,95,.35); }
}

/* ── Reduced motion ──────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  [data-anim] { animation: none !important; }
  .wordmark .dot { animation: none !important; }
  /* The blob itself is skipped under reduced-motion (see stephan-blob.js),
     replaced by the static .blob-bg--static gradient below. The living
     layer (ripples/embers/shockwave/sparks) is JS-gated too — this is the
     belt-and-suspenders. */
  .tap-ripple, .shockwave, .burst-spark, .embers { display: none !important; }
  /* the surname's ambient foil shimmer is continuous motion too */
  .person-name .last { animation: none !important; }
}

/* ── Living layer (PLN-103): tap ripples · embers · save celebration ── */
.tap-ripple {
  position: fixed;
  z-index: 150;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  border: 1.5px solid rgba(232,133,95,.85);
  pointer-events: none;
  animation: ringOut .6s ease-out forwards;
}
@keyframes ringOut {
  from { transform: scale(.5); opacity: .9; }
  to   { transform: scale(6.5); opacity: 0; }
}
.shockwave {
  position: fixed;
  z-index: 149;
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  border-radius: 50%;
  border: 2px solid rgba(232,133,95,.8);
  box-shadow: 0 0 24px rgba(200,91,64,.5);
  pointer-events: none;
  animation: shockOut .8s cubic-bezier(.22,1,.36,1) forwards;
}
@keyframes shockOut {
  from { transform: scale(1); opacity: 1; }
  to   { transform: scale(60); opacity: 0; }
}
.burst-spark {
  position: fixed;
  z-index: 151;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: #FBC9A3;
  box-shadow: 0 0 12px 2px rgba(232,133,95,.9);
  pointer-events: none;
  animation: sparkFly var(--sd, .7s) cubic-bezier(.17,.67,.35,1) forwards;
}
@keyframes sparkFly {
  from { transform: translate(0, 0) scale(1); opacity: 1; }
  to   { transform: translate(var(--dx), var(--dy)) scale(.25); opacity: 0; }
}
.embers {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}
.ember {
  position: absolute;
  bottom: -12px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #FBC9A3, #C85B40 70%);
  box-shadow: 0 0 6px rgba(232,133,95,.75);
  opacity: 0;
  animation: emberRise var(--dur, 10s) linear var(--delay, 0s) infinite;
}
@keyframes emberRise {
  0%   { transform: translate(0, 0); opacity: 0; }
  8%   { opacity: .85; }
  55%  { opacity: .55; }
  100% { transform: translate(var(--ex, 0px), -108vh); opacity: 0; }
}

/* Holo-foil: once gyro drives the surname's highlight, the ambient shimmer
   loop steps aside (JS adds .foil-manual + sets background-position). */
.person-name .last.foil-manual { animation: none; }

/* ── Motion cue (iOS tap-to-activate hint; auto-dismisses) ───── */
.motion-cue {
  position: fixed;
  left: 50%;
  bottom: max(22px, env(safe-area-inset-bottom));
  transform: translate(-50%, 8px);
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(32, 25, 19, 0.92);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease-premium), transform 0.4s var(--ease-premium);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.motion-cue.show { opacity: 1; transform: translate(-50%, 0); }
.mc-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-accent);
  animation: mcPulse 1.6s var(--ease-premium) infinite;
}
@keyframes mcPulse {
  0%   { box-shadow: 0 0 0 0 rgba(200, 91, 64, 0.5); }
  70%  { box-shadow: 0 0 0 7px rgba(200, 91, 64, 0); }
  100% { box-shadow: 0 0 0 0 rgba(200, 91, 64, 0); }
}

/* ── Blob canvas (fixed, full-viewport, BEHIND the card) ──────── */
#blob-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}
/* Fallback for prefers-reduced-motion or a failed WebGL context — a static
   molten-copper hint instead of a blank void, applied by stephan-blob.js. */
#blob-bg.blob-bg--static {
  background:
    radial-gradient(55% 42% at 50% 50%, rgba(200,91,64,0.32), rgba(200,91,64,0) 70%),
    radial-gradient(34% 26% at 56% 44%, rgba(232,133,95,0.22), rgba(232,133,95,0) 72%);
}

/* ── Stage ───────────────────────────────────────────────────── */
.stage {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  padding:
    max(22px, env(safe-area-inset-top))
    max(18px, env(safe-area-inset-right))
    max(22px, env(safe-area-inset-bottom))
    max(18px, env(safe-area-inset-left));
}

/* ── Scene wrapper (pulse target) ────────────────────────────── */
.scene {
  width: 100%;
  max-width: 390px;
}

/* ── Card (translucent "smoked glass" over the blob) ──────────── */
.card {
  position: relative;
  border: 1px solid var(--color-border);
  border-radius: 22px;
  padding: 28px 26px 26px;
  background: rgba(23, 18, 15, 0.32);
  -webkit-backdrop-filter: blur(7px) saturate(1.12);
  backdrop-filter: blur(7px) saturate(1.12);
  box-shadow: 0 34px 64px -24px rgba(0,0,0,.78), 0 1px 0 rgba(243,232,216,.03) inset;
  transform-style: preserve-3d;
}

/* Legibility scrim — sits above the glass, below the text/links. PLN-103:
   the blob core now burns high-center behind the big display name (which can
   take it — size + drop-shadow), so the scrim is LIGHT at the top and grows
   heavier toward the bottom where the small text/tiles live. z-index:0 vs.
   the content blocks' z-index:1 below keeps this under them regardless of
   their own translateZ() tilt-parallax. */
.card-scrim {
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(23,18,15,.26) 0%,
    rgba(23,18,15,.42) 40%,
    rgba(23,18,15,.56) 72%,
    rgba(23,18,15,.70) 100%
  );
}

/* ── Masthead ────────────────────────────────────────────────── */
.masthead {
  position: relative;
  z-index: 1;
  transform: translateZ(32px);
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 31px;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--color-text-muted);
  text-shadow: 0 3px 8px rgba(0,0,0,.45);
}
.wordmark .dot {
  color: var(--color-accent);
  display: inline-block;
  animation: dotIgnite 1.1s var(--ease-premium) .55s both;
}

.micro-tag {
  margin-top: 7px;
  font-size: 0.62rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--color-text-muted);
}

.hairline {
  height: 1px;
  margin-top: 18px;
  background: var(--color-border);
  transform-origin: left center;
}

/* ── Language toggle (EN · DE) ───────────────────────────────── */
.lang-toggle {
  position: absolute;
  top: 0;
  right: 0;
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: rgba(32, 25, 19, 0.55);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.lang-opt {
  border: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  padding: 6px 10px;
  min-height: 28px;
  border-radius: 999px;
  cursor: pointer;
  transition: color .25s var(--ease-premium), background .25s var(--ease-premium);
  -webkit-tap-highlight-color: transparent;
}
.lang-opt.active { color: var(--color-text); background: var(--color-accent); }
.lang-opt:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }

/* ── Person block ────────────────────────────────────────────── */
.person-block { position: relative; z-index: 1; margin-top: 20px; transform: translateZ(44px); }

.person-name {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(30px, 9vw, 42px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  white-space: nowrap;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,.5));
}
.person-name .first { color: #E8DCC8; }
.person-name .last  {
  color: transparent;
  background: linear-gradient(100deg, #E8855F 0%, #E8855F 38%, #FBC9A3 50%, #E8855F 62%, #E8855F 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  animation: foilShimmer 4.5s var(--ease-premium) infinite;
}

.person-title {
  margin-top: 6px;
  font-size: 14px;
  color: var(--color-text-muted);
  text-shadow: 0 2px 8px rgba(0,0,0,.6);
}

/* ── Divisions ───────────────────────────────────────────────── */
.divisions-block { position: relative; z-index: 1; margin-top: 22px; transform: translateZ(22px); }
.div-eyebrow {
  margin-bottom: 11px;
  text-align: center;
  font-size: 0.58rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--color-text-muted);
  text-shadow: 0 1px 6px rgba(0,0,0,.6);
}
.divisions {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}
.div-rule { background: var(--color-border); }

.div-link {
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-decoration: none;
  color: var(--color-accent);
  border-radius: 6px;
  transition: background .35s var(--ease-premium), color .35s var(--ease-premium), transform .12s var(--ease-premium);
}
.div-link:hover,
.div-link:focus-visible {
  background: rgba(200,91,64,.06);
  color: var(--color-accent-hover);
}
.div-link:active { transform: scale(.97); }
.div-link:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 3px; }

/* Subtle frosted backing — PLN-103: the blob is high-CENTER now, so both
   division links sit symmetrically under its glow and get the same glass. */
/* No per-link backdrop-filter: these sit INSIDE the card, whose own glass
   already blurs the canvas behind them — the rgba backing alone keeps text
   crisp, and skipping the extra blur layers matters on low-end phones. */
.div-link.solutions {
  padding: 15px 4px 15px 10px;
  background: rgba(23,18,15,.46);
}
.div-link.design    {
  padding: 15px 8px 15px 16px;
  background: rgba(23,18,15,.46);
}

.div-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: inherit;
  text-shadow: 0 2px 6px rgba(0,0,0,.4);
}
.div-arrow {
  font-size: 13px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0;
  opacity: .85;
  transition: transform .35s var(--ease-premium);
}
.div-link:hover .div-arrow,
.div-link:focus-visible .div-arrow { transform: translate(2px, -2px); }
.div-desc {
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.3;
}

/* ── CTA ─────────────────────────────────────────────────────── */
.cta {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  margin-top: 22px;
  padding: 16px;
  border: none;
  border-radius: 13px;
  background: var(--color-accent);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
  transition: background .25s var(--ease-premium), transform .15s var(--ease-premium);
  -webkit-tap-highlight-color: transparent;
}
.cta:hover        { background: var(--color-accent-press-1); }
.cta:active       { background: var(--color-accent-press-2); transform: scale(.96); }
.cta:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 3px; }

/* ── Tiles ───────────────────────────────────────────────────── */
.tiles { position: relative; z-index: 1; margin-top: 12px; }

.tile-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 64px;
  padding: 12px 8px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  /* Darker backing (no own backdrop-filter — the card's glass already blurs
     the fire behind these): keeps tile text crisp over the hotter blob while
     the thin card glass lets the fire through elsewhere. */
  background: rgba(23,18,15,.46);
  text-decoration: none;
  transition: background .3s var(--ease-premium), border-color .3s var(--ease-premium), transform .12s var(--ease-premium);
}
.tile:hover,
.tile:focus-visible {
  background: rgba(200,91,64,.10);
  border-color: var(--color-accent);
}
.tile:active { transform: scale(.955); }
.tile:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 3px; }

.tile-word {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--color-text);
}
.tile-sub {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--color-text-muted);
}

/* Isabella single-phone centering wrapper (PLN-104, card.css pattern) */
.tile-solo-row {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
}
.tile-solo-row .tile {
  width: calc(50% - 5px);
}

/* ── Apple Wallet button (Apple platforms only, see stephan-blob.js) ── */
.wallet-btn {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 12px;
  padding: 13px;
  min-height: 44px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: rgba(23,18,15,.46);
  color: var(--color-text);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background .3s var(--ease-premium), border-color .3s var(--ease-premium), transform .12s var(--ease-premium);
  -webkit-tap-highlight-color: transparent;
}
.wallet-btn:hover,
.wallet-btn:focus-visible {
  background: rgba(200,91,64,.10);
  border-color: var(--color-accent);
}
.wallet-btn:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 3px; }
.wallet-btn:active { transform: scale(.97); }

/* ── QR section ──────────────────────────────────────────────── */
.qr-section {
  position: relative;
  z-index: 1;
  margin-top: 18px;
  text-align: center;
}

.qr-toggle {
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  cursor: pointer;
  padding: 8px 10px;
  min-height: 44px;
  transition: color .3s var(--ease-premium);
  -webkit-tap-highlight-color: transparent;
}
.qr-toggle:hover,
.qr-toggle:focus-visible { color: var(--color-text); }
.qr-toggle:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 3px; }

.qr-panel {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height .5s var(--ease-premium), opacity .4s var(--ease-premium);
}
.qr-panel.open {
  max-height: 320px;
  opacity: 1;
}

.qr-inner {
  display: flex;
  justify-content: center;
  margin-top: 6px;
}

.qr-tile {
  padding: 14px;
  background: #F3E8D8;
  border-radius: 14px;
  line-height: 0;
}

.qr-caption {
  margin-top: 12px;
  font-size: 12px;
  color: var(--color-text-muted);
}
