/* ----------------------------------------
   harunguna.xyz — classic / old school
   ---------------------------------------- */

:root {
  --bg: #fffff8;
  --surface: #f5f5ee;
  --border: #222;
  --border-light: #bbb;
  --text: #111;
  --muted: #555;
  --link: #00008b;
  --link-visited: #551a8b;
  --accent: #c00;           /* classic red accent */
  --font-serif: Georgia, 'Times New Roman', Times, serif;
  --font-mono: 'Courier New', Courier, monospace;
  --max-w: 680px;
  --max-w-wide: 900px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-serif);
  line-height: 1.7;
}

a {
  color: var(--link);
  text-decoration: underline;
}

a:visited { color: var(--link-visited); }
a:hover { color: var(--accent); }

/* ---- Layout ---- */

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container--wide {
  max-width: var(--max-w-wide);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---- Site header ---- */

.site-header {
  border-bottom: 3px solid var(--border);
  padding: 1.5rem 0 1rem;
  text-align: center;
}

.site-title {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  font-weight: bold;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
}

.site-title:visited { color: var(--text); }
.site-title:hover { color: var(--accent); text-decoration: none; }

.site-tagline {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.25rem;
  letter-spacing: 0.04em;
}

/* ---- Nav ---- */

nav {
  border-bottom: 1px solid var(--border);
  padding: 0.5rem 0;
  background: var(--surface);
}

nav .container--wide {
  display: flex;
  justify-content: center;
  gap: 0;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 0;
}

.nav-links li {
  border-right: 1px solid var(--border-light);
}

.nav-links li:first-child {
  border-left: 1px solid var(--border-light);
}

.nav-links a {
  display: block;
  padding: 0.3rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.04em;
  text-transform: lowercase;
}

.nav-links a:hover,
.nav-links a.active {
  background: var(--border);
  color: var(--bg);
}

/* ---- Hero / intro ---- */

.hero {
  padding: 2.5rem 0 2rem;
  border-bottom: 1px solid var(--border-light);
}

.hero-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted);
  border: 1px solid var(--border-light);
  padding: 0.15rem 0.5rem;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--surface);
}

.hero h1 {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: bold;
  line-height: 1.25;
  margin-bottom: 1rem;
  color: var(--text);
}

.hero h1 em {
  font-style: italic;
  color: var(--accent);
}

.hero-bio {
  font-size: 1rem;
  color: var(--muted);
  max-width: 560px;
  margin-bottom: 1.5rem;
}

.hero-links {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 0.3rem 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  background: var(--bg);
  cursor: pointer;
}

.btn:visited { color: var(--text); }

.btn-primary {
  background: var(--border);
  color: var(--bg);
}

.btn-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  text-decoration: none;
}

.btn-ghost:hover {
  background: var(--surface);
  text-decoration: none;
  color: var(--text);
}

/* ---- Sections ---- */

section {
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--border-light);
}

section:last-child {
  border-bottom: none;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 0.4rem;
}

.section-title {
  font-size: 1.35rem;
  font-weight: bold;
  margin-bottom: 0.4rem;
}

/* ---- About grid ---- */

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-top: 1.5rem;
  border: 1px solid var(--border-light);
}

.about-card {
  padding: 1.25rem;
  border-right: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}

.about-card:nth-child(even) { border-right: none; }
.about-card:nth-last-child(-n+2) { border-bottom: none; }

.about-card h3 {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.about-card p {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.6;
}

/* ---- Post list ---- */

.posts-list {
  list-style: none;
}

.post-item {
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
  padding: 0.85rem 0;
  border-bottom: 1px dashed var(--border-light);
}

.post-item:first-child {
  border-top: 1px dashed var(--border-light);
}

.post-date {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
  min-width: 88px;
}

.post-meta { flex: 1; }

.post-title {
  font-size: 1rem;
  font-style: italic;
  color: var(--link);
}

.post-item:hover .post-title {
  color: var(--accent);
}

.post-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  padding: 0.1rem 0.4rem;
  border: 1px solid var(--border-light);
  color: var(--muted);
  background: var(--surface);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 0.25rem;
}

