/* raj-bhat.com: shared styles for every page outside the home page.
   Tokens mirror src/index.css so both halves of the site read as one. */

:root {
  --bg: #ffffff;
  --bg-soft: #fafafa;
  --navy: #003366;
  --navy-deep: #001a33;
  --ink: #000000;
  --text: #1f1f1f;
  --muted: #666666;
  --gold: #d4af37;
  --line: rgba(0, 0, 0, 0.08);
  --serif: 'Lora', Georgia, 'Times New Roman', serif;
  --mono: 'Space Mono', ui-monospace, Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --gutter: 3rem;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1.6;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main { flex: 1; }
img { max-width: 100%; height: auto; }
h1, h2, h3, p, ul, ol { margin: 0; }
h1, h2, h3 { color: var(--ink); text-wrap: balance; }
a { color: var(--navy); }
:focus-visible { outline: 2px solid var(--navy); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: calc(760px + 2 * var(--gutter)); }

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 1rem; top: 1rem; z-index: 10; padding: 0.5rem 1rem; background: var(--ink); color: #fff; }

/* Small uppercase mono label used above every title, as on the home page */
.eyebrow {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}
.gold { color: var(--gold); }
.navy { color: var(--navy); }

/* Header */
.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 2rem; padding-top: 1.5rem; padding-bottom: 1.5rem; }
.brand { display: inline-flex; align-items: center; gap: 0.875rem; text-decoration: none; font-size: 1.75rem; font-weight: 700; letter-spacing: -0.04em; line-height: 1; }
.brand img { width: 56px; height: 56px; }
.site-nav { display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; }
.site-nav a {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-decoration: none;
  color: var(--muted);
  padding: 0.4rem 0;
  border-bottom: 1.5px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.site-nav a:hover { color: var(--ink); border-bottom-color: var(--gold); }
.site-nav a[aria-current] { color: var(--ink); border-bottom-color: var(--gold); font-weight: 700; }

/* Page intro */
.page-head { padding-top: 5rem; padding-bottom: 3rem; }
.page-head h1 { margin-top: 1.25rem; font-size: clamp(2.5rem, 6vw, 4.5rem); font-weight: 700; letter-spacing: -0.04em; line-height: 1; }
.lede { margin-top: 1.5rem; max-width: 640px; font-size: 1.2rem; line-height: 1.55; color: var(--muted); }
/* Article-only breadcrumb — not used on standalone pages */
.crumbs { margin-bottom: 1.5rem; font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.08em; color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--navy); }
.section { padding-bottom: 5rem; }
.section-title { margin: 0.5rem 0 2rem; font-size: clamp(1.75rem, 3.5vw, 2.5rem); font-weight: 700; letter-spacing: -0.04em; line-height: 1.1; }

/* Buttons and badges, same shapes as the home page */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.9rem 2rem;
  border-radius: 999px;
  border: 1px solid var(--navy-deep);
  background: linear-gradient(135deg, var(--navy-deep), var(--navy));
  color: #fff;
  font-family: var(--serif); font-size: 1rem; font-weight: 600; text-decoration: none;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.btn:hover { transform: scale(1.02); box-shadow: 0 10px 20px rgba(0, 51, 102, 0.2); }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--gold); }
.btn-outline:hover { background: rgba(212, 175, 55, 0.05); box-shadow: none; }
.actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2.5rem; }
.badges { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; padding: 0; list-style: none; }
.badges li { padding: 0.4rem 0.8rem; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-soft); font-family: var(--mono); font-size: 0.65rem; letter-spacing: 0.1em; color: var(--muted); }

