/* Reset-ish */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #111;
  background: #fff;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  opacity: 0.75;
}

.work-tile:hover,
.work-tile:focus-visible {
  opacity: 1;
}

img {
  max-width: 100%;
  display: block;
}

/* Header */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.75rem 1.5rem 1.5rem;
  background: #fff;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  font-weight: 500;
  line-height: 1.2;
}

.nav__link--active {
  text-decoration: underline;
  text-underline-offset: 0.25em;
  text-decoration-thickness: 1px;
}

.branding {
  text-align: right;
}

.branding__name {
  margin: 0;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
}

.branding__title {
  margin: 0.35rem 0 0;
  font-weight: 400;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: #6b6b6b;
  text-transform: none;
  line-height: 1.4;
}

/* View filters — same side padding as header */
.work-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  width: 100%;
  padding: 0.35rem 1.5rem 1.5rem;
  background: #fff;
}

.work-toolbar__label {
  margin: 0;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: #6b6b6b;
}

.work-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  align-items: center;
  justify-content: flex-end;
  flex: 1;
  min-width: 0;
}

.work-filters__btn {
  margin: 0;
  padding: 0 0 0.15rem;
  border: none;
  background: none;
  font: inherit;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #111;
  cursor: pointer;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s, color 0.2s, opacity 0.2s;
}

.work-filters__btn:hover,
.work-filters__btn:focus-visible {
  color: #111;
  outline: none;
  border-bottom-color: #ccc;
}

.work-filters__btn[aria-pressed="true"] {
  border-bottom-color: #111;
  font-weight: 600;
}

.work-empty {
  margin: 0;
  padding: 2.5rem 1.5rem 3rem;
  text-align: center;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: #6b6b6b;
  text-transform: none;
}

/* Work index — 2-up full-bleed grid, no gutter (Kirk-style) */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

#work-index {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.work-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  align-content: start;
}

.work-grid__item {
  margin: 0;
  min-width: 0;
}

.work-tile {
  position: relative;
  display: block;
  overflow: hidden;
  background: #0a0a0a;
  /* Half the viewport each — wide cinematic frame; adjust to 4/3 if you prefer */
  aspect-ratio: 3 / 2;
  text-decoration: none;
  color: #fff;
}

.work-tile--loading .work-tile__img {
  opacity: 0.5;
  filter: blur(0.5px);
}

.work-tile__media {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.work-tile--no-thumb .work-tile__img {
  opacity: 0;
}

.work-tile--no-thumb .work-tile__media {
  background: linear-gradient(145deg, #2a2a2a 0%, #0a0a0a 100%);
}

.work-tile--no-thumb .work-tile__media::after {
  content: "add thumb";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #999;
  pointer-events: none;
}

.work-tile__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.01);
  transition: transform 0.5s ease;
}

.work-tile:hover .work-tile__img,
.work-tile:focus-visible .work-tile__img {
  transform: scale(1.04);
}

.work-tile:hover,
.work-tile:focus-visible {
  opacity: 1;
}

.work-tile__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 1.5rem;
  text-align: center;
  z-index: 1;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.35) 0%,
    rgba(0, 0, 0, 0.2) 40%,
    rgba(0, 0, 0, 0) 100%
  );
  color: #fff;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.work-tile:hover .work-tile__overlay,
.work-tile:focus-visible .work-tile__overlay {
  opacity: 1;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.5) 0%,
    rgba(0, 0, 0, 0.4) 45%,
    rgba(0, 0, 0, 0.15) 100%
  );
}

.work-tile__kicker {
  font-size: clamp(0.7rem, 1.1vw, 0.8rem);
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1.3;
  max-width: 22em;
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.work-tile__tags {
  font-size: 0.62rem;
  font-weight: 400;
  font-family: ui-monospace, "SF Mono", Menlo, Monaco, "Courier New", monospace;
  letter-spacing: 0.04em;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.9);
  text-transform: lowercase;
  max-width: 28em;
}

.work-tile__hint {
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  margin-top: 0.2rem;
  opacity: 0.95;
}

@media (hover: none) and (pointer: coarse) {
  .work-tile__overlay {
    opacity: 1;
    background: linear-gradient(
      to top,
      rgba(0, 0, 0, 0.5) 0%,
      rgba(0, 0, 0, 0.2) 50%,
      rgba(0, 0, 0, 0) 100%
    );
  }
}

/* Text page (About) */
.page--text .text-main {
  max-width: 40rem;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
  text-transform: none;
  letter-spacing: normal;
  font-size: 1rem;
  line-height: 1.6;
  color: #333;
}

