/* Jack of Most Trades · Micah Rauch
   Colors and type come straight from the Design handoff README. */

:root {
  --navy: #14213d;
  --red: #b31b1b;
  --blue: #1d4f9c;
  --deep-blue: #1d3a7a;
  --gold: #f5b400;
  --light-gold: #ffd166;
  --page: #f3f2ef;
  --cream: #f4efe4;
  --muted: #8a8f9c;
  --body-gray: #3b4560;
  --on-navy: #c8cddb;
  --pink: #ffe3e5;
  --border: #d9d2c3;
  --hairline: #e9e2d2;
  --input-bg: #fbf9f4;
  --footer-text: #b8bfd0;
  --footer-red: #e0443f;

  --serif: 'Libre Baskerville', Georgia, serif;
  --sans: 'Libre Franklin', system-ui, sans-serif;
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

html, body {
  margin: 0;
  padding: 0;
  overflow-x: clip; /* the Jack bleeds off the right edge */
  background: var(--page);
  color: var(--navy);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

.page {
  min-height: 100vh;
  background: var(--page) radial-gradient(rgba(20, 33, 61, 0.06) 1px, transparent 1px);
  background-size: 22px 22px;
  line-height: 1.5;
}

a { color: var(--navy); text-decoration: none; }
input, textarea, button { font-family: inherit; }

:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.band-navy :focus-visible, .band-red :focus-visible { outline-color: var(--light-gold); }

h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.01em;
}
h3 { margin: 0; }
p { margin: 0; }

.red { color: var(--red); }
.navy { color: var(--navy); }
.blue { color: var(--blue); }
.gold { color: var(--gold); }

.eyebrow {
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--blue);
}
.eyebrow.gold { color: var(--gold); }
.eyebrow.light-gold { color: var(--light-gold); }

.wrap { max-width: 1120px; margin: 0 auto; }
.section-pad { padding: 88px 24px; }
.rel { position: relative; }
.narrow { max-width: 640px; }
.stack-12 { display: flex; flex-direction: column; gap: 12px; }
.stack-20 { display: flex; flex-direction: column; gap: 20px; }
.stack-44 { display: flex; flex-direction: column; gap: 44px; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: transform .2s, background .2s;
}
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: var(--navy); color: #fff; transform: translateY(-2px); }
.btn-outline { color: var(--navy); border: 1.5px solid var(--navy); }
.btn-outline:hover { background: #fff; }
.btn-navy { align-self: flex-start; background: var(--navy); color: #fff; border: 0; }
.btn-navy:hover { background: var(--blue); }

/* ---------- Nav ---------- */

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 22px 24px;
  flex-wrap: wrap;
}
.brand { display: flex; flex-direction: column; gap: 3px; color: var(--navy); }
.brand-name {
  font-family: var(--serif);
  font-size: 24px;
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.brand-sub {
  display: flex;
  gap: 7px;
  align-items: center;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--blue);
  line-height: 1;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
  font-size: 14px;
  font-weight: 500;
  flex-wrap: wrap;
}
.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  background: var(--navy);
  padding: 8px 16px;
  border-radius: 999px;
  transition: background .2s;
}
.nav-cta:hover { background: var(--red); }

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

.hero {
  position: relative;
  z-index: 2; /* Jack's arm overlaps the next section */
  max-width: 1120px;
  margin: 0 auto;
  padding: 48px 24px 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px 48px;
  align-items: center;
}
.hero-copy { display: flex; flex-direction: column; gap: 28px; padding-bottom: 80px; }
.hero-title { margin: 0; width: 100%; max-width: 700px; line-height: 0; }
.hero-title svg { display: block; overflow: visible; }
.t-serif { font-family: var(--serif); font-size: 78px; font-weight: 400; letter-spacing: -0.5px; }
.t-hand { font-family: 'Kalam', cursive; font-size: 62px; font-weight: 400; fill: var(--red); }
.lede { font-size: 19px; max-width: 560px; color: var(--body-gray); text-wrap: pretty; }
.hero-buttons { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }

