/* =========================================================
   James Cook — portfolio
   Dark grey + signal yellow
   ========================================================= */

:root {
  --bg: #1b1b1c;
  --bg-raise: #232324;
  --bg-sink: #151516;
  --panel: #2a2a2b;
  --line: #373738;
  --line-soft: #2e2e2f;

  --text: #ebe9e4;
  --text-soft: #b9b6b0;
  --muted: #85837f;

  --yellow: #f2c230;
  --yellow-hi: #ffd456;
  --yellow-ink: #1a1813;

  --display: "Big Shoulders Display", "Arial Narrow", sans-serif;
  --body: "Barlow", "Helvetica Neue", sans-serif;

  --gutter: clamp(20px, 5vw, 72px);
  --max: 1360px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* faint film grain, fixed so it never repaints on scroll */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

::selection { background: var(--yellow); color: var(--yellow-ink); }

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

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 800;
  text-transform: uppercase;
  line-height: .92;
  letter-spacing: .005em;
  margin: 0;
}

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--yellow);
  color: var(--yellow-ink);
  padding: 8px 14px;
  z-index: 200;
  font-weight: 600;
}
.skip:focus { left: 8px; }

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 68px;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(27, 27, 28, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  background: var(--yellow);
  color: var(--yellow-ink);
  font: 900 17px/1 var(--display);
  letter-spacing: .02em;
  clip-path: polygon(0 0, 100% 0, 100% 72%, 72% 100%, 0 100%);
}

.brand-name {
  font: 700 19px/1 var(--display);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 36px);
  font-size: 15px;
  font-weight: 500;
}

.site-header nav a {
  color: var(--text-soft);
  position: relative;
  padding: 4px 0;
  transition: color .2s;
}

.site-header nav a:not(.nav-contact)::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: var(--yellow);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}

.site-header nav a:hover { color: var(--text); }
.site-header nav a:hover::after { transform: scaleX(1); }

.site-header nav .nav-contact {
  color: var(--yellow-ink);
  background: var(--yellow);
  padding: 8px 16px;
  font-weight: 600;
  transition: background .2s;
}
.site-header nav .nav-contact:hover { background: var(--yellow-hi); color: var(--yellow-ink); }

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  font: 700 17px/1 var(--display);
  text-transform: uppercase;
  letter-spacing: .08em;
  border: 2px solid transparent;
  transition: transform .18s ease, background .2s, color .2s, border-color .2s;
}
.btn:active { transform: translateY(1px); }

.btn-solid { background: var(--yellow); color: var(--yellow-ink); }
.btn-solid:hover { background: var(--yellow-hi); }

.btn-line { border-color: var(--line); color: var(--text); }
.btn-line:hover { border-color: var(--yellow); color: var(--yellow); }

.btn-dark { background: var(--yellow-ink); color: var(--yellow); }
.btn-dark:hover { background: #2b281f; }

.inline-link {
  display: inline-block;
  margin-top: 10px;
  font-weight: 600;
  color: var(--yellow);
  border-bottom: 2px solid currentColor;
  padding-bottom: 2px;
  transition: color .2s;
}
.inline-link:hover { color: var(--yellow-hi); }

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

.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(56px, 9vw, 120px) var(--gutter) clamp(64px, 8vw, 110px);
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: center;
}

.hero-kicker {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 14px;
  letter-spacing: .04em;
}

.hero h1 {
  font-size: clamp(88px, 15vw, 210px);
  font-weight: 900;
  line-height: .8;
  letter-spacing: -.01em;
}

.role {
  display: inline-block;
  margin: 26px 0 0;
  padding: 6px 12px 5px;
  background: var(--yellow);
  color: var(--yellow-ink);
  font: 800 clamp(20px, 2.2vw, 26px)/1 var(--display);
  text-transform: uppercase;
  letter-spacing: .06em;
  transform: rotate(-1.5deg);
}

