/* iasds theme - restrained editorial palette, light-default with dark toggle */

/* ===== Fonts ===== */
@font-face {
  font-family: 'Season VF';
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  src: url('/fonts/SeasonCollectionVF.woff2') format('woff2-variations');
}

:root {
  --font-body:  'Season VF', Georgia, 'Times New Roman', serif;
  --font-mono:  ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;

  --bg:              #f7f4ef;
  --text:            #171514;
  --text-muted:      #746c64;
  --link:            #245463;
  --link-hover:      #173f4d;
  --border:          #d8d1c8;
  --border-sub:      #e8e2da;
  --code-bg:         #eeebe5;
  --code-color:      #533926;
  --pre-bg:          #eeebe5;
  --blockquote-bg:   #f1ede6;
  --blockquote-border:#9da7a3;
  --table-head-bg:   #ebe6de;
  --table-stripe:    #fbf9f5;
  --card-bg:         #fffdf9;
  --card-border:     #ddd6cc;
  --kbd-bg:          #f0ece6;
  --separator:       #bbb2a8;
  --heading-border:  #e2dcd4;
  --bold:            #171514;
  --mark-bg:         #dfeee9;
  --mark-text:       #153b35;
  --sidebar-bg:      #f0ece6;
  --shadow:          0 1px 2px rgba(36, 28, 18, 0.04);
}

body.dark {
  --bg:              #101314;
  --text:            #ece8df;
  --text-muted:      #a8a099;
  --link:            #8dc6d1;
  --link-hover:      #b2dfe6;
  --border:          #31383a;
  --border-sub:      #252b2d;
  --code-bg:         #181c1e;
  --code-color:      #e0c39f;
  --pre-bg:          #181c1e;
  --blockquote-bg:   #171b1d;
  --blockquote-border:#5a6d70;
  --table-head-bg:   #1a2022;
  --table-stripe:    #141819;
  --card-bg:         #15191a;
  --card-border:     #303739;
  --kbd-bg:          #1b2022;
  --separator:       #42494b;
  --heading-border:  #252b2d;
  --bold:            #f4efe6;
  --mark-bg:         #243c3c;
  --mark-text:       #edf7f4;
  --sidebar-bg:      #171b1c;
  --shadow:          0 1px 2px rgba(0, 0, 0, 0.22);
}

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

html { font-size: 15px; }
html { color-scheme: light; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-weight: 400;
  margin: 0 auto;
  padding: 2.667rem 2rem;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body.dark { color-scheme: dark; }

::selection {
  background: var(--mark-bg);
  color: var(--mark-text);
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 3px;
}

/* ===== Theme Toggle ===== */
.theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background: color-mix(in srgb, var(--card-bg) 88%, transparent);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
  font-size: 0.93rem;
  cursor: pointer;
  color: var(--text-muted);
  box-shadow: var(--shadow);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  z-index: 100;
}
.theme-toggle:hover {
  background: var(--code-bg);
  color: var(--text);
}

/* ===== Layout ===== */
.layout {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  max-width: 68rem;
  margin: 0 auto;
}

/* ===== Sidebar Card ===== */
.sidebar {
  flex: 0 0 18rem;
  position: sticky;
  top: 1.6rem;
}

.sidebar-card {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--sidebar-bg);
  padding: 1rem;
  font-size: 0.87rem;
  line-height: 1.5;
  box-shadow: var(--shadow);
}

.sidebar-card h1 {
  font-size: 1.27rem;
  font-weight: 700;
  margin: 0 0 0.27rem;
  color: var(--text);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.sidebar-card .sub {
  font-size: 0.87rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 1rem;
}

.sidebar-card .bio {
  font-size: 0.87rem;
  color: var(--text);
  margin-bottom: 0.4rem;
  line-height: 1.5;
}

.sidebar-card .divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0.8rem 0;
}

.sidebar-card a { color: var(--link); text-decoration: none; }
.sidebar-card a:hover { text-decoration: underline; }

.sidebar-card .sponsor {
  font-size: 0.8rem;
  color: var(--text);
  line-height: 1.5;
}

