:root {
  --ink: #0f1f1b;
  --ink-2: #4a5a55;
  --ink-3: #7b8985;
  --line: #e3e8e5;
  --surface: #ffffff;
  --canvas: #f4f6f4;
  --brand: #0e4a3f;
  --brand-hover: #0a3a31;
  --brand-tint: #e5f2ec;
  --radius: 12px;
  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "Instrument Sans", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 15px/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

button {
  font: inherit;
}

/* Top bar */
.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 60px;
  padding: 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 700 18px/1 var(--font-display);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.logo {
  display: block;
  width: auto;
  height: 26px;
  flex: none;
}

.bar-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
  padding-left: 16px;
  border-left: 1px solid var(--line);
}

.bar-name {
  overflow: hidden;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.bar-cat {
  color: var(--ink-3);
  font-size: 13px;
  white-space: nowrap;
}

.devices {
  display: inline-flex;
  margin-left: auto;
  padding: 3px;
  border-radius: 999px;
  background: var(--canvas);
}

.devices button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.devices button:hover {
  color: var(--ink);
}

.devices button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(15, 31, 27, 0.12);
}

.bar-nav {
  display: inline-flex;
  gap: 4px;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  color: var(--ink-2);
  transition: background 0.15s, color 0.15s;
}

.icon-btn:hover {
  background: var(--canvas);
  color: var(--ink);
}

.cta {
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, transform 0.15s;
}

.cta:hover {
  background: var(--brand-hover);
  transform: translateY(-1px);
}

.home .cta {
  margin-left: auto;
}

/* Viewer */
.viewer {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.stage {
  flex: 1;
  display: flex;
  justify-content: center;
  min-height: 0;
}

.frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
  transition: width 0.25s ease;
}

.stage[data-device="mobile"] {
  padding: 20px 0;
}

.stage[data-device="mobile"] .frame {
  width: 390px;
  border-radius: 20px;
  box-shadow: 0 0 0 1px var(--line), 0 12px 32px rgba(15, 31, 27, 0.12);
}

/* Index */
.wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 40px 16px 64px;
}

.intro h1 {
  margin: 0 0 6px;
  font: 700 clamp(28px, 4vw, 40px)/1.1 var(--font-display);
  letter-spacing: -0.02em;
}

.intro p {
  margin: 0;
  color: var(--ink-2);
}

.tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 28px 0 20px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.chip:hover {
  border-color: var(--ink-3);
  color: var(--ink);
}

.chip[aria-pressed="true"] {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.search {
  width: 260px;
  max-width: 100%;
  height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font: inherit;
}

.search:focus {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

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

.card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(15, 31, 27, 0.1);
}

.card[hidden] {
  display: none;
}

.card-media {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--canvas);
}

.card-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.card:hover .card-media img {
  transform: scale(1.03);
}

.card-body {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
}

.card-name {
  font-weight: 600;
}

.card-cat {
  color: var(--ink-3);
  font-size: 13px;
}

.empty {
  padding: 40px 0;
  color: var(--ink-3);
  text-align: center;
}

@media (max-width: 860px) {
  .bar-cat,
  .devices span,
  .bar-nav {
    display: none;
  }
}

@media (max-width: 700px) {
  .viewer .devices,
  .bar-title {
    display: none;
  }

  .viewer .cta {
    margin-left: auto;
  }

  .stage[data-device="mobile"] {
    padding: 0;
  }

  .stage[data-device="mobile"] .frame {
    width: 100%;
    border-radius: 0;
    box-shadow: none;
  }

  .search {
    width: 100%;
  }
}
