:root {
  color-scheme: light;
  --background: #fffaf4;
  --surface: #fffdf9;
  --surface-muted: #f5f0eb;
  --blush: #ffe8ec;
  --peach: #ffd7c2;
  --mint: #d9f0e7;
  --brown-soft: #eaded2;
  --text: #3b3535;
  --text-muted: #756b6b;
  --border: rgb(59 53 53 / 14%);
  --border-strong: rgb(59 53 53 / 28%);
  --focus: #ffd7c2;
  --shadow: 0 1px 3px rgb(59 53 53 / 8%);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Yu Gothic", Meiryo, ui-sans-serif, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.7;
}

a {
  color: inherit;
  text-decoration-color: var(--peach);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.3em;
}

a:hover {
  opacity: 0.68;
}

button,
input {
  font: inherit;
}

button,
a,
input {
  border-radius: 6px;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.65rem 0.9rem;
  transform: translateY(-160%);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

.skip-link:focus {
  transform: translateY(0);
}

.shell {
  width: min(100% - 2rem, 68rem);
  margin-inline: auto;
}

.text-link {
  font-weight: 650;
}

.hero {
  padding: clamp(2rem, 6vw, 4rem) 0;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(2.4rem, 8vw, 4.5rem);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.title-block {
  --title-gap: clamp(0.8rem, 2.5vw, 1.4rem);
  --title-icon-size: clamp(3.5rem, 9vw, 6rem);
}

.title-row {
  display: flex;
  align-items: center;
  gap: var(--title-gap);
}

.title-meta {
  margin-top: 0.5rem;
  margin-left: calc(var(--title-icon-size) + var(--title-gap));
}

.title-icon {
  flex: none;
  width: var(--title-icon-size);
  height: auto;
  filter: drop-shadow(0 1px 2px rgb(59 53 53 / 15%));
}

.byline {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.repository-link {
  margin: 0.45rem 0 0;
  font-size: 0.88rem;
}

h2 {
  margin: 0;
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 500;
  line-height: 1.3;
}

h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 500;
  line-height: 1.4;
}

.install-panel {
  max-width: 44rem;
  margin-top: 2rem;
  padding: clamp(1.1rem, 3vw, 1.5rem);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgb(255 255 255 / 55%);
  box-shadow: var(--shadow);
}

.install-primary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.button {
  min-height: 2.75rem;
  padding: 0.65rem 1rem;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
}

.button-primary {
  border-color: var(--border-strong);
  background: #ffffff;
  color: var(--text-muted);
  box-shadow: var(--shadow);
}

.button-primary:hover {
  background: var(--brown-soft);
  color: var(--text);
}

.button-secondary {
  border-color: var(--border);
  background: var(--surface-muted);
  color: var(--text);
}

.button-secondary:hover {
  border-color: var(--border);
  background: var(--brown-soft);
}

.url-row {
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
}

.url-row label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
  font-weight: 700;
}

.url-row label {
  margin-bottom: 0.25rem;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.url-controls {
  display: flex;
  gap: 0.65rem;
}

input {
  width: 100%;
  min-width: 0;
  min-height: 2.75rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

input:focus {
  border-color: var(--peach);
  box-shadow: 0 0 0 2px rgb(255 215 194 / 35%);
}

input[readonly] {
  color: var(--text-muted);
}

#vccUrlField {
  min-height: 2.25rem;
  padding: 0.4rem 0.6rem;
  font-size: 0.82rem;
}

.url-row .button {
  flex: none;
  min-height: 2.25rem;
  padding: 0.4rem 0.75rem;
  font-size: 0.82rem;
  white-space: nowrap;
}

.status {
  min-height: 1.45em;
  margin: 0.2rem 0 -1rem;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.section {
  padding: clamp(2.5rem, 6vw, 4.5rem) 0;
  border-top: 1px solid var(--border);
}

.packages-section {
  padding-top: clamp(1.5rem, 3vw, 2.25rem);
}

.search-label {
  display: block;
  width: min(100%, 20rem);
  margin-left: auto;
}

.package-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.package-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: clamp(1.15rem, 3vw, 1.5rem);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgb(255 255 255 / 55%);
  box-shadow: var(--shadow);
}

.package-heading,
.package-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.package-id {
  margin: 0.15rem 0 0;
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.78rem;
}

.version {
  flex: none;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--mint);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 700;
}

.package-badges {
  display: flex;
  flex: none;
  align-items: flex-end;
  flex-direction: column;
  gap: 0.35rem;
}

.package-license {
  max-width: 10rem;
  padding: 0.2rem 0.45rem;
  border: 1px solid rgb(59 53 53 / 10%);
  border-radius: 6px;
  background: rgb(255 255 255 / 42%);
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
  text-align: right;
}

.package-description {
  margin: 0.75rem 0;
  color: var(--text-muted);
}

.package-details {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 0.9rem;
  font-size: 0.78rem;
}

.package-details > div {
  max-width: 100%;
  padding: 0.25rem 0.55rem;
  border: 1px solid rgb(59 53 53 / 10%);
  border-radius: 6px;
  background: rgb(255 255 255 / 42%);
  color: var(--text-muted);
  line-height: 1.5;
}

.package-details dd {
  min-width: 0;
  margin: 0;
}

.dependency-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dependency-list li {
  min-width: 0;
}

.dependency-list code {
  overflow-wrap: anywhere;
}

.dependency-list span {
  color: var(--text-muted);
}

.package-actions {
  align-items: center;
  margin-top: auto;
}

.empty-state {
  margin: 1.5rem 0 0;
  padding: 1.5rem;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: var(--blush);
  text-align: center;
}

.empty-state p {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 1.25rem, 68rem);
  }

  .install-primary {
    align-items: stretch;
    flex-direction: column;
    gap: 1rem;
  }

  .install-primary .button {
    width: 100%;
  }

  .package-list {
    grid-template-columns: 1fr;
  }

  .search-label {
    width: 100%;
    margin-left: 0;
  }
}

@media (max-width: 420px) {
  .package-heading,
  .package-actions {
    display: flex;
    align-items: stretch;
    flex-direction: column;
  }

  .package-actions .button {
    width: 100%;
  }

  .package-badges {
    align-items: flex-start;
  }

  .package-license {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .button,
  input {
    transition: none;
  }
}
