@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/inter-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/inter-latin-500-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/inter-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #07080b;
  --bg-elev: #12141b;
  --bg-elev-2: #191c25;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f4f6f8;
  --muted: #a7b0bd;
  --faint: #7d8796;
  --accent: #1784a8;
  --accent-ink: #0e6d88;
  --accent-bright: #8fd4ea;
  --danger: #ffb4b8;
  --ok: #8ee0bf;
  --warn: #f0cb86;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background:
    radial-gradient(900px 420px at 8% -10%, rgba(23, 132, 168, 0.18), transparent 55%),
    radial-gradient(700px 380px at 100% 0%, rgba(23, 132, 168, 0.08), transparent 50%),
    var(--bg);
}

a { color: var(--accent-bright); }

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

.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--bg-elev);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 8px;
  z-index: 5;
}

.skip:focus { top: 12px; }

.wrap {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  border-bottom: 1px solid var(--line);
  background: rgba(7, 8, 11, 0.8);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 2;
}

.topbar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  min-height: 72px;
  padding: 12px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.brand img {
  display: block;
  width: 36px;
  height: 36px;
  flex: none;
}

.wordmark {
  font-weight: 600;
  letter-spacing: -0.03em;
  font-size: 1.05rem;
  white-space: nowrap;
}

.labs-label {
  flex: none;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-bright);
  border: 1px solid rgba(23, 132, 168, 0.7);
  border-radius: 999px;
  padding: 3px 7px;
  line-height: 1.2;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.who {
  color: var(--faint);
  font-size: 0.92rem;
  margin-right: 4px;
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 28px 0 18px;
}

h1, h2, h3 { letter-spacing: -0.03em; line-height: 1.2; margin: 0; }

h1 { font-size: 1.8rem; font-weight: 600; }

h2 { font-size: 1.15rem; font-weight: 600; }

.lede { color: var(--muted); margin: 8px 0 0; max-width: 62ch; }

.footer {
  color: var(--faint);
  font-size: 0.85rem;
  padding: 28px 0 40px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 18px;
}

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 40%), var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  min-width: 0;
}

.thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 17px 17px 0 0;
  background:
    radial-gradient(140px 90px at 50% 42%, rgba(23, 132, 168, 0.32), transparent 72%),
    #0c0e13;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 2rem;
  font-weight: 600;
  color: #d7eef5;
}

.card-body { padding: 16px 16px 18px; }

.card h2 {
  font-size: 1.08rem;
  margin-top: 8px;
  overflow-wrap: anywhere;
}

.desc {
  color: var(--muted);
  margin: 6px 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.meta { color: var(--faint); font-size: 0.88rem; margin: 10px 0 0; }

.badges { display: flex; flex-wrap: wrap; gap: 6px; }

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid var(--line-strong);
  color: var(--muted);
}

.badge.status { text-transform: capitalize; }
.badge.done { color: var(--ok); border-color: rgba(142, 224, 191, 0.35); }
.badge.in-progress { color: var(--accent-bright); border-color: rgba(143, 212, 234, 0.4); }
.badge.idea { color: var(--warn); border-color: rgba(240, 203, 134, 0.35); }
.badge.public { color: var(--accent-bright); }
.badge.private { color: var(--muted); }
.badge.hidden, .badge.archived { color: var(--warn); }

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  text-decoration: none;
  cursor: pointer;
}

.btn.primary {
  background: var(--accent-ink);
  border-color: var(--accent-ink);
  color: #fff;
}

.btn.danger {
  color: var(--danger);
  border-color: rgba(255, 180, 184, 0.4);
}

.btn.wide { width: 100%; }

.btn:hover { border-color: rgba(143, 212, 234, 0.7); }

.inline-form { position: relative; }

.inline-form > summary { list-style: none; }
.inline-form > summary::-webkit-details-marker { display: none; }

.inline-form { flex-basis: auto; }
.inline-form[open] { flex-basis: 100%; }
.inline-form form {
  display: grid;
  gap: 8px;
  width: 100%;
  margin-top: 8px;
  padding: 12px;
  border-radius: 14px;
  background: #0c0e13;
  border: 1px solid var(--line-strong);
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--text);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.02);
}

.toggle::before {
  content: "";
  width: 32px;
  height: 18px;
  border-radius: 999px;
  background: #2a2f3a radial-gradient(circle at 7px 50%, #d5dbe3 5px, transparent 5.5px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.toggle.is-on {
  border-color: rgba(23, 132, 168, 0.8);
  background: rgba(23, 132, 168, 0.12);
}

.toggle.is-on::before {
  background: var(--accent) radial-gradient(circle at 25px 50%, #f7fbfd 5px, transparent 5.5px);
  box-shadow: none;
}

.section { margin-top: 36px; }
.section > h2 { margin-bottom: 12px; }

.empty { color: var(--muted); margin: 8px 0; }

.panel {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  min-width: 0;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.kv {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 8px 12px;
  margin: 14px 0 0;
}

.kv dt { color: var(--faint); }
.kv dd { margin: 0; overflow-wrap: anywhere; }

.table-wrap { overflow-x: auto; }

.files {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}

.files th, .files td {
  text-align: left;
  padding: 8px 8px 8px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.files th { color: var(--faint); font-weight: 500; font-size: 0.85rem; }
.files td:last-child, .files th:last-child { text-align: right; white-space: nowrap; }
.files td:first-child { overflow-wrap: anywhere; }

.stack { margin-top: 14px; }
.back { margin: 22px 0 0; }
.hint { color: var(--faint); font-size: 0.88rem; margin: 6px 0 0; }

.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

.auth-card {
  width: min(440px, 100%);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px 24px;
  box-shadow: var(--shadow);
}

.auth-card.embedded { margin: 48px auto; }

.auth-card h1 { margin-top: 18px; }
.auth-card .brand { margin-bottom: 4px; }

form { display: grid; gap: 14px; margin-top: 18px; }
.nav form, .actions > form { margin: 0; display: inline; }
.stack form { margin-top: 14px; display: grid; }

.field { display: grid; gap: 6px; }
label { font-size: 0.92rem; font-weight: 500; }

input[type="text"], input[type="password"], input[type="number"] {
  width: 100%;
  background: #0b0d12;
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 12px 12px;
  font: inherit;
  font-size: 16px;
}

.form-error {
  background: rgba(255, 180, 184, 0.1);
  color: var(--danger);
  border-radius: 12px;
  padding: 10px 12px;
  margin: 12px 0 0;
}

dialog {
  width: min(420px, calc(100vw - 32px));
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow);
}

dialog::backdrop { background: rgba(0, 0, 0, 0.62); }
dialog p { color: var(--muted); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

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

@media (max-width: 800px) {
  .detail-grid { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dt { margin-top: 8px; }
}

@media (max-width: 720px) {
  .grid { grid-template-columns: 1fr; }
  h1 { font-size: 1.5rem; }
}

@media (max-width: 420px) {
  .who { display: none; }
  .wrap { width: min(1120px, calc(100% - 24px)); }
  .wordmark { font-size: 0.98rem; }
}

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