/*
  Pseudopod stylesheet entry (generated).
  Edit files under assets/css/, then: npm run build:css
  File map: docs/css-architecture.md
*/

@layer reset, tokens, base, layout, components, utilities, overrides;

/* ← css/01-reset/reset.css */
@layer reset {
/* reset — element normalization */

}

/* ← css/02-tokens/tokens.css */
@layer tokens {
/* tokens — custom properties on :root */

:root {
    --color-green-50: oklch(98.2% 0.018 155.826);
    --color-green-100: oklch(96.2% 0.044 156.743);
    --color-green-200: oklch(92.5% 0.084 155.995);
    --color-green-300: oklch(87.1% 0.15 154.449);
    --color-green-400: oklch(79.2% 0.209 151.711);
    --color-green-500: oklch(72.3% 0.219 149.579);
    --color-green-600: oklch(62.7% 0.194 149.214);
    --color-green-700: oklch(52.7% 0.154 150.069);
    --color-green-800: oklch(44.8% 0.119 151.328);
    --color-green-900: oklch(39.3% 0.095 152.535);
    --color-green-950: oklch(26.6% 0.065 152.934);
    --color-green-1000: oklch(20.0% 0.045 152.934);

    --color-yellow-50: oklch(98.7% 0.026 102.212);
    --color-yellow-100: oklch(97.3% 0.071 103.193);
    --color-yellow-200: oklch(94.5% 0.129 101.54);
    --color-yellow-300: oklch(90.5% 0.182 98.111);
    --color-yellow-400: oklch(85.2% 0.199 91.936);
    --color-yellow-500: oklch(79.5% 0.184 86.047);
    --color-yellow-600: oklch(68.1% 0.162 75.834);
    --color-yellow-700: oklch(55.4% 0.135 66.442);
    --color-yellow-800: oklch(47.6% 0.114 61.907);
    --color-yellow-900: oklch(42.1% 0.095 57.708);
    --color-yellow-950: oklch(28.6% 0.066 53.813);

    --color-pink-50: oklch(97.1% 0.014 343.198);
    --color-pink-100: oklch(94.8% 0.028 342.258);
    --color-pink-200: oklch(89.9% 0.061 343.231);
    --color-pink-300: oklch(82.3% 0.12 346.018);
    --color-pink-400: oklch(71.8% 0.202 349.761);
    --color-pink-500: oklch(65.6% 0.241 354.308);
    --color-pink-600: oklch(59.2% 0.249 0.584);
    --color-pink-700: oklch(52.5% 0.223 3.958);
    --color-pink-800: oklch(45.9% 0.187 3.815);
    --color-pink-900: oklch(40.8% 0.153 2.432);
    --color-pink-950: oklch(28.4% 0.109 3.907);

    --color-red-50: oklch(97.1% 0.013 17.38);
    --color-red-100: oklch(93.6% 0.032 17.717);
    --color-red-200: oklch(88.5% 0.062 18.334);
    --color-red-300: oklch(80.8% 0.114 19.571);
    --color-red-400: oklch(70.4% 0.191 22.216);
    --color-red-500: oklch(63.7% 0.237 25.331);
    --color-red-600: oklch(57.7% 0.245 27.325);
    --color-red-700: oklch(50.5% 0.213 27.518);
    --color-red-800: oklch(44.4% 0.177 26.899);
    --color-red-900: oklch(39.6% 0.141 25.723);
    --color-red-950: oklch(25.8% 0.092 26.042);

    --color-blue-50: oklch(97% 0.014 254.604);
    --color-blue-100: oklch(93.2% 0.032 255.585);
    --color-blue-200: oklch(88.2% 0.059 254.128);
    --color-blue-300: oklch(80.9% 0.105 251.813);
    --color-blue-400: oklch(70.7% 0.165 254.624);
    --color-blue-500: oklch(62.3% 0.214 259.815);
    --color-blue-600: oklch(54.6% 0.245 262.881);
    --color-blue-700: oklch(48.8% 0.243 264.376);
    --color-blue-800: oklch(42.4% 0.199 265.638);
    --color-blue-900: oklch(37.9% 0.146 265.522);
    --color-blue-950: oklch(28.2% 0.091 267.935);

    /* Light mode (disabled). To restore: uncomment these, wrap the dark
       semantic tokens below in @media (prefers-color-scheme: dark) { :root { … } },
       and set html { color-scheme: light dark; } in base.css.
    --color-bg: var(--color-green-50);
    --color-fg: var(--color-green-950);
    --color-border: rgba(0,0,0,0.10);
    --color-accent: var(--color-pink-700);
    --color-accent-lighter: var(--color-pink-600);
    --color-link: var(--color-yellow-600);
    --color-link-hover: var(--color-yellow-400);
    --color-link-visited: var(--color-pink-600);
    --color-link-visited-hover: var(--color-pink-400);
    --color-heading-link: var(--color-blue-800);
    --font-h1-wght-delta: 100;
    */

    /* Dark mode — always on while light mode is disabled */
    --color-bg: var(--color-green-1000);
    --color-fg: var(--color-green-50);
    --color-border: rgba(255,255,255,0.25);
    --color-accent: var(--color-pink-400);
    --color-accent-lighter: var(--color-pink-300);
    --color-link: var(--color-yellow-300);
    --color-link-hover: var(--color-yellow-500);
    --color-link-visited: var(--color-pink-300);
    --color-link-visited-hover: var(--color-pink-500);
    --color-heading-link: var(--color-blue-300);
    --font-h1-wght-delta: 0;

    --measure: 65ch;
    --space-s: 1rem;
    --space-m: 2rem;
    --space-l: 4rem;
    --font-body: "acumin-variable", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-h1: "HEX Franklin", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --gh-font-heading: var(--font-h1);
    --gh-font-body: var(--font-body);
}

}

