:root {
  --background: #0e1c23;
  --foreground: #e2e8f0;
  --card: #0e1c23;
  --card-foreground: #e2e8f0;
  --primary: #38bdf8;
  --primary-foreground: #0b1220;
  --secondary: #0e1c23;
  --secondary-foreground: #e2e8f0;
  --muted: #0e1c23;
  --muted-foreground: rgba(226, 232, 240, 0.65);
  --border: rgba(148, 163, 184, 0.2);
  --font-sans: 'JetBrains Mono', 'Roboto Mono', monospace;
  --radius: 0rem;
  --container-max-width: 1200px;
  --content-max-width: 800px;
  --lh-body: 1.5;
}

* {
  box-sizing: border-box;
  font-family: var(--font-sans) !important;
}

body {
  background-color: var(--background);
  color: var(--foreground);
  margin: 0;
  padding: 0;
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  background-image: radial-gradient(
      circle at 20% 20%,
      rgba(56, 189, 248, 0.06),
      transparent 35%
    ),
    radial-gradient(circle at 80% 0%, rgba(167, 139, 250, 0.06), transparent 40%);
}

.container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

a:focus-visible {
  outline: 1px dashed rgba(56, 189, 248, 0.9);
  outline-offset: 3px;
}

/* Header & Nav */
.app-header {
  background: rgba(14, 28, 35, 0.92);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: none;
}

.main-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.logo {
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  color: var(--foreground);
  letter-spacing: 0.08em;
  text-transform: none;
  white-space: nowrap;
}

.logo::before {
  content: "$ ";
  color: var(--primary);
}

.prompt-user {
  color: #34d399;
}

.prompt-at {
  color: rgba(226, 232, 240, 0.85);
}

.prompt-host {
  color: #38bdf8;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav-link {
  text-decoration: none;
  color: var(--foreground);
  font-weight: 500;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.1rem 0;
  border-bottom: 1px solid transparent;
}

.nav-link:hover {
  color: var(--primary);
  border-bottom-color: rgba(56, 189, 248, 0.55);
}

.lang-switch {
  display: flex;
  gap: 0.35rem;
  border-left: none;
  padding-left: 0;
  margin-left: 0.75rem;
  position: relative;
}

.lang-link {
  text-decoration: none;
  color: var(--muted-foreground);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.1rem 0.25rem;
  border: 1px solid transparent;
}

.lang-link.active {
  color: var(--primary);
  background-color: transparent;
  border-color: rgba(56, 189, 248, 0.4);
}

/* Hero Section */
.hero-section {
  padding: 5rem 0;
  text-align: center;
  background-color: transparent;
  border-bottom: 1px solid var(--border);
  margin-bottom: 3rem;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.1;
  font-weight: 800;
  margin-bottom: 1.5rem;
  letter-spacing: -2px;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--muted-foreground);
  max-width: 700px;
  margin: 0 auto 2.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 2rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--primary-foreground);
}

.btn-primary:hover {
  filter: brightness(1.2);
}

.btn-secondary {
  background-color: var(--secondary);
  color: var(--secondary-foreground);
  border: 1px solid var(--border);
}

/* How It Works Section */
.section-title {
  font-size: 1.75rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 3rem;
  letter-spacing: -1px;
}

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

.step-card {
  background: white;
  border: 1px solid var(--border);
  padding: 2rem;
}

.step-number {
  width: 2rem;
  height: 2rem;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  margin-bottom: 1rem;
}

.step-title {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
}

.step-desc {
  font-size: 0.95rem;
  color: var(--muted-foreground);
}

/* Posts Grid */
.posts-section {
  padding: 5rem 0;
}

.posts-section-home {
  padding-top: 2rem;
}

.posts-list {
  max-width: var(--content-max-width);
  margin: 0 auto;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  font-family: "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  font-size: 0.92rem;
  color: #e2e8f0;
}

.posts-list-total {
  color: rgba(226, 232, 240, 0.7);
  margin-bottom: 0.6rem;
}

.posts-list-row {
  display: grid;
  grid-template-columns: 70px 28px 140px 34px minmax(200px, 1fr);
  column-gap: 0.8rem;
  padding: 0.28rem 0;
  align-items: baseline;
}

.posts-list-row:hover {
  background: rgba(226, 232, 240, 0.05);
}

