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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #f0f4f8;
  color: #1e293b;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* NAV */
.nav {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.nav-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 17px;
  color: #2563eb;
  cursor: default;
  user-select: none;
}
.nav-links { display: flex; gap: 24px; }
.nav-links a {
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
  text-decoration: none;
  transition: color 0.2s;
}
.nav-links a:hover { color: #2563eb; }

/* HERO */
.hero {
  text-align: center;
  padding: 64px 24px 48px;
  background: linear-gradient(180deg, #fff 0%, #f0f4f8 100%);
}
.hero h1 {
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 8px;
}
.hero-sub {
  font-size: 15px;
  color: #64748b;
  margin-bottom: 28px;
}
.search-wrap {
  max-width: 560px;
  margin: 0 auto;
  position: relative;
}
.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}
.search-wrap input {
  width: 100%;
  padding: 14px 16px 14px 44px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: #1e293b;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-wrap input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.search-wrap input::placeholder { color: #94a3b8; }

/* SECTION TITLES */
.section-title {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 20px;
  text-align: center;
}

/* CATEGORIES */
.categories {
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 24px 48px;
}
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 24px;
  cursor: pointer;
  transition: box-shadow 0.25s, border-color 0.25s, transform 0.2s;
}
.card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  border-color: #cbd5e1;
  transform: translateY(-1px);
}
.card.open { border-color: #2563eb; }
.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}
.card-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.card-icon-blue   { background: #eff6ff; color: #2563eb; }
.card-icon-orange { background: #fff7ed; color: #ea580c; }
.card-icon-green  { background: #f0fdf4; color: #16a34a; }
.card-icon-purple { background: #faf5ff; color: #9333ea; }
.card-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: #0f172a;
  flex: 1;
}
.chevron {
  color: #94a3b8;
  transition: transform 0.3s ease;
  flex-shrink: 0;
}
.card.open .chevron { transform: rotate(180deg); color: #2563eb; }
.card-desc {
  font-size: 13px;
  color: #64748b;
  margin-top: 12px;
  line-height: 1.5;
}
.card-articles {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, margin 0.3s ease;
  margin-top: 0;
}
.card.open .card-articles {
  max-height: 300px;
  margin-top: 16px;
}
.article-link {
  display: block;
  padding: 10px 12px;
  font-size: 13px;
  color: #2563eb;
  text-decoration: none;
  border-radius: 8px;
  transition: background 0.15s;
  border-bottom: 1px solid #f1f5f9;
}
.article-link:last-child { border-bottom: none; }
.article-link:hover { background: #f8fafc; }
.article-link::before {
  content: '📄 ';
  font-size: 12px;
}

/* FAQ */
.faq-section {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 24px 48px;
}
.faq-list { display: flex; flex-direction: column; gap: 8px; }
.faq-item {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.2s;
}
.faq-item.open { border-color: #2563eb; }
.faq-q {
  width: 100%;
  padding: 16px 20px;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: color 0.2s;
}
.faq-q:hover { color: #2563eb; }
.faq-q::after {
  content: '+';
  font-size: 18px;
  font-weight: 400;
  color: #94a3b8;
  transition: transform 0.3s;
}
.faq-item.open .faq-q::after {
  content: '−';
  color: #2563eb;
}
.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}
.faq-item.open .faq-a { max-height: 200px; }
.faq-a p {
  padding: 0 20px 16px;
  font-size: 13px;
  color: #64748b;
  line-height: 1.7;
}

/* CONTACT */
.contact-section {
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 24px 56px;
}
.contact-sub {
  text-align: center;
  font-size: 14px;
  color: #64748b;
  margin-top: -12px;
  margin-bottom: 24px;
}
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.contact-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 28px 24px;
  text-align: center;
  transition: box-shadow 0.2s, transform 0.2s;
}
.contact-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  transform: translateY(-1px);
}
.contact-card svg { margin-bottom: 12px; }
.contact-card h4 {
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 4px;
}
.contact-card p { font-size: 13px; color: #64748b; }

/* FOOTER */
.footer {
  background: #fff;
  border-top: 1px solid #e2e8f0;
  padding: 20px 24px;
}
.footer-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.footer p { font-size: 12px; color: #94a3b8; }
.footer-links { display: flex; gap: 16px; }
.footer-links a {
  font-size: 12px;
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.2s;
}
.footer-links a:hover { color: #64748b; }

/* SEARCH FILTERING */
.card.hidden { display: none; }

/* RESPONSIVE */
@media (max-width: 640px) {
  .cards-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .footer-inner { flex-direction: column; text-align: center; }
}

/* PORTAL OVERLAY */
#portal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #0f172a;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
#portal-overlay.active {
  opacity: 1;
  pointer-events: all;
}
.portal-bar {
  height: 36px;
  background: #1e293b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  flex-shrink: 0;
}
.portal-title {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 500;
}
.portal-close {
  background: none;
  border: none;
  color: #64748b;
  font-size: 20px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.2s;
}
.portal-close:hover { color: #f87171; }
.portal-frame {
  flex: 1;
  border: none;
  width: 100%;
  background: #0f172a;
}
