/* aenor studio — digitale Visitenkarte
   Design-Tokens 1:1 aus aenor.ch (dunkles Neutral-Grau + Blau/Indigo-Verlauf) */

:root {
  --bg:        #0a0a0a;
  --surface:   rgba(16, 16, 18, 0.72);
  --surface-2: rgba(255, 255, 255, 0.035);
  --surface-3: rgba(255, 255, 255, 0.06);
  --line:      rgba(255, 255, 255, 0.09);
  --line-soft: rgba(255, 255, 255, 0.055);

  --text:  #f5f5f5;
  --text-2:#d4d4d4;
  --muted: #a3a3a3;
  --dim:   #737373;

  --blue:   #3b82f6;
  --blue-l: #60a5fa;
  --indigo: #6366f1;
  --green:  #4ade80;
  --amber:  #fbbf24;

  --radius: 26px;
  --radius-md: 16px;
  --radius-sm: 12px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100svh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 6px;
}

.ico {
  width: 18px; height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Hintergrund ---------- */

#bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
  pointer-events: none;
  background: #0b0e14;
}

.aurora {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(58rem 32rem at 18% 8%,  rgba(59, 130, 246, 0.14), transparent 62%),
    radial-gradient(46rem 30rem at 88% 82%, rgba(99, 102, 241, 0.12), transparent 64%),
    radial-gradient(70rem 44rem at 50% 120%, rgba(10, 10, 10, 0.85), transparent 70%);
}

/* ---------- Layout ---------- */

.wrap {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: clamp(18px, 5vw, 44px) clamp(14px, 4vw, 20px) calc(36px + env(safe-area-inset-bottom));
}

.card {
  position: relative;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  backdrop-filter: blur(26px) saturate(150%);
  -webkit-backdrop-filter: blur(26px) saturate(150%);
  box-shadow:
    0 40px 90px -30px rgba(0, 0, 0, 0.95),
    0 8px 26px -12px rgba(0, 0, 0, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  overflow: hidden;
  animation: cardIn 0.9s var(--ease) both;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(22px) scale(0.985); filter: blur(6px); }
  to   { opacity: 1; transform: none; filter: none; }
}

/* leuchtende Haarlinie am oberen Kartenrand — wie der Header auf aenor.ch */
.card-line {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.85), rgba(99, 102, 241, 0.6), transparent);
  z-index: 3;
}

/* ---------- Cover ---------- */

.cover {
  position: relative;
  height: 118px;
  overflow: hidden;
  background:
    radial-gradient(24rem 12rem at 12% -30%, rgba(59, 130, 246, 0.42), transparent 70%),
    radial-gradient(20rem 12rem at 86% 130%, rgba(99, 102, 241, 0.34), transparent 70%),
    linear-gradient(160deg, #101623 0%, #0c0f16 55%, #0a0a0c 100%);
  border-bottom: 1px solid var(--line-soft);
}

.cover-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(70% 120% at 50% 0%, #000 10%, transparent 78%);
  -webkit-mask-image: radial-gradient(70% 120% at 50% 0%, #000 10%, transparent 78%);
}

.cover-mark {
  position: absolute;
  right: -26px;
  top: -44px;
  width: 190px;
  opacity: 0.16;
  filter: saturate(140%);
  transform: rotate(-6deg);
  pointer-events: none;
}

.brand {
  position: absolute;
  left: 20px;
  top: 16px;
  display: flex;
  align-items: center;
  gap: 9px;
}

.brand img { width: 34px; height: 34px; }

.brand-text { display: flex; flex-direction: column; line-height: 1.2; }

.brand-name {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand-sub {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--dim);
}

.shimmer-text {
  background: linear-gradient(90deg, #3b82f6 0%, #3b82f6 30%, #ffffff 50%, #3b82f6 70%, #3b82f6 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: shimmer 7s linear infinite;
}

@keyframes shimmer {
  0%   { background-position: 200% center; }
  100% { background-position: -200% center; }
}

/* ---------- Identität ---------- */

.ident {
  padding: 0 22px 22px;
  text-align: center;
}

.avatar-shell {
  position: relative;
  width: 112px;
  height: 112px;
  margin: -56px auto 14px;
}

.avatar-ring {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  padding: 2.5px;
  background: linear-gradient(140deg, var(--blue-l), var(--indigo) 55%, rgba(99, 102, 241, 0.25));
  box-shadow: 0 12px 34px -10px rgba(59, 130, 246, 0.55);
}

.avatar-ring img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #0d0d0f;
  background: #16161a;
}

.avatar-dot {
  position: absolute;
  right: 5px;
  bottom: 7px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--dim);
  border: 3px solid #0d0d0f;
  transition: background 0.3s;
}

.avatar-dot.is-online { background: var(--green); box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.5); animation: dotPulse 2.4s ease-out infinite; }
.avatar-dot.is-lunch  { background: var(--amber); }
.avatar-dot.is-off    { background: #ef4444; }

@keyframes dotPulse {
  0%   { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.5); }
  70%  { box-shadow: 0 0 0 9px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

.ident h1 {
  margin: 0;
  font-size: clamp(23px, 6.4vw, 27px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.role {
  margin: 6px 0 0;
  font-size: 13.5px;
  color: var(--muted);
}

.role span { color: var(--blue-l); font-weight: 600; }

.tagline {
  margin: 12px auto 0;
  max-width: 33ch;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--dim);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 16px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--text-2);
}

.status-sep {
  width: 1px;
  height: 12px;
  background: var(--line);
}

.status-time {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

.status-time .ico { width: 13px; height: 13px; stroke-width: 2; }

.pulse { position: relative; display: inline-flex; width: 8px; height: 8px; }

.pulse i {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--dim);
}

.pulse.is-online i { background: var(--green); }
.pulse.is-lunch  i { background: var(--amber); }
.pulse.is-off    i { background: #ef4444; }

.pulse.is-online::before,
.pulse.is-lunch::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: currentColor;
  animation: ping 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.pulse.is-online::before { background: var(--green); }
.pulse.is-lunch::before  { background: var(--amber); }

@keyframes ping {
  75%, 100% { transform: scale(2.3); opacity: 0; }
}

/* ---------- Buttons ---------- */

.actions { padding: 0 18px 6px; }

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: transform 0.18s var(--ease), box-shadow 0.25s, background 0.25s, border-color 0.25s;
  will-change: transform;
}

.btn:active { transform: scale(0.975); }

.btn-primary {
  position: relative;
  color: #fff;
  background: linear-gradient(135deg, var(--blue) 0%, var(--indigo) 100%);
  box-shadow: 0 10px 30px -10px rgba(59, 130, 246, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  overflow: hidden;
}

.btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.28) 50%, transparent 80%);
  transform: translateX(-120%);
  animation: sheen 5.5s ease-in-out 1.6s infinite;
}