/* ← css/03-base/base.css */
@layer base {
/* base — element defaults (body, headings, links, focus) */

@font-face {
    font-family: "HEX Franklin";
    src: url("css/HEX_Franklin_v0.3_Variable.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

html {
    /* Light mode disabled — was: color-scheme: light dark; */
    color-scheme: dark;
}

body {
    background-color: var(--color-bg);
    color: var(--color-fg);
    font-family: var(--font-body);
    font-weight: 400;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--color-fg);
}

h1, h2, h3 {
    font-family: var(--font-h1);
    font-weight: calc(700 + var(--font-h1-wght-delta));
}

a {
    color: var(--color-link);
    text-decoration: underline;
}

/*
a:hover {
    color: var(--color-link-hover);
}

a:visited {
    color: var(--color-link-visited);
}*/

a:visited:hover {
    color: var(--color-link-visited-hover);
}

}

/* ← css/04-layout/layout.css */
@layer layout {
/* layout — composition primitives (stack, cluster, shell, measure) */
.container {
  max-width: var(--measure);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-s);
  padding-right: var(--space-s);
}

}

/* ← css/05-components/header.css */
@layer components {
/* header — site header / nav */
.header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem 1.5rem;
  padding: 0.75rem 1rem;
  opacity: 0.85;
}

.header nav {
  flex: 1 1 auto;
  min-width: min(100%, 20rem);
}

.header nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.25rem 1rem;
}

.header nav a {
  font-family: var(--font-h1);
  font-size: 0.875rem;
  font-variation-settings: "wght" calc(500 + var(--font-h1-wght-delta));
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  padding-left: 0.15rem;
  padding-right: 0.15rem;
}

.header a {
  color: var(--color-fg);
  text-decoration: none;
}

.site-logo {
  display: block;
  line-height: 0;
  color: var(--color-fg);
  flex: 0 1 auto;
}

.site-logo-mark {
  display: block;
  height: 2.5rem;
  width: auto;
  max-width: 100%;
}

.header a:hover {
  color: var(--color-accent);
}

@media (max-width: 40rem) {
  .header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    padding-top: 0.75rem;
    padding-bottom: 0.5rem;
  }

  .site-logo {
    align-self: flex-start;
  }

  .site-logo-mark {
    height: 2rem;
  }

  .header nav {
    min-width: 0;
  }

  .header nav ul {
    justify-content: flex-start;
  }

  .header nav a {
    font-size: 0.8125rem;
    min-height: 2.75rem;
  }
}

}

