/* Terminal × fabrique — a quiet terminal in a silk works run by machines.
   Monochrome like the loom banner; phosphor green for what you can act on
   (prompts, links), amber for what the machine reports (dates, meta).
   Text in IBM Plex Sans, everything else in JetBrains Mono (theme.font). */

:root {
  --term-mono: var(--md-code-font-family, "JetBrains Mono"), ui-monospace, monospace;
  --term-measure: 42rem;
}

/* Dark: the terminal. */
[data-md-color-scheme="slate"] {
  --md-hue: 210;
  --md-default-bg-color: #101317;
  --md-default-fg-color: #d6dde4;
  --md-default-fg-color--light: #aab4be;
  --md-default-fg-color--lighter: #7d8894;
  --md-default-fg-color--lightest: #262d35;
  --md-typeset-color: #c9d1d9;
  --md-code-bg-color: #161b21;
  --md-code-fg-color: #d6dde4;
  --md-accent-fg-color: #7fd1a5;
  --md-typeset-a-color: #7fd1a5;
  --term-green: #7fd1a5;
  --term-amber: #e3b766;
  --term-rule: #262d35;
  --term-surface: #141920;
  --term-thread: rgba(214, 221, 228, .025);
}

/* Light: the printout. */
[data-md-color-scheme="default"] {
  --md-default-bg-color: #eceeec;
  --md-default-fg-color: #15191e;
  --md-default-fg-color--light: #444c55;
  --md-default-fg-color--lighter: #6f7781;
  --md-default-fg-color--lightest: #cdd2d6;
  --md-typeset-color: #20262c;
  --md-code-bg-color: #e1e4e3;
  --md-code-fg-color: #15191e;
  --md-accent-fg-color: #1d7a50;
  --md-typeset-a-color: #1d7a50;
  --term-green: #1d7a50;
  --term-amber: #8f6210;
  --term-rule: #cdd2d6;
  --term-surface: #e4e7e5;
  --term-thread: rgba(21, 25, 30, .035);
}

/* Header, tabs and footer are the terminal's frame: dark in both schemes. */
[data-md-color-scheme] {
  --md-primary-fg-color: #0b0d10;
  --md-primary-fg-color--dark: #07090b;
  --md-primary-bg-color: #d6dde4;
  --md-primary-bg-color--light: #7d8894;
  --md-footer-bg-color: #0b0d10;
  --md-footer-bg-color--dark: #07090b;
  --md-footer-fg-color: #d6dde4;
  --md-footer-fg-color--light: #7d8894;
  --md-footer-fg-color--lighter: #5b6570;
  --term-frame-green: #7fd1a5;
  --term-frame-amber: #e3b766;
  --term-frame-rule: #1e242b;
}

