:root {
  --ink: #0c1416;
  --ink-soft: #1a2a2e;
  --paper: #f3efe6;
  --paper-muted: #e4ddd0;
  --teal: #0d9488;
  --teal-bright: #2dd4bf;
  --teal-deep: #0f3d3a;
  --amber: #c47a2b;
  --text: #1c2426;
  --text-muted: #5a6669;
  --on-dark: #f3efe6;
  --on-dark-muted: rgba(243, 239, 230, 0.72);
  --font-display: "Instrument Serif", Georgia, serif;
  --font-body: "DM Sans", "Segoe UI", sans-serif;
  --space: clamp(1.25rem, 3vw, 2.5rem);
  --max: 68rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 4.5rem;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background:
    radial-gradient(ellipse 80% 50% at 10% 0%, rgba(13, 148, 136, 0.08), transparent 55%),
    linear-gradient(180deg, #ebe6db 0%, var(--paper) 40%, #ebe4d6 100%);
  min-height: 100vh;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--teal);
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem var(--space);
  width: 100%;
  background: rgba(243, 239, 230, 0.92);
  border-bottom: 1px solid var(--paper-muted);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
}

.logo-mark {
  display: inline-block;
  width: 1.7rem;
  height: 1.7rem;
  flex-shrink: 0;
  border-radius: 0.35rem;
}

.logo:hover {
  color: var(--teal);
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
}

.nav a:hover {
  color: var(--teal);
}

.nav-cta {
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--teal);
  color: var(--teal-deep) !important;
  background: rgba(13, 148, 136, 0.06);
  font-weight: 600;
}

.nav-cta:hover {
  background: var(--teal);
  color: var(--paper) !important;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  align-items: end;
  overflow: hidden;
  color: var(--on-dark);
}

.hero-visual {
  position: absolute;
  inset: 0;
}

.hero-grid {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nodes path {
  stroke-dasharray: 8 10;
  animation: dash 28s linear infinite;
}

.pulse {
  transform-box: fill-box;
  transform-origin: center;
  animation: pulse 3.2s var(--ease) infinite;
}

.pulse-delay {
  animation-delay: 0.8s;
}

.pulse-delay-2 {
  animation-delay: 1.6s;
}

@keyframes dash {
  to {
    stroke-dashoffset: -400;
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.45;
    transform: scale(0.85);
  }
  50% {
    opacity: 1;
    transform: scale(1.35);
  }
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: clamp(3rem, 8vh, 5rem) var(--space) clamp(2.5rem, 6vh, 4rem);
  max-width: calc(var(--max) + 6rem);
  margin: 0 auto;
  width: 100%;
}

.eyebrow {
  margin: 0 0 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal-bright);
  animation: rise 0.9s var(--ease) both;
}

.brand {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(2.75rem, 8vw, 5.5rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
  color: var(--on-dark);
  animation: rise 0.9s var(--ease) 0.06s both;
}

.hero h1 {
  margin: 0 0 1rem;
  max-width: 18ch;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.75rem, 4.2vw, 2.75rem);
  line-height: 1.15;
  color: var(--on-dark);
  animation: rise 0.9s var(--ease) 0.12s both;
}

.lede {
  margin: 0 0 1.75rem;
  max-width: 38rem;
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  color: var(--on-dark-muted);
  animation: rise 0.9s var(--ease) 0.22s both;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  animation: rise 0.9s var(--ease) 0.32s both;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 1.25rem 2rem;
  margin: 2.5rem 0 0;
  padding-top: 1.75rem;
  border-top: 1px solid rgba(243, 239, 230, 0.18);
  animation: rise 0.9s var(--ease) 0.42s both;
}

.hero-stats div {
  display: grid;
  gap: 0.1rem;
}

.hero-stats dt {
  order: 2;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  color: var(--on-dark-muted);
}

