/* Clean tech-blog theme for the artukam blogs — Ramp × Claude register.
   Same layout, two schemes set on <html> by Ghost's color_scheme custom setting:
   [data-scheme="light"] and [data-scheme="dark"]. The preview toggles it directly. */

/* ---- Tokens ----------------------------------------------------------------
   Light is the base; dark comes from the visitor's OS (prefers-color-scheme) with a
   [data-scheme] override for a manual toggle. The accent is the blog's brand colour:
   in Ghost it's --ghost-accent-color (set blue on public, orange on private); the
   preview supplies it via [data-accent]. It's auto-lifted for dark mode. */
:root {
  --bg:        #fbfaf8;
  --surface:   #f2f0ea;
  --fg:        #1a1a17;
  --fg-soft:   #565349;   /* tinted, not gray */
  --fg-faint:  #8b8779;
  --rule:      #e8e4da;

  --brand:     var(--ghost-accent-color, #b85a26);
  --accent:    var(--brand);
  --accent-2:  color-mix(in srgb, var(--brand) 80%, #ffffff 20%);
  --pill:      #1a1a17;
  --pill-fg:   #fbfaf8;

  /* Respect Ghost's custom-font picker if set, else our Inter. */
  --font-body:    var(--gh-font-body, "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
  --font-heading: var(--gh-font-heading, "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
}

/* Preview accent presets — the real theme uses Ghost's accent colour instead. */
:root[data-accent="blue"]   { --brand: #35619f; }
:root[data-accent="orange"] { --brand: #b85a26; }

/* Dark palette: automatic from the OS, unless a manual light override is set. */
@media (prefers-color-scheme: dark) {
  :root:not([data-scheme="light"]) {
    --bg:       #17150f;
    --surface:  #211e17;
    --fg:       #edeae0;
    --fg-soft:  #a49f90;
    --fg-faint: #756f60;
    --rule:     #2c2820;
    --accent:   color-mix(in srgb, var(--brand) 60%, #ffffff 40%);
    --accent-2: color-mix(in srgb, var(--brand) 42%, #ffffff 58%);
    --pill:     #edeae0;
    --pill-fg:  #17150f;
  }
}
/* Manual dark toggle wins in both directions. */
:root[data-scheme="dark"] {
  --bg:       #17150f;
  --surface:  #211e17;
  --fg:       #edeae0;
  --fg-soft:  #a49f90;
  --fg-faint: #756f60;
  --rule:     #2c2820;
  --accent:   color-mix(in srgb, var(--brand) 60%, #ffffff 40%);
  --accent-2: color-mix(in srgb, var(--brand) 42%, #ffffff 58%);
  --pill:     #edeae0;
  --pill-fg:  #17150f;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  font-weight: 400;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; }

/* ---- Header ---------------------------------------------------------------- */
.wrap  { width: 100%; max-width: 46rem; margin: 0 auto; padding: 0 1.5rem; }
.wrap--read { max-width: 42rem; }

.topbar { border-bottom: 1px solid var(--rule); }
.topbar__inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 4.25rem;
}
.brand {
  font-size: 1.06rem; font-weight: 700; letter-spacing: -0.02em;
  text-decoration: none; color: var(--fg);
}
.brand .mark { color: var(--accent); }
.nav { display: flex; gap: 1.5rem; align-items: center; }
.nav a {
  font-size: 0.9rem; font-weight: 500; text-decoration: none; color: var(--fg-soft);
  transition: color 0.18s ease;
}
.nav a:hover { color: var(--fg); }

/* ---- Home intro ------------------------------------------------------------ */
.intro { padding: 3.5rem 0 1rem; }
.intro__title {
  font-size: clamp(2rem, 5vw, 2.7rem); font-weight: 800; letter-spacing: -0.03em;
  line-height: 1.05; margin: 0;
}
.intro__desc {
  margin: 0.9rem 0 0; max-width: 34rem; color: var(--fg-soft);
  font-size: 1.12rem; line-height: 1.5;
}

/* ---- Post list ------------------------------------------------------------- */
.feed { padding: 1.5rem 0 1rem; }
.post-link {
  display: block; text-decoration: none; color: inherit;
  padding: 1.7rem 0; border-top: 1px solid var(--rule);
}
.feed .post-link:first-child { border-top: 0; }
.post-link__meta {
  font-size: 0.8rem; font-weight: 500; letter-spacing: 0.01em;
  color: var(--fg-faint); margin-bottom: 0.5rem;
  display: flex; gap: 0.6rem; align-items: center;
}
.post-link__meta .tag { color: var(--accent); }
.post-link__title {
  font-size: 1.4rem; font-weight: 700; letter-spacing: -0.022em; line-height: 1.2;
  margin: 0; transition: color 0.18s ease; text-wrap: balance;
}
.post-link:hover .post-link__title { color: var(--accent); }
.post-link__dek { margin: 0.5rem 0 0; color: var(--fg-soft); font-size: 1.02rem; line-height: 1.5; }

/* Lead post — bigger, with a hairline below only */
.post-link--lead { padding-top: 0.5rem; }
.post-link--lead .post-link__title { font-size: clamp(1.8rem, 4vw, 2.4rem); letter-spacing: -0.03em; line-height: 1.1; }
.post-link--lead .post-link__dek { font-size: 1.14rem; margin-top: 0.7rem; max-width: 36rem; }

/* ---- Single post ----------------------------------------------------------- */
.crumb { padding: 1.6rem 0 0; font-size: 0.85rem; color: var(--fg-faint); }
.crumb a { color: var(--fg-soft); text-decoration: none; }
.crumb a:hover { color: var(--fg); }
.crumb .sep { margin: 0 0.5rem; }

.article { padding: 2rem 0 1rem; }
.article__title {
  font-size: clamp(2rem, 5vw, 3rem); font-weight: 800; letter-spacing: -0.035em;
  line-height: 1.06; margin: 0 0 1.1rem; text-wrap: balance;
}
.article__meta {
  display: flex; flex-wrap: wrap; gap: 0.55rem; align-items: center;
  font-size: 0.86rem; font-weight: 500; color: var(--fg-faint);
  padding-bottom: 1.8rem; border-bottom: 1px solid var(--rule);
}
.article__meta .tag { color: var(--accent); }
.article__meta .sep { color: var(--rule); }

/* Body copy */
.prose { font-size: 1.14rem; line-height: 1.72; padding-top: 2rem; }
.prose > * + * { margin-top: 1.35rem; }
.prose p { margin: 0; }
.prose h2 {
  font-size: 1.5rem; font-weight: 700; letter-spacing: -0.025em; line-height: 1.25;
  margin-top: 2.6rem;
}
.prose h3 { font-size: 1.18rem; font-weight: 600; letter-spacing: -0.02em; margin-top: 2rem; }
.prose a {
  color: var(--accent); text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  transition: border-color 0.18s ease;
}
.prose a:hover { border-color: var(--accent); }
.prose strong { font-weight: 700; }
.prose blockquote {
  margin: 1.8rem 0; padding: 0.2rem 0 0.2rem 1.3rem;
  border-left: 2px solid var(--accent); color: var(--fg-soft);
}
.prose blockquote p { margin: 0; }
.prose code {
  font-family: ui-monospace, "SF Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.86em; background: var(--surface); padding: 0.15em 0.4em; border-radius: 5px;
}
.prose pre {
  background: var(--surface); border: 1px solid var(--rule);
  padding: 1.1rem 1.25rem; border-radius: 10px; overflow-x: auto;
  font-size: 0.9rem; line-height: 1.6; margin: 1.6rem 0;
}
.prose pre code { background: none; padding: 0; font-size: 0.92em; }
.prose img { width: 100%; height: auto; border-radius: 10px; }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 2.4rem 0; }
.prose ul, .prose ol { padding-left: 1.3rem; margin-top: 1.1rem; }
.prose li { margin-top: 0.4rem; }
.prose li::marker { color: var(--fg-faint); }

/* ---- Members gate ---------------------------------------------------------- */
.gate {
  margin: 2.5rem 0 1rem; padding: 2.2rem 1.8rem; text-align: center;
  background: var(--surface); border: 1px solid var(--rule); border-radius: 14px;
}
.gate__title { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 0.5rem; }
.gate__body  { margin: 0 auto 1.4rem; max-width: 30rem; color: var(--fg-soft); font-size: 1rem; }
.btn {
  display: inline-block; font-weight: 600; font-size: 0.92rem;
  color: var(--pill-fg); background: var(--accent);
  padding: 0.65rem 1.4rem; border-radius: 8px; text-decoration: none;
  transition: background 0.18s ease, transform 0.18s ease;
}
.btn:hover { background: var(--accent-2); transform: translateY(-1px); }
.gate__note { display: block; margin-top: 0.9rem; font-size: 0.9rem; color: var(--fg-faint); }

/* ---- Post nav + footer ----------------------------------------------------- */
.postnav {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
  margin-top: 2.5rem; padding-top: 1.8rem; border-top: 1px solid var(--rule);
}
.postnav a { text-decoration: none; color: var(--fg); }
.postnav .dir { font-size: 0.78rem; font-weight: 500; color: var(--fg-faint); display: block; margin-bottom: 0.3rem; }
.postnav .t { font-weight: 600; letter-spacing: -0.015em; line-height: 1.25; }
.postnav a:hover .t { color: var(--accent); }
.postnav .next { text-align: right; }

.footer {
  margin-top: 3.5rem; border-top: 1px solid var(--rule);
  padding: 2rem 0 3.5rem;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.8rem;
  font-size: 0.85rem; color: var(--fg-faint);
}
.footer a { color: var(--fg-soft); text-decoration: none; }
.footer a:hover { color: var(--fg); }

/* ---- Home: feed + slim sidebar --------------------------------------------- */
.two{display:grid;grid-template-columns:minmax(0,1fr) 9.5rem;gap:2.6rem;padding-top:1rem;align-items:start}
.aside{position:sticky;top:1.5rem;align-self:start}
.aside h4{font-size:.67rem;text-transform:uppercase;letter-spacing:.1em;color:var(--fg-faint);margin:1.4rem 0 .55rem;font-weight:700}
.aside .sb{display:flex;align-items:center;gap:.4rem;width:100%;text-align:left;font:inherit;cursor:pointer;
  border:1px solid var(--rule);background:var(--surface);border-radius:8px;padding:.5rem .6rem;color:var(--fg-faint);font-size:.82rem}
.aside .sb:hover{color:var(--fg-soft);border-color:var(--fg-faint)}
.aside .taglist{display:flex;flex-direction:column;gap:.4rem}
.aside .taglist a{color:var(--fg-soft);text-decoration:none;font-size:.86rem;display:flex;justify-content:space-between;gap:.5rem}
.aside .taglist a:hover{color:var(--accent)}
.aside .taglist .n{color:var(--fg-faint)}
.older{display:inline-block;margin-top:1.6rem;font-weight:600;color:var(--accent);text-decoration:none}
.older:hover{opacity:.85}
.nav a.active{color:var(--fg)}
@media (max-width:44rem){
  .two{grid-template-columns:1fr;gap:1.5rem}
  .aside{position:static;border-top:1px solid var(--rule);padding-top:1.4rem;margin-top:.5rem}
}

/* ---- Feature image + figures ----------------------------------------------- */
.article__figure{margin:2rem 0}
.article__figure img{width:100%;height:auto;border-radius:10px;display:block}
.prose figure{margin:1.8rem 0}
.prose figure img{border-radius:10px}
.prose figcaption{text-align:center;font-size:.9rem;color:var(--fg-faint);margin-top:.55rem}

/* ---- Ghost pagination (default markup) ------------------------------------- */
.pagination{display:flex;justify-content:space-between;align-items:center;gap:1rem;margin-top:2rem;
  padding-top:1.6rem;border-top:1px solid var(--rule);font-weight:600;font-size:.9rem}
.pagination a{color:var(--accent);text-decoration:none}
.pagination a:hover{opacity:.85}
.pagination .page-number{color:var(--fg-faint);font-weight:500}

/* ---- Headings use the heading font (defaults to Inter) --------------------- */
.intro__title, .article__title, .post-link__title, .prose h2, .gate__title, .postnav .t {
  font-family: var(--font-heading);
}

/* ---- Koenig wide / full-width images (required by GScan) ------------------- */
.prose .kg-width-wide { width: min(90vw, 52rem); margin-left: 50%; transform: translateX(-50%); }
.prose .kg-width-full { width: 100vw; margin-left: 50%; transform: translateX(-50%); }
.prose .kg-width-wide img, .prose .kg-width-full img { width: 100%; }
.prose .kg-width-full img { border-radius: 0; }

/* ---- Load motion (one authored moment) ------------------------------------- */
.rise { opacity: 0; transform: translateY(10px); animation: rise 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.rise:nth-child(2) { animation-delay: 0.05s; }
.rise:nth-child(3) { animation-delay: 0.10s; }
.rise:nth-child(4) { animation-delay: 0.15s; }
.rise:nth-child(n+6) { opacity: 1; transform: none; animation: none; }
@keyframes rise { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .rise { opacity: 1; transform: none; animation: none; } }

/* ---- Preview controls (preview only) --------------------------------------- */
.preview-controls { position: fixed; bottom: 1.1rem; right: 1.1rem; z-index: 50; display: flex; gap: 0.5rem; }
.scheme-toggle {
  font-size: 0.78rem; font-weight: 600; font-family: inherit;
  background: var(--pill); color: var(--pill-fg); border: 1px solid var(--rule); border-radius: 8px;
  padding: 0.55rem 0.9rem; cursor: pointer; box-shadow: 0 4px 18px rgba(0,0,0,0.18);
}

@media (max-width: 34rem) {
  body { font-size: 1.02rem; }
  .prose { font-size: 1.06rem; }
  .topbar__inner { height: 3.5rem; }
  .postnav { grid-template-columns: 1fr; }
  .postnav .next { text-align: left; }
}
