/* Hero — portrait left (circle) + copy right; top-aligned */
.hero {
  position: relative;
  min-height: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: var(--space-5);
  padding: var(--space-5) clamp(0.85rem, 3vw, 1.75rem);
  overflow: visible;
  border-bottom: 1px solid var(--border);
  width: min(100% - 1.25rem, var(--max));
  margin-inline: auto;
}

.hero__portrait {
  flex-shrink: 0;
  width: 7.5rem;
  height: 7.5rem;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--border);
  background: transparent;
}

.hero__photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
}

.hero__copy {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: var(--space-2);
  padding: 0;
  max-width: 36rem;
  min-width: 0;
  --hero-fade: 1;
}

.hero__portrait.is-flight-source {
  opacity: 0;
}

.hero__title.is-name-flying {
  opacity: 0;
}

.hero__copy .hero__kicker,
.hero__copy .hero__role,
.hero__copy .hero__support,
.hero__copy .hero__actions {
  opacity: var(--hero-fade, 1);
}

.hero__kicker {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin: 0;
}

.hero__title {
  margin: 0;
}

.hero__role {
  margin: 0;
  color: var(--text);
  font-size: 1rem;
}

.hero__support {
  margin: 0;
  max-width: 32rem;
  font-size: 0.9rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-1);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.15rem;
  padding: 0.4rem 0.85rem;
  border: 1px solid transparent;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: background var(--ease), border-color var(--ease), color var(--ease);
}

.btn--primary {
  background: var(--accent);
  color: #0b0e10;
}

.btn--primary:hover {
  background: var(--accent-hover);
  color: #0b0e10;
}

.btn--ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
}

.btn--ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Experience */
.exp-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
}

.exp-item {
  display: grid;
  grid-template-columns: 6.25rem minmax(0, 1fr);
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-top: 1px solid var(--border);
}

.exp-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.exp-item__when {
  color: var(--text-faint);
  padding-top: 0.2rem;
}

.exp-item__org {
  color: var(--text);
  margin: 0 0 var(--space-1);
}

.exp-item__role {
  color: var(--accent);
  margin: 0 0 var(--space-2);
}

.exp-item__summary {
  margin: 0;
  max-width: none;
}

/* Projects — results-first + in-place expand
   Row rhythm (A+B): gap + hairline frame + left accent rail */
.project-grid {
  display: grid;
  gap: var(--space-4);
  border: 0;
}

.project {
  display: grid;
  grid-template-columns: minmax(14rem, 22rem) minmax(0, 1fr);
  align-items: stretch;
  gap: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-left: var(--rail, 3px) solid color-mix(in srgb, var(--accent) 45%, var(--border));
  border-radius: 0;
  transition:
    background var(--ease),
    border-color var(--ease),
    border-left-color var(--ease);
  cursor: pointer;
}

.project:hover,
.project:focus-within {
  background: var(--bg-panel);
  border-color: var(--border-strong);
  border-left-color: var(--accent);
}

.project.is-open {
  background: var(--bg-panel);
  border-color: var(--border-strong);
  border-left-color: var(--accent);
  cursor: default;
  position: relative;
  z-index: 35;
  box-shadow: 0 0 0 1px var(--border-strong);
}

/* Spotlight: dim the rest of the page while a case study is open */
.project-focus-veil {
  position: fixed;
  inset: 0;
  z-index: 30;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--project-focus-veil);
  opacity: 0;
  pointer-events: none;
  cursor: default;
  transition: opacity 220ms ease;
}

html.has-project-focus .project-focus-veil {
  opacity: 1;
  pointer-events: auto;
}

@media (prefers-reduced-motion: reduce) {
  .project-focus-veil {
    transition: none;
  }
}

.project__media {
  position: relative;
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  min-height: 10rem;
  height: 100%;
  align-self: stretch;
  overflow: hidden;
}

.project__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

.project__body {
  padding: var(--space-3) var(--space-4);
  display: grid;
  gap: var(--space-2);
  align-content: center;
  min-width: 0;
}

.project__title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
}

.project__title {
  margin: 0;
}

.project__results {
  display: flex;
  flex-wrap: nowrap;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
  max-width: 100%;
}

