/* Renewable Viet Nam Unified Sleek Header & Cross-Page Shell - Rev.004 */
:root {
  --rvn-header-h: 64px;
}

@media (min-width: 1024px) {
  :root {
    --rvn-header-h: 72px;
  }
}

#rvn-header {
  --rvn-bg: rgba(255, 255, 255, 0.92);
  --rvn-border: rgba(226, 232, 240, 0.9);
  --rvn-ink: #0f172a;
  --rvn-muted: #475569;
  --rvn-hover-bg: rgba(241, 245, 249, 0.95);
  --rvn-active-bg: rgba(13, 148, 136, 0.10);
  --rvn-active-ink: #0f766e;
  --rvn-active-ring: rgba(13, 148, 136, 0.24);
  --rvn-btn-bg: rgba(255, 255, 255, 0.95);
  --rvn-btn-border: rgba(203, 213, 225, 0.9);
  position: sticky;
  top: 0;
  z-index: 60;
  width: 100%;
  min-height: var(--rvn-header-h);
  height: var(--rvn-header-h);
  box-sizing: border-box;
  background: var(--rvn-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--rvn-border);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: background-color 0.2s ease, border-color 0.2s ease;
  view-transition-name: rvn-site-header;
}

html.dark #rvn-header {
  --rvn-bg: rgba(15, 23, 42, 0.90);
  --rvn-border: rgba(51, 65, 85, 0.75);
  --rvn-ink: #f1f5f9;
  --rvn-muted: #94a3b8;
  --rvn-hover-bg: rgba(30, 41, 59, 0.9);
  --rvn-active-bg: rgba(45, 212, 191, 0.16);
  --rvn-active-ink: #5eead4;
  --rvn-active-ring: rgba(45, 212, 191, 0.30);
  --rvn-btn-bg: rgba(30, 41, 59, 0.92);
  --rvn-btn-border: rgba(71, 85, 105, 0.78);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

#rvn-header .rvn-inner {
  max-width: 1920px;
  width: 100%;
  height: 100%;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-sizing: border-box;
}

@media (min-width: 640px) {
  #rvn-header .rvn-inner {
    padding: 0 28px;
    gap: 20px;
  }
}

@media (min-width: 1024px) {
  #rvn-header .rvn-inner {
    padding: 0 32px;
    gap: 28px;
  }
}

@media (min-width: 1440px) {
  #rvn-header .rvn-inner {
    padding: 0 40px;
    gap: 36px;
  }
}

#rvn-header .rvn-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 6px 4px;
  border-radius: 10px;
  text-decoration: none;
  flex-shrink: 0;
  user-select: none;
  -webkit-user-select: none;
}

#rvn-header .rvn-brand:hover .rvn-logo {
  opacity: 1;
}

#rvn-header .rvn-logo {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: block;
  flex-shrink: 0;
  opacity: 0.96;
  transition: opacity 0.15s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

#rvn-header .rvn-brand:hover .rvn-logo {
  transform: scale(1.04);
}

#rvn-header .rvn-wordmark {
  font-family: var(--rvn-sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--rvn-ink);
  white-space: nowrap;
  line-height: 1;
}

@media (min-width: 1024px) {
  #rvn-header .rvn-logo {
    width: 36px;
    height: 36px;
  }
  #rvn-header .rvn-wordmark {
    font-size: 13.5px;
    letter-spacing: 0.17em;
  }
}

@media (max-width: 1023px) {
  #rvn-header .rvn-wordmark-ext {
    display: none;
  }
}

@media (max-width: 639px) {
  #rvn-header .rvn-wordmark {
    font-size: 12.5px;
    letter-spacing: 0.12em;
  }
}

@media (max-width: 767px) {
  #rvn-header .rvn-wordmark {
    display: none;
  }
  #rvn-header .rvn-brand {
    gap: 0;
  }
}

#rvn-header .rvn-nav {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 3px;
  flex: 1 1 auto;
  min-width: 0;
  padding: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, "Segoe UI", Arial, sans-serif;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.005em;
  line-height: 1.2;
}

#rvn-header .rvn-nav::-webkit-scrollbar {
  display: none;
}

@media (min-width: 640px) {
  #rvn-header .rvn-nav {
    gap: 4px;
    padding-left: 8px;
    font-size: 14.5px;
  }
}

