/* Andrew Foster — portfolio
   Palette: warm paper, ink, coral, ochre, teal, navy.
   Fonts: Sofia Sans Extra Condensed (display), Sofia Sans Condensed (nav/ui), Newsreader (body).
*/

:root {
  --paper: #F4EFE6;
  --paper-deep: #EBE4D6;
  --ink: #161411;
  --ink-soft: #3F3933;
  --line: #161411;
  --coral: #C73A28;
  --coral-deep: #A82F20;
  --ochre: #E3A31A;
  --teal: #1B5C54;
  --navy: #1E3A5F;
  --cream: #F7F3EC;
  --white: #FFFDF8;
  --focus: #C73A28;
  --radius: 22px;
  --radius-sm: 16px;
  --header-h: 4.5rem;
  --page-pad: clamp(1.25rem, 3vw, 2.5rem);
  --max: 1360px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow: 0 18px 40px -24px rgba(22, 20, 17, 0.35);
  --font-display: "Sofia Sans Extra Condensed", "Arial Narrow", Impact, sans-serif;
  --font-ui: "Sofia Sans Condensed", "Arial Narrow", sans-serif;
  --font-body: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
}

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

html {
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.6;
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 400;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.9'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

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

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration: none;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
  left: 0;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100%;
  z-index: 500;
  background: var(--ink);
  color: var(--paper);
  padding: 0.6rem 1rem;
  font-family: var(--font-ui);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 0.75rem;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 120;
  background: var(--paper);
  border-bottom: 1.5px solid var(--ink);
}

.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  min-height: var(--header-h);
  padding: 0.7rem var(--page-pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.wordmark {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 800;
  font-size: clamp(1.7rem, 2.2vw, 2.15rem);
  letter-spacing: 0.01em;
  line-height: 1;
  text-transform: uppercase;
  text-decoration: none;
  flex-shrink: 0;
  color: var(--ink);
}

.wordmark:hover {
  color: var(--coral);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.35rem;
}

.site-nav ul {
  display: flex;
  gap: 0.15rem 1.15rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  white-space: nowrap;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--coral);
}

.site-nav a[aria-current="page"] {
  box-shadow: 0 1.5px 0 0 currentColor;
}

/* ---------- Dropdown ---------- */

.has-dropdown {
  position: relative;
}

.dropdown-toggle {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  white-space: nowrap;
}

.dropdown-toggle:hover,
.dropdown-toggle.is-current,
.has-dropdown.open > .dropdown-toggle {
  color: var(--coral);
}

.dropdown-toggle.is-current {
  box-shadow: 0 1.5px 0 0 currentColor;
}

.caret {
  transition: transform 0.25s var(--ease);
}

.has-dropdown.open .caret {
  transform: rotate(180deg);
}

.site-nav .dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 0.55rem);
  left: -0.9rem;
  z-index: 130;
  min-width: 11.5rem;
  flex-direction: column;
  gap: 0;
  padding: 0.45rem;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

/* invisible bridge so the pointer can travel from the toggle to the menu */
.site-nav .dropdown::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -0.7rem;
  height: 0.7rem;
}

.has-dropdown.open > .dropdown {
  display: flex;
}

.site-nav .dropdown a {
  display: block;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  font-size: 0.85rem;
}

.site-nav .dropdown a:hover,
.site-nav .dropdown a:focus-visible {
  background: var(--ink);
  color: var(--cream);
}

.site-nav .dropdown a[aria-current="page"] {
  box-shadow: none;
  color: var(--coral);
}

.site-nav .dropdown a[aria-current="page"]:hover {
  color: var(--cream);
}

.social {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding-left: 0.35rem;
  border-left: 1.5px solid var(--ink);
  margin-left: 0.15rem;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  color: var(--ink);
  text-decoration: none;
}

.social-link:hover {
  color: var(--coral);
}

.nav-toggle {
  display: none;
  width: 2.6rem;
  height: 2.6rem;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  position: relative;
  z-index: 120;
}

.nav-toggle-bar {
  display: block;
  width: 1.35rem;
  height: 1.5px;
  margin: 0 auto;
  background: var(--ink);
  transition: transform 0.3s var(--ease), opacity 0.2s ease;
}

.nav-toggle-bar + .nav-toggle-bar {
  margin-top: 6px;
}

body.nav-open .nav-toggle-bar:first-child {
  transform: translateY(3.75px) rotate(45deg);
}

