/* Obsidian Codex — design system overrides for hugo-minimalist-theme */

:root {
  --surface-obsidian: #0a0d14;
  --surface-slate: #0f141c;
  --surface-elevated: #151c27;
  --background: #10131a;
  --primary: #10b981;
  --primary-bright: #4edea3;
  --secondary: #06b6d4;
  --secondary-bright: #4cd7f6;
  --tertiary: #f59e0b;
  --tertiary-bright: #ffb95f;
  --text-parchment: #f1f5f9;
  --text-on: #e1e2ec;
  --text-muted: #94a3b8;
  --text-faint: #475569;
  --border-subtle: #1e293b;
  --border-active: #334155;
  --tag-crypto: #06b6d4;
  --tag-macro: #f59e0b;
  --tag-science: #10b981;
  --tag-frontier: #a855f7;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --reading-max: 680px;
  --font-display: "Newsreader", "Noto Serif", Georgia, serif;
  --font-body: "Inter", "Roboto", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

html {
  background: var(--surface-obsidian);
  color-scheme: dark;
}

body,
body.obsidian-codex {
  background: var(--surface-obsidian);
  color: var(--text-on);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--text-parchment);
  letter-spacing: -0.015em;
}

a {
  color: var(--secondary);
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
a:hover {
  color: var(--secondary-bright);
}

h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
  color: var(--text-parchment);
}
h1 a:hover, h2 a:hover, h3 a:hover, h4 a:hover, h5 a:hover, h6 a:hover {
  color: var(--primary);
}

hr {
  border: 0;
  border-top: 1px solid var(--border-subtle);
  margin: 2.5rem 0;
}

/* ——— Masthead / hero dossier ——— */
.site-masthead {
  position: relative;
  width: 100%;
  color: var(--text-parchment);
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(16, 185, 129, 0.08), transparent 55%),
    linear-gradient(180deg, #070a10 0%, var(--surface-obsidian) 100%);
  border-bottom: 1px solid var(--border-subtle);
}

.masthead-bar {
  width: 100%;
  border-bottom: 1px solid rgba(30, 41, 59, 0.85);
  background: rgba(10, 13, 20, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.masthead-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
}

.masthead-brand {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.masthead-brand:hover {
  color: inherit;
  text-decoration: none;
}

.brand-az {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: 0.04em;
  color: var(--primary-bright);
  line-height: 1.1;
  padding-top: 0.1rem;
}

.brand-sep {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: #3d5a4f;
  line-height: 1.2;
  padding-top: 0.28rem;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text-parchment);
  letter-spacing: -0.01em;
  line-height: 1.15;
  white-space: nowrap;
}

.brand-motto {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.78rem;
  color: rgba(226, 232, 240, 0.72);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.masthead-nav {
  justify-self: center;
}

.masthead-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 1.35rem;
}

.masthead-nav a {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: rgba(241, 245, 249, 0.82);
}

.masthead-nav a:hover,
.masthead-nav a:focus {
  color: var(--primary-bright);
  text-decoration: none;
}

.masthead-nav a.is-active {
  color: var(--primary-bright);
}

.masthead-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.masthead-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 34px;
  padding: 0 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--surface-elevated);
  color: var(--text-parchment);
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  line-height: 1;
}

.masthead-chip:hover,
.masthead-chip:focus {
  border-color: var(--border-active);
  color: var(--text-parchment);
  text-decoration: none;
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.12);
}

.masthead-chip .chip-icon {
  flex: 0 0 auto;
  opacity: 0.9;
}

.masthead-search kbd {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  padding: 0;
}

.masthead-profile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary);
  color: #06261a;
  text-decoration: none;
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.35), 0 0 18px rgba(16, 185, 129, 0.25);
}

.masthead-profile:hover,
.masthead-profile:focus {
  background: var(--primary-bright);
  color: #041910;
  text-decoration: none;
}

.hero-dossier {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.35rem 1.5rem 0.25rem;
}

.hero-frame {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(51, 65, 85, 0.65);
  background: #05070c;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  aspect-ratio: 2.45 / 1;
  min-height: 220px;
}

.hero-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-overlay {
  position: absolute;
  inset: auto 0 0 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.35rem;
  background: linear-gradient(180deg, transparent 0%, rgba(5, 7, 12, 0.55) 45%, rgba(5, 7, 12, 0.82) 100%);
  pointer-events: none;
}

.hero-motto {
  margin: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(0.95rem, 1.6vw, 1.2rem);
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.55);
  max-width: 22em;
}

.hero-label {
  margin: 0;
  font-family: var(--font-body);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(241, 245, 249, 0.88);
  white-space: nowrap;
}

.intro-block {
  text-align: center;
  max-width: 52rem;
  margin: 1.75rem auto 0.5rem;
  padding: 0 0.5rem 0.75rem;
}

.intro-kicker {
  margin: 0 0 0.85rem;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary-bright);
}

.intro-blurb {
  margin: 0 auto;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.05rem, 1.7vw, 1.28rem);
  line-height: 1.45;
  color: rgba(241, 245, 249, 0.92);
  max-width: 40rem;
}

