@import url("css/utility-nav.css");

:root {
  --bg: #f4efe7;
  --bg-accent: #efe4d2;
  --surface: rgba(255, 252, 247, 0.76);
  --surface-strong: rgba(255, 250, 242, 0.92);
  --surface-dark: #1e2431;
  --text: #1b1f26;
  --muted: #596272;
  --line: rgba(33, 40, 52, 0.12);
  --line-strong: rgba(33, 40, 52, 0.2);
  --primary: #0f766e;
  --primary-strong: #115e59;
  --warm: #d97706;
  --shadow: 0 24px 80px rgba(31, 41, 55, 0.12);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Avenir Next", "Trebuchet MS", "Gill Sans", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.16), transparent 30%),
    radial-gradient(circle at 85% 10%, rgba(217, 119, 6, 0.18), transparent 24%),
    linear-gradient(180deg, #faf6ef 0%, var(--bg) 50%, #ebe2d4 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.5), transparent 80%);
  opacity: 0.28;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

.page-shell {
  width: min(1380px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 56px;
}

.hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 28px;
  padding: 36px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(135deg, rgba(255, 251, 245, 0.94), rgba(244, 233, 213, 0.9)),
    rgba(255, 255, 255, 0.6);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.hero::after {
  content: "";
  position: absolute;
  right: -120px;
  top: -120px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(15, 118, 110, 0.22), transparent 68%);
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--primary-strong);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero__title {
  margin: 18px 0 10px;
  max-width: 12ch;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  font-size: clamp(2.7rem, 6vw, 5.6rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.hero__lede {
  max-width: 62ch;
  margin: 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.6;
}

.hero__content {
  position: relative;
  z-index: 1;
}

.hero__visual {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
}

.hero-shot {
  width: 100%;
  max-width: min(100%, 620px);
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.52);
  background: rgba(255, 255, 255, 0.5);
  box-shadow: 0 24px 60px rgba(17, 24, 39, 0.12);
}

.hero-shot img {
  display: block;
  width: 100%;
  height: auto;
}

.hero__meta,
.hero__actions,
.stats,
.toolbar,
.toolbar__group,
.segmented,
.font-card__meta,
.font-card__actions,
.table-actions,
.dialog__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero__meta {
  margin-top: 28px;
}

.pill,
.segmented button,
.action-btn,
.filter-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--text);
}

.pill {
  padding: 10px 14px;
  font-size: 0.94rem;
  color: var(--muted);
}

.pill strong {
  color: var(--text);
}

.hero__actions {
  margin-top: 24px;
}

.action-btn {
  padding: 12px 16px;
  text-decoration: none;
  font-weight: 700;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.action-btn:hover,
.action-btn:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(15, 118, 110, 0.32);
}

.action-btn--primary {
  background: var(--surface-dark);
  color: #f8fafc;
  border-color: transparent;
}

.stats {
  margin: 26px 0 0;
}

.stat-card {
  min-width: 160px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.42);
}

.stat-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1.6rem;
  letter-spacing: -0.03em;
}

.stat-card span {
  color: var(--muted);
  font-size: 0.94rem;
}

.toolbar-shell {
  position: sticky;
  top: 18px;
  z-index: 20;
  margin-top: 24px;
}

.toolbar {
  align-items: center;
  justify-content: space-between;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 22px;
  background: rgba(255, 250, 243, 0.82);
  backdrop-filter: blur(16px);
  box-shadow: 0 16px 46px rgba(17, 24, 39, 0.08);
}

.toolbar__group {
  align-items: center;
}

.field {
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
}

.field input,
.field select {
  border: 0;
  background: transparent;
  color: var(--text);
  min-width: 0;
  outline: 0;
}

.field--search {
  min-width: min(420px, 100%);
  gap: 10px;
}

.field--search input {
  width: 100%;
}

.filter-chip {
  position: relative;
  padding: 0 16px;
  min-height: 52px;
}

.filter-chip input {
  accent-color: var(--primary);
}

.segmented {
  padding: 4px;
}

.segmented button {
  border: 0;
  padding: 12px 16px;
  background: transparent;
  cursor: pointer;
  font-weight: 700;
  color: var(--muted);
}

.segmented button.is-active {
  background: var(--surface-dark);
  color: #f8fafc;
}

.results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 20px 2px 14px;
  color: var(--muted);
}

.results-bar strong {
  color: var(--text);
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 18px;
}

.font-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 18px 48px rgba(17, 24, 39, 0.08);
  backdrop-filter: blur(14px);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.font-card:hover,
.font-card:focus-within {
  transform: translateY(-4px);
  box-shadow: 0 26px 60px rgba(17, 24, 39, 0.12);
  border-color: rgba(15, 118, 110, 0.22);
}

.font-card__preview {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 150px;
  padding: 12px 16px 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(240, 232, 219, 0.92));
}

.font-card__preview img {
  width: 100%;
  height: auto;
  max-height: 165px;
  object-fit: contain;
  filter: drop-shadow(0 14px 20px rgba(15, 23, 42, 0.12));
}

