:root {
  color-scheme: dark;
  --canvas: #10110f;
  --panel: #181916;
  --panel-raised: #1e1f1b;
  --text: #f3f1e9;
  --muted: #9c9d95;
  --faint: #686961;
  --line: rgba(243, 241, 233, 0.13);
  --line-strong: rgba(243, 241, 233, 0.28);
  --red: #ef4433;
  --red-dark: #b92d21;
  --sans:
    Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --radius: 16px;
  --gap: clamp(8px, 1vw, 14px);
}

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

html,
body {
  width: 100%;
  min-width: 320px;
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    var(--canvas);
  background-size: 48px 48px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  color: inherit;
  font: inherit;
}

::selection {
  background: var(--red);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  font-weight: 750;
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: var(--gap);
  width: min(100%, 1600px);
  height: 100svh;
  margin-inline: auto;
  padding: clamp(10px, 1.4vw, 22px);
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 58px;
  padding: 8px 10px 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(24, 25, 22, 0.9);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.025em;
}

.brand-name {
  color: var(--text);
  white-space: nowrap;
}

.brand-name > span {
  color: var(--red);
}

.site-label {
  margin: 0;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.topbar-links {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 8px;
}

.topbar-links a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding-inline: 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  transition:
    border-color 160ms ease,
    color 160ms ease,
    background 160ms ease;
}

.topbar-links a:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.topbar-links .primary-link {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
}

.topbar-links .primary-link:hover {
  border-color: var(--red-dark);
  background: var(--red-dark);
}

.mobile-tabs {
  display: none;
}

.dashboard {
  display: grid;
  grid-template-columns: minmax(230px, 0.78fr) minmax(420px, 1.65fr) minmax(
      280px,
      0.95fr
    );
  gap: var(--gap);
  min-height: 0;
}

.panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.12);
}

.panel-label,
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-label {
  gap: 9px;
  width: max-content;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.panel-label span:first-child {
  color: var(--red);
}

.identity-panel {
  display: flex;
  flex-direction: column;
  padding: clamp(18px, 2vw, 30px);
  background:
    radial-gradient(circle at 100% 0, rgba(239, 68, 51, 0.12), transparent 32%),
    var(--panel);
}

.identity-main {
  margin-block: auto;
}

.identity-kicker {
  margin: 0 0 10px;
  color: var(--red);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.identity-panel h1 {
  margin: 0;
  font-size: clamp(54px, 5.4vw, 86px);
  font-weight: 800;
  letter-spacing: -0.075em;
  line-height: 0.9;
}

.identity-summary {
  max-width: 29ch;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: clamp(14px, 1.1vw, 17px);
}

.identity-facts {
  display: grid;
  gap: 0;
  margin: 0 0 clamp(18px, 2vw, 28px);
  border-top: 1px solid var(--line);
}

.identity-facts div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-block: 10px;
  border-bottom: 1px solid var(--line);
}

.identity-facts dt,
.identity-facts dd {
  margin: 0;
  font-size: 11px;
}

.identity-facts dt {
  color: var(--faint);
  font-family: var(--mono);
  text-transform: uppercase;
}

.identity-facts dd {
  color: var(--muted);
  text-align: right;
}

.identity-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--red);
  border-radius: 9px;
  background: var(--red);
  color: #fff;
  cursor: pointer;
  font-size: 11px;
  font-weight: 750;
  transition:
    background 160ms ease,
    border-color 160ms ease;
}

.button:hover {
  border-color: var(--red-dark);
  background: var(--red-dark);
}

.button-quiet {
  border-color: var(--line);
  background: transparent;
  color: var(--muted);
}

.button-quiet:hover {
  border-color: var(--line-strong);
  background: var(--panel-raised);
  color: var(--text);
}

.projects-panel {
  display: flex;
  flex-direction: column;
  padding: clamp(18px, 2vw, 28px);
}

.panel-heading {
  padding-bottom: 10px;
}

.project-count {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
}

.repository-total {
  display: grid;
  min-width: 22px;
  height: 22px;
  padding-inline: 5px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 9px;
}

.project-table {
  min-height: 0;
  flex: 1;
  padding: 0;
  margin: 0;
  overflow-y: auto;
  border-top: 1px solid var(--line-strong);
  list-style: none;
  overscroll-behavior: contain;
  scrollbar-color: var(--red) var(--panel);
  scrollbar-width: thin;
}

