:root {
  /* === Fonts === */
  --sans-font: BlinkMacSystemFont, "Avenir Next", Avenir, "Nimbus Sans L", Roboto, Noto, "Segoe UI", Arial, Helvetica, "Helvetica Neue", sans-serif;
  --serif-font: "Palatino Linotype", "Georgia", "Iowan Old Style", "Times New Roman", serif;
  --mono-font: Consolas, Menlo, Monaco, "Andale Mono", "Ubuntu Mono", monospace;

  /* === Typography === */
  --base-fontsize: 1.1rem;
  --header-scale: 1.25;
  --line-height: 1.618;

  /* === Light theme === */
  --bg: #ffffff;
  --accent-bg: #f8f8f8;
  --border: #d8dae1;
  --text: #1a1a1a;
  --text-muted: #555555;
  --text-light: #888888;
  --accent: rgba(120, 119, 116, 0.5);
  --highlight: #ffdd33;
  --link: #0056d2;
  --link-hover: #0044aa;
  --code: #d81b60;
  --preformatted: #444;
  --marked: #f8af38;
  --shadow: rgba(0, 0, 0, 0.1);

  /* === Brand === */
  --overlair-green: #4efc8c;
  --overlair-blue: #4ebefc;
  --overlair-blue-light: rgba(78, 190, 252, 0.5);

  --disabled: #efefef;
  --image-opacity: 1;
}

/* === DARK THEME === */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1114;
    --accent-bg: #1a1d21;
    --border: #2a2c31;
    --text: #f5f5f5;
    --text-muted: #cccccc;
    --text-light: #999999;
    --accent: rgba(255, 255, 255, 0.15);
    --highlight: #ffd84d;
    --link: #63a4ff;
    --link-hover: #90caf9;
    --code: #ff70a6;
    --preformatted: #ccc;
    --marked: #f8af38;
    --shadow: rgba(0, 0, 0, 0.4);
  }
}

/* === GLOBAL === */
html {
  font-family: var(--sans-font);
  background: var(--bg);
  color: var(--text);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

html, body {
  overflow-x: hidden;
}

.layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}


.list-container {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 1rem;
}


.list-item {
  display: block;
  text-align: left;
  text-decoration: none;
  color: var(--text);
}

.hoverable-list-item {
  border-radius: 12px;
  background-color: transparent;
  transition: background-color 0.2s ease;
}

.hoverable-list-item:hover {
  background-color: var(--accent-bg);
}


.page-content {
  box-sizing: border-box;
  max-width: 670px;
  margin: 1rem auto 4rem auto;
  padding-top: 3em;
  padding-left: 1rem;
  padding-right: 1rem;
  overflow-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
  color: var(--text);
}

.page-content a,
.page-content code {
  overflow-wrap: anywhere;
  word-break: break-word;
  color: var(--link);
}

.page-content a:hover {
  color: var(--link-hover);
}

/* === SCROLL === */
.page-scroll {
  flex: 1;
  overflow-y: auto;
}

.section-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    /* margin-bottom: 2rem; */
}

.section-title-1 {
  font-size: 1.4em;
  font-weight: 500;
  margin-top: 1rem;
  padding: 0.5rem;
  color: var(--text);
}

.section-title-1:hover {
    text-decoration: solid;
}


.section-title-1 a {
 color: inherit;
  text-decoration: none;
}

.section-subtitle {
  font-size: 1em;
  font-weight: 400;
  padding: 0 0.5rem;
  color: var(--text-light);
}

.section-subtitle a {
 color: inherit;
  text-decoration: none;
}

.section-subtitle:hover {
    text-decoration: solid;
}




.work-labels {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    padding: 10px 10px;
    gap: 0.5rem;
    text-align: left;
}


.work-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 0.5rem 0.5rem;
    border-radius: 10px;
    background-color: rgba(0, 0, 0, 0);
    transition: background-color 0.2s ease;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 36px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  padding: 4pt 0;
}


