/* ---------- Tokens ---------- */
:root {
  --ink: #171F22;
  --mist: #C1D1CF;
  --steel: #748B91;
  --moss: #666B64;
  --graphite: #636467;
  --paper: #F4F6F5;
  --steel-ink: #54676C; /* darker --steel for text (AA on --paper) */

  --font: "Inter Tight", system-ui, sans-serif;
  --card-w: 300px;
  --card-h: 440px;
  --card-r: 14px;
  --strap-h: clamp(120px, 26svh, 300px);

  /* Physics output (unitless; written by carnet.js) */
  --angle: 0;
  --stretch: 0;
  --tilt-x: 0;
  --tilt-y: 0;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}
p, ul, h2 { margin: 0; }

:focus-visible {
  outline: 2px solid var(--steel);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Section layout ---------- */
.whoami {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 32px;
  max-width: 1200px;
  min-height: 100svh;
  margin: 0 auto;
  padding: 0 32px;
  overflow-x: clip;
}

/* ---------- Text column ---------- */
.whoami__text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  padding-block: 64px;
}
.eyebrow {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--moss);
}
.whoami__name {
  font-size: clamp(48px, 7vw, 88px);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.035em;
}
.whoami__role {
  margin-top: -6px;
  font-size: clamp(26px, 3.4vw, 40px);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
  /* marker-style highlight in the palette's mist tone */
  background: linear-gradient(transparent 58%, var(--mist) 58% 92%, transparent 92%);
  padding-inline: 2px;
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 10px;
  border: 1px solid var(--mist);
  border-radius: 999px;
  background: #fff;
  font-size: 14px;
  font-weight: 500;
}
.status__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--steel);
}

.whoami__bio {
  max-width: 46ch;
  font-size: 17px;
  line-height: 1.6;
  color: var(--moss);
}
.whoami__meta {
  font-size: 14px;
  color: var(--graphite);
  font-variant-numeric: tabular-nums;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  list-style: none;
}
.chips li {
  padding: 5px 12px;
  border: 1px solid var(--steel);
  border-radius: 999px;
  font-size: 13px;
  color: var(--ink);
}
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}
.links a {
  color: var(--ink);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--mist);
  text-underline-offset: 4px;
  text-decoration-thickness: 2px;
  transition: text-decoration-color 0.2s;
}
.links a:hover { text-decoration-color: var(--ink); }

/* ---------- Stage + rig (pivot at the top of the strap) ---------- */
.stage {
  position: relative;
  align-self: start;
  height: 100svh;
  min-height: 680px;
}
.rig {
  position: absolute;
  top: -40px;
  left: 50%;
  width: var(--card-w);
  display: flex;
  flex-direction: column;
  align-items: center;
  translate: -50% 0;
  transform-origin: 50% 0;
  transform:
    translateY(calc(var(--stretch) * 1px))
    rotate(calc(var(--angle) * 1deg));
  perspective: 1200px;
  will-change: transform;
}