.intro {
  max-width: 470px;
  margin: 28px 0 0;
  color: var(--text-soft);
  font-size: 18px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.hero-tags {
  list-style: none;
  padding: 0;
  margin: 46px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-tags li {
  font-size: 14px;
  color: var(--text-soft);
  border: 1px solid var(--line);
  padding: 5px 12px;
}

.hero-portrait {
  margin: 0;
  justify-self: end;
  width: min(100%, 380px);
}

.portrait-frame {
  position: relative;
  transform: rotate(1.8deg);
  transition: transform .5s cubic-bezier(.2, .7, .2, 1);
}

.portrait-frame::before {
  content: "";
  position: absolute;
  inset: 18px -18px -18px 18px;
  background: var(--yellow);
  z-index: -1;
}

.hero-portrait:hover .portrait-frame { transform: rotate(0deg); }

.portrait-frame img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: var(--panel);
}

.hero-portrait figcaption {
  margin-top: 34px;
  font-size: 14px;
  color: var(--muted);
}

/* page-load stagger */
.js .hero-copy > *,
.js .hero-portrait {
  opacity: 0;
  transform: translateY(18px);
  animation: rise .7s cubic-bezier(.2, .7, .2, 1) forwards;
}
.js .hero-copy > :nth-child(1) { animation-delay: .05s; }
.js .hero-copy > :nth-child(2) { animation-delay: .12s; }
.js .hero-copy > :nth-child(3) { animation-delay: .24s; }
.js .hero-copy > :nth-child(4) { animation-delay: .32s; }
.js .hero-copy > :nth-child(5) { animation-delay: .40s; }
.js .hero-copy > :nth-child(6) { animation-delay: .48s; }
.js .hero-portrait { animation-delay: .3s; }

@keyframes rise {
  to { opacity: 1; transform: none; }
}

/* the role badge keeps its tilt after rising */
.js .hero-copy > .role { animation-name: rise-tilt; }
@keyframes rise-tilt {
  to { opacity: 1; transform: rotate(-1.5deg); }
}

/* ---------- Section heads ---------- */

.block-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 380px);
  gap: 32px;
  align-items: end;
  padding-bottom: 26px;
  margin-bottom: 44px;
  border-bottom: 1px solid var(--line);
}

.block-head h2 {
  font-size: clamp(52px, 7vw, 96px);
}

.block-head p {
  margin: 0;
  color: var(--text-soft);
  font-size: 16px;
}

/* ---------- Work ---------- */

.work,
.experience {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(64px, 8vw, 110px) var(--gutter);
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(36px, 4vw, 56px) clamp(18px, 2.4vw, 32px);
}

.card { grid-column: span 6; min-width: 0; }
.card-feature { grid-column: 1 / -1; }
.card-wide { grid-column: span 7; }
.card-narrow { grid-column: span 5; }
.card-row { grid-column: 1 / -1; }

.card-link { display: block; }

.card-img {
  position: relative;
  overflow: hidden;
  background: var(--panel);
  aspect-ratio: 16 / 10;
}

.card-img::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 0 solid var(--yellow);
  transition: border-width .2s ease;
  pointer-events: none;
}

.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .7s cubic-bezier(.2, .7, .2, 1), filter .4s;
  filter: saturate(.92);
}

.card-link:hover .card-img img,
.card-link:focus-visible .card-img img {
  transform: scale(1.04);
  filter: saturate(1.05);
}

.card-link:hover .card-img::after,
.card-link:focus-visible .card-img::after { border-width: 4px; }

.card-body { padding-top: 18px; }

.card-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--muted);
}

.card-meta span:first-child {
  color: var(--yellow);
  font-weight: 600;
}

.card h3 {
  font-size: clamp(28px, 2.8vw, 38px);
  transition: color .2s;
}

.card-link:hover h3 { color: var(--yellow); }

.card-desc {
  margin: 12px 0 0;
  max-width: 62ch;
  color: var(--text-soft);
  font-size: 16px;
}

/* feature: image dominant, text panel tucked over its corner */
.card-feature .card-link {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: end;
}

.card-feature .card-img {
  grid-column: 1 / 10;
  grid-row: 1;
  aspect-ratio: 16 / 9;
}

.card-feature .card-body {
  grid-column: 8 / -1;
  grid-row: 1;
  position: relative;
  z-index: 2;
  background: var(--bg-raise);
  border-top: 4px solid var(--yellow);
  padding: 28px 30px 30px;
  margin-bottom: -36px;
  box-shadow: 0 24px 50px -20px rgba(0, 0, 0, .55);
}

.card-feature h3 { font-size: clamp(36px, 4vw, 56px); }

.card-cta {
  display: inline-block;
  margin-top: 18px;
  font: 700 16px/1 var(--display);
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--yellow);
}
.card-cta::after { content: " \2192"; transition: margin .2s; }
.card-link:hover .card-cta::after { margin-left: 6px; }

.card-feature + .card { margin-top: 36px; }
.card-feature + .card + .card { margin-top: 36px; }

/* offset the narrow column for a staggered rhythm */
.card-narrow:nth-child(3) { padding-top: 64px; }

/* last item: horizontal layout */
.card-row .card-link {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(18px, 2.4vw, 32px);
  align-items: center;
}
.card-row .card-img { grid-column: 1 / 8; }
.card-row .card-body { grid-column: 8 / -1; padding-top: 0; }

/* ---------- About ---------- */

.about {
  background: var(--bg-raise);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  position: relative;
  overflow: hidden;
}

.about::before {
  /* hazard stripe strip along the top */
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 8px;
  background: repeating-linear-gradient(-45deg, var(--yellow) 0 14px, var(--bg-raise) 14px 28px);
  opacity: .85;
}

.about-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(72px, 9vw, 130px) var(--gutter);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: clamp(36px, 7vw, 110px);
  align-items: start;
}

.about-title {
  font-size: clamp(56px, 7.4vw, 108px);
}

.about-title em {
  font-style: normal;
  color: var(--yellow);
  display: block;
}