body.nav-open .nav-toggle-bar:last-child {
  transform: translateY(-3.75px) rotate(-45deg);
}

/* ---------- Footer ---------- */

.site-footer {
  margin-top: auto;
  border-top: 1.5px solid var(--ink);
}

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.25rem var(--page-pad) 1.6rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
}

.copyright {
  margin: 0;
  max-width: 44rem;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

.footer-contact {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.footer-contact a {
  text-decoration: none;
}

.footer-contact a:hover {
  color: var(--coral);
}

/* ---------- Home bento ---------- */

.home {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.35rem var(--page-pad) 2.5rem;
  width: 100%;
  container-type: inline-size;
}

/* Row height = 1.5 x column width + half a gap, so a 3-column x 2-row tile
   (Design, Illustration) is exactly square. */
.bento {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: repeat(4, calc((100cqw - 154px) / 8 + 7px));
  gap: 14px;
}

.tile {
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 1.15rem 1.3rem;
  border-radius: var(--radius);
  text-decoration: none;
  overflow: hidden;
  color: var(--cream);
  isolation: isolate;
  transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease);
}

.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--ink) 12%, transparent);
  pointer-events: none;
  z-index: 2;
}

.tile-label {
  position: relative;
  z-index: 2;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 800;
  font-size: clamp(1.7rem, 2.6vw, 2.55rem);
  letter-spacing: 0.01em;
  line-height: 0.9;
  text-transform: uppercase;
}

.tile-arrow {
  position: absolute;
  top: 1rem;
  right: 1.15rem;
  z-index: 2;
  font-size: 1.35rem;
  line-height: 1;
  opacity: 0;
  transform: translate(-6px, 6px);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}

.tile:hover,
.tile:focus-visible {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.tile:hover .tile-arrow,
.tile:focus-visible .tile-arrow {
  opacity: 1;
  transform: none;
}

.tile-design {
  grid-column: 11 / 13;
  grid-row: 1 / 5;
  background: var(--coral);
}

.tile-featured {
  grid-column: 1 / 7;
  grid-row: 1 / 3;
  background: var(--ochre);
  color: var(--ink);
  align-items: stretch;
  justify-content: flex-end;
  flex-direction: column;
}

.tile.has-image {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: var(--cream);
}

.tile.has-image::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(22, 20, 17, 0.72) 0%, rgba(22, 20, 17, 0.0) 48%);
  z-index: 1;
  transition: opacity 0.45s var(--ease);
}

.tile-sketchbook.has-image::before,
.tile-abstract.has-image::before {
  background: linear-gradient(to top, rgba(22, 20, 17, 0.9) 0%, rgba(22, 20, 17, 0.55) 45%, rgba(22, 20, 17, 0.1) 100%);
}

.tile-design.has-image .tile-label {
  text-shadow: 0 2px 14px rgba(22, 20, 17, 0.5);
}

.tile-featured.has-image {
  background-position: center 36%;
  align-items: flex-end;
  flex-direction: row;
}

.tile-featured.has-image .tile-label {
  margin-bottom: 0;
  font-size: clamp(1.7rem, 2.6vw, 2.55rem);
}

.tile-featured-type {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  margin-top: auto;
  margin-bottom: 0.15rem;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 800;
  font-size: clamp(2.6rem, 5.2vw, 5.1rem);
  letter-spacing: -0.02em;
  line-height: 0.82;
  text-transform: uppercase;
  pointer-events: none;
}

.tile-featured .tile-label {
  margin-bottom: auto;
  font-size: clamp(1.35rem, 1.8vw, 1.7rem);
}

.tile-illustration {
  grid-column: 1 / 5;
  grid-row: 3 / 5;
  background: var(--teal);
}

.tile-sketchbook {
  grid-column: 7 / 11;
  grid-row: 1 / 3;
  background: var(--teal);
}

.tile-abstract {
  grid-column: 5 / 8;
  grid-row: 3 / 4;
  background: var(--coral);
}

.tile-clients {
  grid-column: 5 / 9;
  grid-row: 4 / 5;
  background: var(--ochre);
  color: var(--ink);
}

.tile-motion {
  grid-column: 8 / 11;
  grid-row: 3 / 4;
  background: var(--coral-deep);
}

.tile-contact {
  grid-column: 9 / 11;
  grid-row: 4 / 5;
  background: var(--paper);
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--ink);
}

.tile-contact::after {
  box-shadow: none;
}