/* Lanyard strap */
.strap {
  position: relative;
  width: 30px;
  height: var(--strap-h);
  background:
    linear-gradient(90deg, transparent 3px, rgb(255 255 255 / 0.08) 3px 4px, transparent 4px calc(100% - 4px), rgb(255 255 255 / 0.08) calc(100% - 4px) calc(100% - 3px), transparent 0),
    linear-gradient(90deg, #0f1517, var(--ink) 30%, #222c30 55%, var(--ink) 80%, #0f1517);
  border-radius: 0 0 6px 6px;
}
.strap::after { /* rivet */
  content: "";
  position: absolute;
  left: 50%;
  bottom: 22px;
  width: 9px;
  height: 9px;
  translate: -50% 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #b9c2c4 45%, #6d777a);
  box-shadow: 0 1px 1px rgb(0 0 0 / 0.5);
}

/* Swivel clip */
.clip {
  position: relative;
  z-index: 2;
  width: 26px;
  height: 58px;
  margin-top: -8px;
}
.clip::before { /* ring */
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 22px;
  border: 4px solid #aeb8bb;
  border-radius: 11px;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.7), 0 1px 2px rgb(0 0 0 / 0.35);
}
.clip::after { /* hook body */
  content: "";
  position: absolute;
  left: 50%;
  top: 17px;
  width: 14px;
  height: 41px;
  translate: -50% 0;
  border-radius: 6px 6px 3px 3px;
  background:
    linear-gradient(180deg, transparent 12px, rgb(0 0 0 / 0.25) 12px 13px, transparent 13px),
    linear-gradient(90deg, #7d8689, #eef2f3 45%, #c3cbcd 60%, #6d777a);
  box-shadow: 0 2px 3px rgb(0 0 0 / 0.3);
}

/* ---------- Card ---------- */
.card {
  position: relative;
  width: var(--card-w);
  height: var(--card-h);
  margin-top: -14px;
  border-radius: var(--card-r);
  transform-style: preserve-3d;
  transform:
    rotateX(calc(var(--tilt-x) * 1deg))
    rotateY(calc(var(--tilt-y) * 1deg));
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
  will-change: transform;
}
.card.is-dragging { cursor: grabbing; }
.card::before { /* card thickness, visible when tilted */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: #9fb0ae;
  transform: translateZ(-4px);
}
.card__face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  background: var(--mist);
  box-shadow: 0 1px 0 rgb(255 255 255 / 0.6) inset;
}
.card__photo {
  height: 252px;
  background: var(--mist);
}
.card__photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 40% 30%;
  pointer-events: none;
}
.card__slot {
  position: absolute;
  top: 12px;
  left: 50%;
  width: 36px;
  height: 9px;
  translate: -50% 0;
  border-radius: 5px;
  background: var(--paper);
  box-shadow: inset 0 1px 2px rgb(0 0 0 / 0.35);
}

/* Name panel with the curved step notch from the reference */
.card__panel {
  position: absolute;
  inset: auto 0 0 0;
  height: 232px;
  padding: 20px 20px 18px;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  clip-path: path("M0 0 H148 C172 0 168 24 194 24 H300 V232 H0 Z");
}
.card__name {
  font-size: 22px;
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.01em;
}
.card__role {
  margin-top: 6px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--steel-ink);
}
.card__fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  margin: 12px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--mist);
}
.card__field--wide { grid-column: 1 / -1; }
.card__fields dt {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--moss);
}
.card__fields dd {
  margin: 2px 0 0;
  font-size: 13px;
  font-weight: 500;
}
.card__foot {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-top: auto;
}
.card__barcode {
  width: 120px;
  height: 22px;
  background: repeating-linear-gradient(90deg,
    var(--ink) 0 2px, transparent 2px 4px, var(--ink) 4px 5px, transparent 5px 8px,
    var(--ink) 8px 11px, transparent 11px 12px, var(--ink) 12px 13px, transparent 13px 16px);
  opacity: 0.85;
}
.card__id {
  font-size: 11px;
  font-weight: 500;
  color: var(--graphite);
  font-variant-numeric: tabular-nums;
}

/* Monogram, like the logo mark on the reference badge */
.card__mark {
  position: absolute;
  top: 12px;
  left: 14px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--paper);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* Light sheen that slides with the tilt */
.card__sheen {
  position: absolute;
  inset: -40%;
  background: linear-gradient(115deg, transparent 35%, rgb(255 255 255 / 0.35) 50%, transparent 65%);
  mix-blend-mode: soft-light;
  translate: calc(var(--tilt-y) * -6px) calc(var(--tilt-x) * 6px);
  pointer-events: none;
}

/* Soft shadow behind the card; lifts away as the card stretches down */
.shadow {
  position: absolute;
  z-index: -1;
  left: 8%;
  right: 8%;
  bottom: -18px;
  height: 60%;
  border-radius: 30px;
  background: rgb(23 31 34 / 0.28);
  filter: blur(26px);
  transform: translateY(calc(var(--stretch) * 0.4px)) scale(calc(1 - var(--stretch) * 0.003));
  pointer-events: none;
}

/* ---------- Playground only ---------- */
.playground-spacer {
  display: grid;
  place-items: center;
  height: 70vh;
  color: var(--moss);
  font-size: 14px;
}

/* ---------- Responsive ---------- */
@media (max-width: 767px) {
  .whoami {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding: 0 16px;
  }
  .stage {
    order: -1;
    height: 560px;
    min-height: 0;
  }
  .rig { scale: 0.8; }
  :root { --strap-h: 130px; }
  .whoami__text { padding-block: 0 64px; }
}
