/* Shared Layout - HSUK product family (Everything Cloud, CodeFetch, Code2Api, ...)
   Site chrome only: header, nav, footer, content-box card system.
   Structure only — every color is a var(--color-*) token, defined per-site
   in that site's own local styles.css. See websites/CLAUDE.md.
   Opt-in content patterns (step animations, expand/collapse tabs, etc.)
   live in components.css / components.js instead — not every page uses
   them, so they don't belong in this always-loaded file. */

/* Global Resets */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  height: 100%;
}

body {
  background-color: var(--color-bg);
  background-image:
    radial-gradient(ellipse 1200px 800px at 15% 0%, var(--color-surface-2), transparent 60%),
    radial-gradient(ellipse 1000px 900px at 100% 20%, var(--color-glow-2), transparent 55%),
    linear-gradient(180deg, var(--color-bg-gradient-start) 0%, var(--color-bg) 45%, var(--color-bg-gradient-end) 100%);
  background-repeat: no-repeat, no-repeat, no-repeat;
  background-attachment: fixed;
  min-height: 100vh;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: var(--viewport-margin);
  position: relative;
}

/* Soft film-grain texture across the whole page background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%22200%22%20height%3D%22200%22%3E%3Cfilter%20id%3D%22n%22%3E%3CfeTurbulence%20type%3D%22fractalNoise%22%20baseFrequency%3D%220.85%22%20numOctaves%3D%222%22%20stitchTiles%3D%22stitch%22/%3E%3CfeColorMatrix%20type%3D%22matrix%22%20values%3D%220%200%200%200%201%20%200%200%200%200%201%20%200%200%200%200%201%20%200%200%200%200.9%200%22/%3E%3C/filter%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20filter%3D%22url%28%23n%29%22/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
}

body > * {
  position: relative;
  z-index: 1;
}

/* Header & Navigation */
header {
  padding: 0 0 40px 0;
  flex-shrink: 0;
}

.header-tagline {
  margin-top: 24px;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding: 14px var(--viewport-margin);
  text-align: center;
  width: 100vw;
  background: var(--color-surface-1);
  border-top: 1px solid var(--color-surface-3);
  border-bottom: 1px solid var(--color-surface-3);
  font-size: 16px;
  font-weight: var(--font-weight-bold);
  line-height: 1.4;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-fade);
}

/* Top Global Navigation */
.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: nowrap;
  margin-bottom: 60px;
}

.top-nav-links {
  display: flex;
  gap: 40px;
  align-items: center;
  order: 0;
}

/* Logo: icon mark + live text (see websites/CLAUDE.md — Branding).
   Not a flattened wordmark image. */
.logo {
  order: 1;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo .logo-icon {
  display: block;
  height: 50px;
  max-height: none;
  width: auto;
  max-width: none;
  object-fit: contain;
}

.logo-text {
  font-family: var(--font-primary);
  font-weight: 700;
  font-size: 28px;
  letter-spacing: -0.01em;
  color: var(--color-white);
}

/* Legacy: sites that haven't migrated to the icon+text logo yet may still
   have a plain <img> inside .logo. Kept only for backward compatibility —
   new sites should use .logo-icon/.logo-text above. */
.logo img {
  display: block;
  height: auto;
  max-height: 50px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
}

.logo img.invert-to-white {
  filter: brightness(0) invert(1);
}

.logo img.logo-light {
  /* No filter - logo is already light colored */
}

/* Hide burger menu on desktop */
.burger-menu {
  display: none;
}

/* Hide burger menu sub-item on desktop */
.burger-menu-sub-items {
  display: none;
}

/* Hide the mobile-only "More" footer-links heading on desktop */
.burger-menu-footer-heading {
  display: none;
}

/* Active State Indicator - Asymmetrical half-circle */
.top-nav a.active {
  position: relative;
}

.top-nav a.active::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 100%;
  height: 8px;
  border-bottom: 8px solid var(--color-accent);
  border-radius: 0 0 0px 8px;
}

/* Page Header */
#page-header {
  overflow-x: auto;
  overflow-y: hidden;
  margin-bottom: 80px;
  margin-left: auto;
  margin-right: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  max-width: var(--max-width);
  width: 100%;
  line-height: 72px;
  font-size: 32px;
}

