﻿/* ------------------------------------------------------------------ */
/*  Arjun Nagendran — writing                                          */
/*  A quiet reading layer built on the same paper, ink and ember       */
/*  palette as the experience.                                        */
/* ------------------------------------------------------------------ */

:root {
  --ivory: #f4eee2;
  --paper: #faf7f0;
  --paper-deep: #efe7d8;
  --ink: #241f19;
  --ink-soft: #5f5448;
  --ink-faint: #756657;
  --line: #d7cbb8;
  --line-strong: #b9a98f;
  --ember: #b45a32;
  --ember-dark: #8c3f21;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --max: 1120px;
  --read: 68ch;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: rgba(180, 90, 50, .18); }

a { color: inherit; }
img { max-width: 100%; }

:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 4px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 100;
  background: var(--ink);
  color: var(--ivory);
  padding: 10px 14px;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none;
  transition: top .2s;
}
.skip-link:focus { top: 16px; }

/* ------------------------------------------------------------------ */
/*  Masthead                                                          */
/* ------------------------------------------------------------------ */

.blog-head {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(244, 238, 226, .94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.head-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 17px clamp(20px, 5vw, 44px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 450;
  letter-spacing: -.05em;
  line-height: 1;
  text-decoration: none;
}
.brand span { color: var(--ember); }

.blog-nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.6vw, 30px);
  font-size: 10px;
  letter-spacing: .17em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.blog-nav a {
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  text-decoration: none;
  transition: color .2s, border-color .2s;
}
.blog-nav a:hover,
.blog-nav a:focus-visible,
.blog-nav a[aria-current="page"] {
  color: var(--ember-dark);
  border-color: var(--ember-dark);
}

/* ------------------------------------------------------------------ */
/*  Index                                                             */
/* ------------------------------------------------------------------ */

.blog-hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(58px, 10vw, 112px) clamp(20px, 5vw, 44px) clamp(38px, 6vw, 64px);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin: 0 0 1.1rem;
  color: var(--ember-dark);
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
}
.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--ember);
}

.blog-hero h1 {
  margin: 0 0 1.2rem;
  font-family: var(--serif);
  font-size: clamp(4rem, 10vw, 7.6rem);
  font-weight: 350;
  letter-spacing: -.065em;
  line-height: .88;
}

.lede {
  max-width: 52ch;
  margin: 0;
  color: var(--ink-soft);
  font-size: clamp(1.05rem, 1.5vw, 1.3rem);
  line-height: 1.55;
}

.hero-meta {
  margin: 1.7rem 0 0;
  color: var(--ink-faint);
  font-size: 9px;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.hero-meta span { color: var(--line-strong); }

.featured {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(36px, 5vw, 56px) clamp(20px, 5vw, 44px);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}

.featured-kicker {
  margin: 0;
  color: var(--ember-dark);
  font-size: 9px;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.featured-title {
  margin: .35em 0 .5em;
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 3.4rem);
  font-weight: 400;
  letter-spacing: -.045em;
  line-height: 1.02;
  transition: color .25s;
}
.featured:hover .featured-title { color: var(--ember); }

.featured-excerpt {
  max-width: 48ch;
  margin: 0;
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.6;
}

.featured-meta {
  margin: 1.3rem 0 0;
  color: var(--ink-faint);
  font-size: 9px;
  letter-spacing: .14em;
  line-height: 1.8;
  text-transform: uppercase;
}
.featured-meta span { color: var(--line-strong); }

.featured-media {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 3;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--paper);
}
.featured-media img {
  display: block;
  width: 100%;
  height: 100%;
  padding: 18px;
  object-fit: contain;
}

.archive {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(40px, 6vw, 72px) clamp(20px, 5vw, 44px) clamp(60px, 9vw, 100px);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--line-strong);
}
.section-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-weight: 400;
  letter-spacing: -.03em;
}
.section-head > span {
  color: var(--ink-faint);
  font-size: 9px;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.post-list li { border-bottom: 1px solid var(--line); }

.post-list a {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 138px 18px;
  gap: clamp(12px, 2.4vw, 28px);
  align-items: baseline;
  padding: clamp(20px, 2.8vw, 30px) 0;
  text-decoration: none;
  transition: padding-left .3s var(--ease);
}
.post-list a:hover { padding-left: 8px; }

.post-index {
  color: var(--ember-dark);
  font-size: 9px;
  letter-spacing: .14em;
}

.post-copy { min-width: 0; }

.post-title {
  display: block;
  font-family: var(--serif);
  font-size: clamp(1.25rem, 2.3vw, 1.8rem);
  font-weight: 400;
  letter-spacing: -.03em;
  line-height: 1.15;
  transition: color .2s;
}
.post-list a:hover .post-title { color: var(--ember); }

.post-excerpt {
  display: block;
  max-width: 62ch;
  margin-top: .45em;
  color: var(--ink-soft);
  font-size: .92rem;
  line-height: 1.55;
}

.post-meta {
  color: var(--ink-faint);
  font-size: 9px;
  letter-spacing: .13em;
  line-height: 1.8;
  text-align: right;
  text-transform: uppercase;
}

.post-arrow {
  color: var(--ember-dark);
  font-size: 1rem;
  text-align: right;
}

/* ------------------------------------------------------------------ */
/*  Article                                                           */
/* ------------------------------------------------------------------ */

.article-main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 44px) clamp(60px, 9vw, 110px);
}

