/* ------------------------------------------------------------------
   kotlin.website — dark terminal theme
   This is plain, unlayered CSS, so it always beats Silk's @layer rules.
   Tweak everything here; the Kotlin code only emits class names.
   ------------------------------------------------------------------ */

:root {
  --bg: #0a0c0d;
  --bg-elev: #0f1214;
  --bg-hi: #151a1c;
  --border: #1d2426;
  --border-hi: #2e393c;

  --fg: #d5dadb;
  --fg-dim: #7c8a8d;
  --fg-faint: #556063;

  --green: #4ade80;
  --green-dim: #2f9e5c;
  --violet: #a78bfa;
  --orange: #f0883e;
  --red: #f47067;

  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --maxw: 880px;
  --radius: 6px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: rgba(74, 222, 128, 0.25);
  color: #fff;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-hi); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #3c4a4e; }

a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------------------------------------------------------------- shell */

.site-root {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-main {
  flex: 1 0 auto;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px 96px;
}

/* ------------------------------------------------------------------ nav */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  backdrop-filter: blur(10px);
  background: rgba(10, 12, 13, 0.82);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav-brand {
  color: var(--fg);
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.nav-brand:hover { color: var(--green); text-decoration: none; }
.nav-brand::before { content: "~$ "; color: var(--green); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-link {
  color: var(--fg-dim);
  font-size: 14px;
  white-space: nowrap;
}
.nav-link:hover { color: var(--green); text-decoration: none; }
.nav-link.is-active { color: var(--fg); }

/* Below ~420px the brand and four links stop fitting on one line. Wrapping turns
   a sticky 54px header into a 120px one that eats the screen, so shrink instead:
   drop the `~$` prefix and tighten the gaps. */
@media (max-width: 560px) {
  .nav-inner { padding: 12px 18px; gap: 12px; }
  .nav-links { gap: 14px; }
  .nav-link { font-size: 13px; }
}

@media (max-width: 420px) {
  .nav-brand::before { content: none; }
  .nav-links { gap: 12px; }
}

/* ----------------------------------------------------------------- hero */

.hero { padding: 72px 0 56px; }

/* A monospace 15px line holds ~30 characters on a phone, which turns every
   paragraph into a column of stubs. Shrink the type and the vertical rhythm
   together so the hero doesn't fill two screens before the first section. */
@media (max-width: 560px) {
  body { font-size: 14px; }
  .site-main { padding: 0 18px 64px; }
  .hero { padding: 44px 0 36px; }
  .section { margin-top: 44px; }
}

.prompt {
  color: var(--fg-dim);
  font-size: 14px;
  margin-bottom: 14px;
}
.prompt .user { color: var(--green); }
.prompt .path { color: var(--violet); }
.prompt .cmd { color: var(--fg); }

.hero h1 {
  margin: 0 0 6px;
  font-size: clamp(30px, 6vw, 46px);
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-weight: 700;
}

.hero .role {
  color: var(--orange);
  font-size: 15px;
  margin: 0 0 22px;
}

.hero p {
  color: var(--fg-dim);
  max-width: 62ch;
  margin: 0 0 14px;
}
.hero p strong,
.hero p .hl { color: var(--fg); font-weight: 500; }

.cursor {
  display: inline-block;
  width: 9px;
  height: 1.05em;
  background: var(--green);
  vertical-align: -2px;
  margin-left: 4px;
  animation: blink 1.15s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .cursor { animation: none; }
  html { scroll-behavior: auto; }
}

.hero-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 26px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  background: var(--bg-elev);
  color: var(--fg-dim);
  font-size: 13px;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.chip:hover {
  border-color: var(--green-dim);
  color: var(--green);
  background: var(--bg-hi);
  text-decoration: none;
}

/* -------------------------------------------------------------- section */

.section { margin-top: 64px; }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 22px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.section-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.section-head h2::before {
  content: "# ";
  color: var(--green);
}
.section-head .count { color: var(--fg-faint); font-size: 13px; }

.section-note {
  color: var(--fg-dim);
  font-size: 13.5px;
  margin: -6px 0 20px;
}

/* ----------------------------------------------------------- lib cards */

.lib-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.lib-card {
  /* Column layout so the tag row sits on the bottom edge of every card instead
     of trailing its own tagline — the grid stretches cards to the tallest in the
     row, and ragged tag rows are what that looks like otherwise. */
  display: flex;
  flex-direction: column;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elev);
  color: inherit;
  transition: border-color .15s ease, transform .15s ease, background .15s ease;
}
.lib-card:hover {
  border-color: var(--green-dim);
  background: var(--bg-hi);
  transform: translateY(-2px);
  text-decoration: none;
}

.lib-card .name {
  font-size: 16px;
  font-weight: 700;
  color: var(--green);
  margin-bottom: 6px;
  /* `kotlin-native-smtp-client` is one long token; break it at the hyphens
     rather than mid-word. */
  overflow-wrap: break-word;
  hyphens: manual;
}
.lib-card .name::before { content: "› "; color: var(--fg-faint); }

.lib-card .tagline {
  color: var(--fg-dim);
  font-size: 13.5px;
  line-height: 1.55;
  margin-bottom: 14px;
  flex: 1 0 auto;
}

.tags { display: flex; flex-wrap: wrap; gap: 6px; }

.tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-hi);
  color: var(--fg-faint);
  letter-spacing: 0.02em;
}
.tag.accent { color: var(--violet); border-color: rgba(167, 139, 250, 0.35); }

/* ------------------------------------------------------------ timeline */

.entry {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 20px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}
.entry:last-child { border-bottom: none; }

.entry .when {
  color: var(--fg-faint);
  font-size: 13px;
  padding-top: 3px;
}

.entry .what h3 {
  margin: 0 0 2px;
  font-size: 15.5px;
  font-weight: 700;
}
.entry .what .org {
  color: var(--violet);
  font-size: 13.5px;
  margin-bottom: 10px;
}
.entry .what ul {
  margin: 0;
  padding-left: 18px;
  color: var(--fg-dim);
  font-size: 13.5px;
}
.entry .what li { margin-bottom: 5px; }
.entry .what li::marker { color: var(--green-dim); }

/* Same two-column shape as .entry so the stack lines up with the timeline above it. */
.stack-row {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 20px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.stack-row:last-child { border-bottom: none; }

.stack-label {
  color: var(--fg-faint);
  font-size: 13px;
  padding-top: 3px;
}

@media (max-width: 640px) {
  .entry,
  .stack-row { grid-template-columns: 1fr; gap: 8px; }
}

/* ---------------------------------------------------------- blog index */

.post-list { display: flex; flex-direction: column; }

.post-item {
  display: block;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  color: inherit;
}
.post-item:hover { text-decoration: none; }
.post-item:hover .post-title { color: var(--green); }

.post-date { color: var(--fg-faint); font-size: 12.5px; }
.post-title {
  font-size: 16px;
  font-weight: 700;
  margin: 2px 0 4px;
  transition: color .15s ease;
}
.post-desc { color: var(--fg-dim); font-size: 13.5px; margin: 0; }

.empty {
  color: var(--fg-faint);
  font-size: 13.5px;
  padding: 24px 0;
}

/* ------------------------------------------------------- markdown prose */

.post-header { padding: 56px 0 8px; }
.post-header .post-date { display: block; margin-bottom: 6px; }
.post-header h1 { margin: 0; font-size: clamp(26px, 5vw, 34px); letter-spacing: -0.02em; }

.prose { padding-bottom: 24px; }
.prose > h1:first-child { margin-top: 32px; }

.prose h1, .prose h2, .prose h3, .prose h4 {
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 2em 0 0.6em;
}
.prose h1 { font-size: 28px; }
.prose h2 { font-size: 21px; }
.prose h2::before { content: "## "; color: var(--green); }
.prose h3 { font-size: 17px; }
.prose h3::before { content: "### "; color: var(--green-dim); }

.prose p, .prose li { color: var(--fg-dim); }
.prose p { margin: 0 0 1.1em; }
.prose ul, .prose ol { padding-left: 20px; }
.prose li { margin-bottom: 6px; }
.prose li::marker { color: var(--green-dim); }

.prose strong { color: var(--fg); font-weight: 700; }
.prose hr { border: none; border-top: 1px solid var(--border); margin: 2.4em 0; }

.prose blockquote {
  margin: 1.4em 0;
  padding: 2px 0 2px 16px;
  border-left: 2px solid var(--green-dim);
  color: var(--fg-dim);
  font-style: italic;
}

.prose code {
  background: var(--bg-hi);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.9em;
  color: var(--orange);
}

.prose pre {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  overflow-x: auto;
  line-height: 1.55;
}
.prose pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--fg);
  font-size: 13px;
}