/* Mobile Page Header (for mobile-only pages) */
#mobile-page-header {
  display: none;
}

/* Sub Navigation Wrapper (dropdown sections under the top nav, e.g.
   Services / Software on Everything Cloud, Utilities on Code2Api) */
.sub-nav-wrapper {
  overflow-x: auto;
  overflow-y: hidden;
  margin-bottom: 80px;
  margin-left: auto;
  margin-right: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  max-width: var(--max-width);
  width: 100%;
}

.sub-nav-wrapper::-webkit-scrollbar {
  display: none;
}

.sub-nav {
  display: inline-flex;
  gap: 60px;
  align-items: center;
  position: relative;
}

/* Prevent flex items from shrinking */
.sub-nav h1,
.sub-nav a,
.sub-nav .scroll-arrow {
  flex-shrink: 0;
}

/* Dynamic fade based on scroll position */
.sub-nav.has-overflow.scrolled-start {
  mask-image: linear-gradient(to right, black 0%, black calc(100% - 120px), transparent 100%);
  -webkit-mask-image: linear-gradient(to right, black 0%, black calc(100% - 120px), transparent 100%);
}

.sub-nav.has-overflow.scrolled-middle {
  mask-image: linear-gradient(to right, transparent 0%, black 80px, black calc(100% - 80px), transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 80px, black calc(100% - 80px), transparent 100%);
}

.sub-nav.has-overflow.scrolled-end {
  mask-image: linear-gradient(to right, transparent 0%, black 120px, black 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 120px, black 100%);
}

.sub-nav a {
  white-space: nowrap;
  position: relative;
  line-height: 72px;
  font-size: 32px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

/* One generic shape (rounded square) for every sub-nav item — the
   fill state carries the meaning, not the shape, so this never needs
   changing per item. Filled = active, outline = inactive. */
.sub-nav-icon {
  flex-shrink: 0;
  width: 0.4em;
  height: 0.4em;
  border: 0.06em solid currentColor;
  border-radius: 0.1em;
  background: transparent;
  transition: background-color 0.15s ease;
}

.sub-nav a.active {
  color: var(--color-accent);
}

.sub-nav a.active .sub-nav-icon {
  background: currentColor;
}

.sub-nav .scroll-arrow {
  font-size: 40px;
  cursor: pointer;
  position: sticky;
  z-index: 10;
  display: none;
}

.sub-nav .scroll-arrow-left {
  left: 0;
  background: linear-gradient(to left, transparent 0%, var(--color-bg) 30%, var(--color-bg) 100%);
  padding-right: 40px;
  margin-right: -40px;
}

.sub-nav .scroll-arrow-right {
  right: 0;
  background: linear-gradient(to right, transparent 0%, var(--color-bg) 30%, var(--color-bg) 100%);
  padding-left: 40px;
  margin-left: -40px;
}

/* Main Content */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: visible;
  min-width: 0;
  position: relative;
}

/* Content-box system: 3-column / 1-column (legal, wide) options, all
   sharing the same decorative card surface. */

.three-column-content {
  column-count: 3;
  column-gap: 24px;
  max-width: var(--max-width);
  margin: -40px auto 0;
  width: 100%;
  padding: 60px 60px 90px;
  position: relative;
  z-index: 1;
  height: 90%;
}

/* Legal pages (Terms/Privacy): long-form text reads better as a single
   scrolling column rather than the usual 3-column layout. The card's
   height must grow with the (much longer) content instead of being
   capped, otherwise later sections overflow past the visible card. */
.legal-content {
  column-count: 1;
  max-width: 900px;
  height: auto;
}

.legal-content h2 {
  font-size: 28px;
  line-height: 1.3;
  margin: 1.6em 0 0.6em;
}

.legal-content h2:first-child {
  margin-top: 0;
}

.legal-content h3 {
  font-size: 20px;
  font-weight: var(--font-weight-bold);
  line-height: 1.3;
  color: var(--color-accent);
  margin: 1.2em 0 0.4em;
}

.legal-content ul {
  margin: 0 0 1.5em;
  padding-left: 1.4em;
}

.legal-content li {
  font-size: 0.8em;
  line-height: 1.5;
  margin-bottom: 0.5em;
}

