@font-face {
  font-family: "Akzidenz Grotesk";
  src: url("/fonts/akzidenzgroteskpro_regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --primary: #1c1e21;
  --secondary: #767778;
  --active: #322ef6;
  --inactive: #bebebe;
  --surface-subtle: #f2f2f2;
  --visited: #551a8b;
  --text-size: 18px;
  --small-size: 0.75rem;
  --reading-line: 1.45;
  --text-measure: 74ch;
  --space-small: 0.5rem;
  --space-section: 1.5rem;
  --case-image-height: 500px;
  background: #ffffff;
  color: var(--primary);
  font-family: "Akzidenz Grotesk", Arial, sans-serif;
  font-size: 100%;
}

* {
  box-sizing: border-box;
  scrollbar-width: none;
}
*::-webkit-scrollbar { width: 0; height: 0; }
[hidden] {
  display: none !important;
}
::selection {
  background: #e4e3ff;
  color: var(--primary);
}
:focus-visible {
  outline: 0.125rem solid var(--active);
  outline-offset: 0.25rem;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  touch-action: manipulation;
}
body {
  margin: 0;
  min-width: 20rem;
}
button,
input {
  font: inherit;
}
a {
  color: var(--active);
  cursor: pointer;
  text-underline-offset: 0.125rem;
}

.portfolio-grid {
  --viewport-inset: 1.5rem;
  display: grid;
  grid-template-columns: minmax(22.5rem, 1fr) minmax(0, 1.25fr) minmax(
      0,
      1.25fr
    );
  gap: 1.5rem;
  width: 100%;
  max-width: none;
  min-height: 100vh;
  margin: 0 auto;
  padding: 1.5rem;
}

.sidebar {
  display: flex;
  flex-direction: column;
  grid-column: 1;
  position: sticky;
  top: 1.5rem;
  align-self: start;
}
.sidebar > * { flex-shrink: 0; }
.system-message {
  font-size: var(--small-size);
  line-height: 1rem;
  color: var(--secondary);
}
.system-message {
  position: fixed;
  z-index: 40;
  left: 1rem;
  bottom: 5rem;
  max-width: calc(100vw - 2rem);
  margin: 0;
  pointer-events: none;
}
.system-message:empty { display: none; }

.profile-header {
  display: grid;
  grid-template-columns: 12rem 1fr;
  gap: 1.5rem;
  align-items: start;
}

.avatar-wrap {
  width: 12rem;
  height: 12rem;
  overflow: hidden;
  background: var(--inactive);
}
.avatar {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.avatar-placeholder {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: var(--secondary);
  font-size:18px;
}
.external-links {
  display: flex;
  min-width: 0;
  flex-wrap: nowrap;
  text-align: right;
  justify-content: flex-end;
  gap: 0.75rem;
  padding-top: 0.25rem;
  font-size:18px;
  line-height: 1.25rem;
}

.external-links a {
  flex-shrink: 0;
}
.external-links.is-stacked {
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-end;
}

.about {
  max-width: 40rem;
  margin-top: 1.5rem;
}
.about h1,
.case-list h2,
.company h3,
.case-detail h2 {
  margin: 0;
  font-size:18px;
  font-weight: 400;
  line-height: 1.25rem;
}
.about p {
  max-width: 38.75rem;
  margin: 0.5rem 0 0;
  color: var(--secondary);
  font-size:18px;
  line-height: var(--reading-line);
}
.about p,
.case-label,
.case-copy {
  text-wrap: pretty;
}
.case-list {
  margin-top: 2rem;
}
.case-list > h2 {
  margin-bottom: 1rem;
}
.project-workspace-link { display:block; width:fit-content; margin:-0.5rem 0 1rem; font-size:var(--small-size); line-height:1rem; }
.company + .company {
  margin-top: 1.5rem;
}
.company h3 {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}
.company-mark {
  color: var(--active);
  font-size: 0.75rem;
}
.company-mark--plain {
  color: var(--primary);
}

.case-item {
  position: relative;
  text-decoration: none;
  width: 100%;
  display: grid;
  grid-template-columns: 0.75rem minmax(0, 1fr);
  gap: 0.75rem;
  border: 0;
  background: transparent;
  color: var(--primary);
  padding: 0.25rem 0 0.25rem 1.25rem;
  text-align: left;
  cursor: pointer;
  font-size:18px;
  line-height: 1.4;
}
/* The existing left padding reserves this gutter; the label never moves. */
.case-keyboard-marker {
  position: absolute;
  left: 0;
  top: 0.25rem;
  width: 0.75rem;
  visibility: hidden;
}
.case-list:not(.is-pointer-navigation) .case-item:focus-visible .case-keyboard-marker {
  visibility: visible;
}
.case-dash,
.case-label {
  min-width: 0;
}
.case-item.is-active {
  color: var(--active);
}
.case-item.is-viewed { color: var(--visited); }
.case-item.is-active .case-label {
  text-decoration: underline;
  text-underline-offset: 0.1875rem;
}

.case-panel {
  grid-column: 2 / 4;
  min-width: 0;
  padding: 0 0 4rem;
}
/* Programmatic reading focus must not draw a frame around the document. */
.case-panel:focus, .case-detail:focus { outline: none; }
@media (min-width: 42.5625rem) {
  .portfolio-grid {
    height: 100vh;
    min-height: 0;
    overflow: hidden;
  }
  .sidebar,
  .case-panel {
    align-self: stretch;
    height: calc(100vh - var(--viewport-inset) - var(--viewport-inset));
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .sidebar {
    position: static;
  }
}
.sheet-close {
  display: none;
}
.case-modes {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 4;
  display: flex;
  justify-content: flex-end;
  gap: 1.5rem;
  flex-wrap: wrap;
  row-gap: 0.5rem;
  max-width: calc(100% - 3rem);
  width: max-content;
  background: #ffffff;
}
.case-mode {
  text-align: right;
  max-width: 100%;
  border: 0;
  background: transparent;
  color: var(--active);
  padding: 0;
  font-size:18px;
  line-height: 1.25rem;
  text-decoration: underline;
  text-underline-offset: 0.1875rem;
  cursor: pointer;
}
.case-mode.is-selected {
  color: var(--primary);
}
.case-mode:disabled {
  color: var(--inactive);
  cursor: default;
  text-decoration: none;
}
.global-images-mode {
  display: none;
}
/* Absolute text markers replace focus frames without changing link geometry. */
.external-links a,
.case-modes .case-mode {
  position: relative;
}
:is(.external-links a, .case-modes .case-mode, .global-images-mode, .case-item):focus {
  outline: none;
  border: 0;
  box-shadow: none;
}
.group-focus-marker {
  position: absolute;
  left: 50%;
  width: 0.5rem;
  height: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  line-height: 1;
  visibility: hidden;
  pointer-events: none;
  text-decoration: none;
}
.group-focus-marker::before { content: ">"; }
.case-mode .group-focus-marker {
  bottom: 100%;
  transform: translateX(-50%) rotate(90deg);
}
.external-links .group-focus-marker {
  top: calc(100% + 0.125rem);
  transform: translateX(-50%) rotate(-90deg);
}
body:not(.is-pointer-navigation) :is(.external-links a, .case-modes .case-mode, .global-images-mode):focus-visible > .group-focus-marker {
  visibility: visible;
}
.case-detail {
  width: 100%;
  max-width: 100%;
  overflow-anchor: none;
}
.case-image-placeholder {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  width: 100%;
  height: var(--case-cover-height, 20rem);
  margin-bottom: 1rem;
  overflow: hidden;
  padding: 0.5rem;
  background: var(--inactive);
}
.case-image-placeholder:not(:has(img))::before {
  width: 100%;
  height: 100%;
  content: "";
  background: var(--inactive);
}
.case-image-placeholder img {
  display: block;
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}
.image-loading-host {
  position: relative;
}
.image-load-mask {
  position: absolute;
  z-index: 2;
  display: block;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  pointer-events: none;
  background: var(--image-placeholder, var(--inactive));
  color: var(--primary);
  overflow: hidden;
  font-size: 0.75rem;
  line-height: 1rem;
}
.case-media img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}
.case-detail h2 {
  margin-bottom: 1.5rem;
  display: none;
}
.case-copy {
  width: 100%;
  max-width: 100%;
  color: var(--primary);
  font-size: var(--text-size);
  line-height: var(--reading-line);
}
.case-section > :is(p, ul) { max-width: var(--text-measure); }
.case-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-small);
}
.case-section + .case-section {
  margin-top: var(--space-section);
}
.case-copy h3 {
  margin: 0;
  color: var(--secondary);
  font-size:18px;
  font-weight: 400;
  line-height: var(--reading-line);
}
.case-copy p {
  margin: 0;
}
.case-copy ul {
  margin: 0;
  padding-left: 1.5rem;
  list-style-type: square;
}
.case-copy li::marker {
  font-size: 0.75rem;
}
.case-copy li + li {
  margin-top: 0.5rem;
}
.case-table-wrap {
  width: 100%;
  margin: 0;
  overflow-x: auto;
}
.case-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  color: var(--primary);
}
.case-table th,
.case-table td {
  border: 0.0625rem solid var(--inactive);
  padding: 0.5rem;
  overflow-wrap: anywhere;
  text-align: left;
  vertical-align: top;
  font-size:18px;
  line-height: var(--reading-line);
}
.case-table th {
  color: var(--primary);
  font-weight: 400;
}
.case-media {
  margin: 0;
}
.case-media-frame {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  width: 100%;
  height: var(--case-image-height);
  padding: 0.5rem;
  background: var(--inactive);
}
.case-media-frame img {
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}
.case-media figcaption {
  margin-top: 0.25rem;
  color: var(--inactive);
  font-size: 0.75rem;
  line-height: 1rem;
}
.case-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}
.case-gallery--single,
.case-gallery:has(> .case-media:only-child) {
  grid-template-columns: minmax(0, 1fr);
}
.image-only-view {
  display: grid;
  width: 100%;
  gap: 0.75rem;
}
.image-only-featured {
  position: relative;
  display: block;
  width: 100%;
  height: 32rem;
  margin: 0;
  padding: 0.5rem;
  overflow: hidden;
  border: 0;
  background: var(--inactive);
  cursor: zoom-in;
}
.image-only-featured img {
  position: absolute;
  inset: 0.5rem;
  display: block;
  width: calc(100% - 1rem);
  height: calc(100% - 1rem);
  object-fit: contain;
}
.image-only-thumbnails {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.75rem;
}
.image-only-thumbnail {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  margin: 0;
  padding: 0.5rem;
  overflow: hidden;
  border: 0;
  background: var(--inactive);
  cursor: pointer;
}
.image-only-thumbnail img {
  position: absolute;
  inset: 0.5rem;
  display: block;
  width: calc(100% - 1rem);
  height: calc(100% - 1rem);
  object-fit: contain;
}
.case-detail.is-images-only .case-image-placeholder,
.case-detail.is-images-only #case-title {
  display: none;
}
.case-panel.is-global-images .case-mode[data-mode="summary"] {
  display: none;
}

