/* PyTorch DevLog Theme */

:root {
  --accent: #de3412;
  --accent-soft: #fef2f0;
  --accent-hover: #b82a0e;

  --color-text: #1e293b;
  --color-text-muted: #64748b;
  --color-heading: #0f172a;
  --color-background: #ffffff;
  --color-surface: #f8fafc;
  --color-border: #e2e8f0;
  --color-border-muted: #f1f5f9;

  --font-base: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue",
    Arial, sans-serif;
  --font-mono: "SFMono-Regular", Menlo, Consolas, Monaco, monospace;

  --content-max: 1100px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent: #F2765D;
    --accent-soft: #3d1a10;
    --accent-hover: #f9a08d;
    --color-text: #e2e8f0;
    --color-text-muted: #94a3b8;
    --color-heading: #f8fafc;
    --color-background: #0f172a;
    --color-surface: #1e293b;
    --color-border: #334155;
    --color-border-muted: #1e293b;
  }
}

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

body {
  font-family: var(--font-base);
  font-size: 17px;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-background);
  -webkit-font-smoothing: antialiased;
}

/* Header */
.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-header a.site-title {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

.site-header nav a {
  font-size: 0.875rem;
  margin-left: 1.5rem;
  color: var(--color-text-muted);
  text-decoration: none;
  font-weight: 500;
}

.site-header nav a:hover {
  color: var(--accent);
}

/* Layout */
.wrapper {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.content {
  flex: 1;
  min-width: 0;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--color-heading);
  font-weight: 700;
  line-height: 1.3;
}

h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.4rem;
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--accent-soft);
}

h3 {
  font-size: 1.15rem;
  margin: 1.75rem 0 0.6rem;
}

h4 { font-size: 1rem; margin: 1.4rem 0 0.5rem; }

p { margin-bottom: 1rem; }

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

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
  margin: 1.25rem 0;
  border-radius: 6px;
}

ul, ol {
  margin: 0.5rem 0 1rem 1.5rem;
}

li { margin-bottom: 0.25rem; }

blockquote {
  border-left: 4px solid var(--accent);
  padding: 0.75rem 1.25rem;
  margin: 1.25rem 0;
  color: var(--color-text-muted);
  background: var(--color-surface);
  border-radius: 0 6px 6px 0;
}

blockquote p:last-child { margin-bottom: 0; }

hr {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: 2rem 0;
}

/* Code */
code, pre, kbd, samp {
  font-family: var(--font-mono);
  font-size: 0.875em;
}

code {
  background: var(--color-surface);
  color: var(--color-text);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

pre {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin: 1.25rem 0;
  border-radius: 8px;
  line-height: 1.5;
}

pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  border-radius: 0;
}

/* Tables */
table {
  border-collapse: collapse;
  width: 100%;
  margin: 1rem 0;
  font-size: 0.95em;
}

th, td {
  border: 1px solid var(--color-border);
  padding: 0.6rem 0.85rem;
  text-align: left;
}

th {
  background: var(--accent-soft);
  font-weight: 600;
  color: var(--accent-hover);
}

tbody tr:hover {
  background: var(--color-surface);
}

/* Breadcrumb */
.breadcrumb {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
}

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

.breadcrumb a:hover {
  color: var(--accent);
}

/* Article meta */
.meta {
  color: var(--color-text-muted);
  font-size: 0.875rem;
  margin-bottom: 1.75rem;
}

.tag {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 0.2rem 0.65rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-right: 0.3rem;
  text-decoration: none;
  letter-spacing: 0.01em;
}

a.tag:hover {
  background: var(--accent);
  color: #fff;
}

/* Hero */
.hero {
  text-align: center;
  padding: 3.5rem 1.5rem;
  margin-bottom: 2.5rem;
  background: linear-gradient(135deg, var(--accent-soft) 0%, var(--color-background) 100%);
  border-radius: 12px;
  border: 1px solid var(--color-border);
}

.hero h1 {
  font-size: 2.8rem;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
  color: var(--accent);
}

.hero p {
  font-size: 1.1rem;
  color: var(--color-text-muted);
  max-width: 620px;
  margin: 0 auto;
  line-height: 1.7;
}

/* Post cards */
.post-card {
  padding: 1.5rem;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  margin-bottom: 1rem;
  transition: all 0.2s ease;
  background: var(--color-background);
}

.post-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 12px rgba(222, 52, 18, 0.08);
  transform: translateY(-1px);
}

.post-card h3 {
  font-size: 1.1rem;
  margin: 0 0 0.3rem;
  font-weight: 600;
}

.post-card h3 a {
  color: var(--color-heading);
  text-decoration: none;
}

.post-card h3 a:hover {
  color: var(--accent);
}

.post-card .meta {
  margin-bottom: 0.75rem;
}

/* Summary text */
.summary-text {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

.post-card > a {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.post-card > a:hover {
  text-decoration: underline;
}

/* Post list */
.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.post-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--color-border-muted);
}

.post-list .date {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  min-width: 6rem;
  display: inline-block;
  font-variant-numeric: tabular-nums;
}

.post-list a { text-decoration: none; color: var(--color-heading); font-weight: 500; }
.post-list a:hover { color: var(--accent); }

/* Footer */
footer {
  margin-top: 4rem;
  padding: 1.5rem 2rem;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 0.85rem;
  text-align: center;
}

footer a { color: var(--color-text-muted); }
footer a:hover { color: var(--accent); }

/* Responsive */
@media (max-width: 768px) {
  .site-header { padding: 0.75rem 1rem; }
  .site-header nav a { margin-left: 1rem; }
  .wrapper { padding: 1.5rem 1rem; }
  .hero { padding: 2.5rem 1rem; }
  .hero h1 { font-size: 2rem; }
  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.3rem; }
}