body.is-home > .container {
  padding-top: 2rem;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-search-dialog {
  border: 1px solid var(--border-active);
  border-radius: var(--radius-md);
  background: var(--surface-slate);
  color: var(--text-parchment);
  padding: 0;
  width: min(92vw, 420px);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
}

.site-search-dialog::backdrop {
  background: rgba(5, 7, 12, 0.72);
}

.site-search-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
}

.site-search-form input[type="search"] {
  width: 100%;
  box-sizing: border-box;
  height: 42px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--surface-obsidian);
  color: var(--text-parchment);
  padding: 0 0.85rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
}

.site-search-form input[type="search"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.site-search-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.topics-grid {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.topics-card {
  margin: 0;
}

.topics-card a {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.15rem 1.2rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--surface-slate);
  text-decoration: none;
  color: inherit;
}

.topics-card a:hover {
  border-color: var(--border-active);
  background: var(--surface-elevated);
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.08), 0 8px 32px rgba(0, 0, 0, 0.35);
  text-decoration: none;
}

.topics-card-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--text-parchment);
}

.topics-card-count {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.topics-note {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* ——— Layout ——— */
.container {
  margin: 0 auto;
  max-width: 1120px;
  width: 100%;
  padding: 3rem 1.5rem 0;
  box-sizing: border-box;
}

.author {
  text-align: center;
  width: 24%;
  float: left;
  margin: 0 3% 2rem 0;
  padding: 1.5rem 1rem;
  background: var(--surface-slate);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  position: sticky;
  top: 1.5rem;
  box-sizing: border-box;
}

.content {
  width: 70%;
  float: right;
  margin: 0;
  box-sizing: border-box;
}

.content.reading-column .post,
.reading-column {
  max-width: var(--reading-max);
}

/* ——— Author sidebar ——— */
.avatar-ring {
  display: inline-flex;
  padding: 3px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  margin-bottom: 0.75rem;
}

.profile-image {
  display: block;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 3px solid var(--surface-slate);
  object-fit: cover;
}

.author {
  font-family: var(--font-body);
  font-weight: 400;
}

.author p {
  margin: 0;
  padding: 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.author p.name {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--text-parchment);
  margin: 0.5rem 0 0.35rem;
}

.author p.name strong {
  font-weight: 500;
}

.author p.motto {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin: 0.25rem 0 0.75rem;
  padding: 0 0.25rem;
}

.author p.address {
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.author ul.social {
  list-style: none;
  display: inline;
  padding: 0;
  margin: 0 0 1rem;
}

.author ul.social li {
  display: inline;
}

.author ul.social li a {
  padding: 0.35rem;
  font-size: 1.15rem;
  color: var(--text-muted);
}

.author ul.social li a:hover,
.author ul.social li a:focus {
  color: var(--secondary);
  text-shadow: 0 0 12px rgba(6, 182, 212, 0.45);
}

.author .site-nav {
  margin-top: 0.75rem;
  text-align: center;
  border-top: 1px solid var(--border-subtle);
  padding-top: 1rem;
}

.author .site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.author .site-nav li {
  margin: 0.4rem 0;
}

.author .site-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.author .site-nav a:hover,
.author .site-nav a:focus {
  color: var(--primary-bright);
  text-decoration: none;
}

/* ——— Digest cards ——— */
.post,
article.post {
  margin-bottom: 2rem;
  padding: 1.5rem 1.5rem 1.35rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--surface-slate);
  border-bottom: 1px solid var(--border-subtle);
}

.digest-card:hover {
  border-color: var(--border-active);
  background: var(--surface-elevated);
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.08), 0 8px 32px rgba(0, 0, 0, 0.35);
}

.post h2 {
  margin-top: 0.35rem;
  margin-bottom: 0.75rem;
}

.post h2 a,
.post-template h1,
.content .post > h1 a {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.015em;
}

.digest-card h2 a:hover {
  color: var(--primary);
}

.post p,
.digest-card .excerpt {
  line-height: 1.65;
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin: 0 0 1rem;
}

.post p {
  color: var(--text-on);
}

.digest-card .excerpt {
  color: var(--text-muted);
}

.post ul li {
  line-height: 1.7;
  font-size: 0.9375rem;
  color: var(--text-on);
}

.post img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.post-info {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.post-info time {
  color: var(--text-muted);
}

.read-briefing {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--secondary);
  text-decoration: none;
}

.read-briefing:hover {
  color: var(--secondary-bright);
}

/* Domain / tag chips */
.domain-chip {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: rgba(148, 163, 184, 0.08);
  text-decoration: none;
  vertical-align: middle;
}

.domain-chip:hover {
  border-color: var(--border-active);
  color: var(--text-parchment);
}

.domain-crypto,
.domain-chip.domain-crypto {
  color: var(--tag-crypto);
  border-color: rgba(6, 182, 212, 0.35);
  background: rgba(6, 182, 212, 0.1);
}

.domain-macro,
.domain-chip.domain-macro {
  color: var(--tag-macro);
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.1);
}

