/* Dotfield — shared styles
   Single-column, reading-first. Editorial monocle palette, mono accents. */

:root {
  --bg:      oklch(98% 0.005 250);
  --surface: oklch(100% 0 0);
  --fg:      oklch(22% 0.02 240);
  --muted:   oklch(50% 0.018 240);
  --muted-2: oklch(70% 0.012 240);
  --border:  oklch(90% 0.008 240);
  --accent:  oklch(58% 0.16 145);
  --accent-soft: oklch(58% 0.16 145 / 0.08);

  --font-display: -apple-system, BlinkMacSystemFont, 'Inter', 'Hiragino Kaku Gothic ProN', 'Segoe UI', system-ui, sans-serif;
  --font-body:    -apple-system, BlinkMacSystemFont, 'Inter', 'Hiragino Kaku Gothic ProN', 'Segoe UI', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', 'IBM Plex Mono', ui-monospace, Menlo, monospace;

  --maxw: 680px;
}

*,*::before,*::after { box-sizing: border-box; }
html,body { margin: 0; padding: 0; }
html { color-scheme: light; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--fg);
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 120ms, text-decoration-color 120ms;
}
a:hover { color: var(--accent); text-decoration-color: var(--accent); }

.shell { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- Header ---------- */
header.site { padding: 32px 0 8px; }
header.site .row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
header.site .brand {
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
}
header.site .brand b { color: var(--fg); font-weight: 600; }
header.site nav { display: flex; gap: 18px; }
header.site nav a {
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
}
header.site nav a:hover { color: var(--accent); }
header.site nav a.active { color: var(--fg); }

@media (max-width: 520px) {
  header.site .row { flex-direction: column; align-items: flex-start; gap: 12px; }
  header.site nav { gap: 16px; flex-wrap: wrap; }
}

/* ---------- Main ---------- */
main { padding: 40px 0 32px; }

/* Intro (Home / About) — avatar + name */
.intro {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 20px;
  align-items: center;
  margin-bottom: 32px;
}
.avatar {
  width: 88px; height: 88px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.avatar img {
  width: 110%; height: 110%;
  object-fit: cover;
  object-position: center 40%;
}
.intro h1 {
  margin: 0 0 4px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.intro h1 .small { font-size: 16px; font-weight: 500; color: var(--muted); }
.intro .role {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}
.intro .role .sep { color: var(--muted-2); margin: 0 6px; }

@media (max-width: 520px) {
  .intro { grid-template-columns: 72px 1fr; gap: 16px; }
  .avatar { width: 72px; height: 72px; }
  .intro h1 { font-size: 20px; }
}

/* Page head (Dots / Lines / Contact) */
.page-head { margin-bottom: 28px; }
.page-head .kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin: 0 0 8px;
}
.page-head h1 {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.page-head .lede {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

/* Prose */
.prose p { margin: 0 0 18px; }
.prose p:last-child { margin-bottom: 0; }
.prose .lede { font-size: 17px; }
.prose b { font-weight: 600; }

/* Now */
.now {
  margin: 36px 0 8px;
  padding: 14px 18px;
  border-left: 2px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 4px 4px 0;
}
.now .label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin: 0 0 4px;
  font-weight: 500;
}
.now p { margin: 0; font-size: 15px; line-height: 1.6; }

/* Section heading */
.section { margin-top: 48px; }
.section h2 {
  margin: 0 0 16px;
  font-size: 12px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-weight: 500;
}
.section .more {
  display: inline-block;
  margin-top: 16px;
  font-size: 13px;
  color: var(--muted);
  font-family: var(--font-mono);
  text-decoration: none;
}
.section .more:hover { color: var(--accent); }

/* Item list (Home / Dots / Lines) */
ul.list { list-style: none; margin: 0; padding: 0; }
ul.list li {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 18px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  align-items: baseline;
  font-size: 15px;
}
ul.list li:last-child { border-bottom: 1px solid var(--border); }
ul.list li .meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}
ul.list li .title a {
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
ul.list li .title a:hover { color: var(--accent); border-bottom-color: var(--accent); }
ul.list li .right {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-2);
}
ul.list li .right.wip { color: var(--accent); }

@media (max-width: 520px) {
  ul.list li {
    grid-template-columns: 72px 1fr;
    gap: 4px 16px;
  }
  ul.list li .right {
    grid-column: 2 / 3;
    grid-row: 2;
    justify-self: start;
  }
}

/* Entry list (Dots — multi-line items with summary) */
ul.entries { list-style: none; margin: 0; padding: 0; }
ul.entries > li {
  padding: 18px 0;
  border-top: 1px solid var(--border);
}
ul.entries > li:last-child { border-bottom: 1px solid var(--border); }
ul.entries .head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}
ul.entries .head .title {
  font-size: 16px;
  font-weight: 600;
  color: var(--fg);
}
ul.entries .head .meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}
ul.entries .head .meta .sep { color: var(--muted-2); margin: 0 6px; }
ul.entries .head .meta .wip { color: var(--accent); }
ul.entries .summary {
  margin: 4px 0 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}
