/* http://meyerweb.com/eric/tools/css/reset/
   v2.0 | 20110126
   License: none (public domain)
*/

html,
body,
div,
span,
applet,
object,
iframe,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
a,
abbr,
acronym,
address,
big,
cite,
code,
del,
dfn,
em,
img,
ins,
kbd,
q,
s,
samp,
small,
strike,
strong,
sub,
sup,
tt,
var,
b,
u,
i,
center,
dl,
dt,
dd,
ol,
ul,
li,
fieldset,
form,
label,
legend,
table,
caption,
tbody,
tfoot,
thead,  
tr,
th,
td,
article,
aside,
canvas,
details,
embed,
figure,
figcaption,
footer,
header,
hgroup,
menu,
nav,
output,
ruby,
section,
summary,
time,
mark,
audio,
video {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
menu,
nav,
section {
  display: block;
}
body {
  line-height: 1;
}
ol,
ul {
  list-style: none;
}
blockquote,
q {
  quotes: none;
}
blockquote:before,
blockquote:after,
q:before,
q:after {
  content: "";
  content: none;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* overarching variables */ 
:root {
    --background: #ffffff;
    --textBase: #111111;
    --textSub: #999999;
    --border: #000000;
    --grid-margin: 50px;
    --grid-gutter: 25px;
}

/* scroll */
html,
body {
  min-height: 100%;
  overflow: hidden;
}

body {
    font-family: "Besley", serif;
    font-size: 16px;
    line-height: 1.5;
    color: #111;
}

a {
  color: #111;
}

i,
em {
  font-style: italic;
}

/* desktop layout */
.layout {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: var(--grid-gutter);
  padding: 0 var(--grid-margin);
  height: 100vh;
}

/* The placeholder is the grid item; the fetched .sidebar lives inside it. */
#sidebar-placeholder {
  grid-column: 1 / 4;
  min-width: 0;
}

.sidebar {
  grid-column: 1 / 4;
  height: 100vh;
  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 32px 12px 40px 0;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
  display: flex;
  flex-direction: column;
}


.sidebar:hover {
  scrollbar-color: #d9d9d5 transparent;
}

.sidebar::-webkit-scrollbar {
  width: 8px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 999px;
}

.sidebar:hover::-webkit-scrollbar-thumb {
  background: #d9d9d5;
}

.projects {
  grid-column: 4 / 13;
  display: grid;
  grid-template-columns: subgrid; /* for 1 col */
  /* for 2 col
  grid-template-columns: repeat(2, minmax(0, 1fr)); 
  column-gap: 24px; 
  */
  align-content: start;
  height: 100vh;
  box-sizing: border-box;
  overflow-y: auto;

  /* Extend only the scroll container into the existing outer margin. The
     matching right padding preserves the current content/grid position. */
  margin-right: calc(var(--grid-margin) * -1);
  padding: 32px var(--grid-margin) 40px 0;

  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}

/*adding for 3 col test */ 
.projects .name {
  grid-column: 1 / -1;
}

.projects:hover {
  scrollbar-color: #d9d9d5 transparent;
}

/* Chrome / Safari scrollbar styling */
.projects::-webkit-scrollbar {
  width: 8px;
}

.projects::-webkit-scrollbar-track {
  background: transparent;
}

.projects::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 999px;
}

.projects:hover::-webkit-scrollbar-thumb {
  background: #d9d9d5;
}

/* type home page */ 

.name {
    grid-column: 1 / -1;
    font-size: 16px;
    /* font-weight: 500; */
    margin-bottom: 24px;
}

.site-header .name-link {
    position: relative;
    display: inline-block;
    width: 15ch;
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
}

.site-header .name-link .name-short,
.site-header .name-link .name-full {
    display: block;
    white-space: nowrap;
}

.site-header .name-link .name-short {
    opacity: 1;
    transition: opacity 0.2s ease;
}

.site-header .name-link .name-full {
    position: absolute;
    inset: 0 auto auto 0;
    width: 0;
    overflow: hidden;
    opacity: 1;
    transition: width 0.6s steps(18, end), opacity 0.2s ease;
}

.site-header .name-link:hover .name-short {
    opacity: 0;
}

.site-header .name-link:hover .name-full {
    width: 15ch;
    opacity: 1;
}