.domain-science,
.domain-digests,
.domain-chip.domain-science,
.domain-chip.domain-digests {
  color: var(--tag-science);
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.1);
}

.domain-frontier,
.domain-apps,
.domain-chip.domain-frontier,
.domain-chip.domain-apps {
  color: var(--tag-frontier);
  border-color: rgba(168, 85, 247, 0.35);
  background: rgba(168, 85, 247, 0.1);
}

/* Single post reading */
.content.reading-column .post {
  background: transparent;
  border: none;
  padding: 0;
  border-radius: 0;
}

.content.reading-column .post > h1 {
  font-size: 2.25rem;
  margin-bottom: 0.75rem;
}

.post-template h2,
.post-template h3,
.post-template h4,
.post-template h5,
.post-template h6,
.content .post h2,
.content .post h3,
.content .post h4 {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--text-parchment);
}

.content .post a {
  color: var(--secondary);
  border-bottom: 1px solid transparent;
}
.content .post a:hover {
  color: var(--secondary-bright);
  border-bottom-color: rgba(6, 182, 212, 0.4);
}
.content .post h1 a,
.content .post h2 a {
  border-bottom: none;
}

.content .post code,
.content .post pre {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}

.content .post pre {
  background: var(--surface-slate);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 1rem;
  overflow-x: auto;
}

.content .post blockquote {
  border-left: 2px solid var(--primary);
  margin: 1.5rem 0;
  padding: 0.25rem 0 0.25rem 1.25rem;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-style: italic;
}

/* Buttons / pagination */
.btn {
  border: 1px solid var(--border-subtle);
  background-color: var(--surface-slate);
  width: auto;
  min-width: 100px;
  height: 36px;
  padding: 0 1rem;
  display: inline-block;
  border-radius: var(--radius-sm);
  text-align: center;
  font-family: var(--font-mono);
  font-weight: 500;
  line-height: 34px;
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.btn:hover {
  background-color: var(--surface-elevated);
  border-color: var(--secondary);
  color: var(--secondary-bright);
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.12);
}

.btn.home {
  width: auto;
  margin-bottom: 1.5rem;
}

.pagination {
  position: relative;
  height: 36px;
  width: 100%;
  margin: 1rem 0 3rem;
}

.counter {
  text-align: center;
  line-height: 36px;
  font-size: 0.6875rem;
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}

.tag-title {
  font-family: var(--font-display);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 2rem;
  color: var(--text-parchment);
}

.tag-title h1 {
  font-size: 1.75rem;
}

.tag-title p {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.share-buttons li {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.share-buttons li a {
  color: var(--secondary);
}

.comments {
  margin: 2rem 0 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
}

.comments h3 {
  font-family: var(--font-display);
  color: var(--text-parchment);
}

/* Footer */
.main-footer {
  background-color: var(--surface-slate);
  border-top: 1px solid var(--border-subtle);
  text-align: center;
  font-family: var(--font-mono);
  font-weight: 400;
  color: var(--text-faint);
}

.main-footer .container {
  padding: 1.75rem 1.5rem;
}

.main-footer a {
  color: var(--text-muted);
}
.main-footer a:hover {
  color: var(--secondary);
}

.main-footer p {
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
}

/* Highlight / selection */
::selection {
  background: rgba(16, 185, 129, 0.35);
  color: var(--text-parchment);
}

/* Responsive */
@media only screen and (min-width: 720px) {
  .container {
    width: 100%;
  }

  .masthead-inner {
    grid-template-columns: minmax(240px, 1.15fr) auto minmax(220px, 1fr);
  }

  .hero-frame {
    min-height: 280px;
  }
}

@media only screen and (max-width: 719px) {
  .container {
    width: 100%;
    padding: 1.5rem 1rem 0;
  }

  .author,
  .content {
    width: 100%;
    float: none;
    margin: 0 0 1.5rem;
  }

  .author {
    position: static;
    margin-bottom: 2rem;
  }

  .masthead-inner {
    grid-template-columns: 1fr;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
  }

  .masthead-brand {
    justify-content: flex-start;
  }

  .brand-motto {
    white-space: normal;
  }

  .masthead-nav {
    justify-self: start;
    width: 100%;
    overflow-x: auto;
  }

  .masthead-nav ul {
    gap: 1rem;
  }

  .masthead-actions {
    justify-self: start;
    flex-wrap: wrap;
  }

  .hero-dossier {
    padding: 1rem 1rem 0.25rem;
  }

  .hero-frame {
    aspect-ratio: 16 / 10;
    border-radius: 14px;
    min-height: 180px;
  }

  .hero-overlay {
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem;
  }

  .hero-label {
    white-space: normal;
  }

  .intro-block {
    margin-top: 1.25rem;
  }

  .post h2 a,
  .post-template h1,
  .content .post > h1 a {
    font-size: 1.375rem;
  }

  .digest-card,
  .post {
    padding: 1.15rem;
  }
}
