:has(> main > .work) {
    height: auto !important;
    min-height: 100dvh;
}

.work {
    width: 100%;
    max-width: 560px;
    display: flex;
    flex-direction: column;
    padding: 2rem 1rem;
    --border: rgba(255, 255, 255, 0.08);
    --muted: rgba(255, 255, 255, 0.4);
}

.work-head {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 24px;
}

.work-title {
    font-size: 28px;
    font-weight: 700;
    color: #f0f0f2;
    letter-spacing: -0.04em;
}

.work-sub {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.28);
}

.work-sub,
.card-tagline,
.tag,
.card-links a {
    font-family: 'Instrument Mono', monospace;
}

.work-list {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.card {
   width: 100%;
  background: rgba(15, 18, 24, 0.45);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 0.5px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  animation: cardIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: border-color 0.25s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.card:hover {
    border-color: rgba(96, 165, 250, 0.3);
}

.card:nth-child(1) {
    animation-delay: 0.10s;
}

.card:nth-child(2) {
    animation-delay: 0.15s;
}

.card:nth-child(3) {
    animation-delay: 0.20s;
}

.card:nth-child(4) {
    animation-delay: 0.25s;
}

@keyframes cardIn {
    to {
        opacity: 1;
        transform: none;
    }
}

.card-top {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
}

.card-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.card-name {
    font-size: 16px;
    font-weight: 700;
    color: #e8e8ec;
    letter-spacing: -0.02em;
}

.card-tagline {
    font-size: 13px;
    color: var(--muted);
}

.card-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
}

.icon-a {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.7);
}

.icon-b {
  background: rgba(129, 140, 248, 0.18);
  color: #818cf8;
}

.icon-c {
  background: rgba(96, 165, 250, 0.18);
  color: #60a5fa;
}

.icon-d {
  background: rgba(239, 159, 39, 0.15);
  color: #ef9f27;
}

.card-toggle {
    font-size: 20px;
    color: rgba(255, 255, 255, 0.3);
    transition: transform 0.75s cubic-bezier(0.25, 1, 0.5, 1);
}

.card.expanded .card-toggle {
    transform: rotate(180deg);
}

.card-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.75s cubic-bezier(0.25, 1, 0.5, 1);
}

.card.expanded .card-body {
    max-height: 350px;
    transition: max-height 0.75s cubic-bezier(0.25, 1, 0.5, 1);
}

.card-body-inner {
    padding: 18px 20px 22px;
    border-top: 0.5px solid rgba(255, 255, 255, 0.06);
}

.card-desc {
    font-size: 14px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: 16px;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.tag {
  font-size: 12px;
  color: #60a5fa;
  background: rgba(96, 165, 250, 0.1);
  border: 0.5px solid rgba(96, 165, 250, 0.2);
  padding: 5px 12px;
  border-radius: 12px;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.tag:hover {
  background: rgba(96, 165, 250, 0.18);
  border-color: rgba(96, 165, 250, 0.4);
}

.card-links a:hover {
  color: #60a5fa;
}

.card-links {
    display: flex;
    gap: 20px;
}

.card-links a {
    font-size: 12px;
    color: var(--muted);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s;
}

.card-links a:hover {
    color: rgba(255, 255, 255, 0.8);
}

@media (max-width: 540px) {
    .work {
        max-width: 400px;
    }
}