.legal-content code {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75em;
  background: var(--color-surface-4);
  border: 1px solid var(--color-surface-6);
  border-radius: 4px;
  padding: 1px 6px;
  color: var(--color-accent);
}

/* Wide content: single column, full grid width — for tables and tool
   pages that don't suit the 3-column prose layout. Same card surface. */
.wide-content {
  column-count: 1;
  max-width: var(--max-width);
  margin: -40px auto 0;
  width: 100%;
  padding: 60px 60px 90px;
  position: relative;
  z-index: 1;
}

.wide-content a { text-decoration: none; color: var(--color-accent); }
.wide-content p { margin-bottom: 1.5em; break-inside: avoid-column; }

/* Decorative card surface lives on a separate, non-fragmented layer so the
   rounded corners/shadow don't pick up seams from the multi-column content. */
.three-column-content::before,
.wide-content::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, var(--color-surface-5), var(--color-surface-1));
  border-radius: 24px;
}

/* Abstract mountain-range accent along the bottom of the content card */
.three-column-content::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 140px;
  overflow: hidden;
  border-radius: 0 0 24px 24px;
  background-repeat: repeat-x;
  background-position: bottom;
  background-size: 1200px 100%;
}

@keyframes footer-mountains-drift {
  from { background-position-x: 0; }
  to { background-position-x: -1200px; }
}

@media (prefers-reduced-motion: reduce) {
  .three-column-content::after {
    animation: none;
  }
}

.three-column-content a {
  text-decoration: none;
  color: var(--color-accent);
}

.stat-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 1.5em;
  break-inside: avoid-column;
}

.info-stat,
.action-stat {
  flex: 1 1 160px;
  margin: 0;
  padding: 20px;
  background: var(--color-surface-4);
  border: 1px solid var(--color-surface-6);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.action-stat {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.action-stat:hover,
.action-stat:focus-visible {
  background: var(--color-surface-3);
  border-color: var(--color-surface-8);
}

.action-stat:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Icon set automatically from CSS so markup stays identical across
   sites — info-stat gets an asterisk, action-stat a double chevron.
   mask-image (not background-image) so --color-accent can recolor it. */
.info-stat::before,
.action-stat::before {
  content: "";
  display: block;
  width: 28px;
  height: 28px;
  margin-bottom: 4px;
  background-color: var(--color-accent);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-position: center;
  mask-position: center;
}

.info-stat::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M12 4.2A1.1 1.1 0 0 1 13.1 3.1h0A1.1 1.1 0 0 1 14.2 4.2v5l4.3-2.7a1.1 1.1 0 0 1 1.5.35l0 0a1.1 1.1 0 0 1-.35 1.5L15.7 11l4 2.35a1.1 1.1 0 0 1 .4 1.5l0 0a1.1 1.1 0 0 1-1.5.4L14.2 12.7v5A1.1 1.1 0 0 1 13.1 18.9h0a1.1 1.1 0 0 1-1.1-1.2v-5l-4.3 2.55a1.1 1.1 0 0 1-1.5-.4l0 0a1.1 1.1 0 0 1 .4-1.5L10.7 11l-4-2.25a1.1 1.1 0 0 1-.4-1.5l0 0a1.1 1.1 0 0 1 1.5-.35L12 9.2Z' transform='translate(0 1)'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M12 4.2A1.1 1.1 0 0 1 13.1 3.1h0A1.1 1.1 0 0 1 14.2 4.2v5l4.3-2.7a1.1 1.1 0 0 1 1.5.35l0 0a1.1 1.1 0 0 1-.35 1.5L15.7 11l4 2.35a1.1 1.1 0 0 1 .4 1.5l0 0a1.1 1.1 0 0 1-1.5.4L14.2 12.7v5A1.1 1.1 0 0 1 13.1 18.9h0a1.1 1.1 0 0 1-1.1-1.2v-5l-4.3 2.55a1.1 1.1 0 0 1-1.5-.4l0 0a1.1 1.1 0 0 1 .4-1.5L10.7 11l-4-2.25a1.1 1.1 0 0 1-.4-1.5l0 0a1.1 1.1 0 0 1 1.5-.35L12 9.2Z' transform='translate(0 1)'/%3E%3C/svg%3E");
}

.action-stat::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 6l6 6-6 6'/%3E%3Cpath d='M12 6l6 6-6 6'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 6l6 6-6 6'/%3E%3Cpath d='M12 6l6 6-6 6'/%3E%3C/svg%3E");
}

