/*
 * A Billion Fists — outer chrome.
 * Modeled on tmp/example-left-nav (Relish redesign 01), hand-written plain CSS
 * (no Tailwind on this site). Breakpoints mirror Tailwind defaults:
 * sm 640px, lg 1024px, xl 1280px.
 */

/* *****************************************
 * tokens
 * */
:root {
  font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 24px;
  font-weight: 400;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;

  /* original A Billion Fists palette */
  --primary: #AABBFF;         /* --color-blue */
  --primary-hover: #BBAAFF;   /* --color-blue-hover */
  --secondary: #BBFFAA;       /* --color-green */
  --secondary-hover: #AAFFBB; /* --color-green-hover */
  --tertiary: #FFAABB;        /* --color-pink */
  --tertiary-hover: #FFBBAA;  /* --color-pink-hover */
  --offwhite: #fafaf9;
  --dark: #1c1917;   /* stone-900 */
  --light: #f5f5f4;  /* stone-100 */

  --grays-100: #f5f5f4;
  --grays-200: #e7e5e4;
  --grays-300: #d6d3d1;
  --grays-400: #a8a29e;
  --grays-500: #78716c;
  --grays-600: #57534e;
  --grays-700: #44403c;
  --grays-800: #292524;
  --grays-900: #1c1917;

  /* sizes */
  --size--1: clamp(0.825rem, 0.787rem + 0.203vw, 1rem);
  --size-0: clamp(1rem, 0.882rem + 0.588vw, 1.5rem);
  --size-1: clamp(1.25rem, 1.074rem + 0.882vw, 2rem);
  --size-2: clamp(1.5rem, 1.324rem + 0.882vw, 2.25rem);
  --size-3: clamp(1.75rem, 1.574rem + 0.882vw, 2.5rem);
  --size-4: clamp(2rem, 1.824rem + 0.882vw, 2.75rem);
  --size-5: clamp(2.25rem, 2.074rem + 0.882vw, 3rem);
  --size-6: clamp(2.5rem, 2.324rem + 0.882vw, 3.25rem);
  --size-7: clamp(2.75rem, 2.574rem + 0.882vw, 3.5rem);
  --size-8: clamp(3rem, 2.824rem + 0.882vw, 3.75rem);
  --size-9: clamp(3.25rem, 3.074rem + 0.882vw, 4rem);
  --size-lg: 20px;
  --size-md: 18px;
  --size-sm: 16px;
  --size-xs: 14px;
  --img-article-offset: clamp(-2.25rem, -2.074rem + -0.882vw, -3rem);
  --header-height: 80px;
  --nav-width: 25%;
  --nav-min-width: 300px;
  --content-max-width: 1200px;
  --title-max-width: 100ch;

  /* fonts */
  --font-family-serif: georgia, "times new roman", times, serif;
  --font-family-sans-serif: "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  --font-family-heavy: sans-serif;
  --font-section-heading-size: clamp(2rem, 1.059rem + 4.706vw, 6rem);
  --font-title-heading-size: clamp(1.8rem, 1.282rem + 2.588vw, 4rem);
  --font-title-heading-entries-size: calc(var(--size-2) * 0.9);
  --font-body-size: clamp(1rem, 0.882rem + 0.588vw, 1.5rem);
  --font-weight-light: 300;

  --font-size-nav: var(--size--1);

  --kerning-tight: -1px;
  --kerning-normal: 0;
  --kerning-loose: 1px;

  /* semantic (light) */
  --bg-body: var(--offwhite);
  --fg-body: var(--grays-900);
  --bg-header: rgb(214 211 209 / 0.6);
  --bg-header-cell: var(--grays-300);
  --bg-nav: var(--grays-300);
  --bg-footer: var(--grays-100);
  --border-color: var(--grays-400);
  --nav-hover-bg: var(--offwhite);
  --nav-hover-fg: black;
  --nav-current-bg: var(--offwhite);
  --nav-current-fg: black;
  --link-color: color-mix(in oklab, var(--primary) 45%, black);
  --prose-fg: var(--grays-900);
}

.dark {
  color-scheme: dark;

  --bg-body: black;
  --fg-body: var(--grays-200);
  --bg-header: rgb(41 37 36 / 0.7);
  --bg-header-cell: var(--grays-800);
  --bg-nav: var(--grays-800);
  --bg-footer: var(--grays-900);
  --border-color: var(--grays-700);
  --nav-hover-bg: black;
  --nav-hover-fg: white;
  --nav-current-bg: black;
  --nav-current-fg: white;
  --link-color: var(--secondary);
  --prose-fg: var(--grays-200);
}

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

