@font-face {
  font-family: "Liberation Sans Narrow";
  src: url("font/liberation-sans-narrow-regular.ttf") format("truetype");
  font-display: swap;
}

:root {
  font-size: 16px;
  font-family: "Liberation Sans Narrow", "Liberation Sans", Arial, sans-serif;
  color: #111;
  background: #fff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-y: scroll;
  background: #fff;
  color: #111;
}

.skip-link {
  position: absolute;
  left: 0.5rem;
  top: -4rem;
  z-index: 2000;
  padding: 0.45rem 0.65rem;
  border: 1px solid #111;
  background: #fff;
}

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

header,
footer {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.97);
  z-index: 1000;
  transition: opacity 220ms ease;
}

header {
  top: 0;
  border-bottom: 1px solid #e6e6e6;
}

footer {
  bottom: 0;
  border-top: 1px solid #e6e6e6;
}

body.work-idle-hide-bars header,
body.work-idle-hide-bars footer {
  opacity: 0;
  pointer-events: none;
}

.main-nav {
  margin: 0;
  padding: 0.85rem 1rem;
  list-style: none;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  font-size: 1.25rem;
}

footer p {
  margin: 0;
  padding: 0.85rem 1rem;
  text-align: center;
  font-size: 1.125rem;
}

main.center {
  width: min(100%, 850px);
  margin: 0 auto;
  padding: 5.5rem 1.25rem 5.5rem;
}

.container {
  position: relative;
  width: 100%;
  margin: 3rem 0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.work-mobile-title {
  display: none;
  margin: 0.55rem 0 0;
  font-size: 1rem;
  line-height: 1.35;
  text-align: left;
}

.overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.9rem 0.85rem 0.8rem;
  opacity: 1;
  transition: opacity 200ms ease;
  background: linear-gradient(to top, rgba(249, 250, 246, 0.95), rgba(249, 250, 246, 0.62) 55%, rgba(249, 250, 246, 0));
}

.container:hover .overlay,
.container:focus-within .overlay {
  opacity: 1;
}

.text {
  font-size: 1.12rem;
  position: static;
  text-align: left;
  width: 100%;
  line-height: 1.35;
}

.img,
.img1 {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
  text-align: center;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.img1 {
  margin-bottom: 3rem;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  transition: opacity 220ms ease;
}

body.work-page .img1 {
  width: auto;
  max-width: 100%;
  max-height: var(--work-visible-height, 100vh);
  margin-left: auto;
  margin-right: auto;
}

body.work-scroll-focus-mode main.center > h1,
body.work-scroll-focus-mode main.center > .img1 {
  opacity: 0;
  pointer-events: none;
}

body.work-scroll-focus-mode main.center > h1 {
  opacity: 1;
  pointer-events: auto;
}

body.work-scroll-focus-mode main.center > .img1.work-focus-current {
  opacity: 1;
  pointer-events: auto;
}

a {
  color: #111;
  text-decoration: none;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration: underline;
}

a[aria-current="page"] {
  text-decoration: underline;
}

a:focus-visible {
  outline: 2px solid #111;
  outline-offset: 3px;
  text-decoration: underline;
}

h1 {
  margin: 0 0 2rem;
  text-align: center;
  font-weight: 400;
  font-size: clamp(1.9rem, 2.7vw, 2.35rem);
  line-height: 1.1;
}

h2 {
  margin: 2.8rem 0 1.2rem;
  text-align: center;
  font-weight: 400;
  font-size: clamp(1.25rem, 2.1vw, 1.55rem);
}

p {
  margin: 1.1rem 0;
  line-height: 1.55;
}

.prose p {
  max-width: 65ch;
  margin-left: auto;
  margin-right: auto;
}

.prose address {
  max-width: 65ch;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.55;
  font-style: normal;
}

.portfolio-link {
  text-align: center;
}

@media (max-width: 800px) {
  .main-nav {
    font-size: 1.05rem;
    gap: 0.65rem;
    padding: 0.7rem 0.75rem;
  }

  footer p {
    font-size: 1rem;
    padding: 0.7rem 0.75rem;
  }

  main.center {
    padding: 4.4rem 0.8rem 2.1rem;
  }

  .container {
    margin: 1.6rem 0;
    box-shadow: none;
  }

  .container > a {
    display: block;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  }

  .text {
    font-size: 1rem;
  }

  .work-mobile-title {
    display: block !important;
  }

  .container > a .overlay {
    display: none !important;
  }

  footer {
    position: static;
  }
  
  body.work-page footer {
    position: fixed;
    bottom: 0;
  }

  footer p {
    border-top: 1px solid #e6e6e6;
  }
}

@media (hover: hover) and (pointer: fine) {
  .overlay {
    inset: 0;
    padding: 0;
    opacity: 0;
    background-color: #f9faf6;
  }

  .container:hover .overlay,
  .container:focus-within .overlay {
    opacity: 1;
    box-shadow: 0 5px 9px rgba(0, 0, 0, 0.4);
  }

  .text {
    font-size: 1.25rem;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    width: 90%;
  }
}

.admin-page {
  padding-bottom: 7rem;
}

.admin-form {
  display: grid;
  gap: 0.9rem;
  margin-top: 1rem;
}

.admin-form label,
.admin-form fieldset {
  display: grid;
  gap: 0.4rem;
}

.admin-form input,
.admin-form button {
  font: inherit;
  padding: 0.55rem 0.7rem;
  border: 1px solid #b8b8b8;
  background: #fff;
}

.admin-form button {
  width: fit-content;
  cursor: pointer;
}

#result {
  margin-top: 2rem;
}