.sidebar-card .contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.87rem;
}
.sidebar-card .contact-list li { margin-bottom: 0.13rem; }
.sidebar-card .contact-list a {
  color: var(--link);
  text-decoration: none;
  padding: 0.13rem 0;
  display: block;
}
.sidebar-card .contact-list a:hover { color: var(--link); }
.sidebar-card .contact-list .muted-link {
  color: var(--text-muted) !important;
  cursor: default;
}
.sidebar-card .contact-list .muted-link:hover { text-decoration: none; }

.sidebar-card .pgp-line {
  font-size: 0.73rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  line-height: 1.5;
  margin-top: 0.5rem;
}
.sidebar-card .pgp-label {
  font-size: 0.73rem;
  font-family: var(--font-body);
  color: var(--text-muted);
  font-weight: 600;
}

/* ===== Main content ===== */
.main-content {
  flex: 1;
  min-width: 0;
}

.card-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.card {
  border: 1px solid var(--card-border);
  border-radius: 6px;
  padding: 1rem;
  font-size: 0.93rem;
  line-height: 1.5;
  background: var(--card-bg);
  box-shadow: var(--shadow);
}

.card h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 0.5rem;
  letter-spacing: -0.01em;
}
.card h2 a { color: inherit; text-decoration: none; }
.card h2 a:hover { color: var(--link-hover); }

.card .desc {
  font-size: 0.87rem;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.card ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.card li {
  margin-bottom: 0.2rem;
  padding: 0.33rem 0;
  border-bottom: 1px solid var(--border-sub);
  font-size: 0.87rem;
}
.card li:last-child { border-bottom: none; }
.card li a { color: var(--link); text-decoration: none; display: block; }
.card li a:hover { color: var(--link-hover); text-decoration: underline; }

.card a { color: var(--link); text-decoration: none; }
.card a:hover { color: var(--link-hover); text-decoration: underline; }

.card .muted { color: var(--text-muted); font-size: 0.8rem; }
.card hr { border: none; border-top: 1px solid var(--border); margin: 0.5rem 0; }

/* ===== Footer ===== */
.footer {
  margin-top: 1.87rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
  max-width: 68rem;
  margin-left: auto;
  margin-right: auto;
}
.footer .sep { color: var(--separator); margin: 0 0.5rem; }
.footer a { color: var(--link); text-decoration: none; }
.footer a:hover { color: var(--link-hover); text-decoration: underline; }

/* ===== Section page (list.html) ===== */
.section-page {
  max-width: 50rem;
  margin: 0 auto;
}
.section-page h1 { font-size: 1.6rem; font-weight: 700; margin-bottom: 1rem; letter-spacing: -0.01em; }
.section-page > .content { margin-bottom: 1.3rem; }
.post-list { list-style: none; padding: 0; }
.post-list li { margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.post-list li:last-child { border-bottom: none; }
.post-list .title { font-size: 1.07rem; font-weight: 600; }
.post-list .title a { color: var(--link); text-decoration: none; }
.post-list .title a:hover { color: var(--link-hover); text-decoration: underline; }
.post-list .post-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.13rem;
}
.post-list .summary { font-size: 0.87rem; color: var(--text-muted); margin-top: 0.27rem; }

/* ===== Single page (single.html) ===== */
.single-page {
  max-width: 50rem;
  margin: 0 auto;
  padding-bottom: 2rem;
}
.single-page h1 {
  font-size: 1.87rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text);
  letter-spacing: -0.01em;
}
.single-page .meta-line {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1.6rem;
  display: flex;
  gap: 0.5em;
  align-items: center;
}
.single-page .meta-line .source-link { margin-left: 0.25em; }
.single-page .meta-line .source-link a { color: var(--link); text-decoration: none; }
.single-page .meta-line .source-link a:hover { color: var(--link-hover); text-decoration: underline; }