.stat-label {
  font-size: 0.5em;
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-fade);
}

.stat-desc {
  font-size: 0.72em;
  font-weight: var(--font-weight-bold);
}

.stat-value {
  font-size: 0.6em;
  color: var(--color-accent);
  font-weight: var(--font-weight-bold);
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 1.5em;
  column-span: all;
}

.team-card {
  padding: 24px;
  background: var(--color-surface-4);
  border: 1px solid var(--color-surface-6);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.team-photo {
  width: 72px;
  height: 72px;
  margin-bottom: 12px;
  border-radius: 50%;
  object-fit: cover;
}

.team-name {
  font-size: 0.72em;
  font-weight: var(--font-weight-bold);
}

.team-role {
  font-size: 0.5em;
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 8px;
}

.team-bio {
  font-size: 0.6em;
  color: var(--color-text-fade);
  margin-bottom: 0;
}

.three-column-content p {
  margin-bottom: 1.5em;
  break-inside: avoid-column;
}

/* Text Fade Effect */
.text-fade {
  position: relative;
  mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
}

/* Footer Navigation */
footer {
  padding: 40px 0 0 0;
  flex-shrink: 0;
  margin-top: auto;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  align-items: center;
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
}

.footer-nav a {
  font-size: 18px;
}

.footer-nav a.footer-legal-link {
  font-size: 14px;
  font-weight: var(--font-weight-light);
  color: var(--color-text-fade);
}

.footer-nav a.active:not(.footer-legal-link)::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 100%;
  height: 8px;
  border-bottom: 8px solid var(--color-accent);
  border-radius: 0 0 0px 8px;
}

.footer-copyright {
  margin-left: auto;
  max-width: 60%;
  font-size: 14px;
  line-height: 1.4;
  text-align: right;
  color: var(--color-text-fade);
  white-space: normal;
}

/* Articles Page Specific */

.hero {
  margin-bottom: 60px;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

.hero h1 {
  margin-bottom: 30px;
}

.hero-text {
  position: relative;
  max-height: 200px;
  overflow: hidden;
  mask-image: linear-gradient(to bottom, black 70%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 70%, transparent 100%);
}

/* Article Catalogue Grid */
.catalogue-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  max-width: calc((var(--column-width) * 8) + (var(--gutter-width) * 7));
  margin: 0 auto;
  width: 100%;
}

.catalogue-section h2 {
  font-size: 40px;
  line-height: 48px;
  font-weight: 700;
  margin-bottom: 20px;
}

.catalogue-section ul {
  list-style: none;
  padding: 0;
}

.catalogue-section li {
  margin-bottom: 10px;
}

.catalogue-section a {
  color: var(--color-white);
  text-decoration: none;
}

.catalogue-section a:hover {
  text-decoration: underline;
}

.see-more {
  font-weight: 700;
  margin-top: 10px;
}

/* Article Detail Page Specific */

.article-layout {
  display: grid;
  grid-template-columns: repeat(12, var(--column-width));
  gap: var(--gutter-width);
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
}

.article-number-col {
  grid-column: 1 / 2;
}

.article-content-col {
  grid-column: 3 / 10;
}

.article-content {
  position: relative;
}

.article-content h1 {
  margin-bottom: 30px;
}

.article-content .section-label {
  display: block;
  margin-bottom: 20px;
}

.article-body {
  position: relative;
  max-height: 60vh;
  overflow-y: auto;
  mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
  padding-bottom: 100px;
}

/* Article Graphics Placeholder */
.article-graphics {
  display: flex;
  gap: 40px;
  align-items: center;
  margin: 40px 0;
}

.graphic-item {
  width: 100px;
  height: 100px;
  background-color: var(--color-surface-3);
  border-radius: 8px;
}

/* Responsive Styles */