@keyframes sheen {
  0%   { transform: translateX(-120%); }
  55%  { transform: translateX(120%); }
  100% { transform: translateX(120%); }
}

.btn-primary.is-done {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  box-shadow: 0 10px 30px -12px rgba(34, 197, 94, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.btn-ghost {
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text-2);
  padding: 12px 14px;
  font-size: 13.5px;
}

.btn-ghost .ico { width: 17px; height: 17px; }

/* ---------- Kachel-Schnellaktionen ---------- */

.tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 13px 4px 11px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted);
  transition: transform 0.2s var(--ease), background 0.2s, border-color 0.2s, color 0.2s;
}

.tile-ico {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(140deg, rgba(59, 130, 246, 0.18), rgba(99, 102, 241, 0.1));
  border: 1px solid rgba(59, 130, 246, 0.22);
  color: var(--blue-l);
  transition: transform 0.25s var(--ease), box-shadow 0.25s;
}

.tile-wa .tile-ico {
  background: linear-gradient(140deg, rgba(37, 211, 102, 0.2), rgba(37, 211, 102, 0.08));
  border-color: rgba(37, 211, 102, 0.28);
  color: #4ade80;
}

.tile:active { transform: scale(0.96); }

/* ---------- Blöcke ---------- */

.block { padding: 18px 18px 0; }

.block-title {
  margin: 0 0 10px 4px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}

.rows {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
}

.row {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--line-soft);
  transition: background 0.2s;
}

.row:last-child { border-bottom: 0; }

.row-main {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  padding: 12px 4px 12px 13px;
}

.row-ico {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 11px;
  background: var(--surface-3);
  border: 1px solid var(--line-soft);
  color: var(--muted);
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.row-text { display: flex; flex-direction: column; min-width: 0; }

.row-text small {
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dim);
}

.row-text strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-copy, .row-go {
  display: grid;
  place-items: center;
  width: 48px;
  flex: none;
  color: var(--dim);
  transition: color 0.2s;
}

.row-copy { position: relative; }

.row-copy .ic-check,
.modal-copy .ic-check { display: none; color: var(--green); }

.row-copy.is-done .ic-copy,
.modal-copy.is-done .ic-copy { display: none; }

.row-copy.is-done .ic-check,
.modal-copy.is-done .ic-check { display: block; }

.row-copy.is-done { color: var(--green); }

/* ---------- Fakten ---------- */

.facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.fact {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 6px 12px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line-soft);
  text-align: center;
}

.fact-ico {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  margin-bottom: 3px;
}

.fact-ico .ico { width: 15px; height: 15px; }

