:root {
  --bg: #04070a;
  --panel: #0a1216;
  --border: #1eff9f;
  --text: #b7ffd6;
  --muted: #6fd4a2;
  --danger: #ff5e7a;
  --shadow: 0 0 14px rgba(30, 255, 159, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 12% 8%, rgba(30, 255, 159, 0.12), transparent 30%),
    radial-gradient(circle at 88% 16%, rgba(0, 221, 255, 0.08), transparent 30%),
    linear-gradient(180deg, #030608 0%, #05090d 100%);
  color: var(--text);
  font-family: "Share Tech Mono", monospace;
  min-height: 100vh;
  position: relative;
}

.scanline-overlay {
  pointer-events: none;
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.015),
    rgba(255, 255, 255, 0.015) 1px,
    transparent 2px,
    transparent 4px
  );
  opacity: 0.2;
  z-index: 1;
}

a {
  color: #8cf2ff;
}

.topbar,
.container {
  position: relative;
  z-index: 2;
}

.topbar {
  padding: 1rem 1.2rem;
  border-bottom: 1px solid rgba(30, 255, 159, 0.35);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.brand {
  font-family: "VT323", monospace;
  font-size: 2rem;
  color: #7bffca;
  text-decoration: none;
  text-shadow: var(--shadow);
}

.topnav {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.topnav form {
  margin: 0;
}

.container {
  width: min(1100px, 92vw);
  margin: 1.3rem auto 2.8rem;
}

.container.narrow {
  width: min(620px, 92vw);
}

.hero {
  margin-bottom: 1rem;
}

.hero h1 {
  margin: 0.1rem 0 0.7rem;
  font-family: "VT323", monospace;
  font-size: clamp(2.2rem, 4.4vw, 3.6rem);
  line-height: 1;
  letter-spacing: 0.03em;
}

.hero.compact h1 {
  font-size: clamp(2rem, 3.6vw, 3rem);
}

.prompt-line {
  color: var(--muted);
  margin: 0 0 0.3rem;
}

.panel,
.table-panel {
  border: 1px solid rgba(30, 255, 159, 0.45);
  background: linear-gradient(180deg, rgba(8, 16, 19, 0.92), rgba(4, 10, 12, 0.95));
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 1rem;
}

.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.project-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 240px;
}

.project-meta {
  border-top: 1px dashed rgba(30, 255, 159, 0.35);
  padding-top: 0.9rem;
  margin-top: 0.9rem;
}

.tag {
  display: inline-block;
  margin: 0;
  padding: 0.2rem 0.5rem;
  border: 1px solid rgba(30, 255, 159, 0.4);
  border-radius: 999px;
  font-size: 0.9rem;
}

.detail-grid {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.9rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(30, 255, 159, 0.06);
  color: #b2ffe0;
  text-decoration: none;
  font-family: inherit;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease;
}

.btn:hover {
  transform: translateY(-1px);
  background: rgba(30, 255, 159, 0.14);
}

.btn-ghost {
  border-color: rgba(140, 242, 255, 0.6);
  color: #b7f3ff;
  background: rgba(140, 242, 255, 0.06);
}

.btn-link {
  padding: 0;
  border: none;
  background: none;
  color: #8cf2ff;
  text-decoration: underline;
}

.btn-small {
  padding: 0.35rem 0.6rem;
  font-size: 0.86rem;
}

.danger {
  border-color: rgba(255, 94, 122, 0.7);
  color: #ffd0d8;
  background: rgba(255, 94, 122, 0.08);
}

.flash {
  margin: 0.8rem 0 1.1rem;
  border-radius: 8px;
  padding: 0.7rem 0.8rem;
}

.flash-success {
  border: 1px solid rgba(30, 255, 159, 0.55);
  background: rgba(30, 255, 159, 0.08);
}

.flash-error {
  border: 1px solid rgba(255, 94, 122, 0.55);
  background: rgba(255, 94, 122, 0.1);
}

.form-grid {
  display: grid;
  gap: 0.85rem;
}

label {
  display: grid;
  gap: 0.38rem;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.checkbox-line input[type="checkbox"] {
  width: auto;
}

.hint-line {
  margin: -0.35rem 0 0;
  color: #8dd9b6;
  font-size: 0.92rem;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid rgba(30, 255, 159, 0.35);
  background: rgba(5, 16, 12, 0.85);
  color: var(--text);
  border-radius: 8px;
  font: inherit;
  padding: 0.55rem 0.7rem;
}

input:focus,
textarea:focus,
select:focus {
  outline: 1px solid rgba(140, 242, 255, 0.85);
  outline-offset: 1px;
}

.code-area {
  font-family: "Share Tech Mono", monospace;
  min-height: 420px;
}

.editor-hidden {
  display: none;
}

.code-editor {
  width: 100%;
  min-height: 520px;
  border: 1px solid rgba(30, 255, 159, 0.35);
  border-radius: 8px;
  overflow: hidden;
}

.button-row {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

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

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

th,
td {
  text-align: left;
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid rgba(30, 255, 159, 0.2);
  vertical-align: top;
}

th {
  color: #8ef8cb;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.files-layout {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 1rem;
}

.compact-form {
  margin-top: 0.8rem;
  padding-top: 0.8rem;
  border-top: 1px dashed rgba(30, 255, 159, 0.25);
}

.dropzone {
  margin-top: 0.8rem;
  border: 1px dashed rgba(140, 242, 255, 0.5);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  color: #aef7ff;
  background: rgba(140, 242, 255, 0.05);
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
}

.dropzone-active {
  border-color: rgba(30, 255, 159, 0.9);
  color: #ceffe8;
  background: rgba(30, 255, 159, 0.14);
}

.breadcrumb {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.7rem;
}

.breadcrumb a {
  padding: 0.2rem 0.45rem;
  border: 1px solid rgba(140, 242, 255, 0.35);
  border-radius: 6px;
  text-decoration: none;
}

code {
  background: rgba(30, 255, 159, 0.09);
  padding: 0.1rem 0.25rem;
  border-radius: 4px;
}

.landing-wrap {
  min-height: calc(100vh - 4rem);
  display: grid;
  place-items: center;
}

.landing-terminal {
  width: min(860px, 100%);
  padding: 1.4rem;
}

.landing-title {
  margin: 0.15rem 0 0.5rem;
  font-size: clamp(2.4rem, 6vw, 4rem);
  text-shadow:
    0 0 12px rgba(30, 255, 159, 0.45),
    0 0 28px rgba(140, 242, 255, 0.18);
}

.landing-subtitle {
  margin: 0 0 1rem;
  color: #8ed9b3;
}

.boot-lines {
  display: grid;
  gap: 0.45rem;
  margin: 1rem 0 1.2rem;
}

.boot-line {
  margin: 0;
  width: 0;
  overflow: hidden;
  white-space: nowrap;
  color: #bfffe0;
  border-right: 1px solid rgba(30, 255, 159, 0.9);
  animation:
    typing 0.9s steps(var(--chars)) forwards,
    caret-blink 0.7s step-end infinite;
  animation-delay: calc(var(--i) * 0.8s);
}

.landing-progress {
  height: 10px;
  width: 100%;
  border: 1px solid rgba(140, 242, 255, 0.45);
  border-radius: 999px;
  overflow: hidden;
  background: rgba(140, 242, 255, 0.08);
}

.landing-progress-fill {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, rgba(30, 255, 159, 0.75), rgba(140, 242, 255, 0.85));
  animation: loadbar 6.7s ease forwards;
}

.landing-actions {
  margin-top: 1.1rem;
}

.landing-hint {
  margin: 0.4rem 0 0;
  font-size: 0.92rem;
  color: #7bd3a1;
}

.projects-screen {
  opacity: 0;
  animation: projects-fade-in 900ms ease forwards;
}

.projects-screen .panel,
.projects-screen .hero {
  animation: projects-fade-in 900ms ease forwards;
}

@keyframes typing {
  from {
    width: 0;
  }
  to {
    width: calc(var(--chars) * 1ch);
  }
}

@keyframes caret-blink {
  0%,
  100% {
    border-right-color: rgba(30, 255, 159, 0.95);
  }
  50% {
    border-right-color: transparent;
  }
}

@keyframes loadbar {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes projects-fade-in {
  from {
    opacity: 0;
    filter: blur(2px);
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}

@media (max-width: 880px) {
  .files-layout {
    grid-template-columns: 1fr;
  }

  .row-actions {
    min-width: 180px;
  }
}