/* The Jack rig: every piece shares an 850×1100 canvas. */
.jack {
  position: relative;
  width: min(560px, 118%);
  aspect-ratio: 850 / 847;
  justify-self: end;
  align-self: end;
  margin-right: min(0px, -10%);
  transform: scaleX(-1); /* artwork is mirrored so he faces the copy */
  pointer-events: none;
  user-select: none;
}
.jack-clip { position: absolute; top: -600px; left: 0; right: 0; bottom: 0; overflow: hidden; }
.jack-root {
  position: absolute;
  top: 600px;
  left: 0;
  width: 100%;
  aspect-ratio: 850 / 1100;
  will-change: transform;
  visibility: hidden;
}
.jack.is-shown .jack-root { visibility: visible; }
.jack img, .jack-layer { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.jack-layer { will-change: transform; }
.jack-layer.is-hidden { visibility: hidden; }
.jack-arm { transform-origin: 1.3% 61.2%; }   /* elbow (11, 673) */
.jack-hand { transform-origin: 36.6% 85.5%; } /* wrist (311, 940) */

/* ---------- The hand (cards) ---------- */

.band-navy { background: var(--navy); color: var(--cream); padding: 88px 24px; }
/* Intro sits under the title, on the left, so Jack's arm can hang over the empty right side. */
.split-head { display: flex; flex-direction: column; gap: 16px; }
.hand-intro { font-size: 17px; max-width: 560px; color: var(--on-navy); text-wrap: pretty; }

.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 22px;
}
.card { perspective: 1000px; aspect-ratio: 436 / 612; }
.card-inner {
  all: unset;
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform .55s cubic-bezier(.2, .7, .2, 1);
  border-radius: 14px;
}
.card-inner[aria-pressed="true"] { transform: rotateY(180deg); }
@media (any-hover: hover) {
  .card:hover .card-inner { transform: rotateY(180deg); }
}
.card-inner:focus-visible { outline: 2px solid var(--light-gold); outline-offset: 4px; }

.card-back, .card-front {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background: #fff;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  box-shadow: 0 18px 40px -20px rgba(0, 0, 0, .6);
}
.card-back { padding: 6px; }
.card-back-art {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-radius: 9px;
  overflow: hidden;
  background: url(assets/back-navy.svg) center / cover;
}
/* Backs alternate navy/red by position, independent of the suit on the front. */
.card:nth-child(even) .card-back-art { background-image: url(assets/back-red.svg); }
.card-back-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 66%;
  margin-bottom: -10px;
  text-align: center;
  color: #fff;
}
.card-name {
  font-family: 'Federo', serif;
  font-size: clamp(17px, 1.5vw, 22px);
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  text-wrap: balance;
}
.card-hint { font-family: 'Federo', serif; font-size: 11px; letter-spacing: 0.08em; opacity: .9; }

.card-front {
  transform: rotateY(180deg);
  color: var(--navy);
  padding: 18px 18px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
}
.card-top, .card-bottom { display: flex; justify-content: space-between; }
.card-top { align-items: flex-start; }
.card-bottom { align-items: flex-end; }
.pip {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: 'Hanuman', serif;
  font-weight: 700;
  font-size: 30px;
  line-height: .95;
  color: var(--navy);
}
.card[data-suit="red"] .pip { color: var(--red); }
.pip-suit { font-size: 24px; line-height: 1; }
.pip-flip { transform: rotate(180deg); }
.card-era, .card-label {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--muted);
}
.card-label { font-size: 10px; }
#cards { --proof-max: 14; }
.card-proof { font-size: var(--proof-size, 14px); line-height: 1.4; color: var(--deep-blue); text-wrap: pretty; }

/* ---------- How I work ---------- */

.how { position: relative; overflow: hidden; }
.rings {
  position: absolute;
  right: -12vw;
  top: 50%;
  width: clamp(520px, 68vw, 1100px);
  aspect-ratio: 1;
  transform: translateY(-50%);
  pointer-events: none;
}
.rings img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  animation-name: ringspin;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}
.rings img.rev { animation-direction: reverse; }
@keyframes ringspin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .rings img { animation: none; } }

.grid-280 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 22px; }
.grid-300 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 22px; }

.panel {
  margin: 0;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.lift { transition: transform .25s, box-shadow .25s; }
.lift:hover { transform: translateY(-4px); box-shadow: 0 24px 40px -24px rgba(20, 33, 61, .4); }
.panel-top { display: flex; justify-content: space-between; align-items: center; }
.kicker { font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; font-weight: 600; color: var(--muted); }
.glyph { font-size: 22px; }
.panel h3 { font-family: var(--serif); font-weight: 400; font-size: 28px; line-height: 1.1; }
.panel > p { font-size: 16px; color: var(--body-gray); text-wrap: pretty; }

/* ---------- Timeline ---------- */

.band-white {
  background: #fff;
  border-top: 1.5px solid var(--border);
  border-bottom: 1.5px solid var(--border);
  padding: 88px 24px;
}
.timeline-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.6fr); gap: 48px; }
.timeline-head { align-self: start; position: sticky; top: 24px; }
.muted-16 { font-size: 16px; color: var(--body-gray); }
.jobs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.jobs li {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 20px;
  padding: 22px 0;
  border-top: 1px solid var(--hairline);
}
.job-when { display: flex; flex-direction: column; gap: 4px; font-size: 18px; }
.job-years { font-family: var(--serif); font-size: 20px; line-height: 1; color: var(--navy); }
.job-what { display: flex; flex-direction: column; gap: 6px; }
.job-what h3 { font-size: 18px; font-weight: 600; line-height: 1.25; }
.job-what h3 span { color: var(--muted); font-weight: 400; }
.job-what p { font-size: 15px; color: var(--body-gray); text-wrap: pretty; }