/* Breadcrumb */
.breadcrumb {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.8rem;
}
.breadcrumb a { color: var(--link); text-decoration: none; }
.breadcrumb a:hover { color: var(--link-hover); text-decoration: underline; }
.breadcrumb .sep { color: var(--separator); margin: 0 0.5rem; }

/* Prev/Next */
.page-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.93rem;
}
.page-nav a { color: var(--link); text-decoration: none; font-weight: 500; }
.page-nav a:hover { color: var(--link-hover); text-decoration: underline; }
.page-nav .next { margin-left: auto; }

/* ===== Markdown Content ===== */
.content {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
}

/* Paragraphs */
.content p { margin-bottom: 1rem; }

/* Headings */
.content h1,
.content h2,
.content h3,
.content h4,
.content h5,
.content h6 {
  font-weight: 600;
  color: var(--text);
  margin-top: 1.6rem;
  margin-bottom: 1rem;
  line-height: 1.25;
}
.content h1 { font-size: 2em; border-bottom: 1px solid var(--heading-border); padding-bottom: 0.4rem; }
.content h2 { font-size: 1.5em; border-bottom: 1px solid var(--heading-border); padding-bottom: 0.4rem; }
.content h3 { font-size: 1.25em; }
.content h4 { font-size: 1em; }
.content h5 { font-size: 0.875em; }
.content h6 { font-size: 0.85em; color: var(--text-muted); }

/* Links */
.content a {
  color: var(--link);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.content a:hover { color: var(--link-hover); text-decoration: underline; }

.store-page .content > p:first-child {
  font-size: 1.13rem;
  line-height: 1.55;
}

.store-page .content > p:nth-child(2) {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 6px;
  padding: 0.87rem 1rem;
}

/* Bold / Italic */
.content strong { font-weight: 600; }
.content em { font-style: italic; }

/* Inline code */
.content code:not(pre code) {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .2em .4em;
  font-family: var(--font-mono);
  font-size: 85%;
  color: var(--code-color);
}

/* Code blocks */
.content pre {
  background: var(--pre-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1rem;
  overflow-x: auto;
  line-height: 1.45;
  font-size: 85%;
}
.content pre code {
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font-mono);
  color: var(--text);
  font-size: inherit;
}

/* Horizontal rule */
.content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.6rem 0;
}

/* Blockquotes */
.content blockquote {
  border-left: .25em solid var(--blockquote-border);
  padding: 0 1em;
  margin: 0 0 1rem;
  color: var(--text-muted);
}
.content blockquote p:last-child { margin-bottom: 0; }

/* Unordered lists */
.content ul {
  list-style: disc;
  padding-left: 2em;
  margin-bottom: 1rem;
}
.content ul ul { list-style: circle; margin-bottom: 0; }
.content ul ul ul { list-style: square; }
.content li { margin-bottom: 0.27rem; }
.content li > p { margin-bottom: 0.27rem; }

/* Ordered lists */
.content ol {
  padding-left: 2em;
  margin-bottom: 1rem;
}
.content ol li { margin-bottom: 0.27rem; }

/* Tables */
.content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
  font-size: 0.93rem;
}
.content th, .content td {
  border: 1px solid var(--border);
  padding: 0.4rem 0.87rem;
  text-align: left;
}
.content th {
  background: var(--table-head-bg);
  font-weight: 600;
  color: var(--text);
}
.content td { background: var(--bg); }
.content tr:nth-child(even) td { background: var(--table-stripe); }

/* Images */
.content img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 1rem 0;
}
body.dark .content img {
  border: 1px solid var(--border);
  background: var(--bg);
}

/* Task lists */
.content input[type="checkbox"] {
  margin-right: 6px;
}

/* Footnotes */
.content sup { font-size: 12px; }
.content sup a { color: var(--link); }

/* Keyboard */
.content kbd {
  background: var(--kbd-bg);
  border: 1px solid var(--border);
  border-bottom-width: 3px;
  border-radius: 6px;
  padding: 1px 5px;
  font-family: var(--font-mono);
  font-size: 12px;
}

