/* Reset */
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{border:0;font-size:100%;font:inherit;vertical-align:baseline;margin:0;padding:0}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:none}table{border-collapse:collapse;border-spacing:0}
*, *:before, *:after { box-sizing: border-box; }

/* Tokens */
:root {
  --bg:      #f2f2f0;
  --surface: #fff;
  --border:  #ddddd8;
  --text:    #1a1a1a;
  --muted:   #888;
  --accent:  #2a7fff;
  --code-bg: #e8e8e6;
}

/* Base */
html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Menlo", "SF Mono", "Monaco", "Courier New", monospace;
  font-size: 13px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.15s;
}
a:hover { opacity: 0.7; }

/* Layout */
#wrapper {
  max-width: 640px;
  margin: 0 auto;
  padding: 80px 24px 120px;
}

/* Nav */
nav.main-nav {
  max-width: 640px;
  margin: 0 auto;
  padding: 28px 24px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

nav.main-nav a {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.02em;
}
nav.main-nav a:hover { color: var(--text); opacity: 1; }

/* Home */
#header {
  margin-bottom: 60px;
}

#header h1 {
  font-size: 14px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 6px;
}

#header h2 {
  font-size: 14px;
  color: var(--muted);
  font-weight: 400;
}

/* Home sections */
.home-section {
  margin-bottom: 52px;
}

/* Post list */
#post-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

#post-list li {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

#post-list li:first-child {
  border-top: 1px solid var(--border);
}

#post-list .dates {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

#post-list h1 {
  font-size: 13px;
  font-weight: 400;
  color: var(--text);
  margin: 0;
  transition: color 0.15s;
}

#post-list a {
  display: flex;
  align-items: baseline;
  gap: 16px;
  color: var(--text);
  width: 100%;
}

#post-list a:hover h1 { color: var(--accent); opacity: 1; }
#post-list a:hover { opacity: 1; }


#post-list p {
  font-size: 12px;
  color: var(--muted);
  margin: 2px 0 0;
  display: block;
}

.ext-icon {
  font-size: 11px;
  color: var(--muted);
  margin-left: 2px;
}

.empty {
  color: var(--muted);
  font-size: 13px;
}

/* Post page */
.post {
  padding: 0;
}

.post header {
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.post h1 {
  font-size: 16px;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.4;
  margin-bottom: 10px;
}

p.headline {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 400;
}

#post-body {
  font-size: 13px;
  line-height: 1.8;
  color: #333;
}

#post-body h2 {
  font-size: 14px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 40px 0 16px;
}

#post-body h3 {
  font-size: 13px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 32px 0 12px;
}

#post-body p { margin-bottom: 20px; }

#post-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

#post-body ul, #post-body ol {
  margin: 0 0 20px 20px;
  padding: 0;
}

#post-body li {
  list-style: disc;
  padding-bottom: 6px;
}

#post-body ol li { list-style: decimal; }

blockquote {
  border-left: 2px solid var(--border);
  padding-left: 20px;
  color: var(--muted);
  margin: 24px 0;
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 20px;
  overflow-x: auto;
  font-family: "SF Mono", Menlo, Monaco, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.6;
  color: #4a3f35;
  margin-bottom: 24px;
}

code {
  font-family: "SF Mono", Menlo, Monaco, "Courier New", monospace;
  font-size: 13px;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 2px 6px;
  color: #4a3f35;
}

pre code {
  background: none;
  border: none;
  padding: 0;
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 40px 0;
}

img {
  max-width: 100%;
  border-radius: 6px;
  margin: 8px 0;
}

/* Tables */
table {
  width: 100%;
  margin: 32px 0;
  border-collapse: collapse;
  font-size: 13px;
}

th {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  color: #888;
  font-weight: 600;
}

td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  color: #aaa;
}

/* Mobile */
@media screen and (max-width: 540px) {
  #wrapper { padding: 48px 20px 80px; }
  nav.main-nav { padding: 20px 20px 0; }
  .post h1 { font-size: 20px; }
  #post-list a { flex-direction: column; gap: 2px; }
  #post-list .dates { font-size: 11px; }
}
