:root {
  --black: #000000;
  --gold: #F2B212;
  --gold-soft: #C9A25A;
  --ivory: #F3EAD6;
  --muted: #A89E89;

  --sans: "Bricolage Grotesque", system-ui, sans-serif;
  --serif: "Bodoni Moda", Georgia, serif;

  --cw: clamp(9.5rem, 17.5vw, 16rem); /* card width */
  --intro: 1.45s;                    /* when the hand starts dealing */
  --settle: cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; }

html {
  color-scheme: dark;
  scrollbar-color: #5A430F var(--black);
}

::selection {
  background: rgba(242, 178, 18, 0.28);
  color: inherit;
}

.hand { user-select: none; -webkit-user-select: none; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--black);
  color: var(--ivory);
  font-family: var(--sans);
  font-size: 1.125rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

.sprite { position: absolute; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 45% 55% at 70% 45%, rgba(242, 178, 18, 0.11), transparent 70%);
  animation: arrive 1s var(--settle) var(--intro) both;
}

/* The crest: shown alone on load as gold foil, then it grows and fades
   into a watermark behind the whole page. The resting state is the base
   style, so the page is correct even if animations never run. */
.crest {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(44vmin, 26rem);
  aspect-ratio: 1;
  z-index: 0;
  pointer-events: none;
  opacity: 0.07;
  transform: scale(2.5);
  animation: crest 2.3s var(--settle) both;
}

.crest::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, #9A6606 0%, #F2B212 38%, #FFF1BF 50%, #F2B212 62%, #9A6606 100%);
  background-size: 320% 100%;
  background-position: 0% 0;
  -webkit-mask: url(logo-gold.webp) center / contain no-repeat;
  mask: url(logo-gold.webp) center / contain no-repeat;
  animation: sheen 1.3s ease-in-out 0.35s both;
}

@keyframes crest {
  0%   { opacity: 0; transform: scale(0.9); filter: blur(14px); }
  24%  { opacity: 1; transform: scale(1);   filter: blur(0); }
  58%  { opacity: 1; transform: scale(1.03); }
  100% { opacity: 0.07; transform: scale(2.5); }
}

@keyframes sheen {
  from { background-position: 100% 0; }
  to   { background-position: 0% 0; }
}

main { flex: 1; }
.table, .projects, .foot { position: relative; z-index: 1; }
.table { overflow-y: clip; }

.intro, .foot {
  animation: arrive 0.8s var(--settle) calc(var(--intro) + 0.2s) both;
}

@keyframes arrive {
  from { opacity: 0; }
}

/* Layout */
.table {
  flex: 1;
  width: 100%;
  max-width: 76rem;
  margin: 0 auto;
  padding: clamp(2.5rem, 7vw, 6rem) clamp(1rem, 5vw, 4rem) 2rem;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
}

/* Type */
h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(3rem, 6.2vw, 5.75rem);
  font-variation-settings: "opsz" 18;
  line-height: 0.98;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.lede {
  margin: 1.5rem 0 0;
  max-width: 28ch;
  font-size: clamp(1.25rem, 2.2vw, 1.5rem);
  line-height: 1.35;
}


.games {
  list-style: none;
  margin: clamp(2.5rem, 6vw, 4rem) 0 0;
  padding: 0;
  display: grid;
  gap: 1.25rem;
  max-width: 34rem;
}

.games li {
  padding-left: 1rem;
  border-left: 1px solid var(--gold);
}

.games h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  font-variation-settings: "opsz" 18;
  font-size: 1.75rem;
  line-height: 1.1;
}

.games p {
  margin: 0.2rem 0 0;
  color: var(--muted);
}

.entry {
  display: block;
  text-decoration: none;
}
.entry h3 {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(242, 178, 18, 0.6);
  text-underline-offset: 0.18em;
  transition: color 0.15s, text-decoration-color 0.15s;
}
.entry:hover h3 {
  color: var(--gold);
  text-decoration-color: var(--gold);
}

.foot {
  padding: 1.5rem clamp(1rem, 5vw, 4rem) 2rem;
  max-width: 76rem;
  width: 100%;
  margin: 0 auto;
  font-size: 0.9375rem;
  color: var(--muted);
}
.foot p { margin: 0; }

/* Links */
a { color: inherit; }

.text-link {
  font-weight: 600;
  color: var(--ivory);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(242, 178, 18, 0.6);
  text-underline-offset: 0.25em;
  transition: color 0.15s, text-decoration-color 0.15s;
}
.text-link:hover {
  color: var(--gold);
  text-decoration-color: var(--gold);
}

.btn {
  display: inline-block;
  padding: 0.7rem 1.2rem;
  border: 1px solid var(--gold);
  border-radius: 3px;
  color: var(--gold);
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s;
}
.btn:hover {
  background: var(--gold);
  color: var(--black);
}

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

.links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin-top: 2.5rem;
}

.foot .text-link { font-weight: 400; color: inherit; }

/* The hand: the ace and seven of spades */
.hand {
  position: relative;
  width: calc(var(--cw) * 1.82);
  height: calc(var(--cw) * 1.55);
}