.hero-stats dd {
  order: 1;
  margin: 0;
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1.1;
  color: var(--teal-bright);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(1.1rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.25rem;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.btn-primary {
  background: var(--teal-bright);
  color: var(--ink);
}

.btn-primary:hover {
  background: #5eead4;
  color: var(--ink);
}

.btn-ghost {
  border-color: rgba(243, 239, 230, 0.4);
  color: var(--on-dark);
}

.btn-ghost:hover {
  border-color: var(--teal-bright);
  color: var(--teal-bright);
}

.btn-ghost-dark {
  border-color: rgba(12, 20, 22, 0.25);
  color: var(--ink);
}

.btn-ghost-dark:hover {
  border-color: var(--teal);
  color: var(--teal);
}

/* ---------- Sections ---------- */

.section {
  padding: clamp(3.5rem, 9vw, 6rem) var(--space);
  max-width: calc(var(--max) + 6rem);
  margin: 0 auto;
}

.kicker {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
}

.section-intro {
  max-width: 38rem;
  margin-bottom: 2.5rem;
}

.section h2 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2rem, 4vw, 2.75rem);
  line-height: 1.15;
  color: var(--ink);
}

.section-intro p:not(.kicker),
.about-copy p,
.contact-grid p:not(.kicker) {
  margin: 0;
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* ---------- Reveal on scroll ---------- */

/* Reveal only activates when JS confirms IntersectionObserver support */
.js-reveal .reveal {
  opacity: 0;
  transform: translateY(1rem);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

.js-reveal .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Services ---------- */

.service-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 0;
  border-top: 1px solid var(--paper-muted);
}

.service-list li {
  padding: 1.5rem 1.25rem 1.5rem 0;
  border-bottom: 1px solid var(--paper-muted);
}

.service-list h3 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
}

.service-list p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.98rem;
}

/* ---------- Process ---------- */

.process-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1.5rem;
  counter-reset: step;
}

.process-steps li {
  padding: 1.5rem 1.25rem;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid var(--paper-muted);
}

.step-num {
  display: block;
  margin-bottom: 0.75rem;
  font-family: var(--font-display);
  font-size: 1.9rem;
  line-height: 1;
  color: var(--teal);
}

.process-steps h3 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
}

.process-steps p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.engagement {
  margin-top: 2.5rem;
  padding: 1.75rem 1.5rem;
  background: var(--teal-deep);
  color: var(--on-dark);
}

.engagement h3 {
  margin: 0 0 1.25rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.5rem;
}

.engagement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1.25rem 2rem;
}

.engagement-grid h4 {
  margin: 0 0 0.3rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--teal-bright);
}

.engagement-grid p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--on-dark-muted);
}

/* ---------- Specialties ---------- */

.specialty-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
  border-top: 1px solid var(--paper-muted);
}

.specialty-list li {
  display: grid;
  gap: 0.35rem 1.5rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--paper-muted);
}

@media (min-width: 640px) {
  .specialty-list li {
    grid-template-columns: minmax(12rem, 16rem) 1fr;
    align-items: baseline;
  }
}

.specialty-list h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
}

.specialty-list p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.98rem;
}

/* ---------- Products ---------- */

.product-flagship {
  display: grid;
  gap: 2rem;
  margin-bottom: 2.5rem;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  background: var(--teal-deep);
  color: var(--on-dark);
}

@media (min-width: 760px) {
  .product-flagship {
    grid-template-columns: 1.6fr 1fr;
    align-items: start;
  }
}

.flagship-label {
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal-bright);
}

.product-flagship h3 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.9rem, 3.5vw, 2.5rem);
  line-height: 1.1;
}

.product-flagship h3 a {
  color: var(--on-dark);
  text-decoration: none;
}

.product-flagship h3 a:hover {
  color: var(--teal-bright);
}

.flagship-desc {
  margin: 0 0 1.5rem;
  color: var(--on-dark-muted);
  font-size: 1rem;
}

.flagship-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
  align-content: start;
}

.flagship-points li {
  position: relative;
  padding-left: 1.4rem;
  font-size: 0.95rem;
  color: var(--on-dark-muted);
}

