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

/* ─── Font Faces ─── */
@font-face {
  font-family: 'Gilda Display';
  src: url('/fonts/GildaDisplay-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'PT Serif';
  src: url('/fonts/PTSerif-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'PT Serif';
  src: url('/fonts/PTSerif-Italic.ttf') format('truetype');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'PT Serif';
  src: url('/fonts/PTSerif-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'PT Serif';
  src: url('/fonts/PTSerif-BoldItalic.ttf') format('truetype');
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

/* ─── Base ─── */
html { scroll-behavior: smooth; }
body {
  font-family: 'PT Serif', Georgia, serif;
  color: #1a1a1a;
  background: #fff;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
a { color: inherit; }
img { max-width: 100%; display: block; }

/* ─── Typography ─── */
.font-display { font-family: 'Gilda Display', Georgia, serif; }
.text-gray-400 { color: #9ca3af; }
.text-gray-500 { color: #6b7280; }
.text-gray-600 { color: #4b5563; }

/* ─── Layout ─── */
.max-w-content { max-width: 800px; margin-left: auto; margin-right: auto; }
.max-w-2xl { max-width: 42rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }

/* ─── Sections ─── */
.bg-white { background-color: #fff; }
.bg-gray { background-color: #f2f2f2; }

.section-pad { padding-top: 4rem; padding-bottom: 4rem; }

@media (min-width: 768px) {
  .section-pad { padding-top: 6rem; padding-bottom: 6rem; }
}

/* ─── Nav ─── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid #eee;
}
.nav-inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo { height: 2rem; }
.nav-links { display: flex; align-items: center; gap: 1.25rem; }
.nav-links a {
  font-size: 1rem;
  color: #1a1a1a;
  text-decoration: none;
  transition: color 0.2s;
}
.nav-links a:hover { color: #6b7280; }

/* Threads icon in nav - mobile only */
.nav-threads-text { display: none; }
.nav-threads-icon { display: inline-block; }
@media (min-width: 640px) {
  .nav-threads-text { display: inline; }
  .nav-threads-icon { display: none; }
}

/* ─── Footer ─── */
.footer {
  padding: 3rem 1.5rem;
  text-align: center;
  font-size: 0.875rem;
  color: #6b7280;
}
.footer a {
  color: #6b7280;
  text-decoration: none;
  transition: color 0.2s;
}
.footer a:hover { color: #1f2937; }
.footer .sep { margin: 0 0.5rem; }

/* ─── Links ─── */
.link {
  text-decoration: underline;
  text-decoration-thickness: 0.5px;
  text-underline-offset: 0.2em;
  transition: text-decoration-thickness 0.2s;
}
.link:hover { text-decoration-thickness: 1px; }

/* ─── Hero ─── */
.hero {
  padding-top: 7rem;
  padding-bottom: 4rem;
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.hero h1 {
  font-family: 'Gilda Display', Georgia, serif;
  font-size: 1.875rem;
  font-weight: normal;
  color: #111;
  margin-bottom: 1.5rem;
  line-height: 1.2;
}
.hero .thesis {
  font-family: 'Gilda Display', Georgia, serif;
  font-size: 1.25rem;
  font-weight: normal;
  color: #111;
  max-width: 42rem;
  line-height: 1.6;
}
@media (min-width: 640px) {
  .hero h1 { font-size: 3rem; }
  .hero .thesis { font-size: 1.5rem; }
}

/* ─── Section Headers ─── */
.section-h2 {
  font-family: 'Gilda Display', Georgia, serif;
  font-size: 1.5rem;
  font-weight: normal;
  margin-bottom: 1.5rem;
}
@media (min-width: 640px) {
  .section-h2 { font-size: 1.875rem; }
}

/* ─── Body text ─── */
.body-text {
  font-size: 1rem;
  line-height: 1.75;
  max-width: 42rem;
}

/* ─── App Icons ─── */
.app-icons {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.app-icons img { width: 2rem; height: 2rem; }

/* ─── Grid (2-col) ─── */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: center;
}
@media (min-width: 768px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
}

.grid-2-stretch {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}
@media (min-width: 768px) {
  .grid-2-stretch { grid-template-columns: 1fr 1fr; align-items: stretch; }
}

/* ─── E2EE Links ─── */
.e2ee-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-top: 1rem;
}
.e2ee-links a {
  font-size: 0.875rem;
  font-style: italic;
}

/* ─── Portrait ─── */
.portrait-wrap { display: flex; }
.portrait-wrap img {
  width: 100%;
  border-radius: 0.5rem;
  object-fit: cover;
}
@media (min-width: 768px) {
  .portrait-wrap img { height: 100%; }
}

/* ─── Fun Facts ─── */
.fun-facts-text { display: flex; flex-direction: column; justify-content: center; }
.fun-facts-text p { margin-bottom: 1rem; }
.fun-facts-text p:last-child { margin-bottom: 0; }

/* ─── Button ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border: 1px solid #1a1a1a;
  color: #1a1a1a;
  font-size: 0.875rem;
  border-radius: 0.5rem;
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s;
  font-family: 'PT Serif', Georgia, serif;
}
.btn:hover { background-color: #1a1a1a; color: #fff; }

/* ─── Image rounded ─── */
.rounded-lg { border-radius: 0.5rem; }

/* ─── Reading Page ─── */
.year-links { display: flex; flex-wrap: wrap; gap: 1rem; }
.year-links a { font-size: 0.875rem; }

.favorites-card {
  margin-bottom: 2.5rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  background: rgba(255,255,255,0.7);
  padding: 1.25rem 1.5rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.category-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #9ca3af;
  margin-bottom: 0.75rem;
}
.book-list { list-style-type: decimal; list-style-position: outside; margin-left: 1.25rem; }
.book-list li, .fav-list li { margin-bottom: 0.5rem; }
.fav-list { list-style: none; margin-left: 0.25rem; }
.book-title { font-weight: 700; font-style: italic; }
.book-title-link {
  font-weight: 700;
  font-style: italic;
  text-decoration: underline;
  text-decoration-thickness: 0.5px;
  text-underline-offset: 0.2em;
  transition: text-decoration-thickness 0.2s;
}
.book-title-link:hover { text-decoration-thickness: 1px; }
.book-author { font-style: italic; color: #4b5563; }
.category-section { margin-bottom: 2.5rem; }

/* ─── Bits Page ─── */
.bits-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
@media (min-width: 768px) {
  .bits-grid {
    flex-direction: row;
    gap: 1.5rem;
  }
  .bits-col { flex: 1; display: flex; flex-direction: column; gap: 1.5rem; }
}

.bit-card-link { text-decoration: none; color: inherit; display: block; }
.bit-card {
  border-radius: 0.5rem;
  border: 1px solid #d1d5db;
  background: #fff;
  overflow: hidden;
}
.bit-gradient { height: 0.375rem; }

/* Gradient colors */
.grad-violet { background: linear-gradient(to right, #a78bfa, #8b5cf6); }
.grad-cyan { background: linear-gradient(to right, #22d3ee, #3b82f6); }
.grad-green { background: linear-gradient(to right, #4ade80, #10b981); }
.grad-purple { background: linear-gradient(to right, #c084fc, #7c3aed); }
.grad-orange { background: linear-gradient(to right, #fb923c, #f59e0b); }
.grad-pink { background: linear-gradient(to right, #f472b6, #f43f5e); }
.grad-teal { background: linear-gradient(to right, #2dd4bf, #06b6d4); }
.grad-gray { background: linear-gradient(to right, #9ca3af, #64748b); }
.grad-red { background: linear-gradient(to right, #f87171, #f43f5e); }
.grad-sky { background: linear-gradient(to right, #38bdf8, #3b82f6); }
.grad-indigo { background: linear-gradient(to right, #818cf8, #7c3aed); }

.bit-body { padding: 1.25rem; }
.bit-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.5rem; }
.bit-title { font-family: 'Gilda Display', Georgia, serif; font-size: 1.125rem; line-height: 1.4; }
.bit-desc { font-size: 0.875rem; color: #4b5563; line-height: 1.6; margin-bottom: 1rem; }
.bit-desc a { text-decoration: underline; text-decoration-thickness: 0.5px; text-underline-offset: 0.2em; }
.bit-desc a:hover { text-decoration-thickness: 1px; }
.bit-image { width: 100%; border-radius: 0.375rem; margin-bottom: 1rem; }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}
.status-live { background: #ecfdf5; color: #047857; }
.status-live .dot { background: #10b981; }
.status-deprecated { background: #f3f4f6; color: #6b7280; }
.status-deprecated .dot { background: #9ca3af; }
.dot { width: 0.375rem; height: 0.375rem; border-radius: 50%; display: inline-block; }

.stack-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; color: #9ca3af; margin-bottom: 0.375rem; }
.stack-tags { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.stack-tag {
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: #6b7280;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
}
.bit-link-row {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid #f3f4f6;
}
.bit-link-text { font-size: 0.75rem; color: #9ca3af; text-decoration: underline; text-decoration-thickness: 0.5px; text-underline-offset: 0.2em; }

/* ─── Bot Page ─── */
.bot-header {
  padding-top: 7rem;
  padding-bottom: 4rem;
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}
.bot-avatar { width: 10rem; height: 10rem; border-radius: 50%; object-fit: cover; margin-bottom: 1.5rem; }
.bot-cards {
  columns: 1;
  column-gap: 1.5rem;
}
@media (min-width: 768px) {
  .bot-cards { columns: 2; }
}
.bot-card {
  break-inside: avoid;
  margin-bottom: 1.5rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  background: #fff;
  padding: 1.5rem;
}
.bot-card h2 {
  font-family: 'Gilda Display', Georgia, serif;
  font-size: 1.25rem;
  font-weight: normal;
  margin-bottom: 1rem;
}
.bot-card ul { list-style: none; }
.bot-card li {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  margin-bottom: 0.625rem;
  font-size: 0.875rem;
  color: #4b5563;
  line-height: 1.6;
}
.bot-dot { margin-top: 0.125rem; font-size: 0.875rem; flex-shrink: 0; }

/* Bot dot colors */
.dot-violet { color: #8b5cf6; }
.dot-rose { color: #f43f5e; }
.dot-amber { color: #f59e0b; }
.dot-cyan { color: #06b6d4; }
.dot-emerald { color: #10b981; }
.dot-blue { color: #3b82f6; }
.dot-orange { color: #f97316; }

/* ─── Page header (Reading / Bits) ─── */
.page-hero {
  padding-top: 8rem;
  padding-bottom: 5rem;
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.page-hero h1 {
  font-family: 'Gilda Display', Georgia, serif;
  font-size: 1.875rem;
  font-weight: normal;
  margin-bottom: 1rem;
}
.page-hero .subtitle {
  font-size: 1.125rem;
  line-height: 1.6;
  max-width: 36rem;
}
@media (min-width: 640px) {
  .page-hero h1 { font-size: 3rem; }
}

/* ─── Contact ─── */
.contact-hero {
  padding-top: 8rem;
  padding-bottom: 5rem;
}
.contact-hero h1 {
  font-family: 'Gilda Display', Georgia, serif;
  font-size: 3rem;
  font-weight: normal;
  color: #111;
  margin-bottom: 1.5rem;
  line-height: 1.2;
}
.contact-hero p {
  font-size: 1.125rem;
  line-height: 1.6;
  max-width: 36rem;
}

/* ─── Utility ─── */
.mb-8 { margin-bottom: 2rem; }
.mt-8 { margin-top: 2rem; }