.slot {
  --a: 0deg;
  --x: 0%;
  position: absolute;
  left: calc(50% + var(--cw) * 0.025);
  top: 5%;
  width: var(--cw);
  aspect-ratio: 5 / 7;
  margin-left: calc(var(--cw) / -2);
  transform-origin: 50% 140%;
  transform: translateX(var(--x)) rotate(var(--a));
  animation: gather 1.1s var(--settle) calc(var(--intro) + var(--i) * 0.05s) both;
}

.seven { --a: -8deg; --x: -14%; z-index: 1; }
.ace   { --a: 7deg;  --x: 14%;  z-index: 2; }

@keyframes gather {
  0%   { transform: translateX(0%) translateY(90vh) rotate(0deg); }
  45%  { transform: translateX(0%) translateY(12%) rotate(0deg); }
  100% { transform: translateX(var(--x)) translateY(0%) rotate(var(--a)); }
}

.lift {
  width: 100%;
  height: 100%;
  perspective: 1400px;
  transition: translate 0.25s ease-out;
}

.card {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  animation: flip 0.7s cubic-bezier(.3, .7, .3, 1) calc(var(--intro) + 0.8s + var(--i) * 0.18s) both;
}

@keyframes flip {
  from { transform: rotateY(180deg); }
  to   { transform: rotateY(0deg); }
}

.face {
  position: absolute;
  inset: 0;
  border-radius: 5.6% / 4%;
  background: #060504;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-shadow:
    0 0 0 1px rgba(242, 178, 18, 0.25),
    0 2px 4px rgba(0, 0, 0, 0.6),
    0 22px 44px -14px rgba(0, 0, 0, 0.9);
  overflow: hidden;
}
.face svg { display: block; width: 100%; height: 100%; }
.face.back { transform: rotateY(180deg); }

.rank {
  font-family: var(--serif);
  font-weight: 800;
  font-variation-settings: "opsz" 8;
  font-size: 38px;
  text-anchor: middle;
  fill: url(#gold);
}

@media (hover: hover) and (pointer: fine) {
  .slot:hover .lift { translate: 0 -7%; }
}

/* Small screens: hand first, then text */
@media (max-width: 800px) {
  :root { --cw: min(40vw, 11rem); }
  .table {
    grid-template-columns: 1fr;
    padding-top: 2rem;
    justify-items: start;
  }
  .hand { order: -1; justify-self: center; margin-bottom: 0.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  .slot, .card, .crest, .crest::before { animation: none; }
  body::before { animation-delay: 0s; }
  .intro, .foot { animation-delay: 0s; }
}

/* Projects contributed to: panels framed like cards, dealt in on scroll */
.projects {
  width: 100%;
  max-width: 76rem;
  margin: 0 auto;
  padding: clamp(3rem, 8vw, 6rem) clamp(1rem, 5vw, 4rem) clamp(3rem, 7vw, 5rem);
  scroll-margin-top: 1rem;
}

.projects-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  font-variation-settings: "opsz" 18;
  font-size: clamp(2.5rem, 5.5vw, 4.5rem);
  line-height: 0.98;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.projects-head .lede { max-width: 42ch; }

.feature {
  margin-top: clamp(2.5rem, 6vw, 4rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(1.5rem, 4vw, 3rem);
  padding: clamp(0.9rem, 2.2vw, 1.6rem);
}

.shot img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 6px;
}

.feature h3,
.credit h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  font-variation-settings: "opsz" 18;
  line-height: 1.05;
  text-wrap: balance;
}
.feature h3 { font-size: clamp(2.1rem, 3.6vw, 3.1rem); }
.feature h3 .subtitle {
  display: block;
  margin-top: 0.2em;
  font-size: 0.55em;
  color: var(--ivory);
  opacity: 0.8;
}
.credit h3  { font-size: clamp(1.9rem, 3vw, 2.5rem); }

.role {
  margin: 0.6rem 0 0;
  color: var(--gold);
  font-weight: 600;
}

.desc {
  margin: 1rem 0 0;
  max-width: 46ch;
  color: var(--muted);
}

.actions {
  list-style: none;
  margin: 1.75rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem 1.4rem;
}

.feature,
.credit {
  border: 1px solid rgba(242, 178, 18, 0.6);
  outline: 1px solid rgba(242, 178, 18, 0.22);
  outline-offset: -8px;
  border-radius: 12px;
  background: radial-gradient(ellipse 120% 100% at 50% 40%, #1D1913, #060504);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.9);
}

.credit {
  width: min(100%, 34rem);
  margin: clamp(2rem, 5vw, 3.5rem) 0 0 auto;
  padding: clamp(1.4rem, 3vw, 2.2rem);
}

@media (max-width: 800px) {
  .feature { grid-template-columns: 1fr; }
}

/* Scrolling deals each panel onto the table like a thrown card */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }

  @supports (animation-timeline: view()) {
    .deal-in {
      animation: deal-left linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 38%;
    }
    .deal-in.from-right { animation-name: deal-right; }
  }
}

@keyframes deal-left {
  from { opacity: 0; transform: translate(-28vw, 12vh) rotate(-11deg); }
  to   { opacity: 1; transform: none; }
}
@keyframes deal-right {
  from { opacity: 0; transform: translate(28vw, 12vh) rotate(11deg); }
  to   { opacity: 1; transform: none; }
}