.flagship-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 0.55rem;
  height: 0.55rem;
  background: var(--teal-bright);
}

.product-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 0;
  border-top: 1px solid var(--paper-muted);
}

.product-list li {
  padding: 1.5rem 1.25rem 1.5rem 0;
  border-bottom: 1px solid var(--paper-muted);
}

.product-list h3 {
  margin: 0 0 0.45rem;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 400;
  color: var(--teal-deep);
}

.product-list h3 a {
  color: inherit;
  text-decoration: none;
}

.product-list h3 a:hover {
  color: var(--teal);
  text-decoration: underline;
}

.product-badge {
  display: inline-block;
  margin-left: 0.45rem;
  padding: 0.15rem 0.45rem;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
  color: var(--teal-deep);
  border: 1px solid rgba(15, 61, 58, 0.25);
  background: rgba(13, 148, 136, 0.1);
}

.badge-dev {
  color: var(--text-muted);
  border-color: rgba(90, 102, 105, 0.3);
  background: rgba(90, 102, 105, 0.08);
}

.product-list p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.98rem;
}

/* ---------- Open source ---------- */

.oss-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1rem;
}

.oss-list li {
  padding: 1.25rem;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid var(--paper-muted);
  transition: border-color 0.2s var(--ease);
}

.oss-list li:hover {
  border-color: var(--teal);
}

.oss-list h3 {
  margin: 0 0 0.35rem;
  font-size: 1.02rem;
  font-weight: 600;
}

.oss-list h3 a {
  color: var(--teal-deep);
  text-decoration: none;
}

.oss-list h3 a::after {
  content: " ↗";
  font-size: 0.85em;
  color: var(--text-muted);
}

.oss-list h3 a:hover {
  color: var(--teal);
}

.oss-list p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* ---------- News ---------- */

.news-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
  border-top: 1px solid var(--paper-muted);
}

.news-list li {
  display: grid;
  gap: 0.35rem 1.5rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--paper-muted);
}

@media (min-width: 640px) {
  .news-list li {
    grid-template-columns: minmax(9rem, 11rem) 1fr;
    align-items: baseline;
  }
}

.news-date {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--teal);
}

.news-list h3 {
  margin: 0 0 0.3rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
}

.news-list p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.news-archive {
  margin-top: 2rem;
  border: 1px solid var(--paper-muted);
  background: rgba(255, 255, 255, 0.45);
}

.news-archive summary {
  padding: 1.1rem 1.25rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--teal-deep);
  list-style-position: inside;
}

.news-archive summary:hover {
  color: var(--teal);
}

.archive-hint {
  font-weight: 400;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.news-archive .news-list-archive {
  padding: 0 1.25rem 1rem;
  border-top: 1px solid var(--paper-muted);
}

.news-list-archive li:last-child {
  border-bottom: none;
}

/* ---------- Blog ---------- */

.blog-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.blog-list article {
  padding: 1.5rem 1.25rem;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid var(--paper-muted);
}

.blog-list h3 {
  margin: 0.4rem 0 0.5rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.5rem;
  line-height: 1.2;
}

.blog-list h3 a {
  color: var(--teal-deep);
  text-decoration: none;
}

.blog-list h3 a:hover {
  color: var(--teal);
}

.blog-list p {
  margin: 0 0 0.75rem;
  color: var(--text-muted);
  font-size: 0.98rem;
}

.read-more {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--teal-deep);
  text-decoration: none;
}

.read-more:hover {
  color: var(--teal);
}

/* ---------- Blog post page ---------- */

.blog-post {
  max-width: 44rem;
}

.post-header {
  margin-bottom: 2rem;
}

.blog-post h1 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2rem, 4.5vw, 3rem);
  line-height: 1.12;
  color: var(--ink);
}

.post-byline {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.98rem;
}

.blog-post p {
  margin: 0 0 1.2rem;
  color: var(--text);
}

