:root {
  --bg: #FAF6EF;
  --text: #2E2E2E;
  --muted: #6B6B6B;
  --card: #FFFFFF;
  --accent: #FF8A3D;
  --border: #E7E1D6;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}

header {
  position: sticky;
  top: 0;
  background: var(--bg);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
  z-index: 10;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}

.brand {
  display: flex;
  align-items: center;
  cursor: pointer;
  text-decoration: none;
}

.brand .logo {
  display: block;
  width: 320px;
  height: 48px;
  background: url('../logo.svg') no-repeat left center;
  background-size: contain;
}

/* Hide the old text span visually but keep it for screen readers/SEO */
.brand [data-site-name] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.nav-links {
  display: flex;
  gap: 18px;
  align-items: center;
}

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

.lang-switch {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
}

.hero {
  padding: 40px 0 20px;
}

.hero h1 { margin: 0 0 8px; font-size: 28px; }
.hero p { margin: 0; color: var(--muted); }

/* Apple-style Hero section for Homepage */
.home-hero {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 40px 20px;
  position: relative;
  overflow: hidden;
}

.home-hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
  background: linear-gradient(135deg, var(--text) 0%, var(--muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.home-hero p {
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  color: var(--muted);
  max-width: 600px;
  margin: 0 0 40px;
  line-height: 1.5;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.15s forwards;
}

.home-cta {
  display: flex;
  gap: 16px;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards;
}

.btn {
  display: inline-block;
  padding: 14px 28px;
  border-radius: 980px;
  font-size: 17px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary {
  background: var(--text);
  color: var(--bg);
}

.btn-primary:hover {
  background: var(--accent);
  color: #fff;
  transform: scale(1.02);
}

.btn-secondary {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--muted);
  transform: scale(1.02);
}

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

/* Mouse trail effect canvas */
#mouse-trail {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 18px;
}

/* Three-column homepage layout */
.layout {
  display: grid;
  grid-template-columns: 240px 1fr 380px;
  gap: 20px;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 80px; /* below header */
}

.sidebar .menu { list-style: none; padding: 0; margin: 0; }
.sidebar .menu li { margin: 8px 0; }
.sidebar .menu a { color: var(--text); text-decoration: none; display: block; padding: 8px 10px; border-radius: 10px; }
.sidebar .menu a:hover { color: var(--accent); background: rgba(255,138,61,0.08); }

.articles { display: grid; grid-template-columns: 1fr; gap: 16px; }
.article-card { display: block; text-decoration: none; color: var(--text); }
.article-card h3 { margin: 0 0 6px; }
.article-card .muted { font-size: 14px; }

.widgets { display: grid; grid-template-columns: 1fr; gap: 16px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}

.card h3 { margin: 0 0 10px; font-size: 18px; }
.card .muted { color: var(--muted); font-size: 14px; }

.footer {
  margin-top: 40px;
  padding: 30px 0;
  border-top: 1px solid var(--border);
}

.footer .links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
}

.footer .links a { color: var(--text); text-decoration: none; }
.footer .links a:hover { color: var(--accent); }

.price {
  font-size: 22px;
  font-weight: 700;
}

.change {
  font-weight: 600;
}

.change.up { color: #2E8B57; }
.change.down { color: #B22222; }

.list { list-style: none; padding: 0; margin: 0; }
.list li { display: flex; align-items: baseline; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--border); }

.disclaimer {
  margin-top: 10px; color: var(--muted); font-size: 13px;
}

@media (max-width: 1100px) {
  .layout { grid-template-columns: 220px 1fr; }
  .widgets { grid-template-columns: 1fr; }
}

.prose {
  max-width: 760px;
}

.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 {
  line-height: 1.25;
  margin: 18px 0 10px;
}

.prose p {
  margin: 12px 0;
}

.prose a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

.prose ul, .prose ol {
  padding-left: 20px;
  margin: 12px 0;
}

.prose li {
  margin: 6px 0;
}

.prose blockquote {
  margin: 14px 0;
  padding: 8px 12px;
  border-left: 3px solid var(--border);
  background: rgba(0,0,0,0.02);
  border-radius: 12px;
}

.prose pre {
  margin: 14px 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(0,0,0,0.03);
  overflow: auto;
}

.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.95em;
}

.empty-state {
  color: var(--muted);
}

.span-6 {
  grid-column: span 6;
}

.grid > .empty-state {
  grid-column: 1 / -1;
}

.post-meta {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
}

.post-card-meta {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.tools-shell {
  max-width: 960px;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 820px) {
  .nav {
    flex-direction: column;
    gap: 16px;
  }
  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
  }
  .grid { grid-template-columns: repeat(1, 1fr); }
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .tools-grid { grid-template-columns: 1fr; }
}
