:root {
  --bg: #ffffff;
  --ink: #393c4b;
  --logo: #2e2e2e;
  --accent: #ff5441;
  --accent-hover: #cc4233;
  --muted: #8c8fa0;
  --form-border: #8c8fa0;
  --sidebar: 160px;
  --thumb-h: 260px;
  --thumb-h-sm: 220px;
  --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;
}

/* Format logo: Cousine bold 26px, wraps to two lines at ~160px */
#logo,
.logo {
  display: block;
  max-width: 160px;
  margin: 0 0 12px;
  padding: 0;
  color: #2e2e2e;
  font-family: Cousine, monospace;
  font-weight: bold;
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: 0;
  text-decoration: none;
  text-transform: uppercase;
  word-spacing: 9999px; /* force JENNA / AHMED onto two lines */
  white-space: normal;
}

.logo:hover {
  color: #2e2e2e;
}

.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 — four LARGE thumbs in one horizontal row */
.listing-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 24px;
  align-items: flex-start;
  width: 100%;
  max-width: 1100px;
}

.listing-item {
  flex: 1 1 0;
  min-width: 0;
  text-decoration: none;
}

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

.listing-item .thumb {
  /* Shared ROW HEIGHT; img vertically centered in slot */
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: var(--thumb-h);
  overflow: visible;
  background: transparent;
}

.listing-item img {
  max-height: 100%;
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  vertical-align: top;
}

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

.listing-caption {
  display: block;
  margin-top: 10px;
  color: #ff5441;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
}

.listing-item:hover .listing-caption {
  color: #ff5441;
}

/* Gallery listing — images ONLY */
.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: 22px;
  line-height: 1;
  text-decoration: none;
  padding: 0 4px;
  font-weight: 300;
}

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

.thumb-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 24px;
  align-items: flex-start;
}

.thumb-link {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  flex: 0 0 auto;
  line-height: 0;
  height: var(--thumb-h);
  max-width: min(100%, 340px);
  background: #fafafa;
}

.thumb-link img {
  display: block;
  max-height: 100%;
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.thumb-link:hover img {
  opacity: 0.92;
}

.thumb-grid.doodles .thumb-link {
  max-width: min(100%, 340px);
  height: var(--thumb-h);
}

.thumb-grid.doodles .thumb-link img {
  max-height: 100%;
  max-width: 100%;
}

/* Piece view — Format-style, no lightbox */
.piece-view[hidden],
.piece[hidden],
.gallery-view.is-piece .listing-bar,
.gallery-view.is-piece .thumb-grid {
  display: none !important;
}

.gallery-view.is-piece .piece-view {
  display: block;
}

.piece-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 0 18px;
}

.piece-nav {
  font-size: 14px;
  line-height: 1.4;
}

.piece-nav a {
  color: var(--accent);
  text-decoration: none;
}

.piece-nav a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.piece-nav .nav-sep {
  color: var(--accent);
}

.grid-btn {
  color: var(--accent);
  text-decoration: none;
  font-size: 18px;
  line-height: 1;
  padding: 2px 4px;
}

.grid-btn:hover {
  color: var(--accent-hover);
  text-decoration: none;
}

.piece img {
  display: block;
  max-width: min(100%, 720px);
  max-height: calc(100vh - 260px);
  width: auto;
  height: auto;
  object-fit: contain;
}