/* ------------------------------------------------- syntax highlighting */

/* highlight.js emits class names and no colours of its own, so the palette is
   defined here rather than by importing one of its themes — a stock theme brings
   its own idea of a background and a dozen hues this site does not use.
   Deliberately few colours: on a terminal-looking page, code that lights up in
   seven shades stops looking like a terminal. */

.hljs-keyword,
.hljs-literal,
.hljs-type,
.hljs-built_in { color: var(--violet); }

.hljs-string,
.hljs-regexp,
.hljs-char.escape_ { color: var(--green); }

.hljs-number { color: var(--orange); }

.hljs-title,
.hljs-title.function_,
.hljs-title.class_,
.hljs-section { color: var(--fg); font-weight: 500; }

.hljs-attr,
.hljs-attribute,
.hljs-property,
.hljs-variable,
.hljs-params { color: var(--fg); }

.hljs-meta { color: var(--fg-dim); }

/* Comments stay dimmer than prose: in a snippet the code is the point, and a
   comment competing with it for attention is the usual failure of these themes. */
.hljs-comment,
.hljs-quote { color: var(--fg-faint); font-style: italic; }

.hljs-symbol,
.hljs-bullet,
.hljs-link { color: var(--green-dim); }

.hljs-deletion { color: var(--red); }
.hljs-addition { color: var(--green); }
.hljs-emphasis { font-style: italic; }
.hljs-strong { font-weight: 700; }

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  margin: 1.4em 0;
}
.prose th, .prose td {
  border: 1px solid var(--border);
  padding: 8px 12px;
  text-align: left;
}
.prose th { background: var(--bg-elev); color: var(--fg); }
.prose td { color: var(--fg-dim); }

.prose img { max-width: 100%; border-radius: var(--radius); }

/* --------------------------------------------------------------- footer */

.site-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  padding: 28px 24px 40px;
}
.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--fg-faint);
  font-size: 12.5px;
}
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; }

/* Every footer link stays as quiet as the text around it until hovered — the credit
   line should read as a sentence, not as three highlighted words. */
.footer-inner a { color: var(--fg-faint); }
.footer-inner a:hover { color: var(--green); text-decoration: none; }
