*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0f0f0f;
  --card: #161616;
  --border: #272727;
  --text: #e2e2e2;
  --muted: #666;
  --orange: #f97316;
  --mono: 'Geist Mono', monospace;
  --sans: 'Geist', sans-serif;
}

body.light {
  --bg: #f8f8f5;
  --card: #efefeb;
  --border: #d4d4ce;
  --text: #1a1a1a;
  --muted: #555555;
  --orange: #e06000;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
  max-width: 740px;
  margin: 0 auto;
  padding: 48px 24px 80px;
  transition: background 0.2s, color 0.2s;
}

a {
  color: var(--orange);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* header */
header {
  margin-bottom: 48px;
}

.header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

header h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

header .handle {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

header .handle a {
  color: var(--muted);
}

header .handle a:hover {
  color: var(--orange);
  text-decoration: none;
}

#theme-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

#theme-toggle:hover {
  border-color: var(--orange);
  color: var(--text);
}

/* sections */
section {
  margin-bottom: 48px;
}

h2 {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* about */
.about-text {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.8;
}

.about-text ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}

.about-text ul li::before {
  content: '→ ';
  color: var(--orange);
  font-family: var(--mono);
}

/* icon grid */
.icons-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
}

.icon-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.icon-item svg,
.icon-item img {
  width: 36px;
  height: 36px;
}

.icon-item span {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
}

/* filter */
.filter-row {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.f {
  font-family: var(--mono);
  font-size: 11px;
  padding: 4px 12px;
  border: 1px solid var(--border);
  background: none;
  color: var(--muted);
  cursor: pointer;
  border-radius: 3px;
}

.f:hover {
  color: var(--text);
  border-color: var(--muted);
}

.f.on {
  border-color: var(--orange);
  color: var(--orange);
  background: rgba(249, 115, 22, .08);
}

/* table */
table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  text-align: left;
  padding: 0 12px 10px 0;
  border-bottom: 1px solid var(--border);
}

thead th:nth-child(1) { width: 160px; }
thead th:nth-child(2) { width: auto; }
thead th:nth-child(3) { width: 80px; }
thead th:nth-child(4) { width: 100px; }
thead th:last-child {
  text-align: right;
  padding-right: 0;
}

tbody tr {
  border-bottom: 1px solid var(--border);
}

tbody tr:last-child {
  border-bottom: none;
}

tbody td {
  padding: 12px 12px 12px 0;
  vertical-align: middle;
  font-size: 13px;
}

tbody td:nth-child(3) {
  white-space: nowrap;
}

tbody td:last-child {
  text-align: right;
  padding-right: 0;
}

.name {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
}

.desc {
  color: var(--muted);
  font-size: 12px;
}

.lang {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.js   { background: #f1e05a; }
.py   { background: #3572a5; }
.cpp  { background: #f34b7d; }
.html { background: #e34c26; }

.links {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  white-space: nowrap;
}

.lnk {
  font-family: var(--mono);
  font-size: 10px;
  padding: 3px 9px;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 3px;
}

.lnk:hover {
  color: var(--text);
  border-color: var(--muted);
  text-decoration: none;
}

.lnk.live {
  color: var(--orange);
  border-color: rgba(249, 115, 22, .4);
}

.lnk.live:hover {
  background: rgba(249, 115, 22, .1);
}

/* footer */
footer {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: 24px;
}

@media (max-width: 500px) {
  .desc {
    display: none;
  }
}
