/* 1. RESET */

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

ul,
ol {
  list-style: none;
}

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

body {
  padding: 1rem;
  max-width: 100vw;
  overflow-x: hidden;
}

/* Make ASCII logo scrollable on small screens instead of breaking layout */
.ascii-logo {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

.ascii-logo pre {
  white-space: pre; /* prevent line wrapping */
  min-width: 650px; /* lock the width of the ascii art */
}

.command-name,
.social-label {
  display: inline-block;
  width: 80px;
}

/* 2. FONTS */

@font-face {
  font-family: "JetBrainsMono";
  src: url("./fonts/JetBrainsMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "JetBrainsMono";
  src: url("./fonts/JetBrainsMono-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* 3. ROOT DESIGN TOKENS */

:root {
  /* Backgrounds */
  --bg-main: #0d1117;
  --bg-panel: #161b22;
  --bg-soft: #21262d;

  /* Borders */
  --border-color: #30363d;

  /* Text */
  --text-primary: #c9d1d9;
  --text-muted: #8b949e;

  /* Accents */
  --accent-blue: #58a6ff;
  --accent-green: #3fb950;
  --accent-red: #f85149;
  --accent-yellow: #d29922;
  --accent-purple: #a371f7;
  --accent-cyan: #39c5cf;

  /* Cursor */
  --cursor-color: #58a6ff;
}

[data-theme="light"] {
  /* Backgrounds */
  --bg-main: #ffffff;
  --bg-panel: #f6f8fa;
  --bg-soft: #f0f2f5;

  /* Borders */
  --border-color: #d0d7de;

  /* Text */
  --text-primary: #1f2328;
  --text-muted: #57606a;

  /* Accents */
  --accent-blue: #0969da;
  --accent-green: #1f883d;
  --accent-red: #d73a49;
  --accent-yellow: #9a6700;
  --accent-purple: #8250df;
  --accent-cyan: #1b7c83;

  /* Cursor */
  --cursor-color: #0969da;
}

[data-theme="matrix"] {
  /* Backgrounds */
  --bg-main: #000000;
  --bg-panel: #020202;
  --bg-soft: #010101;

  /* Borders */
  --border-color: #003b00;

  /* Text */
  --text-primary: #00ff00;
  --text-muted: #008f00;

  /* Accents */
  --accent-blue: #00bfff;
  --accent-green: #32cd32;
  --accent-red: #ff4136;
  --accent-yellow: #ffdc00;
  --accent-purple: #b10dc9;
  --accent-cyan: #7fdbff;

  /* Cursor */
  --cursor-color: #00ff00;
}

/* 4. BASE STYLES */

body {
  font-family: "JetBrainsMono", monospace;
  background-color: var(--bg-soft);
  color: var(--text-muted);
  padding: 12px;
  font-size: 14px;
  line-height: 1.6;
  letter-spacing: 0.5px;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--accent-blue);
  color: var(--bg-main);
}

input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--accent-cyan);
  font-family: inherit;
  caret-color: var(--cursor-color);
}

.project:hover::after {
  content: '↗';
  margin-left: 5px;
  font-size: 14px;
}

/* 5. TERMINAL STATES (SEMANTIC) */

.success {
  color: var(--accent-green);
}
.error {
  color: var(--accent-red);
}
.warning {
  color: var(--accent-yellow);
}
.info {
  color: var(--accent-blue);
}
.system {
  color: var(--accent-purple);
}

.flag {
  color: var(--accent-green);
  font-weight: 600;
}

/* 6. TEXT UTILITIES */

.text-primary {
  color: var(--text-primary);
}
.text-muted {
  color: var(--text-muted);
}

.text-blue {
  color: var(--accent-blue);
}
.text-green {
  color: var(--accent-green);
}
.text-red {
  color: var(--accent-red);
}
.text-yellow {
  color: var(--accent-yellow);
}
.text-purple {
  color: var(--accent-purple);
}
.text-cyan {
  color: var(--accent-cyan);
}

.bold {
  font-weight: 700;
}
.dim {
  opacity: 0.6;
}
.underline {
  text-decoration: underline;
}

/* 7. BACKGROUND UTILITIES */

.bg-main {
  background: var(--bg-main);
}
.bg-panel {
  background: var(--bg-panel);
}
.bg-soft {
  background: var(--bg-soft);
}

.bg-success {
  background: rgba(63, 185, 80, 0.1);
  border-left: 3px solid var(--accent-green);
  padding-left: 6px;
}

.bg-error {
  background: rgba(248, 81, 73, 0.1);
  border-left: 3px solid var(--accent-red);
  padding-left: 6px;
}

.bg-warning {
  background: rgba(210, 153, 34, 0.1);
  border-left: 3px solid var(--accent-yellow);
  padding-left: 6px;
}

/* 8. SPACING UTILITIES */

.mt-1 {
  margin-top: 4px;
}
.mt-2 {
  margin-top: 8px;
}
.mt-3 {
  margin-top: 12px;
}

.mb-1 {
  margin-bottom: 4px;
}
.mb-2 {
  margin-bottom: 8px;
}
.mb-3 {
  margin-bottom: 12px;
}

.p-1 {
  padding: 4px;
}
.p-2 {
  padding: 8px;
}

/* 9. INTERACTION */

.clickable {
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.clickable:hover {
  opacity: 0.8;
}

/* 10. TERMINAL CONTAINER */

.terminal {
  width: fit-content;
  background-color: var(--bg-panel);
  padding: 6px 10px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
}
