/* Critical Styles */
:root {
  --font-family: "Intel One Mono", monospace;
  --line-height: 1.20rem;
  --border-thickness: 2px;
  --text-color: #000;
  --text-color-alt: #666;
  --background-color: #fff;
  --background-color-alt: #eee;
  --font-weight-normal: 500;
  --font-weight-medium: 600;
  --font-weight-bold: 800;
}

/* Font Loading Optimization */
@font-face {
  font-family: 'Intel One Mono';
  src: local('Intel One Mono'),
       url('https://raw.githubusercontent.com/intel/intel-one-mono/main/fonts/woff2/IntelOneMono-Regular.woff2') format('woff2'),
       url('https://raw.githubusercontent.com/intel/intel-one-mono/main/fonts/ttf/IntelOneMono-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Intel One Mono';
  src: local('Intel One Mono Bold'),
       url('https://raw.githubusercontent.com/intel/intel-one-mono/main/fonts/woff2/IntelOneMono-Bold.woff2') format('woff2'),
       url('https://raw.githubusercontent.com/intel/intel-one-mono/main/fonts/ttf/IntelOneMono-Bold.ttf') format('truetype');
  font-weight: bold;
  font-style: normal;
  font-display: swap;
}

/* Base Styles */
* { box-sizing: border-box; }

html {
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: center;
  background: var(--background-color);
  color: var(--text-color);
  font-family: var(--font-family);
  font-size: 18px;
  line-height: 1.6;
}

body {
  position: relative;
  width: 100%;
  margin: 0;
  padding: 2rem 2ch;
  max-width: calc(min(120ch, round(down, 100%, 1ch)));
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
  :root {
    --text-color: #fff;
    --text-color-alt: #aaa;
    --background-color: #000;
    --background-color-alt: #111;
  }
}

/* Grid System */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.grid .card {
  margin: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

/* Components */
.header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: var(--border-thickness) solid var(--text-color);
  display: flex;
  flex-direction: column;
}

.nav-links {
  margin-top: 1.25rem;
  line-height: 1;
}

.nav-item {
  display: inline;
  white-space: nowrap;
  color: #9966ff;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn {
  background: #1f6feb;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  font-weight: var(--font-weight-bold);
}

.card {
  border: var(--border-thickness) solid var(--text-color);
  padding: 1.5rem;
  border-radius: 4px;
}

/* Utilities */
.mt-2 { margin-top: 0.5rem }
.mt-4 { margin-top: 1rem }
.mt-6 { margin-top: 1.5rem }
.mt-8 { margin-top: 2rem }
.mt-12 { margin-top: 3rem }

/* Hover States */
.btn:hover { background: #3a84ff }
.nav-item:hover {
  color: rgb(20, 255, 243);
  background-color: #282828;
}

/* Mobile Responsive */
@media screen and (max-width: 600px) {
  html { font-size: 16px }
  body { padding: 1rem }
  .grid { grid-template-columns: 1fr; gap: 1rem }
  .card { padding: 1rem }
  .header {
    text-align: center;
    margin-bottom: 1rem;
  }
  .nav-item { font-size: 0.9rem }
}

/* Terminal */
.terminal {
  background: #000;
  color: #33ff33;
  padding: 1rem;
  font-size: 0.875rem;
  white-space: pre-wrap;
  border: var(--border-thickness) solid #33ff33;
}

/* Footer */
footer {
  border-top: 1px solid var(--gray-800);
}

footer a {
  color: var(--gray-400);
  transition: color 0.2s;
}

footer a:hover {
  color: var(--emerald-400);
  text-decoration: none;
}

a {
  color: #9966ff;
  text-decoration: none;
}

a:hover {
  color: rgb(20, 255, 243);
  background-color: #282828;
}

::selection {
  color: white;
  background: blueviolet;
}
