/* ---------------------------------------------------------------
   Aman Trivedi — personal site
   A notebook, not a brand page. Two type families, one accent,
   margin notes for meta. Nothing else is trying to get your attention.

   Changes from the first version: --ink-faint darkened/lightened so
   small meta text passes WCAG AA (it was ~3:1); layout helpers for the
   generated pages (tables, related links, focus list, preview banner).
----------------------------------------------------------------*/

:root {
  --paper: #f2f1ec;
  --paper-raised: #e8e6de;
  --ink: #1c2321;
  --ink-soft: #5a5c53;
  --ink-faint: #666a5f;
  --accent: #2b6e63;
  --accent-ink: #f2f1ec;
  --rule: #cac7ba;
  --rule-strong: #a8a597;
  --selection: #cfe3dc;

  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono",
    Consolas, "Liberation Mono", monospace;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino,
    "Book Antiqua", Georgia, serif;

  --measure: 34rem;
  --gutter: 9.5rem;
  --page-max: 52rem;

  color-scheme: light;
}

:root[data-theme="dark"] {
  --paper: #14181a;
  --paper-raised: #1c2224;
  --ink: #e7e6df;
  --ink-soft: #9aa39a;
  --ink-faint: #8a938a;
  --accent: #7ec2b3;
  --accent-ink: #0f1413;
  --rule: #2c3436;
  --rule-strong: #3c4648;
  --selection: #23423b;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #14181a;
    --paper-raised: #1c2224;
    --ink: #e7e6df;
    --ink-soft: #9aa39a;
    --ink-faint: #8a938a;
    --accent: #7ec2b3;
    --accent-ink: #0f1413;
    --rule: #2c3436;
    --rule-strong: #3c4648;
    --selection: #23423b;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

::selection { background: var(--selection); }

html {
  background: var(--paper);
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

a { color: inherit; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.6em 1em;
  z-index: 100;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}
.skip-link:focus { left: 1rem; top: 1rem; }

a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
main:focus { outline: none; }

/* Prose links get an ink-drawn underline that thickens on hover */
.prose a,
.text-link {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--rule-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s ease, text-decoration-thickness 0.15s ease;
}
.prose a:hover,
.text-link:hover {
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
}

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--paper-raised);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

/* ---------------------------------- layout shell */

.shell {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

header.site-header {
  border-bottom: 1px solid var(--rule);
}

.site-header .shell {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  padding-top: 1.75rem;
  padding-bottom: 1.5rem;
}

.header-tools {
  display: flex;
  align-items: baseline;
  gap: 1.1rem;
}

.wordmark {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  color: var(--ink);
  white-space: nowrap;
}

.wordmark .dot { color: var(--accent); }

nav.primary-nav {
  display: flex;
  align-items: baseline;
  gap: 0.55em;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--ink-soft);
}
nav.primary-nav a {
  text-decoration: none;
  color: var(--ink-soft);
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}
nav.primary-nav a:hover { color: var(--ink); border-bottom-color: var(--rule-strong); }
nav.primary-nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
}
nav.primary-nav .sep { color: var(--rule-strong); }

.theme-toggle {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-faint);
  background: none;
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.15em 0.55em;
  cursor: pointer;
  line-height: 1.4;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--rule-strong); }

main { display: block; }

footer.site-footer {
  border-top: 1px solid var(--rule);
  margin-top: 5rem;
}
footer.site-footer .shell {
  padding: 1.75rem 1.5rem 3rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-faint);
}
footer.site-footer a { text-decoration: none; color: var(--ink-faint); }
footer.site-footer a:hover { color: var(--ink); }
footer.site-footer .foot-links { display: flex; gap: 1.1em; flex-wrap: wrap; }

.preview-banner {
  margin: 0;
  padding: 0.5rem 1.5rem;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-align: center;
}

/* ---------------------------------- margin-note grid
   A gutter for dates, tags, and status — set apart from the
   reading column rather than stacked above it as a label. */

.entry {
  display: grid;
  grid-template-columns: var(--gutter) minmax(0, 1fr);
  column-gap: 1.75rem;
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--rule);
}
.entry:last-child { border-bottom: none; }

.entry .margin {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-faint);
  line-height: 1.7;
  padding-top: 0.3rem;
}
.entry .margin div + div { margin-top: 0.4em; }

.entry .body h2,
.entry .body h3 { margin-top: 0; }
.entry .body h2 a.entry-title {
  text-decoration: none;
  color: var(--ink);
}
.entry .body h2 a.entry-title:hover { color: var(--accent); }