.site-header .name-link:not(:hover) .name-full {
    width: 0;
    opacity: 0;
}

.site-header .name-link:not(:hover) .name-short {
    opacity: 1;
}

.bio {
    font-size: 16px;
    margin-bottom: 32px;
  /* border-top: 1px solid red; */
}

.nav-link {
    display: block;
    font-size: 16px;
    text-decoration: underline;
    color: #111;
    margin-bottom: 5px;
}

.sidebar-links {
  margin-top: 4px;
  padding-top: 0;
}

.sidebar-links .nav-link {
  margin-bottom: 2px;
}

/* info grid 2 columns */ 
.info-columns {
    display: flex;
    gap: 24px;
    margin-top: 32px;
    font-size: 14px;
}

.info-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.info-block h3 {
    font-weight: 650;
}

.info-block a {
    color: #111;
    text-decoration: underline;
}

.sidebar-footer {
  margin-top: auto;
  font-size: 14px;
}

/* project cards */ 

.project-page {
  grid-column: 4 / 13;
}

/* 1 col */ 
.project-card {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: subgrid;
    margin-bottom: 36px;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

/* for 3 col */ 
/* .project-card {
  margin-bottom: 48px;

  color: inherit;
  text-decoration: none;
  cursor: pointer;
} */

.project-card:hover .project-name {
    text-decoration: underline;
}

.project-media {
    grid-column: 1 / -1;
    width: 100%;
    aspect-ratio: 16 / 9;
    margin-bottom: 12px;
    overflow: hidden;
    position: relative;
}

.project-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.project-image-hover {
    position: absolute;
    inset: 0;
    opacity: 0;
}

.project-media:hover .project-image-hover {
    opacity: 1;
}

.project-media:hover .project-image-default {
    opacity: 0;
}

.project-caption {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: subgrid;
  align-items: baseline;
}


.project-circle {
    grid-column: 1/2;
    grid-row: 1;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: #111;
    justify-self: start;
}

.project-name {
    grid-column: 1/ 5;
    grid-row: 1;
    font-size: 16px;
    font-weight: 400;
    padding-left: 20px;
    min-width: 0;
}

.project-description {
    font-size: 14px;
    /* .projects starts at global column 4; local column 3 is global column 6. */
    grid-column: 6 / -1;
    text-align: left;
    min-width: 0;
}

/* project page */ 
.project-topbar {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  margin-bottom: 23px;
}

.close-link {
    color: #111;
    text-decoration: none;
}

.case-study {
    /* Span every column inside .projects (global page columns 4–12). */
    grid-column: 1 / -1;
    padding-bottom: 80px;
    display: grid;
    grid-template-columns: subgrid;
    margin-top: 5px;
    /* border-top: 1px solid red; */
}

.case-media {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #000;
}

.case-media.hero {
    grid-column: 1 / -1;
    width: 100%;
    aspect-ratio: 16 / 9;
    margin-bottom: 12px;
    overflow: hidden;
}

.case-media-large, .case-image-grid {
   margin-bottom: 14px;
}

.case-media-large {
    width: 100%;
}

.case-media-large img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: auto; /* overrides any fixed ratio set elsewhere */
    object-fit: unset;  /* remove if object-fit was being used for cropping */
}

.case-intro {
  display: grid;
  grid-template-columns: subgrid;
  grid-column: 1 / -1;
  gap: var(--grid-gutter);
  margin: 16px 0 36px;
}

.case-description p {
  font-size: 14px;
}

.case-description .case-subhead {
  font-size: 18px;
  /* font-weight: 500; */
  margin: 0 0 20px;
  line-height: 1.3;
}

.case-title,
.case-description {
  grid-column: 1 / 5; /* five columns */
}

.case-title,
.case-media-large,
.case-intro,
.case-text-row,
.case-image-grid {
    grid-column: 1 / -1;
}

.about-title {
  grid-column: 1 / 5; /* five columns */
  grid-column: 1 / -1;
  display: flex;
    gap: 12px;
    font-size: 16px;
    align-items: baseline;
}

.case-meta {
    display: flex;
    flex-direction: column;
    gap: 14px;
    font-size: 14px;
    grid-column: 6 / 8;
}

  .press-links h1 {
    font-weight: 500;
  }

  .press-links p {
    margin: 0;
  }

