/* ============================================================
   Archit Kumar Singh — Editorial Design System (v3.0)
   Warm, literary, paper-like: cream backgrounds, a serif
   voice for headlines, a single clay accent, flat honest
   cards. Inspired by the calm confidence of good editorial
   design — nothing floats, nothing blurs, everything reads.
   ============================================================ */

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

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

/* ---------- Design tokens ---------- */
:root {
  /* Warm editorial palette — cream paper, charcoal ink, clay accent */
  --bg: #f5f3ee;
  --bg-elevated: #fbfaf6;
  --card-bg: #ffffff;

  --text: #23201b;
  --text-soft: #3d372e;
  --muted: #756c5c;
  --faint: #a39a86;

  --accent: #c15f3c;
  --accent-hover: #a94f30;
  --accent-tint: rgba(193, 95, 60, 0.12);
  --accent-glow: rgba(193, 95, 60, 0.28);

  --border: #e4ddcd;
  --border-strong: #d2c8b2;

  --shadow: rgba(56, 44, 24, 0.08);
  --shadow-soft: rgba(56, 44, 24, 0.05);

  --nav-bg: rgba(245, 243, 238, 0.88);

  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --radius-pill: 999px;

  --font-serif: "Fraunces", Georgia, serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "DM Mono", monospace;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
}

body.dark {
  --bg: #141413;
  --bg-elevated: #1b1a17;
  --card-bg: #1e1d19;

  --text: #f1ede2;
  --text-soft: #d9d3c3;
  --muted: #9c9483;
  --faint: #635c4d;

  --accent: #e2895f;
  --accent-hover: #eda37c;
  --accent-tint: rgba(226, 137, 95, 0.14);
  --accent-glow: rgba(226, 137, 95, 0.32);

  --border: #322f28;
  --border-strong: #454034;

  --shadow: rgba(0, 0, 0, 0.42);
  --shadow-soft: rgba(0, 0, 0, 0.26);

  --nav-bg: rgba(20, 20, 19, 0.86);
}

/* ---------- Base ---------- */
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 0.4s var(--ease-soft), color 0.4s var(--ease-soft);
}

a {
  color: inherit;
}

::selection {
  background: var(--accent-glow);
  color: var(--text);
}

/* ---------- Flat paper background + faint grain ---------- */
.aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: var(--bg);
  transition: background 0.4s var(--ease-soft);
}

.aurora__orb {
  display: none;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.025;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}
body.dark .grain {
  opacity: 0.05;
  mix-blend-mode: overlay;
}

/* ---------- Flat card primitive (no blur, honest edges) ---------- */
.glass {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 1px 3px var(--shadow-soft);
}

.glass::before {
  display: none;
}

/* ---------- Nav — plain top bar, not a floating pill ---------- */
.nav-wrap {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  padding: 0 24px;
  transition: border-color 0.3s var(--ease-soft), background 0.3s var(--ease-soft);
}
.nav-wrap.scrolled {
  border-bottom-color: var(--border);
}

nav {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 0;
  transition: padding 0.3s var(--ease-soft);
}
.nav-wrap.scrolled nav {
  padding: 15px 0;
}

.nav-name {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s;
  flex-shrink: 0;
}
.nav-name:hover {
  color: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(14px, 3vw, 28px);
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-links::-webkit-scrollbar {
  display: none;
}

nav a.nav-link {
  position: relative;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0;
  transition: color 0.2s;
  white-space: nowrap;
  padding-bottom: 2px;
}
nav a.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -3px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  transition: right 0.3s var(--ease);
}
nav a.nav-link:hover,
nav a.nav-link.active {
  color: var(--text);
}
nav a.nav-link:hover::after,
nav a.nav-link.active::after {
  right: 0;
}

.whatsapp-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--muted);
  flex-shrink: 0;
  transition: transform 0.25s var(--ease), background 0.25s, color 0.25s, border-color 0.25s;
}
.whatsapp-link::after {
  display: none;
}
.whatsapp-link:hover {
  color: #fff;
  background: #25d366;
  border-color: #25d366;
  transform: scale(1.06);
}

