/* Obsidian-inspired light theme: white background, Inter, purple accent. */

:root{
  --bg: #ffffff;
  --text: #222222;
  --muted: #6b6b6b;
  --border: #e3e3e3;
  --code-bg: #f3f3f3;
  --accent: #705dcf;
  --accent-bg: rgba(112,93,207,0.1);
  --yellow: #e0ac00;
  color-scheme: light;
}

*{ box-sizing: border-box; }
html{ -webkit-text-size-adjust: 100%; }

body{
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

.page{
  max-width: 700px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 3rem;
}

a{ color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
a:hover{ text-decoration-thickness: 2px; }
a:focus-visible, summary:focus-visible{ outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

/* top navigation */
.topbar{
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.9rem;
  margin-bottom: 2.25rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.topbar a{ color: var(--muted); text-decoration: none; }
.topbar a:hover{ color: var(--accent); }
.topbar .nav-links{ display: flex; gap: 1.25rem; }
.topbar [aria-current="page"]{ color: var(--text); }

/* headings, matching Obsidian's default scale */
h1{ font-size: 1.8em; font-weight: 700; line-height: 1.25; margin: 0 0 0.75rem; }
h2{ font-size: 1.6em; font-weight: 600; line-height: 1.3; margin: 2.2em 0 0.5em; }
h3{ font-size: 1.35em; font-weight: 600; line-height: 1.3; margin: 1.8em 0 0.5em; }

p{ margin: 0 0 1em; }
.muted{ color: var(--muted); }

ul, ol{ margin: 0 0 1em; padding-left: 1.5rem; }
li{ margin-bottom: 0.3em; }
li::marker{ color: var(--muted); }

code{
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.875em;
  background: var(--code-bg);
  border-radius: 4px;
  padding: 0.1em 0.35em;
}

strong{ font-weight: 600; }

/* tags, styled like Obsidian's #tags */
.tags{ display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; padding: 0; margin: 0.5rem 0 0; }
.tags li{
  margin: 0;
  padding: 0.1rem 0.6rem;
  background: var(--accent-bg);
  color: var(--accent);
  border-radius: 999px;
  font-size: 0.8rem;
  line-height: 1.5;
}

/* home: intro */
.intro{ display: flex; gap: 1.75rem; align-items: center; margin-bottom: 1.75rem; }
.intro img{
  width: 128px;
  height: 128px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  background: var(--code-bg);
}
.intro h1{ margin-bottom: 0.25rem; }
.intro p{ margin: 0; color: var(--muted); }

/* contact links list */
.link-list{ list-style: none; padding: 0; }
.link-list li{ margin-bottom: 0.4em; }

/* projects index */
.note-list{ list-style: none; padding: 0; margin: 1.5rem 0 0; }
.note-list > li{ padding: 1.1rem 0; margin: 0; border-top: 1px solid var(--border); }
.note-list > li:last-child{ border-bottom: 1px solid var(--border); }
.note-list h2{ font-size: 1.2em; margin: 0 0 0.3rem; }
.note-list h2 a{ text-decoration: none; }
.note-list h2 a:hover{ text-decoration: underline; }
.note-list p{ margin: 0; color: var(--muted); }

/* properties block, like Obsidian's frontmatter panel */
.properties{
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.35rem 1.5rem;
  margin: 1.25rem 0 1.5rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
}
.properties dt{ color: var(--muted); }
.properties dd{ margin: 0; }
.properties .tags{ margin: 0; }

/* figures and diagram */
figure{ margin: 1.25rem 0 1.5rem; }
figcaption{ font-size: 0.85rem; color: var(--muted); margin-top: 0.5rem; }
.diagram{ border: 1px solid var(--border); border-radius: 6px; padding: 1.25rem 1rem; }
.diagram svg{ display: block; width: 100%; max-width: 460px; height: auto; margin: 0 auto; }
.diagram text{ font-family: "Inter", sans-serif; fill: var(--text); font-size: 13px; }
.diagram .sub{ fill: var(--muted); font-size: 11.5px; }
.diagram .box{ fill: #fff; stroke: #c9c9c9; stroke-width: 1; }
.diagram .box-accent{ fill: #fff; stroke: var(--accent); stroke-width: 1.2; }
.diagram .line{ stroke: #8a8a8a; stroke-width: 1.2; fill: none; }
.diagram .arrowhead{ fill: #8a8a8a; }

/* tables: glass panel, the grid shows through blurred */
.table-scroll{
  overflow-x: auto;
  margin: 0 0 1.25rem;
  background: rgba(255,255,255,0.45);
  -webkit-backdrop-filter: blur(10px) saturate(1.4);
  backdrop-filter: blur(10px) saturate(1.4);
  border: 1px solid rgba(224,172,0,0.25);
  border-radius: 10px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.05), inset 0 1px 0 rgba(255,255,255,0.8);
}
table{ border-collapse: collapse; width: 100%; font-size: 0.92rem; min-width: 440px; }
th, td{
  text-align: left;
  vertical-align: top;
  padding: 0.5rem 0.9rem;
  border-bottom: 1px solid rgba(224,172,0,0.18);
}
tbody tr:last-child td{ border-bottom: 0; }
th{ font-weight: 600; background: rgba(224,172,0,0.08); }
td:first-child{ white-space: nowrap; }

/* foldable sections */
details{ border: 1px solid var(--border); border-radius: 6px; margin-bottom: 0.6rem; padding: 0.6rem 1rem; }
summary{ cursor: pointer; list-style: none; font-weight: 500; }
summary::-webkit-details-marker{ display: none; }
summary::before{ content: "▸"; display: inline-block; width: 1.2rem; color: var(--muted); }
details[open] > summary::before{ content: "▾"; }
details > :not(summary){ margin-top: 0.8rem; }
details p{ color: var(--muted); font-size: 0.92rem; }

footer{
  max-width: 700px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
  font-size: 0.85rem;
  color: var(--muted);
}

@media (max-width: 600px){
  .intro{ flex-direction: column; align-items: flex-start; gap: 1rem; }
  .properties{ grid-template-columns: 1fr; gap: 0; }
  .properties dd{ margin-bottom: 0.6rem; }
}

/* cursor flair (see flair.js), tuned for the white theme */
.background-gradient,
.flair{
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-image: radial-gradient(240px at var(--x, 50%) var(--y, 50%), #000 10%, transparent 100%);
  mask-image: radial-gradient(240px at var(--x, 50%) var(--y, 50%), #000 10%, transparent 100%);
}

/* line grid */
.background-gradient{
  z-index: -1;
  opacity: 0.35;
  background-image:
    linear-gradient(to right, var(--yellow) 1px, transparent 1px),
    linear-gradient(to bottom, var(--yellow) 1px, transparent 1px);
  background-size: 2rem 2rem;
}

/* soft glow behind the dots */
.flair{
  z-index: -2;
  opacity: 0.5;
  background:
    radial-gradient(90% 80% at 10% 20%, rgba(224,172,0,0.10) 0%, transparent 100%),
    radial-gradient(200% 120% at 50% 0%, rgba(224,172,0,0.22) 0%, transparent 100%);
}

@media (max-width: 767px){
  .background-gradient, .flair{ display: none; }
}

@media (prefers-reduced-motion: reduce){
  .background-gradient, .flair{ display: none; }
}

/* books table */
.book-table{ min-width: 0; }
.book-table td:first-child{ white-space: normal; }
.book-table .num{ text-align: right; white-space: nowrap; }

/* code blocks */
pre{
  background: var(--code-bg);
  border-radius: 6px;
  padding: 0.9rem 1rem;
  margin: 0 0 1.25rem;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.55;
}
pre code{ background: none; padding: 0; font-size: inherit; }

/* diagram zones */
.diagram .zone{ fill: none; stroke: #b5b5b5; stroke-width: 1.2; stroke-dasharray: 5 4; }
.diagram .zone-accent{ stroke: var(--accent); }
.diagram .label{ font-weight: 600; font-size: 12.5px; }

/* before / after note example */
.example{ display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin: 1rem 0 1.5rem; }
.example div{ border: 1px solid var(--border); border-radius: 6px; padding: 0.75rem 1rem; font-size: 0.9rem; }
.example strong{ display: block; font-size: 0.8rem; color: var(--muted); font-weight: 500; margin-bottom: 0.3rem; }
@media (max-width: 600px){ .example{ grid-template-columns: 1fr; } }