/* =============================================
   proper.rip — style.css
   Typefaces: Eczar (display/titles, roman), IBM Plex Mono (everything else)
   ============================================= */

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

:root {
  --bg: #000000;
  --bg-subtle: #121212;
  --border: #2b2b2b;
  --text: #ffffff;
  --text-muted: #b0b0b0;
  --text-dim: #8a8a8a;
  --display: 'Eczar', Georgia, 'Times New Roman', serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, 'Courier New', monospace;
  --max: 1200px;
  --pad: 2.5rem;
}

[data-theme="light"] {
  --bg: #ffffff;
  --bg-subtle: #f2f2f2;
  --border: #d8d8d8;
  --text: #000000;
  --text-muted: #444444;
  --text-dim: #6a6a6a;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  background: var(--bg);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-weight: 300;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ---- SITE BANNER ---- */

.site-banner {
  display: block;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  line-height: 1.6;
  text-align: center;
  color: var(--text-muted);
  padding: 0.8rem var(--pad);
  border-bottom: 1px solid var(--border);
  transition: color 0.15s;
}

.site-banner-name {
  color: var(--text);
}

.site-banner:hover {
  color: var(--text);
}

/* ---- LANDING PAGE ---- */

.landing {
  display: flex;
  align-items: center;
  min-height: 100vh;
  padding: 4rem 0;
}

.landing-inner {
  max-width: 600px;
  padding: 0 var(--pad);
  margin: 0 auto;
  width: 100%;
}

.landing-bio {
  font-family: var(--mono);
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--text-muted);
  margin-bottom: 2rem;
  text-align: justify;
}

.landing-bio a {
  color: var(--text);
  border-bottom: 1px solid var(--border);
  transition: border-color 0.15s;
}

.landing-bio a:hover {
  border-color: var(--text-muted);
}

.landing-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  margin-bottom: 1.5rem;
}

