:root {
  --c-bg: #ffffff;
  --c-bg-soft: #fafaf8;
  --c-surface: #ffffff;
  --c-border: rgba(0, 0, 0, 0.08);
  --c-border-strong: rgba(0, 0, 0, 0.15);
  --c-text: #111111;
  --c-text-muted: rgba(17, 17, 17, 0.5);
  --c-text-subtle: rgba(17, 17, 17, 0.28);
  --c-accent: #6366f1;
  --c-accent-soft: rgba(99, 102, 241, 0.08);
  --c-accent-border: rgba(99, 102, 241, 0.2);
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'Inter', system-ui, sans-serif;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--c-text);
  background: var(--c-bg-soft);
  -webkit-font-smoothing: antialiased;
}

/* NAV */
.nav {
  background: var(--c-surface);
  border-bottom: 0.5px solid var(--c-border);
  padding: 0 48px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-logo { display: inline-block; text-decoration: none; }
.nav-logo-text {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 700;
  color: var(--c-text);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  display: block;
  line-height: 1;
}
.nav-logo-line {
  position: relative;
  margin-top: 4px;
  height: 6px;
}
.nav-logo-line::before {
  content: '';
  position: absolute;
  top: 50%; left: 0; right: 0;
  height: 1.5px;
  transform: translateY(-50%);
  background: linear-gradient(to right, transparent 0%, var(--c-accent) 25%, var(--c-accent) 75%, transparent 100%);
  opacity: 0.5;
}
.nav-logo-dot {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--c-accent);
}
.nav-links { display: flex; gap: 28px; }
.nav-links a { font-size: 13px; color: var(--c-text-muted); text-decoration: none; }
.nav-links a:hover { color: var(--c-text); }
.nav-cta {
  font-size: 13px;
  background: var(--c-accent);
  color: #fff;
  padding: 7px 16px;
  border-radius: var(--radius-md);
  text-decoration: none;
}

/* HERO */
.hero {
  background: var(--c-surface);
  border-bottom: 0.5px solid var(--c-border);
  padding: 72px 48px 56px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}
.hero-label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-accent);
  margin-bottom: 18px;
}
.hero-title {
  font-family: var(--font-serif);
  font-size: 46px;
  line-height: 1.15;
  letter-spacing: -1px;
  font-weight: 700;
  margin-bottom: 18px;
  color: var(--c-text);
}
.hero-title em { color: var(--c-text-subtle); font-style: italic; }
.hero-sub {
  font-size: 15px;
  color: var(--c-text-muted);
  line-height: 1.65;
  margin-bottom: 28px;
}
.hero-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tag {
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 20px;
  border: 0.5px solid var(--c-border);
  color: var(--c-text-muted);
  text-decoration: none;
}
.tag-active {
  border-color: var(--c-accent-border);
  color: var(--c-accent);
  background: var(--c-accent-soft);
}
.hero-right {
  background: var(--c-bg-soft);
  border: 0.5px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 32px;
}
.most-read-label {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-accent);
  margin-bottom: 16px;
}
.most-read-item {
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 12px 0;
  border-bottom: 0.5px solid var(--c-border);
  text-decoration: none;
}
.most-read-item:last-child { border-bottom: none; }
.most-read-num { font-size: 11px; color: var(--c-text-subtle); min-width: 16px; }
.most-read-title { font-size: 14px; color: var(--c-text); line-height: 1.4; }

/* SECTIONS */
.articles-section, .tools-section {
  padding: 48px;
  border-bottom: 0.5px solid var(--c-border);
}
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 28px;
}
.section-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-text-subtle);
}
.section-link { font-size: 13px; color: var(--c-accent); text-decoration: none; }

/* ARTICLES GRID */
.articles-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--c-border);
  border: 0.5px solid var(--c-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.article-card {
  background: var(--c-surface);
  padding: 26px;
}
.article-card-image { width: 100%; height: 180px; object-fit: cover; display: block; margin-bottom: 16px; }
.article-cat {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-accent);
  margin-bottom: 12px;
}
.article-title {
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1.35;
  margin-bottom: 10px;
}
.article-title a { color: var(--c-text); text-decoration: none; }
.article-title a:hover { color: var(--c-accent); }
.article-card--featured .article-title { font-size: 24px; letter-spacing: -0.5px; }
.article-excerpt { font-size: 13px; color: var(--c-text-muted); line-height: 1.6; margin-bottom: 18px; }
.article-meta { font-size: 12px; color: var(--c-text-subtle); }

