:root {
  --bg:        #000000;
  --bg-raised: #0a0a0a;
  --bg-hover:  #101410;
  --border:    #1c1c1c;
  --border-hi: #2a3a2a;

  --text:      #c8ccc8;
  --muted:     #5a5f5a;

  --green:     #33ff66;
  --green-dim: #1f9942;
  --blue:      #4db8ff;
  --red:       #ff4d4d;

  --maxw:   760px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 50% -12%, rgba(51, 255, 102, 0.1), transparent 38%),
    linear-gradient(rgba(51, 255, 102, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(51, 255, 102, 0.025) 1px, transparent 1px);
  background-attachment: fixed;
  background-size: 100% 100%, 32px 32px, 32px 32px;
  color: var(--text);
  font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  line-height: 1.65;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--green-dim);
  color: #000;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 88px 24px 68px;
}

/* intro */
.intro {
  margin-bottom: 64px;
  padding-left: 20px;
  border-left: 1px solid var(--green-dim);
}

.site-title {
  margin-top: 10px;
  font-size: clamp(2.5rem, 8vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.06em;
  color: var(--green);
  line-height: 1;
}

.site-cursor {
  color: var(--green-dim);
  animation: cursor-blink 1.1s steps(2, jump-none) infinite;
}

.site-desc {
  margin-top: 12px;
  font-size: 0.98rem;
  color: var(--text);
}

.site-desc::before {
  content: "> ";
  color: var(--green-dim);
}

/* sections */
.block {
  margin-bottom: 64px;
}

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

.section-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--green-dim);
  letter-spacing: 0.02em;
}

.section-number {
  margin-right: 10px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 500;
}

.section-note {
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* projects */
.projects {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.project {
  display: block;
  position: relative;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  padding: 18px 54px 18px 20px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.project::before {
  content: attr(data-index);
  position: absolute;
  top: 18px;
  right: 18px;
  color: var(--muted);
  font-size: 0.72rem;
}

.project::after {
  content: "↗";
  position: absolute;
  right: 18px;
  bottom: 14px;
  color: var(--green);
  font-size: 1rem;
  opacity: 0;
  transform: translate(-4px, 4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.project:hover {
  background: var(--bg-hover);
  border-color: var(--border-hi);
  box-shadow: inset 3px 0 var(--green-dim);
  transform: translateX(4px);
}

.project:hover::after {
  opacity: 1;
  transform: translate(0, 0);
}

.project:focus-visible,
a.contact:focus-visible,
button.contact-handle:focus-visible {
  outline: 1px solid var(--green);
  outline-offset: 4px;
}

.project-name {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  transition: color 0.15s ease;
}

.project:hover .project-name {
  color: var(--green);
}

.project-link {
  display: block;
  margin-top: 3px;
  font-size: 0.8rem;
  color: var(--blue);
}

.project-desc {
  display: block;
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--muted);
}

.project-desc:empty {
  display: none;
}

/* contacts */
.contacts {
  border-top: 1px solid var(--border);
}

.contact {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
}

.contact-name,
.contact-handle,
.contact-status {
  min-width: 0;
}

a.contact:hover .contact-handle {
  color: var(--green);
  text-decoration: underline;
}

.contact-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.contact-handle {
  font-size: 0.85rem;
  color: var(--blue);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

button.contact-handle {
  appearance: none;
  width: fit-content;
  border: 0;
  padding: 0;
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

button.contact-handle:hover,
button.contact-handle:focus-visible {
  color: var(--green);
  text-decoration: underline;
}

button.contact-handle.is-copied {
  color: var(--green);
}

.copy-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 10;
  padding: 8px 12px;
  border: 1px solid var(--green-dim);
  background: var(--bg-raised);
  color: var(--green);
  font-size: 0.8rem;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.copy-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.contact-status {
  justify-self: end;
  font-size: 0.75rem;
  color: var(--muted);
}

.contacts-more summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.75rem;
  list-style: none;
}

.contacts-more summary::-webkit-details-marker {
  display: none;
}

.contacts-more summary::before {
  content: "+";
  color: var(--green-dim);
  font-size: 0.9rem;
  margin-right: -8px;
}

.contacts-more[open] summary::before {
  content: "−";
}

.contacts-more summary:hover,
.contacts-more summary:focus-visible {
  color: var(--text);
}

.summary-action {
  color: var(--green-dim);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.contacts-more-list .contact:first-child {
  border-top: 0;
}

.contact-status::before {
  content: "[";
  margin-right: 3px;
}

.contact-status::after {
  content: "]";
  margin-left: 3px;
}

.status-active {
  color: var(--green);
}

.status-banned {
  color: var(--red);
}

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

@media (max-width: 520px) {
  .contact {
    grid-template-columns: 1fr auto;
    gap: 2px 12px;
  }

  .contact-handle {
    grid-column: 1;
    grid-row: 2;
  }

  .contact-status {
    grid-column: 2;
    grid-row: 1 / span 2;
  }
}

/* footer */
.foot {
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.foot p {
  font-size: 0.8rem;
  color: var(--muted);
}

.foot p::before {
  content: "// ";
  color: var(--green-dim);
}

@keyframes cursor-blink {
  0%, 45% { opacity: 1; }
  46%, 100% { opacity: 0; }
}

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

/* small screens */
@media (max-width: 520px) {
  .wrap { padding: 64px 18px 48px; }
  .intro { margin-bottom: 52px; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 4px; }
  .section-note { font-size: 0.62rem; }
}
