:root{
  --bg:   #080a09;
  --bg2:  #10130f;
  --fg:   #d8ded9;
  --dim:  #7f8982;
  --line: #1d241f;
  --accent: #a6e3a1;
  --accent-strong: #b5e8ae; /* hover/prompt emphasis only, not for bulk syntax coloring */
  --shadow: rgba(0, 0, 0, 0.35); /* pre block shadow only */
  --font-smoothing: antialiased; /* correct for light-on-dark text */
}

/* --- latte theme (Catppuccin Latte adaptation) ---
   Same 8 variables as :root, nothing else. Every rule in this file
   already goes through these variables, so overriding them here is
   the entire light-theme implementation - deliberately not a second
   stylesheet. Kept restrained/single-accent on purpose, matching the
   dark theme's philosophy - not a full Catppuccin showcase. */
html[data-theme="latte"]{
  --bg:   #eff1f5; /* Catppuccin Latte base */
  --bg2:  #e6e9ef; /* Catppuccin Latte mantle */
  --fg:   #4c4f69; /* Catppuccin Latte text */
  --dim:  #6c6f85; /* Catppuccin Latte subtext0 */
  --line: #ccd0da; /* Catppuccin Latte surface0 */
  --accent: #40a02b; /* Catppuccin Latte green */
  --accent-strong: #2d7d1f; /* darkened green for hover/focus - light
    backgrounds read "stronger" as darker, not lighter, unlike dark */
  --shadow: rgba(76, 79, 105, 0.14); /* tinted with --fg's hue instead
    of pure black, which reads as muddy on a light background */
  --font-smoothing: auto; /* "antialiased" thins dark-on-light text and
    was making body copy read as washed out; default rendering keeps
    the same #4c4f69/#6c6f85 values (already correct, unchanged) but
    with the intended weight against a light background */
}

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

html{ background:var(--bg); }

/* --- Liberation Mono (self-hosted) ---
   Source: Debian/Ubuntu package fonts-liberation, converted to WOFF2
   locally. No external CDN reference. Only Regular/Bold/Italic exist
   for this family (no Medium/SemiBold) - font-weight:500 in this
   stylesheet falls back to the Regular (400) face, which is correct. */
