/* ogandhi.com
   Palette: sky paper, cell-navy ink, reservoir teal, sun amber (used only for the generation curve). */

@font-face { font-family: "Literata"; src: url("/fonts/literata-latin-wght-normal.woff2") format("woff2"); font-weight: 200 900; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Literata"; src: url("/fonts/literata-latin-ext-wght-normal.woff2") format("woff2"); font-weight: 200 900; font-style: normal; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Literata"; src: url("/fonts/literata-latin-wght-italic.woff2") format("woff2"); font-weight: 200 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("/fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("/fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --paper: #F3F6F7;
  --paper-deep: #E6ECEE;
  --ink: #13233A;
  --ink-soft: #4A5A6E;
  --water: #2F6670;
  --water-deep: #1F4D55;
  --sun: #E7A33E;
  --rule: #CBD5D8;
  --serif: "Literata", Georgia, "Times New Roman", serif;
  --sans: "Atkinson Hyperlegible", "Segoe UI", Arial, sans-serif;
  --measure: 38rem;
  --wide: 68rem;
  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3rem;
  --step-2: 1.6rem;
  --step-3: 2.1rem;
  --step-4: clamp(2.6rem, 5.2vw + 1rem, 4.6rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: var(--step-0);
  line-height: 1.65;
  font-variant-numeric: oldstyle-nums proportional-nums;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--water); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--water-deep); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; border-radius: 2px; }

.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--paper); padding: 0.5rem 1rem; font-family: var(--sans); }
.skip:focus { left: 1rem; }

.wrap { width: min(100% - 2.5rem, var(--wide)); margin-inline: auto; }
.prose { max-width: var(--measure); }

/* Header */
.site-header { padding-block: 1.25rem; }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.75rem 2rem; }
.site-name { font-family: var(--serif); font-weight: 600; font-size: var(--step-1); color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: 0.6rem; letter-spacing: -0.01em; }
.site-name svg { width: 2.1rem; height: auto; flex: none; transform: translateY(-0.15em); }
.site-name:hover { color: var(--ink); }
.nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.4rem; font-family: var(--sans); font-size: 1rem; }
.nav a { color: var(--ink-soft); text-decoration: none; padding-block: 0.2rem; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--sun); }

/* Home hero: one clear-sky day of PV output */
.hero { padding-top: 1rem; }
.day { position: relative; margin-bottom: 2.5rem; }
.day svg { width: 100%; height: auto; overflow: visible; display: block; }
.day .curve { fill: none; stroke: var(--sun); stroke-width: 3; stroke-linecap: round; }
.day .area { fill: var(--sun); opacity: 0.13; }
.day .baseline { stroke: var(--ink); stroke-width: 1.2; }
.day .tick { stroke: var(--ink-soft); stroke-width: 1; }
.day text { font-family: var(--serif); font-size: 16px; fill: var(--ink-soft); font-variant-numeric: lining-nums tabular-nums; }
@media (prefers-reduced-motion: no-preference) {
  .day .curve { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: draw 2.2s cubic-bezier(.45,.05,.3,1) 0.2s forwards; }
  .day .area { opacity: 0; animation: fill 1.2s ease-out 1.6s forwards; }
  @keyframes draw { to { stroke-dashoffset: 0; } }
  @keyframes fill { to { opacity: 0.13; } }
}

.intro { display: grid; grid-template-columns: minmax(0, 1fr) 15rem; gap: 2rem 4rem; align-items: start; }
.intro h1 { font-size: var(--step-4); line-height: 1.02; font-weight: 500; letter-spacing: -0.025em; margin: 0 0 1.25rem; font-variation-settings: "opsz" 72; }
.lede { font-size: var(--step-2); line-height: 1.35; margin: 0 0 1.25rem; max-width: 30ch; font-weight: 400; }
.intro .standing { color: var(--ink-soft); max-width: var(--measure); margin: 0 0 1.5rem; }
.intro figure { margin: 0; }
.intro figure img { border-radius: 2px; filter: saturate(0.92); }
.links { font-family: var(--sans); display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; margin: 0; padding: 0; list-style: none; }

/* Sections */
.section { padding-block: 3.5rem; border-top: 1px solid var(--rule); }
.section:first-of-type { border-top: 0; }
.section > .wrap > h2, .section-title { font-size: var(--step-3); line-height: 1.15; font-weight: 500; letter-spacing: -0.015em; margin: 0 0 0.5rem; }
.section-intro { color: var(--ink-soft); max-width: var(--measure); margin: 0 0 2rem; }

.topics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.25rem 3.5rem; list-style: none; margin: 0; padding: 0; }
.topics li { border-left: 3px solid var(--sun); padding-left: 1.1rem; }
.topics h3 { font-size: var(--step-1); line-height: 1.25; font-weight: 600; margin: 0 0 0.35rem; }
.topics h3 a { color: var(--ink); text-decoration: none; }
.topics h3 a:hover { color: var(--water-deep); text-decoration: underline; }
.topics p { margin: 0; color: var(--ink-soft); }

