:root {
  --ink: #050505;
  --paper: #fbfbf8;
  --paper-dark: #f4f3ee;
  --muted: #686865;
  --line: #e5e5df;
  --accent: #050505;
  --green: #2d6f4b;
  --white: #fff8ea;
  --page-pad: 32px;
  --display: Inter, "Inter Variable", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --body: Inter, "Inter Variable", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: Inter, "Inter Variable", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  padding: var(--page-pad);
  color: var(--ink);
  background: var(--paper);
  font-family: var(--body);
  font-size: 14px;
  line-height: 1.25;
  text-rendering: geometricPrecision;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.masthead {
  min-height: 52vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  row-gap: 32px;
  padding: 0;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.admin-link,
.back-link,
.pill-nav a,
.view-pills button {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 12px;
  color: var(--ink);
  background: #f0f0ed;
  border: 1px solid transparent;
  font-family: var(--body);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
}

.admin-link {
  justify-self: end;
}

.masthead-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.pill-nav,
.view-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill-nav a:hover,
.view-pills button:hover,
.view-pills .is-active {
  color: var(--paper);
  background: var(--ink);
}

#site-title {
  grid-row: 1;
  margin: 0;
  font-family: var(--display);
  font-size: 120px;
  font-weight: 900;
  line-height: 0.84;
  letter-spacing: 0;
  text-transform: uppercase;
  white-space: nowrap;
  width: 100%;
  overflow: visible;
}

.intro {
  grid-row: 3;
  align-self: start;
  justify-self: end;
  width: min(520px, 42vw);
  margin-top: 0;
  font-size: clamp(18px, 1.45vw, 26px);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: 0;
  text-wrap: balance;
}

.intro p {
  margin: 0;
}

.archive-count {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: right;
}

.work-toolbar {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0 14px;
  border-bottom: 1px solid var(--line);
}

.view-pills button {
  cursor: pointer;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border-bottom: 1px solid var(--ink);
  padding-top: 0;
}

.work-card {
  min-width: 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--paper-dark);
  transition: background-color 160ms ease;
}

.work-card a {
  display: block;
}

.work-card img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: var(--paper-dark);
  filter: saturate(0.94) contrast(1.02);
  transition: filter 180ms ease;
}

.work-card:hover {
  background: var(--paper-dark);
}

.work-card:hover img {
  filter: saturate(1.05) contrast(1.04);
}

.work-meta {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  padding: 12px clamp(12px, 1.8vw, 22px) 18px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  text-transform: uppercase;
}

.work-title {
  overflow-wrap: anywhere;
}

.work-category {
  color: var(--muted);
  text-align: right;
}

.empty-state {
  min-height: 34vh;
  margin: 0;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  border-bottom: 1px solid var(--ink);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  background: var(--paper-dark);
  border-radius: 8px;
  padding: 14px;
}

.site-footer {
  min-height: 30vh;
  display: grid;
  grid-template-columns: 32px 1fr 1fr 1fr;
  align-items: start;
  gap: 32px;
  padding: 18px 0 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.footer-logo {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: var(--paper);
  background: var(--ink);
  font-family: var(--display);
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

.site-footer nav {
  display: grid;
  gap: 0;
  justify-self: end;
}

.site-footer p {
  margin: 0;
}

.site-footer a:hover,
.admin-link:hover,
.back-link:hover {
  color: var(--accent);
}

.admin-page {
  font-family: var(--mono);
}

.admin-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 0 0 28px;
  border-bottom: 1px solid var(--line);
}

.admin-header h1 {
  font-family: var(--display);
  font-size: clamp(54px, 10vw, 140px);
  line-height: 0.8;
  text-align: right;
  margin: 0;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
  text-transform: uppercase;
}

.admin-shell {
  padding: 32px 0 0;
}

.token-panel,
.upload-panel,
.table-wrap {
  border-top: 1px solid var(--ink);
  padding: 18px 0 28px;
}

.token-panel label,
.upload-panel label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.token-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  max-width: 620px;
}

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

.wide {
  grid-column: span 2;
}

input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--white);
}

input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.admin-page button {
  min-height: 42px;
  border: 1px solid var(--ink);
  border-radius: 0;
  padding: 10px 16px;
  color: var(--paper);
  background: var(--ink);
  cursor: pointer;
}

.admin-page button:hover {
  background: var(--accent);
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
}

.check-row {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 9px !important;
}

.check-row input {
  width: 18px;
  min-height: 18px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
  background: var(--paper);
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: middle;
  font-size: 12px;
}

th {
  color: var(--muted);
  font-weight: 400;
  text-transform: uppercase;
}

td img {
  width: 118px;
  height: 74px;
  object-fit: cover;
  background: var(--white);
}

td input {
  min-height: 36px;
  padding: 7px 9px;
}

.row-actions {
  display: flex;
  gap: 8px;
}

.ghost-button {
  color: var(--ink);
  background: transparent;
}

.danger-button:hover {
  background: #8e1f12;
}

.cms-message {
  min-height: 24px;
  color: var(--green);
}

@media (max-width: 760px) {
  .masthead {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    min-height: auto;
    padding-bottom: 32px;
  }

  #site-title {
    font-size: 58px;
    line-height: 0.76;
  }

  .intro {
    grid-row: 3;
    justify-self: start;
    width: 100%;
    max-width: none;
    font-size: 18px;
    line-height: 1.08;
  }

  .masthead-bar,
  .work-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-link {
    justify-self: start;
  }

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

  .site-footer,
  .admin-header {
    align-items: flex-start;
  }

  .site-footer {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .admin-header h1,
  .eyebrow {
    text-align: left;
  }

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

  .wide {
    grid-column: span 1;
  }

  .token-row {
    grid-template-columns: 1fr;
  }
}