.blog-post h2 {
  margin: 2rem 0 0.75rem;
  font-size: clamp(1.4rem, 3vw, 1.8rem);
}

.blog-post ul {
  margin: 0 0 1.2rem;
  padding-left: 1.3rem;
  color: var(--text);
}

.blog-post li {
  margin-bottom: 0.6rem;
}

.blog-post a {
  color: var(--teal-deep);
}

.blog-post a:hover {
  color: var(--teal);
}

.post-footer {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--paper-muted);
}

/* ---------- About ---------- */

.about {
  display: grid;
  gap: 2.5rem;
  align-items: start;
}

@media (min-width: 720px) {
  .about {
    grid-template-columns: 1.4fr 1fr;
    gap: 3rem;
  }
}

.about-copy p + p {
  margin-top: 1rem;
}

.facts {
  margin: 0;
  display: grid;
  gap: 1.25rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--paper-muted);
  border-bottom: 1px solid var(--paper-muted);
}

.facts div {
  display: grid;
  gap: 0.2rem;
}

.facts dt {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.facts dd {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.75rem;
  color: var(--teal-deep);
}

.facts dd a {
  color: inherit;
  text-decoration: none;
}

.facts dd a:hover {
  color: var(--teal);
  text-decoration: underline;
}

/* ---------- Contact ---------- */

.contact {
  padding-bottom: clamp(4rem, 10vw, 7rem);
}

.contact-grid {
  display: grid;
  gap: 2.5rem;
  align-items: start;
}

@media (min-width: 760px) {
  .contact-grid {
    grid-template-columns: 1.5fr 1fr;
    gap: 3rem;
  }
}

.contact-grid h2 {
  max-width: 16ch;
}

.contact-grid > div > p:not(.kicker) {
  max-width: 34rem;
  margin: 0 0 1.5rem;
}

.contact .btn-primary {
  background: var(--teal);
  color: var(--paper);
}

.contact .btn-primary:hover {
  background: var(--teal-deep);
  color: var(--paper);
}

.contact-points {
  list-style: none;
  margin: 0;
  padding: 1.5rem 0 0;
  display: grid;
  gap: 0.85rem;
  border-top: 1px solid var(--paper-muted);
}

.contact-points li {
  position: relative;
  padding-left: 1.4rem;
  color: var(--text-muted);
  font-size: 0.98rem;
}

.contact-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 0.55rem;
  height: 0.55rem;
  background: var(--teal);
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--paper-muted);
  background: rgba(255, 255, 255, 0.35);
}

.footer-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  max-width: calc(var(--max) + 6rem);
  margin: 0 auto;
  padding: 2.5rem var(--space) 1.5rem;
}

.footer-brand {
  max-width: 22rem;
}

.footer-logo {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--ink);
}

.footer-brand p:not(.footer-logo) {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.footer-col {
  display: grid;
  gap: 0.5rem;
  align-content: start;
}

.footer-col h4 {
  margin: 0 0 0.25rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.footer-col a {
  font-size: 0.95rem;
  color: var(--text);
  text-decoration: none;
  width: fit-content;
}

.footer-col a:hover {
  color: var(--teal);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  max-width: calc(var(--max) + 6rem);
  margin: 0 auto;
  padding: 1rem var(--space) 1.75rem;
  border-top: 1px solid var(--paper-muted);
  color: var(--text-muted);
  font-size: 0.88rem;
}

.footer-bottom p {
  margin: 0;
}

/* ---------- Responsive nav ---------- */

@media (max-width: 860px) {
  .nav {
    gap: 0.9rem;
  }

  .nav a {
    font-size: 0.875rem;
  }
}

@media (max-width: 660px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
  }

  .nav {
    gap: 0.65rem 0.9rem;
    flex-wrap: wrap;
  }

  html {
    scroll-padding-top: 7rem;
  }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .nodes path,
  .pulse,
  .eyebrow,
  .brand,
  .hero h1,
  .lede,
  .cta-row,
  .hero-stats {
    animation: none;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
