@font-face {
  font-family: "Inter";
  src: url("/fonts/Inter-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("/fonts/Inter-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("/fonts/Inter-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  /* tokens aligned with tailwind.config.js */
  --color-brand: #e91e63;
  --color-accent: #d60017;
  --color-on-accent: #ffffff;
  --color-primary: #030712;
  --color-on-primary: #ffffff;
  --color-outline: rgba(0, 0, 0, 0.1);
  --color-background: #fafafa;
  --color-on-background: #030712;
  --color-surface: #ffffff;
  --color-on-surface: #212121;
  --color-card: #ffffff;
  --color-on-card: #0f172a;
  --color-secondary: #f4f4f5;
  --color-on-secondary: #18181b;

  /* local aliases */
  --bg: var(--color-background);
  --surface: var(--color-surface);
  --text: var(--color-on-surface);
  --muted: #6b7280;
  --accent: var(--color-accent);
  --border: var(--color-outline);

  --announcement-height: 38px;
  --app-bar-height: 52px;
  --docs-navbar-height: 58px;
  --app-bar-scroll-offset: 87px;
  --radius: 12px;
  --container: 960px;
}

* { box-sizing: border-box; }

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: "Inter", "Avenir Next", "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.5;
}

.bodyLarge {
  font-family: "Inter", "Avenir Next", "Segoe UI", sans-serif;
  font-size: 1.125rem;
  font-weight: 400;
  line-height: 1.5;
}

.container {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
}

.app-chrome {
  border-bottom: 1px solid #e6e6e6;
  background: #fff;
}

.announcement-bar {
  background: var(--accent);
  color: var(--color-on-accent);
  min-height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
}

.announcement-bar a {
  color: inherit;
  text-decoration: none;
}

.appbar {
  border-top: 1px solid rgba(0, 0, 0, 0.03);
  border-bottom: 1px solid #ececec;
  min-height: 52px;
  display: flex;
  align-items: center;
}

.appbar-inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.appbar-left,
.appbar-right {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.08rem;
}

.brand img {
  display: block;
}

.app-link {
  color: #2f3541;
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 500;
}

.app-link:hover {
  color: #111827;
}

.new-badge {
  margin-left: 0.25rem;
  padding: 0.05rem 0.3rem;
  border-radius: 999px;
  background: #f03d3d;
  color: #fff;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.app-icon {
  font-weight: 700;
}

.app-pill {
  border: 1px solid #dadde3;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
}

.main-content { padding: 2.2rem 0; }

.main-bleed.main-content {
  width: 100%;
  margin: 0;
  padding: 0;
}

.hero {
  padding: 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 30px rgba(18, 16, 14, 0.05);
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
}

h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.8rem, 4.2vw, 2.8rem);
  line-height: 1.1;
}

p { line-height: 1.6; }

.button {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  background: var(--accent);
  color: white;
}

.grid-links {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.panel-link {
  display: block;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  padding: 0.9rem 1rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
}

.panel-link:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}

.debug-wrap {
  width: 100vw;
  margin-top: -2.2rem;
  margin-left: 50%;
  transform: translateX(-50%);
  position: sticky;
  top: 0;
  z-index: 30;
}

.main-bleed .debug-wrap {
  margin-top: 0;
}

.app-sticky {
  position: static;
  width: 100%;
}

