:root {
  --bg: #ffffff;
  --ink: #393c4b;
  --logo: #2e2e2e;
  --accent: #ff5441;
  --accent-hover: #cc4233;
  --muted: #8c8fa0;
  --form-border: #8c8fa0;
  --sidebar: 160px;
  --content-offset: 200px;
}

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

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Karla, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.7;
}

a {
  color: var(--accent);
  text-decoration: underline;
}

a:hover {
  color: var(--accent-hover);
}

img {
  max-width: 100%;
  height: auto;
  vertical-align: top;
  -webkit-user-drag: none;
}

button,
input,
textarea {
  font-family: inherit;
}

.skip {
  position: absolute;
  left: -999px;
}

/* Sidebar — Format Chroma */
.menu {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--sidebar);
  padding: 50px 0 0 18px;
  z-index: 20;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.logo {
  display: block;
  max-width: 140px;
  margin: 0 0 12px;
  padding: 0;
  color: var(--logo);
  font-family: Cousine, ui-monospace, monospace;
  font-weight: 700;
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: 0;
  text-decoration: none;
  text-transform: uppercase;
}

.logo:hover {
  color: var(--logo);
}

.menu-nav {
  list-style: none;
  margin: 0;
  padding: 25px 0 20px;
  overflow-y: auto;
  flex: 1;
  scrollbar-width: none;
}

.menu-nav::-webkit-scrollbar {
  display: none;
}

.menu-nav li {
  display: block;
  margin: 0;
}

.menu-nav a {
  display: inline-block;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.4;
  text-decoration: none;
  padding: 5px 5px 5px 3px;
}

.menu-nav a:hover,
.menu-nav a:focus,
.menu-nav a.active {
  color: var(--accent);
  text-decoration: none;
  outline: none;
}

.menu-footer {
  padding: 8px 0 40px;
}

.social-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px 3px;
}

.ig-link {
  display: inline-flex;
  align-items: center;
  color: var(--accent);
  text-decoration: none;
}

.ig-link svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.ig-link:hover {
  color: var(--accent);
}

.share-btn {
  background: none;
  border: 0;
  padding: 0 4px;
  color: var(--accent);
  font-family: Helvetica, Arial, sans-serif;
  font-size: 10px;
  text-transform: lowercase;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.share-btn:hover {
  color: var(--accent);
}

.copy {
  margin: 10px 0 0 3px;
  padding: 0;
  width: 140px;
  color: var(--ink);
  font-size: 10px;
  line-height: 1.3;
}

.mobile-toggle {
  display: none;
  background: none;
  border: 0;
  padding: 8px;
  cursor: pointer;
}

.mobile-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--accent);
  margin: 4px 0;
}

/* Main column */
.wrap {
  margin: 0 0 0 var(--content-offset);
  padding: 73px 40px 80px 10px;
  min-height: 100vh;
}

/* Home listing */
.listing-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 28px 32px;
  align-items: flex-start;
}

.listing-item {
  flex: 1 1 160px;
  max-width: 240px;
  min-width: 140px;
  text-decoration: none;
}

.listing-item:hover {
  text-decoration: none;
}

.listing-item .thumb {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #f3f3f3;
}

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

.listing-item:hover img {
  opacity: 0.92;
}

.listing-caption {
  display: block;
  margin-top: 10px;
  color: var(--accent);
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
}

.listing-item:hover .listing-caption {
  color: var(--accent);
}

/* Gallery pages */
.gallery-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin: 0 0 28px;
  min-height: 28px;
}

.gallery-title {
  margin: 0;
  color: var(--accent);
  font-family: Karla, sans-serif;
  font-size: 14px;
  font-weight: 400;
  text-decoration: underline;
}

.close-x {
  color: var(--accent);
  font-size: 20px;
  line-height: 1;
  text-decoration: none;
  padding: 0 4px;
  font-weight: 300;
}

.close-x:hover {
  color: var(--accent-hover);
  text-decoration: none;
}

.gallery-row {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 40px;
  align-items: stretch;
}

.gallery-work {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 28px;
  align-items: flex-start;
  margin: 0;
  padding: 0;
  background: #fff;
}

.gallery-work a[data-lightbox] {
  display: block;
  text-decoration: none;
  cursor: zoom-in;
  flex: 0 0 auto;
}

.gallery-work img {
  display: block;
  height: 240px;
  width: auto;
  max-width: min(100%, 320px);
  object-fit: contain;
  background: #fafafa;
}

.gallery-row.doodles .gallery-work img {
  height: 210px;
  max-width: min(100%, 280px);
}

