/* dogl.uk theme on top of Minima: Himalayan blue, snow and night, with the Himalayan dog from the favicon photo as a silhouette.
   Young Serif (display) + Instrument Sans (text), both SIL Open Font License.
   Light and dark are the same tokens; html[data-theme] is set in head.html before paint. */

@font-face { font-family: "Young Serif"; src: url("/assets/fonts/youngserif.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("/assets/fonts/instrumentsans-normal.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("/assets/fonts/instrumentsans-italic.woff2") format("woff2"); font-weight: 400 700; font-style: italic; font-display: swap; }

/* Palette sampled from the favicon photo: a Himalayan valley at dusk, ridges in layered blue,
   one warm note where the sun catches the cloud (the dog's nose star). */
:root {
  --bg: #F6F9FC;            /* snow, a breath of sky */
  --surface: #FFFFFF;
  --ink: #12233B;
  --muted: #5A6B83;
  --line: #DCE5F0;
  --accent: #2F5E9E;        /* Himalayan blue, lifted */
  --accent-soft: #E6EEF8;
  --accent-line: #C2D3EA;
  --star: #8A5B12;          /* the cloud gold, darkened for text */
  --paw: #E9B45E;           /* sunlit cloud */
  --sunset: #F08A4B;        /* the dog's nose, catching the last light */
  --band: linear-gradient(180deg, #4A74AA 0%, #6A8EC0 70%, #7C9DC8 100%);   /* the valley's middle distance */
  --band-solid: #4A74AA;
  --band-ink: #FFFFFF;
  --band-muted: #EAF1FA;
  --ridge-0: #B4C8E4; --ridge-1: #D4E0F0; --ridge-2: #F6F9FC;
  --dog-line: #EAF1FA;
  --paper: var(--bg);
  --display: "Young Serif", "Iowan Old Style", Georgia, serif;
  --text: "Instrument Sans", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: var(--display);
  --brass: var(--star);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #111F38;            /* night over the ridges, not black */
  --surface: #162846;
  --ink: #E9F0F9;
  --muted: #A3B5CE;
  --line: #243A5E;
  --accent: #A9C8EE;        /* mist */
  --accent-soft: #1C3559;
  --accent-line: #36588A;
  --star: #F0CD8C;
  --paw: #F0C27A;
  --sunset: #F4A06A;
  --band: linear-gradient(180deg, #1C3358 0%, #26426D 100%);
  --band-solid: #1C3358;
  --band-ink: #F1F5FB;
  --band-muted: #C9D8EE;
  --ridge-0: #2F4E7C; --ridge-1: #203A62; --ridge-2: #111F38;
  --dog-line: #C9D8EE;
  color-scheme: dark;
}

/* ---- base */
html { background: var(--bg); }
body { background: var(--bg); color: var(--ink); font-family: var(--text); font-size: 17px; line-height: 1.6; }
h1, h2, h3, h4, .page-heading, .post-title { font-family: var(--display); font-weight: 400; color: var(--ink); letter-spacing: 0; }
.page-heading, .post-title { font-size: clamp(2.2rem, 5vw, 3.1rem); line-height: 1.1; margin-bottom: 1.25rem; color: var(--accent); }
.post-content h2, .page-content h2 { font-size: 1.75rem; margin-top: 2rem; }
.post-content h3, .page-content h3 { font-size: 1.3rem; }
a, a:visited { color: var(--accent); text-decoration: underline; text-decoration-color: var(--accent-line); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); text-decoration-color: currentColor; }
:root[data-theme="dark"] a, :root[data-theme="dark"] a:visited { color: var(--accent); }
::selection { background: var(--paw); color: #0C1B33; }
:focus-visible { outline: 2px solid var(--paw); outline-offset: 2px; }
.post-meta, .footer-col-3, .contact-list { color: var(--muted); }
blockquote { border-left: 3px solid var(--accent-line); color: var(--muted); font-style: normal; letter-spacing: 0; }
code, pre { background: var(--surface); border-color: var(--line); color: var(--ink); }
table { color: var(--ink); border-color: var(--line); }
table th { background: var(--accent-soft); border-color: var(--line); }
table td { border-color: var(--line); }
table tr:nth-child(even) { background: var(--surface); }
img { border-radius: 3px; }

/* section rule: a small Himalayan ridgeline instead of a hairline */
.page-content hr, .post-content hr {
  border: 0; height: 14px; margin: 2.25rem auto; width: 120px; background: var(--accent-line);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 14'%3E%3Cpath d='M2 12 L22 7 L32 10 L50 2 L64 8 L78 5 L96 11 L118 8' stroke='black' stroke-width='1.3' stroke-linejoin='round' stroke-linecap='round' fill='none'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 14'%3E%3Cpath d='M2 12 L22 7 L32 10 L50 2 L64 8 L78 5 L96 11 L118 8' stroke='black' stroke-width='1.3' stroke-linejoin='round' stroke-linecap='round' fill='none'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ---- the dog: the Himalayan from the favicon photo, as a silhouette (scripts/dog-svg.py) */
.dog { display: block; overflow: visible; }
.dog .dog-body { fill: var(--dog-line); }
/* a very faint sunset on the nose, the one warm note */
.dog .dog-nose { fill: var(--sunset); opacity: .85; filter: blur(3.5px); }

/* ---- header band */
.site-header { background: var(--band); border-top: 0; border-bottom: 0; min-height: 0; position: relative; padding-bottom: 18px; }
.site-header .ridges { position: absolute; left: 0; bottom: -1px; width: 100%; height: 26px; display: block; pointer-events: none; }
.ridges .ridge-0 { fill: var(--ridge-0); opacity: .7; }
.ridges .ridge-1 { fill: var(--ridge-1); opacity: .9; }
.ridges .ridge-2 { fill: var(--bg); }
.site-header .wrapper { position: relative; z-index: 1; }
.site-header .wrapper { display: flex; align-items: flex-end; gap: 1rem; min-height: 76px; padding-top: .6rem; }
.site-brand { display: flex; align-items: flex-end; gap: .55rem; text-decoration: none !important; margin-right: auto; padding-bottom: .55rem; }
.site-brand .dog { height: 56px; width: auto; margin-bottom: -4px; }
.site-title, .site-title:visited { font-family: var(--display); font-weight: 400; font-size: 1.45rem; letter-spacing: 0; line-height: 1; color: var(--band-ink); float: none; margin: 0; white-space: nowrap; }
.site-nav { float: none; line-height: 1; padding-bottom: .9rem; display: flex; align-items: center; gap: .25rem; position: static; }
.site-nav .page-link, .site-nav .page-link:visited { color: var(--band-muted); font-size: .98rem; text-decoration: none; padding: .3rem .1rem; border-bottom: 2px solid transparent; }
.site-nav .page-link:hover { color: var(--band-ink); }
.site-nav .page-link[aria-current="page"] { color: var(--band-ink); border-bottom-color: var(--paw); }
.site-nav .page-link:not(:last-child) { margin-right: 14px; }
.theme-toggle { background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .45); color: var(--band-ink); border-radius: 999px; width: 34px; height: 34px; display: inline-grid; place-items: center; cursor: pointer; margin-left: .6rem; padding: 0; flex: none; }
.theme-toggle:hover { border-color: var(--band-muted); }
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }
.site-nav .menu-icon > svg path { fill: var(--band-ink); }
@media screen and (max-width: 600px) {
  .site-header .wrapper { min-height: 64px; }
  .site-brand .dog { height: 40px; }
  .site-title { font-size: 1.2rem; }
  .site-nav { padding-bottom: .7rem; }
  .site-nav .trigger { display: none; }
  .site-nav .nav-trigger:checked ~ .trigger { display: block; position: absolute; top: 100%; right: 15px; z-index: 20; background: var(--band-solid); border-radius: 0 0 8px 8px; padding: .6rem 1rem .8rem; min-width: 11rem; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }
  .site-nav .nav-trigger:checked ~ .trigger .page-link { display: block; margin: 0; padding: .45rem 0; }
  .site-nav label[for="nav-trigger"] { display: block; width: 36px; height: 36px; cursor: pointer; }
  .site-nav .menu-icon { display: block; width: 36px; height: 26px; line-height: 0; padding-top: 10px; text-align: center; }
  .site-nav { position: static; background: none; border: 0; right: auto; top: auto; }
}

/* ---- Kannada spine, like the film frames */
.spine { position: fixed; right: 18px; top: 50%; transform: translateY(-50%); writing-mode: vertical-rl; font-family: "Noto Sans Kannada", var(--text); font-size: 1.15rem; letter-spacing: .08em; color: var(--muted); opacity: .6; pointer-events: none; user-select: none; }
@media (max-width: 1100px) { .spine { display: none; } }

/* ---- footer */
.site-footer { background: var(--surface); border-top: 1px solid var(--line); color: var(--muted); }
.site-footer .footer-heading { font-family: var(--display); font-weight: 400; font-size: 1.3rem; color: var(--ink); }
.footer-nav { display: flex; flex-wrap: wrap; gap: .35rem 1.1rem; margin: .2rem 0 1.2rem; font-family: var(--display); font-size: 1.02rem; }
.footer-nav a { color: var(--accent); text-decoration: none; border-bottom: 1px solid transparent; }
.footer-nav a:hover, .footer-nav a[aria-current="page"] { border-bottom-color: var(--accent-line); }
.footer-credit { font-size: .78rem; color: var(--muted); margin: 1.2rem 0 0; clear: both; }
.footer-credit a { color: var(--muted); }
.social-media-list a, .social-media-list a:visited { color: var(--accent); }

/* ---- home */
.home-hero { margin: .5rem 0 1.5rem; }
.home-hero p { margin: 0; font-family: var(--display); font-size: clamp(1.3rem, 2.6vw, 1.7rem); line-height: 1.3; color: var(--accent); max-width: 22ch; }

/* ---- shared filter pills (writing, bookshelf, education) */
.wfilter label:has(input:checked), .shelf-filter label:has(input:checked) { background: var(--accent-soft) !important; color: var(--accent) !important; border-color: var(--accent-line) !important; }
.wfilter label, .shelf-filter label { color: var(--muted) !important; }
.wtag { color: var(--accent) !important; background: var(--accent-soft) !important; }

/* ---- bio switcher on /about/ */
.bio-tabs { display: flex; flex-wrap: wrap; gap: .3rem; margin: 0 0 1rem; }
.bio-tabs button { font: inherit; font-size: .92rem; cursor: pointer; padding: .25rem .8rem; border-radius: 999px; border: 1px solid transparent; background: none; color: var(--muted); }
.bio-tabs button[aria-selected="true"] { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }
.bio-tabs button:focus-visible { outline: 2px solid var(--paw); outline-offset: 1px; }
.bio-panel[hidden] { display: none; }
.bio-copy { font-size: .85rem; margin-top: .5rem; color: var(--muted); }
.bio-copy button { font: inherit; background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; text-decoration-color: var(--accent-line); text-underline-offset: 3px; cursor: pointer; }
.about-list { list-style: none; margin: 0; padding: 0; }
.about-list li { padding: .45rem 0; border-top: 1px solid var(--line); margin: 0; }
.about-list li span { color: var(--muted); }

/* ---- cover shelf (currently reading) */
.cover-shelf { list-style: none; margin: .5rem 0 1.5rem; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 1.3rem 1rem; }
.cover-shelf li { margin: 0; }
.cover-shelf-link { display: block; text-decoration: none !important; }
.cover-shelf img { display: block; width: 100%; height: auto; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 2px 5px 5px 2px; box-shadow: inset 4px 0 0 rgba(0, 0, 0, .12), 0 6px 16px rgba(18, 35, 59, .16); background: var(--accent-soft); transition: transform .2s ease; }
.cover-shelf-link:hover img, .cover-shelf-link:focus-visible img { transform: translateY(-3px); }
.cover-shelf-title { display: block; margin-top: .55rem; font-family: var(--display); font-size: .98rem; line-height: 1.25; color: var(--ink); }
.cover-shelf-link:hover .cover-shelf-title { color: var(--accent); }
.cover-shelf-meta { display: block; font-size: .8rem; color: var(--muted); margin-top: .15rem; }
:root[data-theme="dark"] .cover-shelf img { box-shadow: inset 4px 0 0 rgba(0, 0, 0, .2), 0 6px 18px rgba(0, 0, 0, .45); }
@media (prefers-reduced-motion: reduce) { .cover-shelf img { transition: none; } }

/* ---- reading list (/reading/, data in _data/reading_list.yml) */
.rl-toc { display: flex; flex-wrap: wrap; gap: .45rem; margin: .4rem 0 1.6rem; }
.rl-toc a { font-size: .85rem; padding: .22rem .7rem; border: 1px solid var(--accent-line); border-radius: 999px; background: var(--accent-soft); color: var(--accent); text-decoration: none; }
.rl-toc a:hover, .rl-toc a:focus-visible { border-color: var(--accent); }
.rl-section { margin: 0 0 1.8rem; padding-top: .9rem; border-top: 1px solid var(--line); scroll-margin-top: 1rem; }
.rl-section h3 { font-family: var(--display); font-weight: 400; font-size: 1.25rem; margin: 0 0 .6rem; }
.rl-section h4 { font-size: .78rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 1rem 0 .4rem; }
.rl-items { list-style: none; margin: 0; padding: 0; }
.rl-items li { margin: 0 0 .7rem; padding-left: .9rem; border-left: 2px solid var(--accent-line); line-height: 1.45; }
.rl-items cite { font-style: italic; color: var(--ink); }
.rl-by { color: var(--muted); font-size: .88rem; }
.rl-by::before { content: "· "; }

/* ---- quote cards in jots (_includes/quote.html) */
.qcard { margin: 1.4rem 0; padding: .9rem 1.1rem .75rem; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent-line); border-radius: 4px 8px 8px 4px; }
.qcard-body p { margin: 0 0 .6rem; line-height: 1.55; overflow-wrap: anywhere; }
.qcard-part + .qcard-part { border-top: 1px dashed var(--line); padding-top: .6rem; }
.qcard figcaption { font-size: .82rem; color: var(--muted); margin-top: .2rem; }
.qcard figcaption a { color: var(--muted); }
.qcard-platform { font-weight: 600; letter-spacing: .02em; }
.qcard-missing { color: var(--star); font-size: .9rem; }

/* ---- words per year (_includes/words-chart.html, data in _data/archive/words.json) */
.wchart { margin: .6rem 0 1rem; }
.wchart-plot { position: relative; padding: 1.7rem 0 1.2rem 2.4rem; }
.wchart-unit { position: absolute; top: 0; left: 0; font-size: .72rem; color: var(--muted); }
.wchart-grid { position: absolute; left: 2.4rem; right: 0; top: 1.7rem; bottom: 1.2rem; pointer-events: none; }
.wchart-tick { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); }
.wchart-tick:first-child { border-top-color: var(--accent-line); }
.wchart-tick b { position: absolute; right: 100%; margin-right: .45rem; transform: translateY(-50%); font-weight: 400; font-size: .68rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.wchart-bars { display: flex; align-items: flex-end; gap: 3px; height: 140px; position: relative; }
.wchart-col { flex: 1 1 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; position: relative; min-width: 0; }
.wchart-stack { display: flex; flex-direction: column-reverse; min-height: 1px; border-radius: 2px 2px 0 0; overflow: hidden; }
.wchart-seg { display: block; flex-basis: 0; min-height: 0; }
.wchart-year { position: absolute; bottom: -1.25rem; left: 0; right: 0; text-align: center; font-size: .68rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.ws-1 { background: var(--accent); } .ws-2 { background: color-mix(in srgb, var(--accent) 72%, var(--bg)); }
.ws-3 { background: color-mix(in srgb, var(--accent) 50%, var(--bg)); } .ws-4 { background: color-mix(in srgb, var(--accent) 32%, var(--bg)); }
.ws-5 { background: color-mix(in srgb, var(--accent) 18%, var(--bg)); outline: 1px solid var(--accent-line); outline-offset: -1px; }
.wchart-legend { display: flex; flex-wrap: wrap; gap: .3rem 1rem; margin-top: .6rem; padding-left: 2.4rem; font-size: .8rem; color: var(--muted); }
.wchart-legend i { display: inline-block; width: .7rem; height: .7rem; border-radius: 2px; margin-right: .35rem; vertical-align: -1px; }
.wchart-note { font-size: .88rem; color: var(--muted); }
@media (max-width: 600px) { .wchart-bars { gap: 2px; } .wchart-year { font-size: .6rem; } }

/* Papers (_papers): where a piece was first published, above the full text */
.paper-note { color: var(--muted); font-size: .95rem; border-left: 3px solid var(--accent-line); padding-left: .9rem; margin-bottom: 2rem; }