.font-card__body {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.font-card__title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.font-card__title {
  margin: 0;
  font-size: 1.18rem;
  letter-spacing: -0.02em;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge--mono {
  background: rgba(217, 119, 6, 0.14);
  color: #9a5704;
}

.badge--proportional {
  background: rgba(15, 118, 110, 0.11);
  color: var(--primary-strong);
}

.meta-chip {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(33, 40, 52, 0.08);
  color: var(--muted);
  font-size: 0.92rem;
}

.meta-chip strong {
  color: var(--text);
}

.font-card__actions,
.table-actions {
  margin-top: 2px;
}

.button,
.ghost-button,
.table-button {
  cursor: pointer;
  border: 0;
  border-radius: 12px;
  padding: 11px 13px;
  font-weight: 700;
  transition: transform 140ms ease, opacity 140ms ease, background 140ms ease;
}

.button:hover,
.ghost-button:hover,
.table-button:hover,
.button:focus-visible,
.ghost-button:focus-visible,
.table-button:focus-visible {
  transform: translateY(-1px);
}

.button {
  background: var(--surface-dark);
  color: #f8fafc;
}

.ghost-button,
.table-button {
  background: rgba(255, 255, 255, 0.76);
  color: var(--text);
  border: 1px solid var(--line);
}

.copy-flash {
  animation: copyFlash 700ms ease;
}

@keyframes copyFlash {
  0% {
    background: rgba(255, 255, 255, 0.76);
    border-color: var(--line);
    box-shadow: none;
  }

  35% {
    background: rgba(15, 118, 110, 0.18);
    border-color: rgba(15, 118, 110, 0.42);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
  }

  100% {
    background: rgba(255, 255, 255, 0.76);
    border-color: var(--line);
    box-shadow: none;
  }
}

.catalog-table-wrap {
  width: 100%;
  max-width: 100%;
  margin-left: 0;
  overflow: auto;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: var(--surface-strong);
  box-shadow: 0 22px 50px rgba(17, 24, 39, 0.08);
}

table {
  width: 100%;
  min-width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

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

th:nth-child(2),
td:nth-child(2) {
  width: 60%;
  padding-left: 8px;
  padding-right: 8px;
}

th:nth-child(1),
td:nth-child(1) {
  width: 16%;
}

th:nth-child(3),
td:nth-child(3) {
  width: 10%;
}

th:nth-child(4),
td:nth-child(4) {
  width: 14%;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(245, 238, 228, 0.95);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.78rem;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.6);
}

.table-name {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.table-preview {
  display: block;
  width: auto;
  max-width: 100%;
  height: 170px;
  border-radius: 12px;
  object-fit: contain;
  margin: 4px 0;
  filter:
    drop-shadow(0 10px 18px rgba(15, 23, 42, 0.12))
    drop-shadow(0 0 10px rgba(255, 255, 255, 0.2));
}

td:nth-child(2) .ghost-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 2px 0;
  background: transparent;
  border-color: transparent;
}


.empty-state {
  padding: 48px 24px;
  text-align: center;
  border: 1px dashed rgba(33, 40, 52, 0.2);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.46);
  color: var(--muted);
}

.empty-state strong {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 1.08rem;
}

.dialog {
  width: min(960px, calc(100% - 24px));
  border: 0;
  padding: 0;
  border-radius: 26px;
  background: transparent;
}

.dialog::backdrop {
  background: rgba(15, 23, 42, 0.56);
  backdrop-filter: blur(6px);
}

.dialog__panel {
  overflow: hidden;
  border-radius: 26px;
  background: #f7f1e8;
  box-shadow: 0 36px 80px rgba(15, 23, 42, 0.28);
}

.dialog__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 22px 0;
}

.dialog__title {
  margin: 0;
  font-size: 1.5rem;
}

.dialog__preview {
  padding: 18px 22px 10px;
}

.dialog__preview img {
  display: block;
  width: 100%;
  max-height: 66vh;
  object-fit: contain;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(241, 233, 220, 0.98));
  padding: 24px;
}

.dialog__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 22px 22px;
}

.dialog__body {
  padding: 18px 22px 22px;
}

.license-copy {
  max-height: 60vh;
  margin: 0;
  overflow: auto;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(33, 40, 52, 0.1);
  background: rgba(255, 255, 255, 0.7);
  color: var(--text);
  font-family: "SFMono-Regular", "Consolas", "Liberation Mono", monospace;
  font-size: 0.92rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

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

.hidden {
  display: none !important;
}

@media (max-width: 900px) {
  .page-shell {
    width: min(100% - 20px, 1380px);
    padding-top: 16px;
  }

  .hero {
    grid-template-columns: 1fr;
    padding: 24px;
  }

  .toolbar {
    gap: 14px;
  }

  .toolbar__group {
    width: 100%;
  }

  .field--search {
    min-width: 0;
    width: 100%;
  }

  .results-bar {
    flex-direction: column;
    align-items: flex-start;
  }

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

  th:nth-child(4),
  td:nth-child(4) {
    display: none;
  }
}

@media (max-width: 640px) {
  .hero__title {
    max-width: none;
  }

  .stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat-card {
    min-width: 0;
  }

  .dialog__footer,
  .dialog__header {
    flex-direction: column;
    align-items: flex-start;
  }
}