/* ← css/05-components/post.css */
@layer components {
/* post — feed items and single-post chrome */

/* Shell */

.post {
    line-height: 1.5;
    opacity: 0.85;

    blockquote {
        margin: 0;
        padding: 1rem;
        border-left: 0.5rem solid var(--color-accent);
    }
}

/* Day chrome */

.post-feed .post {
    padding-bottom: 1rem;
}

.post-day {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0;
    font-size: 1.125rem;
    font-variation-settings: "wght" calc(600 + var(--font-h1-wght-delta));
    text-align: center;

    &::before,
    &::after {
        content: "";
        flex: 1 1 0;
        border-top: 1px solid var(--color-border);
    }
}

.post-continued {
    border-top: 1px solid var(--color-border);

    .post-day {
        display: none;
    }
}

/* Entry */

.post-entry {
    h1,
    h2 {
        font-size: 1.5rem;
        line-height: 1;
        letter-spacing: -0.01em;
        margin-bottom: 0.75rem;
    }

    h1 a,
    h2 a {
        text-decoration: none;
        color: var(--color-heading-link);

        &:hover {
            text-decoration: underline;
        }
    }

    .post-content p:first-of-type {
        margin: 0;
    }

    [data-more] {
        display: none;
    }
}

.post-excerpt {
    margin-bottom: 1rem;
}

.post-continue {
    scroll-margin-top: 2rem;
}

/* Read more — feed cutoff; single hide is above under .post-entry */

.post-feed .post-content {
    [data-more] {
        display: inline-block;

        &::after {
            content: 'Read more →';
        }

        ~ * {
            display: none;
        }
    }

    .post-read-more {
        display: inline-block;
        margin-top: 1em;
        text-decoration: none;

        &:hover {
            text-decoration: underline;
        }
    }
}

/* Link */

.post-lead {
    margin-bottom: 1rem;
}

.post-outbound {
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
    color: var(--color-heading-link);
    font-family: var(--font-h1);
    font-variation-settings: "wght" calc(500 + var(--font-h1-wght-delta));
    font-weight: 700;
    text-decoration: none;
    text-transform: uppercase;

    &:hover {
        text-decoration: underline;
    }
}

/* Bookmark captures: hostname in the body, not a title-case heading */
.post-outbound-url {
    font-family: inherit;
    font-variation-settings: normal;
    font-weight: inherit;
    text-transform: none;
}

.post-outbound-icon {
    width: 0.85em;
    height: 0.85em;
    flex-shrink: 0;
    stroke-width: 2.5;
}

/* Meta */

.post-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.875rem;
    margin-top: 1rem;

    a {
        text-decoration: none;
        color: var(--color-fg);

        &:hover {
            text-decoration: underline;
        }

        svg {
            stroke: var(--color-accent);
        }
    }

    .post-tags a {
        border: 1px solid var(--color-border);
        color: var(--color-fg);
        padding: 0.25em 0.5em;
        border-radius: 0.25em;
    }
}

.post-meta-primary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35em;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35em;
}

.post-permalink {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    text-decoration: none;

    &:hover {
        text-decoration: none;
    }

    svg {
        width: 20px;
        height: 20px;
    }
}

/* Page title */

.post-feed-heading {
    font-size: 1.5rem;
    font-weight: calc(600 + var(--font-h1-wght-delta));
    margin-top: 2rem;
    margin-bottom: 1rem;
    text-align: center;
}

}

