:root {
  --felt: #1E4A3A;
  --cream: #F4EFE3;
  --red: #C8322B;
  --ink: #1D1D1D;
  --shadow: rgba(8, 26, 19, .55);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--felt);
  color: var(--cream);
  font-family: 'Barlow', system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

p { margin: 0; }

a { color: var(--cream); }
a:hover { color: #FFFFFF; }

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--cream);
  outline-offset: 4px;
  border-radius: 2px;
}

.wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 64px);
}

/* ---------- Header ---------- */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 24px;
  padding: 18px 0;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* ---------- Hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "name"
    "lede"
    "stage"
    "contact";
  padding: 20px 0 48px;
}

.name {
  grid-area: name;
  margin: 0 0 22px;
  font-family: 'Anton', Impact, sans-serif;
  font-weight: 400;
  font-size: clamp(60px, 20vw, 112px);
  line-height: .92;
  letter-spacing: .005em;
  text-transform: uppercase;
  overflow-wrap: normal;
  word-break: keep-all;
  hyphens: none;
}

.lede {
  grid-area: lede;
  max-width: 34em;
  font-size: clamp(19px, 1.7vw, 23px);
  line-height: 1.4;
  text-wrap: pretty;
}

.contact {
  grid-area: contact;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.contact-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 28px;
}

.lk {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}

.lk:hover { text-decoration-thickness: 2px; }