/* Publication lists */
.pubs { list-style: none; margin: 0; padding: 0; }
.pub { display: grid; grid-template-columns: 3.5rem minmax(0, 1fr); gap: 0 1.25rem; padding-block: 0.9rem; border-top: 1px solid var(--rule); }
.pub:first-child { border-top: 0; }
.pub .year { color: var(--ink-soft); font-variant-numeric: lining-nums tabular-nums; }
.pub .title { font-weight: 600; line-height: 1.4; display: block; color: var(--ink); }
.pub a.title { color: var(--water); }
.pub .authors, .pub .venue { display: block; font-size: var(--step--1); color: var(--ink-soft); line-height: 1.5; }
.pub .authors strong { color: var(--ink); font-weight: 700; }
.pub .venue { font-style: italic; }
.pub[hidden] { display: none; }

.books { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem 3rem; margin: 2.5rem 0 0; padding: 0; list-style: none; }
.book { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.book img { width: 7.5rem; }
.book h3 { font-size: var(--step-0); line-height: 1.35; margin: 0.25rem 0 0.4rem; font-weight: 600; }
.book p { margin: 0; font-size: var(--step--1); color: var(--ink-soft); }

.filters { font-family: var(--sans); display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 2rem; }
.filters button { font: inherit; font-size: 0.95rem; color: var(--ink); background: transparent; border: 1px solid var(--rule); border-radius: 999px; padding: 0.3rem 0.9rem; cursor: pointer; }
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.filters button:hover { border-color: var(--ink); }

.pub-group { margin-top: 3rem; }
.pub-group h2 { font-size: var(--step-2); font-weight: 500; margin: 0 0 0.75rem; }

/* Writing list */
.posts { list-style: none; margin: 0; padding: 0; max-width: var(--measure); }
.posts li { padding-block: 1rem; border-top: 1px solid var(--rule); }
.posts li:first-child { border-top: 0; }
.posts h3 { font-size: var(--step-1); font-weight: 600; line-height: 1.3; margin: 0 0 0.25rem; }
.posts h3 a { color: var(--ink); text-decoration: none; }
.posts h3 a:hover { color: var(--water-deep); text-decoration: underline; }
.posts p { margin: 0; color: var(--ink-soft); }
.meta { font-size: var(--step--1); color: var(--ink-soft); font-variant-numeric: lining-nums; }

/* Inner pages */
.page-head { padding-block: 2.5rem 1.5rem; }
.page-head h1 { font-size: var(--step-3); font-size: clamp(2rem, 3vw + 1rem, 3rem); line-height: 1.1; font-weight: 500; letter-spacing: -0.02em; margin: 0 0 0.75rem; max-width: 22ch; }
.page-head .dek { font-size: var(--step-1); line-height: 1.45; color: var(--ink-soft); margin: 0; max-width: var(--measure); }
.page-body { padding-bottom: 4rem; }
.page-body .prose h2 { font-size: var(--step-2); font-weight: 500; line-height: 1.25; margin: 2.5rem 0 0.75rem; }
.page-body .prose h3 { font-size: var(--step-1); font-weight: 600; margin: 2rem 0 0.5rem; }
.page-body .prose li { margin-bottom: 0.5rem; }
.page-body .prose ul { padding-left: 1.2rem; }
.page-body .prose ul.pubs, .page-body .prose ul.posts { padding-left: 0; }
.page-body .prose .pub-group h2 { margin-top: 0; }
.page-body .prose img { margin: 1.5rem 0 0.5rem; border: 1px solid var(--rule); background: #fff; }
.page-body .prose em:only-child { color: var(--ink-soft); }
.about-grid { display: grid; grid-template-columns: minmax(0, var(--measure)) 15rem; gap: 2rem 4rem; align-items: start; }
.footnotes { font-size: var(--step--1); color: var(--ink-soft); margin-top: 3rem; }
.footnotes hr { border: 0; border-top: 1px solid var(--rule); }
.note { font-family: var(--sans); font-size: var(--step--1); color: var(--ink-soft); border-left: 3px solid var(--rule); padding-left: 1rem; margin: 0 0 2rem; max-width: var(--measure); }
.more { font-family: var(--sans); margin-top: 1.5rem; }

/* Footer */
.site-footer { background: var(--ink); color: #DCE4E7; padding-block: 3rem 2.5rem; margin-top: 2rem; }
.site-footer a { color: #FFFFFF; }
.site-footer h2 { font-size: var(--step-2); font-weight: 500; margin: 0 0 0.75rem; color: #FFFFFF; }
.site-footer p { margin: 0 0 1rem; max-width: var(--measure); }
.site-footer .links a { color: #FFFFFF; }
.site-footer .small { font-variant-numeric: lining-nums; font-size: var(--step--1); color: #B7C4CA; margin-top: 2rem; }

@media (max-width: 52rem) {
  .intro, .about-grid { grid-template-columns: 1fr; }
  .intro figure, .about-grid figure { max-width: 12rem; order: -1; }
  .topics, .books { grid-template-columns: 1fr; }
  .day text { font-size: 22px; }
}
@media (max-width: 30rem) {
  .pub { grid-template-columns: 1fr; }
  .book { grid-template-columns: 5.5rem minmax(0, 1fr); }
  .book img { width: 5.5rem; }
}
@media print {
  .site-header nav, .day, .filters, .site-footer .links { display: none; }
  body { background: #fff; }
}