.work-caption {
  flex: 1 1 280px;
  max-width: 42em;
  margin: 0;
  padding: 0;
  color: var(--accent);
  background: #fff;
  font-family: Karla, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

.work-caption strong {
  font-weight: 400;
  font-style: italic;
}

.work-caption a {
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
}

/* Essay */
.essay {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 8px 40px;
}

.essay-title {
  margin: 0 0 28px;
  text-align: center;
  color: var(--ink);
  font-family: Karla, sans-serif;
  font-size: 24px;
  font-weight: 400;
  line-height: 1.4;
}

.essay-figure {
  margin: 0 auto 32px;
  text-align: center;
}

.essay-figure img {
  max-width: 100%;
  height: auto;
  cursor: zoom-in;
}

.essay-figure.portrait img {
  max-height: 720px;
  width: auto;
}

.essay-body {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.7;
}

.essay-body p {
  margin: 0;
  padding: 0.5em 0;
}

.essay-body i,
.essay-body em {
  font-style: italic;
}

.essay-notes {
  margin-top: 36px;
}

.essay-notes h2 {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 400;
  color: var(--ink);
}

/* Contact */
.contact {
  max-width: 640px;
  padding: 0 8px 40px;
}

.contact h1 {
  margin: 0 0 16px;
  font-size: 36px;
  font-weight: 400;
  line-height: 1.3;
  color: var(--ink);
}

.contact .lede p {
  margin: 0;
  padding: 0.45em 0;
}

.contact-form {
  margin-top: 28px;
  border: 1px solid var(--form-border);
}

.form-row {
  display: flex;
}

.field {
  position: relative;
  flex: 1;
  border-bottom: 1px solid var(--form-border);
}

.field + .field {
  border-left: 1px solid var(--form-border);
}

.field.full {
  flex: 1 1 100%;
  border-left: 0;
}

.field label {
  position: absolute;
  top: 10px;
  left: 12px;
  font-size: 13px;
  color: var(--ink);
  pointer-events: none;
}

.field input,
.field textarea {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 34px 12px 12px;
  color: var(--ink);
  font-size: 14px;
  outline: none;
  resize: vertical;
}

.field textarea {
  min-height: 160px;
}

.form-actions {
  padding: 16px 12px;
}

.send {
  display: inline-block;
  background: #fff;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 2px;
  padding: 10px 18px;
  font-size: 14px;
  cursor: pointer;
}

.send:hover {
  color: var(--accent-hover);
  border-color: var(--accent-hover);
}

.form-note,
.form-success {
  margin-top: 16px;
  font-size: 13px;
  color: var(--ink);
}

.form-success {
  display: none;
  padding: 16px 0;
}

.form-success.visible {
  display: block;
}

.share-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 8px 14px;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
  z-index: 80;
}

.share-toast.show {
  opacity: 1;
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.96);
  z-index: 50;
  padding: 48px 24px 32px;
}

.lightbox.open {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow: auto;
}

.lightbox img {
  max-height: calc(100vh - 220px);
  max-width: min(92vw, 1100px);
  width: auto;
  height: auto;
  object-fit: contain;
  flex: 0 1 auto;
}

.lightbox .lb-caption {
  flex: 0 0 auto;
  max-width: 42em;
  width: min(42em, 92vw);
  margin-top: 16px;
  margin-bottom: 24px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  text-align: left;
}

.lightbox .lb-caption strong {
  font-weight: 400;
  font-style: italic;
}

.lb-close,
.lb-nav {
  position: absolute;
  background: none;
  border: 0;
  color: var(--accent);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.lb-close {
  top: 18px;
  right: 28px;
  font-size: 26px;
}

.lb-prev {
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
}

.lb-next {
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
}

@media screen and (max-width: 1024px) {
  .listing-item {
    max-width: 31%;
  }
}

@media screen and (max-width: 767px) {
  .menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: auto;
    width: auto;
    height: 72px;
    padding: 14px 5.5%;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    border-bottom: 0;
  }

  .logo {
    font-size: 22px;
    max-width: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
  }

  .menu-nav,
  .menu-footer {
    display: none;
  }

  .menu.open .menu-nav {
    display: block;
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    padding: 20px 8%;
    overflow: auto;
  }

  .menu.open .menu-nav a {
    display: block;
    font-size: 16px;
    padding: 10px 0;
  }

  .menu.open .menu-footer {
    display: block;
    position: fixed;
    left: 8%;
    bottom: 24px;
  }

  .mobile-toggle {
    display: block;
  }

  .wrap {
    margin: 0;
    padding: 96px 5.5% 64px;
  }

  .listing-item {
    max-width: 47%;
    flex-basis: 47%;
  }

  .gallery-work {
    flex-direction: column;
  }

  .gallery-work img,
  .gallery-row.doodles .gallery-work img {
    height: auto;
    width: 100%;
    max-width: 100%;
  }

  .gallery-work a[data-lightbox] {
    width: 100%;
  }

  .form-row {
    flex-direction: column;
  }

  .field + .field {
    border-left: 0;
  }

  .contact h1 {
    font-size: 28px;
  }
}

/* keep lightbox caption in viewport */
