:root {
  --gallery-ground: #ffffff;
}

.hero-full {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100svh;
  min-height: 420px;
  margin: 0;
  overflow: hidden;
  background: var(--ink);
}

.hero-full > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;

  object-position: 32% center;
}

.hero-full::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(10, 10, 14, 0.45), rgba(10, 10, 14, 0) 22%);
  pointer-events: none;
}

.hero-cue {
  position: absolute;
  left: 50%;
  bottom: clamp(26px, 4vh, 54px);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translateX(-50%);
  color: #fff;
  text-decoration: none;
}

.hero-cue-mark {
  display: block;
  width: 255px;
  height: auto;
  filter: url(#ink-paper) drop-shadow(0 1px 14px rgba(0, 0, 0, 0.5));
}

.hero-cue:hover .hero-cue-mark,
.hero-cue:focus-visible .hero-cue-mark {
  filter: url(#ink-grey) drop-shadow(0 1px 14px rgba(0, 0, 0, 0.5));
}

#works {
  background: var(--gallery-ground);
}

@media (min-width: 961px) {
  body.portfolio-index main { padding-top: 0; }

  #works {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    scroll-margin-top: 0;
  }

  .gallery {
    grid-row: 1;
    grid-column: 1;
    margin: 0;
    padding: calc(var(--compact-header-height) + 0.75rem) var(--site-gutter) 2rem;
  }
}

@media (hover: hover) {
  .artwork:hover .artwork-caption,
  .artwork:focus-within .artwork-caption {
    opacity: 1;
  }
}

.studio-notes--card {
  position: fixed;
  bottom: clamp(16px, 2vw, 32px);
  right: clamp(16px, 2vw, 32px);
  z-index: 5;

  width: min(460px, calc(100vw - 32px));

  --wash-h: 155%;
  --wash-x: 52%;
  --wash-y: 46%;
  --wash-tilt: -7deg;

  --wash-ink: 0.09;

  padding: 0;
  overflow: visible;

  background: rgba(255, 255, 255, 0.89);
  -webkit-backdrop-filter: blur(24px) saturate(1.8);
  backdrop-filter: blur(24px) saturate(1.8);
  border: 1px solid var(--hairline);

  border-radius: 2px;

  transform: translateY(calc(100% + clamp(16px, 2vw, 32px)));
  opacity: 0;
  visibility: hidden;
  transition:
    transform 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.35s ease,
    visibility 0s linear 0.55s;
}

.studio-notes--card.is-in {
  transform: none;
  opacity: 1;
  visibility: visible;
  transition:
    transform 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.35s ease,
    visibility 0s;
}

.studio-notes--card[hidden] {
  display: none;
}

.studio-notes-shield {
  position: fixed;
  inset: -100vh 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  z-index: 4;
  touch-action: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .studio-notes--card {
    background: var(--surface);
  }
}

.studio-notes-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "title"
    "form";
  align-content: center;
  row-gap: 0;
}

.studio-notes-copy {
  grid-area: title;
  padding: 22px 44px 0 26px;
}

.studio-notes-form {
  grid-area: form;
  padding: 0 26px 22px 26px;
}

.notes-art {
  position: absolute;
  inset: 0;
  z-index: 0;
  margin: 0;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
}

.studio-notes-copy,
.studio-notes-form {
  position: relative;
  z-index: 1;
}

.studio-notes-form {
  position: static;
}

.notes-art img {
  position: absolute;
  top: var(--wash-y);
  left: var(--wash-x);
  display: block;
  width: auto;
  height: var(--wash-h);
  transform: translateY(-50%) rotate(var(--wash-tilt));
  transform-origin: 50% 50%;
  opacity: var(--wash-ink);
}

.studio-notes-copy {
  font-size: 1.0625rem;
  letter-spacing: -0.014em;
  line-height: 1.55;
  text-wrap: balance;
}

.studio-notes-title,
.studio-notes-message {
  font-size: inherit;
  letter-spacing: inherit;
  line-height: inherit;
}

.studio-notes-title {
  margin: 0;
  font-weight: 500;
}

.notes-title-mark {
  display: block;
  width: auto;
  height: 3.125em;
}

.studio-notes-message {
  margin: 0.25em 0 0;
  font-weight: 400;
  color: color-mix(in srgb, var(--ink) 76%, var(--surface));
}

.notes-line {
  display: block;
}

.notes-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 1;
  padding: 8px;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  line-height: 0;
  transition: color 0.2s ease;
}

.notes-close:hover,
.notes-close:focus-visible {
  color: var(--ink);
}

.close-icon {
  display: block;
  width: 21px;
  height: 21px;
}

.close-icon path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.studio-notes-form {
  margin-top: 0;
}

.studio-notes-row[hidden] {
  display: none;
}

.studio-notes-row {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-top: 0.375rem;
  border-bottom: 1px solid var(--rule);
  transition: border-color 0.2s ease;
}

@media (hover: hover) {
  .studio-notes-row:has(.studio-notes-submit:not(:disabled):hover) {
    border-bottom-color: var(--ink);
  }

  .studio-notes-submit:not(:disabled):hover {
    color: #000;
  }
}

.studio-notes-row:focus-within {
  border-color: var(--ink);
  border-bottom-width: 2px;
}