/* Warp and weft: the loom's grid, barely there. */
body {
  background-color: var(--md-default-bg-color);
  background-image:
    repeating-linear-gradient(0deg, var(--term-thread) 0 1px, transparent 1px 8px),
    repeating-linear-gradient(90deg, var(--term-thread) 0 1px, transparent 1px 8px);
}
.md-main, .md-content { background: transparent; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Frame ---------- */
.md-header, .md-tabs, .md-nav, .md-search, .md-footer, .md-post__meta, .md-meta,
.md-typeset .md-post__action, .md-pagination, .md-top, .md-source, .md-clipboard {
  font-family: var(--term-mono);
}
.md-header, .md-header--shadow { box-shadow: none; border-bottom: 1px solid var(--term-frame-rule); }
.md-header__topic:first-child { font-weight: 500; letter-spacing: 0; }

/* The logo is the prompt's home, "~/" (overrides/partials/logo.html),
   followed by the author's name (overrides/partials/header.html). */
.md-logo__prompt {
  display: inline-block; font-family: var(--term-mono); font-weight: 700;
  font-size: 1rem; line-height: 1.2rem; color: var(--term-frame-green);
}
.md-header__button.md-logo { margin-right: 0; padding-right: .3rem; }
.md-header__title { margin-left: .2rem; }
.md-nav__button.md-logo .md-logo__prompt { font-size: 1.6rem; line-height: 2.4rem; }

.md-tabs { border-bottom: 1px solid var(--term-frame-rule); }
.md-tabs__list { display: flex; align-items: baseline; }
.md-tabs__item { height: 2.6rem; padding: 0 .15rem; }
.md-tabs__link {
  margin-top: .85rem; font-size: .7rem; opacity: 1;
  color: var(--md-primary-bg-color--light);
}
.md-tabs__link:hover, .md-tabs__link:focus { color: var(--term-frame-green); }
.md-tabs__item--active .md-tabs__link { color: var(--md-primary-bg-color); }
.md-tabs__item--active .md-tabs__link::before { content: "▸ "; color: var(--term-frame-green); }
/* The first tab is the title the others continue: "Dwelling on… …Agentic". */
.md-tabs__item:first-child { padding-left: 0; margin-right: .6rem; }
.md-tabs__item:first-child .md-tabs__link { color: var(--md-primary-bg-color); font-weight: 700; font-size: .8rem; }
/* "//" between topics (not between the title and the first topic, which
   reads on: "Dwelling on… …Agentic // …Software architecture // …"). */
.md-tabs__item:nth-child(n+3) { display: inline-flex; align-items: baseline; }
.md-tabs__item:nth-child(n+3)::before {
  content: "//"; margin: 0 .55rem 0 .35rem; font-size: .7rem;
  color: var(--md-footer-fg-color--lighter);
}
/* The blog plugin appends "Archive" and "Topics" after the nav entries
   (blog_dir is the root): keep only ours, the five first. */
.md-tabs__item:nth-child(n+6) { display: none; }

@media screen and (min-width: 76.25em) {
  .md-sidebar--primary, .md-sidebar--secondary { display: none; }
}

/* ---------- Hero (home only): the loom, then a prompt ---------- */
.hero { position: relative; overflow: hidden; background: #0b0d10; border-bottom: 1px solid var(--term-frame-rule); }
.hero__image {
  position: absolute; inset: 0; background-size: cover; background-position: center 40%;
  filter: grayscale(1) contrast(1.1) brightness(.75);
}
.hero__image::after {
  /* Scanlines, and a fade into the page below. */
  content: ""; position: absolute; inset: 0;
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, .28) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, rgba(11, 13, 16, .15) 0%, rgba(11, 13, 16, .55) 60%, rgba(11, 13, 16, .95) 100%);
}
.hero__inner { position: relative; min-height: 17rem; display: flex; align-items: flex-end; padding: 2.5rem .8rem 1.6rem; }
.hero__term {
  max-width: var(--term-measure); margin: 0 auto; width: 100%;
  font-family: var(--term-mono); font-size: .78rem; line-height: 1.6; color: #d6dde4;
  background: rgba(11, 13, 16, .78); border: 1px solid #2a323b; padding: .9rem 1.1rem;
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.hero__term p { margin: 0; }
.hero__out { color: #f1f4f7; font-size: .95rem; margin: .35rem 0 .5rem !important; max-width: 36em; }
.hero__prompt { color: var(--term-frame-green); }
.hero__cursor {
  display: inline-block; width: .55em; height: 1.05em; vertical-align: text-bottom;
  background: var(--term-frame-green); animation: term-blink 1.1s steps(1) infinite;
}
@keyframes term-blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .hero__cursor { animation: none; } }

/* ---------- One reading column ---------- */
.md-main__inner { max-width: calc(var(--term-measure) + 4rem); margin-left: auto; margin-right: auto; }
.md-content { max-width: var(--term-measure); margin: 0 auto; }

/* ---------- Typography: Markdown's own marks, kept visible ---------- */
.md-typeset { font-size: .86rem; line-height: 1.75; color: var(--md-typeset-color); }
.md-typeset h1, .md-typeset h2, .md-typeset h3, .md-typeset h4 {
  font-family: var(--term-mono); color: var(--md-default-fg-color); letter-spacing: -.01em;
}
.md-typeset h1 { font-weight: 700; font-size: 1.7rem; line-height: 1.25; margin-bottom: 1em; }
.md-typeset h2 { font-weight: 700; font-size: 1.15rem; margin-top: 2.2em; }
.md-typeset h3 { font-weight: 600; font-size: .95rem; }
.md-typeset h1::before { content: "# "; color: var(--term-green); font-weight: 400; }
.md-typeset h2::before { content: "## "; color: var(--term-green); font-weight: 400; }
.md-typeset h3::before { content: "### "; color: var(--term-green); font-weight: 400; }
.md-typeset strong { color: var(--md-default-fg-color); }
.md-typeset a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; }
.md-typeset a:hover { color: var(--term-amber); }
.md-typeset blockquote { border-left: 2px solid var(--term-amber); color: var(--md-default-fg-color--light); }
.md-typeset hr { border-bottom: 1px dashed var(--term-rule); }
.md-typeset code { font-size: .82em; border-radius: 0; }
.md-typeset pre > code { border: 1px solid var(--term-rule); border-left: 2px solid var(--term-green); }
.md-typeset ::selection { background: var(--term-green); color: var(--md-default-bg-color); }

/* ---------- Posts ---------- */
.md-post--excerpt {
  background: var(--term-surface); border: 1px solid var(--term-rule);
  border-left: 2px solid var(--term-green); padding: .9rem 1.2rem .5rem; margin-bottom: 1.4rem;
}
.md-post--excerpt .md-post__content h2 { margin-top: .2em; }
.md-post--excerpt .md-post__content h2::before { content: none; }
.md-post__header, .md-post__meta { color: var(--term-amber); font-size: .66rem; }
.md-post__meta a { color: inherit; }
.md-post__header .md-post__authors { display: none; }
.md-typeset .md-post__action a { font-size: .7rem; text-decoration: none; }
.md-typeset .md-post__action a::before { content: "$ "; color: var(--md-default-fg-color--lighter); }
.md-typeset .md-post__action a::after { content: " →"; }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: 10.5rem 1fr; gap: 1.6rem; align-items: start; margin-bottom: 1rem; }
.md-typeset .about__portrait { margin: .35rem 0 0; }
.about__portrait img {
  display: block; width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover;
  border: 1px solid var(--term-rule);
  filter: grayscale(1) contrast(1.05); transition: filter .4s ease;
}
.about__portrait:hover img { filter: none; }
.about p:first-child { margin-top: 0; }
.links { font-family: var(--term-mono); font-size: .75rem; display: flex; gap: 1.4rem; flex-wrap: wrap; }
.links a { text-decoration: none !important; }
@media screen and (max-width: 40em) {
  .about { grid-template-columns: 1fr; }
  .md-typeset .about__portrait { max-width: 10.5rem; }
}

/* ---------- Footer and comments ---------- */
.md-footer-meta { border-top: 1px solid var(--term-frame-rule); }
.md-typeset #__comments {
  font-size: 1.05rem; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px dashed var(--term-rule);
}
