@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  color-scheme: light;
  --ink: #20221f;
  --muted: #898b84;
  --paper: #f6f6f2;
  --line: #e8e9e3;
  --accent: #a6c95f;
  --sidebar-width: 240px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "DM Sans", "Segoe UI", sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }

.app-shell { min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 2;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  padding: 30px 18px 24px;
  overflow-y: auto;
  background: #fff;
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 10px;
  margin: 1px 0 58px 6px;
  font-family: Manrope, "Segoe UI", sans-serif;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -1px;
}

.brand-period { color: #9fbe57; }

.brand-mark {
  display: grid;
  width: 29px;
  height: 29px;
  grid-template-columns: repeat(2, 1fr);
  gap: 3px;
  transform: rotate(-8deg);
}

.brand-mark i { border-radius: 4px; background: #a6c95f; }
.brand-mark i:nth-child(2) { background: #d5e5ae; }
.brand-mark i:nth-child(3) { background: #d5e5ae; }
.brand-mark i:nth-child(4) { background: #42483a; }

.sidebar-section { min-height: 0; flex: 0 0 auto; }
.section-label, .eyebrow {
  margin: 0;
  color: #999b93;
  font-family: "DM Mono", Consolas, monospace;
  font-size: 10px;
  letter-spacing: 1.05px;
}

.section-label { padding: 0 10px 13px; }
.category-list { display: grid; gap: 3px; }

.category-link {
  display: flex;
  min-height: 38px;
  align-items: center;
  gap: 11px;
  padding: 0 10px;
  border-radius: 7px;
  color: #666961;
  font-size: 13px;
  transition: background .16s ease, color .16s ease;
}

.category-link:hover { background: #f5f6f1; color: var(--ink); }
.category-link[aria-current="page"] { background: #eff3e6; color: #39452a; font-weight: 600; }
.category-icon { width: 17px; color: #8f9386; text-align: center; font-size: 15px; }
.category-link[aria-current="page"] .category-icon { color: #718d3e; }
.category-count { margin-left: auto; color: #a2a49d; font-family: "DM Mono", Consolas, monospace; font-size: 10px; }

.sidebar-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 22px;
  padding: 16px 11px;
  border: 1px solid #eceee5;
  border-radius: 9px;
  background: #fafbf7;
}

.note-icon { color: #8cab4e; font-size: 17px; line-height: 20px; }
.sidebar-note p { margin: 0; color: #74776e; font-size: 11px; line-height: 1.65; }
.sidebar-credit { margin: 16px 10px 0; color: #a8aaa2; font-size: 10px; }

.main-content { min-height: 100vh; margin-left: var(--sidebar-width); padding: 0 54px; }
.topbar {
  display: flex;
  height: 68px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.breadcrumb { display: flex; align-items: center; gap: 10px; color: #a0a198; font-size: 11px; }
.breadcrumb strong { color: #565950; font-weight: 600; }
.topbar-actions { display: flex; align-items: center; gap: 16px; }
.topbar-link { color: #73766d; font-size: 11px; transition: color .16s ease; }
.topbar-link:hover { color: #607b37; }
.topbar-link > span[aria-hidden="true"] { margin-left: 4px; }
.language-switch { display: flex; gap: 2px; padding: 3px; border: 1px solid #e4e6de; border-radius: 7px; background: #fff; }
.language-button { min-width: 30px; padding: 4px 5px; border: 0; border-radius: 4px; background: transparent; color: #85877f; cursor: pointer; font-family: "DM Mono", Consolas, monospace; font-size: 9px; }
.language-button[aria-pressed="true"] { background: #eff3e6; color: #39452a; font-weight: 500; }
.language-button:focus-visible { outline: 2px solid #a6c95f; outline-offset: 2px; }

.intro {
  position: relative;
  display: flex;
  min-height: 316px;
  align-items: center;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.intro-copy { position: relative; z-index: 1; padding: 39px 0 46px; }
.eyebrow { display: flex; align-items: center; gap: 8px; }
.eyebrow-dot { width: 6px; height: 6px; border-radius: 50%; background: #a7c75e; }

h1, h2, h3, p { margin-top: 0; }
h1 {
  margin: 18px 0 13px;
  font-family: Manrope, "Segoe UI", sans-serif;
  font-size: clamp(40px, 4.4vw, 60px);
  font-weight: 600;
  letter-spacing: -3.7px;
  line-height: .99;
}

h1 span { color: #8fae4c; }
.intro-description { max-width: 380px; margin: 0; color: #85877f; font-size: 13px; line-height: 1.65; }

.intro-art {
  position: absolute;
  top: 0;
  right: 3%;
  width: 330px;
  height: 300px;
}

.art-orbit { position: absolute; width: 270px; height: 270px; border: 1px solid #e7e9dd; border-radius: 50%; }
.orbit-one { top: 22px; left: 23px; }
.orbit-two { top: 46px; left: 47px; width: 220px; height: 220px; }
.art-card {
  position: absolute;
  top: 75px;
  left: 96px;
  width: 137px;
  height: 165px;
  border: 1px solid #e1e4d8;
  border-radius: 12px;
}

.art-card-back { transform: rotate(13deg) translate(18px, 5px); background: #e9eddf; }
.art-card-front {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 14px;
  transform: rotate(-8deg);
  background: #fff;
  box-shadow: 0 14px 38px #464c3214;
}

.art-card-front span { width: 25px; height: 4px; border-radius: 4px; background: #d9e7bd; }
.art-card-front span:nth-child(2) { width: 47px; background: #edf0e6; }
.art-card-front span:nth-child(3) { width: 36px; background: #edf0e6; }
.art-card-front b { margin-top: 5px; font-family: Manrope, "Segoe UI", sans-serif; font-size: 21px; letter-spacing: -1.1px; line-height: 1.08; }
.art-spark { position: absolute; z-index: 1; color: #a7c75e; }
.spark-one { top: 48px; right: 57px; font-size: 22px; }
.spark-two { bottom: 43px; left: 60px; color: #c6d79d; font-size: 18px; }

.library { padding: 38px 0 50px; }
.collection-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.collection-eyebrow { margin-bottom: 8px; }
h2 { margin: 0; font-family: Manrope, "Segoe UI", sans-serif; font-size: 22px; font-weight: 700; letter-spacing: -.8px; }
.total-count { margin-left: 6px; color: #a0a297; font-family: "DM Mono", Consolas, monospace; font-size: 11px; font-weight: 400; letter-spacing: 0; vertical-align: middle; }

.search-box {
  display: flex;
  width: min(270px, 38%);
  height: 39px;
  align-items: center;
  gap: 10px;
  padding: 0 10px 0 12px;
  border: 1px solid #e4e6de;
  border-radius: 7px;
  background: #fff;
}

.search-box:focus-within { border-color: #b5ca89; box-shadow: 0 0 0 3px #a6c95f18; }
.search-icon { position: relative; width: 14px; height: 14px; flex: 0 0 auto; border: 1.5px solid #96998f; border-radius: 50%; }
.search-icon::after { position: absolute; right: -4px; bottom: -2px; width: 5px; height: 1.5px; transform: rotate(45deg); background: #96998f; content: ""; }
.search-box input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 11px; }
.search-box input::placeholder { color: #a7a99f; }
kbd { padding: 2px 5px; border: 1px solid #e8e9e3; border-radius: 4px; color: #a3a59d; font-family: "DM Mono", Consolas, monospace; font-size: 10px; }

.active-filters { min-height: 27px; margin-top: 19px; color: #909289; font-size: 11px; }
.active-filters strong { color: #53564e; font-weight: 600; }
.component-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }

.component-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #e8e9e3;
  border-radius: 9px;
  background: #fff;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.component-card:hover { transform: translateY(-3px); border-color: #d9dfcb; box-shadow: 0 10px 26px #30351c0c; }
.card-preview {
  position: relative;
  display: grid;
  width: 100%;
  height: 142px;
  place-items: center;
  overflow: hidden;
  border: 0;
  border-bottom: 1px solid #f0f0eb;
  cursor: pointer;
}

.preview-0 { background: #f0f2e8; }
.preview-1 { background: #f5eee7; }
.preview-2 { background: #edf1f1; }
.preview-3 { background: #f2edf4; }
.preview-4 { background: #f5f1e5; }
.preview-5 { background: #eaf0e9; }
.preview-glow { position: absolute; width: 126px; height: 126px; border-radius: 50%; background: #ffffff8c; filter: blur(1px); }
.mini-window { position: relative; display: flex; width: 148px; height: 83px; flex-direction: column; gap: 8px; padding: 12px; transform: rotate(-3deg); border: 1px solid #e9e9e2; border-radius: 8px; background: #fff; box-shadow: 0 10px 24px #35391e12; transition: transform .2s ease; }
.component-card:hover .mini-window { transform: rotate(0deg) scale(1.04); }
.mini-dots { display: flex; gap: 3px; }
.mini-dots i { width: 4px; height: 4px; border-radius: 50%; background: #d6d8d0; }
.mini-line { width: 70%; height: 5px; border-radius: 8px; background: #eceee7; }
.mini-line.short { width: 43%; }
.mini-pill { width: 35px; height: 12px; margin-top: auto; border-radius: 8px; background: #d9e7bc; }
.preview-label { position: absolute; right: 12px; bottom: 10px; color: #a0a197; font-family: "DM Mono", Consolas, monospace; font-size: 9px; letter-spacing: .5px; }
.preview-action { position: absolute; top: 50%; left: 50%; padding: 7px 10px; transform: translate(-50%, 8px); border: 1px solid #eceee5; border-radius: 5px; background: #ffffffed; color: #45483f; font-size: 10px; opacity: 0; transition: opacity .16s ease, transform .16s ease; pointer-events: none; }
.component-card:hover .preview-action, .card-preview:focus-visible .preview-action { transform: translate(-50%, 0); opacity: 1; }
.card-details { display: flex; min-height: 67px; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 13px; }
.card-title { overflow: hidden; margin: 0 0 4px; font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.card-category { overflow: hidden; margin: 0; color: #999b93; font-family: "DM Mono", Consolas, monospace; font-size: 9px; letter-spacing: .55px; text-overflow: ellipsis; white-space: nowrap; }
.card-arrow { display: grid; width: 25px; height: 25px; flex: 0 0 auto; place-items: center; border: 1px solid #edeee8; border-radius: 50%; color: #777b70; font-size: 13px; transition: background .16s ease, color .16s ease; }
.component-card:hover .card-arrow { border-color: #dce8c6; background: #eff4e5; color: #667e3d; }

.empty-state { padding: 75px 20px; text-align: center; }
.empty-state[hidden] { display: none; }
.empty-state > span { color: #a5c264; font-size: 35px; }
.empty-state h3 { margin: 9px 0 6px; font-family: Manrope, "Segoe UI", sans-serif; font-size: 17px; }
.empty-state p { margin: 0; color: #898b84; font-size: 12px; }
.page-footer { display: flex; justify-content: space-between; padding: 17px 0 24px; border-top: 1px solid var(--line); color: #a1a39a; font-size: 10px; }

.preview-dialog {
  width: min(1100px, calc(100% - 40px));
  max-width: none;
  max-height: min(850px, calc(100% - 40px));
  padding: 0;
  overflow: hidden;
  border: 1px solid #e4e6de;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 24px 100px #171a0f40;
}

.preview-dialog::backdrop { background: #21231d91; backdrop-filter: blur(3px); }
.dialog-header { display: flex; min-height: 68px; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 18px; }
.dialog-category { margin: 0 0 4px; color: #91948a; font-family: "DM Mono", Consolas, monospace; font-size: 9px; letter-spacing: .8px; }
.dialog-header h2 { font-size: 16px; letter-spacing: -.3px; }
.dialog-actions { display: flex; align-items: center; gap: 15px; }
.open-original { color: #70746a; font-size: 11px; }
.open-original:hover { color: #607b37; }
.close-dialog { display: grid; width: 31px; height: 31px; place-items: center; border: 1px solid #e8e9e3; border-radius: 50%; background: #fff; cursor: pointer; font-size: 20px; line-height: 1; }
.close-dialog:hover { background: #f5f6f1; }
.preview-frame-wrap { height: min(74vh, 720px); border-top: 1px solid #e8e9e3; background: #f6f6f2; }
.preview-frame-wrap iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }

@media (min-width: 1500px) {
  .component-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .main-content { padding-right: 70px; padding-left: 70px; }
}

@media (max-width: 1100px) {
  :root { --sidebar-width: 210px; }
  .main-content { padding-right: 32px; padding-left: 32px; }
  .component-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .intro-art { right: -4%; opacity: .75; }
}

@media (max-width: 700px) {
  :root { --sidebar-width: 0px; }
  .sidebar { position: relative; width: auto; height: auto; padding: 15px 18px 0; border-right: 0; background: transparent; }
  .brand { margin: 0 0 15px; font-size: 17px; }
  .brand-mark { width: 25px; height: 25px; }
  .sidebar-section { overflow: hidden; }
  .section-label, .sidebar-note, .sidebar-credit { display: none; }
  .category-list { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 11px; scrollbar-width: none; }
  .category-list::-webkit-scrollbar { display: none; }
  .category-link { min-height: 31px; flex: 0 0 auto; gap: 0; padding: 0 10px; border: 1px solid #e7e9e2; background: #fff; font-size: 11px; }
  .category-icon, .category-count { display: none; }
  .main-content { min-height: auto; margin-left: 0; padding: 0 19px; }
  .topbar { height: auto; min-height: 47px; flex-wrap: wrap; gap: 8px 12px; padding: 8px 0; }
  .topbar-actions { gap: 7px; }
  .topbar-link { font-size: 10px; }
  .intro { min-height: 252px; }
  .intro-copy { padding: 34px 0; }
  h1 { font-size: 43px; letter-spacing: -2.6px; }
  .intro-description { max-width: 285px; font-size: 12px; }
  .intro-art { right: -130px; opacity: .38; }
  .library { padding-top: 29px; }
  .collection-heading { align-items: flex-start; flex-direction: column; gap: 16px; }
  .search-box { width: 100%; }
  .active-filters { margin-top: 15px; }
  .component-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card-preview { height: 112px; }
  .mini-window { width: 128px; transform: scale(.9) rotate(-3deg); }
  .card-details { min-height: 60px; padding: 10px; }
  .card-arrow { width: 22px; height: 22px; }
  .preview-dialog { width: calc(100% - 18px); max-height: calc(100% - 18px); }
  .dialog-header { padding: 10px 12px; }
  .dialog-actions { gap: 10px; }
  .open-original { font-size: 10px; }
  .preview-frame-wrap { height: 78vh; }
}

@media (max-width: 390px) {
  .component-grid { grid-template-columns: 1fr; }
  .card-preview { height: 135px; }
  .breadcrumb { gap: 6px; font-size: 10px; }
  .topbar-link { font-size: 10px; }
  .topbar-actions { gap: 5px; }
  .language-switch { gap: 0; padding: 2px; }
  .language-button { min-width: 27px; padding: 4px 3px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