/* Rotated vertical text (readable bottom to top) */
.sidebar-text {
  /* writing-mode: vertical-rl; */
  /* transform: rotate(180deg); */
  text-align: center;
  user-select: none;
  text-decoration: none;
  /* padding: 0 5pt; */
 

}
.sidebar-text-muted { color: var(--text-light); }
.sidebar-text-mid { color: var(--text-muted); }
.sidebar-text-strong { color: var(--text); font-weight: 600; }


.sidebar-text-top {
    display: flex;
  flex-direction: row;
  gap: 0.4rem;
  font-size: 1.125rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-left: 10px;
  padding-right: 10px;
}
.sidebar-text-bottom {
    display: flex;
    flex-direction: row;
    gap: 0.4rem;
    /* transform-origin: center center; */
    font-size: 1.2rem;
    /* padding-bottom: 40px; */
    cursor: pointer;
    color: #999;
}

.sidebar-menu-icon {
  width: 30px;
  height: 30px;
  padding: 5px;
  color: var(--text-muted);
  transition: opacity 0.2s ease;
}

.sidebar-menu-icon:hover {
  opacity: 0.7;
}

/* Popup menu styling */
.sidebar-menu {
  position: absolute;
  top: 36px;
  right: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 4px 12px var(--shadow);
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
  transition: all 0.25s ease;
  z-index: 100;
}


.sidebar-menu.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.sidebar-menu-item {
  padding: 8px 14px;
  text-decoration: none;
  color: var(--text);
  font-size: 0.95rem;
  white-space: nowrap;
}

.sidebar-menu-item:hover {
  background: var(--accent-bg);
}

.nav-link {
    text-decoration: none;
    padding: 0.5rem 0.5rem;
    border-radius: 10px;
    background-color: rgba(0, 0, 0, 0);
    transition: background-color 0.2s ease;
}

.nav-link:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

a.disabled {
  pointer-events: none;
  cursor: default;
}


.svg-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    color: var(--text)
}

.media-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 2rem auto;
  width: 100%;
  max-width: 700px;
  text-align: center;
}

.media-wrapper img,
.media-wrapper iframe,
.media-wrapper object {
  width: 92%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 8px var(--shadow);
  transition: transform 0.2s ease;
  opacity: var(--image-opacity);
}

.media-wrapper figcaption {
    margin-top: 0.5rem;
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Type-specific adjustments */
.media-wrapper.is-yt iframe {
    aspect-ratio: 16 / 9;
    border: none;
}

.media-wrapper.is-tw {
    max-width: 550px;
}

.media-wrapper.is-svg img {
    background: none;
    border-radius: 0;
    box-shadow: none;
}

.media-inner {
    width: 85%;
    max-width: 700px; 
    height: auto; 
    border-radius: 8px; 
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); 
    transition: transform 0.2s ease;
}





/* Base post typography */
.post-body {
  font-family: var(--serif-font);
  font-size: 1.125rem;
  line-height: 1.75;
  color: var(--text);
  max-width: 65ch;
  margin: 2rem auto;
  padding-left: 5px;
  padding-right: 5px;
}

/* Headings */
.post-body h1, .post-body h2, .post-body h3, .post-body h4 {
  font-family: var(--serif-font);
  font-weight: 600;
  color: var(--text);
}


.post-body h1 {
  font-size: 2rem;
}

.post-body h2 {
  font-size: 1.5rem;
}

.post-body h3 {
  font-size: 1.25rem;
}

.post-body h4 {
  font-size: 1.125rem;
}


/* Paragraphs */
.post-body p {
  margin: 1.2em 0;
}

/* Emphasis and strong */
.post-body em {
  font-style: italic;
}

.post-body strong {
  font-weight: 600;
}

/* Blockquotes */

.post-body blockquote {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  border-left: 4px solid var(--border);
  background: var(--accent-bg);
  margin: 1.5em 3em 1.5em 0;
  width: 90%;
  padding: 0.75em 1.25em;
  border-radius: 6px;
}