.sidebar,
.profile-header {
  min-width: 0;
}
.case-copy p,
.case-copy li {
  overflow-wrap: anywhere;
  white-space: pre-line;
}
.content-status {
  color: var(--secondary);
  font-size: 0.875rem;
  line-height: 1.25rem;
}
.is-scroll-locked {
  position: fixed;
  width: 100%;
  overflow: hidden;
}

/* The image gets explicit fitted dimensions; zoom never changes the document layout. */
.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: block;
  padding: 0;
  background: rgb(0 0 0 / 0%);
  cursor: zoom-out;
}
.image-lightbox.is-open {
  background: rgb(0 0 0 / 94%);
}
.viewer-topbar {
  position: absolute;
  top: max(0.75rem, env(safe-area-inset-top));
  left: 1.5rem;
  right: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
}
.viewer-counter {
  color: #bebebe;
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}
.viewer-stage {
  position: absolute;
  inset: 4rem 1.5rem 7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  cursor: zoom-out;
}
.viewer-stage.is-zoomed {
  cursor: grab;
}
.viewer-stage.is-dragging {
  cursor: grabbing;
}
.image-lightbox .viewer-image {
  position: absolute;
  display: block;
  max-width: none;
  max-height: none;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}
.viewer-status {
  position: absolute;
  color: #bebebe;
  font-size: 0.875rem;
}
.viewer-bottom {
  position: absolute;
  bottom: max(2.5rem, calc(env(safe-area-inset-bottom) + 1.5rem));
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}
.viewer-zoom {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}
.image-lightbox button {
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0.5rem;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
}
.image-lightbox button:disabled {
  opacity: 0.3;
  cursor: default;
}
.image-lightbox button:focus-visible {
  outline-color: #aaa8ff;
  outline-offset: 0;
}
.viewer-reset {
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  width: 4rem;
}
.viewer-prev,
.viewer-next,
.viewer-minus,
.viewer-plus {
  font-size: 1.5rem;
}
.viewer-hint {
  position: absolute;
  bottom: max(0.5rem, env(safe-area-inset-bottom));
  left: 1rem;
  right: 1rem;
  margin: 0;
  color: #bebebe;
  text-align: center;
  font-size: 0.75rem;
  line-height: 1rem;
  pointer-events: none;
}