.landing-location {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.2em;
  color: var(--text-dim);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.landing-location svg {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
}

.landing-meta-icons {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.landing-projects-label {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.2em;
  color: var(--text-dim);
}

.landing-projects-list {
  list-style: none;
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.landing-projects-list li {
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--text-muted);
  text-align: justify;
}

.landing-projects-list a {
  color: var(--text);
  border-bottom: 1px solid var(--border);
  transition: border-color 0.15s;
}

.landing-projects-list a:hover {
  border-color: var(--text-muted);
}

.landing-projects-desc {
  color: var(--text-dim);
}

.landing-projects-title {
  color: var(--text);
}

.landing-projects-list a.desc-link {
  color: var(--text-muted);
  border-bottom: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.landing-projects-list a.desc-link:hover {
  color: var(--text);
  border-bottom-color: var(--text-muted);
}

.landing-icon {
  color: var(--text-dim);
  transition: color 0.15s;
  display: flex;
  align-items: center;
}

.landing-icon:hover {
  color: var(--text);
}

.landing-meta-icons .theme-toggle {
  border: none;
  width: auto;
  height: auto;
  padding: 0;
}

.landing-meta-icons .theme-toggle svg {
  width: 18px;
  height: 18px;
}

.landing-projects {
  margin-top: 2.75rem;
}

.landing-coda {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-top: 3.5rem;
  transition: color 0.15s;
}

.landing-coda a {
  color: var(--text-dim);
  border-bottom: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.landing-coda a:hover {
  color: var(--text);
  border-bottom-color: var(--text-dim);
}

/* ---- POST LIST ---- */

.post-list {
  max-width: var(--max);
  margin: 0 auto;
}

.post-item {
  border-bottom: 1px solid var(--border);
}

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

.post-item-link {
  display: block;
  padding: 1.375rem var(--pad);
  transition: background 0.15s;
}

.post-item-link:hover {
  background: var(--bg-subtle);
}

.post-item-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.post-item-date {
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  color: var(--text-dim);
}

.post-item-title {
  font-family: var(--display);
  font-size: 1.375rem;
  line-height: 1.3;
  font-weight: 600;
  color: var(--text);
  transition: color 0.15s;
}

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

.post-item-excerpt {
  font-size: 0.875rem;
  line-height: 1.75;
  color: var(--text-muted);
  max-width: 560px;
  margin-top: 0.375rem;
}

/* ---- POST PAGE ---- */

.post-header {
  /* no border — negative space */
}

.post-header-inner {
  max-width: 660px;
  margin: 0 auto;
  padding: 3rem var(--pad) 2.5rem;
}

/* Writing index header aligns with the full-width post list, not the
   narrow article body column. */
.post-header-inner--wide {
  max-width: var(--max);
}

.post-title {
  font-family: var(--display);
  font-size: clamp(1.85rem, 4vw, 2.5rem);
  line-height: 1.15;
  font-weight: 600;
  max-width: 680px;
  margin-bottom: 1.25rem;
}

.post-meta {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.post-nav {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem var(--pad) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.post-nav a {
  font-size: 1.625rem;
  line-height: 1;
  color: var(--text-dim);
  transition: color 0.15s;
  padding: 0.25rem 0.5rem;
  margin-left: -0.5rem;
}

.post-nav a:hover {
  color: var(--text);
}

.post-body {
  max-width: 660px;
  margin: 0 auto;
  padding: 0 var(--pad) 3.5rem;
  font-family: var(--mono);
  font-size: 0.9375rem;
  line-height: 1.75;
  color: var(--text-muted);
}

.post-body p + p {
  margin-top: 1.5em;
}

.post-body h2 {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  margin: 3rem 0 1.25rem;
  font-weight: 400;
}

.post-body a {
  color: var(--text);
  border-bottom: 1px solid var(--border);
  transition: border-color 0.15s;
}

.post-body a:hover {
  border-color: var(--text-muted);
}

.post-body ul,
.post-body ol {
  margin: 1.25em 0;
  padding-left: 1.5rem;
  color: var(--text-muted);
}

.post-body li {
  margin-bottom: 0.5em;
  line-height: 1.7;
}

.post-body s,
.post-body del {
  text-decoration: line-through;
  color: var(--text-dim);
}

.post-body figure {
  margin: 2.5rem 0;
}

.post-body img,
.post-body figure img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

.post-body figcaption {
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.6;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  margin-top: 0.75rem;
  text-align: center;
}

.post-body blockquote {
  border-left: 1px solid var(--border);
  padding-left: 1.5rem;
  margin: 2rem 0;
  color: var(--text-dim);
  font-style: italic;
}

.post-body code {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--text-muted);
  background: var(--bg-subtle);
  padding: 2px 6px;
}

.post-body pre {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  padding: 1.5rem;
  margin: 2rem 0;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.7;
  color: var(--text-muted);
}

.post-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.6;
}

.post-body th {
  text-align: left;
  font-weight: 500;
  color: var(--text-muted);
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--text-dim);
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.post-body td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  vertical-align: top;
  word-break: break-all;
}

.post-body td:first-child {
  white-space: nowrap;
  color: var(--text);
  word-break: normal;
}

.post-body tbody tr:hover td {
  background: var(--bg-subtle);
}

.post-back {
  max-width: 660px;
  margin: 0 auto;
  padding: 0 var(--pad) 4rem;
}

.post-back a {
  font-size: 0.625rem;
  letter-spacing: 0.2em;
  color: var(--text-dim);
  transition: color 0.15s;
}

.post-back a:hover {
  color: var(--text);
}

/* ---- THEME TOGGLE ---- */

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-dim);
  transition: color 0.2s, border-color 0.2s;
  flex-shrink: 0;
}

.theme-toggle:hover {
  color: var(--text-muted);
  border-color: var(--text-dim);
}

.theme-toggle svg {
  width: 14px;
  height: 14px;
}

/* ---- RESPONSIVE ---- */

@media (max-width: 768px) {
  :root {
    --pad: 1.25rem;
  }

  .landing {
    align-items: flex-start;
    padding-top: 3rem;
  }
}

/* ---- a11y utilities ---- */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
