/* ─────────────────────────────────────────────────────
   phaniputtabakula.com — design system
   Fonts: Instrument Serif (display) + DM Sans (body)
   Palette: warm dark / warm cream light
   ───────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;1,9..40,300&display=swap');

/* ─── Tokens ──────────────────────────────────────────────── */

:root {
  --bg:          #0c0b0a;
  --surface:     #141210;
  --border:      #242018;
  --text:        #ede8e1;
  --muted:       #7d7872;
  --faint:       #4c4840;
  --accent:      #c8a96e;
  --accent-bg:   rgba(200, 169, 110, 0.08);

  --serif:  'Instrument Serif', Georgia, 'Times New Roman', serif;
  --sans:   'DM Sans', -apple-system, system-ui, sans-serif;
  --mono:   'SF Mono', 'Cascadia Code', 'Fira Code', ui-monospace, monospace;

  --max-w:  640px;
  --nav-h:  56px;
  --ease:   cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg:        #f7f4ef;
    --surface:   #f0ece4;
    --border:    #ddd8ce;
    --text:      #1c1a17;
    --muted:     #8a847e;
    --faint:     #c0bab2;
    --accent:    #9a7240;
    --accent-bg: rgba(154, 114, 64, 0.08);
  }
}

/* ─── Reset ───────────────────────────────────────────────── */

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

html {
  font-size: 16px;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ─── Layout ──────────────────────────────────────────────── */

.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 5vw, 2rem);
}

.page { padding-top: var(--nav-h); }

/* ─── Nav ─────────────────────────────────────────────────── */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--nav-h);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1.25rem, 5vw, 2.5rem);
  background: rgba(12, 11, 10, 0.82);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}

@media (prefers-color-scheme: light) {
  .nav { background: rgba(247, 244, 239, 0.86); }
}

.nav.scrolled { border-bottom-color: var(--border); }

.nav-logo {
  font-family: var(--serif);
  font-size: 1.075rem;
  letter-spacing: 0.008em;
  color: var(--text);
  transition: color 0.2s;
}

.nav-logo:hover { color: var(--accent); }

.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 1.875rem;
}

.nav-links a {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0.01em;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--text); }

.nav-links .ext::after {
  content: '\202f↗';
  font-size: 0.68em;
  opacity: 0.5;
  vertical-align: 0.15em;
}

/* ─── Hero ────────────────────────────────────────────────── */

.hero {
  padding-top: clamp(4.5rem, 12vh, 7.5rem);
  padding-bottom: clamp(2.5rem, 7vh, 4.5rem);
}

.hero-eyebrow {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.375rem;
}

.hero-name {
  font-family: var(--serif);
  font-size: clamp(3rem, 8vw, 4.75rem);
  font-weight: 400;
  line-height: 1.03;
  letter-spacing: -0.028em;
  color: var(--text);
  margin-bottom: 2rem;
}

.hero-desc {
  font-size: 1.0625rem;
  font-weight: 300;
  line-height: 1.78;
  color: var(--muted);
  max-width: 490px;
}

.hero-desc strong {
  font-weight: 400;
  color: var(--text);
}

.hero-location {
  margin-top: 2rem;
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  color: var(--faint);
}

/* ─── Section ─────────────────────────────────────────────── */

.section {
  padding: clamp(2.5rem, 6vh, 3.75rem) 0;
  border-top: 1px solid var(--border);
}

.section-label {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 1.625rem;
}

/* ─── Building ────────────────────────────────────────────── */

.building-list {
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
}

.bld-name {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.5rem;
  transition: color 0.2s;
}

.bld-arr {
  font-size: 0.75em;
  color: var(--faint);
  transition: transform 0.2s var(--ease), color 0.2s;
}

a.bld-name:hover { color: var(--accent); }
a.bld-name:hover .bld-arr { transform: translate(2px, -2px); color: var(--accent); }

.bld-desc {
  font-size: 0.9375rem;
  font-weight: 300;
  line-height: 1.72;
  color: var(--muted);
}

/* ─── Writing list ────────────────────────────────────────── */

.writing-list { list-style: none; }

.wl-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--border);
  cursor: default;
}

.wl-item:first-child { border-top: 1px solid var(--border); }

.wl-title {
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--text);
  line-height: 1.45;
  transition: color 0.2s;
}

a.wl-item:hover .wl-title { color: var(--accent); }

.wl-date {
  font-size: 0.8125rem;
  color: var(--faint);
  white-space: nowrap;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.more-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 1.5rem;
  font-size: 0.875rem;
  color: var(--muted);
  transition: color 0.2s;
}

.more-link:hover { color: var(--text); }

/* ─── Elsewhere ───────────────────────────────────────────── */

.elsewhere-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.el-link {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.el-label {
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--text);
  min-width: 6.5rem;
}

.el-val {
  font-size: 0.9375rem;
  font-weight: 300;
  color: var(--muted);
  transition: color 0.2s;
}

.el-link:hover .el-val { color: var(--text); }