#json-entry {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #f7f7f7;
  border: 1px solid #ddd;
  padding: 0.8rem;
}

#downloads {
  display: grid;
  gap: 0.45rem;
}

.download-link {
  text-decoration: underline;
}

.admin-preview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.7rem;
}

.preview-image {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid #ddd;
}

.dropzone {
  border: 2px dashed #b8b8b8;
  background: #fafafa;
  padding: 1rem;
  cursor: pointer;
}

.dropzone:focus-visible {
  outline: 2px solid #111;
  outline-offset: 3px;
}

.dropzone.is-dragover {
  border-color: #111;
  background: #f0f0f0;
}

.file-info {
  margin: 0.4rem 0 0;
  font-size: 0.95rem;
}

.dropzone-wrap {
  margin-top: 0.2rem;
}

.dropzone-title {
  margin: 0 0 0.55rem;
  font-size: 1.05rem;
  font-weight: 400;
}

#save-project {
  margin-top: 0.6rem;
}

.save-status {
  margin-top: 0.55rem;
  font-size: 0.95rem;
}

.works-manager {
  margin-top: 2rem;
}

.works-list {
  display: grid;
  gap: 0.7rem;
}

.work-row {
  border: 1px solid #ddd;
  padding: 0.75rem;
  background: #fff;
}

.work-meta {
  margin: 0;
}

.work-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

.work-actions button,
#connect-project,
#load-works {
  font: inherit;
  padding: 0.5rem 0.8rem;
  border: 1px solid #b8b8b8;
  background: #f7f7f7;
  cursor: pointer;
}

.work-actions button:hover,
#connect-project:hover,
#load-works:hover,
.admin-form button:hover,
#save-project:hover {
  background: #ebebeb;
}

.work-actions button:focus-visible,
#connect-project:focus-visible,
#load-works:focus-visible,
.admin-form button:focus-visible,
#save-project:focus-visible {
  outline: 2px solid #111;
  outline-offset: 2px;
}

.admin-form button[type="submit"],
#save-project {
  background: #111;
  color: #fff;
  border-color: #111;
}

.admin-form button[type="submit"]:hover,
#save-project:hover {
  background: #2a2a2a;
}

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

.work-edit-form {
  margin-top: 0;
}

.work-images-title {
  margin: 0.4rem 0;
}

.work-images-list {
  display: grid;
  gap: 0.45rem;
}

.work-image-item {
  display: grid;
  grid-template-columns: 88px 1fr auto;
  align-items: center;
  gap: 0.6rem;
  border: 1px solid #ddd;
  padding: 0.45rem 0.55rem;
}

.work-image-preview {
  width: 88px;
  height: 66px;
  object-fit: cover;
  border: 1px solid #ddd;
  background: #f6f6f6;
}

.work-image-name {
  font-size: 0.95rem;
}

.work-image-title-flag {
  font-size: 0.9rem;
  color: #444;
}

.work-image-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
}

.work-image-controls button {
  font: inherit;
  padding: 0.2rem 0.45rem;
  border: 1px solid #b8b8b8;
  background: #fff;
  cursor: pointer;
}
