/* longkutoy.com — one small stylesheet for every page. */
:root {
  --bg: #fbfbf9;
  --surface: #ffffff;
  --text: #1b1d22;
  --muted: #5a606c;
  --line: #e6e6e2;
  --accent: #3451d1;
  --accent-soft: rgba(52, 81, 209, 0.08);
  --shadow: 0 1px 2px rgba(20, 22, 28, 0.04), 0 8px 24px -12px rgba(20, 22, 28, 0.12);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1014;
    --surface: #15181e;
    --text: #e8eaee;
    --muted: #9ca3af;
    --line: #252a33;
    --accent: #8ea6ff;
    --accent-soft: rgba(142, 166, 255, 0.1);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.65 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.skip {
  position: absolute; left: 16px; top: -48px;
  background: var(--text); color: var(--bg);
  padding: 8px 14px; border-radius: 8px; z-index: 10;
}
.skip:focus { top: 12px; }

.wrap { max-width: 720px; margin: 0 auto; padding: 0 20px; }

/* header */
.site-header { padding: 28px 0 8px; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.brand { font-weight: 650; color: var(--text); text-decoration: none; letter-spacing: -0.01em; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 20px; }
.site-nav a { color: var(--muted); text-decoration: none; font-size: 15px; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); }

main.wrap { padding-bottom: 72px; }
section { margin-top: 56px; }
h1, h2, h3 { line-height: 1.25; letter-spacing: -0.02em; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); font-weight: 600; margin: 0 0 18px; }

/* intro */
.intro { margin-top: 48px; }
.intro h1 { font-size: clamp(30px, 6vw, 40px); margin: 0 0 12px; font-weight: 700; }
.intro p { color: var(--muted); font-size: 19px; margin: 0; max-width: 34em; }

/* projects */
.projects { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; list-style: none; margin: 0; padding: 0; }
.card {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.thumb { aspect-ratio: 16 / 10; background: #12151c; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top left; }
.thumb.icon { display: grid; place-items: center; background: radial-gradient(120% 120% at 50% 0%, #2a3150 0%, #0f1220 70%); }
.thumb.icon img { width: 96px; height: 96px; object-fit: contain; }
.card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card h3 { margin: 0; font-size: 19px; }
.card p { margin: 0; color: var(--muted); font-size: 15.5px; line-height: 1.55; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; list-style: none; margin: 4px 0 0; padding: 0; }
.tags li { font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 1px 9px; }
.links { display: flex; gap: 10px; flex-wrap: wrap; margin-top: auto; padding-top: 10px; }
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14.5px; font-weight: 550;
  padding: 7px 14px; border-radius: 999px;
  text-decoration: none;
  border: 1px solid var(--line);
  color: var(--text);
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.btn.primary:hover { filter: brightness(1.08); }

/* writing */
.posts { list-style: none; margin: 0; padding: 0; }
.posts li { display: flex; gap: 18px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--line); }
.posts time { color: var(--muted); font-size: 14.5px; min-width: 6.5em; font-variant-numeric: tabular-nums; }
.posts a { color: var(--text); text-decoration: none; font-weight: 550; }
.posts a:hover { color: var(--accent); }
.empty { color: var(--muted); margin: 0; padding: 16px 18px; border: 1px dashed var(--line); border-radius: 12px; }

/* articles */
.article { margin-top: 48px; }
.article header { margin-bottom: 28px; }
.article h1 { font-size: clamp(28px, 5.5vw, 38px); margin: 0 0 8px; }
.article .meta { color: var(--muted); font-size: 15px; }
.prose > * + * { margin-top: 1.1em; }
.prose p, .prose ul, .prose ol { margin-bottom: 0; }
.prose h2 { font-size: 23px; text-transform: none; letter-spacing: -0.01em; color: var(--text); margin: 2em 0 0; }
.prose img { border-radius: 12px; }
.prose code { font: 0.9em ui-monospace, "SF Mono", Menlo, monospace; background: var(--accent-soft); padding: 1px 5px; border-radius: 5px; }
.prose pre { background: var(--surface); border: 1px solid var(--line); padding: 14px 16px; border-radius: 12px; overflow-x: auto; }
.prose pre code { background: none; padding: 0; }
.prose blockquote { margin-left: 0; padding-left: 16px; border-left: 3px solid var(--line); color: var(--muted); }

/* footer */
.site-footer { border-top: 1px solid var(--line); padding: 24px 0 40px; color: var(--muted); font-size: 14.5px; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.site-footer a { color: var(--muted); }

@media (max-width: 520px) {
  body { font-size: 16px; }
  .site-header { padding-top: 20px; }
  .site-nav ul { gap: 16px; }
  section { margin-top: 44px; }
  .intro { margin-top: 36px; }
  .intro p { font-size: 17.5px; }
  .posts li { flex-direction: column; gap: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