body,
h1, h2, h3, h4, h5, h6,
p, figure, blockquote,
ul, ol,
dl, dd {
  margin: 0;
}

ul, ol {
  padding: 0;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

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

body {
  min-height: 100vh;
  background: var(--bg-body);
  color: var(--fg-body);
}

/* *****************************************
 * wrapping grid layout
 * */
.wrap {
  transition: all 0.2s ease-in-out;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.wrap > .site-main {
  flex-grow: 1;
  z-index: 1;
  padding-top: var(--header-height);
}

@media (min-width: 1280px) {
  .wrap {
    display: grid;
    grid-template-areas:
      "b c c"
      "b d d";
    grid-template-rows: auto 1fr;
    grid-template-columns: 25% 75%;
  }

  .wrap > .site-nav {
    grid-area: b;
  }

  .wrap > .site-main {
    grid-area: c;
    border-right: 1px solid var(--border-color);
  }

  .wrap > .site-footer {
    grid-area: d;
    border-right: 1px solid var(--border-color);
  }
}

/* *****************************************
 * header
 * */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-header);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-color);
}

.site-header .logo {
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--header-height);
  padding: 12px 16px;
  text-decoration: none;
  color: inherit;
}

.site-header .logo-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  background: white;
  padding: 3px;
  border-radius: 9999px;
}
.dark .site-header .logo-icon {
  filter: invert(1);
}

.site-header .logo-text {
  display: flex;
  flex-direction: column;
  font-family: georgia, "times new roman", times, serif;
  font-weight: 900;
  font-size: clamp(26px, calc(19.5px + 2.031vw), 52px);
  line-height: 1.2;
  letter-spacing: -1px;
}

.header-note {
  display: none;
  flex-grow: 1;
  padding-left: 40px;
  padding-right: 40px;
  font-size: var(--size--1);
  line-height: 1.75;
}

.header-cta {
  display: none;
  margin-left: auto;
  margin-right: 12px;
}

@media (min-width: 640px) {
  .header-cta {
    display: inline-block;
  }
}

@media (min-width: 1024px) {
  .header-note {
    display: block;
    text-align: right;
  }
}

.nav-toggle {
  display: block;
  padding: 12px;
  min-width: 60px;
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

@media (min-width: 1280px) {
  .site-header .logo {
    width: var(--nav-width);
    min-width: var(--nav-min-width);
    justify-content: center;
    background: var(--bg-header-cell);
    border-right: 1px solid var(--border-color);
  }

  .nav-toggle {
    display: none;
  }
}

/* *****************************************
 * side nav
 * */
.site-nav {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  width: min(320px, 85vw);
  overflow-y: auto;
  background: var(--bg-nav);
  background-image: url(/assets/images/fist-white.svg);
  background-position: center bottom;
  background-repeat: no-repeat;
  background-size: 50%;
  border-left: 1px solid var(--border-color);
  padding-top: calc(var(--header-height) + var(--size-lg));
  transform: translateX(0);
  transition: transform 0.2s ease-in-out;

}
.dark .site-nav {
  background-image: url(/assets/images/fist.svg);
}

body.nav-collapsed .site-nav {
  transform: translateX(100%);
}

.menu {
  list-style: none;
  width: 100%;
}

.menu .menu-item a {
  display: block;
  padding: 4px 12px;
  margin-bottom: 8px;
  font-weight: 700;
  color: inherit;
  text-decoration: none;
  transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
}

.menu .menu-item a:hover {
  background: var(--nav-hover-bg);
  color: var(--nav-hover-fg);
}

.menu .current-menu-item > a {
  background: var(--nav-current-bg);
  color: var(--nav-current-fg);
}

.sub-menu {
  list-style: none;
}

.sub-menu .menu-item a {
  padding-left: 40px;
  font-size: 0.875rem;
  line-height: var(--size-lg);
}

.theme-toggle {
  margin-top: auto;
  margin-right: var(--size-lg);
  padding: var(--size-lg) 0;
  display: flex;
  font-size: 12px;
  line-height: 16px;
  border-top: 1px solid var(--border-color);
}

.theme-toggle > span,
.theme-toggle button {
  flex: 1 1 0;
  padding: 4px 12px;
  text-align: left;
}

.theme-toggle button {
  font: inherit;
  color: inherit;
  background: none;
  border: 1px solid var(--border-color);
  cursor: pointer;
}

.theme-toggle button:hover {
  background: var(--grays-500);
  color: white;
}

.theme-toggle button.active {
  background: var(--grays-400);
}

.dark .theme-toggle button.active {
  background: var(--grays-600);
}

@media (min-width: 1280px) {
  .site-nav,
  body.nav-collapsed .site-nav {
    left: 0;
    right: auto;
    width: auto;
    transform: translateX(0);
    border-left: none;
    border-right: 1px solid var(--border-color);
    padding-left: calc(var(--nav-width) - var(--nav-min-width));
  }

  .menu .menu-item a {
    margin-bottom: 0;
    width: var(--nav-min-width);
  }

  .sub-menu .menu-item a {
    width: var(--nav-min-width);
  }
}

/* *****************************************
 * footer
 * */
.site-footer {
  position: relative;
  background: var(--bg-footer);
  border-top: 1px solid var(--border-color);
}

.footer-inner {
  padding: var(--size-lg);
}

.footer-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  row-gap: var(--size-lg);
  padding-block: var(--size-lg);
}
.footer-cta small {
  display: block;
  font-size: var(--size-1);
}

