/*
  Danial Hazarika: site styles.
  Black canvas, warm neutrals, one accent color. Fonts are Geist, Geist Mono
  and Geist Pixel (Triangle), self-hosted under the SIL Open Font License
  (see fonts-license.txt).
*/

@font-face { font-family: "Geist"; src: url("geist.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("geist-mono.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Pixel Triangle"; src: url("geist-pixel-triangle.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --canvas: #000000;
  --parchment: #efe6d8;
  --bone: #aca69c;
  --ash: #736e68;
  --charcoal: #605c56;
  --hairline: #2a2724;
  --accent: #ffb000;

  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --pixel: "Geist Pixel Triangle", "Geist Mono", ui-monospace, monospace;

  --page: 1400px;
  --gutter: clamp(20px, 5vw, 64px);
  --section-gap: clamp(104px, 13vw, 200px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--parchment);
  font: 400 17px/1.6 var(--sans);
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv03", "cv04", "cv09", "cv11";
}
::selection { background: var(--accent); color: var(--canvas); }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
img, svg { max-width: 100%; height: auto; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
p { margin: 0; }

.page-container { width: 100%; max-width: var(--page); margin-inline: auto; padding-inline: var(--gutter); }

.skip-link { position: absolute; left: -9999px; top: 12px; background: var(--accent); color: var(--canvas); padding: 8px 14px; border-radius: 1000px; font: 500 13px var(--sans); z-index: 50; }
.skip-link:focus { left: 12px; }

/* Header: name on the left, three links on the right */
.site-header { border-bottom: 1px solid var(--hairline); }
.header-shell { max-width: var(--page); margin-inline: auto; padding: 22px var(--gutter); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand-name { font: 600 15px/1 var(--sans); letter-spacing: -0.013em; color: var(--parchment); }
.site-nav { display: flex; gap: 28px; }
.site-nav a { font: 500 14px/1 var(--sans); letter-spacing: -0.02em; color: var(--bone); transition: color .2s; }
.site-nav a:hover { color: var(--parchment); }
.site-nav a[aria-current="page"] { color: var(--accent); }

/* Shared pieces */
.primary-button { display: inline-flex; align-items: center; gap: 10px; background: var(--accent); color: var(--canvas); border-radius: 40px; padding: 13px 22px; font: 500 14px/1 var(--sans); letter-spacing: -0.02em; transition: background .2s; }
.primary-button:hover { background: var(--parchment); }
.text-link, .inverted-link { display: inline-flex; gap: 8px; align-items: center; font: 500 14px/1.2 var(--sans); letter-spacing: -0.02em; color: var(--parchment); padding-bottom: 3px; border-bottom: 1px solid var(--charcoal); transition: color .2s, border-color .2s; }
.text-link:hover, .inverted-link:hover { color: var(--accent); border-color: var(--accent); }
.empty-line { color: var(--bone); font-size: 16px; }

/* Section labels in the pixel face */
.section-head h2, .project-teaser h2, .method h2 { font: 400 30px/1.33 var(--pixel); letter-spacing: -0.033em; text-transform: uppercase; color: var(--parchment); }

/* Homepage */
.home-hero { padding-top: clamp(88px, 12vw, 176px); padding-bottom: var(--section-gap); }
.hero-copy { max-width: 980px; }
.hero-copy h1 { font: 600 clamp(40px, 5.6vw, 80px)/1.04 var(--sans); letter-spacing: -0.04em; color: var(--parchment); }
.hero-copy h1 em { font-style: normal; color: var(--bone); }
.hero-copy > p { max-width: 600px; margin: 36px 0 40px; color: var(--bone); font-size: clamp(17px, 1.4vw, 19px); line-height: 1.6; }

.featured-section { padding-bottom: var(--section-gap); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; margin-bottom: 40px; }

.article-card { border-top: 1px solid var(--charcoal); }
.article-card + .article-card { border-top-color: var(--hairline); }
.article-card-main { padding: 36px 0 40px; }
.article-card-link h3 { max-width: 900px; font: 600 clamp(26px, 2.8vw, 38px)/1.12 var(--sans); letter-spacing: -0.03em; color: var(--parchment); transition: color .2s; }
.card-arrow { color: var(--accent); font-weight: 400; margin-left: 10px; }
.article-card-link:hover h3 { color: var(--accent); }
.article-card-main > p { max-width: 680px; margin-top: 16px; color: var(--bone); font-size: 16px; line-height: 1.6; }
.article-card-meta { display: flex; gap: 24px; margin-top: 22px; font: 400 12px/1.2 var(--mono); letter-spacing: 0.02em; color: var(--ash); text-transform: uppercase; }

.project-teaser { padding-bottom: var(--section-gap); }
.project-teaser-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; padding-top: 40px; background: linear-gradient(var(--charcoal), var(--charcoal)) center top / calc(100% - 2 * var(--gutter)) 1px no-repeat; }
.project-teaser-right p { max-width: 520px; color: var(--bone); font-size: 17px; line-height: 1.6; margin-bottom: 24px; }

.method { padding-bottom: var(--section-gap); }
.method h2 { margin-bottom: 40px; }
.method-steps { list-style: none; counter-reset: step; margin: 0; padding: 0; max-width: 900px; border-top: 1px solid var(--charcoal); }
.method-steps li { counter-increment: step; display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 8px; padding: 22px 0; border-bottom: 1px solid var(--hairline); color: var(--parchment); font-size: clamp(17px, 1.4vw, 20px); line-height: 1.5; letter-spacing: -0.015em; }
.method-steps li::before { content: counter(step, decimal-leading-zero); font: 400 13px/1.9 var(--mono); color: var(--ash); }

/* Writing, Projects and About page headers */
.listing-hero { padding-top: clamp(88px, 11vw, 160px); padding-bottom: 72px; }
.listing-hero h1 { font: 400 clamp(44px, 6vw, 84px)/1.1 var(--pixel); letter-spacing: -0.033em; text-transform: uppercase; color: var(--parchment); }
.listing-dek { margin-top: 28px; }
.listing-rule { display: none; }
.listing-dek p { max-width: 620px; color: var(--bone); font-size: 18px; line-height: 1.6; }
.listing-content, .projects-content { padding-bottom: var(--section-gap); }
.listing-content .article-card:last-child { border-bottom: 1px solid var(--hairline); }

.about-content { padding-bottom: var(--section-gap); }
.about-text { max-width: 720px; border-top: 1px solid var(--charcoal); padding-top: 40px; }
.about-text p { font-size: 18px; line-height: 1.7; color: var(--parchment); margin-bottom: 22px; }
.about-text p:last-of-type { color: var(--bone); }
.about-text .primary-button { margin-top: 16px; }

.not-found { min-height: 60vh; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 24px; padding-block: 120px; }
.not-found h1 { font: 400 clamp(44px, 6vw, 84px)/1.1 var(--pixel); text-transform: uppercase; letter-spacing: -0.033em; }
.not-found p { color: var(--bone); font-size: 18px; }

/* Article cover */
.memo-cover-inner { padding-top: 40px; padding-bottom: 64px; }
.memo-breadcrumbs { font: 400 12px/1 var(--mono); letter-spacing: 0.02em; text-transform: uppercase; }
.memo-breadcrumbs a { color: var(--ash); transition: color .2s; }
.memo-breadcrumbs a:hover { color: var(--parchment); }
.memo-cover-grid { padding-top: clamp(56px, 8vw, 112px); max-width: 960px; }
.memo-kind { display: flex; gap: 10px; font: 400 12px/1 var(--mono); letter-spacing: 0.02em; color: var(--ash); text-transform: uppercase; }
.memo-kind span { color: var(--charcoal); }
.live-square { display: none; }
.memo-headings h1 { margin: 24px 0 24px; font: 600 clamp(36px, 4.6vw, 64px)/1.06 var(--sans); letter-spacing: -0.04em; color: var(--parchment); }
.memo-headings h1.is-long { font-size: clamp(34px, 3.9vw, 54px); line-height: 1.08; }
.memo-subtitle { max-width: 720px; color: var(--bone); font-size: clamp(18px, 1.6vw, 21px); line-height: 1.5; letter-spacing: -0.015em; }
.memo-author { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--hairline); max-width: 720px; }
.memo-author > span { display: flex; flex-direction: column; gap: 8px; }
.memo-author b { font: 600 14px/1 var(--sans); color: var(--parchment); letter-spacing: -0.013em; }
.memo-author small { font: 400 12px/1.5 var(--mono); color: var(--ash); letter-spacing: 0.02em; }

.reading-progress { position: sticky; top: 0; z-index: 20; height: 2px; background: transparent; }
#reading-bar { display: block; height: 100%; width: 0; background: var(--accent); }

.archive-banner { border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); }
.archive-banner > div { padding-top: 14px; padding-bottom: 14px; font: 400 12px/1.5 var(--mono); color: var(--ash); letter-spacing: 0.01em; }