.draft-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 3px;
  padding: 0.05em 0.45em;
  margin-left: 0.5em;
  vertical-align: middle;
}

@media (max-width: 680px) {
  .entry { grid-template-columns: 1fr; row-gap: 0.6rem; }
  .entry .margin {
    display: flex;
    flex-wrap: wrap;
    gap: 0 1em;
    padding-top: 0;
    border-left: 2px solid var(--rule-strong);
    padding-left: 0.6em;
  }
  .entry .margin div + div { margin-top: 0; }
}

/* ---------------------------------- hero / page intro */

.hero {
  padding: 3.25rem 0 1.5rem;
}
.hero h1 {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 500;
  margin: 0 0 0.5rem;
  letter-spacing: 0.005em;
}
.hero .tagline {
  font-family: var(--font-serif);
  font-size: 1.55rem;
  line-height: 1.35;
  margin: 0 0 1.25rem;
  max-width: 34ch;
  color: var(--ink);
}
.hero .lede {
  max-width: var(--measure);
  color: var(--ink-soft);
  font-size: 1.05rem;
}
.hero .lede p { margin: 0 0 0.9em; }
.hero .lede a {
  color: var(--ink);
  text-decoration-color: var(--rule-strong);
  text-underline-offset: 3px;
}
.hero .rule-draw {
  height: 1px;
  background: var(--rule-strong);
  margin: 1.75rem 0 0;
  transform-origin: left;
  animation: draw-rule 0.9s cubic-bezier(0.2, 0.7, 0.3, 1) 0.15s both;
}
@keyframes draw-rule {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

.page-intro {
  padding: 3rem 0 1rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 0.5rem;
}
.page-intro .kicker {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-faint);
  margin: 0 0 0.6rem;
}
.page-intro h1 {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
  line-height: 1.25;
}
.page-intro .dek {
  max-width: var(--measure);
  color: var(--ink-soft);
  font-size: 1.05rem;
  margin: 0 0 1.25rem;
}
.page-intro .tags { margin-bottom: 1rem; }
.page-intro .project-links { margin: 0 0 1rem; }

/* ---------------------------------- section headers */

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 3.25rem 0 0;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--rule);
}
.section-head h2 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0;
}
.section-head .more {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  text-decoration: none;
  color: var(--ink-soft);
  white-space: nowrap;
}
.section-head .more:hover { color: var(--accent); }

/* ---------------------------------- listing rows (home summary lists) */

.row-list { list-style: none; margin: 0; padding: 0; }
.row-list li {
  display: grid;
  grid-template-columns: 6rem minmax(0, 1fr);
  column-gap: 1.25rem;
  align-items: baseline;
  padding: 1.05rem 0;
  border-bottom: 1px solid var(--rule);
}
.row-list li:last-child { border-bottom: none; }
.row-list .meta {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-faint);
}
.row-list a.row-link {
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
}
.row-list a.row-link:hover { color: var(--accent); }
.row-list .desc {
  display: block;
  font-weight: 400;
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin-top: 0.2rem;
}
@media (max-width: 560px) {
  .row-list li { grid-template-columns: 1fr; row-gap: 0.2rem; }
}

/* "Right now" list on the home page: plain lines, set off by a rule on the left */
.focus-list {
  list-style: none;
  margin: 1.1rem 0 0;
  padding: 0;
  max-width: var(--measure);
}
.focus-list li {
  padding-left: 0.9rem;
  border-left: 2px solid var(--rule-strong);
  color: var(--ink-soft);
  font-size: 0.98rem;
}
.focus-list li + li { margin-top: 0.7rem; }
.focus-list a { color: var(--ink); text-decoration-color: var(--rule-strong); text-underline-offset: 3px; }
.focus-list a:hover { text-decoration-color: var(--accent); }

.elsewhere {
  margin: 3.25rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ink-faint);
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1.1em;
}

/* ---------------------------------- prose */