/* TOOLS */
.tools-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tool-card {
  background: var(--c-surface);
  border: 0.5px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  gap: 14px;
  text-decoration: none;
}
.tool-card--soon { opacity: 0.6; cursor: default; }
.tool-icon {
  width: 34px; height: 34px;
  border-radius: 8px;
  flex-shrink: 0;
  background: var(--c-accent-soft);
  border: 0.5px solid var(--c-accent-border);
  display: flex;
  align-items: center;
  justify-content: center;
}
.tool-name { font-size: 14px; font-weight: 500; color: var(--c-text); margin-bottom: 5px; }
.tool-desc { font-size: 13px; color: var(--c-text-muted); line-height: 1.5; }
.tool-badge {
  font-size: 10px;
  margin-top: 7px;
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--c-accent-soft);
  color: var(--c-accent);
  border: 0.5px solid var(--c-accent-border);
}
.tool-badge--soon {
  background: rgba(0,0,0,0.03);
  color: var(--c-text-subtle);
  border-color: var(--c-border);
}

/* FOOTER */
.footer {
  padding: 28px 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--c-surface);
  border-top: 0.5px solid var(--c-border);
}
.footer-logo {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--c-text);
  opacity: 0.4;
}
.footer-note { font-size: 12px; color: var(--c-text-subtle); }



/* POST */
.post {
  max-width: 720px;
  margin: 0 auto;
  padding: 64px 48px;
}
.post-cat {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-accent);
  text-decoration: none;
  display: block;
  margin-bottom: 16px;
}
.post-title {
  font-family: var(--font-serif);
  font-size: 42px;
  line-height: 1.2;
  letter-spacing: -1px;
  font-weight: 700;
  color: var(--c-text);
  margin-bottom: 16px;
}
.post-meta {
  font-size: 13px;
  color: var(--c-text-subtle);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 40px;
}
.post-meta-dot {
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--c-text-subtle);
  display: inline-block;
}
.post-image-wrap {
  margin: 0 -48px 48px;
}
.post-image {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  display: block;
}
.gh-content {
  font-size: 18px;
  line-height: 1.8;
  color: var(--c-text);
}
.gh-content h2 {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 700;
  margin: 48px 0 16px;
  color: var(--c-text);
}
.gh-content h3 {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  margin: 36px 0 12px;
  color: var(--c-text);
}
.gh-content p { margin-bottom: 24px; }
.gh-content img {
  width: 100%;
  border-radius: var(--radius-md);
  margin: 32px 0;
  border: 0.5px solid var(--c-border);
}
.gh-content a { color: var(--c-accent); }
.gh-content ul, .gh-content ol {
  margin: 0 0 24px 24px;
}
.gh-content li { margin-bottom: 8px; }
.gh-content blockquote {
  border-left: 3px solid var(--c-accent);
  padding-left: 24px;
  margin: 32px 0;
  color: var(--c-text-muted);
  font-style: italic;
}

/* MOBILE */
@media (max-width: 768px) {
  .nav {
    padding: 0 20px;
  }
  .nav-links { display: none; }
  .nav-cta { font-size: 12px; padding: 6px 12px; }

  .hero {
    grid-template-columns: 1fr;
    padding: 40px 20px 32px;
    gap: 32px;
  }
  .hero-title { font-size: 32px; }

  .articles-section, .tools-section {
    padding: 32px 20px;
  }
  .articles-grid {
    grid-template-columns: 1fr;
  }
  .article-card--featured .article-title { font-size: 20px; }

  .tools-grid {
    grid-template-columns: 1fr;
  }

  .footer {
    padding: 20px;
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }

  .post {
    padding: 32px 20px;
  }
  .post-title { font-size: 28px; }
  .post-image-wrap { margin: 0 -20px 32px; }
  .gh-content { font-size: 16px; }
}

.kg-width-wide { margin: 0 -80px; }
.kg-width-full { margin: 0 -48px; width: calc(100% + 96px); }


/* ═══════════════════════════════════════════
   REFERENCING GENERATOR — Tool Styles
   Append these to main.css
═══════════════════════════════════════════ */

/* Search box */
.ref-search-wrap { max-width: 720px; margin: 0 auto; }
.ref-search-box {
  background: var(--c-surface);
  border: 1px solid var(--c-border-strong, rgba(0,0,0,0.14));
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.ref-style-select {
  border: none;
  border-right: 0.5px solid var(--c-border);
  padding: 0 16px;
  height: 52px;
  font-size: 13px;
  font-family: var(--font-sans);
  color: var(--c-text);
  background: var(--c-bg-soft);
  cursor: pointer;
  min-width: 180px;
  outline: none;
}
.ref-search-input {
  flex: 1;
  border: none;
  padding: 0 16px;
  height: 52px;
  font-size: 14px;
  font-family: var(--font-sans);
  color: var(--c-text);
  background: var(--c-surface);
  outline: none;
}
.ref-search-input::placeholder { color: var(--c-text-muted); }
.ref-cite-btn {
  background: var(--c-accent);
  color: #fff;
  border: none;
  padding: 0 28px;
  height: 52px;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s;
}
.ref-cite-btn:hover { opacity: 0.9; }
.ref-cite-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Search hints */
.ref-search-hints {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  margin-top: 12px;
  font-size: 12px;
  color: var(--c-text-muted);
}
.ref-hint-dot {
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--c-text-subtle);
  display: inline-block;
}
.ref-manual-link {
  font-size: 12px;
  color: var(--c-accent);
  text-decoration: none;
  display: block;
  text-align: center;
  margin-top: 12px;
}
.ref-manual-link:hover { text-decoration: underline; }

