*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #221e1f; --bg-deep: #1a1617; --cyan: #00adef; --cyan-muted: #4da1bb;
  --orange: #f67d20; --white: #f0f0f0; --grid: #3a3637;
  --bar-h: 32px;
  --font-p: 'Nunito Sans', 'Avenir', system-ui, sans-serif;
  --font-s: 'Source Sans 3', 'Myriad Pro', sans-serif;
  --font-ui: 'Source Sans 3', 'Myriad Pro', sans-serif;
}
html { scroll-behavior: smooth; }
body { margin: 0; background: #0a0a0a; color: var(--white); font-family: var(--font-p); }

/* Compact navbar (top + footer) */
.navbar { position: fixed; top: 0; left: 0; right: 0; height: var(--bar-h); background: var(--bg-deep); border-bottom: 1px solid var(--grid); font-family: var(--font-s); font-size: 11px; letter-spacing: 0.02em; z-index: 100; white-space: nowrap; overflow: hidden; }
.navbar-footer { position: static; border-bottom: none; border-top: 1px solid var(--grid); }
.nb-inner { max-width: 777px; margin: 0 auto; height: 100%; display: flex; align-items: center; justify-content: space-between; padding: 0 8px; }
.nb-left, .nb-right { flex-shrink: 0; display: flex; align-items: center; }
.nb-center { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.nb-link { color: var(--cyan-muted); text-decoration: none; padding: 0 6px; }
.nb-link:hover { color: var(--cyan); }
.nb-sep { color: var(--grid); padding: 0 1px; user-select: none; }
.nb-num { color: var(--orange); font-weight: 600; padding: 0 4px; }
.nb-title { color: var(--white); padding: 0 4px; overflow: hidden; text-overflow: ellipsis; }

/* Thesis layout: applet + essay */
.app-section { height: 100vh; padding-top: var(--bar-h); position: relative; }
.app-section iframe { width: 100%; height: 100%; border: none; display: block; }
.read-more { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 50; }
.read-more a { display: inline-flex; align-items: center; gap: 6px; color: var(--cyan-muted); font-family: var(--font-s); font-size: 11px; letter-spacing: 0.05em; text-decoration: none; background: rgba(26,22,23,0.85); border: 1px solid var(--grid); padding: 6px 16px; border-radius: 20px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: all 200ms; }
.read-more a:hover { color: var(--cyan); border-color: var(--cyan); }
.read-more a svg { width: 12px; height: 12px; fill: currentColor; }

.essay { max-width: 680px; margin: 0 auto; padding: 48px 24px 32px; background: var(--bg); }
.essay-section-tag { font-family: var(--font-s); font-size: 10px; color: var(--grid); letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 12px; }
.essay h1 { font-size: 28px; font-weight: 400; color: var(--orange); line-height: 1.25; margin-bottom: 40px; }
.essay-body h2 { font-size: 14px; font-weight: 400; color: var(--orange); font-family: var(--font-s); letter-spacing: 0.04em; margin: 36px 0 14px; padding-top: 28px; border-top: 1px solid var(--grid); }
.essay-body p { font-size: 16px; line-height: 1.75; color: var(--white); margin-bottom: 20px; }
.essay-body ul { padding-left: 20px; margin-bottom: 20px; }
.essay-body li { font-size: 16px; line-height: 1.75; color: var(--white); margin-bottom: 10px; }
.essay-body strong { color: var(--orange); font-weight: 600; }
.essay-body a { color: var(--cyan); text-decoration: none; }
.essay-copyright { max-width: 680px; margin: 0 auto; padding: 20px 24px 80px; background: var(--bg); font-family: var(--font-s); font-size: 11px; color: var(--grid); text-align: center; }

/* Essay/WP layout: standalone post body */
body.essay-page { background: var(--bg); color: var(--white); font-family: var(--font-p); font-weight: 400; line-height: 1.7; max-width: 640px; margin: 0 auto; padding: 100px 24px 120px; overflow-x: hidden; }
body.essay-page nav { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 80px; font-family: var(--font-s); font-size: 12px; letter-spacing: .04em; }
.post-meta { font-family: var(--font-s); font-size: 11px; color: var(--cyan-muted); letter-spacing: .03em; margin-bottom: 16px; }
.post-title { font-family: var(--font-p); font-size: 28px; font-weight: 400; color: var(--orange); line-height: 1.25; margin-bottom: 48px; }
.post-body { font-size: 17px; }
.post-body p { margin-bottom: 1.4em; }
.post-body h2 { font-family: var(--font-s); font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--cyan-muted); margin: 2.5em 0 1em; }
.post-body h3 { font-size: 17px; font-weight: bold; margin: 2em 0 .5em; }
.post-body strong { font-weight: bold; color: var(--white); }
.post-body em { font-style: italic; }
.post-body hr { border: none; border-top: 1px solid var(--grid); margin: 2.5em 0; }
.post-body a { color: var(--cyan); text-decoration: none; }
.post-body a:hover { text-decoration: underline; }
.post-body img { max-width: 100%; height: auto; margin: 2em 0; }
.post-body figure { margin: 2em 0; }
.post-body figure img { margin: 0; }
.post-body ul, .post-body ol { margin: 0 0 1.4em 1.4em; }
.post-body li { margin-bottom: .4em; }
.post-body blockquote { border-left: 2px solid var(--cyan); padding: 10px 16px; margin: 1.4em 0; color: var(--cyan-muted); font-style: italic; font-family: var(--font-s); }
.post-footer { margin-top: 64px; padding-top: 24px; border-top: 1px solid var(--grid); font-family: var(--font-s); font-size: 11px; color: var(--cyan-muted); display: flex; justify-content: space-between; }
.post-footer a { color: var(--cyan-muted); text-decoration: none; }
.post-footer a:hover { text-decoration: underline; }

/* Related links + bottom nav */
.related-links a { display: block; color: var(--cyan-muted); font-size: 14px; font-family: sans-serif; text-decoration: none; padding: .3em 0; border-bottom: 1px solid #2a2627; }
.related-links a:hover { color: var(--cyan); }
.bottom-nav { margin-top: 2em; padding: 1em 0; border-top: 1px solid var(--grid); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.bottom-nav a { font-family: sans-serif; font-size: 11px; text-decoration: none; letter-spacing: .05em; }
.bottom-nav .read-essay { color: var(--cyan-muted); }
.bottom-nav .next-post { color: var(--orange); }

/* Mobile */
img, video, canvas, iframe, svg { max-width: 100%; height: auto; }
@media (max-width: 680px) {
  .nb-center { display: none; }
  .essay { padding: 40px 16px 32px; }
  .essay h1 { font-size: 22px; }
}
@media (max-width: 480px) {
  body.essay-page { padding: 80px 16px 80px; }
  .post-title { font-size: 22px; }
}
