/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #1c1c1c;
  --text: #d4d4d4;
  --text-bright: #ffffff;
  --accent: #4ade80;
  --surface: #262626;
  --border: #404040;
}

body {
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  font-size: 14px;
}

/* Terminal window style */
.terminal-window {
  max-width: 900px;
  margin: 2rem auto;
  background-color: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
}

.terminal-header {
  background-color: #2d2d2d;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.terminal-buttons {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.terminal-button {
  width: 14px;
  height: 14px;
  border: 1px solid var(--border);
  background-color: #404040;
  display: inline-block;
  cursor: pointer;
  position: relative;
}

.terminal-button.close::before,
.terminal-button.close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 1px;
  background-color: var(--text);
  transform: translate(-50%, -50%) rotate(45deg);
}

.terminal-button.close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.terminal-button.minimize::before {
  content: "";
  position: absolute;
  bottom: 2px;
  left: 50%;
  width: 6px;
  height: 1px;
  background-color: var(--text);
  transform: translateX(-50%);
}

.terminal-button.maximize::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  border: 1px solid var(--text);
  transform: translate(-50%, -50%);
}

.terminal-title {
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 500;
}

.terminal-body {
  padding: 2rem;
  min-height: calc(100vh - 8rem);
}

/* Typography */
h1 {
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--text-bright);
  margin-bottom: 1rem;
}

h1::before {
  content: "$ ";
  color: var(--accent);
}

.tagline {
  color: var(--text);
  margin-bottom: 2rem;
  opacity: 0.8;
}

.tagline span {
  color: var(--accent);
}

h2 {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-bright);
  margin-bottom: 1rem;
  margin-top: 2rem;
}

h2::before {
  content: "## ";
  color: var(--accent);
  opacity: 0.5;
}

p {
  color: var(--text);
  margin-bottom: 1rem;
}

/* Command prompt style */
.prompt::before {
  content: "→ ";
  color: var(--accent);
}

/* Links */
a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

a:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* Navigation */
nav {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

nav ul {
  list-style: none;
  display: flex;
  gap: 2rem;
}

nav a {
  color: var(--text);
  position: relative;
}

nav a::before {
  content: "./";
  color: var(--accent);
  opacity: 0.5;
}

nav a:hover {
  color: var(--text-bright);
  text-decoration: none;
}

nav a:hover::after {
  content: "_";
  animation: blink 1s infinite;
}

@keyframes blink {
  0%, 50% {
    opacity: 1;
  }
  51%, 100% {
    opacity: 0;
  }
}

/* Main content */
main {
  margin-top: 2rem;
}

section {
  margin-bottom: 2rem;
}

/* Code block style sections */
.code-block {
  background-color: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1rem;
  margin: 1rem 0;
  position: relative;
}

.code-block::before {
  content: attr(data-lang);
  position: absolute;
  top: -8px;
  right: 8px;
  background-color: var(--surface);
  padding: 0 0.5rem;
  font-size: 0.75rem;
  color: var(--accent);
}

/* Lists */
section ul {
  list-style: none;
  padding-left: 0;
}

section li {
  margin-bottom: 0.5rem;
  position: relative;
  padding-left: 1.5rem;
}

section li::before {
  content: "-";
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* Nested lists */
section ul ul {
  margin-top: 0.5rem;
  padding-left: 1.5rem;
}

section ul ul li::before {
  content: "└─";
  color: var(--accent);
  opacity: 0.6;
}

section ul ul li:last-child::before {
  content: "└─";
}

section ul ul li:not(:last-child)::before {
  content: "├─";
}

/* Category labels */
section li > text,
section li:not(:has(a)):not(:has(ul)) {
  color: var(--text);
  font-weight: 600;
  opacity: 0.9;
}

section li a {
  color: var(--text-bright);
}

/* Output style */
.output {
  margin-top: 1rem;
  padding-left: 2rem;
  color: var(--text);
  font-style: italic;
  opacity: 0.8;
}

/* Contact section */
#contact a {
  color: var(--text-bright);
  background-color: var(--bg);
  padding: 0.25rem 0.5rem;
  border-radius: 3px;
  border: 1px solid var(--border);
}

#contact a:hover {
  border-color: var(--accent);
  text-decoration: none;
}

/* ASCII art */
.ascii-art {
  color: var(--accent);
  font-size: 0.8rem;
  line-height: 1;
  margin: 2rem 0;
  white-space: pre;
  opacity: 0.3;
}

/* Footer */
footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  text-align: center;
  opacity: 0.5;
}

footer p {
  font-size: 0.8rem;
}

/* Command history effect */
.history {
  opacity: 0.5;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

/* Typing animation */
@keyframes typing {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

.typing {
  overflow: hidden;
  white-space: nowrap;
  border-right: 2px solid var(--accent);
  animation: typing 2s steps(40, end), blink 1s step-end infinite;
}

/* Matrix effect for header background */
header {
  position: relative;
  overflow: hidden;
}

header::before {
  content: "01001000 01100101 01101100 01101100 01101111";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  color: var(--accent);
  opacity: 0.05;
  font-size: 0.8rem;
  white-space: pre;
  overflow: hidden;
  animation: scroll 20s linear infinite;
}

@keyframes scroll {
  0% {
    transform: translateX(100%);
  }
  100% {
    transform: translateX(-100%);
  }
}

/* Responsive */
@media (max-width: 768px) {
  .terminal-window {
    margin: 1rem;
    border-radius: 0;
  }

  .terminal-body {
    padding: 1.5rem;
  }

  nav ul {
    flex-direction: column;
    gap: 0.5rem;
  }
}