.tile-sketchbook,
.tile-abstract,
.tile-motion,
.tile-clients,
.tile-contact {
  padding: 1rem 1.05rem;
}

.tile-sketchbook .tile-label,
.tile-abstract .tile-label,
.tile-motion .tile-label,
.tile-clients .tile-label,
.tile-contact .tile-label {
  font-size: clamp(1.35rem, 2vw, 2.1rem);
}

/* Desktop: tall Apparel Design strip with a vertical label */
@media (min-width: 901px) {
  .tile-design.has-image {
    background-image: url("../images/home/apparel-tall.jpg") !important;
    background-position: 38% center !important;
    justify-content: center;
    align-items: center;
  }
  .tile-design .tile-label {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: clamp(1.9rem, 3vw, 3.1rem);
    letter-spacing: 0.06em;
    margin: 0;
  }
  .tile-design.has-image::before {
    background: linear-gradient(to right, rgba(22,20,17,0.15) 0%, rgba(22,20,17,0.55) 55%, rgba(22,20,17,0.15) 100%);
  }
  .tile-sketchbook.has-image {
    background-image: url("../images/sketchbook/large/Red_Caricatures.jpg") !important;
    background-position: center !important;
  }
}

/* Sketchbook tile: art runs edge to edge (cover) */
.tile-sketchbook.has-image {
  background-color: #fff;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: var(--ink);
}

.tile-sketchbook.has-image::before {
  display: none;
}

.tile-sketchbook .tile-label {
  padding: 0.3rem 0.55rem 0.35rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 0 1.5px var(--ink);
}

.tile-sketchbook:hover,
.tile-sketchbook:focus-visible {
  box-shadow: var(--shadow);
}

/* ---------- Section pages ---------- */

.section-page,
.contact-page {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.75rem var(--page-pad) 3.5rem;
  width: 100%;
}

.section-hero {
  margin-bottom: 2.25rem;
  max-width: 46rem;
}

.section-title {
  margin: 0 0 0.7rem;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 800;
  font-size: clamp(4.2rem, 13vw, 9.5rem);
  letter-spacing: -0.02em;
  line-height: 0.8;
  text-transform: uppercase;
}

.section-intro {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

.replace-note {
  color: var(--ink-soft);
  font-style: italic;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.gallery-item {
  margin: 0;
  position: relative;
}

.gallery-button {
  appearance: none;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
  color: inherit;
  border-radius: var(--radius-sm);
}

.gallery-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--paper-deep);
  transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease);
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}

.gallery-button:hover .gallery-thumb,
.gallery-button:focus-visible .gallery-thumb {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.gallery-button:hover .gallery-thumb img,
.gallery-button:focus-visible .gallery-thumb img {
  transform: scale(1.05);
}

.placeholder-tile {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 1rem 1.05rem;
  color: var(--cream);
}

.placeholder-tile.is-light {
  color: var(--ink);
}

.placeholder-mark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -58%);
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 800;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  letter-spacing: -0.04em;
  opacity: 0.22;
  text-transform: uppercase;
  pointer-events: none;
  user-select: none;
}

.gallery-caption {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.55rem;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  line-height: 1.25;
}

.gallery-caption .pending {
  font-weight: 500;
  color: var(--ink-soft);
  font-style: italic;
}

.callout {
  margin: 1.4rem 0 0;
  padding: 0.9rem 1.15rem 1rem;
  max-width: 46rem;
  border-left: 5px solid var(--coral);
  background: var(--white);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 1.1rem;
  line-height: 1.5;
}

/* ---------- Motion: video cards ---------- */

.video-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 20px;
  margin-top: 0.5rem;
}

.video-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.video-card.is-featured {
  grid-column: 1 / -1;
}

.video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--ink);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--ink) 12%, transparent);
}

.video-frame video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--ink);
}

.video-info {
  padding-top: 0.75rem;
}

.video-title {
  margin: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 800;
  font-size: clamp(1.5rem, 2.4vw, 2.1rem);
  letter-spacing: 0.01em;
  line-height: 0.95;
  text-transform: uppercase;
}