.post-body .blockquote-quote {
  font-style: italic;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 0.5em;
  margin-right: 2em;
  text-align: left;
  font-family: "Georgia", "Times New Roman", serif;
}

.post-body .blockquote-author {
  font-weight: 600;
  font-size: 0.95em;
  align-self: flex-start;
}

/* Figures / captions */
.post-body figure {
  margin: 2rem 0;
  text-align: center;
}

.post-body figcaption {
  font-size: 0.95rem;
  color: #666;
  margin-top: 0.5rem;
}

/* Lists */
.post-body ul,
.post-body ol {
  font-size: 1.15rem;
  margin-right: 2rem;
}

/* Links */
.post-body a {
  /* color: #0044cc; */
  text-decoration: none;
  color: var(--link);
}

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

.flexible-list-item {
    display: flex;
    flex-direction: column;
    padding: 12.5px 22.5px;
    gap: 5px;
    margin-left: 1rem;
    margin-right: 1rem;
    border-radius: 12px;
    background-color: transparent;
    transition: opacity 0.2s ease;
    opacity: 1;
}

.flexible-list-item:hover {
    opacity: 0.5;
}


.cell-title {
    color: var(--text);
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0;
    padding: 0;
    text-decoration: none;
}

.cell-metadata {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 0;
    gap: 4pt;
    margin: 0;
    -webkit-line-clamp: 1; /* limit to 3 lines */
    overflow: hidden;
   text-overflow: ellipsis;
    white-space: nowrap;
}

.cell-excerpt {
  font-size: 1rem;
  line-height: 1.2;
  color: var(--text-muted);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3; /* limit to 3 lines */
  -webkit-box-orient: vertical;
}

#cell-link {
    color: var(--text-light);
    font-size: 0.8rem;
    /* padding: 2pt; */
}

.cell-link-icon {
     transform: translateY(2.5px);
     font-size: 12pt;
     color: var(--text-light);
     opacity: 0.4;
    /* position: absolute; */
    /* top: 4px; */
}
.cell-link-container {
    display: flex;
    flex-direction: row;
    align-items:first baseline;
    font-size: 1.05rem;
    /* margin-left: -1rem; */
    /* margin: 0 auto; */
    /* padding-left: 1rem; */
    gap: 2px;
}


.cell-icon {
    position: absolute;
    margin-top: 17.5px;
    margin-left: 10px;
    width: 13pt;
    height: 13pt;
    pointer-events: none;
    cursor: pointer;
}

.cell-category {
    font-size: 0.8rem;
    font-weight: 300;
    color: var(--text-light);
}

.cell-date {
    font-size: 0.8em;
    font-weight: 500;
    color: var(--text-light);

}

code {
  color: var(--code);
  font-family: var(--mono-font);
}

pre {
  background: var(--accent-bg);
  color: var(--preformatted);
  padding: 0.75em;
  border-radius: 6px;
  overflow-x: auto;
}

/* Highlight */
mark {
  background: var(--marked);
  color: var(--text);
}




.search-container {
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-form {
  width: 100%;
  max-width: 600px;
}

.search-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-input {
  flex: 1 1 auto;   
  min-width: 120px;
  padding: 6px 38px 6px 10px;  /* make room for the button on the right */
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1rem;
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--overlair-blue);
  background-color: var(--accent-bg);
}

.search-button {
  position: absolute;
  right: 2px;
  top: 8px;
  /* top: 50%; */
 /* transform: translateY(50%); */
  border: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0 6px;
  line-height: 1;
  opacity: 0.4;
  transition: opacity 0.2s ease;
}

.search-button:hover {
  opacity: 0.8;
}



.flash-mark {
  background-color: #ffdd33;
  border-radius: 2px;
  padding: 0 2px;
  transition: background-color 0.8s ease-in-out;
}

.not-found-container {
  display: flex;
  justify-content: center;  /* horizontal centering */
  align-items: center;      /* vertical centering */
  height: 100vh;            /* fill the viewport (or parent) height */
  width: 100%;
}

.not-found-title {
  font-size: 5rem;
  text-align: center;
}