.posts-list-cell {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.posts-list-perms {
  color: #a78bfa;
}

.posts-list-acl {
  color: rgba(226, 232, 240, 0.4);
  text-align: center;
}

.posts-list-date {
  color: #38bdf8;
}

.posts-list-flag {
  color: #34d399;
  text-align: center;
}

.posts-list-name {
  min-width: 0;
}

.posts-list-tags {
  color: rgba(226, 232, 240, 0.6);
  font-size: 0.8rem;
  margin-top: 0.15rem;
}

.posts-list-link {
  color: #67e8f9;
  text-decoration: none;
}

.posts-list-link:hover {
  color: #22d3ee;
  text-decoration: underline;
}

.section-actions {
  text-align: center;
  margin-top: 3rem;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 2.5rem;
  flex-wrap: wrap;
}

.pagination-link {
  text-decoration: none;
  color: var(--foreground);
  border: 1px solid var(--border);
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-size: 0.85rem;
}

.pagination-link.is-disabled {
  color: var(--muted-foreground);
  border-color: var(--border);
  cursor: default;
}

.pagination-info {
  color: var(--muted-foreground);
  font-size: 0.85rem;
}

/* Terms (tags) */
.terms-list {
  max-width: var(--content-max-width);
  margin: 0 auto;
  font-family: "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  font-size: 0.92rem;
}

.terms-total {
  color: var(--muted-foreground);
  margin-bottom: 0.6rem;
}

.terms-row {
  display: grid;
  grid-template-columns: 90px minmax(200px, 1fr);
  column-gap: 1rem;
  padding: 0.28rem 0;
}

.terms-row:hover {
  background: rgba(226, 232, 240, 0.05);
}

.terms-cell {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.terms-count {
  color: rgba(226, 232, 240, 0.6);
  text-align: right;
  padding-right: 0.25rem;
}

.terms-link {
  color: #a3e635;
  text-decoration: none;
}

.terms-link:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .terms-row {
    grid-template-columns: 70px minmax(140px, 1fr);
  }
}

/* Post Content Styling */
.app-main {
  padding: 2rem 0 5rem;
}

.post-full {
  max-width: var(--content-max-width);
  margin: 0 auto;
}

.post-header {
  margin-bottom: 3rem;
  text-align: center;
}

.post-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -1.5px;
  margin-bottom: 1rem;
}

.post-meta {
  color: var(--muted-foreground);
  font-size: 0.85rem;
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.post-content-header {
  text-align: left;
  margin-bottom: 2rem;
}

.post-content-header .post-title {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0;
  margin-bottom: 0.4rem;
}

.post-date {
  color: var(--muted-foreground);
  font-size: 0.85rem;
  display: block;
}

.post-content-header .post-tags {
  margin-top: 0.75rem;
  justify-content: center;
}

.post-content .post-tags {
  justify-content: flex-start;
}

.post-tags-bottom {
  margin-top: 2rem;
}

.post-content {
  font-size: 1rem;
  line-height: 1.7;
  background: transparent;
  color: #e2e8f0;
  padding: 2rem 0;
  border: none;
  border-radius: 0;
  font-family: "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
}

.post-content p {
  margin-bottom: 1.5rem;
}

.post-content h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
  color: #f8fafc;
}

.post-content h1::before,
.post-content h2::before,
.post-content h3::before,
.post-content h4::before,
.post-content h5::before,
.post-content h6::before {
  color: rgba(226, 232, 240, 0.55);
}

.post-content h1::before {
  content: "# ";
}

.post-content h2::before {
  content: "## ";
}

.post-content h3::before {
  content: "### ";
}

.post-content h4::before {
  content: "#### ";
}

.post-content h5::before {
  content: "##### ";
}

.post-content h6::before {
  content: "###### ";
}

.post-content-header .post-title::before {
  content: "# ";
  color: rgba(226, 232, 240, 0.55);
}

.post-content a {
  color: #38bdf8;
}

.post-content blockquote {
  border-left: 3px solid rgba(148, 163, 184, 0.4);
  padding-left: 1rem;
  color: rgba(226, 232, 240, 0.75);
}

.post-content pre,
.post-content code,
.post-content pre code,
.post-content .hljs {
  font-family: "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
}

.post-content pre {
  background: rgba(15, 23, 42, 0.6);
  color: #e2e8f0;
  padding: 1.25rem 1.5rem;
  border-radius: 10px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.6;
  box-shadow: none;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.post-content pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

.post-content code {
  background: rgba(226, 232, 240, 0.12);
  color: #e2e8f0;
  padding: 0.15rem 0.35rem;
  border-radius: 6px;
  font-size: 0.95em;
}

.post-content .hljs {
  background: transparent;
}

.post-content p > img,
.post-content p > a:only-child > img,
.post-content figure > img,
.post-content figure > a:only-child > img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.75rem auto;
}

/* Center embedded videos the same way as images (see render-link hook in layouts/_default/_markup/render-link.html). */
.post-content p > video.post-video,
.post-content figure > video.post-video {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.75rem auto;
}

.post-content figure {
  margin: 1.75rem auto;
  text-align: center;
}

.post-content figcaption {
  margin-top: 0.5rem;
  color: var(--muted-foreground);
  font-size: 0.85rem;
}

@media (max-width: 900px) {
  .posts-list-row {
    grid-template-columns: 70px 24px 120px 30px minmax(160px, 1fr);
  }
}

@media (max-width: 640px) {
  .posts-list-row {
    grid-template-columns: 1fr;
    row-gap: 0.35rem;
  }
  .posts-list-cell {
    white-space: normal;
  }
}

/* Footer */
.app-footer {
  background: rgba(14, 28, 35, 0.92);
  border-top: 1px solid var(--border);
  padding: 2.5rem 0 1.75rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-title {
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: none;
  margin-bottom: 1.5rem;
  color: var(--foreground);
}

.footer-title::before {
  content: "# ";
  color: var(--primary);
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  text-decoration: none;
  color: var(--muted-foreground);
  font-size: 0.9rem;
}

.footer-text {
  color: var(--muted-foreground);
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0;
}

.footer-copyright {
  margin: 0.75rem 0 0;
  color: rgba(226, 232, 240, 0.55);
  font-size: 0.8rem;
}

@media (max-width: 768px) {
  .main-nav {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  .nav-links {
    flex-direction: column;
    gap: 0.5rem;
  }
  .lang-switch {
    border-left: none;
    padding-left: 0;
    margin-left: 0;
    margin-top: 0.5rem;
  }
  .post-content {
    padding: 1.5rem;
  }
}
