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

:root {
  --bg:      #0e0e0e;
  --sidebar: #161616;
  --accent:  #ff3eaa;
  --muted:   #777;
  --text:    #f0ede8;
  --sidebar-text: #a9a9a9;
  --border:  #2a2a2a;
}

body {
  display: flex;
  min-height: 100vh;
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  font-size: 13px;
  font-weight: 400;
  background: var(--bg);
  color: var(--text);
}

/* ── SIDEBAR ── */

aside {
  width: 210px;
  min-width: 210px;
  background: var(--sidebar);
  color: #aaa;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  align-self: flex-start;
  overflow: hidden;
  border-right: 1px solid var(--border);
}

aside header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px;
  border-bottom: 1px solid var(--border);
}

aside header figure {
  font-size: 18px;
  
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  
}

aside header span {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  text-transform: lowercase;
}

aside header span + span {
  font-size: 10px;
  font-weight: 400;
  color: var(--sidebar-text);
  text-transform: lowercase;
  padding-top: 2px;
}

aside input {
  margin: 12px;
  width: calc(100% - 24px);
  background: #000;
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 400;
  font-size: 12px;
  padding: 8px 10px;
  outline: none;
}

aside input::placeholder {
  color: #444;
}

aside input:focus {
  border-color: var(--accent);
}

nav {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0 12px;
  scrollbar-width: thin;
  scrollbar-color: #333 transparent;
}

nav p {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--sidebar-text);
  padding: 2rem 14px 5px;
}

nav ul {
  list-style: none;
}

nav a {
  display: block;
  padding: 4px 14px;
  color: var(--sidebar-text);
  font-weight: 400;
  font-size: 12px;
  transition: color 0.1s, background 0.1s;
  text-decoration: none;
}

nav a:hover {
  color: var(--text);
  background: #1e1e1e;
}

nav a.active {
  color: var(--accent);
  background: rgba(255,62,170,0.08);
  border-left: 3px solid var(--accent);
  padding-left: 11px;
}

aside footer {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  font-size: 10px;
  font-weight: 400;
  color: var(--sidebar-text);
  line-height: 1.7;
}

aside footer a {
  color: var(--sidebar-text);
  text-decoration: underline;
}

/* ── MAIN ── */

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

h2 {
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--sidebar-text);
  padding: 2rem 14px 5px;
}

#topbar {
  display: flex;
  align-items: center;
  justify-content: right;
  padding: 14px 40px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  text-transform: lowercase;
}

#topbar button {
  background: transparent;
  border: 1px solid var(--border);
  width: 30px;
  height: 30px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
  font-weight: 400;
}

#topbar button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.article-body {
  padding: 48px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.card-section {
  padding: 0 48px 48px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  max-width: 820px;
  margin-top: 12px;
}

#hero {
  padding: 0 0 36px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

#hero h1 {
  font-size: 56px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  letter-spacing: -0.03em;
  margin-bottom: 10px;
}

#hero p {
  font-size: 13px;
  font-weight: 400;
  color: var(--accent);
  text-transform: lowercase;
}

.article-body p {
  line-height: 1.75;
  color: #999;
  font-weight: 400;
  max-width: 850px;
}

.article-body a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
}

.article-body a:hover {
  background: var(--accent);
  color: #000;
}

.card {
  background: var(--sidebar);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  min-height: 200px;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
  cursor: pointer;
  position: relative;
}

.card-icons {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  gap: 5px;
  align-items: center;
}

.card-icons svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.card:hover {
  border-color: var(--accent);
  background: #1c1218;
  transform: translateY(-2px);
}

/* ── RESPONSIVE ── */

@media (max-width: 768px) {
  body {
    flex-direction: column;
  }

  aside {
    width: 100%;
    min-width: unset;
    height: auto;
    position: static;
    overflow: visible;
  }

  nav {
    display: none;
  }

  .article-body {
    padding: 28px 20px;
  }

  #hero h1 {
    font-size: 36px;
  }

  .card-section {
    padding: 0 20px 32px;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  #topbar {
    padding: 12px 20px;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.card h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.card p {
  font-size: 12px;
  line-height: 1.75;
  color: #999;
}

.card-read-more {
  margin-top: auto;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.05em;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s;
  align-self: flex-start;
}

.card-read-more:hover {
  border-bottom-color: var(--accent);
}

/* ── LEGEND LIST ── */

ul.legend {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

ul.legend li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #999;
}

ul.legend svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