/* ─── Footer ──────────────────────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 0 3rem;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-copy {
  font-size: 0.8125rem;
  color: var(--faint);
}

.footer-links {
  list-style: none;
  display: flex;
  gap: 1.625rem;
}

.footer-links a {
  font-size: 0.8125rem;
  color: var(--faint);
  transition: color 0.2s;
}

.footer-links a:hover { color: var(--muted); }

/* ─── Page header (list / prose pages) ───────────────────── */

.page-header {
  padding-top: clamp(4.5rem, 12vh, 7.5rem);
  padding-bottom: clamp(2rem, 5vh, 3rem);
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}

.page-title {
  font-family: var(--serif);
  font-size: clamp(2rem, 5.5vw, 2.875rem);
  font-weight: 400;
  letter-spacing: -0.022em;
  line-height: 1.08;
  color: var(--text);
  margin-bottom: 0.625rem;
}

.page-desc {
  font-size: 1rem;
  font-weight: 300;
  color: var(--muted);
}

/* ─── Archive (writing list page) ────────────────────────── */

.archive { list-style: none; padding: 0; }

.empty-state {
  padding: 4rem 0;
  font-size: 0.9375rem;
  color: var(--faint);
}

/* ─── Single post ─────────────────────────────────────────── */

.post-header {
  padding-top: clamp(4.5rem, 12vh, 7.5rem);
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
}

.post-title {
  font-family: var(--serif);
  font-size: clamp(1.875rem, 5vw, 2.625rem);
  font-weight: 400;
  line-height: 1.14;
  letter-spacing: -0.022em;
  color: var(--text);
  margin-bottom: 1rem;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.8125rem;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.post-meta span::before {
  content: '·';
  margin-right: 1.25rem;
}

/* ─── Prose ───────────────────────────────────────────────── */

.prose {
  padding: 2.75rem 0;
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.82;
  color: var(--text);
}

.prose > * + * { margin-top: 1.375rem; }

.prose h2 {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: -0.018em;
  line-height: 1.22;
  color: var(--text);
  margin-top: 3rem;
  margin-bottom: 0.875rem;
}

.prose h3 {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
}

.prose h4 {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text);
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
}

.prose a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--faint);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color 0.2s, text-decoration-color 0.2s;
}

.prose a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

.prose strong { font-weight: 500; color: var(--text); }
.prose em { font-style: italic; }

.prose ul, .prose ol { padding-left: 1.3rem; }

.prose li {
  color: var(--muted);
  margin-bottom: 0.375rem;
}

.prose li strong { color: var(--text); }

.prose blockquote {
  border-left: 2px solid var(--accent);
  padding: 0.125rem 0 0.125rem 1.25rem;
  color: var(--muted);
  font-style: italic;
}

.prose hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.75rem 0;
}

.prose code {
  font-family: var(--mono);
  font-size: 0.875em;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.1em 0.38em;
  color: var(--text);
}

.prose pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  margin: 1.875rem 0;
}

.prose pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.875rem;
  line-height: 1.65;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  margin: 1.875rem 0;
}

.prose th, .prose td {
  text-align: left;
  padding: 0.625rem 0.875rem;
  border-bottom: 1px solid var(--border);
}

.prose th {
  font-weight: 500;
  color: var(--text);
  font-size: 0.8125rem;
  letter-spacing: 0.03em;
}

.prose td { color: var(--muted); }

/* ─── Post navigation ─────────────────────────────────────── */

.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  padding: 2.75rem 0;
  border-top: 1px solid var(--border);
}

.pn-link {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.pn-link.pn-next { align-items: flex-end; text-align: right; }

.pn-dir {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}

.pn-title {
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.4;
  transition: color 0.2s;
}

.pn-link:hover .pn-title { color: var(--text); }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding-bottom: 1rem;
  font-size: 0.875rem;
  color: var(--faint);
  border-top: 1px solid var(--border);
  padding-top: 2.75rem;
  transition: color 0.2s;
}

.back-link:hover { color: var(--muted); }

/* ─── Animations ──────────────────────────────────────────── */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ani { animation: fadeUp 0.5s var(--ease) both; }
.d0  { animation-delay: 0s; }
.d1  { animation-delay: 0.08s; }
.d2  { animation-delay: 0.16s; }
.d3  { animation-delay: 0.24s; }
.d4  { animation-delay: 0.32s; }
.d5  { animation-delay: 0.40s; }

/* ─── Mobile ──────────────────────────────────────────────── */

@media (max-width: 560px) {
  .nav-links { gap: 1.125rem; }
  .nav-links .ext::after { display: none; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .wl-item { flex-direction: column; gap: 0.2rem; align-items: flex-start; }
  .el-label { min-width: 5.5rem; }
  .post-nav { grid-template-columns: 1fr; }
  .pn-link.pn-next { align-items: flex-start; text-align: left; }
}

/* ─── Selection ───────────────────────────────────────────── */

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

/* ─── Scrollbar ───────────────────────────────────────────── */

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--faint); }