.video-caption {
  margin: 0.45rem 0 0;
  max-width: 46rem;
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

.video-credit {
  margin: 0.4rem 0 0;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
}

@media (max-width: 720px) {
  .video-list {
    grid-template-columns: minmax(0, 1fr);
    gap: 26px;
  }
}

/* ---------- Clients: name groups ---------- */

.name-groups {
  margin: 0 0 3rem;
  padding-bottom: 2.25rem;
  border-bottom: 1.5px solid var(--ink);
}

.name-group + .name-group {
  margin-top: 2rem;
}

.name-group-title {
  margin: 0 0 0.8rem;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 800;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  letter-spacing: 0.01em;
  line-height: 1;
  text-transform: uppercase;
}

.name-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.chip {
  padding: 0.4rem 1.05rem 0.45rem;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
  line-height: 1.2;
  background: var(--white);
  transition: transform 0.3s var(--ease), background-color 0.3s var(--ease), color 0.3s var(--ease);
}

.chip:hover {
  transform: translateY(-2px);
  color: var(--cream);
}

.chip-0:hover { background: var(--coral); border-color: var(--coral); }
.chip-1:hover { background: var(--teal); border-color: var(--teal); }
.chip-2:hover { background: var(--navy); border-color: var(--navy); }
.chip-3:hover { background: var(--ink); }

.name-groups-note {
  margin: 1.5rem 0 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

/* ---------- Uniform gallery tiles (art is never cropped) ---------- */

.gallery-thumb img {
  object-fit: contain;
  background: var(--paper-deep);
}

.gallery-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(22, 20, 17, 0.1);
  pointer-events: none;
}

/* ---------- Bento gallery (Design) ---------- */

.section-note {
  margin: 0.9rem 0 0;
  max-width: 46rem;
  font-size: 0.92rem;
  font-style: italic;
  line-height: 1.5;
  color: var(--ink-soft);
}

.bento-wrap {
  container-type: inline-size;
}

.gallery.is-bento {
  --gap: 14px;
  --cols: 4;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  grid-auto-rows: calc((100cqw - (var(--cols) - 1) * var(--gap)) / var(--cols) * 0.75);
  grid-auto-flow: row dense;
  gap: var(--gap);
}

.is-bento .bento-tile {
  grid-column: var(--c) / span var(--w);
  grid-row: var(--r) / span var(--h);
  min-width: 0;
  min-height: 0;
}

.is-bento .gallery-button,
.is-bento .gallery-thumb {
  height: 100%;
}

.is-bento .gallery-thumb {
  aspect-ratio: auto;
  background: var(--tile-bg, var(--paper-deep));
}

.is-bento .gallery-thumb img {
  background: transparent;
  object-fit: contain;
}

.is-bento .fit-cover .gallery-thumb img {
  object-fit: cover;
}

.is-bento .gallery-button:hover .gallery-thumb,
.is-bento .gallery-button:focus-visible .gallery-thumb {
  transform: none;
  box-shadow: none;
}

.is-bento .gallery-button:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 2px;
}

.is-bento .gallery-button:hover .gallery-thumb img,
.is-bento .gallery-button:focus-visible .gallery-thumb img {
  transform: scale(1.03);
}

.is-bento .gallery-button {
  position: relative;
  overflow: hidden;
}

.is-bento .bento-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  padding: 1.6rem 0.8rem 0.65rem;
  color: #fff;
  font-size: 0.8rem;
  line-height: 1.25;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  background: linear-gradient(to top, rgba(22, 20, 17, 0.82), rgba(22, 20, 17, 0));
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
  pointer-events: none;
}

.is-bento .gallery-button:hover .bento-caption,
.is-bento .gallery-button:focus-visible .bento-caption {
  opacity: 1;
  transform: none;
}

@media (hover: none) {
  .is-bento .bento-caption {
    opacity: 1;
    transform: none;
  }
}

/* The empty Design template tiles */
.is-bento .placeholder-tile {
  align-items: flex-start;
}

/* ---------- Lightbox ---------- */

.lightbox[hidden] {
  display: none;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(22, 20, 17, 0.92);
}

.lightbox-dialog {
  position: relative;
  z-index: 1;
  height: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto 1fr auto;
  align-items: center;
  padding: 1rem 0.5rem 1.5rem;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--paper);
  cursor: pointer;
  font-size: 2.4rem;
  line-height: 1;
  padding: 0.4rem 0.7rem;
  font-family: var(--font-ui);
}

.lightbox-close {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  font-size: 2.8rem;
  margin-right: 0.4rem;
}

.lightbox-prev { grid-column: 1; grid-row: 2; }
.lightbox-next { grid-column: 3; grid-row: 2; }