.post-tag--de    { border-color: #226; color: #226; background: #eef; }
.post-tag--palstack { border-color: #522; color: #522; background: #fef; }
.post-tag--brain { border-color: #520; color: #840; background: #ffd; }

/* ---- Individual post ---- */

.post-header {
  padding: 2.5rem 0 2rem;
  border-bottom: 2px solid var(--border);
}

.post-header .post-tag {
  margin-bottom: 0.75rem;
}

.post-header h1 {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: bold;
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

.post-header .byline {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
}

.post-body {
  padding: 2.5rem 0 3.5rem;
}

.post-body p {
  margin-bottom: 1.4rem;
  font-size: 1.05rem;
}

.post-body h2 {
  font-size: 1.3rem;
  font-weight: bold;
  margin: 2.5rem 0 0.75rem;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 0.25rem;
}

.post-body h3 {
  font-size: 1.1rem;
  font-weight: bold;
  margin: 2rem 0 0.6rem;
}

.post-body ul, .post-body ol {
  padding-left: 1.75rem;
  margin-bottom: 1.4rem;
  font-size: 1.05rem;
}

.post-body li { margin-bottom: 0.35rem; }

.post-body code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--surface);
  border: 1px solid var(--border-light);
  padding: 0.05rem 0.3rem;
  color: var(--accent);
}

.post-body pre {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--border);
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
  line-height: 1.55;
}

.post-body pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--text);
}

.post-body blockquote {
  border-left: 4px solid var(--border);
  padding: 0.5rem 0 0.5rem 1.25rem;
  margin: 1.5rem 0;
  color: var(--muted);
  font-style: italic;
  background: var(--surface);
}

.post-nav {
  padding: 1.5rem 0;
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--border-light);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

/* ---- Footer ---- */

footer {
  border-top: 3px solid var(--border);
  padding: 1.5rem 0;
  background: var(--surface);
}

footer .container--wide {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
}

footer a { color: var(--muted); text-decoration: underline; }
footer a:hover { color: var(--accent); }

/* ---- Responsive ---- */

@media (max-width: 640px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-card { border-right: none; border-bottom: 1px solid var(--border-light); }
  .about-card:last-child { border-bottom: none; }
  .post-item { flex-direction: column; gap: 0.15rem; }
  footer .container--wide { flex-direction: column; gap: 0.5rem; text-align: center; }
  .nav-links a { padding: 0.3rem 0.75rem; }
}

/* ---- Post tables (data engineering posts) ---- */

.post-body table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: 0.92rem;
}

.post-body th, .post-body td {
  border: 1px solid var(--border-light);
  padding: 0.45rem 0.75rem;
  text-align: left;
}

.post-body th {
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* ---- Post figures (charts / diagrams) ---- */

.post-figure {
  margin: 1.75rem 0;
  border: 1px solid var(--border-light);
  background: var(--surface);
  padding: 1.25rem 1.25rem 0.9rem;
}

.post-figure svg {
  display: block;
  width: 100%;
  height: auto;
}

.post-figure img {
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
}

.post-figure-caption {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--muted);
  margin-top: 0.6rem;
  text-align: center;
}

/* ---- Homepage timeline (zigzag) ---- */

.tl-wrap { max-width: 1120px; margin: 0 auto; padding: 0 1.5rem 3rem; }
.tl-grid { display: grid; grid-template-columns: 1fr 56px 1fr; border-bottom: none; }

.tl-intro { padding: 2.5rem 0 2rem; align-items: start; }
.tl-intro-text { grid-column: 1; text-align: right; }
.tl-intro h1 { font-size: clamp(1.6rem, 3vw, 2.1rem); line-height: 1.25; margin-bottom: 0.75rem; }
.tl-links { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: flex-end; }
.tl-proof { grid-column: 3; list-style: none; display: flex; flex-direction: column; gap: 0.6rem; }
.tl-proof li { border: 1px solid var(--border-light); background: var(--surface); padding: 0.55rem 0.85rem; font-size: 0.9rem; }
.tl-proof b { display: block; font-size: 1.1rem; }

.tl-heading { font-family: var(--font-mono); color: var(--accent); font-size: 0.85rem; text-align: center; margin: 0.5rem 0 1.5rem; }

.tl-line { position: relative; padding: 0; }
.tl-line::before { content: ""; position: absolute; left: 50%; top: 0.3rem; bottom: 1.5rem; border-left: 2px solid var(--border); transform: translateX(-1px); }