.footer-icon {
  width: 90px;
  height: 90px;
  margin: 0 auto;
  background: white;
  padding: 3px;
  border-radius: 9999px;
}
.dark .footer-icon {
  filter: invert(1);
}

.footer-cta h2 {
  flex-basis: 100%;
  padding: 0 var(--size-lg);
  line-height: 1.1;
}

@media (min-width: 768px) {
  .footer-cta {
    align-items: flex-start;
  }
}

.text-primary {
  background: var(--primary);
  color: var(--dark);
  padding: 0 6px;
}

.dark .text-primary {
  background: transparent;
  color: var(--primary);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  margin-top: var(--size-lg);
  padding: var(--size-sm) var(--size-lg);
  font-size: 0.875rem;
}

.footer-bottom a {
  color: inherit;
}
.footer-bottom .copyright {
  align-self: end;
}

/* *****************************************
 * buttons
 * */
.btn {
  display: inline-block;
  padding: 12px 16px;
  text-align: center;
  color: var(--dark);
  font-weight: 900;
  text-decoration: none;
  text-transform: uppercase;
  line-height: 1;
  border-radius: 8px;
  white-space: nowrap;
  transition: background-color 0.3s ease-in-out, color 0.3s ease-in-out;
}

.btn:hover {
  background: var(--grays-500);
  color: white;
}

.btn-primary {
  background: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-hover);
  color: var(--dark);
}

/* *****************************************
 * typography
 * */
h1,
h2,
h3,
h4,
h5 {
  font-family: var(--font-family-serif);
  font-weight: 300;
  line-height: 1.3;
}
h1 { font-size: var(--size-6); }
h2 { font-size: var(--size-5); }
h3 { font-size: var(--size-4); }
h4 { font-size: var(--size-3); }
h5 { font-size: var(--size-2); }
h6 { font-size: var(--size-1); }

blockquote {
  font-family: var(--font-family-serif);
  font-weight: light;
  font-style: italic;
}
cite {
  text-align: right;
  font-size: smaller;
  display: block;
  font-style: normal;
}
blockquote cite {
  padding-top: var(--size-0);
  margin-top: var(--size-0);
  border-top: var(--border-size-sm) solid var(--color-gray2)
}

blockquote {
  font-family: georgia, "times new roman", times, serif;
  background: rgb(255 255 255 / 0.2);
  border: 1px solid var(--border-color);
  padding: 4px var(--size-lg);
}

.dark blockquote {
  background: rgb(28 25 23 / 0.2);
}

blockquote cite {
  display: block;
  padding-top: 12px;
  text-align: right;
  font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
  font-style: normal;
}

mark {
  background-color: transparent;
  padding: 0 2px;
  color: var(--fg-body);
}

.bg-secondary {
  background: var(--secondary);
  color: var(--dark);
}

.bg-tertiary {
  background: var(--tertiary);
  color: var(--dark);
}

.site-main a:not(.btn) {
  color: var(--fg-body);
  text-decoration: none;
  border-color: var(--primary);
  border-bottom-width: 2px;
  border-bottom-style: dotted;
}
.site-main a:not(.btn):hover,
.site-main a:not(.btn):visited:hover,
.site-main a:not(.btn):active {
  border-color: var(--tertiary);
  text-decoration: none;
}
.site-main a:not(.btn)a:visited {
  color: var(--fg-body);
}