/* ← css/05-components/archive.css */
@layer components {
/* archive — year / month grouping via adjacent-sibling selectors (Darnes) */

.archive-list {
  margin-top: var(--space-m, 2rem);
  margin-bottom: var(--space-m, 2rem);
}

.archive-item {
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  column-gap: 1rem;
}

.archive-item .archive-year,
.archive-item .archive-month {
  grid-column: 1 / -1;
}

.archive-item .archive-year {
  margin: var(--space-l, 4rem) 0 var(--space-m, 2rem);
  font-size: 2rem;
  letter-spacing: 0.02em;
  border-bottom: 1px solid color-mix(in srgb, var(--color-fg) 20%, transparent);
  padding-bottom: 0.35rem;
}

.archive-item:first-child .archive-year {
  margin-top: 0;
}

.archive-item .archive-month {
  margin: var(--space-m, 2rem) 0 var(--space-s, 1rem);
  font-size: 1.1rem;
  font-weight: calc(600 + var(--font-h1-wght-delta));
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.7;
}

.archive-post {
  display: contents;
}

.archive-post time {
  font-variant-numeric: tabular-nums;
  opacity: 0.55;
  text-align: right;
}

.archive-post a {
  text-decoration: none;
  padding-top: 0.2rem;
  padding-bottom: 0.2rem;
}

.archive-post a:hover {
  text-decoration: underline;
}

/* Hide duplicate year headings when the previous item shares the year */
.archive-y-2005 + .archive-y-2005 .archive-year,
.archive-y-2006 + .archive-y-2006 .archive-year,
.archive-y-2007 + .archive-y-2007 .archive-year,
.archive-y-2008 + .archive-y-2008 .archive-year,
.archive-y-2009 + .archive-y-2009 .archive-year,
.archive-y-2010 + .archive-y-2010 .archive-year,
.archive-y-2011 + .archive-y-2011 .archive-year,
.archive-y-2012 + .archive-y-2012 .archive-year,
.archive-y-2013 + .archive-y-2013 .archive-year,
.archive-y-2014 + .archive-y-2014 .archive-year,
.archive-y-2015 + .archive-y-2015 .archive-year,
.archive-y-2016 + .archive-y-2016 .archive-year,
.archive-y-2017 + .archive-y-2017 .archive-year,
.archive-y-2018 + .archive-y-2018 .archive-year,
.archive-y-2019 + .archive-y-2019 .archive-year,
.archive-y-2020 + .archive-y-2020 .archive-year,
.archive-y-2021 + .archive-y-2021 .archive-year,
.archive-y-2022 + .archive-y-2022 .archive-year,
.archive-y-2023 + .archive-y-2023 .archive-year,
.archive-y-2024 + .archive-y-2024 .archive-year,
.archive-y-2025 + .archive-y-2025 .archive-year,
.archive-y-2026 + .archive-y-2026 .archive-year,
.archive-y-2027 + .archive-y-2027 .archive-year,
.archive-y-2028 + .archive-y-2028 .archive-year,
.archive-y-2029 + .archive-y-2029 .archive-year,
.archive-y-2030 + .archive-y-2030 .archive-year {
  display: none;
}

/* Hide duplicate month headings when the previous item shares the month */
.archive-m-1 + .archive-m-1 .archive-month,
.archive-m-2 + .archive-m-2 .archive-month,
.archive-m-3 + .archive-m-3 .archive-month,
.archive-m-4 + .archive-m-4 .archive-month,
.archive-m-5 + .archive-m-5 .archive-month,
.archive-m-6 + .archive-m-6 .archive-month,
.archive-m-7 + .archive-m-7 .archive-month,
.archive-m-8 + .archive-m-8 .archive-month,
.archive-m-9 + .archive-m-9 .archive-month,
.archive-m-10 + .archive-m-10 .archive-month,
.archive-m-11 + .archive-m-11 .archive-month,
.archive-m-12 + .archive-m-12 .archive-month {
  display: none;
}

/* Archive channel pages (archive-year.hbs, archive-month.hbs) */

.archive-heading {
  font-size: 1.5rem;
  font-weight: calc(600 + var(--font-h1-wght-delta));
  margin-top: 2rem;
  margin-bottom: 1rem;
  text-align: center;
}

}

/* ← css/05-components/stats.css */
@layer components {
/* stats — contribution graph, streaks, on this day */

.stats {
  margin-top: var(--space-m);
  margin-bottom: var(--space-l);
}

.stats-header h1 {
  margin: 0 0 0.35rem;
}

.stats-lede {
  margin: 0 0 var(--space-m);
  opacity: 0.75;
  max-width: 40ch;
}

.stats-status {
  margin: 0 0 var(--space-m);
  opacity: 0.7;
}

.stats-status-error {
  color: var(--color-red-400);
  opacity: 1;
}

.stats-streaks {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-s);
  margin-bottom: var(--space-m);
  padding-bottom: var(--space-m);
  border-bottom: 1px solid var(--color-border);
}

