
:root {
  /*
    Reference palette
    - Ti: #354551  (dark blue-gray)
    - Ne: #10445A  (deep petrol)
    - Si: #2A8CAE  (teal)
    - Fe: #90B0C0  (soft blue-gray)
  */

  /* ========= Background ========= */
  --bg-teal: #2a8cae;     /* Si */
  --bg-soft: #90b0c0;     /* Fe */
  --bg-deep: #10445a;     /* Ne */
  --bg-anchor: #354551;   /* Ti */

  /* Background gradient stops */
  --bg-spot-1: rgba(42, 140, 174, 0.75);
  --bg-spot-2: rgba(144, 176, 192, 0.55);
  --bg-spot-3: rgba(53, 69, 81, 0.60);

  /* ========= Card ========= */
  --card: #ffffff;
  --border: rgba(0, 0, 0, 0.10);
  --radius: 18px;

  /* Card shadow (on the background) */
  --shadow: 0 28px 70px rgba(0, 0, 0, 0.55);
  --shadow-lift: 0 34px 86px rgba(0, 0, 0, 0.60);

  /* ========= Text (on white card) ========= */
  --text: #111827;
  --muted: #4b5563;
  --muted2: #6b7280;

  /* ========= Accents (derived from palette) ========= */
  --accent: var(--bg-teal);
  --accent-soft: rgba(42, 140, 174, 0.16);
  --accent-alt: var(--bg-deep);

  /* ========= Layout ========= */
  --w: 520px;
  --h: 330px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: rgba(255, 255, 255, 0.92);
  background:
    radial-gradient(1200px 800px at 15% 15%, var(--bg-spot-1), transparent 60%),
    radial-gradient(1000px 700px at 85% 35%, var(--bg-spot-2), transparent 65%),
    radial-gradient(900px 700px at 50% 100%, var(--bg-spot-3), transparent 70%),
    linear-gradient(180deg, var(--bg-teal), var(--bg-anchor));
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.10;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.45'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

.wrap {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 32px 20px;
}

.stage {
  width: min(var(--w), 94vw);
  height: min(var(--h), 62vw);
  max-height: 360px;
  perspective: 1400px;
}

.card {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  cursor: pointer;
  outline: none;
  will-change: transform;

  /* tilt inputs */
  --mx: 0;
  --my: 0;
  --tilt-max: 7deg;
  --tilt-x: calc(var(--my) * var(--tilt-max));
  --tilt-y: calc(var(--mx) * var(--tilt-max));

  /* flip */
  --flip-rot: 0deg;

  /* kick */
  --kick: 0deg;

  transition:
    transform 520ms cubic-bezier(.2, .7, .2, 1),
    box-shadow 220ms ease;

  transform:
    rotateX(var(--tilt-x))
    rotateY(calc(var(--flip-rot) + var(--tilt-y) + var(--kick)));
}

@media (hover: hover) and (pointer: fine) {
  .card:hover { box-shadow: var(--shadow-lift); }
}

.face {
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  backface-visibility: hidden;
  background: var(--card);
  border: 1px solid var(--border);
  overflow: hidden;
}

.face::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: var(--radius);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.60),
    rgba(255, 255, 255, 0.00) 30%
  );
  opacity: 0.35;
}

.face::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: var(--radius);
  background: radial-gradient(circle at 1px 1px, rgba(0, 0, 0, 0.02) 1px, transparent 0);
  background-size: 22px 22px;
  opacity: 0.60;
}

.front { transform: rotateY(0deg); }
.back  { transform: rotateY(180deg); }

.content {
  position: relative;
  z-index: 1;
  height: 100%;
  padding: 22px 22px 18px;
  display: grid;
  gap: 12px;
  color: var(--text);
}

.top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.name {
  font-family: Fraunces, serif;
  font-size: clamp(26px, 4vw, 34px);
  line-height: 1.1;
  margin: 0;
}

.role {
  margin-top: 6px;
  font-size: 14px;
  color: var(--muted);
  font-weight: 500;
}

.avatar {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.06);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tagline {
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
  max-width: 56ch;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 2px;
}

.icon {
  width: 14px;
  height: 14px;
  display: inline-block;
  margin-right: 6px;
  fill: currentColor;
  flex: 0 0 auto;
}

.emoji {
  display: inline-block;
  margin-right: 6px;
  line-height: 1;
  transform: translateY(1px);
}

a.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 12px;
  line-height: 1;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  color: var(--text);
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.18);
  box-shadow: none;
  transition: background 120ms ease, border-color 120ms ease;
}

a.btn:hover {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.28);
}

a.btn:active { background: rgba(0, 0, 0, 0.08); }

a.btn.primary {
  background: var(--accent-soft);
  border-color: rgba(42, 140, 174, 0.45);
}

a.btn.primary:hover { background: rgba(42, 140, 174, 0.22); }

.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--muted2);
}

.hint {
  display: flex;
  align-items: center;
  user-select: none;
}

@media (prefers-reduced-motion: reduce) {
  .card { transition: none; }
  a.btn { transition: none; }
}

@media (max-width: 420px) {
  :root { --h: 360px; }
  .content { padding: 18px 16px 16px; }
  a.btn { height: 32px; padding: 0 11px; }
}

/* ==========================================
    Mobile: normal page with white sections
    ========================================== */
@media (max-width: 640px) {
  body { overflow-x: hidden; }

  .wrap {
    min-height: auto;
    display: block;
    padding: 24px 18px 40px;
  }

  .stage {
    width: 100%;
    height: auto;
    max-height: none;
    perspective: none;
  }

  .card {
    width: 100%;
    height: auto;
    transform: none !important;
    box-shadow: none !important;
    cursor: default;
  }

  .face {
    position: static;
    inset: auto;
    transform: none !important;
    backface-visibility: visible;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: visible;
    margin-bottom: 20px;
  }

  .face::before,
  .face::after { content: none !important; }

  /* Hide repeated header on the back for mobile */
  .back .top { display: none !important; }

  .content {
    padding: 18px 16px;
    gap: 12px;
    color: var(--text);
  }

  .front { margin-bottom: 24px; }

  .footer,
  .hint { display: none !important; }

  .name { font-size: 30px; }
  .tagline { max-width: 60ch; }

  a.btn {
    height: 34px;
    padding: 0 12px;
  }
}