ul.entries .links { display: flex; gap: 14px; flex-wrap: wrap; }
ul.entries .links a {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}
ul.entries .links a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* Say hi (Home / Contact) */
.say-hi p { margin: 0 0 10px; font-size: 15px; }
.say-hi .links { display: flex; gap: 18px; flex-wrap: wrap; }

/* Contact form */
.form {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.form .field { display: flex; flex-direction: column; gap: 6px; }
.form label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.form input,
.form textarea,
.form select {
  font: inherit;
  color: var(--fg);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 10px 12px;
  width: 100%;
  outline: none;
  transition: border-color 120ms;
}
.form input:focus,
.form textarea:focus,
.form select:focus {
  border-color: var(--accent);
}
.form textarea { min-height: 140px; resize: vertical; }
.form .submit {
  align-self: flex-start;
  background: var(--fg);
  color: var(--bg);
  border: 0;
  padding: 10px 18px;
  border-radius: 4px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms;
}
.form .submit:hover { background: var(--accent); color: var(--surface); }
.form .note {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted-2);
}

/* Inline mono accent */
.mono {
  font-family: var(--font-mono);
  font-size: 0.92em;
  color: var(--muted);
}

/* ---------- Article (Lines detail) ---------- */
.article-back {
  display: inline-block;
  margin: 0 0 24px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
}
.article-back:hover { color: var(--accent); }

.article-head { margin-bottom: 32px; }
.article-head .kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin: 0 0 12px;
}
.article-head h1 {
  margin: 0 0 16px;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.25;
}
.article-head .meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}
.article-head .meta .sep { color: var(--muted-2); }
.article-head .meta .tag {
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

/* Article body — same shell width, reading-optimised line-height */
.article-body { font-size: 16px; line-height: 1.8; }
.article-body p { margin: 0 0 22px; }
.article-body .lede {
  font-size: 17px;
  color: var(--muted);
  margin-bottom: 28px;
}
.article-body h2 {
  margin: 44px 0 14px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.005em;
  line-height: 1.35;
}
.article-body h3 {
  margin: 32px 0 10px;
  font-size: 16px;
  font-weight: 700;
}
.article-body ul,
.article-body ol {
  margin: 0 0 22px;
  padding-left: 22px;
}
.article-body li { margin-bottom: 6px; }
.article-body blockquote {
  margin: 26px 0;
  padding: 2px 0 2px 18px;
  border-left: 2px solid var(--accent);
  color: var(--muted);
  font-size: 16px;
}
.article-body blockquote p { margin-bottom: 6px; }
.article-body blockquote p:last-child { margin-bottom: 0; }
.article-body code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--accent-soft);
  color: var(--fg);
  padding: 1px 5px;
  border-radius: 3px;
}
.article-body pre {
  margin: 24px 0;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.65;
}
.article-body pre code {
  background: transparent;
  padding: 0;
  font-size: inherit;
}
.article-body figure { margin: 28px 0; }
.article-body figure img { display: block; max-width: 100%; height: auto; }
.article-body figcaption {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}
.article-body img { max-width: 100%; height: auto; }
.article-body hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 36px 0;
}
.article-body a {
  color: var(--fg);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.article-body a:hover { color: var(--accent); }

/* Article footer — prev / next */
.article-foot {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.article-foot .nav-link {
  display: block;
  text-decoration: none;
  color: var(--fg);
}
.article-foot .nav-link .label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 4px;
}
.article-foot .nav-link .title {
  font-size: 14px;
  color: var(--fg);
  border-bottom: 1px solid transparent;
  transition: color 120ms, border-color 120ms;
}
.article-foot .nav-link:hover .title {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.article-foot .nav-link.next { text-align: right; }
.article-foot .nav-link.disabled { opacity: 0.4; pointer-events: none; }

@media (max-width: 520px) {
  .article-head h1 { font-size: 24px; }
  .article-foot { grid-template-columns: 1fr; }
  .article-foot .nav-link.next { text-align: left; }
}

/* Footer */
footer.site {
  border-top: 1px solid var(--border);
  margin-top: 64px;
  padding: 24px 0 48px;
  font-size: 13px;
  color: var(--muted);
}
footer.site .row {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
footer.site a { color: var(--muted); text-decoration-color: var(--border); }