.announcement {
  background: var(--accent);
  color: var(--color-on-accent);
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.announcement a {
  color: inherit;
  text-decoration: none;
  font-weight: 500;
}

.announcement a:hover {
  text-decoration: underline;
}

.kdbg-max {
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
}

.kdbg-appbar {
  min-height: 52px;
  border-bottom: 1px solid #e5e7eb;
  background: #fff;
  padding: 0 1rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.kdbg-row {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kdbg-left,
.kdbg-right,
.kdbg-desktop-links {
  display: flex;
  align-items: center;
}

.kdbg-left {
  gap: 2.5rem;
}

.kdbg-desktop-links,
.kdbg-right {
  gap: 0.75rem;
}

.kdbg-home {
  display: inline-flex;
  align-items: center;
  color: #111827;
  text-decoration: none;
}

.home-wordmark {
  height: 24px;
  width: auto;
  display: block;
}

.appbar-action {
  color: #1f2937;
  font-size: 0.875rem;
  font-weight: 500;
}

.appbar-developers {
  gap: 0.25rem;
}

.kdbg-badge {
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1;
  color: var(--color-on-accent);
  background: var(--accent);
  border-radius: 5px;
  padding: 0.18rem 0.3rem;
}

.appbar-icon {
  color: #1f2937;
  min-width: 32px;
  min-height: 32px;
  padding: 0.375rem;
  font-size: 1rem;
}

.appbar-github {
  color: #111827;
  font-size: 0.875rem;
  font-weight: 600;
  gap: 0.4rem;
  min-height: 32px;
  padding: 0.375rem 0.875rem;
}

.appbar-svg {
  width: 20px;
  height: 20px;
  display: block;
}

.tokens-page {
  max-width: 1120px;
  margin: 2rem auto 0;
  padding: 0 1rem 3rem;
}

.tokens-shell {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tokens-shell h1 {
  margin: 0;
  font-size: 2rem;
  line-height: 1.15;
}

.tokens-shell h2 {
  margin: 1rem 0 0;
  font-size: 1.25rem;
}

.tokens-shell p {
  margin: 0;
  color: #52525b;
}

.token-grid,
.meta-grid,
.type-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.token-card,
.meta-card,
.type-card {
  border: 1px solid var(--color-outline);
  background: var(--color-surface);
  border-radius: 10px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.token-card code,
.meta-card code,
.type-card code {
  font-size: 0.82rem;
}

.swatch {
  display: block;
  width: 100%;
  height: 34px;
  border-radius: 8px;
}

.type-card p {
  margin: 0;
}

.token-name {
  font-size: 0.9rem;
  font-weight: 500;
}

.shape-small {
  border-radius: 999px;
}

.interactive-size {
  min-width: 48px;
  min-height: 48px;
}

.indication {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.indication::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.1);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.indication:hover::before {
  opacity: 1;
}

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

.button-unstyled {
  -webkit-appearance: none;
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0.5rem 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.2s ease, filter 0.2s ease, transform 0.15s ease;
  border-radius: 9999px;
  min-width: 48px;
  min-height: 48px;
  line-height: 1;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

@media (min-width: 640px) {
  .button-unstyled {
    min-width: 32px;
    min-height: 32px;
  }
}

.button-unstyled::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.1);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.button-unstyled:hover::before {
  opacity: 1;
}

.button-unstyled:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.button-secondary {
  border: 1px solid var(--color-outline);
  background: var(--color-secondary);
  color: var(--color-on-secondary);
}

.button-secondary:hover {
  filter: brightness(0.93);
}

.button-primary {
  background: var(--color-primary);
  color: var(--color-on-primary);
}

.button-primary:hover {
  background: #1f2937;
}

.button-cta {
  padding: 1rem 2rem;
  background: linear-gradient(135deg, var(--accent), var(--accent));
  color: var(--color-on-accent);
}

.button-cta:hover {
  filter: brightness(1.12);
}

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

.button-ghost:hover {
  background: rgba(244, 244, 245, 0.8);
}

.button-icon {
  color: var(--color-on-background);
  padding: 0.5rem;
}

.button-icon:hover {
  background: var(--color-secondary);
}

.button-icon-outlined {
  border: 1px solid var(--color-outline);
  background: var(--color-surface);
  color: var(--color-on-surface);
  padding: 0.5rem;
}

.button-icon-outlined:hover {
  background: var(--color-secondary);
}

.button-outlined {
  border: 1px solid var(--color-outline);
  background: var(--color-surface);
  color: var(--color-on-surface);
}

.button-outlined:hover {
  background: var(--color-secondary);
}

.button-link {
  color: var(--color-on-background);
  background: transparent;
  border: 1px solid transparent;
}

.button-link:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.button-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.components-page {
  width: 100vw;
  margin-top: 0;
  margin-left: 50%;
  transform: translateX(-50%);
  padding: 0 0 4rem;
}

.components-header {
  max-width: 56rem;
  margin: 0 auto;
  padding: 2.5rem 1rem 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.components-header h1 {
  margin: 0;
  font-size: 2.25rem;
  line-height: 1.2;
  letter-spacing: -0.05em;
  color: #111827;
}

.components-header p {
  margin: 1rem auto 0;
  color: #6b7280;
  max-width: 100%;
}

.component-tags {
  margin: 1.5rem auto 0;
  padding-inline: 1rem;
  width: 100vw;
  margin-left: 50%;
  transform: translateX(-50%);
  display: flex;
  overflow-x: auto;
  gap: 0.5rem;
  scrollbar-width: none;
}

.component-tag {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0;
  white-space: nowrap;
  padding: 0.375rem 0.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #f3f4f6;
  color: #4b5563;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25rem;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.component-tag:hover {
  background: #e5e7eb;
  color: #374151;
}

.component-tag-count {
  margin-left: 0.375rem;
  color: #6b7280;
  font-size: 0.75rem;
  line-height: 1rem;
}

.components-list-wrap {
  width: 100%;
  margin-top: 2.5rem;
  padding: 0 0.25rem 5rem;
}

.component-grid {
  margin: 0 auto;
  max-width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.component-card {
  width: 100%;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0.125rem;
  border-radius: 0.75rem;
}

.component-card-preview {
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  background: #f5f5f5;
  width: 100%;
  height: 12rem;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.component-card-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.component-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.component-card-placeholder img {
  width: 52px;
  height: 52px;
  opacity: 0.35;
}

.component-card-body {
  padding: 0.5rem 0 0;
  width: 100%;
  display: flex;
  flex-direction: column;
}

.component-card-title {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
  font-weight: 600;
  color: #1f2937;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.component-card-subtitle {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
  color: #6b7280;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}

@media (max-width: 760px) {
  .appbar-right .app-icon,
  .appbar-right .app-pill,
  .appbar-left .app-link {
    display: none;
  }

  .announcement {
    display: none;
  }

  .kdbg-desktop-only,
  .kdbg-desktop-links {
    display: none;
  }

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

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

  .container {
    width: min(1120px, calc(100% - 1rem));
  }

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

@media (min-width: 640px) {
  .components-header h1 {
    font-size: 3rem;
    line-height: 1.25;
  }

  .component-tags {
    width: 100%;
    margin-left: auto;
    transform: none;
    overflow: auto;
    flex-wrap: wrap;
    justify-content: center;
    padding-inline: 0;
  }
}

@media (min-width: 768px) {
  .components-list-wrap {
    margin-top: 5.625rem;
  }

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

@media (min-width: 1024px) {
  .components-list-wrap {
    padding-left: 1rem;
    padding-right: 1rem;
  }

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

@media (min-width: 1280px) {
  .component-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  }
}
