/* ============================================================
   Components
   ============================================================ */

/* --- Navbar --- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 76px;
  display: flex;
  align-items: center;
  background: transparent;
  transition: background var(--dur-hover) var(--ease-standard),
    box-shadow var(--dur-hover) var(--ease-standard),
    border-color var(--dur-hover) var(--ease-standard);
  border-bottom: 1px solid transparent;
}

.navbar.is-scrolled {
  background: color-mix(in srgb, var(--surface-0) 88%, transparent);
  backdrop-filter: blur(10px) saturate(1.1);
  -webkit-backdrop-filter: blur(10px) saturate(1.1);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
}

.navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 1.05rem;
  color: var(--text-primary);
}

.brand__mark {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  gap: var(--sp-4);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  font-size: 0.95rem;
  color: var(--text-secondary);
  position: relative;
  padding: 6px 0;
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  height: 1px;
  width: 0;
  background: var(--accent);
  transition: width var(--dur-hover) var(--ease-standard);
}

.nav-links a:hover::after,
.nav-links a[aria-current='page']::after {
  width: 100%;
}

.nav-links a[aria-current='page'] {
  color: var(--text-primary);
}

.navbar__actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--surface-1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: border-color var(--dur-hover) var(--ease-standard);
}
.theme-toggle:hover { border-color: var(--border-strong); }
[data-theme='dark'] .theme-toggle .icon-sun { display: block; }
[data-theme='dark'] .theme-toggle .icon-moon { display: none; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }

@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-toggle { display: inline-flex; }
}

.mobile-menu {
  position: fixed;
  inset: 0;
  background: var(--surface-0);
  z-index: 200;
  display: flex;
  flex-direction: column;
  padding: var(--sp-3);
  transform: translateY(-8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-page) var(--ease-standard), transform var(--dur-page) var(--ease-standard);
}

.mobile-menu.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.mobile-menu__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 76px;
}

.mobile-menu__links {
  list-style: none;
  padding: 0;
  margin: var(--sp-4) 0 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.mobile-menu__links a {
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  padding: var(--sp-1) 0;
  min-height: 44px;
  display: flex;
  align-items: center;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform var(--dur-hover) var(--ease-standard),
    background var(--dur-hover) var(--ease-standard),
    border-color var(--dur-hover) var(--ease-standard);
  min-height: 44px;
}

.btn-primary {
  background: var(--npw-forest);
  color: #fdfcfa;
}
[data-theme='dark'] .btn-primary,
@media (prefers-color-scheme: dark) { }
.btn-primary:hover {
  transform: translateY(-1px);
  background: color-mix(in srgb, var(--npw-forest) 88%, black);
}

.btn-secondary {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text-primary);
}
.btn-secondary:hover {
  border-color: var(--npw-forest);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover { color: var(--text-primary); }

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* --- Hero --- */
.hero {
  position: relative;
  padding-top: var(--sp-16);
  padding-bottom: var(--sp-12);
  overflow: hidden;
}

.hero__ridges {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.55;
  pointer-events: none;
  --ridge-stroke: var(--border-strong);
}
[data-theme='dark'] .hero__ridges { opacity: 0.4; }

.hero::before {
  content: '';
  position: absolute;
  top: -10%;
  right: -5%;
  width: 620px;
  height: 620px;
  background: radial-gradient(circle, color-mix(in srgb, var(--npw-forest) 10%, transparent) 0%, transparent 70%);
  z-index: 0;
  pointer-events: none;
  animation: hero-glow 10s ease-in-out infinite;
}
[data-theme='dark'] .hero::before {
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 16%, transparent) 0%, transparent 70%);
}

@keyframes hero-glow {
  0%, 100% { transform: scale(1) translateY(0); opacity: 0.8; }
  50% { transform: scale(1.08) translateY(12px); opacity: 1; }
}

/* Subtle "signal flowing along the terrain" effect: a dashed line whose
   dash pattern scrolls slowly. Reads as data moving through a network,
   which fits the brand, and is animated but genuinely subtle: dim
   color, ~1.5px lines, long duration. Disabled entirely under
   prefers-reduced-motion by the global rule in base.css. */