.page--text .text-main h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
}

.page--text .text-main p {
  margin: 0 0 1rem;
}

.text-main__lead {
  font-size: 1.05rem;
  color: #222;
  margin-bottom: 1.25rem !important;
}

.page--text .text-main__list {
  margin: 0 0 1.25rem 1rem;
  padding: 0;
  line-height: 1.55;
  color: #333;
}

.page--text .text-main__list li {
  margin-bottom: 0.25rem;
}

/* Footer */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem 1.5rem 1.75rem;
  background: #fff;
  border-top: 1px solid #eee;
}

.site-footer__contact {
  margin: 0;
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  color: #6b6b6b;
  text-transform: none;
}

.site-footer__contact a {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.social {
  list-style: none;
  display: flex;
  gap: 0.9rem;
  margin: 0;
  padding: 0;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: none;
}

.social__link {
  display: inline-flex;
  width: 1.5rem;
  height: 1.5rem;
  align-items: center;
  justify-content: center;
  border: 1px solid #111;
  border-radius: 2px;
  transition: background 0.2s, color 0.2s;
}

.social__link:hover,
.social__link:focus-visible {
  background: #111;
  color: #fff;
  opacity: 1;
}

/* Project case study (detail) */
#work-index[hidden] {
  display: none;
}

.project-detail[hidden] {
  display: none;
}

.project-detail {
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.project-detail__inner {
  display: grid;
  grid-template-columns: minmax(0, 22rem) minmax(0, 1fr);
  gap: 0;
  min-height: 50vh;
  border-top: 1px solid #eee;
  flex: 1;
  align-items: start;
}

.project-detail__left {
  padding: 1.5rem 1.5rem 2.5rem;
  border-right: 1px solid #eee;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.project-detail__back {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  opacity: 0.85;
}

.project-detail__back:hover,
.project-detail__back:focus-visible {
  opacity: 1;
}

.project-detail__title {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  line-height: 1.5;
  max-width: 20em;
  text-transform: uppercase;
  color: #111;
}

.project-detail__body {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1.6;
  color: #333;
  text-transform: none;
  white-space: pre-line;
}

.project-detail__body--html {
  white-space: normal;
  letter-spacing: 0.02em;
  font-size: 0.72rem;
}

.project-detail__body--html p {
  margin: 0 0 1em;
}

.project-detail__body--html p:last-child {
  margin-bottom: 0;
}

/* Case study: meta lines (awards, press) — tight single line spacing, same size as body */
.project-detail__body--html .case-study-line {
  font-size: 0.72rem;
  line-height: 1.15;
  margin: 0 0 0.08em;
  color: #333;
  letter-spacing: 0.02em;
  font-weight: 400;
}

/* Extra space after recognition / meta block, before first narrative or section */
.project-detail__body--html p.case-study-line + p:not(.case-study-line) {
  margin-top: 1.35em;
}

.project-detail__body--html p.case-study-sect,
.project-detail__body--html p.case-study-sect--meta {
  margin: 0.95em 0 0.4em;
  font-size: 0.72rem;
  color: #111;
  letter-spacing: 0.02em;
}

/* After a run of .case-study-line, ensure space before the first *Insight* / *Idea* block */
.project-detail__body--html p.case-study-line + p.case-study-sect,
.project-detail__body--html p.case-study-line + p.case-study-sect--meta {
  margin-top: 1.35em;
}

.project-detail__body--html p.case-study-sect i,
.project-detail__body--html p.case-study-sect--meta i {
  font-style: italic;
}

.project-detail__body--html a {
  color: #111;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}

.project-detail__body--html a:hover,
.project-detail__body--html a:focus-visible {
  opacity: 0.8;
}

.project-detail__body--html .project-detail__recognition {
  font-size: 0.64rem;
  line-height: 1.5;
  color: #5a5a5a;
  margin-bottom: 1.1em;
}

.project-detail__body--html .project-embed {
  margin: 0.9em 0 1.1em;
  width: 100%;
  max-width: 100%;
}

.project-detail__body--html .project-embed__inner {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #111;
  border-radius: 2px;
  overflow: hidden;
}

.project-detail__body--html .project-embed__inner iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.project-detail__awards {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: #5a5a5a;
  text-transform: none;
  line-height: 1.45;
  margin-top: 0.25rem;
}

.project-detail__vimeo {
  margin: 0.5rem 0 0;
  font-size: 0.65rem;
  text-transform: none;
  letter-spacing: 0.04em;
}

.project-detail__vimeo a {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.project-detail__contact {
  margin: auto 0 0;
  padding-top: 1.5rem;
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  color: #6b6b6b;
  text-transform: none;
}

.project-detail__right {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0;
  min-width: 0;
  background: #fafafa;
  width: 100%;
}

.project-stage-wrap {
  position: relative;
  width: 100%;
  margin: 0;
  padding: 1.25rem 1.25rem 0 0;
  flex: 0 0 auto;
}

.project-stage-nav {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 2;
  display: flex;
  gap: 0.25rem;
}

.project-stage-nav__btn {
  width: 2rem;
  height: 2rem;
  margin: 0;
  border: 1px solid #111;
  background: #fff;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  color: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
  padding: 0 0 0.1rem 0.05rem;
}

.project-stage-nav__btn:hover,
.project-stage-nav__btn:focus-visible {
  background: #111;
  color: #fff;
  outline: none;
}

.project-stage {
  position: relative;
  width: 100%;
  background: #0a0a0a;
  aspect-ratio: 16 / 9;
}

.project-stage__empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  text-align: center;
  color: #999;
  font-size: 0.65rem;
  text-transform: none;
  letter-spacing: 0.04em;
  line-height: 1.5;
}

.project-frame {
  position: absolute;
  inset: 0;
}

.project-frame__iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.project-figure {
  position: absolute;
  inset: 0;
  margin: 0;
}

.project-figure__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(4.5rem, 1fr));
  gap: 0.35rem;
  padding: 0 1.25rem 1.5rem 1.25rem;
  max-height: 14rem;
  overflow-y: auto;
}

