/* James Bell — compact, motion-led portfolio. No external dependencies. */
:root {
  color-scheme: light;
  --ink: #18211f;
  --muted: #626b67;
  --accent: #206855;
  --line: #c2d0c7;
  --paper: #e7ece7;
  --gutter: clamp(24px, 5vw, 80px);
  --card-width: 318px;
  --card-gap: 22px;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Helvetica, Arial, sans-serif;
  font-size: 16px;
  color: var(--ink);
  background-color: var(--paper);
  background-image: linear-gradient(135deg, #e2e9e3 0%, #eff1ec 48%, #dde6e1 100%);
  background-size: cover;
  background-attachment: fixed;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: transparent;
}
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 5px; }
[hidden] { display: none !important; }
p { margin: 0; line-height: 1.65; }
.shell { width: min(100% - var(--gutter) * 2, 1320px); margin-inline: auto; }
.site-header { min-height: 96px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); }
.name { font-size: 23px; font-weight: 650; letter-spacing: -.8px; white-space: nowrap; }
.name > span { color: var(--accent); }
.site-header nav { display: flex; align-items: center; gap: 30px; font-size: .875rem; }
.site-header nav a { padding-block: 10px; }
.site-header nav a[aria-current] { text-decoration: underline; text-underline-offset: 7px; text-decoration-color: var(--accent); }
.site-header nav a:hover, .site-footer a:hover { color: var(--accent); }
.site-header nav .resume-link { display: inline-flex; gap: 22px; align-items: center; padding: 10px 17px; border: 1px solid #c5cec9; border-radius: 4px; }
main { outline: none; }
.intro { display: grid; grid-template-columns: minmax(0, 1fr) 460px; gap: 40px; align-items: start; padding-block: 53px 43px; }
.eyebrow, .meta { font-size: .75rem; letter-spacing: .075em; text-transform: uppercase; font-weight: 600; color: var(--muted); margin-bottom: 21px; }
h1, h2, h3 { margin: 0; }
.intro h1 { font-size: clamp(2.4rem, 4.5vw, 4.4rem); letter-spacing: -.055em; line-height: 1.09; font-weight: 550; }
.intro h1 span { color: var(--accent); }
.intro-note { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 22px; align-items: start; padding-bottom: 2px; }
.headshot { display: block; width: 120px; height: 144px; overflow: hidden; border-radius: 10px; box-shadow: 0 5px 18px #18211f12; }
.headshot img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center top; transform: scale(1.4); transform-origin: 55% 18%; }
.intro-bio > p:first-child { font-size: 1rem; line-height: 1.6; }
.availability { margin-top: 13px; font-size: .875rem; color: var(--muted); }
.text-link { display: inline-flex; gap: 24px; align-items: center; margin-top: 17px; padding-bottom: 4px; font-size: .875rem; font-weight: 600; border-bottom: 1px solid var(--ink); }
.work-section { padding-top: 5px; }
.work-heading, .work-label, .carousel-controls { display: flex; align-items: center; }
.work-heading { justify-content: space-between; gap: 20px; }
.work-label { gap: 12px; }
.work-label h2 { font-size: 1rem; font-weight: 600; }
.work-count { color: var(--muted); font-size: .75rem; border-left: 1px solid var(--line); padding-left: 12px; }
.carousel-controls { gap: 8px; }
.interaction-hint { font-size: .75rem; color: var(--muted); margin-right: 18px; }
.motion-toggle, .arrow-button { display: inline-flex; justify-content: center; align-items: center; height: 36px; background: transparent; border: 1px solid var(--line); border-radius: 50%; }
.arrow-button { width: 36px; font-size: 1.125rem; }
.motion-toggle { padding-inline: 12px; gap: 8px; border-radius: 20px; font-size: .75rem; }
.motion-symbol { width: 12px; }
.motion-toggle:hover, .arrow-button:hover { background: var(--ink); color: white; border-color: var(--ink); }
.carousel { overflow-x: auto; padding: 30px var(--gutter) 25px; scrollbar-width: thin; position: relative; }
.carousel.is-looping { overflow: hidden; }
.carousel-track { display: flex; width: max-content; }
.is-looping .carousel-track { will-change: transform; }
.project-group { display: flex; flex-shrink: 0; gap: var(--card-gap); padding-right: var(--card-gap); }
.project-card { display: block; width: var(--card-width); flex: 0 0 var(--card-width); position: relative; transform-origin: center; transition: transform .38s cubic-bezier(.22,.7,.22,1); border-radius: 8px; }
.card-visual { height: 280px; position: relative; overflow: hidden; border-radius: 8px; background: #273c37; box-shadow: 0 4px 10px #17251c0b; isolation: isolate; }
.card-visual::after { content: ""; position: absolute; inset: 0; z-index: 0; background: linear-gradient(180deg, #0006 0%, transparent 35%, #0003 50%, #07120ded 100%); }
.card-visual img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .65s cubic-bezier(.2,.7,.2,1); }
.qrate img { object-position: 50% 60%; }
.receiptme img { object-position: 35% 50%; }
.direct-coil img { object-position: 34% 50%; }
.card-type { position: absolute; top: 19px; left: 20px; z-index: 1; font-size: .75rem; font-weight: 500; color: white; text-shadow: 0 1px 8px #000; }
.card-caption { position: absolute; bottom: 22px; left: 22px; right: 22px; color: white; z-index: 1; }
.card-caption h3 { font-size: 2rem; letter-spacing: -.045em; line-height: 1.1; font-weight: 550; }
.card-caption p { font-size: .875rem; line-height: 1.5; margin-top: 11px; max-height: 0; opacity: 0; overflow: hidden; transform: translateY(7px); transition: max-height .38s ease, opacity .3s, transform .38s; }
.card-cta { display: block; font-size: .75rem; font-weight: 600; max-height: 0; opacity: 0; overflow: hidden; transition: max-height .38s ease, opacity .3s, margin .38s; }
.card-cta > span { margin-left: 8px; }
.card-foot { display: flex; justify-content: space-between; gap: 6px; font-size: .75rem; color: var(--muted); padding: 13px 2px 0; }
.project-card:focus-visible { z-index: 3; transform: translateY(-5px) scale(1.065); outline-offset: 8px; }
.project-card:focus-visible .card-caption p { max-height: 110px; opacity: 1; transform: none; }
.project-card:focus-visible .card-cta { max-height: 24px; margin-top: 14px; opacity: 1; }
.work-bottom { display: flex; justify-content: space-between; gap: 20px; color: var(--muted); font-size: .75rem; padding-block: 3px 37px; }
.swipe-hint { display: none; white-space: nowrap; }
.site-footer { padding-block: 24px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 20px; font-size: .875rem; }
.site-footer p { font-weight: 550; }
.site-footer p span { font-weight: 400; color: var(--muted); margin-left: 20px; font-size: .75rem; }
.site-footer > div { display: flex; gap: 25px; }
.skip { position: fixed; top: 8px; left: 8px; z-index: 10; padding: 12px; background: white; transform: translateY(-200%); }
.skip:focus { transform: none; }
/* Project views */
.detail { padding-top: 33px; }
.back { font-size: .875rem; color: var(--muted); display: inline-block; padding-block: 5px; }
.back:hover { color: var(--accent); }
.detail-heading { margin-block: 32px; }
.detail-heading .meta { margin-bottom: 13px; }
.detail-heading h1 { font-size: clamp(2.5rem, 5vw, 4.5rem); font-weight: 550; line-height: 1.1; letter-spacing: -.055em; }
.detail-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 65px; align-items: start; }
figure { margin: 0; }
.project-hero { display: block; width: 100%; aspect-ratio: 1.24; object-fit: cover; border-radius: 8px; }
figcaption { font-size: .75rem; line-height: 1.6; color: var(--muted); margin-top: 10px; }
.detail-copy { max-width: 560px; }
.detail-copy h2 { font-size: .75rem; text-transform: uppercase; letter-spacing: .085em; margin: 28px 0 10px; }
.detail-copy h2:first-child { margin-top: 0; }
.detail-copy p, .detail-copy li { font-size: 1rem; color: #4c5751; line-height: 1.7; }
.detail-copy p { margin-bottom: 16px; }
.detail-copy .intro { display: block; padding: 0; color: var(--ink); font-size: 1.25rem; line-height: 1.5; }
.detail-copy ul { padding-left: 18px; margin: 0; }
.detail-copy li { padding-left: 5px; margin-bottom: 10px; }
.next-project { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); margin-top: 40px; padding-block: 24px 32px; }
.next-project > span { color: var(--muted); font-size: .875rem; }
.next-project strong { font-size: 1.3rem; font-weight: 550; }
.contact-copy { padding-bottom: 40px; }
.detail-copy .contact-email { color: var(--ink); font-size: clamp(1.1rem, 4vw, 1.5rem); overflow-wrap: anywhere; user-select: all; }
.contact-button { padding: 12px 18px; border: 1px solid var(--accent); border-radius: 4px; background: var(--accent); color: white; }
.contact-button:hover { background: var(--ink); border-color: var(--ink); }
.detail-copy .contact-status { min-height: 1.7em; margin-top: 8px; font-size: .875rem; }
.contact-link { text-decoration: underline; text-underline-offset: 4px; }
@media (hover: hover) and (pointer: fine) {
  .project-card:hover { transform: translateY(-5px) scale(1.065); z-index: 3; }
  .project-card:hover .card-visual { box-shadow: 0 16px 24px #16271d26; }
  .project-card:hover img, .project-card:focus-visible img { transform: scale(1.08); }
  .project-card:hover .card-caption p { max-height: 110px; opacity: 1; transform: none; }
  .project-card:hover .card-cta { max-height: 24px; margin-top: 14px; opacity: 1; }
}
@media (min-width: 1600px) { .carousel { padding-inline: calc((100vw - 1320px) / 2); } }
@media (max-width: 1100px) {
  .intro { grid-template-columns: minmax(0, 1fr) 340px; gap: 30px; }
  .intro-note { grid-template-columns: 88px minmax(0, 1fr); gap: 18px; }
  .headshot { width: 88px; height: 106px; }
  .intro h1 { font-size: 3.1rem; }
  .detail-grid { gap: 35px; }
}
@media (max-width: 760px) {
  :root { --card-width: 290px; --card-gap: 16px; }
  .site-header { min-height: 78px; gap: 16px; }
  .name { font-size: 20px; }
  .site-header nav { gap: 18px; font-size: .875rem; }
  .site-header nav .resume-link { padding: 8px 11px; gap: 10px; }
  .intro { display: block; padding-block: 37px 31px; }
  .intro h1 { font-size: clamp(2.3rem, 6.8vw, 3.3rem); }
  .eyebrow { font-size: .75rem; margin-bottom: 17px; }
  .intro-note { margin-top: 23px; max-width: 520px; }
  .availability { margin-top: 9px; }
  .text-link { margin-top: 12px; }
  .interaction-hint, .desktop-hint { display: none; }
  .carousel { padding-top: 22px; padding-bottom: 18px; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter); }
  .project-card { scroll-snap-align: start; }
  .card-visual { height: 270px; }
  .card-caption p { max-height: none; opacity: 1; transform: none; }
  .card-cta { max-height: none; opacity: 1; margin-top: 11px; }
  .card-caption h3 { font-size: 1.8rem; }
  .swipe-hint { display: inline; }
  .work-bottom { padding-bottom: 26px; }
  .site-footer { align-items: flex-start; }
  .site-footer p span { display: block; margin: 4px 0 0; }
  .site-footer > div { gap: 18px; }
  .detail-grid { grid-template-columns: 1fr; gap: 22px; }
  .detail-heading { margin-top: 23px; }
  .project-hero { aspect-ratio: 1.65; }
  .detail-copy { max-width: none; }
}
@media (max-width: 430px) {
  .site-header { flex-wrap: wrap; padding-block: 17px; gap: 14px; }
  .site-header nav { gap: 16px; }
  .site-header nav a { padding-block: 3px; }
  .site-header nav .resume-link { padding: 5px 8px; }
  .intro h1 { font-size: 2.25rem; }
  .site-footer { flex-direction: column; gap: 16px; }
  .work-bottom > p { max-width: 175px; }
}
@media (pointer: coarse) {
  .interaction-hint, .desktop-hint { display: none; }
  .swipe-hint { display: inline; }
  .card-caption p { max-height: none; opacity: 1; transform: none; }
  .card-cta { max-height: none; opacity: 1; margin-top: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
  .project-card:hover, .project-card:focus-visible { transform: none; }
}

/* Static project grid */
.intro h1 {
  font-size: clamp(2.25rem, 3.6vw, 3.75rem);
}

.project-gallery {
  display: grid;
  gap: 26px;
  min-width: 0;
}

.project-image {
  display: block;
  border-radius: 8px;
  cursor: zoom-in;
}

.project-image:hover {
  outline: 1px solid var(--line);
  outline-offset: 4px;
}

.map-closeup {
  width: min(100%, 440px);
}

.gallery-hint {
  font-size: .75rem;
  color: var(--muted);
}

/* Enlarged images stay on the page and can be dismissed with X or Escape. */
body.image-viewer-open { overflow: hidden; }
.image-viewer {
  width: min(94vw, 1400px);
  max-width: none;
  max-height: 94vh;
  max-height: 94dvh;
  margin: auto;
  padding: 16px 20px 20px;
  border: 0;
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 24px 80px #0006;
}
.image-viewer::backdrop { background: #101917d9; }
.image-viewer-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.image-viewer-controls button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: white;
  font-size: 24px;
  line-height: 1;
}
.image-viewer-close { margin-left: auto; }
.image-viewer-controls button:hover:not(:disabled) { background: var(--ink); color: white; }
.image-viewer-viewport {
  height: min(62vh, 720px);
  height: min(62dvh, 720px);
  overflow: auto;
  overscroll-behavior: contain;
  background: #edf0ee;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.image-viewer-viewport:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.image-viewer-canvas {
  position: relative;
  min-width: 100%;
  min-height: 100%;
  display: grid;
  place-items: center;
}
.image-viewer-viewport.is-zoomed { cursor: grab; }
.image-viewer-viewport.is-dragging { cursor: grabbing; }
.image-viewer img {
  display: block;
  max-width: none;
  max-height: none;
  user-select: none;
}
.image-viewer figcaption { text-align: center; margin-top: 16px; }
.image-viewer-hint { text-align: center; font-size: .75rem; color: var(--muted); margin-top: 8px; }

.carousel {
  width: min(100% - var(--gutter) * 2, 1320px);
  margin-inline: auto;
  padding: 32px 0 40px;
  overflow: visible;
  scroll-snap-type: none;
}

.carousel-track {
  display: block;
  width: auto;
  transform: none;
}

.project-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 36px;
  padding: 0;
}

.carousel .project-card {
  width: 100%;
  min-width: 0;
  position: relative;
  transition: transform 280ms ease;
}

.carousel .card-visual {
  height: auto;
  background: #203d33;
  border: 0;
  /* Green is strongest at the image edge and fades smoothly into the page. */
  box-shadow: 0 0 8px 1px #36876580, 0 0 20px 5px #3687653d, 0 0 38px 10px #3687651a;
  transition: box-shadow 280ms ease;
}

.carousel .card-visual::after {
  display: block;
  background: linear-gradient(180deg, #071a1033 0%, transparent 38%, #071a1055 60%, #071a10eb 100%);
}

/* Keep the complete screenshots visible */
.carousel .card-visual img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  object-position: center;
  transform: none;
}

/* Fill the image area for the Direct Coil photograph */
.carousel .direct-coil .card-visual img {
  object-fit: cover;
}

.carousel .card-type {
  background: #fffffff2;
  color: var(--ink);
  text-shadow: none;
}

.carousel .card-type {
  padding: 6px 10px;
  border-radius: 4px;
}

/* Titles sit over the image; supporting text reveals on hover or focus. */
.carousel .card-caption {
  position: absolute;
  bottom: 24px;
  left: 24px;
  right: 24px;
  padding: 0;
  color: white;
  text-shadow: 0 2px 12px #0005;
}

.carousel .project-card .card-caption p {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(8px);
  margin-top: 0;
  color: #f0f6f2;
}

.carousel .project-card .card-cta {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  color: #fff;
}

.work-bottom .swipe-hint {
  display: none;
}

/* Show complete images on the project detail pages too */
.project-hero {
  height: auto;
  aspect-ratio: auto;
  object-fit: contain;
}

/* Enlarge the whole card on hover */
@media (hover: hover) and (pointer: fine) {
  .carousel .project-card:hover {
    transform: translateY(-8px) scale(1.10);
    z-index: 3;
  }

  .carousel .project-card:hover .card-visual {
    box-shadow: 0 0 10px 2px #3687658f, 0 0 26px 8px #36876547, 0 0 50px 14px #3687651f;
  }
  .carousel .project-card:hover img { transform: scale(1.07); }
  .carousel .project-card:hover .card-caption p { max-height: 110px; opacity: 1; transform: none; margin-top: 11px; }
  .carousel .project-card:hover .card-cta { max-height: 28px; opacity: 1; margin-top: 14px; }
}

/* Give keyboard users the same effect */
.carousel .project-card:focus-visible {
  transform: translateY(-8px) scale(1.10);
  z-index: 3;
}
.carousel .project-card:focus-visible img { transform: scale(1.07); }
.carousel .project-card:focus-visible .card-visual {
  box-shadow: 0 0 10px 2px #3687658f, 0 0 26px 8px #36876547, 0 0 50px 14px #3687651f;
}
.carousel .project-card:focus-visible .card-caption p { max-height: 110px; opacity: 1; transform: none; margin-top: 11px; }
.carousel .project-card:focus-visible .card-cta { max-height: 28px; opacity: 1; margin-top: 14px; }
@media (hover: none), (pointer: coarse) {
  .carousel .project-card .card-caption p { max-height: none; opacity: 1; transform: none; margin-top: 10px; }
  .carousel .project-card .card-cta { max-height: none; opacity: 1; margin-top: 10px; }
  .carousel .card-caption { bottom: 18px; left: 18px; right: 18px; }
  .carousel .card-visual img { aspect-ratio: 4 / 3; }
}

/* Stack the cards on smaller screens */
@media (max-width: 760px) {
  .project-group {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  .carousel .project-card:hover,
  .carousel .project-card:focus-visible {
    transform: none;
  }
  .carousel .project-card:hover img,
  .carousel .project-card:focus-visible img { transform: none; }
}