.prose { max-width: var(--measure); overflow-wrap: break-word; }
.prose h2 {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  margin: 2.3rem 0 0.75rem;
  scroll-margin-top: 1rem;
}
.prose h3 {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  margin: 1.8rem 0 0.6rem;
  scroll-margin-top: 1rem;
}
.prose h4 {
  font-family: var(--font-serif);
  font-size: 1rem;
  margin: 1.5rem 0 0.5rem;
}
.prose p { margin: 0 0 1.15em; }
.prose ul, .prose ol { margin: 0 0 1.15em; padding-left: 1.3em; }
.prose li { margin-bottom: 0.4em; }
.prose li > ul, .prose li > ol { margin: 0.4em 0 0.4em; }
.prose blockquote {
  margin: 1.5em 0;
  padding-left: 1em;
  border-left: 2px solid var(--accent);
  color: var(--ink-soft);
  font-style: italic;
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose pre {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.5;
  background: var(--paper-raised);
  border-left: 2px solid var(--accent);
  padding: 1em 1.1em;
  overflow-x: auto;
  border-radius: 0 3px 3px 0;
  margin: 1.5em 0;
}
.prose pre code { background: none; padding: 0; font-size: inherit; }
.prose hr { border: none; border-top: 1px solid var(--rule); margin: 2.5em 0; }
.prose strong { font-weight: 700; }
.prose em { font-style: italic; }
.prose img { max-width: 100%; height: auto; display: block; margin: 1.5em 0; }

.table-wrap { overflow-x: auto; margin: 1.5em 0 2.5em; }
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.prose table th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-faint);
  font-weight: 500;
  padding: 0.4em 1em 0.4em 0;
  border-bottom: 1px solid var(--rule-strong);
}
.prose table td {
  padding: 0.6em 1em 0.6em 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
.prose table td:first-child { font-weight: 600; }

/* The /now page: section headings read as small margin labels, like the rest of the notebook */
.prose-now h2 {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ink-faint);
  margin: 2.2rem 0 0.4rem;
}

/* ---------------------------------- breadcrumbs */

.breadcrumbs {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-faint);
  margin: 1.75rem 0 0;
}
.breadcrumbs a { text-decoration: none; color: var(--ink-faint); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs .sep { margin: 0 0.4em; }

/* ---------------------------------- tags */

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4em;
  list-style: none;
  margin: 0 0 1em;
  padding: 0;
}
.tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-soft);
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.15em 0.5em;
}

/* ---------------------------------- related links, status, misc */

.related {
  max-width: var(--measure);
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
}
.related h2 {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ink-faint);
  margin: 0 0 0.6rem;
}
.related ul { list-style: none; margin: 0; padding: 0; }
.related li { margin-bottom: 0.9rem; }
.related .rel-meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-faint);
  margin-left: 0.5em;
}
.related .rel-desc {
  display: block;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.project-links {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1.25em;
}

.empty { color: var(--ink-soft); padding: 2rem 0; }

.status-note {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
}

.back-top {
  display: inline-block;
  margin-top: 3rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  text-decoration: none;
  color: var(--ink-soft);
}
.back-top:hover { color: var(--accent); }

/* ---------------------------------- print: it's a notebook, it should print like one */

@media print {
  html, body { background: #fff; color: #000; }
  .skip-link, .header-tools, .site-footer .foot-links, .back-top, .elsewhere, .preview-banner { display: none !important; }
  .site-header, .site-footer { border-color: #999; }
  .prose a { text-decoration: underline; }
  .prose pre { border-left-color: #666; background: #f4f4f4; white-space: pre-wrap; }
}


/* ---------------------------------- role profile landing pages */

.profile-hero {
  padding: 4.25rem 0 2rem;
  max-width: 46rem;
}

.profile-kicker,
.initiative-kicker,
.initiative-number,
.experience-meta,
.experience-company,
.project-stack,
.root-note {
  font-family: var(--font-mono);
  color: var(--ink-faint);
}

.profile-kicker {
  font-size: 0.78rem;
  margin: 0 0 0.75rem;
  text-transform: lowercase;
}

.profile-hero h1 {
  font-family: var(--font-mono);
  font-size: 1.7rem;
  font-weight: 500;
  margin: 0;
}

.profile-title {
  font-family: var(--font-serif);
  font-size: 2.15rem;
  line-height: 1.2;
  margin: 0.5rem 0 1rem;
  max-width: 22ch;
}

.profile-tagline {
  font-size: 1.28rem;
  line-height: 1.4;
  max-width: 39rem;
  margin: 0 0 1rem;
}

.profile-intro {
  color: var(--ink-soft);
  max-width: 39rem;
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
  align-items: center;
  margin: 1.5rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.button-link {
  display: inline-block;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  border: 1px solid var(--ink);
  padding: 0.45rem 0.7rem;
}

.button-link:hover { background: var(--accent); border-color: var(--accent); }

.proof-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.proof-item {
  padding: 1rem 0.8rem 1.1rem 0;
  min-width: 0;
}

.proof-item + .proof-item { border-left: 1px solid var(--rule); padding-left: 0.8rem; }
.proof-item strong { display: block; font-family: var(--font-mono); font-size: 1.15rem; font-weight: 500; }
.proof-item span { display: block; margin-top: 0.25rem; color: var(--ink-soft); font-size: 0.78rem; line-height: 1.35; }

.profile-section { margin-top: 4rem; }

.initiative-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  margin-top: 1.5rem;
}

.initiative-card {
  background: var(--paper);
  padding: 1.5rem;
}

.initiative-number { margin: 0 0 0.9rem; font-size: 0.72rem; }
.initiative-kicker { font-size: 0.72rem; margin: 0 0 0.4rem; text-transform: lowercase; }
.initiative-card h3 { font-family: var(--font-serif); font-size: 1.35rem; margin: 0 0 0.7rem; }
.initiative-card p { max-width: 38rem; }
.initiative-card .tags { margin-top: 1rem; }

.ownership-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--rule);
}

.ownership-card { padding: 1.25rem 1rem 0 0; }
.ownership-card + .ownership-card { padding-left: 1rem; border-left: 1px solid var(--rule); }
.ownership-card h3 { font-family: var(--font-mono); font-size: 0.82rem; font-weight: 500; margin: 0 0 0.55rem; }
.ownership-card p { color: var(--ink-soft); font-size: 0.92rem; margin: 0; }

.experience-list { border-top: 1px solid var(--rule); }
.experience-item {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr);
  gap: 1.5rem;
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--rule);
}
.experience-meta { font-size: 0.76rem; padding-top: 0.25rem; }
.experience-item h3 { margin: 0; font-family: var(--font-serif); font-size: 1.2rem; }
.experience-company { font-size: 0.76rem; margin: 0.2rem 0 0.7rem; }
.experience-item p:last-child { max-width: 38rem; margin-bottom: 0; }

