/* Nonchalant v1 — type-led, content-first. No gradients, no cards, no shadows. */

/* light tokens */
:root{
  --bg: #ffffff;
  --ink: #111111;
  --muted: #555555;
  --link: #0645ad;      /* classic link blue */
  --link-visited: #0b0080;
  --line: #e5e7eb;
  --radius: 6px;
  --maxw: 72ch;         /* comfortable measure for prose */
  --space-1: .5rem; --space-2: .875rem; --space-3: 1.25rem; --space-4: 2rem; --space-5: 3.5rem;
  --fs--1: 0.9375rem;   /* ~15px */
  --fs-0: 1rem;         /* 16px base */
  --fs-1: clamp(1.125rem, 1.05rem + .5vw, 1.375rem);
  --fs-2: clamp(1.375rem, 1.2rem + .8vw, 1.75rem);
  --fs-3: clamp(1.75rem, 1.5rem + 1.4vw, 2.25rem);
}


*{box-sizing:border-box}
html{height:100%; scroll-behavior:smooth}
body{
  margin:0;
  min-height:100%;
  display:flex;
  flex-direction:column;
  background:var(--bg);
  color:var(--ink);
  font-family: -apple-system, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji","Segoe UI Emoji";
  font-size: var(--fs-0);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}
.container{padding: 0 var(--space-4);}

header.site{
  position: sticky; top: 0; background: var(--bg);
  border-bottom: 1px solid var(--line);
}
header.site .nav{
  display:flex; gap: var(--space-2); align-items:center; justify-content:flex-start;
  padding: .65rem var(--space-2);
  overflow:auto;
}
header.site a{ color:inherit; text-decoration:none; padding:.25rem .4rem }
header.site a[aria-current="page"]{ outline:1px solid var(--line) }
header.site .site-name{ font-weight: 600; }
header.site .nav-separator{ color: var(--muted); user-select: none; }

main{ flex: 1; padding: var(--space-3) 0 }
main section{ scroll-margin-top: 4rem; }

h1,h2,h3,h4{ line-height:1.25; margin: var(--space-3) 0 var(--space-2) }
h1{ font-size: var(--fs-3); }
h2{ font-size: var(--fs-2); }
h3{ font-size: var(--fs-1); }

p, ul, ol, pre, blockquote, table{ margin: 0 0 var(--space-2) 0 }

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

blockquote{
  margin-left: 0; padding-left: var(--space-2);
  color: var(--muted);
}

hr{ border:0; border-top:1px solid var(--line); margin: var(--space-4) 0 }

/* Wheel and cuneiform symbols */
.separator-anim{
  position: relative;
}
.separator-anim hr{
  margin: var(--space-4) 0;
}
.anim-scene{
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}
.wheel{
  font-size: 1.25rem;
  line-height: 1;
  color: var(--muted);
}
.cuneiform{
  display: flex;
  align-items: center;
  color: var(--muted);
}
.cuneiform svg{
  display: block;
}

code, pre{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: .95em;
}
pre{
  padding: var(--space-2);
  background: color-mix(in lab, var(--ink) 6%, var(--bg));
  border: 1px solid var(--line);
  overflow:auto
}
table{ width:100%; border-collapse: collapse; font-variant-numeric: tabular-nums}
th, td{ text-align:left; border-bottom:1px solid var(--line); padding:.5rem .25rem }

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

footer.site{ border-top:1px solid var(--line); margin-top: var(--space-4); padding: var(--space-2) 0; color: var(--muted) }
.footer-content{
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.footer-content > small{
  flex: 1;
}
.footer-content > small:nth-child(2){
  text-align: center;
}
.footer-content > small:last-child{
  text-align: right;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.25rem;
}
.visitor-count{
  color: var(--bg);
}
.footer-content svg{
  flex-shrink: 0;
}

/* simple list styles for notes/projects */
.list a.item{
  display: flex;
  flex-direction: column;
  padding: .75rem 0;
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
}
.list a.item:hover .item-title{ text-decoration: underline }
.item-date{
  color: var(--muted);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  margin-bottom: 0.2rem;
}
.item-title{
  font-size: var(--fs-0);
}
.item-tags{
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

/* Tag filter buttons */
/* Article date in view pages */
.article-date{
  color: var(--muted);
  font-size: 0.875rem;
  margin-top: -0.5rem;
  margin-bottom: 1.5rem;
}

.tags-wrapper{
  margin-bottom: var(--space-3);
}
.tags-toggle{
  appearance: none;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 0.875rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0;
  margin-bottom: 0.5rem;
}
.tags-toggle:hover{
  color: var(--ink);
}
.tags-toggle .chevron{
  display: inline-block;
  transition: transform 0.2s ease;
}
.tags-toggle[aria-expanded="true"] .chevron{
  transform: rotate(90deg);
}
.tags{
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.tags.collapsed{
  display: none;
}
.tag{
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  padding: 0.25rem 0.6rem;
  border-radius: 1rem;
  font-size: 0.8125rem;
  cursor: pointer;
  transition: all 0.15s ease;
}
.tag:hover{
  border-color: var(--ink);
  color: var(--ink);
}
.tag.active{
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

/* dark tokens */
:root[data-theme="dark"]{
  --bg: #000000;
  --ink: #e9eef3;
  --muted: #9aa3ad;
  --link: #79b8ff;
  --link-visited: #b392f0;
  --line: #1f242c;
}
/* whimsy tokens */
:root[data-theme="whimsy"]{
  --bg: #fff8f1;
  --ink: #212121;
  --muted: #6c6b6e;
  --link: #b40058;
  --link-visited: #5e2b97;
  --line: #efdcd2;
  --radius: 12px;
  --marker: "✦";
  --quote-border: #f3b6d0;
}

/* whimsy tweaks */
header.site a,
.theme-toggle{ border-radius: var(--radius); }

ul, ol{ list-style-type: var(--marker); }

blockquote{
  border-left: 3px solid var(--quote-border, var(--line));
  border-radius: var(--radius);
}

/* Minimal toggle styles */
.theme-toggle{
  margin-left: auto; /* pushes toggle to the right in the nav */
  appearance: none; border: 1px solid var(--line); background: transparent;
  padding: .25rem .5rem; cursor: pointer; color: inherit;
  display: flex; align-items: center; gap: 0.25rem;
}
.theme-toggle::before{
  content: '';
  width: 3px;
  height: 14px;
  border-radius: 2px;
  transition: background-color 0.2s, box-shadow 0.2s;
}
.theme-toggle.saber-light::before{
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e, 0 0 12px #22c55e;
}
.theme-toggle.saber-dark::before{
  background: #ef4444;
  box-shadow: 0 0 8px #ef4444, 0 0 12px #ef4444;
}
.theme-toggle:focus-visible{ outline: 2px solid var(--line); outline-offset: 2px; }

/* print-friendly */
@media print{
  :root{
    --bg: #ffffff;
    --ink: #111111;
    --muted: #555555;
    --link: #0645ad;
    --link-visited: #0b0080;
    --line: #e5e7eb;
  }
  header.site, footer.site{ display:none }
  .container{ max-width: none; }
}