.lightbox-figure {
  grid-column: 2;
  grid-row: 2 / 4;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  max-height: 100%;
}

.lightbox-media {
  max-height: calc(100vh - 9rem);
  max-width: min(1100px, 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-media img {
  max-height: calc(100vh - 9rem);
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
}

.lightbox-media .placeholder-tile {
  width: min(70vw, 520px);
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  justify-content: flex-end;
}

.lightbox-figure figcaption {
  margin-top: 0.9rem;
  text-align: center;
  color: var(--paper);
  font-family: var(--font-ui);
}

.lightbox-title {
  display: block;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.lightbox-caption {
  display: block;
  opacity: 0.8;
  font-size: 0.95rem;
}

body.lightbox-open {
  overflow: hidden;
}

/* ---------- About / Contact ---------- */

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: start;
  padding-top: 0.5rem;
}

.about-photo {
  position: sticky;
  top: calc(var(--header-h) + 1.25rem);
}

.photo-placeholder,
.about-photo img {
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  object-fit: cover;
}

.about-photo img {
  aspect-ratio: auto;
  height: auto;
  object-fit: contain;
}

.about-name {
  margin: 0 0 0.35rem !important;
  font-family: var(--font-ui);
  font-weight: 700 !important;
  font-size: 1.35rem !important;
  letter-spacing: 0.03em;
}

.photo-placeholder {
  background: var(--teal);
  color: var(--cream);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}

.photo-monogram {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 800;
  font-size: clamp(6rem, 14vw, 10rem);
  line-height: 0.8;
  letter-spacing: -0.04em;
}

.photo-hint {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.75;
}

.about-title {
  margin: 0.2rem 0 1rem;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 800;
  font-size: clamp(4rem, 10vw, 7.5rem);
  letter-spacing: -0.02em;
  line-height: 0.8;
  text-transform: uppercase;
}

.about-bio p {
  margin: 0 0 1rem;
  font-size: 1.2rem;
}

.about-contact {
  margin-top: 2.25rem;
  padding-top: 1.4rem;
  border-top: 1.5px solid var(--ink);
}

.contact-heading {
  margin: 0 0 0.7rem;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 800;
  font-size: 2.2rem;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  line-height: 1;
}

.about-contact p {
  margin: 0 0 0.25rem;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: 0.03em;
}

.about-contact a {
  text-decoration: none;
}

.about-contact a:hover {
  color: var(--coral);
}

.resume-link {
  display: inline-block;
  margin-top: 0.4rem;
  padding: 0.55rem 1.3rem 0.6rem;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--cream) !important;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 1.1rem !important;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  transition: transform 0.3s var(--ease), background-color 0.3s var(--ease);
}

.resume-link:hover {
  background: var(--coral);
  border-color: var(--coral);
  transform: translateY(-2px);
  color: var(--cream) !important;
}

.about-bio .resume-wrap {
  margin: 1.25rem 0 0;
}

.social-text {
  margin-top: 0.7rem !important;
  font-size: 1.05rem !important;
}

/* ---------- Responsive ---------- */

@media (max-width: 1080px) {
  .nav-toggle {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .site-nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 110;
    background: var(--paper);
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 5.5rem var(--page-pad) 2rem;
    gap: 2rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateX(100%);
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.4s var(--ease), visibility 0.4s;
  }

  body.nav-open .site-nav {
    transform: none;
    visibility: visible;
    pointer-events: auto;
  }

  body.nav-open .site-header {
    background: transparent;
    border-bottom-color: transparent;
  }

  .wordmark {
    position: relative;
    z-index: 121;
  }

  .site-nav ul {
    flex-direction: column;
    gap: 0.35rem;
    width: 100%;
  }

  .site-nav a {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 800;
    font-size: clamp(2.4rem, 9vw, 3.8rem);
    letter-spacing: -0.02em;
    line-height: 1;
  }

  .site-nav a[aria-current="page"] {
    box-shadow: none;
    color: var(--coral);
  }

  .dropdown-toggle {
    gap: 0.7rem;
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 800;
    font-size: clamp(2.4rem, 9vw, 3.8rem);
    letter-spacing: -0.02em;
    line-height: 1;
  }

  .dropdown-toggle.is-current {
    box-shadow: none;
  }

  .caret {
    width: 18px;
    height: 11px;
  }

  .site-nav .dropdown {
    position: static;
    min-width: 0;
    margin: 0.35rem 0 0.2rem 0.25rem;
    padding: 0.1rem 0 0.1rem 1rem;
    background: transparent;
    border: 0;
    border-left: 3px solid var(--ink);
    border-radius: 0;
    box-shadow: none;
    gap: 0.1rem;
  }

  .site-nav .dropdown::before {
    display: none;
  }

  .site-nav .dropdown a,
  .site-nav .dropdown a:hover,
  .site-nav .dropdown a:focus-visible {
    padding: 0.1rem 0;
    background: transparent;
    color: var(--ink);
    font-size: clamp(1.7rem, 6.5vw, 2.3rem);
  }

  .site-nav .dropdown a[aria-current="page"],
  .site-nav .dropdown a[aria-current="page"]:hover {
    color: var(--coral);
  }

  .social {
    border: 0;
    padding: 0;
    margin: 0;
    gap: 0.8rem;
  }

  .social-link svg {
    width: 28px;
    height: 28px;
  }

  body.nav-open {
    overflow: hidden;
  }
}

@media (max-width: 900px) {
  .gallery {
    grid-template-columns: repeat(3, 1fr);
  }


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

  .about-photo {
    position: static;
    max-width: 28rem;
  }

  .footer-inner {
    flex-direction: column;
    gap: 1rem;
  }

  .footer-contact {
    align-items: flex-start;
  }
}

@media (max-width: 800px) {
  .tile-sketchbook .tile-label,
  .tile-abstract .tile-label,
  .tile-motion .tile-label,
  .tile-clients .tile-label,
  .tile-contact .tile-label {
    font-size: clamp(1.7rem, 5vw, 2.3rem);
  }
}

@media (max-width: 900px) {
  .bento {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: none;
    grid-auto-rows: minmax(150px, auto);
    min-height: 0;
  }

  .tile-design,
  .tile-featured,
  .tile-illustration,
  .tile-sketchbook,
  .tile-abstract,
  .tile-clients,
  .tile-motion,
  .tile-contact {
    grid-column: auto;
    grid-row: auto;
  }

  .tile-featured {
    grid-column: 1 / -1;
    min-height: 240px;
    order: -1;
  }

  .tile-design,
  .tile-illustration {
    min-height: 200px;
  }

  .tile-sketchbook {
    grid-row: span 2;
    min-height: 320px;
    padding: 1.15rem 1rem;
  }

  /* Wide, short tile: show the whole sheet instead of the tall crop */
  .tile-sketchbook.has-image {
    background-image: url("../images/sketchbook/large/Red_Caricatures.jpg") !important;
    background-size: cover;
    background-position: center !important;
  }

  .tile-illustration {
    aspect-ratio: 1 / 1;
    min-height: 0;
  }
}

@media (max-width: 620px) {
  .gallery {
    grid-template-columns: repeat(2, 1fr);
  }


  .bento {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .tile-featured,
  .tile-design,
  .tile-illustration,
  .tile-sketchbook,
  .tile-abstract,
  .tile-clients,
  .tile-motion,
  .tile-contact {
    grid-column: 1 / -1;
    min-height: 150px;
  }

  .tile-featured {
    min-height: 220px;
    order: 0;
  }

  .tile-sketchbook {
    grid-row: auto;
    min-height: 0;
    aspect-ratio: 1 / 1;
  }

  .tile-illustration {
    min-height: 0;
  }

  .section-title {
    font-size: clamp(3.4rem, 18vw, 5.5rem);
  }

  .lightbox-prev,
  .lightbox-next {
    display: none;
  }

  .lightbox-dialog {
    grid-template-columns: 1fr;
    padding: 0.5rem 1rem 1.25rem;
  }

  .lightbox-close {
    grid-column: 1;
  }

  .lightbox-figure {
    grid-column: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 620px) {
  .gallery.is-bento {
    --gap: 10px;
    --cols: 2;
  }

  .is-bento .bento-tile {
    grid-column: auto / span var(--w);
    grid-row: auto / span var(--h);
  }

  .is-bento .bento-caption {
    font-size: 0.72rem;
    padding: 1.2rem 0.55rem 0.45rem;
  }
}

.gallery[hidden] {
  display: none;
}


.tile-clients.has-image {
  background-color: #c03639;
  background-size: contain;
  background-position: right center;
}
.tile-contact.has-image {
  color: var(--cream);
  box-shadow: none;
}

.social-link svg text {
  text-transform: none;
  letter-spacing: 0;
}