/* Cards */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; padding: 0; list-style: none; }
.card {
  display: flex; flex-direction: column; height: 100%;
  padding: 1.75rem;
  border: 1px solid var(--line); border-radius: 16px;
  background: var(--bg);
  color: inherit; text-decoration: none;
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
a.card:hover { border-color: var(--gold); transform: translateY(-6px); box-shadow: 0 30px 60px rgba(0, 51, 102, 0.06); }
.card h3 { margin: 0.9rem 0 0.6rem; font-size: 1.3rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1.25; }
.card p { font-size: 0.95rem; line-height: 1.5; color: var(--muted); }
.card .eyebrow + p { margin-top: 0.9rem; font-size: 1.05rem; color: var(--text); }
.card .meta { margin-top: auto; padding-top: 1.5rem; }
.meta { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.05em; color: var(--muted); }
.card-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.card-dark h3 { color: #fff; }
.card-dark p, .card-dark .eyebrow { color: rgba(255, 255, 255, 0.7); }
.card-dark .links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin-top: auto; padding-top: 1.5rem; }
.card-dark a { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.15em; text-transform: uppercase; text-decoration: none; color: var(--gold); }
.card-dark a:hover { color: #fff; }

/* Blog index: featured article */
.feature {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 3rem; align-items: center;
  margin-bottom: 1.25rem; padding: 3rem;
  border: 1px solid var(--line); border-radius: 30px;
  background: var(--bg-soft);
}
.feature h2 { margin: 1rem 0; font-size: clamp(1.75rem, 3.2vw, 2.6rem); font-weight: 700; letter-spacing: -0.04em; line-height: 1.1; }
.feature h2 a { color: inherit; text-decoration: none; }
.feature h2 a:hover { color: var(--navy); }
.feature p:not([class]) { max-width: 520px; font-size: 1.1rem; color: var(--muted); }
.feature .meta { margin: 1.5rem 0 2rem; }
.feature-words { font-size: clamp(2.5rem, 5vw, 4.25rem); font-weight: 700; letter-spacing: -0.05em; line-height: 0.95; color: var(--ink); text-align: right; }
.feature-words span { display: block; }

/* Article and text pages */
.article-layout { display: grid; grid-template-columns: minmax(0, 720px) 260px; justify-content: space-between; column-gap: 4rem; align-items: start; padding-top: 4rem; padding-bottom: 5rem; }
.article-layout > * { grid-column: 1; min-width: 0; }
.article-layout > .toc-wrap { grid-column: 2; grid-row: 1 / span 3; align-self: stretch; }
.article-head h1 { margin-top: 1.25rem; font-size: clamp(2.1rem, 4.6vw, 3.4rem); font-weight: 700; letter-spacing: -0.04em; line-height: 1.08; }
.article-head .lede { font-size: 1.25rem; }
.article-head .meta { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--line); line-height: 1.9; }
.article-head .meta::before { content: ''; display: block; width: 56px; height: 3px; margin: -1.25rem 0 1.25rem; background: var(--gold); transform: translateY(-2px); }

.prose { font-size: 1.0625rem; line-height: 1.8; }
.article-layout .prose { margin-top: 2.5rem; }
.prose p { margin-bottom: 1.4rem; }
.prose .lead { font-size: 1.3rem; line-height: 1.55; font-weight: 600; color: var(--navy-deep); }
.prose h2 { margin: 3rem 0 1rem; font-size: 1.6rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1.2; scroll-margin-top: 1.5rem; }
.prose section { scroll-margin-top: 1.5rem; }
.prose a { text-decoration-color: var(--gold); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.prose a:hover { color: var(--ink); }
.prose ul, .prose ol { margin-bottom: 1.4rem; padding-left: 1.4rem; }
.prose li { margin-bottom: 0.5rem; }
.prose li::marker { color: var(--gold); }
.prose > :first-child, .wide > :first-child { margin-top: 0; }
.wide .section-title { margin-top: 4rem; }
.wide > p:last-child { margin-top: 2.5rem; color: var(--muted); }

.note { margin: 3rem 0 1.25rem; padding: 1.5rem; border: 1px solid var(--gold); border-radius: 12px; background: rgba(212, 175, 55, 0.05); color: var(--muted); }
.author { display: flex; gap: 1.25rem; align-items: flex-start; padding: 1.75rem; border: 1px solid var(--line); border-radius: 20px; background: var(--bg-soft); }
.author img { width: 48px; height: 48px; flex-shrink: 0; }
.author h2 { margin: 0.4rem 0; font-size: 1.3rem; font-weight: 600; letter-spacing: -0.02em; }
.author p:not([class]) { font-size: 0.95rem; color: var(--muted); }
.more { margin-top: 3.5rem; }
.more .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 1.25rem; }
.back { display: inline-block; margin-top: 2.5rem; font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.15em; text-transform: uppercase; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--gold); padding-bottom: 0.35rem; }

.toc { position: sticky; top: 2rem; border: 1px solid var(--line); border-radius: 16px; background: var(--bg); }
.toc summary { padding: 1.1rem 1.25rem; cursor: pointer; font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--ink); }
.toc ol { margin: 0; padding: 0 1.25rem 1.25rem; list-style: none; max-height: 60vh; overflow: auto; }
.toc a { display: block; padding: 0.45rem 0 0.45rem 0.85rem; border-left: 2px solid var(--line); font-size: 0.9rem; line-height: 1.35; color: var(--muted); text-decoration: none; }
.toc a:hover { border-left-color: var(--gold); color: var(--ink); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); }
.site-footer .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; padding-top: 2rem; padding-bottom: 2rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.75rem; }
.site-footer nav a { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.06em; text-decoration: none; color: var(--muted); transition: color 0.2s; }
.site-footer nav a:hover { color: var(--ink); }
.site-footer p { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.06em; color: var(--muted); }

@media (max-width: 1000px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-layout { grid-template-columns: minmax(0, 720px); justify-content: center; }
  .article-layout > .toc-wrap { grid-column: 1; grid-row: auto; margin-top: 2rem; }
  .toc { position: static; }
}

@media (max-width: 700px) {
  :root { --gutter: 1.5rem; }
  .site-header .wrap { flex-direction: column; align-items: flex-start; gap: 1rem; padding-top: 1.25rem; padding-bottom: 1rem; }
  .brand { font-size: 1.5rem; }
  .brand img { width: 44px; height: 44px; }
  .site-nav { gap: 0.25rem 1.5rem; }
  .page-head { padding-top: 3rem; padding-bottom: 2.25rem; }
  .lede, .article-head .lede { font-size: 1.1rem; }
  .section { padding-bottom: 3.5rem; }
  .grid, .more .grid { grid-template-columns: minmax(0, 1fr); }
  .feature { grid-template-columns: minmax(0, 1fr); padding: 1.75rem; border-radius: 24px; }
  .feature-words { display: none; }
  .article-layout { padding-top: 2.5rem; padding-bottom: 3.5rem; }
  .prose { font-size: 1.03rem; }
  .prose h2 { font-size: 1.4rem; margin-top: 2.5rem; }
  .actions .btn { width: 100%; justify-content: center; }
  .site-footer .wrap { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