.theme-toggle {
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.25s var(--ease), background 0.25s, border-color 0.25s;
}
.theme-toggle:hover {
  transform: scale(1.06);
  border-color: var(--accent);
}
.theme-toggle:active {
  transform: scale(0.94);
}
.theme-toggle svg {
  width: 14px;
  height: 14px;
  color: var(--muted);
}
.icon-moon {
  display: block;
}
.icon-sun {
  display: none;
}
body.dark .icon-moon {
  display: none;
}
body.dark .icon-sun {
  display: block;
}

/* ---------- Layout ---------- */
main {
  position: relative;
  z-index: 2;
  max-width: 700px;
  margin: 0 auto;
  padding: 132px 24px 100px;
}

@media (max-width: 480px) {
  main {
    padding: 108px 18px 70px;
  }
  .nav-name {
    display: none;
  }
  .nav-links {
    gap: 12px;
  }
  nav a.nav-link {
    font-size: 0.8rem;
  }
  .theme-toggle,
  .whatsapp-link {
    width: 28px;
    height: 28px;
  }
}

@media (max-width: 360px) {
  .nav-links {
    gap: 8px;
  }
  nav a.nav-link {
    font-size: 0.74rem;
  }
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes fadeIn {
  to {
    opacity: 1;
  }
}
@keyframes floaty {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  animation: fadeUp 0.7s var(--ease) forwards;
}
.reveal--1 {
  animation-delay: 0.04s;
}
.reveal--2 {
  animation-delay: 0.11s;
}
.reveal--3 {
  animation-delay: 0.18s;
}
.reveal--4 {
  animation-delay: 0.25s;
}
.reveal--5 {
  animation-delay: 0.32s;
}

/* ---------- Hero ---------- */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 64px;
}

.avatar-frame {
  position: relative;
  width: 124px;
  height: 124px;
  margin-bottom: 28px;
}

.avatar-frame__glow {
  position: absolute;
  inset: -18px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-tint), transparent 70%);
  opacity: 0.9;
}

.avatar-frame__ring {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  padding: 3px;
  background: var(--card-bg);
  border: 1px solid var(--border-strong);
  box-shadow: 0 6px 20px -8px var(--shadow);
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease);
}

.avatar-frame:hover .avatar-frame__ring {
  transform: scale(1.03);
  border-color: var(--accent);
}

.avatar-frame__ring img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

h1.display {
  font-family: var(--font-serif);
  font-style: normal;
  font-weight: 500;
  font-size: clamp(2.2rem, 7vw, 3.1rem);
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.08;
  margin-bottom: 12px;
}

.tagline {
  font-size: 0.86rem;
  color: var(--muted);
  letter-spacing: 0.03em;
  font-weight: 400;
}

/* ---------- Bio / prose ---------- */
.prose {
  margin-bottom: 20px;
}
.prose p {
  font-size: 1.02rem;
  line-height: 1.8;
  color: var(--text-soft);
  margin-bottom: 22px;
  font-weight: 400;
}
.prose strong {
  font-weight: 600;
  color: var(--text);
}
.prose em {
  font-style: italic;
}
.prose a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-glow);
  transition: border-color 0.2s, color 0.2s;
}
.prose a:hover {
  border-color: var(--accent);
  color: var(--accent-hover);
}

.prose h2 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.32rem;
  color: var(--text);
  margin: 40px 0 14px;
  line-height: 1.3;
}

.prose ul {
  list-style: none;
  margin: 0 0 22px 0;
  padding: 0;
}
.prose ul li {
  position: relative;
  font-size: 1.02rem;
  line-height: 1.8;
  color: var(--text-soft);
  font-weight: 400;
  padding: 3px 0 3px 20px;
}
.prose ul li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 500;
}

.prose .quote {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: 1.15rem;
  color: var(--text);
  line-height: 1.7;
  padding: 20px 24px;
  margin: 30px 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  border-left: 3px solid var(--accent);
  background: var(--bg-elevated);
}

/* ---------- Divider ---------- */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0 0 40px;
}

/* ---------- Footer ---------- */
footer {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 20px 50px;
}

.location-time {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  color: var(--muted);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}
.location-time .dot {
  opacity: 0.4;
}