/* ---------- Testimonials ---------- */

.quote { gap: 18px; }
.quote-mark { font-family: var(--serif); font-size: 56px; line-height: .6; }
.quote p { font-size: 17px; line-height: 1.5; color: var(--navy); text-wrap: pretty; }
.quote footer { font-size: 14px; color: var(--body-gray); }

/* ---------- Contact ---------- */

.band-red { background: var(--red); color: #fff; padding: 88px 24px; }
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}
.contact-title { font-size: clamp(36px, 4.6vw, 60px); line-height: 1.02; text-wrap: balance; }
.contact-intro { font-size: 17px; color: var(--pink); text-wrap: pretty; }
.contact-links { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; font-size: 17px; }
.contact-links a {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  color: #fff;
  font-weight: 600;
  overflow-wrap: anywhere;
  transition: color .2s;
}
.contact-links a:hover { color: var(--light-gold); }
.contact-links a span { color: var(--light-gold); }

.contact-form {
  background: #fff;
  color: var(--navy);
  border-radius: 18px;
  padding: 30px;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .5);
}
.form-fields { display: flex; flex-direction: column; gap: 16px; }
.form-fields label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.form-fields input, .form-fields textarea {
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 16px;
  color: var(--navy);
  background: var(--input-bg);
  letter-spacing: normal;
  font-weight: 400;
}
.form-fields textarea { resize: vertical; }
.form-fields input:focus, .form-fields textarea:focus { outline: none; border-color: var(--blue); }
.botcheck { display: none; }
.form-error { font-size: 14px; color: var(--red); }
.form-sent { display: flex; flex-direction: column; gap: 10px; padding: 20px 0; text-align: center; }
.form-sent[hidden], .form-fields[hidden], .form-error[hidden] { display: none; }
.sent-heart { font-size: 44px; color: var(--red); line-height: 1.2; }
.form-sent p { font-family: var(--serif); font-size: 26px; font-weight: 400; }

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

.site-footer { background: var(--navy); color: var(--footer-text); }
.footer-inner {
  padding: 28px 24px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
}
.footer-suits { display: flex; gap: 10px; color: #fff; }
.footer-suits .fred { color: var(--footer-red); }

/* ---------- Narrow screens ---------- */

@media (max-width: 760px) {
  /* Phones: brand on the left, only the "Deal me in" button on the right. */
  .nav { flex-wrap: nowrap; gap: 12px; }
  .nav-links a:not(.nav-cta) { display: none; }
  .nav-links { flex-shrink: 0; }
  .nav-cta { white-space: nowrap; font-size: 13px; padding: 8px 12px; }
  .brand-sub { gap: 5px; letter-spacing: 0.1em; }
  .contact-grid, .timeline-grid { grid-template-columns: minmax(0, 1fr); }
  .timeline-head { position: static; }
  /* Bigger rings on phones, centered near the right edge and a bit low. */
  .rings { width: 1000px; right: auto; left: 99%; transform: translate(-50%, -30%); }
}
@media (max-width: 993px) and (min-width: 557px) {
  /* Two cards per row instead of three, so card copy stays readable. */
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 556px) {
  /* Below this, two cards per row get too narrow for the copy: one per row. */
  .cards { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 695px) {
  /* Hero is one column here: Jack sits under the buttons. */
  .hero { row-gap: 0; }
  .hero-copy { padding-bottom: 32px; }
  /* Jack is full width here, so his arm hangs lower: about 30% of his width, plus a little room. */
  #hand { padding-top: calc(min(560px, 1.18 * (100vw - 48px)) * 0.3 + 8px); }
}
@media (max-width: 480px) {
  .nav-links { gap: 14px 18px; }
  .hero-buttons { gap: 10px; flex-wrap: nowrap; }
  .hero-buttons .btn { padding: 12px 15px; font-size: 14px; gap: 8px; white-space: nowrap; }
  .btn-extra { display: none; } /* "(PDF)" drops on phones so both buttons fit on one line */
  .jobs li { grid-template-columns: 1fr; gap: 8px; }
  .job-when { flex-direction: row; align-items: center; gap: 10px; }
  .contact-form, .panel { padding: 24px; }
}
@media (max-width: 993px) {
  /* One or two cards per row: the cards are big, so the type grows with them. */
  #cards { --proof-max: 17; }
  .card-back { container-type: inline-size; }
  .card-back-text { width: 80%; }
  .card-name { font-size: min(30px, 9.5cqi); } /* 30px on big cards; scales with the card so "DEVELOPMENT" always fits */
  .card-hint { font-size: 16px; }
}
@media (max-width: 359px) {
  .brand-sub { display: none; }
  .brand-name { font-size: 22px; }
  .hero-buttons { flex-wrap: wrap; }
}
