/* ==========================================================================
   Chematrix Solutions — Design System
   Concept: engineering blueprint / simulation readout.
   Physics pillar   -> blueberry streamlines (cool, continuous, vector-like)
   Data pillar      -> amber nodes (discrete, punctual, signal-like)
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&family=Playfair+Display:wght@600;700;800&display=swap");

:root {
  --blueberry: #164065;
  --blueberry-deep: #06233d;
  --lightgray: #efebeb;
  --white: #ffffff;
  --ink: #0c1b2a;
  --ink-soft: #4a5a68;
  --line: rgba(10, 55, 95, 0.14);
  --line-strong: rgba(10, 55, 95, 0.28);
  --flow: #4fa9dd;
  --amber: #e4a13b;
  --amber-deep: #b97a1f;
  --Black: #000000;
  --font-display: Georgia, "Times New Roman", serif;
  --font-body: "Inter", sans-serif;
  --font-mono: "JetBrains Mono", monospace;

  --maxw: 1240px;
  --radius: 2px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}
a {
  color: inherit;
  text-decoration: none;
}
ul {
  list-style: none;
}
button {
  font-family: inherit;
  cursor: pointer;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 32px;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  color: var(--blueberry-deep);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(2.1rem, 4vw, 3.4rem);
  font-weight: 700;
}

p {
  color: var(--ink-soft);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 14px 26px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.btn-outline {
  border-color: var(--line-strong);
  color: var(--blueberry);
  background: transparent;
}

.btn-outline:hover {
  background: var(--blueberry);
  color: var(--white);
  border-color: var(--blueberry);
}

/* NAV */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--blueberry);
}

.brand-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  display: block;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 34px;
}

.nav-links a {
  font-family: var(--font-body);
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  color: var(--Black);
  position: relative;
  padding: 6px 0;
}

.nav-links a:hover,
.nav-links a.is-active {
  color: var(--blueberry);
}

.nav-cta {
  display: flex;
  align-items: center;
  gap: 18px;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
}

@media (max-width: 900px) {
  .nav-links {
    position: fixed;
    inset: 76px 0 0 0;
    background: var(--white);
    flex-direction: column;
    align-items: flex-start;
    padding: 32px;
    gap: 22px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    border-top: 1px solid var(--line);
  }

  .nav-links.open {
    transform: translateX(0);
  }
  .nav-toggle {
    display: block;
  }
  .nav-cta .btn-outline {
    display: none;
  }
}

/* ******************************************************************************** */
/* ************************* HERO Style ******************************************* */
/* ******************************************************************************** */

.hero {
  position: relative;
  background: var(--blueberry-deep);
  color: #fff;
  overflow: hidden;
  padding: 80px 0 64px;
  min-height: 360px;
}

.hero .mesh-grid {
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.12) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.12) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse at 50% 0%, black 0%, transparent 70%);
  pointer-events: none;
  opacity: 0.6;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  position: relative;
  z-index: 2;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  font-family: var(--font-mono);
  color: #8fcbef;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero h1 {
  color: #fff;
  margin: 0 0 16px 0;
  font-family: Georgia, "Times New Roman", serif;
  position: relative;
  display: inline-block;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.2));
  line-height: 1.2;
  font-size: clamp(2rem, 4.4vw, 3.1rem);
}

.hero-lede {
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.1rem;
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.7;
}

.hero-field {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0.55;
  pointer-events: none;
}

.homepage-background {
  position: absolute;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.homepage-background img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.45;
}

@media (max-width: 900px) {
  .hero {
    padding: 56px 0 40px;
  }
  .hero h1 {
    font-size: clamp(1.7rem, 5vw, 2.2rem);
  }
  .hero-lede {
    font-size: 0.95rem;
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 40px 0 28px;
  }
  .wrap {
    padding: 0 20px;
  }
  .hero h1 {
    font-size: 1.55rem;
  }
  .hero-lede {
    font-size: 0.9rem;
  }
}

/* Stream path animation in SVG */
.stream-path {
  stroke-dasharray: 10 12;
  animation: streamMove 2.2s linear infinite;
}
@keyframes streamMove {
  to {
    stroke-dashoffset: -22;
  }
}

.node-pulse {
  animation: nodePulse 2.6s ease-in-out infinite;
}
@keyframes nodePulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

@media (prefers-reduced-motion: reduce) {
  .stream-path,
  .node-pulse {
    animation: none;
  }
}

/* Utilities */
.center {
  text-align: center;
}
.center .eyebrow {
  justify-content: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  color: var(--flow);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.eyebrow:not(:empty)::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--flow);
}

