/* Jack of It All — playing-card vernacular: card stock, heart red, ink.
   Bodoni Moda carries the "J" index feel; Archivo does the reading. */

:root {
  --paper: #F2F1EC;
  --card: #FFFFFF;
  --ink: #1A1A1A;
  --heart: #C8102E;
  --rule: #CFCDC5;
  --muted: #5B5A56;

  --display: "Bodoni Moda", "Didot", "Bodoni 72", Georgia, serif;
  --text: "Archivo", "Helvetica Neue", Arial, sans-serif;

  --gutter: clamp(1.25rem, 4vw, 4rem);
  --measure: 34rem;
}

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

html { background: var(--paper); color: var(--ink); }

body {
  margin: 0;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  font-family: var(--text);
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 500;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; text-wrap: pretty; }

a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--heart);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100%;
  padding: .5rem 1rem;
  background: var(--ink);
  color: var(--card);
  text-decoration: none;
}
.skip:focus { top: 1rem; }

/* Corner indices: the page is the card. */
.index {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: .05em;
  color: var(--heart);
  text-decoration: none;
  line-height: 1;
}
.index-rank {
  font-family: var(--display);
  font-weight: 700;
  font-size: 2rem;
  font-variation-settings: "opsz" 72;
}
.index-suit { width: .95rem; fill: currentColor; }
.index-mirror { transform: rotate(180deg); }

.top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: calc(var(--gutter) * .75) var(--gutter) 0;
}
.top-nav {
  display: flex;
  gap: 1.75rem;
  padding-top: .35rem;
  font-weight: 500;
}
.top-nav a {
  text-decoration: none;
  border-bottom: 1.5px solid transparent;
}
.top-nav a:hover { border-bottom-color: var(--ink); }

main { padding: 0 var(--gutter); }

/* Hero: headline beside the card, held at the edge of the page. */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  align-items: end;
  column-gap: var(--gutter);
  min-height: min(74svh, 42rem);
  padding-top: clamp(2rem, 8vh, 6rem);
}
.hero-copy { padding-bottom: clamp(2rem, 6vh, 4rem); }
h1 {
  font-size: clamp(2.75rem, 2rem + 4.5vw, 6.25rem);
  line-height: .98;
  letter-spacing: -.01em;
  font-variation-settings: "opsz" 96;
  max-width: 12ch;
}
.lede {
  margin-top: clamp(1.25rem, 3vh, 2rem);
  max-width: var(--measure);
  font-size: clamp(1.0625rem, 1rem + .4vw, 1.3125rem);
  line-height: 1.5;
}
.hero-card {
  margin: 0;
  justify-self: end;
  width: min(100%, 34rem);
  aspect-ratio: 1;
}
.hero-card svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
/*
   Load overture — one idea, told in order: the page is being readied,
   the hand arrives, the copy sets, then a card is dealt into the pinch.

   Timeline                                   0        400      900     1400     1900ms
   hand        rise      0   –  480ms  ████████▌
   headline    rise    120   –  740ms      ▐████████▌
   lede        rise    240   –  860ms          ▐███████▌
   page chrome fade    400   –  900ms              ▐█████▌
   card        deal    720   – 1870ms                  ▐

   The card path is arced (three position keyframes, not two) and lands
   with a paper settle: overshoot past the pinch, counter-swing, rest.
   No library — pure CSS keyframes, fill-mode both, reduced-motion off.
*/
@media (prefers-reduced-motion: no-preference) {
  .top, .foot {
    animation: fade 500ms cubic-bezier(.25, .6, .35, 1) 400ms both;
  }
  .hero-copy h1, .lede {
    animation: rise 620ms cubic-bezier(.22, .61, .36, 1) both;
  }
  .hero-copy h1  { animation-delay: 120ms; }
  .lede          { animation-delay: 260ms; }
  .hero-card .hand-back, .hero-card .hand-front {
    animation: rise 480ms cubic-bezier(.22, .61, .36, 1) both;
  }
  .hero-card .card {
    transform-box: fill-box;
    transform-origin: 50% 100%;
    animation: deal 1150ms linear 720ms both;
  }
  @keyframes rise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
  }
  @keyframes fade {
    from { opacity: 0; }
    to   { opacity: 1; }
  }
  /* Dealt with a wrist flicked clockwise, caught, and squared in the fingers. */
  @keyframes deal {
    0%   { opacity: 0; transform: translate(20%, -42%) rotate(11deg); animation-timing-function: cubic-bezier(.4, .1, .5, .95); }
    20%  { opacity: 1; }
    30%  { transform: translate(4%, -24%) rotate(-2deg);  animation-timing-function: cubic-bezier(.25, .6, .35, 1); }
    60%  { transform: translate(-4.5%, -4%) rotate(-5deg); animation-timing-function: cubic-bezier(.35, 0, .35, 1); }
    82%  { transform: translate(.8%, .6%) rotate(1deg);  animation-timing-function: cubic-bezier(.4, 0, .4, 1); }
    100% { opacity: 1; transform: translate(0, 0) rotate(0deg); }
  }
}

/* Sections are separated by the ruled lines of a ledger, not by boxes. */
.what, .contact {
  border-top: 1.5px solid var(--ink);
  padding: clamp(2rem, 5vh, 3.5rem) 0 clamp(3rem, 8vh, 6rem);
}
h2 {
  font-size: clamp(1.75rem, 1.4rem + 1.6vw, 2.75rem);
  font-variation-settings: "opsz" 48;
  margin-bottom: clamp(1.5rem, 4vh, 2.5rem);
}
.trades {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gutter);
}
.trade { border-left: 1.5px solid var(--rule); padding-left: 1.25rem; }
.trade h3 {
  font-size: clamp(1.5rem, 1.25rem + 1vw, 2rem);
  font-variation-settings: "opsz" 36;
  color: var(--heart);
  margin-bottom: .5rem;
}
.trade p { max-width: 28rem; color: var(--ink); }

.contact p { max-width: var(--measure); }
.mail {
  display: inline-block;
  margin-top: 1.5rem;
  font-family: var(--display);
  font-size: clamp(1.5rem, 1.1rem + 2.2vw, 3rem);
  font-variation-settings: "opsz" 48;
  line-height: 1.1;
  text-decoration: none;
  border-bottom: 2px solid var(--heart);
  overflow-wrap: anywhere;
}
.mail:hover { color: var(--heart); }

.foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 var(--gutter) calc(var(--gutter) * .75);
  color: var(--muted);
  font-size: .9375rem;
}

@media (max-width: 52rem) {
  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
    row-gap: 1rem;
  }
  .hero-copy { order: 2; padding-bottom: 2.5rem; }
  .hero-card { order: 1; justify-self: start; width: min(100%, 22rem); }
  .trades { grid-template-columns: 1fr; gap: 2rem; }
}