@media (min-width: 120.0625rem) {
  .portfolio-grid {
    max-width: 120rem;
  }
  .case-modes {
    right: calc((100vw - 120rem) / 2 + 1.5rem);
  }
}

@media (max-width: 56.25rem) {
  .portfolio-grid {
    --viewport-inset: 1rem;
    grid-template-columns: minmax(18.75rem, 1fr) minmax(0, 1fr);
    gap: 1.5rem;
    padding: 1rem;
  }
  .case-panel {
    grid-column: 2;
  }
  .profile-header {
    grid-template-columns: 9rem 1fr;
    gap: 1.5rem;
  }
  .avatar-wrap {
    width: 9rem;
    height: 9rem;
  }
  .image-only-thumbnails {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .sidebar {
    top: 1rem;
  }
}

/* Full-height independent viewports: spacing scrolls with the content, rather
   than clipping it at an inset rectangle above/below the window edges. */
@media (min-width: 42.5625rem) {
  .portfolio-grid {
    height: 100vh;
    height: 100dvh;
    padding-top: 0;
    padding-bottom: 0;
  }
  .sidebar,
  .case-panel {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    padding-top: 24px;
    padding-bottom: 24px;
    overflow-anchor: none;
  }
  .case-panel { padding-bottom: 5rem; }
  .case-image-placeholder { margin-bottom: 2rem; }
}

.case-label {
  text-decoration-thickness: 0.0625rem;
  text-decoration-skip-ink: auto;
}
.image-only-thumbnail:focus-visible {
  outline-offset: -0.1875rem;
}

@media (max-width: 42.5rem) {
  .portfolio-grid {
    display: block;
    padding: 1rem;
  }
  .sidebar {
    position: static;
    min-height: calc(100svh - 2rem);
    padding-bottom: 3rem;
  }
  .profile-header {
    grid-template-columns: 9rem 1fr;
    gap: 1rem;
  }
  .external-links {
    gap: 0.75rem 1rem;
    padding-top: 0;
  }
  .about {
    margin-top: 1rem;
  }
  .case-list {
    margin-top: 2rem;
  }
  .is-case-open {
    overflow: hidden;
  }
  .case-panel {
    position: fixed;
    inset: 0.5rem;
    bottom: auto;
    z-index: 11;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 1rem);
    height: calc(100dvh - 1rem);
    min-height: 0;
    margin: 0;
    overflow: hidden;
    visibility: hidden;
    background: #ffffff;
    padding: 0.5rem 0.5rem 0;
    pointer-events: none;
  }
  .is-case-open .case-panel {
    visibility: visible;
    pointer-events: auto;
  }
  .sheet-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 3;
    display: block;
    width: auto;
    height: auto;
    margin: 0;
    padding: 0;
    border: 0;
    background: #ffffff;
    color: var(--secondary);
    font-size:18px;
    line-height: 1.25rem;
    text-decoration: underline;
    text-underline-offset: 0.1875rem;
    cursor: pointer;
    touch-action: manipulation;
  }
  .sheet-close span {
    display: block;
  }
  .case-detail {
    overscroll-behavior: contain;
    min-height: 0;
    flex: 1 1 auto;
    overflow-y: auto;
    padding-bottom: 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .case-detail h2 {
    display: block;
  }
  .case-detail::-webkit-scrollbar {
    width: 0;
    height: 0;
  }
  .case-image-placeholder img {
    object-fit: contain;
  }
  .case-gallery {
    grid-template-columns: 1fr;
  }
  .case-media-frame {
    padding: 0.25rem;
  }
  .case-modes {
    max-width: none;
    /* Out of flow, anchored to the fixed, dynamic-viewport-height case panel. */
    position: absolute;
    inset: auto 0 0;
    z-index: 4;
    width: auto;
    margin: 0;
    padding: 0.5rem 0.5rem calc(0.5rem + env(safe-area-inset-bottom, 0px));
    justify-content: flex-end;
    gap: 1.5rem;
    row-gap: 0.5rem;
    background: #ffffff;
  }
  .case-modes #copy-case-link { display: none; }
  .case-modes .case-mode { background: transparent; color: var(--active); }
  .global-images-mode {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 4;
    display: block;
    width: auto;
    margin: 0;
    background: #ffffff;
  }
  .is-case-open .global-images-mode,
  .case-panel.is-global-images .sheet-close {
    display: none;
  }
  .image-only-featured {
    height: 24rem;
    padding: 0.25rem;
  }
  .image-only-featured img {
    inset: 0.25rem;
    width: calc(100% - 0.5rem);
    height: calc(100% - 0.5rem);
  }
  .image-only-thumbnails {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }
  .image-only-thumbnail {
    padding: 0.25rem;
  }
  .image-only-thumbnail img {
    inset: 0.25rem;
    width: calc(100% - 0.5rem);
    height: calc(100% - 0.5rem);
  }
  .case-panel.is-global-images .case-detail {
    position: relative;
    overflow: hidden;
    padding-bottom: 0;
  }
  .case-panel.is-global-images .image-only-view {
    --featured-height: min(24rem, 48dvh);
    position: absolute;
    inset: 0 0 0.5rem;
    min-height: 0;
    grid-template-rows: var(--featured-height) minmax(0, 1fr);
  }
  .case-panel.is-global-images .image-only-featured {
    height: var(--featured-height);
  }
  .case-panel.is-global-images .image-only-thumbnails {
    min-height: 0;
    grid-auto-rows: 25vw;
    overflow-y: auto;
    align-content: start;
    overscroll-behavior: contain;
    padding-bottom: 0.5rem;
    scrollbar-width: none;
  }
  .case-panel.is-global-images .image-only-thumbnail {
    height: 100%;
    aspect-ratio: auto;
  }
  .case-panel.is-global-images .image-only-thumbnails::-webkit-scrollbar {
    width: 0;
    height: 0;
  }
  .viewer-stage {
    left: 0.5rem;
    right: 0.5rem;
  }
  .viewer-topbar {
    left: 0.5rem;
    right: 0.5rem;
  }
}