/* Definition lists */
.content dl { margin-bottom: 1rem; }
.content dt { font-weight: 600; margin-top: 0.4rem; }
.content dd { padding-left: 2em; margin-bottom: 0.27rem; color: var(--text-muted); }

/* Mark */
.content mark {
  background: var(--mark-bg);
  color: var(--mark-text);
  padding: 0 2px;
  border-radius: 2px;
}

/* Abbreviation */
.content abbr[title] {
  cursor: help;
  border-bottom: 1px dotted var(--text-muted);
  text-decoration: none;
}

/* ===== Mobile ===== */
@media (max-width: 48rem) {
  .layout {
    flex-direction: column;
    gap: 1.6rem;
  }
  .sidebar {
    flex: none;
    position: static;
    width: 100%;
  }
  .card-grid { gap: 0.8rem; }
  body { padding: 1.6rem 1rem; }
  .theme-toggle { top: 0.67rem; right: 0.67rem; }
  .footer { display: block; }
  .footer .sep { display: none; }
  .footer span { display: block; margin-bottom: 0.27rem; }
  .single-page h1 { font-size: 1.6rem; }
  .section-page h1 { font-size: 1.45rem; }
  .content pre { padding: 0.8rem; font-size: 80%; }
  .content table { display: block; overflow-x: auto; white-space: nowrap; }
}

@media (min-width: 48.07rem) and (max-width: 64rem) {
  .layout { gap: 1.6rem; }
  .sidebar { flex: 0 0 16rem; }
}

/* ===== Dark mode: syntax highlighting overrides ===== */
body.dark .bg,
body.dark .chroma { background-color: #181c1e !important; }
body.dark .chroma .hl { background-color: #232a2c; }
body.dark .chroma .lnt,
body.dark .chroma .ln { color: #7f8a8b; }
body.dark .chroma .k,
body.dark .chroma .kc,
body.dark .chroma .kd,
body.dark .chroma .kn,
body.dark .chroma .kp,
body.dark .chroma .kr,
body.dark .chroma .kt { color: #93c7d1; }
body.dark .chroma .na,
body.dark .chroma .nc,
body.dark .chroma .n { color: #ece8df; }
body.dark .chroma .nb,
body.dark .chroma .ni { color: #b8c7e6; }
body.dark .chroma .bp { color: #a8a099; }
body.dark .chroma .no,
body.dark .chroma .nd,
body.dark .chroma .nf { color: #c7b9e8; }
body.dark .chroma .s,
body.dark .chroma .sa,
body.dark .chroma .sb,
body.dark .chroma .sc,
body.dark .chroma .dl,
body.dark .chroma .sd,
body.dark .chroma .s2,
body.dark .chroma .se,
body.dark .chroma .sh,
body.dark .chroma .si,
body.dark .chroma .sx,
body.dark .chroma .sr,
body.dark .chroma .s1,
body.dark .chroma .ss { color: #b7d59a; }
body.dark .chroma .m,
body.dark .chroma .mb,
body.dark .chroma .mf,
body.dark .chroma .mh,
body.dark .chroma .mi,
body.dark .chroma .il,
body.dark .chroma .mo { color: #d8bc8a; }
body.dark .chroma .c,
body.dark .chroma .ch,
body.dark .chroma .cm,
body.dark .chroma .c1,
body.dark .chroma .cs,
body.dark .chroma .cp,
body.dark .chroma .cpf { color: #8f9999; }
body.dark .chroma .o,
body.dark .chroma .ow { color: #93c7d1; }
body.dark .chroma .err { color: #f4efe6; background-color: #5d2028; }
body.dark .chroma .gd { color: #e79b9b; background-color: #361c20; }
body.dark .chroma .gi { color: #b7d59a; background-color: #1c2d20; }
body.dark .chroma .p { color: #ece8df; }
body.dark .chroma .nl { color: #93c7d1; }
body.dark .chroma .nv,
body.dark .chroma .vc,
body.dark .chroma .vg,
body.dark .chroma .vi { color: #d8bc8a; }
body.dark .chroma .nt { color: #b8c7e6; }
body.dark .chroma .hl { background-color: #232a2c; }