/* Footer */
footer {
  background: #0b1220;
  color: #e6ebf2;
  padding: 70px 0 40px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand p {
  color: #a7b3c6;
  font-size: 0.95rem;
  margin: 10px 0 0 0;
  max-width: 360px;
  line-height: 1.6;
}

.footer-brand .brand {
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--flow);
  text-align: center;
}

.footer-socials {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
}

.footer-socials a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 2px;
  color: #ffffff;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  transition:
    color 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease;
}

.footer-socials a:hover,
.footer-socials a:focus-visible {
  color: var(--blueberry-deep);
  border-color: var(--flow);
  background: var(--flow);
  outline: none;
}

footer h4 {
  margin: 0 0 10px 0;
  font-size: 0.95rem;
  color: #fff;
  font-family: var(--font-body);
  font-weight: 600;
}

footer ul li {
  margin: 8px 0;
}

footer ul li a {
  color: #cfd8e6;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

footer ul li a:hover {
  color: #fff;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 22px;
  font-size: 0.85rem;
  color: #9fb0c7;
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 560px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
}

/* ==========================================================================
   BLOG LISTING SECTION
   ========================================================================== */

.blog-listing {
  position: relative;
  overflow: hidden;
  padding: 95px 0;
  background:
    radial-gradient(
      circle at 8% 15%,
      rgba(79, 169, 221, 0.09),
      transparent 28%
    ),
    radial-gradient(
      circle at 92% 85%,
      rgba(228, 161, 59, 0.08),
      transparent 30%
    ),
    var(--white);
}

.blog-listing::before {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(22, 64, 101, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(22, 64, 101, 0.035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(ellipse at center, black 0%, transparent 75%);
  content: "";
  pointer-events: none;
}

.blog-listing .wrap {
  position: relative;
  z-index: 1;
}

.blog-listing-header {
  max-width: 780px;
  margin: 0 auto 55px;
  text-align: center;
}

.blog-listing-header h2 {
  margin: 0 0 16px;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.blog-listing-header p {
  max-width: 640px;
  margin: 0 auto;
  font-size: 1.02rem;
  line-height: 1.75;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 30px;
  max-width: 1180px;
  margin: 0 auto;
}

.blog-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  text-align: left;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 26px rgba(10, 55, 95, 0.055);
  cursor: pointer;
  transition:
    transform 0.28s ease,
    box-shadow 0.28s ease,
    border-color 0.28s ease;
}

.blog-card:hover,
.blog-card:focus-visible {
  transform: translateY(-7px);
  border-color: var(--line-strong);
  box-shadow: 0 20px 40px rgba(10, 55, 95, 0.12);
  outline: none;
}

.blog-card:focus-visible {
  outline: 2px solid var(--flow);
  outline-offset: 3px;
}

.blog-card-media {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 230px;
  overflow: hidden;
  background: var(--lightgray);
  border-bottom: 1px solid var(--line);
}

.blog-card-media svg {
  display: none;
}

.blog-card-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.blog-card-media svg {
  width: 100%;
  height: 100%;
}

.blog-card-category {
  position: absolute;
  z-index: 2;
  top: 15px;
  left: 15px;
  padding: 7px 11px;
  border-radius: 20px;
  color: var(--blueberry-deep);
  background: rgba(255, 255, 255, 0.92);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.blog-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 26px 26px 28px;
}

.blog-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.blog-card-meta span:not(:last-child)::after {
  content: "\2022";
  margin-left: 10px;
  color: var(--line-strong);
}

.blog-card-body h3 {
  margin: 0 0 12px;
  font-size: 1.35rem;
  line-height: 1.3;
}

.blog-card-body p {
  flex: 1;
  margin: 0 0 22px;
  font-size: 0.95rem;
  line-height: 1.7;
}

.blog-card-read {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--flow);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.blog-card-read span {
  display: inline-block;
  font-size: 16px;
  transition: transform 0.2s ease;
}

.blog-card:hover .blog-card-read span {
  transform: translateX(4px);
}

@media (max-width: 860px) {
  .blog-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .blog-listing {
    padding: 60px 0;
  }
  .blog-card-media {
    height: 190px;
  }
}

/* ==========================================================================
   BLOG ARTICLE VIEW
   ========================================================================== */

.blog-article {
  padding: 60px 0 100px;
}

.blog-article[hidden],
.blog-listing[hidden] {
  display: none;
}

.blog-back {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 34px;
  background: none;
  border: none;
  color: var(--blueberry);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0;
}

.blog-back span {
  font-size: 15px;
  transition: transform 0.2s ease;
}

.blog-back:hover span {
  transform: translateX(-4px);
}

.blog-back:hover {
  color: var(--flow);
}

.blog-article-header {
  max-width: 800px;
  margin: 0 auto 40px;
  text-align: center;
}

.blog-article-category {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-family: var(--font-mono);
  color: var(--flow);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.blog-article-category::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--flow);
}

.blog-article-header h1 {
  margin: 0 0 20px;
  color: var(--blueberry-deep);
  font-size: clamp(1.9rem, 4vw, 2.9rem);
  line-height: 1.18;
}

.blog-article-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.blog-article-meta span:not(:last-child)::after {
  content: "\2022";
  margin-left: 12px;
  color: var(--line-strong);
}

.blog-article-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 1000px;
  height: 380px;
  margin: 0 auto 55px;
  overflow: hidden;
  background: var(--lightgray);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 16px 40px rgba(10, 55, 95, 0.09);
}

.blog-article-visual svg {
  display: none;
}

.blog-article-visual img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.blog-article-visual svg {
  width: 100%;
  height: 100%;
}

.blog-article-lede {
  max-width: 720px;
  margin: 0 auto 10px;
  font-size: 1.12rem;
  line-height: 1.85;
  color: var(--ink);
}

.blog-article-body {
  max-width: 720px;
  margin: 0 auto;
}

.blog-block {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  padding: 30px 0;
  border-bottom: 1px solid var(--line);
}

.blog-block:first-of-type {
  padding-top: 40px;
}

.blog-block:last-child {
  border-bottom: 0;
}

.blog-block-index {
  display: none;
  padding-top: 6px;
  color: var(--flow);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.blog-block-content h2 {
  margin: 0 0 14px;
  font-size: 1.4rem;
  line-height: 1.28;
}

.blog-block-content p {
  margin: 0 0 14px;
  font-size: 0.98rem;
  line-height: 1.8;
}

.blog-block-content p:last-child {
  margin-bottom: 0;
}

.blog-block-content strong {
  color: var(--ink);
  font-weight: 600;
}

.blog-flow-note {
  margin: 6px 0 14px;
  padding: 14px 18px;
  border-left: 2px solid var(--flow);
  background: rgba(79, 169, 221, 0.07);
  color: var(--blueberry-deep);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  line-height: 1.7;
}

.blog-article-closer {
  max-width: 720px;
  margin: 50px auto 0;
  padding: 40px 42px;
  background: var(--blueberry);
  border-radius: var(--radius);
  box-shadow: 0 16px 35px rgba(10, 55, 95, 0.12);
  text-align: center;
}

.blog-article-closer h3 {
  margin: 0 0 12px;
  color: #fff;
  font-size: 1.5rem;
}

.blog-article-closer p {
  margin: 0 0 22px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.95rem;
  line-height: 1.7;
}

.blog-article-closer .btn-outline {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.45);
}

.blog-article-closer .btn-outline:hover {
  color: var(--blueberry-deep);
  background: var(--flow);
  border-color: var(--flow);
}

@media (max-width: 700px) {
  .blog-article-visual {
    height: 240px;
  }
  .blog-block {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .blog-article-closer {
    padding: 32px 26px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .blog-card,
  .blog-card-read span,
  .blog-back span {
    transition: none;
  }
}

.blog-block-noindex {
  grid-template-columns: 1fr;
}

.blog-block-noindex .blog-block-index {
  display: none;
}

@media (max-width: 600px) {
  .wrap {
    padding-right: 16px;
    padding-left: 16px;
  }
  .nav .wrap {
    height: 64px;
  }

  .nav {
    background: #e5e5e5;
  }
  .brand {
    gap: 7px;
    font-size: 1.2rem;
  }
  .brand-logo {
    width: 32px;
    height: 32px;
  }
  .nav-links {
    position: fixed;
    top: 64px;
    right: -100%;
    bottom: auto;
    left: 0;
    right: -100%;
    background: #e5e5e5;
    padding: 24px 20px;
    transform: none;
    width: 100%;
    height: auto;
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    visibility: hidden;
    pointer-events: none;
    transition: right 0.3s ease;
  }
  .nav-links.open {
    right: 0;
    visibility: visible;
    pointer-events: auto;
  }
  .hero {
    min-height: 0;
    padding: 48px 0 36px;
  }
  .hero h1 {
    line-height: 1.25;
  }
  .hero-lede {
    max-width: none;
  }
  .blog-grid {
    grid-template-columns: 1fr;
  }
  .blog-article-header h1 {
    font-size: 2rem;
  }
  .blog-article-body,
  .blog-article-visual {
    max-width: 100%;
  }
}