/* Article body */
.memo-layout { display: grid; grid-template-columns: 220px minmax(0, 720px); column-gap: clamp(40px, 6vw, 104px); padding-top: 72px; padding-bottom: var(--section-gap); }
.memo-sidebar-sticky { position: sticky; top: 32px; }
.side-label { font: 400 12px/1 var(--mono); letter-spacing: 0.02em; color: var(--ash); padding-bottom: 14px; margin-bottom: 8px; border-bottom: 1px solid var(--hairline); }
.toc-nav { display: flex; flex-direction: column; }
.toc-link { display: block; padding: 8px 0; font: 500 13px/1.35 var(--sans); letter-spacing: -0.02em; color: var(--ash); transition: color .2s; }
.toc-link:hover { color: var(--parchment); }
.toc-link.is-active { color: var(--accent); }
.mobile-toc { display: none; }

.memo-body { font-size: 18px; line-height: 1.7; color: var(--parchment); letter-spacing: -0.008em; }
.memo-body > :first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.memo-body p { margin: 0 0 1.25em; }
.memo-body h2 { margin: 72px 0 22px; padding-top: 28px; border-top: 1px solid var(--charcoal); font: 600 clamp(24px, 2.2vw, 30px)/1.2 var(--sans); letter-spacing: -0.03em; color: var(--parchment); scroll-margin-top: 32px; }
.memo-body h3 { margin: 48px 0 16px; font: 600 21px/1.3 var(--sans); letter-spacing: -0.02em; scroll-margin-top: 32px; }
.memo-body a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.memo-body a:hover { color: var(--parchment); }
.memo-body strong { font-weight: 600; color: var(--parchment); }
.memo-body em { font-style: italic; }
.memo-body ul, .memo-body ol { margin: 0 0 1.25em; padding-left: 22px; }
.memo-body li { margin-bottom: 8px; }
.memo-body li::marker { color: var(--ash); }
.memo-body blockquote { margin: 32px 0; padding: 4px 0 4px 20px; border-left: 2px solid var(--accent); color: var(--bone); }
.memo-body blockquote p:last-child { margin-bottom: 0; }
.memo-body hr { border: 0; height: 1px; background: var(--hairline); margin: 56px 0; }
.memo-body code { font: 400 0.88em var(--mono); color: var(--parchment); }
.memo-body pre { background: #0d0c0b; border: 1px solid var(--hairline); padding: 20px; overflow-x: auto; font-size: 14px; }
.memo-body table { width: 100%; border-collapse: collapse; margin: 32px 0 40px; font-size: 15px; line-height: 1.5; }
.memo-body th { text-align: left; vertical-align: bottom; padding: 0 16px 12px 0; border-bottom: 1px solid var(--charcoal); font: 400 12px/1.3 var(--mono); letter-spacing: 0.02em; text-transform: uppercase; color: var(--ash); }
.memo-body td { vertical-align: top; padding: 14px 16px 14px 0; border-bottom: 1px solid var(--hairline); color: var(--bone); }
.memo-body td:first-child { color: var(--parchment); font-weight: 500; min-width: 140px; }
.memo-body > p:last-child:has(> em:only-child) { color: var(--ash); font-size: 15px; }

.end-of-article { margin-top: 72px; padding-top: 24px; border-top: 1px solid var(--hairline); }

/* Footer */
.site-footer { border-top: 1px solid var(--hairline); }
.site-footer > div { max-width: var(--page); margin-inline: auto; padding-inline: var(--gutter); }
.footer-middle { padding-top: 40px; padding-bottom: 28px; }
.footer-middle nav { display: flex; flex-wrap: wrap; gap: 24px; }
.footer-middle nav a { font: 400 13px/1 var(--mono); color: var(--ash); transition: color .2s; }
.footer-middle nav a:hover { color: var(--parchment); }
.footer-bottom { padding-bottom: 40px; font: 400 12px/1 var(--mono); color: var(--charcoal); letter-spacing: 0.02em; }

/* Tablet and phone */
@media (max-width: 960px) {
  .memo-layout { grid-template-columns: minmax(0, 1fr); padding-top: 48px; }
  .memo-sidebar { display: none; }
  .mobile-toc { display: block; margin-bottom: 48px; border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); }
  .mobile-toc summary { display: flex; justify-content: space-between; cursor: pointer; list-style: none; padding: 16px 0; font: 400 12px var(--mono); letter-spacing: 0.02em; color: var(--ash); }
  .mobile-toc summary::-webkit-details-marker { display: none; }
  .mobile-toc .toc-nav { padding-bottom: 12px; }
  .project-teaser-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .header-shell { padding-block: 18px; }
  .site-nav { gap: 18px; }
  .section-head h2, .project-teaser h2, .method h2 { font-size: 24px; }
  .memo-body { font-size: 17px; }
  .memo-body table { font-size: 14px; }
  .memo-body td:first-child { min-width: 110px; }
  .method-steps li { grid-template-columns: 40px minmax(0, 1fr); }
}

@media print {
  body { background: #fff; color: #111; }
  .site-header, .site-footer, .reading-progress, .memo-sidebar, .mobile-toc, .memo-breadcrumbs { display: none; }
  .memo-body, .memo-body td, .memo-body td:first-child, .memo-headings h1, .memo-subtitle { color: #111; }
  .memo-body a { color: #111; }
}
