@charset "UTF-8";

:root {
  color-scheme: dark;

  /* Base palette */
  --ink-black: hsla(216, 45%, 4%, 1);
  --taupe-grey: hsla(314, 7%, 35%, 1);
  --soft-linen: hsla(72, 12%, 92%, 1);
  --jet-black: hsla(193, 41%, 18%, 1);
  --dark-amaranth: hsla(340, 79%, 25%, 1);

  /* Tints/shades derived from the palette (same hues, shifted lightness) */
  --jet-black-900: hsla(193, 41%, 7%, 1);
  --jet-black-800: hsla(193, 41%, 10%, 1);
  --jet-black-600: hsla(193, 41%, 26%, 1);
  --jet-black-300: hsla(193, 30%, 62%, 1);
  --amaranth-300: hsla(340, 79%, 74%, 1);
  --amaranth-400: hsla(340, 70%, 62%, 1);
  --taupe-300: hsla(314, 7%, 68%, 1);
  --linen-dim: hsla(72, 12%, 80%, 1);

  /* Semantic tokens */
  --bg: var(--ink-black);
  --surface: var(--jet-black-800);
  --surface-sunk: var(--jet-black-900);
  --border: var(--jet-black);
  --border-strong: var(--jet-black-600);
  --text: var(--linen-dim);
  --heading: var(--soft-linen);
  --muted: var(--taupe-300);
  --accent: var(--amaranth-300);
  --accent-hover: var(--soft-linen);
  --accent-fill: var(--dark-amaranth);
  --cool: var(--jet-black-300);

  /* Type */
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas,
    "Liberation Mono", "Courier New", monospace;

  --radius: 8px;
  --measure: 70ch;
}

/* ---------- Reset & base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 40% at 50% -10%, hsla(193, 41%, 18%, 0.55), transparent 70%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--dark-amaranth);
  color: var(--soft-linen);
}

h1,
h2,
h3,
h4 {
  color: var(--heading);
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin: 2rem 0 0.75rem;
}

h1 { font-size: 2.2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }

p,
ul,
ol {
  margin: 0 0 1rem;
}

strong {
  color: var(--heading);
}

a {
  color: var(--accent);
  text-decoration-color: hsla(340, 79%, 74%, 0.4);
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
  transition: color 0.15s, text-decoration-color 0.15s;
}

a:hover,
a:focus-visible {
  color: var(--accent-hover);
  text-decoration-color: var(--amaranth-400);
}

:focus-visible {
  outline: 2px solid var(--amaranth-400);
  outline-offset: 3px;
  border-radius: 2px;
}

img {
  max-width: 100%;
  height: auto;
}

.icon-arch {
  max-width: 2%;
  height: auto;
}

.icon-cachy {
  max-width: 2%;
  height: auto;
}

.icon-hypr {
  max-width: 1.5%;
  height: auto;
}

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

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 10;
  padding: 0.5rem 1rem;
  background: var(--accent-fill);
  color: var(--soft-linen);
}

.skip-link:focus {
  left: 1rem;
}

/* ---------- Header & footer ---------- */

.site-header {
  border-bottom: 1px solid var(--border);
  position: relative;
}

/* Thin amaranth-to-teal rule under the header */
.site-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, var(--dark-amaranth), var(--jet-black) 60%, transparent);
}

.site-header .inner,
.site-footer .inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.4rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
}

.site-title {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
}

.site-title a {
  color: var(--heading);
  text-decoration: none;
}

/* Prompt-style marker before the site name */
.site-title a::before {
  content: "> ";
  color: var(--amaranth-400);
}

.site-title a:hover,
.site-title a:focus-visible {
  color: var(--accent);
}

.site-tagline {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--cool);
}

.site-footer {
  margin-top: 5rem;
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--muted);
}

.site-footer p {
  margin: 0;
}

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

.layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 1rem 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 3rem;
}

.content {
  min-width: 0;
  max-width: var(--measure);
}

.content > :first-child,
.content > section:first-child > :first-child {
  margin-top: 0;
}

@media (max-width: 820px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.5rem;
  }
}

/* ---------- Home page sections ---------- */

.section-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--cool);
  margin: 0 0 0.35rem;
}

.section-label::before {
  content: "// ";
  color: var(--amaranth-400);
}

.home-section {
  margin-bottom: 3rem;
}

.home-section h2 {
  margin-top: 0;
}

.about {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}

@media (max-width: 480px) {
  .about {
    flex-direction: column;
  }
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--dark-amaranth);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  box-shadow: 0 12px 32px -16px hsla(216, 45%, 1%, 0.9);
}

.project-card h2 {
  margin-top: 0;
}