.stats-streak-value {
  margin: 0;
  font-family: var(--font-h1);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: calc(700 + var(--font-h1-wght-delta));
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.stats-streak-label {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.65;
}

.stats-section-title {
  margin: 0 0 var(--space-s);
  font-size: 1.15rem;
  font-weight: calc(600 + var(--font-h1-wght-delta));
  letter-spacing: 0.03em;
  text-transform: uppercase;
  opacity: 0.8;
}

.stats-graph-section {
  margin-bottom: var(--space-l);
}

.stats-graph-wrap {
  overflow-x: auto;
  padding-bottom: 0.35rem;
}

.stats-graph {
  display: flex;
  gap: 0.4rem;
  min-width: min-content;
  align-items: start;
}

.stats-graph-labels {
  display: grid;
  grid-template-rows: repeat(7, 11px);
  gap: 3px;
  padding-top: 0;
  margin-right: 0.15rem;
}

.stats-graph-label {
  font-size: 9px;
  line-height: 11px;
  opacity: 0.55;
  font-variant-numeric: tabular-nums;
}

.stats-graph-grid {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: 1fr;
  gap: 3px;
}

.stats-graph-week {
  display: grid;
  grid-template-rows: repeat(7, 11px);
  gap: 3px;
}

.stats-cell {
  width: 11px;
  height: 11px;
  border: 0;
  padding: 0;
  border-radius: 2px;
  background: color-mix(in oklch, var(--color-fg) 8%, transparent);
  cursor: pointer;
  display: block;
}

.stats-cell:disabled,
.stats-cell-empty {
  visibility: hidden;
  cursor: default;
}

.stats-cell.level-1 {
  background: var(--color-green-800);
}

.stats-cell.level-2 {
  background: var(--color-green-600);
}

.stats-cell.level-3 {
  background: var(--color-green-400);
}

.stats-cell.level-4 {
  background: var(--color-green-200);
}

.stats-cell:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
}

.stats-cell-selected {
  outline: 1px solid var(--color-fg);
  outline-offset: 1px;
}

.stats-legend {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.65rem;
  font-size: 0.75rem;
  opacity: 0.65;
}

.stats-legend .stats-cell {
  cursor: default;
  pointer-events: none;
}

.stats-day-detail {
  margin: var(--space-s) 0 0;
  font-size: 0.95rem;
  line-height: 1.45;
}

.stats-day-detail strong {
  font-weight: calc(600 + var(--font-h1-wght-delta));
}

.stats-on-this-day-meta {
  margin: 0 0 var(--space-s);
  opacity: 0.7;
}

.stats-on-this-day-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.stats-on-this-day-item {
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  gap: 0.75rem;
  align-items: baseline;
}

.stats-on-this-day-item time {
  font-variant-numeric: tabular-nums;
  opacity: 0.55;
  text-align: right;
}

.stats-on-this-day-item a {
  text-decoration: none;
}

.stats-on-this-day-item a:hover {
  text-decoration: underline;
}

@media (max-width: 720px) {
  .stats-streaks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem 1rem;
  }
}

@media (max-width: 520px) {

  .stats-graph-labels {
    grid-template-rows: repeat(7, 10px);
  }

  .stats-graph-week {
    grid-template-rows: repeat(7, 10px);
  }

  .stats-cell {
    width: 10px;
    height: 10px;
  }
}

}

/* ← css/05-components/pagination.css */
@layer components {
/* pagination — feed / archive page nav */

.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.75rem 1.25rem;
    margin-top: var(--space-m);
    margin-bottom: var(--space-m);
    padding-left: 1rem;
    padding-right: 1rem;
    font-size: 0.875rem;
    text-align: center;
}

.pagination a {
    text-decoration: none;
}

.pagination a:hover {
    text-decoration: underline;
}

}

/* ← css/05-components/cards.css */
@layer components {
/* Ghost Koenig card helpers. Keep kg-* quirks here. */

/*
  Cards render as <figure class="kg-card">. The UA stylesheet gives
  figures 40px inline margins, so cards sit narrower than post text.
*/
.kg-card {
    margin-left: 0;
    margin-right: 0;
    max-width: 100%;
}

.kg-image-card img {
    display: block;
    width: 100%;
    height: auto;
}

.kg-embed-card {
    width: 100%;
}

.kg-width-wide {
    width: 100%;
}

.kg-width-full {
    width: 100vw;
    max-width: none;
    margin-left: calc(50% - 50vw);
}

}

/* ← css/06-utilities/utilities.css */
@layer utilities {
/* utilities — sparse helpers only (.sr-only, etc.) */

}

/* ← css/07-overrides/overrides.css */
@layer overrides {
/* overrides — last-resort / a11y escape hatches only */

/* X/Twitter sets inline max-width: 550px on rendered embeds. */
.kg-embed-card .twitter-tweet {
    max-width: 100% !important;
}

}