/* Arrival of the hero text (load only) */
.fd { animation: fadeUp .9s var(--ease-out) both; }
.lede.fd { animation-delay: .1s; }
.contact.fd { animation-delay: .2s; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Card stage ---------- */

.stage {
  grid-area: stage;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 28px 0 18px;
  perspective: 1400px;
  touch-action: pan-y;
}

.slab {
  --rx: 0deg;
  --ry: 0deg;
  --sx: 50%;
  --sy: 50%;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(100%, 340px);
  margin: 0;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: 18px;
  background: rgba(255, 255, 255, .13);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .55),
    0 30px 60px var(--shadow),
    0 6px 14px rgba(8, 26, 19, .35);
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transform-style: preserve-3d;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.slab.settle { transition: transform 1.6s var(--ease-out); }
.slab.live { transition: transform .18s ease-out; }

@media (prefers-reduced-motion: no-preference) {
  .js .slab.arrive { --rx: 8deg; --ry: -28deg; --sx: 0%; --sy: 0%; }
}

/* Grading label */
.grade {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border: 2px solid var(--red);
  border-radius: 6px;
  background: var(--cream);
  color: var(--ink);
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  font-size: 13px;
  line-height: 1.15;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.grade-id,
.grade-score { display: flex; flex-direction: column; }
.grade-score { align-items: flex-end; }

.grade-num {
  font-family: 'Anton', sans-serif;
  font-weight: 400;
  font-size: 30px;
  line-height: 1;
}

/* The card itself */
.card {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 63 / 88;
  transform-style: preserve-3d;
  transition: transform .9s var(--ease-out);
}

.card.is-flipped { transform: rotateY(180deg); }

.face {
  position: absolute;
  inset: 0;
  border-radius: 10px;
  overflow: hidden;
  background: var(--cream);
  color: var(--ink);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  container-type: size;
}

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

.face-body {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
}

/* Front */
.front .face-body { padding: 2.6cqw; }

.photo {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-bottom: 0;
  background: #111;
}

.photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 52% 22%;
  -webkit-user-drag: none;
}

.badge {
  position: absolute;
  top: 3cqw;
  left: 3cqw;
  padding: 1.1cqw 2.6cqw;
  border-radius: 999px;
  background: var(--red);
  color: #FFFFFF;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 3.7cqw;
  line-height: 1.2;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.sheen {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg,
    rgba(255, 255, 255, 0) 32%,
    rgba(255, 255, 255, .55) 45%,
    rgba(170, 215, 255, .4) 51%,
    rgba(255, 200, 230, .3) 56%,
    rgba(255, 255, 255, 0) 68%);
  background-size: 260% 260%;
  background-position: var(--sx) var(--sy);
  mix-blend-mode: screen;
  opacity: .75;
}

.slab.settle .sheen { transition: background-position 1.6s var(--ease-out); }
.slab.live .sheen { transition: background-position .18s ease-out; }

.nameplate {
  display: block;
  padding: 2.3cqw 2.8cqw 1.7cqw;
  border: 2px solid var(--ink);
  border-bottom: 0;
  background: var(--red);
  color: #FFFFFF;
  font-family: 'Anton', sans-serif;
  font-size: 8cqw;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.strip {
  display: flex;
  justify-content: space-between;
  gap: 2cqw;
  padding: 1.7cqw 2.8cqw;
  background: var(--ink);
  color: var(--cream);
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  font-size: 3.7cqw;
  line-height: 1.2;
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* Back */
.back .face-body {
  gap: 3cqw;
  padding: 4.6cqw 4.5cqw 4.5cqw;
  font-family: 'Barlow Condensed', sans-serif;
}

.back-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 2cqw;
}

.back-name {
  font-family: 'Anton', sans-serif;
  font-size: 7.2cqw;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.back-no {
  font-weight: 700;
  font-size: 3.7cqw;
}

.back-bio {
  font-size: 4.2cqw;
  line-height: 1.25;
}

.tb {
  width: 100%;
  border-collapse: collapse;
  font-size: 4.3cqw;
  line-height: 1.2;
}

.tb th {
  text-align: left;
  font-weight: 700;
  padding: 1.5cqw 1.1cqw 1.5cqw 0;
  border-bottom: 2px solid var(--ink);
}

.tb td {
  padding: 1.6cqw 1.1cqw 1.6cqw 0;
  border-bottom: 1px solid rgba(29, 29, 29, .2);
  vertical-align: top;
}

.tb td:first-child,
.tb th:first-child { white-space: nowrap; }

.tb-now td {
  color: var(--red);
  font-weight: 700;
  border-bottom: 0;
}

.scout {
  display: flex;
  flex-direction: column;
  gap: .8cqw;
}

.scout-title {
  font-weight: 700;
  font-size: 4.2cqw;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.scout-text {
  font-family: 'Barlow', sans-serif;
  font-size: 4.1cqw;
  line-height: 1.3;
}

.career {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  gap: 2cqw;
  padding: 1.7cqw 2.3cqw;
  background: var(--red);
  color: #FFFFFF;
  font-weight: 700;
  font-size: 3.7cqw;
  line-height: 1.2;
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* Flip button under the slab */
.flip-btn {
  position: relative;
  z-index: 1; /* above the slab's drop shadow */
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  background: none;
  color: var(--cream);
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: .04em;
  text-transform: uppercase;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
  cursor: pointer;
}

.flip-btn:hover { color: #FFFFFF; text-decoration-thickness: 2px; }

/* ---------- Extras ---------- */

.extras {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 28px 0 40px;
  border-top: 1px solid rgba(244, 239, 227, .3);
  font-size: 17px;
  line-height: 1.6;
}

.extras p { max-width: 52em; }

.extras strong { font-weight: 600; }

.extras a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.extras a:hover { text-decoration-thickness: 2px; }

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

.foot {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 24px;
  padding: 18px 0 26px;
  border-top: 1px solid rgba(244, 239, 227, .3);
  font-size: 14px;
}

.hint-touch { display: none; }

@media (hover: none) {
  .hint-mouse { display: none; }
  .hint-touch { display: inline; }
}

.is-touch .hint-mouse { display: none; }
.is-touch .hint-touch { display: inline; }

/* ---------- Desktop: text left, card right ---------- */

@media (min-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 560px) auto;
    grid-template-rows: 1fr auto auto auto 1fr;
    grid-template-areas:
      ".       stage"
      "name    stage"
      "lede    stage"
      "contact stage"
      ".       stage";
    justify-content: space-between;
    column-gap: clamp(32px, 6vw, 96px);
    padding: clamp(24px, 4vw, 56px) 0 clamp(48px, 6vw, 88px);
  }

  .name {
    margin-bottom: 26px;
    font-size: clamp(64px, 8.4vw, 124px);
  }

  .lede { margin-bottom: 26px; }

  .stage { padding: 24px; }

  .slab { width: clamp(320px, 28vw, 380px); }

  .extras { font-size: 18px; }
}

/* ---------- Reduced motion: no tilt, no settle, cross-fade flip ---------- */

@media (prefers-reduced-motion: reduce) {
  .fd { animation: none; }

  .slab,
  .slab.settle,
  .slab.live { transform: none; transition: none; }

  .slab .sheen { transition: none; }

  .card,
  .card.is-flipped { transform: none; transition: none; }

  .face {
    -webkit-backface-visibility: visible;
    backface-visibility: visible;
    transition: opacity .25s ease;
  }

  .back { transform: none; opacity: 0; }
  .card.is-flipped .front { opacity: 0; }
  .card.is-flipped .back { opacity: 1; }
}
