:root {
  --forest: #1d2f28;
  --text: #e8f3ed;
  --muted: #afc6bb;
  --border: #3d534a;
  --emerald: #0fd6a8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--forest);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

.page-shell {
  min-height: 100vh;
  padding: 4rem 6vw;
}

.hero {
  max-width: 820px;
  margin: 0 auto;
  text-align: left;
}

.name {
  display: block;
  margin: 0 0 1.6rem;
  font-size: clamp(2.8rem, 6vw, 3.8rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.name-link {
  color: var(--text);
  text-decoration: none;
  display: inline-block;
}

.nav-links {
  display: flex;
  gap: 0.75rem clamp(1.2rem, 3vw, 2.4rem);
  font-size: 1.1rem;
  font-weight: 600;
  flex-wrap: wrap;
}

.bookshelf {
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
  margin-top: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.sort-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  border-top: 1px solid var(--border);
  padding-top: 1.2rem;
}

.sort-bar h2 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sort-controls {
  display: inline-flex;
  gap: 0.6rem;
}

.sort-controls button {
  background: color-mix(in srgb, var(--text) 6%, transparent);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: background 160ms ease, border-color 160ms ease;
}

.sort-controls button:hover,
.sort-controls button:focus-visible {
  background: rgba(15, 214, 168, 0.15);
  border-color: rgba(15, 214, 168, 0.4);
}

.top-recs,
.categories {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.top-recs h3,
.categories h4 {
  margin: 0 0 0.6rem;
  letter-spacing: 0.04em;
}

.categories {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.category {
  background: color-mix(in srgb, var(--text) 4%, transparent);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
  min-height: 120px;
}

.nav-links a {
  color: var(--text);
  text-decoration: none;
  position: relative;
  padding-bottom: 0.15rem;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: var(--emerald);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 220ms ease;
}

.nav-links a:hover::after,
.nav-links a:focus-visible::after,
.nav-links a[aria-current="page"]::after {
  transform: scaleX(1);
}

.now-callout {
  margin-top: 3rem;
  padding: 1.35rem 0 0;
  border-top: 1px solid var(--border);
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
}

.now-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.now-textblock {
  text-align: left;
  display: inline-flex;
  flex-direction: column;
  gap: 0.4rem;
  width: 100%;
}

.now-blurb {
  display: block;
  margin: 0;
  color: #dff2e8;
  letter-spacing: 0.02em;
}

.now-link {
  color: inherit;
  text-decoration: none;
  display: block;
}

.now-link:hover .now-label,
.now-link:focus-visible .now-label {
  border-color: var(--emerald);
}

.now-mini-list {
  margin: 0.9rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem;
  color: var(--text);
}

.now-mini-block {
  display: grid;
  gap: 0.25rem;
}

.now-mini-title {
  font-weight: 700;
  letter-spacing: 0.02em;
}

.now-mini-items {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.25rem;
}

.now-mini-items li {
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.now-label {
  display: inline-block;
  margin: 0;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.8rem;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  transition: border-color 200ms ease;
}
.now-page {
  max-width: 820px;
  margin: 2.5rem auto 0;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.content-page {
  max-width: 820px;
  margin: 2.5rem auto 0;
}

.page-heading {
  border-top: 1px solid var(--border);
  padding-top: 1.2rem;
}

.page-heading h2 {
  margin: 0.5rem 0 0;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 500;
}

.repo-list {
  display: grid;
  gap: 1rem;
  margin-top: 1.8rem;
}

.repo-card {
  display: grid;
  gap: 0.35rem;
  padding: 1.1rem 1.2rem;
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--text) 4%, transparent);
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.repo-card:hover,
.repo-card:focus-visible {
  background: rgba(15, 214, 168, 0.1);
  border-color: rgba(15, 214, 168, 0.45);
  transform: translateY(-1px);
}

.repo-name {
  font-size: 1.15rem;
  font-weight: 700;
}

.repo-description {
  color: var(--muted);
  line-height: 1.5;
}

.now-heading {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

.now-updated {
  font-size: 0.9rem;
  color: var(--muted);
}

.now-content {
  display: grid;
  gap: 1.2rem;
}

.now-section h3 {
  margin: 0 0 0.35rem;
  letter-spacing: 0.04em;
}

.now-section ul {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.2rem;
  list-style: disc;
}

.now-section li {
  line-height: 1.5;
  overflow-wrap: anywhere;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--emerald);
  outline-offset: 4px;
}

@media (max-width: 768px) {
  .page-shell {
    padding: 3rem 5vw;
  }

  .nav-links {
    gap: 0.65rem 1.2rem;
  }

  .now-callout {
    margin-top: 2.25rem;
  }

  .now-mini-list {
    grid-template-columns: 1fr;
    gap: 1.1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
