:root {
  --ink: #171717;
  --muted: #60646c;
  --line: #dedbd2;
  --paper: #f7f3eb;
  --panel: #fffdf8;
  --accent: #9b2f2f;
  --accent-dark: #681f1f;
  --gold: #c49346;
  --jade: #326b61;
  --shadow: 0 18px 45px rgba(23, 23, 23, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

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

img {
  display: block;
  max-width: 100%;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(23, 23, 23, 0.08);
  background: rgba(247, 243, 235, 0.92);
  backdrop-filter: blur(16px);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 72px;
  gap: 20px;
}

.brand,
.nav-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.brand-name {
  font-weight: 800;
  letter-spacing: 0;
}

.nav-actions {
  color: var(--muted);
  font-size: 14px;
}

.nav-actions a:hover {
  color: var(--ink);
}

.lang-toggle,
.button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.lang-toggle {
  min-width: 64px;
  padding: 9px 12px;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 42px;
  align-items: center;
  width: min(1180px, calc(100% - 32px));
  min-height: calc(100vh - 72px);
  margin: 0 auto;
  padding: 48px 0 64px;
}

.hero-content {
  max-width: 720px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 20px;
  max-width: 820px;
  font-size: clamp(42px, 7vw, 82px);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.04;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 680px;
  color: var(--muted);
  font-size: 18px;
}

.hero-actions,
.card-actions,
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
}

.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.button.primary:hover {
  background: var(--accent-dark);
}

.button.secondary:hover,
.lang-toggle:hover {
  border-color: var(--ink);
}

.button.small {
  min-height: 38px;
  padding: 0 14px;
  font-size: 14px;
}

button.button {
  appearance: none;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 34px 0 0;
}

.hero-stats div {
  border-left: 3px solid var(--gold);
  padding-left: 12px;
}

.hero-stats dt {
  font-size: 28px;
  font-weight: 900;
}

.hero-stats dd {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.hero-media {
  position: relative;
  min-height: 560px;
}

.hero-frame {
  position: absolute;
  overflow: hidden;
  border: 1px solid rgba(23, 23, 23, 0.12);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0)),
    radial-gradient(circle at 28% 22%, rgba(196, 147, 70, 0.48), transparent 32%),
    radial-gradient(circle at 74% 66%, rgba(50, 107, 97, 0.45), transparent 30%),
    linear-gradient(135deg, #321818, #7b2b2b 40%, #1f3e3a);
}

.hero-frame::after {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 4px;
}

.hero-frame-a {
  top: 18px;
  right: 30px;
  width: 68%;
  aspect-ratio: 4 / 5;
}

.hero-frame-b {
  bottom: 42px;
  left: 0;
  width: 56%;
  aspect-ratio: 1 / 1;
}

.hero-frame-c {
  right: 0;
  bottom: 0;
  width: 42%;
  aspect-ratio: 3 / 4;
}

.toolbar,
.section,
.library {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 420px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.search-box input {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  padding: 0 14px;
}

.filter-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  padding: 0 14px;
}

.filter-button.active {
  border-color: var(--jade);
  background: var(--jade);
  color: #fff;
}

.section {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(280px, 0.75fr);
  gap: 52px;
  align-items: end;
  padding: 78px 0 28px;
}

.section > p,
.license-grid p {
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  padding: 20px 0 42px;
}

.card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  background:
    linear-gradient(135deg, rgba(155, 47, 47, 0.18), rgba(50, 107, 97, 0.2)),
    #ece3d4;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb img[src=""],
.thumb img:not([src]) {
  display: none;
}

.count {
  position: absolute;
  right: 10px;
  bottom: 10px;
  border-radius: 999px;
  background: rgba(23, 23, 23, 0.82);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  padding: 6px 10px;
}

.card-body {
  padding: 18px;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.card h3 {
  margin-bottom: 8px;
  font-size: 22px;
  line-height: 1.12;
}

.card p {
  min-height: 66px;
  color: var(--muted);
  font-size: 15px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 28px;
  margin-bottom: 16px;
}

.tags span {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  padding: 4px 8px;
}

.empty-state {
  display: none;
  padding: 42px 0 82px;
  color: var(--muted);
  text-align: center;
}

.license {
  align-items: start;
  padding-bottom: 80px;
}

.license-grid {
  display: grid;
  gap: 14px;
}

.license-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 18px;
}

.license-grid .wide-notice {
  border-color: rgba(155, 47, 47, 0.32);
  background: #fff8f4;
}

.license-grid h3 {
  margin-bottom: 8px;
}

.footer {
  border-top: 1px solid var(--line);
  padding: 26px 16px;
  color: var(--muted);
  text-align: center;
}

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

.modal[aria-hidden="false"] {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23, 23, 23, 0.52);
}

.modal-panel {
  position: relative;
  width: min(620px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 26px;
}

.detail-panel {
  width: min(980px, 100%);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.checkout-summary {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}

.detail-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: start;
}

.detail-head p {
  color: var(--muted);
}

.detail-price {
  min-width: 130px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  text-align: right;
}

.detail-price span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.detail-price strong {
  color: var(--accent);
  font-size: 28px;
}

.detail-gallery {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 20px 0;
}

.gallery-tile {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  aspect-ratio: 4 / 3;
  background:
    linear-gradient(135deg, rgba(155, 47, 47, 0.16), rgba(50, 107, 97, 0.16)),
    #ece3d4;
}

.gallery-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-tile span {
  position: absolute;
  left: 8px;
  bottom: 8px;
  border-radius: 999px;
  background: rgba(23, 23, 23, 0.76);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  padding: 4px 8px;
}

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

.detail-footer p {
  margin-bottom: 0;
  color: var(--muted);
}

.summary-name {
  margin-bottom: 6px;
  font-size: 20px;
  font-weight: 900;
}

.summary-order,
.summary-record {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.summary-order {
  margin-bottom: 8px;
}

.summary-record {
  margin: 10px 0 0;
}

.summary-detail,
.checkout-note,
.crypto-box p {
  color: var(--muted);
}

.summary-price {
  margin-bottom: 0;
  color: var(--accent);
  font-size: 28px;
  font-weight: 900;
}

.checkout-options {
  display: grid;
  gap: 14px;
  margin: 16px 0;
}

.support-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.crypto-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}

.copy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.copy-row code {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  padding: 10px;
  white-space: nowrap;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

@media (max-width: 900px) {
  .hero,
  .section,
  .toolbar {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 34px;
  }

  .hero-content {
    order: 1;
  }

  .hero-media {
    order: 2;
    min-height: 430px;
  }

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

@media (max-width: 640px) {
  .nav {
    align-items: flex-start;
    flex-direction: column;
    min-height: 0;
    padding: 14px 0;
  }

  .nav-actions {
    width: 100%;
    justify-content: space-between;
  }

  h1 {
    font-size: 42px;
  }

  .hero-stats,
  .grid {
    grid-template-columns: 1fr;
  }

  .hero-media {
    min-height: 330px;
  }

  .hero-frame-a {
    right: 8px;
  }

  .card p {
    min-height: auto;
  }

  .detail-head,
  .detail-footer {
    grid-template-columns: 1fr;
    display: grid;
  }

  .detail-price {
    text-align: left;
  }

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