.studio-notes-field {
  position: relative;
  flex: 1;
  min-width: 0;
}

.studio-notes-input {
  display: block;
  width: 100%;
  padding: 18px 0 4px;
  border: 0;
  background: transparent;
  color: var(--ink);
  caret-color: var(--ink);
  font-family: inherit;
  font-size: 16px;
  letter-spacing: -0.005em;
  line-height: 1.4;
}

.studio-notes-label {
  position: absolute;
  top: 18px;
  left: 0;
  color: var(--muted);
  font-size: 16px;
  letter-spacing: -0.005em;
  line-height: 1.4;
  transform-origin: left top;
  pointer-events: none;
  transition: transform 0.18s ease;
}

.studio-notes-input:focus + .studio-notes-label,
.studio-notes-input:not(:placeholder-shown) + .studio-notes-label {
  transform: translateY(-15px) scale(0.75);
}

.studio-notes-input:focus {
  outline: none;
}

.studio-notes-submit {
  display: block;
  flex-shrink: 0;
  padding: 8px 0;
  border: 0;
  background: none;
  color: var(--read-ink);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.4;
  transition: color 0.2s ease;
}

.studio-notes-row.is-ready .studio-notes-submit {
  color: #000;
}

.studio-notes-status {
  margin: 0.75rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.6;
}

.studio-notes-status:empty {
  display: none;
}

@media (min-width: 961px) {
  .studio-notes--card {
    position: absolute;
    bottom: clamp(26px, 4vh, 54px);
    right: var(--site-gutter);
    width: clamp(25rem, 26vw, 28.75rem);
    opacity: 1;
    visibility: visible;
  }

  .studio-notes--card,
  .studio-notes--card.is-in {
    transform: none;
    transition: none;
  }

  .studio-notes-copy {
    padding: 1rem 1.5rem 0;
  }

  .studio-notes-form {
    padding: 0 1.5rem 0.875rem;
  }

  .studio-notes-input,
  .studio-notes-label {
    font-size: 1rem;
  }

  .notes-title-mark {
    height: 2.5em;
  }

  .studio-notes-message {
    margin-top: 0.15em;
  }

  .notes-close {
    display: none;
  }
}

@media (max-width: 960px) {
  .hero-full {
    min-height: 0;
  }

  .hero-cue {
    bottom: clamp(26px, 4svh, 54px);
  }

  .hero-full::after {
    background:
      linear-gradient(90deg, rgba(10, 10, 14, 0.5), rgba(10, 10, 14, 0) 32%),
      linear-gradient(0deg, rgba(10, 10, 14, 0.45), rgba(10, 10, 14, 0) 22%);
  }

  #works {
    padding-top: var(--page-top);
  }

  .gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0 var(--page-gutter);
  }

  .gallery-column {
    display: contents;
  }

  .artwork {
    order: var(--art-order);
  }

  .portfolio-index {
    --page-gutter: max(var(--mobile-page-gutter), env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
  }

  .studio-notes--card {
    --notes-bottom-gap: 12px;
    bottom: calc(var(--notes-bottom-gap) + env(safe-area-inset-bottom, 0px));
    right: calc(16px + env(safe-area-inset-right, 0px));
  }

  .studio-notes--card.is-editing {
    position: absolute;
    top: calc(var(--notes-edit-top) - var(--notes-edit-safe, env(safe-area-inset-bottom, 0px)));
    bottom: auto;
    transform: none;
    transition: none;
  }

  .studio-notes--card.is-editing.is-dropping {
    transform: translateY(var(--notes-drop));
    transition: transform 0.3s cubic-bezier(0.25, 0.9, 0.35, 1);
  }
}

@media (max-width: 620px) {
  .hero-cue {
    bottom: calc(clamp(20px, 3.5svh, 40px) + env(safe-area-inset-bottom, 0px));
  }

  .hero-cue-mark {
    width: min(170px, 46vw);
  }

  .gallery {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .frame {
    width: 100%;
    padding: var(--mat);
  }

  .artwork-caption {
    position: static;
    margin-top: 8px;
    opacity: 1;
  }

  .studio-notes--card {
    --notes-bottom-gap: 12px;
    left: max(calc(var(--mobile-page-gutter) / 2), env(safe-area-inset-left, 0px));
    right: max(calc(var(--mobile-page-gutter) / 2), env(safe-area-inset-right, 0px));
    width: auto;

    --wash-h: 150%;
    --wash-x: 54%;
    --wash-y: 46%;
    --wash-tilt: -4deg;

    --wash-ink: 0.075;
  }

  .studio-notes-copy {
    font-size: 14px;
    line-height: 1.4;
    padding: 10px 40px 0 16px;
  }

  .notes-title-mark {
    height: 2.75em;
  }

  .studio-notes-message {
    margin-top: 0.25em;
  }

  .studio-notes-form {
    padding: 0 16px 10px;
  }

  .studio-notes-row {
    margin-top: 2px;
    gap: 12px;
  }

  .studio-notes-input,
  .studio-notes-submit {
    min-height: 44px;
  }

  .notes-close {
    top: 4px;
    right: 4px;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .studio-notes--card,
  .studio-notes--card.is-in,
  .studio-notes--card.is-editing.is-dropping,
  .studio-notes-label,
  .studio-notes-submit {
    transition: none;
  }
}