.case-credits {
    grid-column: 8 / -1;
    font-size: 14px;
}

/* Lets the meta and credits occupy their own grid columns on wide screens. */
.case-details {
    display: contents;
}

.case-title {
    display: flex;
    gap: 12px;
    font-size: 16px;
    align-items: baseline;
}

.case-text-row {
    display: grid;
    grid-template-columns: subgrid;
    margin: 0px 0 5px;
    font-size: 14px;
}

.case-text-long, .case-text-short {
    margin: 0 0 25px 0; /* space below each paragraph */
}

.case-text-short {
    grid-column: 1 / 5;
}

.case-text-long {
    grid-column: 6 / 10;
    display: flex;
    flex-direction: column;
    /* border: 1px solid red; */
}

.case-text-long p {
  margin: 0 0 12px;
}

.case-image-grid {
    display: grid;
    grid-template-columns: var(--case-image-grid-columns, 1fr 1fr);
    align-items: start;
    gap: 16px;
}

.case-media {
    overflow: hidden;
}

.case-media img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

/* Large case-study media keeps each file's intrinsic aspect ratio. */
.case-media.case-media-large {
    aspect-ratio: auto;
    overflow: visible;
}

.case-media-large img,
.case-media-large video {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

/* Two-up media uses the same uncropped, intrinsic sizing as large media. */
.case-image-grid .case-media {
    min-width: 0;
    aspect-ratio: auto;
    overflow: visible;
}

.case-image-grid .case-media img,
.case-image-grid .case-media video {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

.case-image-grid > img,
.case-image-grid > video {
    min-width: 0;
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}


/* ABOUT PAGE */
.about-intro {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: subgrid;
  align-items: start;
}

.about-copy {
  grid-column: 1 / -1;
}

.about-copy p {
  margin: 0 0 10px 0; /* space below each paragraph */
}

.about-copy a {
  color: inherit;
}

.about-description {
  grid-column: 1 / 6;
  display: grid;
  grid-template-columns: subgrid;
  grid-column-gap: var(--grid-gutter);
  align-content: start; /* prevents rows from stretching to fill leftover height */
  margin-bottom: 30px;
}

.about-headshot {
  grid-column: 6 / -1;
  grid-row: 1;
  overflow: hidden;
  align-self: start;
}

.about-headshot img {
  display: block;
  width: 100%;
  height: auto;
}

.about-business-card {
  grid-column: 1 / -1; /* fills the full width of the 6-column .about-description */
  overflow: hidden;
}

.about-business-card img {
  display: block;
  width: 100%;
  height: auto;
}

.about-info-columns {
  display: grid;
  grid-template-columns: subgrid;
  grid-column: 1 / -1;
  font-size: 14px;
  margin-top: 32px;
}

.about-info-columns .info-column:first-child {
  grid-column: 1 / 3;
}

.about-info-columns .info-column:last-child {
  grid-column: 3 / 5;
}

.about-info-columns .info-column {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Stage 1: Experience/Education/Press and Contact stack into one column,
   but bio + headshot stay side by side. */
@media screen and (max-width: 1100px) {
  .about-info-columns {
    grid-template-columns: 1fr;
  }

  .about-info-columns .info-column:first-child,
  .about-info-columns .info-column:last-child {
    grid-column: 1 / -1;
  }

  .about-info-columns .info-column:last-child {
    margin-top: 24px;
  }
}

/* Stack the About copy and headshot when the project column gets narrow. */
@media screen and (max-width: 900px) {
  .about-intro {
    grid-template-columns: minmax(0, 1fr);
  }

  .about-description,
  .about-headshot {
    grid-column: 1 / -1;
  }

  .about-headshot {
    grid-row: auto;
    order: -1;
    margin-bottom: 24px;
  }

  .about-description {
    display: block;
  }

  .about-info-columns {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Keep the intro description beside its details until the project columns
   become too narrow; then stack the meta and credits in one detail column. */
@media screen and (max-width: 1100px) {
    .case-details {
        display: flex;
        flex-direction: column;
        gap: 14px;
        grid-column: 6 / -1;
        grid-row: 1;
    }
}

/* At narrower desktop/tablet widths, use a single reading column. */
@media screen and (max-width: 900px) {
    .case-intro,
    .case-text-row {
        display: block;
    }

    .case-intro > * + *,
    .case-text-short + .case-text-long {
        margin-top: 16px;
    }
}

/* Sidebar responsiveness */
/* mobile *//* mobile */
@media screen and (max-width: 768px) {
  html,
  body {
    height: auto;
    min-height: 100%;
    overflow: auto;
  }

  .layout {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 100vh;
    padding: 24px;
  }

  #sidebar-placeholder,
  .sidebar {
    display: contents;
  }

  .sidebar,
  .projects {
    height: auto;
    min-height: 0;
    overflow: visible;
    padding: 0;
  }

  .site-header,
  .projects > .name {
    display: none;
  }

  .projects {
    margin-right: 0;
    order: 4;
  }

  .sidebar-footer {
    order: 5;
    margin-top: 48px;
    padding-bottom: 24px;
  }

  .work-view {
    display: contents;
  }

  .work-view-header {
    order: 0;
    margin-bottom: 8px;
  }

  .work-view-header .nav-link {
    margin-bottom: 0;
  }

  .sidebar > .nav-link {
    margin-bottom: 8px;
  }

  .sidebar > .nav-link[href*="play.html"] {
    order: 1;
  }

  .sidebar > .nav-link[href*="about.html"] {
    order: 2;
  }

  .work-view-body {
    order: 3;
  }

  .project-topbar {
    margin-bottom: 24px;
  }

  .project-topbar .close-link {
    display: none;
  }

  .sidebar .info-columns {
    display: none;
  }

  .project-caption {
    grid-template-columns: 5px 1fr;
    gap: 4px 16px;
  }

  .project-card {
    display: block;
  }

  .project-description {
    grid-column: 2;
  }

  .project-media {
    aspect-ratio: 16 / 9;
  }

    .project-topbar,
    .case-intro,
    .case-text-row,
    .case-image-grid {
        display: block;
    }

    .case-description,
    .case-meta,
    .case-text-short,
    .case-text-long,
    .case-image-grid .case-media {
        margin-top: 16px;
    }

}

  @media screen and (max-width: 900px) {
    .about-photo-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 16px;
    }

    .about-photo-grid .case-media {
      margin-top: 0;
    }
  }

@media (max-width: 1100px) {
    .project-caption {
        grid-template-columns: 5px 1fr;
        row-gap: 8px;
    }

    .project-description {
        grid-column: 2;
    }

}

.project-list-view.hide-subtitles {
    grid-template-columns: minmax(0, 1fr);
}

.project-list-view.hide-subtitles .project-row {
    grid-template-columns: minmax(0, 1fr);
}

.project-list-view.hide-subtitles .project-row span:not(.list-name) {
    display: none;
}

.project-list-view.hide-subtitles .project-row .list-name {
    white-space: nowrap;
}

/* grid */ 
.grid-overlay {
    position: fixed;
    inset: 0;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    column-gap: var(--grid-gutter);
    padding: 0 var(--grid-margin);
    pointer-events: none;
    z-index: 9999;
}
/* 
.grid-overlay div {
    background: rgba(255, 0, 0, 0.05);
} */


/* data interaction */ 
/* Interactive portfolio data viz */
.portfolio-network {
  --bg: #fff;
  --ink: #111;
  --line: rgba(17, 17, 17, 0.45);

  position: relative;
  width: 100%;
  height: clamp(150px, 18vw, 190px);
  margin: 3px 0 14px;
  overflow: visible;
  color: var(--ink);
  /* border: 2px solid red; */ 
}

.network-hint {
  display: none;
  position: absolute;
  left: 0;
  bottom: -30px;
  z-index: 10;
  color: rgba(17, 17, 17, 0.45);
  font-size: 12px;
  font-style: italic;
  line-height: 1;
  text-align: left;
  cursor: pointer;
}

.portfolio-network #field {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.portfolio-network svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.portfolio-network line {
  stroke: var(--line);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.portfolio-network .label {
  position: absolute;
  transform: translate(-50%, -50%);
  border: 1px solid var(--ink);
  background: var(--bg);
  padding: 2px 6px 3px;
  font-size: clamp(11px, 1vw, 14px);
  line-height: 1;
  letter-spacing: -0.04em;
  white-space: nowrap;
  z-index: 4;
  pointer-events: none;
}

.portfolio-network .dot {
  position: absolute;
  width: clamp(9px, 0.9vw, 12px);
  height: clamp(9px, 0.9vw, 12px);
  border-radius: 50%;
  background: var(--ink);
  z-index: 6;
  cursor: pointer;
}

.portfolio-network .dot::before {
  content: "";
  position: absolute;
  inset: -8px;
}

.portfolio-network .dot::after {
  content: attr(data-id);
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  font-size: clamp(9px, 0.85vw, 11px);
  line-height: 1;
  pointer-events: none;
}

.portfolio-network .hover-title {
  position: absolute;
  z-index: 40;
  border: 1px solid var(--ink);
  background: var(--bg);
  padding: 2px 6px 3px;
  font-size: clamp(11px, 0.95vw, 13px);
  line-height: 1;
  white-space: nowrap;
  color: var(--ink);
  text-decoration: none;
  pointer-events: none;
  opacity: 0;
  transform: translate(4px, -50%);
}

.portfolio-network .hover-title.is-visible {
  opacity: 1;
  pointer-events: auto;
  cursor: pointer;
}

.hover-bg {
  position: absolute;
  inset: 24px;              /* was: inset: 0; — this pulls all 4 sides in */
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
  z-index: 0;
}

.hover-bg.is-visible {
  opacity: 0.6;
}

.portfolio-network #shuffle {
  display: none;
}

.portfolio-network .state-readout {
  position: absolute;
  right: 0;
  bottom: -20px;  
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 4px;
}

.portfolio-network #shuffleIcon {
  display: none;
}

.portfolio-network #stateCounter {
  font-size: clamp(14px, 0.8vw, 14px);
  color: rgba(17, 17, 17, 0.45);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
} 

.portfolio-network #stateTitle {
  position: absolute;
  left: 0;
  bottom: -20px;
  z-index: 10;
  font-size: clamp(14px, 0.8vw, 14px);
  color: rgba(17, 17, 17, 0.45);
  cursor: pointer;
}