.piece-caption {
  max-width: 42em;
  margin: 16px 0 40px;
  padding: 0;
  color: var(--ink);
  font-family: Karla, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

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

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

/* 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;
}

.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;
}

@media screen and (max-width: 1100px) {
  :root { --thumb-h: 240px; }
}

@media screen and (max-width: 900px) {
  .listing-grid {
    flex-wrap: wrap;
  }

  .listing-item {
    flex: 1 1 42%;
  }

  :root { --thumb-h: 220px; }
}

@media screen and (max-width: 767px) {
  html,
  body {
    overflow-x: hidden;
  }

  body.menu-open {
    overflow: hidden;
    touch-action: none;
  }

  /* Top fixed bar — Format Chroma mobile */
  .menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: auto;
    width: auto;
    height: auto;
    min-height: 64px;
    padding: 16px 5.5%;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    border-bottom: 0;
    z-index: 40;
    background: #ffffff;
  }

  /* Single-line logo — override desktop two-line wrap */
  #logo,
  .logo {
    font-size: 24px;
    line-height: 1.2;
    max-width: none;
    width: auto;
    margin: 0;
    padding: 0;
    word-spacing: normal;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1 1 auto;
    min-width: 0;
  }

  /* Hide sidebar nav/footer until drawer opens */
  .menu-nav {
    display: block;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;
    width: 80%;
    max-width: 300px;
    margin: 0;
    padding: 52px 20px 100px;
    background: #ffffff;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    z-index: 40;
    flex: none;
    list-style: none;
    transform: translateX(100%);
    transition: transform 400ms cubic-bezier(0.77, 0, 0.175, 1);
    box-shadow: none;
  }

  .menu.open .menu-nav {
    transform: translateX(0);
    transition-timing-function: cubic-bezier(0.165, 0.84, 0.44, 1);
  }

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

  .menu-nav a {
    display: block;
    color: #393c4b;
    font-size: 16px;
    line-height: 1.4;
    padding: 8px 10px;
    margin-right: 10%;
    text-decoration: none;
  }

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

  .menu-footer {
    display: block;
    position: fixed;
    right: 0;
    bottom: 0;
    left: auto;
    width: 80%;
    max-width: 300px;
    padding: 12px 26px 20px;
    background: #ffffff;
    box-shadow: 0 0 21px 21px #ffffff;
    z-index: 45;
    transform: translateX(100%);
    transition: transform 400ms cubic-bezier(0.77, 0, 0.175, 1);
    pointer-events: none;
  }

  .menu.open .menu-footer {
    transform: translateX(0);
    transition-timing-function: cubic-bezier(0.165, 0.84, 0.44, 1);
    pointer-events: auto;
  }

  /* Dim overlay behind drawer */
  .mobile-menu-overlay {
    display: block;
    position: fixed;
    top: -40px;
    left: 0;
    right: 0;
    bottom: -40px;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    pointer-events: none;
    transition: opacity 450ms ease;
    z-index: 35;
  }

  .menu.open ~ .mobile-menu-overlay,
  body.menu-open .mobile-menu-overlay {
    opacity: 1;
    pointer-events: auto;
  }

  /* Coral hamburger — 3 bars */
  .mobile-toggle {
    display: inline-block;
    position: relative;
    flex: 0 0 auto;
    width: 48px;
    height: 33px;
    padding: 8px;
    margin-left: 8px;
    z-index: 50;
  }

  .mobile-toggle span {
    display: block;
    position: absolute;
    width: 25px;
    height: 2px;
    right: 10px;
    background: var(--accent);
    margin: 0;
    transition: transform 200ms ease, opacity 200ms ease;
  }

  .mobile-toggle span:nth-child(1) {
    top: 9px;
  }

  .mobile-toggle span:nth-child(2) {
    top: 16px;
  }

  .mobile-toggle span:nth-child(3) {
    top: 23px;
  }

  .menu.open .mobile-toggle span:nth-child(1) {
    top: 16px;
    transform: rotate(45deg);
  }

  .menu.open .mobile-toggle span:nth-child(2) {
    opacity: 0;
  }

  .menu.open .mobile-toggle span:nth-child(3) {
    top: 16px;
    transform: rotate(135deg);
  }

  /* Content below header */
  .wrap {
    margin: 0;
    padding: 88px 5.5% 64px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Home listing — 2-up on mobile */
  .listing-grid {
    flex-wrap: wrap;
    gap: 20px 6%;
    max-width: 100%;
  }

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

  :root { --thumb-h: 180px; }

  .listing-item .thumb {
    height: var(--thumb-h);
    aspect-ratio: auto;
    max-width: 100%;
  }

  .listing-item img {
    max-height: 100%;
    max-width: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
  }

  .listing-caption {
    text-align: center;
    font-size: 13px;
    color: #ff5441;
  }

  /* Section thumb grids — 2-col, no horizontal scroll */
  .thumb-grid {
    gap: 16px 6%;
    width: 100%;
  }

  .thumb-link,
  .thumb-grid.doodles .thumb-link {
    flex: 1 1 47%;
    max-width: 47%;
    height: var(--thumb-h);
    width: auto;
  }

  .thumb-link img,
  .thumb-grid.doodles .thumb-link img {
    max-height: 100%;
    max-width: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
  }

  /* Piece view */
  .piece img {
    max-width: 100%;
    max-height: 80vh;
    width: auto;
    height: auto;
    margin: 0 auto;
  }

  .piece-caption {
    max-width: 100%;
    text-align: left;
    margin: 16px 0 40px;
  }

  .piece-bar {
    flex-wrap: wrap;
    gap: 8px;
  }

  .essay,
  .contact {
    max-width: 100%;
    padding-left: 0;
    padding-right: 0;
  }

  .essay-title {
    font-size: 22px;
  }

  .essay-figure.portrait img {
    max-height: 70vh;
  }

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

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

  .field input,
  .field textarea {
    width: 100%;
    max-width: 100%;
  }

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

  .copy {
    width: auto;
    max-width: 100%;
  }
}

@media screen and (max-width: 480px) {
  .listing-item {
    flex: 1 1 47%;
    max-width: 47%;
  }

  :root { --thumb-h: 160px; }

  .listing-item .thumb {
    height: var(--thumb-h);
    aspect-ratio: auto;
  }

  .thumb-link {
    flex: 1 1 47%;
    max-width: 47%;
  }

  .wrap {
    padding: 84px 4.5% 56px;
  }
}


/* Contact anti-spam honeypot — visually hidden */
.hp {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.turnstile-slot {
  margin: 16px 0 8px;
}

.form-status {
  margin: 12px 0 0;
  min-height: 1.4em;
  color: var(--ink);
  font-size: 14px;
}

.form-status.is-error {
  color: #b00020;
}

.form-error {
  display: none;
  margin-top: 16px;
  color: #b00020;
}

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

.contact-form .send:disabled {
  opacity: 0.55;
  cursor: wait;
}