.project-facts {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.project-facts li {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: var(--surface-sunk);
  border: 1px solid var(--border-strong);
  color: var(--muted);
}

/* ---------- Post summaries (home page) ---------- */

.post-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: grid;
  gap: 1rem;
}

.post-summary {
  position: relative;
  padding: 1.25rem 1.5rem;
  background: var(--surface-sunk);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-strong);
  border-radius: var(--radius);
  transition: border-color 0.15s, background-color 0.15s;
}

.post-summary:hover,
.post-summary:focus-within {
  background: var(--surface);
  border-left-color: var(--dark-amaranth);
}

.post-summary h3 {
  margin: 0.2rem 0 0.4rem;
  font-size: 1.25rem;
}

.post-summary h3 a {
  color: var(--heading);
  text-decoration: none;
}

.post-summary h3 a:hover,
.post-summary h3 a:focus-visible {
  color: var(--accent);
}

.post-summary p {
  margin-bottom: 0.6rem;
}

.read-more {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
}

.read-more:hover,
.read-more:focus-visible {
  text-decoration: underline;
}

.post-meta {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0;
}

.post-meta .tag {
  display: inline-block;
  padding: 0 0.5rem;
  border-radius: 4px;
  background: var(--accent-fill);
  color: var(--soft-linen);
}

/* ---------- Archive sidebar ---------- */

.archive {
  font-size: 0.95rem;
}

.archive-box {
  position: sticky;
  top: 1.5rem;
  background: var(--surface-sunk);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.archive h2 {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--cool);
  margin: 0 0 0.85rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
}

.archive details {
  margin-bottom: 0.5rem;
}

.archive summary {
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--heading);
  padding: 0.2rem 0;
}

.archive summary::marker {
  color: var(--amaranth-400);
}

.archive ul {
  list-style: none;
  padding: 0 0 0 0.9rem;
  margin: 0.35rem 0 0.75rem 0.25rem;
  border-left: 1px solid var(--border-strong);
}

.archive li {
  margin: 0.5rem 0;
  line-height: 1.4;
}

.archive li a {
  text-decoration: none;
}

.archive li a:hover,
.archive li a:focus-visible {
  text-decoration: underline;
}

.archive li a[aria-current="page"] {
  color: var(--heading);
  font-weight: 600;
}

.archive li a[aria-current="page"]::before {
  content: "▸ ";
  color: var(--amaranth-400);
}

.archive .archive-date {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
}

/* ---------- Blog post page ---------- */

.back-link {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  margin-bottom: 1.75rem;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
}

.back-link:hover,
.back-link:focus-visible {
  color: var(--heading);
  border-color: var(--dark-amaranth);
  background: var(--surface);
}

.post-header {
  margin-bottom: 2.25rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--border);
}

.post-header h1 {
  margin: 0.5rem 0 0.75rem;
}

.post-lede {
  font-size: 1.2rem;
  color: var(--muted);
  margin: 0;
}

.post-body h2 {
  margin-top: 2.75rem;
}

.post-body h2::before {
  content: "#";
  margin-right: 0.4em;
  color: var(--amaranth-400);
  font-family: var(--font-mono);
  font-weight: 400;
}

.post-body li::marker {
  color: var(--amaranth-400);
}

.post-body blockquote {
  margin: 1.75rem 0;
  padding: 0.85rem 1.25rem;
  border-left: 3px solid var(--dark-amaranth);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: linear-gradient(90deg, hsla(340, 79%, 25%, 0.18), transparent);
  color: var(--heading);
  font-style: italic;
}

.post-body blockquote p:last-child {
  margin-bottom: 0;
}

.post-footer {
  margin-top: 3.5rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.post-footer .back-link {
  margin-bottom: 0;
}

/* ---------- Code ---------- */

code,
kbd,
pre {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

/* Inline code */
:not(pre) > code {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--soft-linen);
  padding: 0.08em 0.4em;
  border-radius: 4px;
  overflow-wrap: anywhere;
}

/* Code block: <figure class="code-block"> wrapping <figcaption> + <pre><code> */
.code-block {
  margin: 1.0rem 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-sunk);
  border: 1px solid var(--border);
  box-shadow: 0 12px 32px -18px hsla(216, 45%, 1%, 0.95);
}

.code-block figcaption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.code-block .lang {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  color: var(--soft-linen);
  padding: 0 0.5rem;
  border-radius: 4px;
  background: var(--accent-fill);
}

.code-block pre {
  margin: 0;
  padding: 0.25rem 1.1rem; /* top, bottom | left, right */
  overflow-x: auto;
  line-height: 1.3;
  color: var(--soft-linen);
  tab-size: 4; /* 4 space supremacy */
  scrollbar-color: var(--border-strong) transparent;
}

.code-block pre code {
  font-size: 0.8rem;
  user-select: all; /* probably won't work in Safari */
}
