:root {
  --bg: #f4f7fb;
  --bg2: #e8eef6;
  --panel: #ffffff;
  --text: #152033;
  --mist: #5b6b7c;
  --accent: #0f7a6c;
  --accent-soft: #d8f3ee;
  --accent-ink: #ffffff;
  --line: rgba(21, 32, 51, 0.1);
  --shadow: 0 10px 30px rgba(21, 32, 51, 0.06);
  --font-display: "Bricolage Grotesque", sans-serif;
  --font-body: Figtree, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font-body);
  background:
    radial-gradient(900px 420px at 90% -10%, rgba(15, 122, 108, 0.12), transparent 55%),
    radial-gradient(700px 380px at -5% 20%, rgba(90, 140, 200, 0.14), transparent 50%),
    linear-gradient(180deg, #f8fafc 0%, var(--bg) 40%, var(--bg2) 100%);
}

.hero {
  min-height: 100vh;
  min-height: 100dvh;
  padding: 1.5rem clamp(1.5rem, 5vw, 3.5rem) 3rem;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse 80% 70% at 85% 40%, rgba(15, 122, 108, 0.14), transparent 60%),
    linear-gradient(135deg, #eef5f8, #f4f7fb 50%, #e7eef8);
}
.logo {
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.95rem;
  opacity: 0.8;
}

.hero-grid {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: clamp(1.75rem, 4vw, 3rem);
  align-items: center;
  margin-top: 2rem;
  max-width: 1120px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.hero-copy {
  max-width: 36rem;
  min-width: 0;
}
.brand {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.4rem, 7.5vw, 4.5rem);
  line-height: 0.92;
  letter-spacing: -0.045em;
  color: var(--accent);
}
h1 {
  margin: 1.15rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3.2vw, 2.1rem);
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.15;
}
.lede {
  margin: 1rem 0 0;
  color: var(--mist);
  max-width: 30rem;
  line-height: 1.55;
  font-size: 1.1rem;
}
.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1.85rem;
  padding: 1.25rem 2.25rem;
  border-radius: 0.6rem;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: clamp(1.2rem, 2.4vw, 1.45rem);
  letter-spacing: -0.02em;
  text-decoration: none;
  box-shadow: 0 16px 38px rgba(15, 122, 108, 0.3);
}
.cta:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.live-panel {
  background: linear-gradient(180deg, #ffffff 0%, #f7fbfa 100%);
  border: 1px solid var(--line);
  border-radius: 1rem;
  box-shadow: 0 16px 40px rgba(21, 32, 51, 0.08);
  overflow: hidden;
  width: 340px;
  max-width: 100%;
  height: 400px;
  max-height: 400px;
  display: flex;
  flex-direction: column;
  justify-self: end;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}
.live-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.95rem 1.05rem;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-display);
  font-size: 0.98rem;
  background: rgba(15, 122, 108, 0.04);
}
.live-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.18);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.85); opacity: 0.7; }
}
.live-feed {
  list-style: none;
  margin: 0;
  padding: 0.45rem;
  overflow: hidden;
  flex: 1;
}
.live-item {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 0.7rem;
  align-items: center;
  padding: 0.7rem 0.75rem;
  border-radius: 0.65rem;
  border: 1px solid transparent;
  animation: slideIn 0.35s ease-out;
}
.live-item + .live-item { margin-top: 0.2rem; }
.live-item:first-child {
  background: var(--accent-soft);
  border-color: rgba(15, 122, 108, 0.18);
}
.live-item:nth-child(odd):not(:first-child) {
  background: rgba(15, 122, 108, 0.035);
}
.live-avatar {
  width: 40px;
  height: 40px;
  border-radius: 0.45rem;
  object-fit: cover;
  background: var(--bg2);
  box-shadow: 0 2px 8px rgba(21, 32, 51, 0.08);
}
.live-meta { min-width: 0; }
.live-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}
.live-item strong {
  display: block;
  font-size: 0.9rem;
  letter-spacing: -0.01em;
  font-family: ui-monospace, Menlo, monospace;
  color: var(--accent);
}
.live-top em {
  font-style: normal;
  color: var(--mist);
  font-size: 0.7rem;
  white-space: nowrap;
}
.live-item span {
  display: block;
  margin-top: 0.18rem;
  color: var(--mist);
  font-size: 0.8rem;
  line-height: 1.35;
}
.live-item span b { color: var(--text); font-weight: 700; }