@media screen and (max-width: 1024px) {
  .three-column-content {
    column-count: 2;
    height: auto;
    padding: 40px;
  }

  .wide-content {
    padding: 40px;
  }

  .three-column-content::before,
  .wide-content::before {
    border-radius: 20px;
  }

  .three-column-content::after {
    border-radius: 0 0 20px 20px;
  }

  .catalogue-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .team-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .article-number-col {
    grid-column: 1;
  }

  .article-content-col {
    grid-column: 2 / 9;
  }

  .logo img {
    max-height: 45px;
    max-width: 180px;
  }

  .logo .logo-icon { height: 45px; }
  .logo-text { font-size: 24px; }

  .sub-nav {
    gap: 40px;
  }

  .sub-nav h1 {
    font-size: 35px;
    line-height: 42px;
  }
}

@media screen and (max-width: 768px) {
  .top-nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 30px;
  }

  .top-nav-links {
    gap: 30px;
  }

  .logo img {
    max-height: 40px;
    max-width: 150px;
  }

  .logo .logo-icon { height: 40px; }
  .logo-text { font-size: 22px; }

  .sub-nav {
    gap: 30px;
  }

  .sub-nav h1 {
    font-size: 30px;
    line-height: 36px;
  }

  .sub-nav .scroll-arrow {
    font-size: 32px;
  }

  .sub-nav .scroll-arrow-left {
    padding-right: 30px;
    margin-right: -30px;
  }

  .sub-nav .scroll-arrow-right {
    padding-left: 30px;
    margin-left: -30px;
  }

  .three-column-content,
  .wide-content {
    column-count: 1;
    height: auto;
    padding: 30px;
  }

  /* .three-column-content's desktop height (90%, see base rule) is a
     multi-column-layout trick: constraining the box height lets columns
     fill side-by-side instead of one tall column. At column-count: 1
     that same height constraint instead makes the browser overflow
     content into an *implicit* extra column off to the right — CSS
     columns are a horizontal-overflow mechanism, so height: 90% here
     doesn't just clip, it produces a real second column WebKit lays
     out past the visible viewport. height: auto lets the box grow to
     fit its content instead. (Confirmed via computed-style inspection:
     child elements report the correct 1-column width individually, but
     the last one is still positioned at left: 380 — a second column —
     while the container itself is only 370px wide.)

     WebKit/Safari can also render a phantom extra column purely from
     break-inside: avoid-column on a child of a column-count: 1
     container, independent of the height issue above — reset it here
     too so single-column mobile layout can't be affected by
     column-break hints meant only for the multi-column desktop/tablet
     layout. */
  .three-column-content p,
  .wide-content p,
  .stat-cards {
    break-inside: auto;
  }

  .three-column-content::before,
  .wide-content::before {
    border-radius: 16px;
  }

  .three-column-content::after {
    border-radius: 0 0 16px 16px;
  }

  .catalogue-grid {
    grid-template-columns: 1fr;
  }

  .team-grid {
    grid-template-columns: 1fr;
  }

  .article-layout {
    grid-template-columns: 1fr;
  }

  .article-number-col,
  .article-content-col {
    grid-column: 1;
  }
}

@media screen and (max-width: 480px) {
  .top-nav-links {
    gap: 20px;
    font-size: 20px;
    line-height: 24px;
  }

  .sub-nav {
    gap: 24px;
  }

  .sub-nav h1 {
    font-size: 24px;
    line-height: 28px;
  }

  .sub-nav .scroll-arrow {
    font-size: 28px;
  }

  .sub-nav .scroll-arrow-left {
    padding-right: 20px;
    margin-right: -20px;
  }

  .sub-nav .scroll-arrow-right {
    padding-left: 20px;
    margin-left: -20px;
  }

  .sub-nav-wrapper {
    margin-bottom: 60px;
  }

  /* Active state adjustments for mobile */
  .sub-nav a.active::after {
    bottom: -12px;
    height: 10px;
    border-width: 2px;
  }
}

/* Sign-up / Beta modal (native <dialog>) */
.form-modal {
  position: fixed;
  margin: auto;
  padding: 0;
  border: none;
  border-radius: 16px;
  max-width: 440px;
  width: calc(100% - 40px);
  background: var(--color-bg);
  color: var(--color-white);
  box-shadow: 0 30px 60px -20px var(--color-shadow-strong);
}

.form-modal::backdrop {
  background: var(--color-backdrop);
}

.form-modal-form {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 40px;
}

.form-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: var(--color-surface-3);
  color: var(--color-white);
  font-size: 20px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

