/* ====================================================================
   PALIMPS — Palimpsest (blog) stylesheet
   Shared by /palimpsest/ and /en/palimpsest/ list and article pages.
   Tokens mirror website/index.html (BRAND.md). Single-language pages.
   ==================================================================== */

:root {
  --primary: #6B4CDB;
  --primary-deep: #4A2C9E;
  --primary-soft: #B39DDD;
  --bg: #F8F6FF;
  --surface: #FDFBFF;
  --surface-2: #EDE6F5;
  --border: #E4DCFA;
  --fg: #160E2C;
  --muted: #5F5678;
  --paper-1: #FBF3DF;
  --paper-2: #F0E7D1;
  --paper-3: #E4D9BF;
  --grad-top: #7A5EE5;
  --grad-bottom: #5C3BCC;
  --shadow-soft: 0 8px 30px rgba(74, 44, 158, 0.08);
  --shadow-strong: 0 24px 60px rgba(74, 44, 158, 0.18);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --serif: "New York", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Helvetica Neue", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #100C1E;
    --surface: #1C1630;
    --surface-2: #201A36;
    --border: #2E2550;
    --fg: #EDE9FA;
    --muted: #9B93B8;
    --primary: #8B67E0;
    --primary-deep: #B39DDD;
    --primary-soft: #8B67E0;
    --shadow-soft: 0 8px 30px rgba(0, 0, 0, 0.4);
    --shadow-strong: 0 24px 60px rgba(0, 0, 0, 0.6);
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ==================== HEADER ==================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.site-header.scrolled { border-bottom-color: var(--border); }
.site-header .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.5px;
  color: var(--fg);
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  background-image: url('/icon.png');
  background-size: cover;
  background-position: center;
}
.brand-name { font-family: var(--serif); font-weight: 700; letter-spacing: 0.8px; }

.nav-actions { display: flex; align-items: center; gap: 10px; }
.lang-link {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 999px;
  transition: all 0.15s ease;
}
.lang-link:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.nav-cta {
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 999px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 4px 14px rgba(107, 76, 219, 0.3);
}
.nav-cta:hover { text-decoration: none; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(107, 76, 219, 0.4); }

/* ==================== PAGE WRAP ==================== */
.page { padding: 64px 0 40px; }
@media (max-width: 760px) { .page { padding: 40px 0 24px; } }