@font-face{
  font-family: "Liberation Mono";
  src: url("/fonts/LiberationMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face{
  font-family: "Liberation Mono";
  src: url("/fonts/LiberationMono-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face{
  font-family: "Liberation Mono";
  src: url("/fonts/LiberationMono-Italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

body{
  background:var(--bg);
  color:var(--fg);
  font-family:
    "Liberation Mono",
    ui-monospace,
    SFMono-Regular,
    Menlo,
    Monaco,
    Consolas,
    "Courier New",
    monospace;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: var(--font-smoothing);
  /* Disable programming ligatures so -> != == => render as literal
     characters, not typographic symbols. */
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0, "calt" 0;
}

.col{
  max-width: 768px; /* 720px reading column + 24px padding each side (box-sizing: border-box) */
  margin: 0 auto;
  padding: 11.5vh 24px 10vh;
  overflow-wrap: break-word;
}

.dim{ color: var(--dim); }

hr{
  border: none;
  border-top: 1px solid var(--line);
  width: 40px;
  margin: 0;
}

a{ color: inherit; }

/* --- hero (homepage) --- */

.hero{ margin-bottom: 8vh; position: relative; }

.prompt{
  font-size: 13.5px;
  color: var(--dim);
  margin-bottom: 16px;
}

.prompt a{
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}
.prompt a:hover,
.prompt a:focus-visible{
  color: var(--accent-strong);
}
.prompt a:focus-visible{
  outline: 1px solid var(--accent-strong);
  outline-offset: 2px;
  border-radius: 2px;
}

h1{
  font-size: 33px;
  font-weight: 500;
  letter-spacing: 0.015em;
  display:flex;
  align-items:baseline;
  gap: 2px;
}

/* Homepage-only first-visit intro (see layouts/index.html). Absolutely
   positioned over .hero-real, which stays in normal flow but invisible
   (visibility, not display) so its space is reserved throughout - the
   swap between the two is instant with zero layout shift either way.
   Hidden by default (no JS / reduced motion / already seen: this rule
   never applies, .hero-real is simply shown normally). */
.terminal-intro{
  display: none;
}
html.intro-pending .terminal-intro{
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
}
html.intro-pending .hero-real{
  visibility: hidden;
}
.terminal-intro.intro-fade-out{
  opacity: 0;
  transition: opacity 0.15s ease;
}
#intro-cmd{
  color: var(--fg);
}
.intro-result{
  font-size: 33px;
  font-weight: 500;
  letter-spacing: 0.015em;
  display:flex;
  align-items:baseline;
  gap: 2px;
}

.cursor{
  display:inline-block;
  width: 10px;
  height: 20px;
  background: var(--accent);
  margin-left: 4px;
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink{
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.tagline{
  color: var(--dim);
  font-size: 14.5px;
  margin-top: 10px;
}

/* --- hero (secondary pages: /notes/) --- */

.hero-small{ margin-bottom: 6vh; }
.hero-small h1.h2{
  font-size: 20px;
  font-weight: 500;
  margin-top: 8px;
  letter-spacing: 0.01em;
}

/* --- sections (homepage) --- */

section{ margin: 6.5vh 0; }

.tag{
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 0.04em;
  margin-bottom: 16px;
}

.tag::before{ content: "# "; color: var(--dim); }

section p{
  max-width: 58ch;
  color: var(--fg);
}

.note-list{ list-style:none; }
.note-list li{ margin: 8px 0; }
.note-list a{
  display:flex;
  gap: 18px;
  text-decoration:none;
  color: var(--fg);
}
.note-list .note-date{
  color: var(--dim);
  width: 92px;
  flex-shrink: 0;
  white-space: nowrap;
}
.note-title{ transition: color 0.15s ease; }
.note-list a:hover .note-title{
  color: var(--accent-strong);
  text-decoration: underline;
  text-decoration-color: var(--accent-strong);
  text-underline-offset: 3px;
}

.more-link{
  display:block;
  margin-top: 16px;
  color: var(--dim);
  font-size: 14px;
  text-decoration:none;
  border-bottom: 1px solid var(--line);
  width: fit-content;
}
.more-link:hover{ color: var(--accent-strong); border-color: var(--accent-strong); }

.links{ list-style:none; }
.links li{
  display:flex;
  gap: 16px;
  margin: 4px 0;
}
.links .k{
  color: var(--dim);
  width: 9ch;
  flex-shrink: 0;
}
.links a{
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}
.links a:hover{
  color: var(--accent-strong);
  border-bottom-color: var(--accent-strong);
}

/* Tag index (/tags/) renders tag names in lowercase for visual
   consistency with the rest of the site's Unix-like language, without
   changing the underlying Hugo term title/casing or URLs. */
.tag-index a{ text-transform: lowercase; }

/* --- /notes/ list ("ls" style) --- */

.year-group{ margin: 5vh 0; }
.year{
  color: var(--dim);
  font-size: 13px;
  letter-spacing: 0.04em;
  margin-bottom: 14px;
}

.ls-row{
  display:flex;
  gap: 20px;
  margin: 12px 0;
}
.ls-date{
  color: var(--dim);
  width: 46px;
  flex-shrink: 0;
  padding-top: 1px;
  white-space: nowrap;
}
.ls-body{
  display:flex;
  flex-direction:column;
  gap: 2px;
}
.ls-title{
  color: var(--fg);
  text-decoration: none;
  transition: color 0.15s ease;
  width: fit-content;
}
.ls-title:hover,
.ls-title:focus-visible{
  color: var(--accent-strong);
  text-decoration: underline;
  text-decoration-color: var(--accent-strong);
  text-underline-offset: 3px;
}
.ls-title:focus-visible{
  outline: 1px solid var(--accent-strong);
  outline-offset: 2px;
  border-radius: 2px;
}
.ls-tags{
  color: var(--dim);
  font-size: 12.5px;
}
.ls-tags a{
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}
.ls-tags a:hover,
.ls-tags a:focus-visible{
  color: var(--accent-strong);
}
.ls-tags a:focus-visible{
  outline: 1px solid var(--accent-strong);
  outline-offset: 2px;
  border-radius: 2px;
}

.back-link{
  display:inline-block;
  margin-top: 24px;
  color: var(--dim);
  font-size: 14px;
  text-decoration:none;
  border-bottom: 1px solid var(--line);
}
.back-link:hover{ color: var(--accent-strong); border-color: var(--accent-strong); }

/* --- tag term page (/tags/<tag>/) --- */

.term-heading{
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.01em;
  margin-top: 8px;
}
.term-heading::before{ content: "# "; color: var(--dim); }

/* --- single note --- */

article.note{ margin-bottom: 2vh; }

article.note h1{
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.01em;
  margin-bottom: 14px;
  display:block;
}
article.note h1::before{ content: "# "; color: var(--dim); }

.note-meta{
  display:flex;
  gap: 16px;
  color: var(--dim);
  font-size: 13px;
  margin-bottom: 6vh;
}
.note-meta .note-date-full{ white-space: nowrap; }

.note-body{ max-width: 720px; }

.note-body p{ margin: 16px 0; }

.note-body h2{
  font-size: 17px;
  font-weight: 500;
  margin: 6vh 0 14px;
  color: var(--fg);
}
.note-body h2::before{ content: "## "; color: var(--dim); }

.note-body h3{
  font-size: 15.5px;
  font-weight: 500;
  margin: 4vh 0 12px;
  color: var(--fg);
}
.note-body h3::before{ content: "### "; color: var(--dim); }

.note-body ul,
.note-body ol{ margin: 16px 0 16px 22px; }
.note-body li{ margin: 4px 0; }

.note-body a{
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}
.note-body a:hover{ color: var(--accent-strong); border-bottom-color: var(--accent-strong); }

/* --- images / figures --- */

.note-body p:has(> .note-figure){ display: contents; }

.note-figure{
  display: block;
  margin: 5vh auto;
  max-width: 100%;
}
/* On viewports with room for it, figures may render wider than the
   720px prose column (up to ~920px), centered on the viewport rather
   than the prose column - editorial breathing room for images without
   affecting text width. Narrow viewports keep the contained behavior
   above (no horizontal escape, avoids touching the screen edge). */
@media (min-width: 900px){
  .note-figure{
    width: 100vw;
    max-width: 920px;
    margin-left: 50%;
    transform: translateX(-50%);
  }
}
.note-figure img{
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  margin: 0 auto;
  border: 1px solid var(--line);
}
.note-figure figcaption{
  display: block;
  margin-top: 10px;
  color: var(--dim);
  font-size: 12.5px;
  text-align: center;
}

/* --- code --- */

.note-body p code,
.note-body li code{
  background: var(--bg2);
  border: 1px solid var(--line);
  padding: 1px 5px;
  font-size: 0.9em;
}

/* Technical blocks (shell/config/output) sit at the SAME width as prose
   (.note-body, ~720px) - no intrinsic/fit-content sizing. A short block
   like "WAN / LAN / DMZ" reads as a normal paragraph-width block, not a
   floating widget. Content stays left-aligned; this is a deliberate
   editorial choice (code as part of the reading flow), not a UI
   component system. */
pre{
  background: var(--bg2);
  border: 1px solid var(--line);
  box-shadow: 0 2px 6px var(--shadow);
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  margin: 5vh 0;
  font-size: 14px;
  line-height: 1.6;
}
pre code{ background: none; border: none; padding: 0; }

/* ASCII/network diagrams stay the SAME width as every other block
   (the 720px reading column) - no breakout. Only their content is
   centered inside that column, everything else stays left-aligned. */
pre code.language-diagram{
  display: block;
  text-align: center;
}

.chroma{ color: var(--fg); background: transparent; }
.chroma .c, .chroma .c1, .chroma .cm, .chroma .cp{ color: var(--dim); font-style: italic; }
.chroma .k, .chroma .kd, .chroma .kn, .chroma .kr, .chroma .kt,
.chroma .s, .chroma .s1, .chroma .s2, .chroma .sb, .chroma .se{ color: var(--accent); }
.chroma .nf, .chroma .nb, .chroma .nc, .chroma .nd{ color: var(--fg); }
.chroma .o, .chroma .p{ color: var(--dim); }
.chroma .mi, .chroma .mf, .chroma .m{ color: var(--fg); }
.chroma .gh{ color: var(--dim); } /* generic heading, used by some lexers for prompts */

/* Shell commands get a "$ " prompt marker on the first line, in accent
   green (same role as any other path/prompt on the site) - the command
   text itself stays main-text color, not tinted green, so the accent
   reads as a deliberate marker rather than a wash over everything. */
pre code.language-bash > .line:first-of-type::before,
pre code.language-sh > .line:first-of-type::before{
  content: "$ ";
  color: var(--accent-strong);
}

/* --- footer --- */

footer{
  margin-top: 10vh;
  display:flex;
  justify-content: space-between;
  color: var(--dim);
  font-size: 12px;
}

.theme-toggle{
  display:flex;
  align-items:baseline;
  gap: 6px;
}
.theme-toggle button{
  font: inherit;
  color: var(--fg);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  transition: color 0.15s ease;
}
.theme-toggle button:hover,
.theme-toggle button:focus-visible{
  color: var(--accent-strong);
  border-bottom-color: var(--accent-strong);
}
.theme-toggle button:focus-visible{
  outline: 1px solid var(--accent-strong);
  outline-offset: 2px;
  border-radius: 2px;
}

/* --- responsive --- */

@media (max-width: 480px){
  .col{ padding: 8vh 20px 7vh; }
  h1{ font-size: 27px; }
  .hero{ margin-bottom: 6.5vh; }
  section{ margin: 5vh 0; }
  article.note h1{ font-size: 19px; }
  .note-meta{ margin-bottom: 5vh; }
  .ls-row{ gap: 14px; }
  pre{ padding: 14px 16px; font-size: 13px; }
  footer{ flex-wrap: wrap; row-gap: 6px; }
}