/* Native OS cursors, preserving each control's semantic affordance. */
@media (min-width: 42.5625rem) and (hover: hover) and (pointer: fine) {
  :root {
    --cursor-default: default;
    --cursor-pointer: pointer;
    --cursor-text: text;
    --cursor-zoom-in: zoom-in;
    --cursor-zoom-out: zoom-out;
    --cursor-disabled: not-allowed;
    cursor: var(--cursor-default);
  }
  img { cursor: var(--cursor-default); }
  :where(p, h1, h2, h3, h4, h5, h6, li, dt, dd, td, th, figcaption, blockquote,
    code, pre, .viewer-counter, input, textarea, [contenteditable="true"]) {
    cursor: var(--cursor-text);
  }
  a[href], button, [role="button"], summary, label[for],
  .case-mode, .image-only-thumbnail,
  .image-lightbox button {
    cursor: var(--cursor-pointer);
  }
  /* Child labels/images must keep the action cursor, not the text/image default. */
  :is(a[href], button, [role="button"]) :where(*) { cursor: inherit; }
  .case-media[role="button"],
  .image-only-featured {
    cursor: var(--cursor-zoom-in);
  }
  .image-lightbox,
  .viewer-stage { cursor: var(--cursor-zoom-out); }
  .image-lightbox .viewer-image { cursor: inherit; }
  .viewer-stage.is-zoomed {
    cursor: grab;
  }
  .viewer-stage.is-dragging {
    cursor: grabbing;
  }
  :disabled, [aria-disabled="true"],
  .case-mode:disabled,
  .image-lightbox button:disabled {
    cursor: var(--cursor-disabled);
  }
}
