/* Inspired by http://bettermotherfuckingwebsite.com/ */

:root {
  --fg: #111;
  --muted: #51514d;
  --bg: #fbfbf7;
  --link: #2a5bd7;
  --border: #e6e6da;
  --code-bg: #f3f3ea;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    "Apple Color Emoji", "Segoe UI Emoji";
  font-size: 18px;
  line-height: 1.6;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 18px;
}

.site-header {
  border-bottom: 1px solid #eee;
}

.site-nav {
  max-width: 680px;
  margin: 0 auto;
  padding: 14px 18px;
  display: flex;
  gap: 14px;
  align-items: baseline;
}

.site-title {
  font-weight: 700;
}

.spacer {
  flex: 1;
}

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

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3 {
  line-height: 1.25;
  margin: 0 0 12px;
}

p {
  margin: 0 0 14px;
}

ul {
  margin: 0 0 14px;
  padding-left: 20px;
}

/* Longform content polish (especially project pages) */

.project h1,
.project h2,
.project h3 {
  font-family: ui-serif, Iowan Old Style, Palatino, Georgia, serif;
}

.project h1 {
  margin-bottom: 16px;
}

.project h2 {
  margin-top: 26px;
}

.project img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
}

/* Rouge (kramdown) code blocks */

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  font-size: 0.95em;
  background: var(--code-bg);
  border: 1px solid var(--border);
  padding: 0.12em 0.35em;
  border-radius: 7px;
}

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

.highlighter-rouge .highlight {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  /* Prefer wrapping over horizontal scrolling for long lines */
  overflow-x: auto;
  margin: 0 0 16px;
}

.highlighter-rouge pre {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.5;
}

/* ASCII diagrams / text art: preserve alignment (no wrapping), allow horizontal scroll. */
.ascii-diagram .highlighter-rouge .highlight {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  /* Give the diagram more horizontal room than regular code blocks. */
  padding: 10px 12px;
}

.ascii-diagram .highlighter-rouge pre {
  white-space: pre;
  overflow-wrap: normal;
  word-break: normal;
  /* Scale down on narrow viewports so the diagram fits without scrolling.
     (Scroll still works as a fallback.) */
  font-size: clamp(8px, 2.6vw, 16px);
  line-height: 1.3;
}

@media (max-width: 480px) {
  .ascii-diagram .highlighter-rouge .highlight {
    padding: 8px 10px;
  }
}

/* Rouge wraps the <pre> in another .highlight; ensure only the outer wrapper has the border/background. */
.highlighter-rouge pre.highlight {
  background: transparent;
  border: 0;
  padding: 0;
  border-radius: 0;
}

/* Embedded task renderer frames: calm container, no shadows */

.task-transcript-note {
  margin: 12px 0 12px;
  padding: 10px 12px;
  border-left: 4px solid #c7d3f4;
  background: #f6f7ff;
  color: #2d3a52;
  font-weight: 600;
  border-radius: 12px;
}

.task-renderer-embed {
  margin: 18px 0 24px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
}

.task-renderer-embed iframe {
  display: block;
  background: #111;
}

@media (max-width: 700px) {
  .project img[style*="float: right"],
  .project img[style*="float:right"] {
    float: none !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 0 14px !important;
  }
}

.project-list {
  list-style: none;
  padding-left: 0;
}

.project-list li {
  margin: 0 0 10px;
}

.lede {
  margin-top: 10px;
  color: var(--muted);
}

.domain-joke {
  margin: 6px 0 18px;
  padding-left: 12px;
  position: relative;
  color: var(--muted);
  font-size: 0.95em;
}

.domain-joke::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.35em;
  width: 3px;
  height: 18px;
  background: var(--border);
  border-radius: 3px;
}

.meta {
  list-style: none;
  padding-left: 0;
  margin: 12px 0 18px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.muted {
  color: var(--muted);
}

.site-footer {
  border-top: 1px solid #eee;
}

.site-footer .muted {
  max-width: 680px;
  margin: 0 auto;
  padding: 18px;
}
