:root {
  color-scheme: light;
  --ink: #17213b;
  --muted: #66708a;
  --line: #e4e8f1;
  --surface: #ffffff;
  --canvas: #f5f7fb;
  --primary: #5f52d9;
  --primary-deep: #4037ae;
  --success: #157a59;
  --danger: #b84c4c;
  --shadow-sm: 0 8px 22px rgba(30, 43, 83, 0.06);
  --shadow-lg: 0 26px 70px rgba(25, 35, 76, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 12% 8%, rgba(104, 92, 226, 0.09), transparent 28rem),
    var(--canvas);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button,
summary,
a,
input {
  -webkit-tap-highlight-color: transparent;
}

button,
summary {
  cursor: pointer;
}

a {
  color: inherit;
}

.page-shell {
  width: min(100%, 1120px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px;
}

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 390px;
  padding: 30px clamp(26px, 6vw, 72px) 64px;
  border-radius: 30px;
  background:
    radial-gradient(circle at 84% 16%, rgba(120, 222, 199, 0.2), transparent 15rem),
    radial-gradient(circle at 6% 100%, rgba(105, 86, 221, 0.32), transparent 22rem),
    linear-gradient(135deg, #161a39 0%, #202553 57%, #282b67 100%);
  box-shadow: var(--shadow-lg);
  color: #f8f9ff;
}

.hero::before,
.hero::after {
  position: absolute;
  z-index: -1;
  display: block;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  content: "";
  pointer-events: none;
}

.hero::before {
  width: 460px;
  height: 460px;
  right: -164px;
  bottom: -292px;
}

.hero::after {
  width: 300px;
  height: 300px;
  right: -62px;
  bottom: -202px;
}

.hero-topline,
.hero-content {
  position: relative;
  z-index: 1;
}

.hero-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  color: rgba(248, 249, 255, 0.82);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.brand span {
  color: #8ee0c8;
}

.page-label,
.eyebrow,
.section-kicker {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.page-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(248, 249, 255, 0.65);
}

.page-label-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #8ee0c8;
  box-shadow: 0 0 0 5px rgba(142, 224, 200, 0.13);
}

.hero-content {
  max-width: 680px;
  margin-top: clamp(76px, 11vw, 112px);
}

.eyebrow {
  color: #8ee0c8;
}

.eyebrow span {
  padding: 0 6px;
  color: rgba(248, 249, 255, 0.4);
}

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

h1 {
  max-width: 630px;
  margin: 16px 0 18px;
  font-size: clamp(2.1rem, 5vw, 3.6rem);
  font-weight: 760;
  letter-spacing: 0.01em;
  line-height: 1.25;
  text-wrap: balance;
}

h1 em {
  color: #8ee0c8;
  font-style: normal;
}

.hero-lede {
  max-width: 560px;
  margin-bottom: 0;
  color: rgba(248, 249, 255, 0.72);
  font-size: clamp(0.96rem, 1.7vw, 1.08rem);
  line-height: 1.9;
}

.main-content {
  padding: 58px clamp(0px, 3vw, 34px) 34px;
}

.library {
  width: 100%;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.section-kicker {
  margin-bottom: 7px;
  color: var(--primary);
}

.section-heading h2 {
  margin-bottom: 0;
  font-size: clamp(1.55rem, 3vw, 2rem);
  letter-spacing: 0.01em;
  line-height: 1.3;
}

.collection-count {
  flex: 0 0 auto;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.84rem;
  font-variant-numeric: tabular-nums;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.search-field {
  display: flex;
  align-items: center;
  width: min(100%, 540px);
  min-height: 54px;
  padding: 0 13px 0 17px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-sm);
  color: var(--muted);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.search-field:focus-within {
  border-color: rgba(95, 82, 217, 0.72);
  background: var(--surface);
  box-shadow: 0 0 0 4px rgba(95, 82, 217, 0.12), var(--shadow-sm);
}

.search-icon {
  margin-right: 10px;
  color: var(--primary);
  font-size: 1.45rem;
  line-height: 1;
  transform: translateY(-1px);
}

.search-field input {
  width: 100%;
  min-width: 0;
  padding: 2px 8px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 0.95rem;
}

.search-field input::placeholder {
  color: #98a0b3;
}

kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 25px;
  height: 25px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f6f7fb;
  color: #8992a7;
  font-size: 0.76rem;
  line-height: 1;
}

.clear-button {
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.clear-button:hover {
  border-color: var(--primary);
  color: var(--primary-deep);
}

.skill-list {
  display: grid;
  gap: 13px;
}

.skill-card {
  padding: 22px 24px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.skill-card:hover {
  border-color: #d4d1f4;
  box-shadow: 0 15px 35px rgba(30, 43, 83, 0.1);
  transform: translateY(-1px);
}

.skill-card[hidden] {
  display: none;
}

.skill-header {
  display: flex;
  align-items: start;
  gap: 14px;
  min-width: 0;
}

.skill-number {
  flex: 0 0 auto;
  min-width: 31px;
  padding-top: 3px;
  color: #9a9fc1;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
}

.skill-name {
  min-width: 0;
  margin-bottom: 0;
  color: var(--ink);
  font-size: 1.06rem;
  font-weight: 700;
  overflow-wrap: anywhere;
  line-height: 1.55;
}

.skill-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 17px;
}

.copy-button {
  min-width: 106px;
  min-height: 44px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: var(--primary);
  color: #ffffff;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.copy-button::before {
  margin-right: 6px;
  content: "↗";
  font-size: 0.92rem;
}

.copy-button:hover {
  background: var(--primary-deep);
  transform: translateY(-1px);
}

.copy-button:active {
  transform: translateY(0);
}

.copy-button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.copy-button.is-copied {
  border-color: rgba(21, 122, 89, 0.2);
  background: #e4f5ee;
  color: var(--success);
}

.copy-button.is-copied::before {
  content: "✓";
}

.copy-button.is-error {
  border-color: rgba(184, 76, 76, 0.2);
  background: #fbeeee;
  color: var(--danger);
}

.copy-button.is-error::before {
  content: "!";
}

.copy-feedback {
  min-height: 1.5em;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: right;
}

.copy-button.is-copied + .copy-feedback {
  color: var(--success);
}

.copy-button.is-error + .copy-feedback {
  color: var(--danger);
}

.skill-details {
  margin-top: 13px;
  border-top: 1px solid #f0f1f6;
}

.skill-details summary {
  width: fit-content;
  padding-top: 12px;
  color: var(--muted);
  font-size: 0.79rem;
  font-weight: 650;
  list-style-position: inside;
}

.skill-details summary:hover {
  color: var(--primary-deep);
}

.skill-text {
  max-height: 420px;
  margin: 12px 0 0;
  padding: 15px;
  overflow: auto;
  border: 1px solid #eceef5;
  border-radius: 11px;
  background: #f8f9fc;
  color: #3b4560;
  font-family: inherit;
  font-size: 0.84rem;
  line-height: 1.8;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.copy-fallback-textarea {
  position: fixed;
  top: -9999px;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.empty-state {
  display: grid;
  gap: 5px;
  margin: 18px 0 0;
  padding: 32px 20px;
  border: 1px dashed #cfd3e3;
  border-radius: 15px;
  color: var(--muted);
  text-align: center;
}

/* display指定が hidden 属性の既定値を上書きしないようにする */
.empty-state[hidden] {
  display: none;
}

.empty-state strong {
  color: var(--ink);
}

.site-footer {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 12px clamp(0px, 3vw, 34px) 28px;
  color: #7d8499;
  font-size: 0.78rem;
}

.site-footer p {
  margin-bottom: 0;
}

.footer-note {
  color: #9aa0b1;
  text-align: right;
}

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

:focus-visible {
  outline: 3px solid rgba(95, 82, 217, 0.55);
  outline-offset: 3px;
}

.hero a:focus-visible {
  outline-color: #8ee0c8;
}

@media (max-width: 640px) {
  .page-shell {
    padding: 12px;
  }

  .hero {
    min-height: 400px;
    padding: 23px 22px 46px;
    border-radius: 23px;
  }

  .hero-topline {
    align-items: start;
  }

  .page-label {
    font-size: 0.62rem;
    letter-spacing: 0.14em;
  }

  .hero-content {
    margin-top: 84px;
  }

  h1 {
    font-size: clamp(1.9rem, 9.5vw, 2.8rem);
    letter-spacing: 0.01em;
  }

  .hero-lede {
    font-size: 0.92rem;
    line-height: 1.8;
  }

  .main-content {
    padding: 42px 0 26px;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
    gap: 5px;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .search-field {
    width: 100%;
  }

  .clear-button {
    align-self: start;
  }

  .skill-card {
    padding: 19px 17px 16px;
    border-radius: 15px;
  }

  .skill-actions {
    align-items: flex-end;
    flex-direction: column-reverse;
    gap: 7px;
  }

  .copy-button {
    width: 100%;
  }

  .copy-feedback {
    align-self: stretch;
    text-align: left;
  }

  .site-footer {
    align-items: start;
    flex-direction: column;
    gap: 5px;
    padding: 7px 0 20px;
  }

  .footer-note {
    text-align: left;
  }
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