/* ==================== BLOG LIST ==================== */
.pal-hero { text-align: center; max-width: 640px; margin: 0 auto 56px; }
.pal-eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 14px;
}
.pal-hero h1 {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(44px, 9vw, 76px);
  line-height: 1;
  letter-spacing: -1px;
  margin-bottom: 22px;
  background: linear-gradient(180deg, var(--primary-deep) 0%, var(--primary) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.pal-intro { font-size: 17px; line-height: 1.7; color: var(--muted); }

.post-list {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.post-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px 32px;
  color: var(--fg);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.post-card:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
  border-color: color-mix(in srgb, var(--primary) 32%, var(--border));
}
@media (max-width: 560px) { .post-card { padding: 24px 22px; } }
.post-card .post-meta {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.2px;
  margin-bottom: 12px;
}
.post-card h2 {
  font-size: clamp(20px, 3.2vw, 25px);
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.25;
  margin-bottom: 10px;
}
.post-card p {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 16px;
}
.post-card .post-go {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
}

/* ==================== FAQ ==================== */
.faq-list {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.faq-item:hover { border-color: color-mix(in srgb, var(--primary) 30%, var(--border)); }
.faq-item[open] {
  background: var(--surface-2);
  border-color: color-mix(in srgb, var(--primary) 38%, var(--border));
  box-shadow: var(--shadow-soft);
}
/* Hide native disclosure triangle across browsers */
.faq-item > summary { list-style: none; }
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item > summary::marker { content: ""; display: none; }
.faq-item summary {
  cursor: pointer;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
  line-height: 1.4;
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  color: var(--fg);
  -webkit-tap-highlight-color: transparent;
}
.faq-item summary:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}
.faq-item summary::after {
  content: "";
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  background-image:
    linear-gradient(currentColor, currentColor),
    linear-gradient(currentColor, currentColor);
  background-size: 12px 2px, 2px 12px;
  background-position: center center, center center;
  background-repeat: no-repeat;
  color: var(--primary);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.faq-item[open] summary::after {
  background-size: 12px 2px, 0 0;
  transform: rotate(180deg);
}
@media (max-width: 560px) {
  .faq-item summary { padding: 18px 18px; font-size: 16px; }
}
.faq-item .ans {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.72;
  color: var(--fg);
  padding: 0 24px 22px;
  margin: 0;
  border-top: 1px solid color-mix(in srgb, var(--primary) 16%, var(--border));
  padding-top: 16px;
}
@media (max-width: 560px) {
  .faq-item .ans { padding: 14px 18px 20px; font-size: 16px; }
}
.faq-item .ans a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }

/* ==================== ARTICLE ==================== */
.article { max-width: 680px; margin: 0 auto; }

.breadcrumb { font-size: 14px; color: var(--muted); margin-bottom: 22px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--primary); }

.article-header { margin-bottom: 36px; }
.article-header h1 {
  font-size: clamp(30px, 5.2vw, 46px);
  font-weight: 800;
  letter-spacing: -1.4px;
  line-height: 1.13;
  margin-bottom: 18px;
}
.article-lede {
  font-family: var(--serif);
  font-size: clamp(18px, 2.4vw, 21px);
  line-height: 1.55;
  color: var(--muted);
  margin-bottom: 24px;
}
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 14px;
  color: var(--muted);
  padding: 16px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.article-meta .dot { color: var(--primary-soft); }

/* Hero image */
.article-hero { margin: 0 0 36px; }
.article-hero img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

/* Article prose */
.article-body { font-family: var(--serif); }
.article-body p {
  font-size: 19px;
  line-height: 1.78;
  color: var(--fg);
  margin: 0 0 1.35em;
}
.article-body h2 {
  font-family: var(--sans);
  font-size: clamp(22px, 3.4vw, 29px);
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.28;
  margin: 1.9em 0 0.55em;
}
.article-body h2:first-child { margin-top: 0; }
.article-body strong { font-weight: 700; color: var(--fg); }
.article-body a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }

/* Closing note — a margin note on paper */
.article-close {
  margin-top: 40px;
  background: var(--paper-1);
  border: 1px solid var(--paper-3);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 22px 26px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  line-height: 1.65;
  color: #1F1530;
}
.article-close a { color: var(--primary-deep); font-weight: 600; }
@media (prefers-color-scheme: dark) {
  .article-close {
    background: var(--surface);
    border-color: var(--border);
    border-left-color: var(--primary);
    color: var(--muted);
  }
  .article-close a { color: var(--primary); }
}

/* ==================== END CTA ==================== */
.end-cta {
  max-width: 680px;
  margin: 64px auto 0;
  text-align: center;
  background: linear-gradient(135deg, var(--grad-top), var(--grad-bottom));
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 48px 36px;
}
@media (max-width: 560px) { .end-cta { padding: 36px 24px; } }
.end-cta h2 {
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 800;
  letter-spacing: -0.8px;
  line-height: 1.15;
  margin-bottom: 10px;
}
.end-cta h2 em { font-style: normal; font-family: var(--serif); }
.end-cta p { font-size: 16px; opacity: 0.9; margin-bottom: 24px; }
.btn-store {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--paper-1);
  color: #1F1530;
  padding: 14px 24px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 15px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-store:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-strong); }
.btn-store svg { width: 22px; height: 22px; }

/* ==================== FOOTER ==================== */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 80px;
  padding: 48px 0 40px;
  font-size: 14px;
  color: var(--muted);
}
.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
}
@media (max-width: 620px) { .footer-inner { grid-template-columns: 1fr; text-align: center; } }
.footer-brand { display: flex; align-items: center; gap: 10px; }
.footer-brand strong { font-family: var(--serif); letter-spacing: 0.8px; }
.footer-brand .tag { display: block; font-size: 12px; margin-top: 2px; }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 620px) { .footer-links { justify-content: center; } }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--primary); text-decoration: none; }
.footer-meta {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
}
@media (max-width: 620px) { .footer-meta { justify-content: center; text-align: center; } }