.project-thumbs[hidden] {
  display: none;
}

.project-stills {
  width: 100%;
  padding: 1.5rem 1.25rem 2rem 0;
  margin-top: 0;
  border-top: 1px solid #e8e8e8;
  flex: 0 0 auto;
}

.project-stills[hidden] {
  display: none;
}

.project-stills__label {
  margin: 0 0 0.9rem;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #111;
}

.project-stills__grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
}

.project-stills__item {
  margin: 0;
  min-width: 0;
  width: 100%;
  background: #e8e8e8;
  overflow: hidden;
  border-radius: 2px;
  line-height: 0;
}

.project-stills__img {
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
  vertical-align: top;
  object-fit: contain;
  background: #111;
}

.project-stills__empty {
  margin: 0;
  font-size: 0.65rem;
  line-height: 1.5;
  color: #777;
  text-transform: none;
  letter-spacing: 0.02em;
}

.project-stills__empty code {
  font-size: 0.6rem;
  background: #eee;
  padding: 0.1em 0.35em;
  border-radius: 2px;
}

/* Extra right-column embeds (below stills) — see detail.railHTML in projects.js */
.project-rail-extra {
  width: 100%;
  box-sizing: border-box;
  padding: 0 1.25rem 1.75rem 0;
  margin: 0;
}

.project-rail-extra .project-embed {
  margin: 0.75em 0 0;
  width: 100%;
  max-width: 100%;
}

.project-rail-extra .project-embed:first-child {
  margin-top: 0.35em;
}

.project-rail-extra .project-embed__inner {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #111;
  border-radius: 2px;
  overflow: hidden;
}

.project-rail-extra .project-embed__inner iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.project-thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  padding: 0;
  border: 2px solid transparent;
  background: #111;
  cursor: pointer;
  overflow: hidden;
}

.project-thumb--active {
  border-color: #111;
}

.project-thumb__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-thumb__ph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.6rem;
  opacity: 0.7;
}

/* Single column on small screens */
@media (max-width: 700px) {
  body {
    font-size: calc(0.75rem + 1.33px);
  }

  .work-grid {
    grid-template-columns: 1fr;
  }

  .work-toolbar {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .branding {
    text-align: left;
    width: 100%;
  }

  .site-header {
    flex-direction: column;
  }

  .project-detail__inner {
    grid-template-columns: 1fr;
  }

  .project-detail__left {
    border-right: none;
    border-bottom: 1px solid #eee;
  }

  /* ~1pt larger body copy on small screens (rem is from root) */
  .project-detail__title {
    font-size: calc(0.72rem + 1.33px);
  }

  .project-detail__body--html,
  .project-detail__body--html .case-study-line,
  .project-detail__body--html p.case-study-sect,
  .project-detail__body--html p.case-study-sect--meta {
    font-size: calc(0.72rem + 1.33px);
  }

  .project-detail__body--html p {
    /* paragraphs inherit; explicit for clarity with calc */
    font-size: inherit;
  }
}