.tl-stop { position: relative; padding-bottom: 1.25rem; grid-row: var(--row) / span 2; }
.tl-stop--L { grid-column: 1; text-align: right; }
.tl-stop--R { grid-column: 3; }
/* The dot is centred in the 56px gutter: its centre sits 28px from either column edge. */
.tl-stop::after { content: ""; position: absolute; top: 0.45rem; width: 14px; height: 14px; box-sizing: border-box; background: var(--bg); border: 2px solid var(--accent); border-radius: 50%; }
.tl-stop--L::after { right: -35px; }
.tl-stop--R::after { left: -35px; }
.tl-stop::before { content: ""; position: absolute; top: 0.9rem; width: 14px; border-top: 1px solid var(--border-light); }
.tl-stop--L::before { right: -21px; }
.tl-stop--R::before { left: -21px; }

.tl-label { font-family: var(--font-mono); font-size: 0.78rem; color: var(--accent); }
.tl-title { font-size: 1.2rem; line-height: 1.3; margin: 0.1rem 0 0.25rem; }
.tl-blurb { font-size: 0.92rem; color: var(--muted); margin-bottom: 0.4rem; }
.tl-posts { list-style: none; font-size: 0.92rem; }
.tl-posts li { padding: 0.12rem 0; }
.tl-date { font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); white-space: nowrap; }
.tl-stop--L .tl-date { margin-left: 0.5rem; }
.tl-stop--R .tl-date { margin-right: 0.5rem; }

.tl-latest { border-top: 1px solid var(--border); margin-top: 1rem; padding-top: 1.2rem; display: flex; flex-wrap: wrap; gap: 0.6rem 2rem; align-items: baseline; font-size: 0.92rem; }
.tl-latest-label { font-family: var(--font-mono); color: var(--accent); font-size: 0.8rem; }

@media (max-width: 800px) {
  .tl-grid { grid-template-columns: 1fr; }
  .tl-intro-text, .tl-proof { grid-column: 1; text-align: left; }
  .tl-links { justify-content: flex-start; }
  .tl-proof { margin-top: 1.25rem; }
  .tl-heading { text-align: left; }
  .tl-line { padding-left: 1.75rem; }
  .tl-line::before { left: 0.45rem; transform: none; }
  .tl-stop, .tl-stop--L, .tl-stop--R { grid-column: 1; grid-row: auto; text-align: left; }
  .tl-stop--L::after, .tl-stop--R::after { left: calc(-1.75rem + 0.45rem - 6px); right: auto; }
  .tl-stop::before { display: none; }
  .tl-stop--R .tl-date { margin-right: 0.5rem; }
}

/* ---- Blog page: tags and sort ---- */

.blog-wrap { max-width: 1120px; margin: 0 auto; padding: 0 1.5rem 4rem; }
.blog-title { font-size: 1.9rem; margin: 2rem 0 0.3rem; }
.blog-sub { color: var(--muted); margin-bottom: 1.25rem; }

.tag-bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 0.7rem 0; }
.tag-bar[hidden] { display: none; }
.tag-chip, .sort-btn { font-family: var(--font-mono); font-size: 0.8rem; background: var(--bg); color: var(--text); border: 1px solid var(--border-light); padding: 0.15rem 0.6rem; margin: 0.15rem 0.25rem 0.15rem 0; cursor: pointer; }
.tag-chip i { font-style: normal; color: var(--muted); }
.tag-chip.is-on, .sort-btn.is-on { background: var(--border); color: var(--bg); border-color: var(--border); }
.tag-chip.is-on i { color: var(--border-light); }
.sort-toggle { white-space: nowrap; }
.sort-btn { margin: 0; border-color: var(--border); }

.tag-status { font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted); margin: 0.9rem 0 0.2rem; min-height: 1.2em; }
.tag-clear { font: inherit; background: none; border: 0; color: var(--link); text-decoration: underline; cursor: pointer; padding: 0; }

.tag-list { list-style: none; display: grid; grid-template-columns: 1fr 1fr; column-gap: 3rem; }
.tag-item { padding: 0.75rem 0; border-bottom: 1px dotted var(--border-light); }
.tag-item[hidden] { display: none; }
.tag-item .post-date { display: block; font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted); }
.tag-item-title { display: block; font-weight: bold; margin: 0.1rem 0 0.3rem; }
.tag-link { text-decoration: none; margin-right: 0.25rem; }
.tag-link.is-hit { border-color: var(--accent); color: var(--accent); }
.post-tags .post-tag + .post-tag { margin-left: 0.35rem; }

@media (max-width: 800px) {
  .tag-bar { flex-direction: column; align-items: flex-start; }
  .tag-list { grid-template-columns: 1fr; }
}