.ridge-line {
  animation: ridge-flow linear infinite;
}
.ridge-line--1 { animation-duration: 14s; }
.ridge-line--2 { animation-duration: 19s; animation-direction: reverse; }
.ridge-line--3 { animation-duration: 24s; }

@keyframes ridge-flow {
  to { stroke-dashoffset: -240; }
}

.hero__grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: var(--sp-8);
  align-items: center;
}
@media (max-width: 960px) {
  .hero__grid { grid-template-columns: 1fr; gap: var(--sp-6); }
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: 620px;
}

.hero p.lead {
  font-size: var(--fs-lg);
  color: var(--text-secondary);
  max-width: 560px;
}

.hero__cta-row {
  display: flex;
  gap: var(--sp-2);
  margin-top: var(--sp-4);
  flex-wrap: wrap;
}

/* Signature element: a live-looking status panel. Ties the hero directly
   to what the company sells (reliability) instead of decorating it. */
.status-panel {
  position: relative;
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-3);
  max-width: 400px;
  margin-left: auto;
}
[data-theme='dark'] .status-panel { box-shadow: var(--shadow-md); }

.status-panel__head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: var(--sp-2);
}

.status-panel__updated {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-muted);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--npw-olive);
  flex-shrink: 0;
  animation: status-pulse 2.4s ease-in-out infinite;
}
.status-dot--sm { width: 6px; height: 6px; animation-duration: 2.8s; }

/* A gentle pulse on the "live" indicator only, standard status-page
   language (GitHub, Vercel, etc. all do this). One element, not the
   whole page, so it reads as a real signal rather than decoration. */
@keyframes status-pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--npw-olive) 35%, transparent); }
  50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--npw-olive) 0%, transparent); }
}

.status-panel__rows {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.status-panel__rows li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--text-secondary);
}
.status-panel__rows li span:nth-child(2) {
  flex: 1;
  color: var(--text-primary);
}

.status-panel__foot {
  margin-top: var(--sp-2);
  padding-top: var(--sp-2);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.mono { font-family: var(--font-mono); }

/* --- Section title --- */
.section-title {
  max-width: 700px;
  margin-bottom: var(--sp-6);
}
.section-title.centered {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

/* --- Cards --- */
.card {
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-hover) var(--ease-standard),
    border-color var(--dur-hover) var(--ease-standard),
    box-shadow var(--dur-hover) var(--ease-standard);
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.card__icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--npw-forest) 10%, transparent);
  color: var(--npw-forest);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--sp-2);
}
[data-theme='dark'] .card__icon { color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); }

.card h3 { font-size: 1.2rem; margin-bottom: 6px; }
.card p { margin: 0; font-size: 0.98rem; }

/* --- Bento grid --- */
.bento {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--sp-2);
}
.bento .card { grid-column: span 3; }
.bento .card.span-4 { grid-column: span 4; }
.bento .card.span-2 { grid-column: span 2; }
.bento .card.span-6 { grid-column: span 6; }

@media (max-width: 900px) {
  .bento { grid-template-columns: 1fr; }
  .bento .card, .bento .card.span-4, .bento .card.span-2, .bento .card.span-6 { grid-column: span 1; }
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-3);
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-3);
}
@media (max-width: 900px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

/* --- Stats --- */
.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-3);
}
.stat .num {
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  font-weight: 650;
  color: var(--npw-forest);
}
[data-theme='dark'] .stat .num { color: var(--accent); }
.stat .label {
  font-size: 0.9rem;
  color: var(--text-muted);
}
@media (max-width: 720px) {
  .stat-row { grid-template-columns: repeat(2, 1fr); gap: var(--sp-4); }
}

/* --- Process / timeline --- */
.process-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.process-step {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: var(--sp-3);
  padding: var(--sp-4) 0;
  border-top: 1px solid var(--border-subtle);
}
.process-step:last-child { border-bottom: 1px solid var(--border-subtle); }
.process-step .index {
  font-family: var(--font-mono);
  color: var(--npw-copper);
  font-size: 1.1rem;
  font-weight: 600;
}