/* *****************************************
 * page content
 * */
.title-section {
  padding: var(--size-lg);
  max-width: var(--title-max-width);
}
.title-section p {
  margin-top: var(--size-0);
  font-size: var(--size-0);
  line-height: 1.5;
}

.heading.level-1 {
  font-size: clamp(2rem, 1.059rem + 4.706vw, 4.5rem);
  line-height: 1.05;
  margin-block: 8px 12px;
}

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

/* entries grid (home, archive, art index) */
.entries-grid {
  padding: 0 var(--size-lg) var(--size-lg);
}

.entries {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.entry {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-color);
  background: color-mix(in srgb, var(--bg-body) 60%, white);
}

.dark .entry {
  background: color-mix(in srgb, var(--bg-body) 60%, var(--grays-800));
}

.entry h3 {
  font-family: var(--font-family-sans-serif);
  font-size: var(--size-1);
  line-height: 1.1;
  margin-bottom: var(--size-md);
}

.entry figure {
  order: 0;
}

.entry img {
  width: 100%;
  height: auto;
}

.entry .content {
  padding: 8px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.entry .excerpt {
  font-size: var(--size-md);
  flex-grow: 1;
  font-weight: var(--font-weight-light);
  line-height: 1.3;
}

.entry .metadata {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: auto;
  font-size: 0.75rem;
  line-height: 1.4;
}

/* home: first entry is featured, spans the full row with image beside text */
@media (min-width: 1024px) {
  .entries-big-first .entry:first-child {
    grid-column: 1 / -1;
    flex-direction: row;
    max-width: var(--content-max-width);
  }

  .entries-big-first .entry:first-child figure {
    flex: 0 1 600px;
    min-width: 0;
  }

  .entries-big-first .entry:first-child .content {
    flex: 1 1 0;
    padding: 16px 24px;
    gap: 12px;
  }
}

.entries-nextnav {
  padding: var(--size-lg) 0;
}

.entries-nextnav nav a.active {
  font-weight: 900;
}

/**************************************************************/
/* Layout: home
/**************************************************************/
.home-hero {
  padding-bottom: var(--size-2);
}
.home-hero h1 span {
  font-size: var(--size-1);
  display: block;
}
.home-hero h2 {
  text-align: right;
  font-size: var(--size-1);
}

/**************************************************************/
/* single art page */
/**************************************************************/
.page-art {
  display: grid;
  gap: var(--size-8);
  padding: var(--size-lg);
}

@media (min-width: 1024px) {
  .page-art {
    grid-template-columns: 1fr 320px;
    /*align-items: start;*/
  }
  .page-art aside {
    order: 2;
    /*position: sticky;*/
  }
  .page-art main {
    order: 1;
  }
  .page-art .aside-nav {
    margin-top: auto;
  }
}

.page-art figure::before {
  content: '\2B08';
  font-size: 12px;
  position: absolute;
  width: 15px;
  height: 15px;
  padding: 0;
  z-index: 2;
  text-align: center;
  line-height: 15px;
  vertical-align: middle;
  background-color: var(--primary);
  color: black;
}
.mission figure::before, .entry.art figure::before {
  content: '\2B05';
  transform: rotate(180deg);
  font-size: 12px;
  position: absolute;
  width: 15px;
  height: 15px;
  padding: 0;
  z-index: 2;
  text-align: center;
  line-height: 15px;
  vertical-align: middle;
  background-color: var(--primary);
  color: black;
}

.page-art aside {
  display: flex;
  flex-direction: column;
  gap: 24px;
  top: calc(var(--header-height) + var(--size-lg));
}

.aside-article {
  background: var(--bg-footer);
  border: 1px solid var(--border-color);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.aside-article h1 {
  font-size: var(--size-2);
}

.page-art .aside-nav {
  border: 1px solid var(--border-color);
  padding: var(--size-xs);
}

.aside-article .section-name {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--grays-500);
}

.aside-article .date {
  font-size: 0.875rem;
  color: var(--grays-600);
}

.nav-btt {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  margin-bottom: var(--size-2);
  font-size: var(--size--1);
}

.nav-btt a {
  display: block;
}

.nav-prevnext a {
  display: flex;
  align-items: start;
  gap: 10px;
  flex-direction: column;
  font-size: var(--size--1);
  margin-bottom: var(--size-1);
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
}
.nav-prevnext a img {
  flex-grow: 0;
  flex-shrink: 0;
}

.newswire .prose mark {
  font-style: italic;
}
.newswire .dateline {
  margin-bottom: 12px;
}

.newswire .dateline p {
  font-size: 0.875rem;
  color: var(--grays-600);
}

.newswire figure {
  margin-block: 12px;
}
.newswire figure:not(.new) {
  margin: var(--size-2) 0;
  border: 1px solid var(--border-color);
}
.newswire img {
  max-width: unset;
  width: 100%;
}
@media (min-width: 768px) {
 .newswire figure:not(.new) {
    max-width: 400px;
  }
  .newswire figure:not(.new):nth-child(2n) {
    float: right;
    margin-left: var(--size-lg);
    margin-right: var(--img-article-offset);
  }
}

.id-ego-caption {
  font-size: var(--size--1);
  padding: var(--size-xs);
  margin-top: 8px;
  max-width: 50ch;
  margin: 0 auto;
}

.id-ego-caption .section-heading {
  font-size: 1rem;
  line-height: 1.4;
  margin-block: unset;
  margin-bottom: var(--size-xs);
  border-bottom: 1px solid var(--border-color);
}
.id-ego-caption mark {
  font-family: var(--font-family-serif);
  font-style: italic;
}

/* prose */
.prose {
  color: var(--prose-fg);
  max-width: 75ch;
  font-size: var(--font-body-size);
  line-height: 1.7;
}

.prose p,
.prose ul,
.prose ol,
.prose figure {
  margin-block: 12px;
}

.prose figure img {
  margin-inline: auto;
}

.prose h2,
.prose h3 {
  margin-block: var(--size-lg) 12px;
}

/**************************************************************/
/* LLM chat
/**************************************************************/
details {
  font-size: var(--size-sm);
  max-width: 80ch;
}
details summary {
  cursor: pointer;
  margin-top: var(--size-1);
  border-bottom: 1px solid var(--border-color);
  padding: 0 5px;
}
details summary + p {
  margin-top: var(--size-1);
}
dl {
  margin: 1rem auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: var(--size-sm);
}

dt {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

dd {
  margin: 0;
  padding: var(--size-0);
  overflow: auto;
  max-width: 100%;
  box-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.dark dd {
  box-shadow: 0 1px 2px rgba(255,255,255,0.5);
}
@media (min-width: 768px) {
  dd {
    max-width: 80%;
  }
}
dd p:first-child {
  margin-block-start: 0;
}
details code {
  display: block;
  font-size: smaller;
  background-color: var(--offwhite);
}
details .h2 {
  font-size: var(--size-1);
  font-weight: bold;
  line-height: 1.2;
  margin-top: var(--size-md);
  margin-bottom: var(--size-md);
}
details .h3 {
  font-size: var(--size-0);
  font-weight: bold;
  line-height: 1.2;
  margin-top: var(--size-md);
  margin-bottom: var(--size-md);
}
details .h4 {
  margin-top: var(--size-md);
  margin-bottom: var(--size-md);
  font-weight: bold;
}
details ul,
details ol {
  margin-left: var(--size-lg);
}

/* "Me" styles — right aligned */
dt:has(+ dd) {
  display: none; /* hide dt, style bubbles by context */
}

/* Target Me blocks */
dl > dt:nth-of-type(odd) {
  text-align: right;
}

dl > dt:nth-of-type(odd) + dd {
  border-bottom-right-radius: 0.2rem;
  align-self: flex-end;
}

/* Target LLM blocks */
dl > dt:nth-of-type(even) {
  text-align: left;
  color: #555;
}

dl > dt:nth-of-type(even) + dd {
  background: #ffffff;
  color: #1a1a1a;
  border-bottom-left-radius: 0.2rem;
  align-self: flex-start;
}


/* mission, portfolio, misc pages */
.mission {
  display: grid;
  gap: 24px;
  padding: 0 var(--size-lg) var(--size-lg);
}

@media (min-width: 1024px) {
  .mission {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.portfolio-thumbs {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  padding: 0 0 var(--size-lg);
}

.content-grid {
  padding: 0 var(--size-lg) var(--size-lg);
  display: grid;
  gap: 12px;
}

.archive-sections h2 {
  margin-block: var(--size-lg) 8px;
}

.wrapper {
  padding: 0 var(--size-lg) var(--size-lg);
}