@media (min-width: 1024px) {
  #rvn-header .rvn-nav {
    gap: 6px;
    padding-left: 12px;
    font-size: 15.5px;
  }
}

@media (min-width: 1440px) {
  #rvn-header .rvn-nav {
    gap: 8px;
  }
}

@media (max-width: 767px) {
  #rvn-header .rvn-nav {
    -webkit-mask-image: linear-gradient(to right, #000 0, #000 90%, transparent 100%);
    mask-image: linear-gradient(to right, #000 0, #000 90%, transparent 100%);
  }
}

#rvn-header .rvn-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 11px;
  border-radius: 999px;
  color: var(--rvn-muted);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  font-size: inherit;
  font-weight: 500;
  border: 1px solid transparent;
  user-select: none;
  -webkit-user-select: none;
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 640px) {
  #rvn-header .rvn-link {
    padding: 0 14px;
    min-height: 44px;
  }
}

@media (min-width: 1024px) {
  #rvn-header .rvn-link {
    padding: 0 18px;
  }
}

#rvn-header .rvn-link:hover {
  color: var(--rvn-ink);
  background: var(--rvn-hover-bg);
  text-decoration: none;
  transform: translateY(-1px);
}

#rvn-header .rvn-link.is-active {
  color: var(--rvn-active-ink);
  background: var(--rvn-active-bg);
  border-color: var(--rvn-active-ring);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px var(--rvn-active-ring);
}

/* About us entry: a distinct blue identity button pinned to the right of the
   section links rather than sitting inline with them. */
#rvn-header .rvn-link-cta {
  gap: 7px;
  margin-left: auto;
  padding: 0 15px;
  border-color: rgba(37, 99, 235, 0.45);
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.10), rgba(37, 99, 235, 0.04));
  color: #1d4ed8;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.12);
}

#rvn-header .rvn-link-cta:hover {
  color: #1e40af;
  border-color: rgba(37, 99, 235, 0.70);
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.18), rgba(37, 99, 235, 0.08));
}

#rvn-header .rvn-link-cta.is-active {
  color: #ffffff;
  border-color: #2563eb;
  background: #2563eb;
  box-shadow: 0 2px 8px -2px rgba(37, 99, 235, 0.55);
}

#rvn-header .rvn-link-cta-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  opacity: 0.9;
}

@media (min-width: 768px) and (max-width: 1023px) {
  #rvn-header .rvn-nav {
    gap: 3px;
    font-size: 13.5px;
  }
  #rvn-header .rvn-link {
    padding: 0 12px;
  }
  #rvn-header .rvn-link-cta-icon {
    display: none;
  }
  #rvn-header .rvn-link-cta {
    padding: 0 12px;
  }
}

@media (max-width: 767px) {
  /* Mobile: identity button leads the nav, ahead of Energy Grid */
  #rvn-header .rvn-link-cta {
    order: -1;
    margin-left: 0;
    margin-right: 6px;
    width: 40px;
    padding: 0;
    justify-content: center;
  }
  #rvn-header .rvn-link-cta-label {
    display: none;
  }
  #rvn-header .rvn-link-cta-icon {
    width: 17px;
    height: 17px;
  }
}

html.dark #rvn-header .rvn-link-cta {
  border-color: rgba(96, 165, 250, 0.45);
  background: linear-gradient(180deg, rgba(96, 165, 250, 0.16), rgba(96, 165, 250, 0.05));
  color: #93c5fd;
}

html.dark #rvn-header .rvn-link-cta:hover {
  color: #bfdbfe;
  border-color: rgba(96, 165, 250, 0.72);
}

html.dark #rvn-header .rvn-link-cta.is-active {
  color: #0b1220;
  border-color: #60a5fa;
  background: #60a5fa;
  box-shadow: 0 2px 10px -2px rgba(96, 165, 250, 0.5);
}

#rvn-header .rvn-link:focus-visible,
#rvn-header .rvn-brand:focus-visible,
#rvn-header .rvn-toggle:focus-visible {
  outline: 2px solid var(--rvn-active-ink);
  outline-offset: 2px;
}

#rvn-header .rvn-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--rvn-btn-bg);
  border: 1px solid var(--rvn-btn-border);
  color: var(--rvn-muted);
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 768px) {
  #rvn-header .rvn-toggle {
    width: 44px;
    height: 44px;
    border-radius: 14px;
  }
}