/*list view of interactive section */
.work-view-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.view-toggle {
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

@media (max-width: 1100px) {
  .view-toggle {
    display: none;
  }
}

.project-row {
  display: grid;
  grid-template-columns: subgrid;
  grid-column: 1 / -1;
  gap: 16px;
  border-bottom: 1px solid rgba(0,0,0,.45);
  padding: 6px 0 3px;
  font-size: 13px;
  color: inherit;
  text-decoration: none;
}

.project-row span:last-child {
  color: rgba(0,0,0,.38);
  white-space: nowrap;
  text-align: left;
}

.work-view-body {
  position: relative;
  height: 230px;
  min-height: 190px;
  margin: 10px 0 10px;
  /*border: 2px solid red;*/ 
}

.work-view-body .portfolio-network,
.work-view-body .project-list-view {
  position: absolute;
  inset: 0;
  width: 100%;
}

.project-list-view {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-content: start;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 1;
}

.portfolio-network {
  z-index: 2;
}

.work-view.show-list .portfolio-network {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.work-view:not(.show-list) .portfolio-network {
  transform: translateY(8px);
}

.work-view.show-list .project-list-view {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 3;
}

.work-view.show-list .network-hint {
  display: none;
}

.work-view {
  position: relative;
  padding-bottom: 4px;
}

.work-view-body {
  position: relative;
  min-height: 190px;
  margin: 0 0 8px;
}

.work-view-body .portfolio-network,
.work-view-body .project-list-view {
  position: absolute;
  inset: 0;
  width: 100%;
  /* border: red solid 1px; */
}

/* list view hover */
.list-name{
    position: relative;
    padding-left: 0px;
    text-decoration:none;
}

.list-name::before{
    content:"";
    position:absolute;
    left:0;
    top:50%;

    width:14px;
    height:14px;
    border-radius:50%;
    background:#111;

    transform:translateY(-50%);
    display:none;
}

.project-row:hover .list-name::before{
    display:block;
}

.project-row.is-active .list-name::before{
    display:block;
}

.project-row:hover .list-name{
    padding-left:20px;
    text-decoration:underline;
    text-underline-offset:3px;
}

.project-row.is-active .list-name{
    padding-left:20px;
}