.project__results li {
  display: grid;
  gap: 0.1rem;
  border: 1px solid var(--accent);
  background: rgba(91, 143, 138, 0.22);
  padding: 0.4rem 0.65rem;
  min-width: 0;
  flex: 0 0 auto;
  white-space: nowrap;
}

.project__results .val {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  color: #b8e0db;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.project__results .lab {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent-hover);
  line-height: 1.25;
  white-space: nowrap;
  max-width: none;
}

.project__results .est {
  opacity: 0.75;
}

.project__stack {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.project__stack li {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text);
  border: 1px solid var(--border-strong);
  padding: 0.25rem 0.5rem;
  background: #222830;
}

.project__link {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  width: fit-content;
  flex-shrink: 0;
  border: 1px solid var(--accent);
  padding: 0.35rem 0.65rem;
  color: var(--accent);
  background: var(--accent-dim);
  cursor: pointer;
  white-space: nowrap;
}

.project__link::after {
  content: " ▾";
  font-size: 0.85em;
}

.project.is-open .project__link::after {
  content: " ▴";
}

.project__link:hover,
.project.is-open .project__link {
  border-color: var(--accent-hover);
  color: var(--text);
  background: rgba(91, 143, 138, 0.32);
}

.project__expand {
  display: none;
  grid-column: 1 / -1;
  border-top: 1px solid var(--border);
  background: var(--bg);
  padding: var(--space-4);
  gap: var(--space-4);
}

.project.is-open .project__expand {
  display: grid;
}

.project__points {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: var(--space-3);
  max-width: none;
}

.project__points li {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.45;
  padding-left: calc(var(--rail) + var(--space-3));
  border-left: var(--rail) solid var(--border-strong);
}

.project__shots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
  gap: var(--space-3);
}

.project__shots figure {
  margin: 0;
  border: 1px solid var(--border);
  background: var(--bg-panel);
}

.project__shots img {
  width: 100%;
  height: 8.5rem;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}

.project__cover-img {
  cursor: zoom-in;
}

.project__shots figcaption {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-faint);
  padding: var(--space-2);
}

.project__shot {
  position: relative;
}

.project__shot--hidden {
  opacity: 0.45;
  outline: 1px dashed var(--text-faint, #888);
}

.project__shot-ops {
  display: none;
  gap: 0.35rem;
  padding: 0.35rem;
  background: rgba(20, 22, 26, 0.92);
}

.project__shot-ops button,
.project__shot-add {
  border: 1px solid #5a6270;
  background: #2a2f36;
  color: #e8eaed;
  border-radius: 0;
  padding: 0.3rem 0.5rem;
  font: inherit;
  font-size: 0.7rem;
  cursor: pointer;
}

.project__shot-add {
  display: none;
  min-height: 8.5rem;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: 2px dashed #5b8dee;
  background: transparent;
  color: #5b8dee;
  width: 100%;
}

.project__shot-add:hover {
  background: rgba(91, 141, 238, 0.08);
}

html[data-pf-edit-mode='1'] .project__shot-ops {
  display: flex;
  flex-wrap: wrap;
}

html[data-pf-edit-mode='1'] .project__shot-add {
  display: flex;
}

html:not([data-pf-edit-mode='1']) .project__shot--hidden {
  display: none !important;
}

/* Edit: drag handle + order # (grid + list) */
.project__shot-drag,
.project__shot-ord,
.project__shot-meta,
.project__shot-move {
  display: none;
}

html[data-pf-edit-mode='1'] .project__shot-drag {
  display: flex;
  position: absolute;
  top: 0.25rem;
  left: 0.25rem;
  z-index: 2;
  width: 1.6rem;
  height: 1.6rem;
  align-items: center;
  justify-content: center;
  border: 1px solid #5a6270;
  background: rgba(20, 22, 26, 0.92);
  color: #e8eaed;
  border-radius: 0;
  cursor: grab;
  font-size: 0.85rem;
  line-height: 1;
  padding: 0;
}

html[data-pf-edit-mode='1'] .project__shot-drag:active {
  cursor: grabbing;
}

html[data-pf-edit-mode='1'] .project__shot-ord {
  display: block;
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  z-index: 2;
  padding: 0.15rem 0.35rem;
  background: rgba(20, 22, 26, 0.92);
  color: #9ec1ff;
  font-size: 0.68rem;
}

.project__shot.is-dragging {
  opacity: 0.45;
}

.project__shot.is-drop-target {
  outline: 2px solid #5b8dee;
  outline-offset: -2px;
}

/* Image list mode (edit bar toggle) */
html[data-pf-shot-layout='list'] .project__shots {
  grid-template-columns: 1fr;
}

html[data-pf-shot-layout='list'][data-pf-edit-mode='1'] .project__shot {
  display: grid;
  grid-template-columns: 1.6rem 2.2rem 6.5rem minmax(0, 1fr) auto auto;
  grid-template-rows: auto;
  align-items: center;
  gap: 0.5rem 0.65rem;
  padding: 0.45rem 0.5rem;
}

html[data-pf-shot-layout='list'][data-pf-edit-mode='1'] .project__shot-drag {
  position: static;
  width: 1.6rem;
  height: 1.6rem;
}

html[data-pf-shot-layout='list'][data-pf-edit-mode='1'] .project__shot-ord {
  position: static;
  text-align: center;
  background: transparent;
  padding: 0;
  font-size: 0.85rem;
  font-weight: 600;
}

html[data-pf-shot-layout='list'][data-pf-edit-mode='1'] .project__shot-img {
  width: 6.5rem;
  height: 4.25rem;
  object-fit: cover;
}

html[data-pf-shot-layout='list'][data-pf-edit-mode='1'] .project__shot-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

html[data-pf-shot-layout='list'][data-pf-edit-mode='1'] .project__shot-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text, #e8eaed);
}