.fi-blue   { background: rgba(59, 130, 246, 0.12); border: 1px solid rgba(59, 130, 246, 0.22); color: var(--blue-l); }
.fi-green  { background: rgba(74, 222, 128, 0.1);  border: 1px solid rgba(74, 222, 128, 0.2);  color: var(--green); }
.fi-indigo { background: rgba(99, 102, 241, 0.13); border: 1px solid rgba(99, 102, 241, 0.24); color: #818cf8; }

.fact strong {
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.fact small { font-size: 11px; color: var(--dim); }

.hours {
  margin-top: 9px;
  text-align: center;
  font-size: 11.5px;
  color: var(--dim);
}

/* ---------- Chips ---------- */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.chips li {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  font-size: 12px;
  color: var(--text-2);
}

/* ---------- Footer ---------- */

.card-foot {
  margin-top: 20px;
  padding: 16px 18px 18px;
  border-top: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.015);
  text-align: center;
}

.foot-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.foot-links span { color: #3f3f3f; }

.foot-links a { transition: color 0.2s; }

.foot-copy {
  margin: 8px 0 0;
  font-size: 11px;
  color: #5a5a5a;
}

.hint {
  margin: 16px 0 0;
  text-align: center;
  font-size: 11.5px;
  color: #6b6b6b;
}

/* ---------- QR-Overlay ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal[hidden] { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 4, 6, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeIn 0.25s ease-out both;
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 340px;
  padding: 26px 22px 22px;
  border-radius: var(--radius);
  background: rgba(18, 18, 20, 0.94);
  border: 1px solid var(--line);
  box-shadow: 0 40px 90px -25px rgba(0, 0, 0, 0.95);
  text-align: center;
  animation: modalPop 0.32s var(--ease) both;
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.9) translateY(14px); }
  to   { opacity: 1; transform: none; }
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--muted);
  transition: background 0.2s, color 0.2s;
}

.modal-card h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.modal-sub {
  margin: 7px 0 18px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--dim);
}

.qr-frame {
  position: relative;
  padding: 14px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 18px 40px -18px rgba(59, 130, 246, 0.55);
}

.qr-frame canvas {
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  display: block;
}

.qr-url {
  margin: 14px 0 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--blue-l);
  letter-spacing: -0.01em;
}

.modal-copy { gap: 8px; }

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 17px;
  border-radius: 999px;
  background: rgba(20, 20, 22, 0.95);
  border: 1px solid var(--line);
  box-shadow: 0 20px 40px -16px rgba(0, 0, 0, 0.9);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  transform: translate(-50%, 22px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s var(--ease), transform 0.28s var(--ease);
}

.toast .ico { width: 16px; height: 16px; color: var(--green); stroke-width: 2.4; }

.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Reveal ---------- */

.reveal {
  opacity: 0;
  animation: revealUp 0.75s var(--ease) both;
  animation-delay: calc(0.25s + var(--d, 0s));
}

@keyframes revealUp {
  from { opacity: 0; transform: translateY(14px); filter: blur(4px); }
  to   { opacity: 1; transform: none; filter: none; }
}

/* ---------- Hover nur für echte Zeigergeräte ---------- */

@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 38px -10px rgba(59, 130, 246, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  }
  .btn-ghost:hover {
    background: var(--surface-3);
    border-color: rgba(255, 255, 255, 0.16);
    color: #fff;
  }
  .tile:hover {
    transform: translateY(-3px);
    background: var(--surface-3);
    border-color: rgba(59, 130, 246, 0.3);
    color: var(--text);
  }
  .tile:hover .tile-ico {
    transform: scale(1.06);
    box-shadow: 0 8px 20px -8px rgba(59, 130, 246, 0.8);
  }
  .row:hover { background: rgba(255, 255, 255, 0.035); }
  .row:hover .row-ico { color: var(--blue-l); border-color: rgba(59, 130, 246, 0.3); background: rgba(59, 130, 246, 0.1); }
  .row-copy:hover { color: var(--text); }
  .row:hover .row-go { color: var(--blue-l); }
  .foot-links a:hover { color: var(--blue-l); }
  .modal-close:hover { background: var(--surface-3); color: #fff; }
  .chips li { transition: border-color 0.2s, color 0.2s; }
  .chips li:hover { border-color: rgba(59, 130, 246, 0.3); color: #fff; }
}

/* ---------- Grosse Screens: Karte etwas grosszügiger ---------- */

@media (min-width: 640px) {
  .wrap { max-width: 500px; padding-top: 48px; }
  body { font-size: 15.5px; }
}

/* ---------- Sehr schmale Geräte ---------- */

@media (max-width: 359px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .facts { grid-template-columns: 1fr; }
  .fact { flex-direction: row; justify-content: flex-start; gap: 10px; text-align: left; }
  .fact-ico { margin-bottom: 0; }
}

/* ---------- Bewegung reduzieren ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; }
  .shimmer-text {
    animation: none;
    background: none;
    -webkit-text-fill-color: #93c5fd;
    color: #93c5fd;
  }
}

/* ---------- Druck / PDF ---------- */

@media print {
  #bg, .aurora, .btn-row, .modal, .toast, .hint { display: none !important; }
  body { background: #fff; color: #111; }
  .card { border-color: #ddd; box-shadow: none; background: #fff; backdrop-filter: none; }
  .ident h1, .row-text strong, .fact strong { color: #111; }
}

/* Adresse darf über zwei Zeilen laufen */
.row-wrap .row-text strong {
  white-space: normal;
  line-height: 1.35;
}

.row-wrap .row-main { padding-top: 10px; padding-bottom: 10px; }

/* Fokus-Ziel beim Öffnen des Overlays soll keinen Ring zeichnen */
.modal-card:focus { outline: none; }