.about-copy p {
  margin: 0 0 18px;
  color: var(--text-soft);
}

.about-copy .about-lead {
  font-size: 22px;
  line-height: 1.45;
  color: var(--text);
  font-weight: 500;
  margin-bottom: 24px;
}

/* ---------- Skills ---------- */

.skills {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: skill;
}

.skill {
  counter-increment: skill;
  display: grid;
  grid-template-columns: 90px minmax(0, 340px) minmax(0, 1fr);
  gap: 24px;
  align-items: baseline;
  padding: 30px 0;
  border-bottom: 1px solid var(--line-soft);
  transition: background .25s, padding .25s;
}

.skill::before {
  content: counter(skill, decimal-leading-zero);
  font: 800 40px/1 var(--display);
  color: transparent;
  -webkit-text-stroke: 1px var(--muted);
  transition: color .25s, -webkit-text-stroke-color .25s;
}

.skill:hover::before {
  color: var(--yellow);
  -webkit-text-stroke-color: var(--yellow);
}

.skill h3 { font-size: clamp(28px, 2.6vw, 36px); }

.skill p {
  margin: 0;
  color: var(--text-soft);
  max-width: 60ch;
}

.toolbelt {
  margin: 34px 0 0;
  color: var(--text-soft);
  font-size: 15px;
}

.toolbelt span {
  color: var(--muted);
  margin-right: 12px;
}

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

.contact {
  background: var(--yellow);
  color: var(--yellow-ink);
  position: relative;
  overflow: hidden;
}

.contact::after {
  content: "JC";
  position: absolute;
  right: -2vw;
  bottom: -9vw;
  font: 900 clamp(200px, 34vw, 520px)/1 var(--display);
  color: rgba(26, 24, 19, .07);
  pointer-events: none;
}

.contact-inner {
  position: relative;
  z-index: 1;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(72px, 9vw, 120px) var(--gutter);
}

.contact-kicker {
  margin: 0 0 16px;
  font-weight: 600;
  font-size: 15px;
}

.contact h2 {
  font-size: clamp(60px, 9vw, 140px);
  max-width: 11ch;
}

.contact-text {
  max-width: 440px;
  margin: 26px 0 30px;
  font-size: 18px;
}

.contact-email {
  display: block;
  width: fit-content;
  margin-bottom: 30px;
  font: 700 clamp(24px, 3.4vw, 44px)/1.1 var(--display);
  text-transform: none;
  letter-spacing: .01em;
  border-bottom: 3px solid currentColor;
  overflow-wrap: anywhere;
}
.contact-email:hover { opacity: .75; }

.contact :focus-visible { outline-color: var(--yellow-ink); }

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

.site-footer {
  padding: 28px var(--gutter);
  display: flex;
  align-items: center;
  gap: 24px;
  background: var(--bg-sink);
  color: var(--muted);
  font-size: 14px;
}

.site-footer p { margin: 0; }
.site-footer p:nth-of-type(2) { margin-left: auto; }

.back-top { color: var(--text-soft); transition: color .2s; }
.back-top:hover { color: var(--yellow); }

/* ---------- Scroll reveal ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1);
}
.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; }
  .hero-portrait { justify-self: start; width: min(72%, 320px); margin-left: 6px; }

  .card-feature .card-img { grid-column: 1 / -1; }
  .card-feature .card-body { grid-column: 2 / -1; grid-row: 2; margin: -60px 0 0; }

  .card-wide,
  .card-narrow { grid-column: span 6; }
  .card-narrow:nth-child(3) { padding-top: 0; }

  .about-inner { grid-template-columns: 1fr; }

  .skill { grid-template-columns: 70px minmax(0, 1fr); }
  .skill p { grid-column: 2; }
}

@media (max-width: 680px) {
  body { font-size: 16px; }

  .brand-name { display: none; }
  .site-header nav { gap: 18px; font-size: 14px; }
  .site-header nav a[href="#experience"] { display: none; }

  .block-head { grid-template-columns: 1fr; gap: 14px; }

  .work-grid { grid-template-columns: 1fr; }
  .card,
  .card-wide,
  .card-narrow,
  .card-feature,
  .card-row { grid-column: 1 / -1; }
  .card-feature + .card,
  .card-feature + .card + .card { margin-top: 0; }

  .card-feature .card-link,
  .card-row .card-link { display: block; }
  .card-feature .card-body { margin: -28px 0 0 18px; padding: 22px 20px 24px; }
  .card-row .card-body { padding-top: 18px; }

  .skill { grid-template-columns: 1fr; gap: 10px; }
  .skill p { grid-column: 1; }
  .skill::before { font-size: 30px; }

  .site-footer { flex-wrap: wrap; gap: 12px 20px; }
  .site-footer p:nth-of-type(2) { margin-left: 0; width: 100%; order: 5; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .js .hero-copy > *,
  .js .hero-portrait,
  .js .reveal { opacity: 1; transform: none; }
  .js .hero-copy > .role { transform: rotate(-1.5deg); }
}