/* ---------- Back link ---------- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 40px;
  transition: color 0.2s, transform 0.2s;
}
.back-link:hover {
  color: var(--accent);
  transform: translateX(-3px);
}

/* ---------- Page header (blog / publications) ---------- */
.page-header {
  margin-bottom: 40px;
}
.page-header h1 {
  font-family: var(--font-serif);
  font-style: normal;
  font-weight: 500;
  font-size: clamp(2.2rem, 8vw, 2.9rem);
  color: var(--text);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.page-header p {
  font-size: 0.92rem;
  color: var(--muted);
  font-weight: 400;
  line-height: 1.6;
  max-width: 46ch;
}

/* ---------- Blog list ---------- */
.posts-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.post-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  text-decoration: none;
  color: inherit;
  padding: 24px 26px;
  border-radius: var(--radius-md);
  background: var(--card-bg);
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px var(--shadow-soft);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s;
}
.post-item:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 10px 24px -14px var(--shadow);
}

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

.post-date {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.post-title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(1.05rem, 3.5vw, 1.22rem);
  color: var(--text);
  line-height: 1.35;
  transition: color 0.2s;
}
.post-item:hover .post-title {
  color: var(--accent);
}

.post-item__arrow {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--muted);
  transition: transform 0.3s var(--ease), background 0.3s, color 0.3s, border-color 0.3s;
}
.post-item__arrow svg {
  width: 15px;
  height: 15px;
  transition: transform 0.3s var(--ease);
}
.post-item:hover .post-item__arrow {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.post-item:hover .post-item__arrow svg {
  transform: translateX(2px);
}

.empty-state {
  padding: 70px 0;
  text-align: center;
}
.empty-state p {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--muted);
  opacity: 0.8;
}

/* ---------- Publications ---------- */
.pub-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pub-card {
  position: relative;
  padding: 28px 30px;
  border-radius: var(--radius-lg);
  background: var(--card-bg);
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px var(--shadow-soft);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s;
  overflow: hidden;
}
.pub-card::after {
  display: none;
}
.pub-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 14px 30px -16px var(--shadow);
}

.pub-index {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--faint);
  margin-bottom: 10px;
  display: block;
}

.pub-title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.16rem;
  line-height: 1.4;
  color: var(--text);
  margin-bottom: 14px;
}

.pub-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}

.pub-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--muted);
  padding: 6px 13px;
  border-radius: var(--radius-pill);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}
.pub-chip--status {
  color: var(--accent);
}
.pub-chip--status .dot-live {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-tint);
}

.pub-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-size: 0.83rem;
  font-weight: 600;
  color: #fff8f2;
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  border: 1px solid var(--accent);
  transition: transform 0.25s var(--ease), background 0.25s, box-shadow 0.25s;
  box-shadow: 0 10px 22px -12px var(--accent-glow);
}
.pub-btn:hover {
  transform: translateY(-2px);
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: 0 14px 28px -10px var(--accent-glow);
}
.pub-btn svg {
  width: 14px;
  height: 14px;
  transition: transform 0.25s var(--ease);
}
.pub-btn:hover svg {
  transform: translate(2px, -2px);
}

/* ---------- Blog post (article) shell ---------- */
.post-header {
  margin-bottom: 30px;
}
.post-header h1 {
  font-family: var(--font-serif);
  font-style: normal;
  font-weight: 500;
  font-size: clamp(1.8rem, 6vw, 2.5rem);
  color: var(--text);
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin-bottom: 14px;
}
.post-header .post-date {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

.post-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  margin-bottom: 28px;
}

.post-hero-img {
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 32px;
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px -18px var(--shadow);
}
.post-hero-img img {
  width: 100%;
  display: block;
}

.post-closing {
  margin-top: 44px;
  padding: 26px 26px 24px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}
.post-closing h2 {
  margin-top: 0 !important;
}
.post-closing p:last-child {
  margin-bottom: 0;
  font-style: italic;
  color: var(--accent);
}

/* ---------- Utility ---------- */
.lazy-fade {
  opacity: 0;
  transition: opacity 0.6s var(--ease);
}
.lazy-fade.loaded {
  opacity: 1;
}