.post-head {
  max-width: 830px;
  margin: 0 auto;
  padding: clamp(42px, 7vw, 80px) 0 clamp(28px, 4vw, 44px);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: 1.8rem;
  color: var(--ink-faint);
  font-size: 9px;
  letter-spacing: .15em;
  text-transform: uppercase;
}
.breadcrumb a {
  color: var(--ember-dark);
  text-decoration: none;
}
.breadcrumb a:hover { text-decoration: underline; }

.post-kicker {
  margin: 0 0 1rem;
  color: var(--ember);
  font-size: 9px;
  letter-spacing: .17em;
  text-transform: uppercase;
}
.post-kicker span { color: var(--line-strong); }

.post-head h1 {
  margin: .35em 0 .45em;
  font-family: var(--serif);
  font-size: clamp(2.5rem, 6vw, 4.8rem);
  font-weight: 350;
  letter-spacing: -.055em;
  line-height: 1;
  text-wrap: balance;
}

.standfirst {
  max-width: 60ch;
  margin: 0 0 1.4rem;
  color: var(--ink-soft);
  font-size: clamp(1.05rem, 1.7vw, 1.3rem);
  line-height: 1.55;
}

.byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .8rem;
  max-width: none;
  margin: 0;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 9px;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.byline b { color: var(--ink); font-weight: 500; white-space: nowrap; }
.byline span { color: var(--line-strong); white-space: nowrap; }

.post-layout {
  max-width: 800px;
  margin: 0 auto;
}

.toc {
  margin: 0 0 clamp(30px, 4vw, 48px);
  padding: 1.2rem 1.4rem;
  border: 1px solid var(--line);
  background: var(--paper);
}
.toc p {
  margin: 0 0 .7rem;
  color: var(--ember-dark);
  font-size: 9px;
  letter-spacing: .17em;
  text-transform: uppercase;
}
.toc ol {
  margin: 0;
  padding-left: 1.1rem;
  columns: 2;
  column-gap: 2rem;
}
.toc li {
  margin: .4rem 0;
  font-size: .83rem;
  line-height: 1.4;
}
.toc a {
  color: var(--ink-soft);
  text-decoration: none;
}
.toc a:hover { color: var(--ember); }

.prose {
  max-width: var(--read);
  margin: 0 auto;
  color: var(--ink);
  font-size: 19px;
  line-height: 1.72;
  overflow-wrap: break-word;
}
.prose > *:first-child { margin-top: 0; }

.prose p,
.prose .para {
  margin: 0 0 1.35em;
}
.prose .para > br:first-child { display: none; }

.prose h2 {
  margin: 2.2em 0 .65em;
  padding-top: .65em;
  border-top: 1px solid var(--line);
  font-family: var(--serif);
  font-size: clamp(1.55rem, 2.8vw, 2.05rem);
  font-weight: 400;
  letter-spacing: -.03em;
  line-height: 1.18;
  scroll-margin-top: 90px;
}

.prose h3 {
  margin: 1.8em 0 .5em;
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 400;
  letter-spacing: -.02em;
  line-height: 1.25;
}

.prose strong { font-weight: 600; }

.prose u {
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  text-decoration-color: var(--line-strong);
}

.prose a {
  color: var(--ember-dark);
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(180, 90, 50, .4);
  text-underline-offset: 3px;
  transition: color .2s, text-decoration-color .2s;
}
.prose a:hover {
  color: var(--ember);
  text-decoration-color: var(--ember);
}

.prose ul,
.prose ol {
  margin: 0 0 1.35em;
  padding-left: 1.35em;
}
.prose li {
  margin: .45em 0;
  padding-left: .2em;
}

.prose blockquote {
  margin: 2em 0;
  padding: .2em 0 .2em 1.4em;
  border-left: 2px solid var(--ember);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.22em;
  line-height: 1.5;
}
.prose blockquote p { margin: .4em 0; }

.prose figure.post-figure { margin: 2.2em 0; }
.prose .post-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  background: var(--paper);
}
.prose .post-figure figcaption {
  max-width: 60ch;
  margin-top: .7rem;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.55;
}
.prose .post-figure figcaption a { color: inherit; }

.prose figure.post-video { margin: 2.2em 0; }
.prose figure.post-video iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  background: #17110c;
}
.prose figure.post-video figcaption {
  max-width: 60ch;
  margin-top: .7rem;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.55;
}

.prose iframe { max-width: 100%; }
.prose img { max-width: 100%; height: auto; }