.project-row {
  display: grid;
  grid-template-columns:
    28px minmax(0, 1.65fr) minmax(76px, 0.65fr) 60px
    minmax(50px, auto);
  align-items: center;
  gap: clamp(7px, 1vw, 14px);
  padding: 8px 6px;
  border-bottom: 1px solid var(--line);
  transition: background 160ms ease;
}

.project-row:hover {
  background: var(--panel-raised);
}

.project-index,
.project-type,
.project-status {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.project-index {
  color: var(--red);
}

.project-info {
  display: block;
  min-width: 0;
}

.project-title-line {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.project-info strong,
.project-info small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-info strong {
  font-size: 13px;
  letter-spacing: -0.025em;
}

.project-info small {
  margin-top: 2px;
  color: var(--faint);
  font-size: 9px;
}

.project-mobile-status {
  display: none;
  flex: 0 0 auto;
  padding: 2px 4px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 6px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.project-mobile-status.status-private {
  border-color: rgba(239, 68, 51, 0.45);
  color: #f5a59c;
}

.project-type {
  color: var(--muted);
}

.project-status {
  color: #f5a59c;
}

.project-status::before {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 5px;
  border-radius: 50%;
  background: var(--red);
  content: "";
}

.project-status.status-muted {
  color: var(--faint);
}

.project-status.status-muted::before {
  background: var(--faint);
}

.project-status.status-progress {
  color: var(--text);
}

.project-status.status-progress::before {
  background: var(--text);
}

.project-status.status-public {
  color: var(--muted);
}

.project-status.status-public::before {
  background: var(--text);
}

.project-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.project-site-link {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
}

.project-site-link:hover {
  color: var(--red);
}

.project-arrow {
  color: var(--faint);
  font-size: 15px;
  text-align: right;
  transition:
    color 160ms ease,
    transform 160ms ease;
}

.project-row:hover .project-arrow {
  color: var(--red);
  transform: translate(2px, -2px);
}

.repository-loading {
  display: flex;
  min-height: 100%;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
}

.repository-loading.repository-error,
.repository-loading:has(.inline-link) {
  flex-direction: column;
}

.loading-mark {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  animation: loading-pulse 1.2s ease-in-out infinite;
}

.inline-link {
  color: var(--text);
  font-size: 9px;
}

.inline-link:hover {
  color: var(--red);
}

@keyframes loading-pulse {
  50% {
    opacity: 0.25;
    transform: scale(0.75);
  }
}

.side-stack {
  display: grid;
  grid-template-rows: minmax(0, 1.65fr) minmax(150px, 0.75fr);
  gap: var(--gap);
  min-height: 0;
}

.about-panel,
.links-panel {
  padding: clamp(16px, 1.7vw, 24px);
}

.about-panel {
  display: flex;
  flex-direction: column;
}

.about-panel h2,
.current-block h3 {
  margin: 0;
  letter-spacing: -0.035em;
}

.about-panel h2 {
  margin-top: clamp(14px, 1.7vw, 24px);
  font-size: clamp(20px, 2vw, 29px);
  line-height: 1.05;
}

.about-panel > p {
  margin: 12px 0 14px;
  color: var(--muted);
  font-size: clamp(11px, 0.9vw, 13px);
}

.tool-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.tool-list li {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  text-transform: uppercase;
}

.current-block {
  margin-top: auto;
  padding-top: clamp(12px, 1.5vw, 20px);
  border-top: 1px solid var(--line);
}

.current-block h3 {
  margin-bottom: 7px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.log-list {
  display: grid;
  gap: 5px;
  padding: 0;
  margin: 0;
  color: var(--muted);
  font-size: clamp(9px, 0.8vw, 11px);
  list-style: none;
}

.log-list li {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log-list span {
  display: inline-block;
  width: 58px;
  color: var(--red);
  font-family: var(--mono);
  font-size: 8px;
  text-transform: uppercase;
}

.links-panel {
  display: flex;
  flex-direction: column;
}

.link-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
  margin-top: auto;
}

.link-grid a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease;
}

.link-grid a:hover {
  border-color: var(--red);
  background: rgba(239, 68, 51, 0.07);
  color: var(--text);
}

.link-grid span {
  color: var(--red);
}

.link-grid .link-wide {
  grid-column: 1 / -1;
}

.statusbar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
  min-height: 24px;
  padding-inline: 4px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.statusbar span:nth-child(2) {
  text-align: center;
}

.statusbar span:last-child {
  text-align: right;
}

@media (max-height: 720px) and (min-width: 981px) {
  .app-shell {
    padding-block: 8px;
  }

  .topbar {
    min-height: 50px;
  }

  .identity-panel,
  .projects-panel,
  .about-panel,
  .links-panel {
    padding: 15px;
  }

  .identity-panel h1 {
    font-size: 56px;
  }

  .identity-summary,
  .about-panel > p {
    font-size: 11px;
  }

  .identity-facts div {
    padding-block: 7px;
  }

  .about-panel h2 {
    margin-top: 10px;
    font-size: 20px;
  }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    gap: 8px;
    height: 100dvh;
    padding: 8px;
  }

  .topbar {
    grid-template-columns: 1fr auto;
    min-height: 52px;
    padding: 6px 7px 6px 10px;
    border-radius: 12px;
  }

  .site-label,
  .topbar-links > a:first-child {
    display: none;
  }

  .topbar-links .primary-link {
    min-height: 34px;
  }

  .brand {
    gap: 8px;
    font-size: 10px;
  }

  .mobile-tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--panel);
  }

  .mobile-tabs button {
    min-height: 34px;
    padding: 5px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--faint);
    cursor: pointer;
    font-family: var(--mono);
    font-size: 9px;
    text-transform: uppercase;
  }

  .mobile-tabs button[aria-selected="true"] {
    background: var(--red);
    color: #fff;
  }

  .dashboard {
    position: relative;
    display: block;
    min-height: 0;
  }

  .side-stack {
    display: contents;
  }

  .panel[data-panel] {
    display: none;
    width: 100%;
    height: 100%;
    border-radius: 12px;
  }

  .panel[data-panel].is-active {
    display: flex;
  }

  .identity-panel,
  .projects-panel,
  .about-panel,
  .links-panel {
    padding: clamp(16px, 5vw, 24px);
  }

  .identity-main {
    margin-block: auto;
  }

  .identity-panel h1 {
    font-size: clamp(68px, 23vw, 96px);
  }

  .identity-summary {
    max-width: 31ch;
    font-size: 15px;
  }

  .identity-facts {
    margin-bottom: 16px;
  }

  .projects-panel {
    flex-direction: column;
  }

  .project-row {
    grid-template-columns: 20px minmax(0, 1fr) minmax(46px, auto);
    gap: 7px;
    padding: 8px 4px;
  }

  .project-type,
  .project-status {
    display: none;
  }

  .project-info strong {
    font-size: 13px;
  }

  .project-info small {
    margin-top: 2px;
    font-size: 9px;
  }

  .project-mobile-status {
    display: inline-block;
  }

  .about-panel h2 {
    margin-top: 20px;
    font-size: clamp(25px, 8vw, 34px);
  }

  .about-panel > p {
    max-width: 42ch;
    margin-block: 16px;
    font-size: 13px;
  }

  .tool-list li {
    padding: 6px 9px;
    font-size: 9px;
  }

  .current-block {
    padding-top: 16px;
  }

  .log-list {
    gap: 8px;
    font-size: 11px;
  }

  .links-panel {
    flex-direction: column;
  }

  .link-grid {
    grid-template-columns: 1fr;
    gap: 9px;
    margin-block: auto;
  }

  .link-grid a {
    min-height: 54px;
    padding-inline: 15px;
    font-size: 12px;
  }

  .link-grid .link-wide {
    grid-column: auto;
  }

  .statusbar {
    min-height: 16px;
  }

  .statusbar span:nth-child(2) {
    display: none;
  }

  .statusbar {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-height: 620px) and (max-width: 980px) {
  .identity-main {
    margin-block: 20px;
  }

  .identity-facts div {
    padding-block: 6px;
  }

  .about-panel h2 {
    margin-top: 10px;
    font-size: 22px;
  }

  .about-panel > p {
    margin-block: 8px;
    font-size: 11px;
  }

  .tool-list li {
    padding: 4px 7px;
  }

  .current-block {
    padding-top: 8px;
  }

  .log-list {
    gap: 3px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .loading-mark {
    animation: none;
  }
}

.error-page {
  display: grid;
  min-height: 100svh;
  place-items: center;
  overflow: auto;
}

.error-content {
  width: min(calc(100% - 32px), 620px);
  padding: clamp(24px, 5vw, 48px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.error-content > div {
  margin-top: 64px;
}

.error-content h1 {
  margin: 0;
  font-size: clamp(48px, 10vw, 84px);
  letter-spacing: -0.065em;
  line-height: 0.92;
}

.error-content p:not(.panel-label) {
  margin: 18px 0 24px;
  color: var(--muted);
}