/* --- FAQ / accordion --- */
.accordion-item {
  border-bottom: 1px solid var(--border-subtle);
}
.accordion-trigger {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: var(--sp-3) 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-2);
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--text-primary);
  min-height: 44px;
}
.accordion-trigger .plus {
  transition: transform var(--dur-hover) var(--ease-standard);
  flex-shrink: 0;
}
.accordion-item[data-open='true'] .plus { transform: rotate(45deg); }

.accordion-panel {
  overflow: hidden;
  max-height: 0;
  transition: max-height var(--dur-reveal) var(--ease-standard);
}
.accordion-panel__inner { padding-bottom: var(--sp-3); }

/* --- Forms --- */
.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: var(--sp-3);
}
.form-field label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}
.form-field .hint {
  font-size: 0.82rem;
  color: var(--text-muted);
}
.form-field input,
.form-field textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 14px 16px;
  min-height: 52px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface-1);
  color: var(--text-primary);
  transition: border-color var(--dur-hover) var(--ease-standard), box-shadow var(--dur-hover) var(--ease-standard);
}
.form-field textarea { min-height: 140px; resize: vertical; }
.form-field input:focus,
.form-field textarea:focus {
  border-color: var(--npw-forest);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--npw-forest) 18%, transparent);
  outline: none;
}
.form-field.has-error input,
.form-field.has-error textarea {
  border-color: #a3453a;
}
.field-error {
  font-size: 0.85rem;
  color: #a3453a;
}
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.alert {
  border-radius: var(--radius-md);
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--border-subtle);
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: var(--sp-3);
}
.alert-success { background: color-mix(in srgb, var(--npw-olive) 14%, var(--surface-1)); border-color: color-mix(in srgb, var(--npw-olive) 40%, transparent); }
.alert-error { background: color-mix(in srgb, #a3453a 10%, var(--surface-1)); border-color: color-mix(in srgb, #a3453a 35%, transparent); }

/* --- Badges --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--text-secondary);
}

/* --- Blog card --- */
.blog-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: var(--sp-3) 0;
  border-top: 1px solid var(--border-subtle);
}
.blog-card:last-child { border-bottom: 1px solid var(--border-subtle); }
.blog-card__meta {
  display: flex;
  gap: var(--sp-2);
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.blog-card h3 { font-size: 1.3rem; margin-bottom: 4px; }
.blog-card h3 a:hover { color: var(--npw-forest); }
[data-theme='dark'] .blog-card h3 a:hover { color: var(--accent); }

/* --- Article --- */
.article-header { max-width: var(--prose-max); margin: 0 auto var(--sp-6); }
.article-body { max-width: var(--prose-max); margin: 0 auto; }
.article-body p { color: var(--text-primary); font-size: 1.08rem; }

/* --- Footer --- */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: var(--sp-8) 0 var(--sp-4);
  background: var(--surface-1);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--sp-4);
}
.footer-grid h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: var(--sp-2);
}
.footer-links { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-links a { color: var(--text-secondary); font-size: 0.93rem; }
.footer-links a:hover { color: var(--text-primary); }
.footer-bottom {
  margin-top: var(--sp-6);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 8px;
}
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

/* --- Reveal on scroll --- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity var(--dur-reveal) var(--ease-standard), transform var(--dur-reveal) var(--ease-standard);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Skeleton loader --- */
.skeleton {
  border-radius: var(--radius-sm);
  background: linear-gradient(100deg, var(--surface-2) 30%, var(--surface-1) 45%, var(--surface-2) 60%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
@keyframes shimmer {
  0% { background-position: 160% 0; }
  100% { background-position: -60% 0; }
}

/* --- Error pages --- */
.error-page {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.error-page .code {
  font-family: var(--font-mono);
  color: var(--npw-copper);
  font-size: 1rem;
  letter-spacing: 0.1em;
}