.profile-project-list { border-top: 1px solid var(--rule); }
.profile-project {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.3rem 0;
  border-bottom: 1px solid var(--rule);
}
.profile-project h3 { margin: 0; font-family: var(--font-serif); font-size: 1.15rem; }
.project-stack { font-size: 0.73rem; margin: 0.25rem 0 0.65rem; }
.profile-project p { max-width: 40rem; }
.profile-project > a { flex: 0 0 auto; font-family: var(--font-mono); font-size: 0.8rem; align-self: center; }

.profile-footer-cta {
  margin: 4rem 0 1rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}
.profile-footer-cta p { margin: 0.25rem 0; }

.root-gateway {
  min-height: 68vh;
  display: grid;
  place-content: center;
  text-align: center;
}
.root-mark { font-family: var(--font-mono); font-size: 1rem; margin: 0; }
.root-mark .dot { color: var(--accent); }
.root-note { font-size: 0.72rem; margin: 0.35rem 0 0; }

@media (max-width: 800px) {
  .proof-grid { grid-template-columns: repeat(3, 1fr); }
  .proof-item:nth-child(4) { border-left: none; padding-left: 0; }
  .proof-item:nth-child(n+4) { border-top: 1px solid var(--rule); }
  .initiative-grid { grid-template-columns: 1fr; }
  .ownership-grid { grid-template-columns: repeat(2, 1fr); }
  .ownership-card:nth-child(3) { border-left: none; padding-left: 0; border-top: 1px solid var(--rule); }
  .ownership-card:nth-child(4) { border-top: 1px solid var(--rule); }
}

@media (max-width: 560px) {
  .profile-hero { padding-top: 2.75rem; }
  .profile-title { font-size: 1.75rem; }
  .profile-tagline { font-size: 1.1rem; }
  .proof-grid { grid-template-columns: repeat(2, 1fr); }
  .proof-item + .proof-item { border-left: none; padding-left: 0; }
  .proof-item:nth-child(even) { border-left: 1px solid var(--rule); padding-left: 0.8rem; }
  .proof-item:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .ownership-grid { grid-template-columns: 1fr; }
  .ownership-card,
  .ownership-card + .ownership-card { padding-left: 0; border-left: none; border-bottom: 1px solid var(--rule); padding-bottom: 1rem; }
  .experience-item { grid-template-columns: 1fr; gap: 0.25rem; }
  .profile-project { display: block; }
  .profile-project > a { display: inline-block; margin-top: 0.6rem; }
}
