/* Flexoki-inspired warm palette, matching stephango.com aesthetic */

:root {
  /* Flexoki light palette */
  --bg: #FFFCF0;
  --text: #100F0F;
  --text-muted: #6F6E69;
  --text-faint: #B7B5AC;
  --accent: #100F0F;
  --border: #E6E4D9;
  --action: #24837B;
  --font-heading: -apple-system, BlinkMacSystemFont, 'Inter', 'IBM Plex Sans', Segoe UI, Helvetica, Arial, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Inter', 'IBM Plex Sans', Segoe UI, Helvetica, Arial, sans-serif;
  --radius: 4px;
  --tag-bg: #F2F0E5;
  --tag-text: #6F6E69;
  --code-bg: #F2F0E5;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #100F0F;
    --text: #CECDC3;
    --text-muted: #878580;
    --text-faint: #575653;
    --accent: #CECDC3;
    --border: #282726;
    --action: #3AA99F;
    --tag-bg: #1C1B1A;
    --tag-text: #878580;
    --code-bg: #1C1B1A;
  }
  .card { background: #1C1B1A; }
}

html {
  box-sizing: border-box;
  font-size: 62.5%;
}

*, *:before, *:after {
  box-sizing: inherit;
}

body {
  font-family: var(--font-body);
  font-size: 1.8rem;
  font-size: calc(1.5rem + 0.25vw);
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  margin: 2vw auto 0 auto;
  padding: 2rem 0 24rem;
  overflow-x: hidden;
}

::selection {
  background: rgba(187, 220, 206, 0.3);
}

/* Hide unused template chrome */
.profile { display: none; }
.social-bar { display: none; }
.bottom-nav { display: none; }
.articles { display: none; }

/* Topbar - styled like stephango.com nav */
.topbar {
  display: flex;
  align-items: center;
  max-width: 37em;
  margin: 0 auto 3em;
  padding: 0 1rem;
  border-bottom: none;
}

.topbar-brand {
  flex-grow: 1;
  color: var(--text);
  text-decoration: none;
}

.topbar-brand:hover {
  text-decoration: none;
  opacity: 1;
}

.topbar-icon {
  display: none;
}

.topbar-title {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1em;
}

.topbar-actions {
  flex-shrink: 1;
  display: flex;
  gap: 2em;
}

.topbar-action {
  font-size: 1em;
  color: var(--text-muted);
  text-decoration: none;
}

.topbar-action:hover {
  color: var(--action);
}

/* Body content = main content area */
.body-content {
  max-width: 37em;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Headings */
.body-content h1 {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 2em;
  font-size: calc(1.35em + 0.55vw);
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-top: 1.5em;
  margin-bottom: 0.25em;
}

.body-content h1:first-child {
  margin-top: 0;
}

.body-content h2 {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 1.4em;
  font-size: calc(1em + 0.2vw);
  letter-spacing: -0.015em;
  line-height: 1.3;
  margin-top: 2em;
  margin-bottom: 0.5em;
  color: var(--text-muted);
}

.body-content h3 {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 1em;
  line-height: 1.3;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}

/* Paragraphs */
.body-content p {
  margin-bottom: 1em;
  max-width: 37em;
}

/* Links - same color as text, underlined, hover = cyan */
.body-content a {
  color: var(--text);
  text-decoration: underline;
}

.body-content a:hover {
  color: var(--action);
}

/* Lists */
.body-content ul, .body-content ol {
  padding: 0.5rem 0 1rem 1em;
  margin: 0 0 0 0.5em;
}

.body-content ul > li {
  list-style: disc;
  padding: 0.15rem 0;
}

.body-content ul > li::marker {
  color: var(--text-faint);
  font-size: 85%;
}

/* Horizontal rules - decorative dots like stephango */
.body-content hr {
  width: 100%;
  border: 0;
  height: 1px;
  margin: 1.5em 0;
  background: var(--border);
}

/* Blockquote */
.body-content blockquote {
  border-left: 2px solid var(--text);
  padding-left: 1.5em;
  margin: 1.5em 0;
  color: var(--text);
}

.body-content blockquote p {
  margin: 0;
}

/* Emphasis */
.body-content em {
  color: var(--text-muted);
}

.body-content strong {
  font-weight: 600;
}

/* Code */
.body-content code {
  font-family: ui-monospace, SFMono-Regular, 'Cascadia Code', Menlo, Monaco, monospace;
  background: var(--code-bg);
  padding: 0.1em 0.2em;
  border-radius: 4px;
  font-size: 90%;
}

.body-content pre {
  font-family: ui-monospace, SFMono-Regular, 'Cascadia Code', Menlo, Monaco, monospace;
  border-radius: 4px;
  padding: 1em;
  font-size: 90%;
  border: 1px solid var(--border);
  white-space: pre-wrap;
}

.body-content pre code {
  background: transparent;
  padding: 0;
}

/* Images */
.body-content img {
  border-radius: 6px;
  max-width: 100%;
  display: block;
  margin-bottom: 0.5em;
}

/* Tables */
.body-content table {
  margin-top: 1.5em;
  margin-bottom: 2.5em;
  width: 100%;
  border-collapse: collapse;
  font-size: 90%;
  font-variant-numeric: tabular-nums;
}

.body-content tr {
  border-bottom: 1px solid var(--border);
}

.body-content td {
  padding: 0.5em 1em 0.5em 0;
  line-height: 1.3;
}

.body-content th {
  text-align: left;
  font-weight: 600;
  padding-bottom: 0.5em;
}

/* Mobile */
@media (max-width: 860px) {
  .body-content {
    max-width: 88vw;
  }
}

@media (max-width: 600px) {
  body {
    margin: 0 auto;
    padding: 1.5rem 0 12rem;
  }
}