.prose table {
  display: block;
  width: 100%;
  margin: 1.5em 0;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: .85em;
  line-height: 1.5;
}
.prose th,
.prose td {
  padding: .65em .8em;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.prose th { font-weight: 600; }

.prose pre {
  padding: 1em;
  overflow: auto;
  border: 1px solid var(--line);
  background: var(--paper-deep);
  font-size: .8em;
}
.prose code {
  padding: .1em .3em;
  background: var(--paper-deep);
  font-size: .85em;
}
.prose pre code { padding: 0; background: none; }

.prose hr {
  margin: 2.4em 0;
  border: 0;
  border-top: 1px solid var(--line-strong);
}

.post-foot {
  max-width: var(--read);
  margin: clamp(40px, 7vw, 72px) auto 0;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line-strong);
}
.post-foot-meta {
  margin: 0;
  color: var(--ink-faint);
  font-size: 9px;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  margin-top: 1.6rem;
}
.post-nav a {
  max-width: 46%;
  text-decoration: none;
}
.post-nav a:hover b { color: var(--ember); }
.post-nav small {
  display: block;
  color: var(--ink-faint);
  font-size: 9px;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.post-nav b {
  display: block;
  margin-top: .35em;
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 400;
  letter-spacing: -.02em;
  line-height: 1.2;
  transition: color .2s;
}
.post-nav .next { margin-left: auto; text-align: right; }

.related {
  max-width: var(--max);
  margin: clamp(60px, 8vw, 100px) auto 0;
  padding: clamp(32px, 4vw, 48px) clamp(20px, 5vw, 44px) 0;
  border-top: 1px solid var(--line-strong);
}
.related .section-head { border-bottom: 0; padding-bottom: 1.2rem; }
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  padding-top: .4rem;
}
.related-card {
  display: block;
  padding: 1.2rem 1.2rem 1.4rem;
  border: 1px solid var(--line);
  background: var(--paper);
  text-decoration: none;
  transition: border-color .2s, transform .2s var(--ease);
}
.related-card:hover {
  border-color: var(--ember);
  transform: translateY(-2px);
}
.related-meta {
  color: var(--ink-faint);
  font-size: 8px;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.related-card h3 {
  margin: .6em 0 0;
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 400;
  letter-spacing: -.02em;
  line-height: 1.2;
}

/* ------------------------------------------------------------------ */
/*  Footer                                                            */
/* ------------------------------------------------------------------ */

.blog-footer {
  border-top: 1px solid var(--line);
  background: var(--paper);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.2rem;
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px clamp(20px, 5vw, 44px);
  color: var(--ink-faint);
  font-size: 9px;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.footer-inner nav { display: flex; gap: 1.4rem; }
.footer-inner a { text-decoration: none; }
.footer-inner a:hover,
.footer-inner a[aria-current="page"] { color: var(--ember); }

/* ------------------------------------------------------------------ */
/*  Responsive                                                        */
/* ------------------------------------------------------------------ */

@media (max-width: 820px) {
  .featured { grid-template-columns: 1fr; }
  .featured-media { order: -1; aspect-ratio: 16 / 10; }

  .post-list a {
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 12px;
  }
  .post-meta {
    grid-column: 2;
    margin-top: .5rem;
    text-align: left;
  }
  .post-arrow { display: none; }

  .post-head h1 { font-size: clamp(2.2rem, 10vw, 3.4rem); }
  .prose { font-size: 17.5px; }
  .toc ol { columns: 1; }
  .related-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .head-inner { padding: 14px 20px; gap: .7rem; }
  .brand { font-size: 1.15rem; }
  .blog-nav { gap: 12px; font-size: 8.5px; letter-spacing: .12em; }
  .blog-hero { padding-top: 52px; }
  .blog-hero h1 { font-size: clamp(3.3rem, 18vw, 4.6rem); }
  .featured { padding-top: 30px; padding-bottom: 34px; }
  .featured-title { font-size: clamp(1.8rem, 8vw, 2.4rem); }
  .post-head { padding-top: 38px; }
  .post-nav { flex-direction: column; gap: 1.3rem; }
  .post-nav a { max-width: none; }
  .post-nav .next { margin-left: 0; text-align: left; }
  .footer-inner { flex-direction: column; gap: .8rem; }
}

/* ------------------------------------------------------------------ */
/*  Print and motion                                                  */
/* ------------------------------------------------------------------ */

@media print {
  .blog-head,
  .blog-footer,
  .toc,
  .post-nav,
  .related,
  .skip-link { display: none !important; }

  body { background: #fff; color: #000; font-size: 11pt; }
  .article-main,
  .post-head,
  .post-layout,
  .prose,
  .post-foot {
    max-width: none;
    margin: 0;
    padding: 0;
  }
  .prose a { color: #000; text-decoration: underline; }
  .prose figure { break-inside: avoid; }
  .prose h2 { break-after: avoid; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