.item-soon {
  opacity: 0.78;
}
.item-soon:hover {
  opacity: 1;
}
.soon-tag {
  display: inline-block;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: #eef2f7;
  color: var(--mist);
  font-size: 0.78rem;
  font-weight: 700;
}
.item-soon .open {
  color: var(--mist);
  font-weight: 600;
}
.modal-soon {
  margin: 1rem 0 0;
  padding: 0.85rem 0.95rem;
  border-radius: 0.5rem;
  background: #eef2f7;
  color: var(--mist);
  font-weight: 600;
  line-height: 1.4;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.catalog {
  max-width: 920px;
  margin: 0 auto;
  padding: 2.75rem clamp(1.25rem, 4vw, 2.75rem) 4rem;
}
.catalog h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: -0.03em;
}
.sub {
  margin: 0.45rem 0 1.15rem;
  color: var(--mist);
  line-height: 1.45;
}
#search {
  display: block;
  width: min(100%, 28rem);
  margin-bottom: 1.25rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  box-shadow: var(--shadow);
}
#search:focus {
  outline: 2px solid var(--accent);
  border-color: transparent;
}

#item-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}
.item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  background: var(--panel);
  color: inherit;
  text-align: left;
  font: inherit;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.item:hover {
  border-color: rgba(15, 122, 108, 0.35);
  transform: translateY(-1px);
}
.item img {
  width: 64px;
  height: 64px;
  border-radius: 0.4rem;
  background: var(--bg2);
  object-fit: cover;
}
.item h3 {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.item p {
  margin: 0.3rem 0 0;
  color: var(--mist);
  font-size: 0.9rem;
}
.item code {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 0.25rem;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.86rem;
}
.open {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.88rem;
  white-space: nowrap;
}
.empty { color: var(--mist); margin-top: 1rem; }

.modal[hidden] { display: none; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 1rem;
}
.backdrop {
  position: absolute;
  inset: 0;
  background: rgba(21, 32, 51, 0.45);
  backdrop-filter: blur(3px);
}
.card {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
  padding: 1.4rem 1.35rem 1.35rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: var(--panel);
  box-shadow: 0 20px 50px rgba(21, 32, 51, 0.18);
}
.x {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 0.35rem;
  background: var(--bg2);
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
}
.card img {
  width: 72px;
  height: 72px;
  border-radius: 0.4rem;
  background: var(--bg2);
  object-fit: cover;
}
.card h3 {
  margin: 0.8rem 0 0;
  font-family: var(--font-display);
  font-size: 1.3rem;
  letter-spacing: -0.03em;
}
.card ol {
  margin: 1rem 0 0;
  padding-left: 1.2rem;
  color: var(--mist);
  line-height: 1.55;
}
.card li + li { margin-top: 0.85rem; }
.card a {
  display: inline-block;
  margin-top: 0.3rem;
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}
.card a:hover { text-decoration: underline; }
.code-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.45rem;
}
.card code {
  padding: 0.25rem 0.55rem;
  border-radius: 0.3rem;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: ui-monospace, Menlo, monospace;
  font-weight: 700;
}
#copy-code {
  border: 1px solid var(--line);
  border-radius: 0.3rem;
  background: var(--bg);
  color: var(--text);
  padding: 0.3rem 0.65rem;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
#copy-code:hover { border-color: rgba(15, 122, 108, 0.4); }

footer {
  border-top: 1px solid var(--line);
  padding: 1.75rem 1.25rem 2.25rem;
  text-align: center;
  color: var(--mist);
  font-size: 0.85rem;
  line-height: 1.5;
}
footer a { color: var(--accent); font-weight: 700; text-decoration: none; }
footer p { margin: 0.4rem 0; }

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 1.5rem;
  }
  .live-panel {
    width: 100%;
    height: 280px;
    max-height: 280px;
    justify-self: stretch;
    order: 2;
  }
  .hero { min-height: auto; padding-bottom: 2.5rem; }
}

@media (max-width: 640px) {
  .item {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 0.75rem;
  }
  .item img {
    width: 56px;
    height: 56px;
  }
  .open {
    grid-column: 2;
    justify-self: start;
  }
  .cta {
    width: 100%;
    font-size: 1.25rem;
    padding: 1.3rem 1.5rem;
  }
}