#rvn-header .rvn-toggle:hover {
  color: var(--rvn-ink);
  background: var(--rvn-hover-bg);
  transform: translateY(-1px);
}

#rvn-header .rvn-toggle:active {
  transform: scale(0.96);
}

#rvn-header .rvn-toggle svg {
  width: 19px;
  height: 19px;
}

@media (min-width: 768px) {
  #rvn-header .rvn-toggle svg {
    width: 21px;
    height: 21px;
  }
}

#rvn-header #sunIcon {
  display: none !important;
  color: #f59e0b;
}

#rvn-header #moonIcon {
  display: block !important;
}

html.dark #rvn-header #sunIcon {
  display: block !important;
}

html.dark #rvn-header #moonIcon {
  display: none !important;
}

/* Native Cross-Document Smooth View Transitions */
@view-transition {
  navigation: auto;
}

::view-transition-old(rvn-site-header),
::view-transition-new(rvn-site-header) {
  animation: none;
}

::view-transition-old(root) {
  animation: rvnFadeOut 110ms ease-out both;
}

::view-transition-new(root) {
  animation: rvnFadeIn 130ms ease-in both;
}

@keyframes rvnFadeOut {
  from { opacity: 1; }
  to { opacity: 0.92; }
}

@keyframes rvnFadeIn {
  from { opacity: 0.92; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  #rvn-header .rvn-link,
  #rvn-header .rvn-toggle,
  #rvn-header .rvn-logo {
    transition: none !important;
  }
  #rvn-header .rvn-link:hover,
  #rvn-header .rvn-toggle:hover,
  #rvn-header .rvn-brand:hover .rvn-logo {
    transform: none !important;
  }
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none !important;
  }
}

@media print {
  #rvn-header {
    display: none !important;
  }
}

/* ==========================================================================
   Apple-style typography layer (Rev.005)
   Sans-serif everywhere, 600-weight headings, tabular numerals,
   monospace reserved for small status tags.
   ========================================================================== */
/* Roboto is the primary typeface: open source (Apache 2.0), loaded from Google
   Fonts in each page head, so no font licence is required to serve the site. */
:root {
  --rvn-sans: "Roboto", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --rvn-mono: SFMono-Regular, "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --rvn-heading-ink: #0f172a;
  --rvn-heading-ink-dark: #f1f5f9;
  --rvn-body-ink: #64748b;
}

html,
body,
button,
input,
select,
textarea {
  font-family: var(--rvn-sans);
  font-variant-numeric: tabular-nums;
}

html body {
  font-family: var(--rvn-sans) !important;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* No editorial serif anywhere in the application */
.font-serif,
.font-sans,
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--rvn-sans) !important;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600 !important;
  letter-spacing: -0.02em;
  color: var(--rvn-heading-ink);
}

html.dark h1,
html.dark h2,
html.dark h3,
html.dark h4,
html.dark h5,
html.dark h6 {
  color: var(--rvn-heading-ink-dark);
}

p {
  font-weight: 400;
  letter-spacing: normal;
}

/* Descriptions / subtitles that carry no explicit colour */
main p:not([class*="text-"]),
.rvn-subtitle {
  color: var(--rvn-body-ink);
}

/* Align digits without the blocky look */
.tabular-nums,
table,
.font-mono {
  font-variant-numeric: tabular-nums;
}

/* Monospace is reserved for small status tags (01, 02, LIVE) */
.font-mono {
  font-family: var(--rvn-sans) !important;
}

[class*="text-[10px]"].font-mono:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6),
[class*="text-[11px]"].font-mono:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6),
.font-mono.text-xs:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6),
.rvn-status-tag {
  font-family: var(--rvn-mono) !important;
  font-weight: 500 !important;
  letter-spacing: 0.04em;
}

/* Body copy stays regular weight and muted, regardless of legacy font-light/bold
   utility classes left over from the serif era. */
main p {
  font-weight: 400 !important;
}

html:not(.dark) main p[class*="text-slate-600"] {
  color: var(--rvn-body-ink);
}

/* Workstation mode ribbons: keep pill labels on one line instead of
   compressing the track when a section gains extra modes. */
.energy-mode-btn,
.ev-mode-btn,
.hp-mode-btn {
  flex: 0 0 auto;
  white-space: nowrap;
}