/* Loading dots */
.ref-loading {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 16px 0;
}
.ref-loading-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--c-accent);
  animation: ref-bounce 1s infinite ease-in-out;
}
.ref-loading-dot:nth-child(2) { animation-delay: 0.15s; }
.ref-loading-dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes ref-bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* Error */
.ref-error {
  font-size: 13px;
  color: var(--c-danger-text);
  background: var(--c-danger-soft);
  border: 0.5px solid var(--c-danger-border);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  margin-top: 12px;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  text-align: left;
}

/* Results list */
.ref-results-list {
  background: var(--c-surface);
  border: 0.5px solid var(--c-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-align: left;
}
.ref-result-item {
  padding: 14px 20px;
  border-bottom: 0.5px solid var(--c-border);
  cursor: pointer;
  transition: background 0.1s;
}
.ref-result-item:last-child { border-bottom: none; }
.ref-result-item:hover { background: var(--c-surface-sub); }
.ref-result-item.selected {
  background: var(--c-accent-soft);
  border-left: 3px solid var(--c-accent);
}
.ref-result-title {
  font-size: 14px;
  color: var(--c-text);
  font-weight: 500;
  margin-bottom: 3px;
}
.ref-result-item.selected .ref-result-title { color: var(--c-accent-text); }
.ref-result-meta { font-size: 12px; color: var(--c-text-muted); }

/* Output section */
.ref-output-section { border-top: 0.5px solid var(--c-border); background: var(--c-bg-soft); }
.ref-output-box {
  background: var(--c-surface);
  border: 0.5px solid var(--c-accent-border);
  border-left: 3px solid var(--c-accent);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 20px 24px;
  margin-bottom: 16px;
}
.ref-output-text {
  font-size: 15px;
  line-height: 1.8;
  color: var(--c-text);
}
.ref-output-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.ref-copy-btn {
  font-size: 12px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: 0.5px solid var(--c-accent-border);
  color: var(--c-accent-text);
  background: var(--c-accent-soft);
  cursor: pointer;
  font-family: var(--font-sans);
  transition: opacity 0.15s;
}
.ref-copy-btn:hover { opacity: 0.8; }
.ref-intext-btn {
  font-size: 12px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: 0.5px solid var(--c-border);
  color: var(--c-text-muted);
  background: var(--c-surface);
  cursor: pointer;
  font-family: var(--font-sans);
}

/* Styles bar */
.ref-styles-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 16px;
}
.ref-styles-label { font-size: 12px; color: var(--c-text-subtle); margin-right: 4px; }
.ref-style-switch { cursor: pointer; }

/* Manual form */
.ref-manual-wrap {
  background: var(--c-surface);
  border: 0.5px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-top: 16px;
}
.ref-manual-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.ref-manual-select {
  font-size: 13px;
  padding: 6px 12px;
  border: 0.5px solid var(--c-border);
  border-radius: var(--radius-sm);
  background: var(--c-bg-soft);
  color: var(--c-text);
  font-family: var(--font-sans);
  outline: none;
}
.ref-manual-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.ref-field { display: flex; flex-direction: column; gap: 5px; }
.ref-field--full { grid-column: 1 / -1; }
.ref-field label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--c-text-subtle);
}
.ref-field input {
  font-size: 13px;
  padding: 8px 12px;
  border: 0.5px solid var(--c-border);
  border-radius: var(--radius-sm);
  background: var(--c-bg-soft);
  color: var(--c-text);
  outline: none;
  font-family: var(--font-sans);
}
.ref-field input:focus { border-color: var(--c-accent-border); background: var(--c-surface); }
.ref-manual-actions { margin-top: 20px; }

/* Mobile */
@media (max-width: 768px) {
  .ref-search-box { flex-direction: column; border-radius: var(--radius-md); }
  .ref-style-select {
    border-right: none;
    border-bottom: 0.5px solid var(--c-border);
    width: 100%;
    height: 44px;
    min-width: unset;
  }
  .ref-search-input { width: 100%; height: 44px; }
  .ref-cite-btn { width: 100%; height: 44px; }
  .ref-manual-grid { grid-template-columns: 1fr; }
  .ref-field--full { grid-column: 1; }
}
