:root {
  --bg: #000000;
  --text: #ffffff;
  --muted: #aaaaaa;
  --line: #333333;
  --font-mono: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  transition: none !important;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.6;
  max-width: 860px;
  margin: 32px auto;
  border: 2px solid var(--line);
}

header {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  border-bottom: 2px solid var(--line);
}

header > a {
  display: flex;
  align-items: center;
  padding: 12px 18px;
  text-decoration: none;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-right: 2px solid var(--line);
}

nav {
  display: flex;
  align-items: stretch;
}

nav a,
header button {
  display: flex;
  align-items: center;
  padding: 12px 18px;
  color: var(--text);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: none;
  border: none;
  border-left: 2px solid var(--line);
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  margin-left: 0;
}

main {
  padding: 32px 24px;
}

footer {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  border-top: 2px solid var(--line);
}

footer a {
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-right: 2px solid var(--line);
}

header > a:hover,
nav a:hover,
header button:hover,
footer a:hover {
  background: var(--text);
  color: var(--bg);
  text-decoration: none;
}

header > a.active,
nav a.active,
footer a.active {
  font-weight: bold;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

ul {
  list-style: none;
  border-top: 2px solid var(--line);
}

li {
  margin-bottom: 0;
  border-bottom: 1px solid var(--line);
}

.ledger-row {
  display: grid;
  grid-template-columns: 64px 72px 1fr auto;
  gap: 12px;
  align-items: baseline;
  padding: 10px 12px;
  text-decoration: none;
  color: var(--text);
}

.ledger-row--text {
  grid-template-columns: 64px 120px 1fr;
}

.ledger-row:hover {
  background: var(--text);
  color: var(--bg);
}

.ledger-row:hover .muted {
  color: var(--bg);
}

.ledger-id {
  font-weight: bold;
}

.intro {
  margin-bottom: 40px;
}

.intro p {
  margin-bottom: 16px;
}

a {
  color: var(--text);
}

main p a:hover {
  background: var(--text);
  color: var(--bg);
  text-decoration: none;
}

.muted {
  color: var(--muted);
}

main h1,
main h2,
main h3 {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 15px;
  border-bottom: 2px solid var(--line);
  padding-bottom: 8px;
  margin-top: 28px;
  margin-bottom: 20px;
}

main > h1:first-child,
main > h2:first-child,
main > h3:first-child {
  margin-top: 0;
}

main p {
  margin-bottom: 16px;
  text-align: justify;
}

.artwork-meta p {
  text-align: left;
  margin-bottom: 0;
}

main img {
  max-width: 100%;
  max-height: 480px;
  width: auto;
  height: auto;
  display: block;
  margin: 24px auto;
  border: 2px solid var(--line);
}

.artwork-frame {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 24px;
  margin-bottom: 24px;
  padding: 24px;
  border: 2px solid var(--line);
}

.artwork-frame a {
  display: inline-block;
  line-height: 0;
}

.artwork-frame img {
  width: auto;
  height: 480px;
  max-width: 100%;
  object-fit: contain;
  display: block;
  margin: 0;
  border: none;
}

.artwork-meta {
  margin-bottom: 24px;
  color: var(--text);
}

.spec-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  border: 2px solid var(--line);
}

.spec-label,
.spec-value {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}

.spec-label {
  color: var(--muted);
  text-transform: uppercase;
  border-right: 1px solid var(--line);
  font-weight: bold;
}

.spec-grid > :nth-last-child(-n+2) {
  border-bottom: none;
}

.artwork-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  font-size: 12px;
}

.text-meta {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: -12px;
  margin-bottom: 24px;
  text-align: left;
}

.text-nav-bar {
  margin-top: 32px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.artwork-view-link,
.work-nav-link {
  display: inline-block;
  font-size: 12px;
  color: var(--muted);
  text-decoration: underline;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.work-nav-disabled {
  font-size: 12px;
  color: var(--line);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.viewer-bar a {
  display: inline-block;
  border: 1px solid var(--text);
  padding: 3px 10px;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: bold;
}

.artwork-view-link:hover,
.work-nav-link:hover,
.viewer-bar a:hover {
  background: var(--text);
  color: var(--bg);
  text-decoration: none;
}

.viewer-body {
  max-width: none;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.viewer-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: none;
}

.viewer-container img {
  max-width: 96vw;
  max-height: calc(100vh - 110px);
  max-height: calc(100dvh - 110px);
  width: auto;
  height: auto;
  display: block;
  object-fit: contain;
  border: 2px solid var(--line);
}

.viewer-bar {
  margin-top: 12px;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  text-align: center;
  border: 1px solid var(--line);
  padding: 8px 16px;
}

body.text-page,
body.work-page {
  --bg: #000000;
  --text: #ffffff;
  --muted: #aaaaaa;
  --line: #333333;
  background: var(--bg);
  color: var(--text);
}

.bio-section {
  margin-top: 24px;
  margin-bottom: 40px;
}

.bio-text p {
  margin-bottom: 16px;
}

.hidden-field {
  display: none;
}

.contact-form {
  border: 2px solid var(--line);
  margin-top: 16px;
}

.form-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  border-bottom: 1px solid var(--line);
}

.form-label {
  padding: 10px 12px;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: bold;
  border-right: 1px solid var(--line);
}

.form-input {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg);
  color: var(--text);
  border: none;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
}

.form-input:focus {
  outline: none;
  background: #111111;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  padding: 10px 12px;
}

.form-submit {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--text);
  padding: 6px 18px;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
}

.form-submit:hover {
  background: var(--text);
  color: var(--bg);
}

.legal-bar {
  margin-top: 24px;
  display: flex;
  justify-content: flex-end;
}

.legal-link {
  font-size: 11px;
  color: var(--muted);
  text-decoration: underline;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.legal-link:hover {
  background: var(--text);
  color: var(--bg);
  text-decoration: none;
}

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay:target {
  display: flex;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  cursor: default;
}

.modal-box {
  position: relative;
  z-index: 1;
  background: var(--bg);
  border: 2px solid var(--text);
  max-width: 680px;
  width: 100%;
  max-height: 85vh;
  max-height: 85dvh;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 2px solid var(--line);
  font-weight: bold;
  letter-spacing: 0.06em;
}

.modal-close {
  text-decoration: none;
  text-transform: uppercase;
  font-size: 12px;
  border: 1px solid var(--text);
  padding: 2px 8px;
}

.modal-close:hover {
  background: var(--text);
  color: var(--bg);
}

.modal-body {
  padding: 20px 16px;
  overflow-y: auto;
  font-size: 12px;
}

.modal-body h2 {
  font-size: 13px;
  margin-top: 20px;
  margin-bottom: 12px;
}

.modal-body h2:first-child {
  margin-top: 0;
}