html[data-pf-shot-layout='list'][data-pf-edit-mode='1'] .project__shot-desc {
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--text-muted, #b8bfc8);
}

html[data-pf-shot-layout='list'][data-pf-edit-mode='1'] .project__shot-move {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

html[data-pf-shot-layout='list'][data-pf-edit-mode='1'] .project__shot-move button {
  border: 1px solid #5a6270;
  background: #2a2f36;
  color: #e8eaed;
  border-radius: 0;
  width: 1.75rem;
  height: 1.5rem;
  font: inherit;
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0;
}

html[data-pf-shot-layout='list'][data-pf-edit-mode='1'] .project__shot-ops {
  flex-direction: column;
  align-items: stretch;
  background: transparent;
  padding: 0;
}

html[data-pf-shot-layout='list'][data-pf-edit-mode='1'] .project__shot-add {
  min-height: 3rem;
  grid-column: 1 / -1;
}

.folio-lightbox {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.folio-lightbox[hidden] {
  display: none !important;
}

.folio-lightbox__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  margin: 0;
  background: rgba(8, 10, 14, 0.88);
  cursor: pointer;
}

.folio-lightbox__frame {
  position: relative;
  z-index: 1;
  max-width: min(96vw, 72rem);
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  overflow: visible;
}

/* Media stage = image + overlay chrome (YouTube-like) */
.folio-lightbox__stage {
  position: relative;
  display: grid;
  place-items: center;
  background: #0b0d10;
  border: 1px solid #5a6270;
  border-radius: 0;
  overflow: hidden;
  min-height: 8rem;
}

.folio-lightbox__media {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
}

.folio-lightbox__img,
.folio-lightbox__canvas {
  display: block;
  max-width: 94vw;
  max-height: 68vh;
  width: auto;
  height: auto;
  object-fit: contain;
  margin: 0 auto;
}

.folio-lightbox__img[hidden],
.folio-lightbox__canvas[hidden],
.folio-lightbox__chrome[hidden] {
  display: none !important;
}

.folio-lightbox__close-x {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  z-index: 3;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 0;
  background: rgba(10, 12, 16, 0.55);
  color: #e8eaed;
  font: inherit;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.folio-lightbox__stage:hover .folio-lightbox__close-x,
.folio-lightbox__stage.is-chrome-visible .folio-lightbox__close-x,
.folio-lightbox__close-x:focus-visible {
  opacity: 1;
}

/* Gradient scrim + play/seek on the picture */
.folio-lightbox__chrome {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 1.75rem 0.65rem 0.55rem;
  background: linear-gradient(to top, rgba(8, 10, 14, 0.92) 0%, rgba(8, 10, 14, 0.55) 55%, transparent 100%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.folio-lightbox__stage.is-chrome-visible .folio-lightbox__chrome,
.folio-lightbox__stage:hover .folio-lightbox__chrome,
.folio-lightbox__chrome:focus-within {
  opacity: 1;
  pointer-events: auto;
}

@media (hover: none) {
  .folio-lightbox__chrome,
  .folio-lightbox__close-x {
    opacity: 1;
    pointer-events: auto;
  }
}

.folio-lightbox__play {
  flex: 0 0 auto;
  width: 2.1rem;
  height: 2.1rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.folio-lightbox__play[aria-pressed='true'] {
  color: #9ec1ff;
}

.folio-lightbox__seek {
  flex: 1 1 auto;
  min-width: 0;
  accent-color: #5b8dee;
  height: 0.35rem;
}

.folio-lightbox__frame-meta {
  flex: 0 0 auto;
  color: #c5cad3;
  font-size: 0.68rem;
  min-width: 3.5rem;
  text-align: right;
}

.folio-lightbox__caption {
  padding: 0.15rem 0.1rem 0;
  max-width: min(94vw, 72rem);
}

.folio-lightbox__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #e8eaed;
}

.folio-lightbox__desc {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
  line-height: 1.45;
  color: #b8bfc8;
}

.folio-lightbox__desc[hidden] {
  display: none !important;
}

html[data-pf-edit-mode='1'] .folio-lightbox__title,
html[data-pf-edit-mode='1'] .folio-lightbox__desc {
  outline: 1px dashed #5b8dee;
  cursor: text;
}

html[data-lightbox='1'] {
  overflow: hidden;
}

/* Skills */
.skill-groups {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}

.skill-group {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  padding: var(--space-3) var(--space-4);
}

.skill-group h3 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-bottom: var(--space-3);
}

.skill-group ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: var(--space-1);
}

.skill-group li {
  color: var(--text);
  padding-bottom: var(--space-1);
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}

.skill-group li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

/* Contact stub */
.contact-box {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  padding: var(--space-4);
  display: grid;
  gap: var(--space-3);
  max-width: 36rem;
}

.contact-box p {
  margin: 0;
}

.contact-meta {
  color: var(--text-faint);
  font-size: 0.78rem;
}

.contact-form {
  display: grid;
  gap: var(--space-3);
}

.contact-field {
  display: grid;
  gap: var(--space-1);
}

.contact-field span {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}

.contact-field input,
.contact-field textarea {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: 0;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  padding: 0.5rem 0.65rem;
}

.contact-field input:focus,
.contact-field textarea:focus {
  outline: 1px solid var(--accent);
  border-color: var(--accent);
}

.contact-form__status {
  margin: 0;
  color: var(--accent);
  font-size: 0.78rem;
}

/* Load / degrade */
.degraded {
  border: 1px solid var(--border-strong);
  background: var(--accent-dim);
  color: var(--text);
  padding: var(--space-3) var(--space-4);
  margin: var(--space-4) auto;
  width: min(100% - 2rem, var(--max));
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.reveal {
  opacity: 0;
  transform: translateY(8px);
  animation: rise 520ms ease forwards;
}

.reveal:nth-child(2) {
  animation-delay: 60ms;
}

.reveal:nth-child(3) {
  animation-delay: 120ms;
}

@keyframes rise {
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    animation: none;
  }
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: var(--space-4);
  }

  .hero__portrait {
    width: 5.75rem;
    height: 5.75rem;
  }

  .exp-item {
    grid-template-columns: 1fr;
    gap: var(--space-2);
  }

  .project {
    grid-template-columns: 1fr;
  }

  .project__media {
    border-right: 0;
    border-bottom: 1px solid var(--border);
    min-height: 11rem;
    max-height: none;
    aspect-ratio: 16 / 9;
  }

  .project__expand {
    padding: var(--space-3);
  }

  .skill-groups {
    grid-template-columns: 1fr;
  }
}
