:root {
  --bg: #030806;
  --panel: rgba(4, 18, 12, 0.82);
  --panel-strong: rgba(5, 27, 17, 0.94);
  --line: rgba(0, 255, 128, 0.22);
  --text: #e7fff1;
  --muted: #8db89d;
  --green: #00ff80;
  --green-soft: rgba(0, 255, 128, 0.1);
  --danger: #ff6b6b;
  --radius: 18px;
  --max: 1020px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  color: var(--text);
  background:
    linear-gradient(rgba(0, 255, 128, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 128, 0.035) 1px, transparent 1px),
    var(--bg);
  background-size: 36px 36px;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(3, 8, 6, 0.2), rgba(3, 8, 6, 0.96));
  z-index: -1;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.018),
    rgba(255, 255, 255, 0.018) 1px,
    transparent 1px,
    transparent 4px
  );
  opacity: 0.35;
  z-index: 3;
}

.matrix-rain {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.24;
  pointer-events: none;
  z-index: -2;
}

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

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

.site-header,
.site-footer,
main {
  width: min(var(--max), calc(100% - 28px));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 0;
}

.brand,
.nav-links,
.site-footer {
  border: 1px solid var(--line);
  background: rgba(3, 8, 6, 0.72);
  backdrop-filter: blur(8px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 999px;
  color: var(--green);
  font-weight: 800;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--green);
  border-radius: 50%;
  color: var(--bg);
  background: var(--green);
}

.nav-links {
  display: flex;
  gap: 4px;
  padding: 7px;
  border-radius: 999px;
}

.nav-links a,
.small-link {
  color: var(--muted);
  padding: 9px 12px;
  border-radius: 999px;
  transition: background 160ms ease, color 160ms ease;
}

.nav-links a:hover,
.small-link:hover {
  color: var(--green);
  background: var(--green-soft);
}

main {
  display: grid;
  gap: 22px;
  padding: 22px 0 44px;
}

.section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  backdrop-filter: blur(10px);
  padding: clamp(22px, 5vw, 44px);
}

.hero {
  min-height: 420px;
  display: grid;
  align-content: center;
}

.terminal-label {
  color: var(--green);
  margin: 0 0 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 14px;
  font-size: clamp(2.5rem, 9vw, 6rem);
  line-height: 0.95;
  letter-spacing: -0.08em;
}

h1 span,
h2 {
  color: var(--green);
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.8rem, 5vw, 3.4rem);
  line-height: 1;
  letter-spacing: -0.05em;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.15rem;
}

.hero-text,
.contact p,
.terminal-card p,
.project-card p,
.experience-intro,
.experience-list p {
  color: var(--muted);
  line-height: 1.7;
}

.hero-text {
  max-width: 640px;
  font-size: 1.08rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.button,
.discord-name,
.form-button {
  border: 1px solid var(--green);
  border-radius: 999px;
  background: var(--green);
  color: var(--bg);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  padding: 12px 16px;
}

.button.ghost {
  background: transparent;
  color: var(--green);
}

.split {
  display: grid;
  grid-template-columns: minmax(180px, 0.72fr) minmax(0, 1.28fr);
  gap: 28px;
  align-items: start;
}

.terminal-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-strong);
  padding: 22px;
}

.terminal-card::before,
.project-card::before,
.admin-box::before {
  content: "● ● ●";
  display: block;
  color: var(--green);
  font-size: 0.78rem;
  letter-spacing: 0.5em;
  margin-bottom: 18px;
  opacity: 0.85;
}

.feature-list {
  display: grid;
  gap: 11px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.feature-list li {
  color: var(--text);
}

.feature-list li::before {
  content: ">";
  color: var(--green);
  margin-right: 9px;
}

.experience-intro {
  max-width: 520px;
  margin: 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.stat-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-strong);
  padding: 20px;
  min-height: 150px;
  display: grid;
  align-content: space-between;
}

.stat-card strong {
  color: var(--green);
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1;
  letter-spacing: -0.08em;
}

.stat-card span {
  color: var(--muted);
  line-height: 1.5;
}

.experience-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.experience-list > div {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.24);
  padding: 20px;
}

.experience-list p {
  margin-bottom: 0;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
  margin-bottom: 22px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.project-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-strong);
  overflow: hidden;
  min-height: 100%;
}

.project-card.has-image::before {
  display: none;
}

.project-image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-bottom: 1px solid var(--line);
}

.project-body {
  padding: 20px;
}

.project-card:not(.has-image) .project-body {
  padding-top: 0;
}

.project-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--green);
  padding: 5px 8px;
  font-size: 0.72rem;
  white-space: nowrap;
}

.empty-state {
  grid-column: 1 / -1;
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 22px;
  color: var(--muted);
}

.contact {
  text-align: center;
}

.contact h2 {
  margin-bottom: 14px;
}

.discord-name {
  margin-top: 8px;
}

#copy-message {
  display: block;
  margin-top: 12px;
  color: var(--muted);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  margin-bottom: 22px;
  border-radius: var(--radius);
  color: var(--muted);
}

.site-footer a {
  color: var(--green);
}

/* Admin page */
.admin-main {
  min-height: calc(100vh - 120px);
  align-content: center;
}

.admin-box {
  max-width: 720px;
  width: 100%;
  justify-self: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: clamp(22px, 5vw, 34px);
}

.admin-box h1 {
  font-size: clamp(2rem, 6vw, 3.4rem);
  letter-spacing: -0.06em;
  margin-bottom: 10px;
}

.form-grid {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  font: inherit;
  padding: 12px 13px;
  outline: none;
}

textarea {
  min-height: 130px;
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: var(--green);
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.form-button.secondary {
  background: transparent;
  color: var(--green);
}

.admin-project-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.admin-project {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.24);
}

.admin-project p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.delete-button {
  border: 1px solid rgba(255, 107, 107, 0.55);
  background: transparent;
  color: var(--danger);
  border-radius: 999px;
  padding: 8px 10px;
  font: inherit;
  cursor: pointer;
}

.notice {
  color: var(--muted);
  line-height: 1.6;
}

.hidden {
  display: none !important;
}

@media (max-width: 760px) {
  .site-header {
    align-items: stretch;
    flex-direction: column;
  }

  .nav-links {
    justify-content: center;
    overflow-x: auto;
  }

  .split,
  .project-grid,
  .stats-grid,
  .experience-list {
    grid-template-columns: 1fr;
  }

  .section-head,
  .site-footer,
  .admin-project {
    flex-direction: column;
    align-items: flex-start;
  }
}

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

  .matrix-rain {
    display: none;
  }
}