.form-modal-close:hover,
.form-modal-close:focus-visible {
  background: var(--color-surface-7);
}

.form-modal-title {
  font-size: 28px;
  line-height: 1.2;
  padding-right: 30px;
  margin-bottom: 8px;
}

.form-modal-text {
  font-size: 18px;
  line-height: 1.4;
  color: var(--color-text-fade);
  margin-bottom: 24px;
}

.form-modal-label {
  font-size: 14px;
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-fade);
  margin-bottom: 6px;
}

.form-modal-input {
  font-family: inherit;
  font-size: 18px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--color-surface-9);
  background: var(--color-surface-4);
  color: var(--color-white);
}

.form-modal-input:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.form-modal-status {
  font-size: 15px;
  min-height: 0;
}

.form-modal-status:not(:empty) {
  min-height: 1.4em;
  margin-top: 8px;
}

.form-modal-status.is-error {
  color: var(--color-error);
}

.form-modal-status.is-success {
  color: var(--color-success);
}

.form-modal-submit {
  font-family: inherit;
  font-weight: var(--font-weight-bold);
  font-size: 18px;
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  background: var(--color-accent);
  color: var(--color-accent-ink);
  cursor: pointer;
  margin-top: 16px;
}

.form-modal-submit:hover:not(:disabled),
.form-modal-submit:focus-visible {
  background: var(--color-accent-hover);
}

.form-modal-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

@media screen and (max-width: 480px) {
  .form-modal-form {
    padding: 30px 24px;
  }

  .form-modal-title {
    font-size: 24px;
  }
}

/* Tables, cards, forms — used by tool/utility content within the
   content-box system (e.g. compare tables, PEM tools). */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.72em;
  margin-bottom: 8px;
}

th {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.55em;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-fade);
  text-align: left;
  padding: 10px 16px;
  border-bottom: 1px solid var(--color-surface-6);
}

td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--color-surface-3);
  vertical-align: top;
  line-height: 1.6;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--color-surface-1); }

.card {
  display: block;
  text-decoration: none;
  background: var(--color-surface-4);
  border: 1px solid var(--color-surface-6);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.card:hover {
  border-color: var(--color-accent);
  box-shadow: 0 0 24px var(--color-accent-wash);
}

.card h2 {
  font-size: 0.85em;
  font-weight: 700;
  color: var(--color-accent);
  margin: 0 0 4px;
}

.card p { font-size: 0.72em; color: var(--color-text-fade); margin: 0; }

.callout {
  background: var(--color-surface-4);
  border: 1px solid var(--color-surface-6);
  border-left: 3px solid var(--color-accent);
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 20px;
  font-size: 0.8em;
  line-height: 1.7;
  color: var(--color-text-fade);
}

.callout strong { color: var(--color-accent); }

label {
  display: block;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.5em;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-fade);
  margin-bottom: 8px;
}

input[type="text"],
input[type="email"],
textarea {
  width: 100%;
  padding: 10px 14px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.6em;
  background: var(--color-surface-4);
  color: var(--color-white);
  border: 1px solid var(--color-surface-7);
  border-radius: 8px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-wash);
}

textarea { padding: 12px 14px; resize: vertical; }

button {
  margin-top: 14px;
  padding: 10px 24px;
  background: var(--color-accent);
  color: var(--color-accent-ink);
  border: none;
  border-radius: 8px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.6em;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: opacity 0.2s;
}

button:hover { opacity: 0.85; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

code {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75em;
  background: var(--color-surface-4);
  border: 1px solid var(--color-surface-6);
  border-radius: 4px;
  padding: 1px 6px;
  color: var(--color-accent);
}

pre {
  background: var(--color-surface-4);
  border: 1px solid var(--color-surface-6);
  border-radius: 10px;
  padding: 20px 24px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.6em;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  min-height: 4rem;
  position: relative;
}

pre.highlight {
  border-color: var(--color-accent);
  box-shadow: 0 0 20px var(--color-accent-wash);
}

.use-btn {
  margin-top: 0;
  padding: 4px 10px;
  background: transparent;
  color: var(--color-accent);
  border: 1px solid var(--color-surface-7);
  border-radius: 6px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.5em;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s, color 0.15s;
}

.use-btn:hover { border-color: var(--color-accent); }
