:root {
  --bg: #ffffff;
  --bg-alt: #f7f9f9;
  --text: #16191d;
  --text-dim: #5b6470;
  --border: #e6eaee;
  --accent: #0d9488;
  --accent-dark: #0b7c72;
  /* Brand palette — brand sheet v1.0 */
  --ink: #16191d;
  --teal: #0d9488;
  --teal-bright: #2dd4bf;
  --slate: #5b6a6e;
  --mist: #eef3f2;
  --white: #ffffff;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

/* Offset in-page anchor jumps for the sticky header */
section[id] {
  scroll-margin-top: 72px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-dark);
}

/* Keyboard focus — visible accent ring on every interactive element */

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Skip link — hidden until focused */

.skip-link {
  position: absolute;
  left: 16px;
  top: -64px;
  z-index: 20;
  background: var(--accent);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 10px 18px;
  border-radius: 8px;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 16px;
  color: #ffffff;
}

h1, h2, h3 {
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}

.eyebrow {
  display: inline-block;
  color: var(--accent);
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.eyebrow::before {
  content: "// ";
  content: "// " / "";
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  z-index: 10;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 18px;
  padding-bottom: 18px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.logo .accent {
  color: var(--accent);
}

/* The dissolve — inline mark: the dot of .team, evaporating up a diagonal */
.logo-mark {
  width: 30px;
  height: auto;
  flex-shrink: 0;
  color: var(--accent);
  overflow: visible;
}

nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

nav a:not(.btn-cta) {
  color: var(--text-dim);
  font-weight: 500;
  font-size: 0.95rem;
}

nav a:not(.btn-cta):hover {
  color: var(--text);
}

/* Buttons */

.btn-cta {
  display: inline-block;
  background: var(--accent);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 10px 20px;
  border-radius: 8px;
  transition: background 0.15s ease;
}

.btn-cta:hover {
  background: var(--accent-dark);
  color: #ffffff;
}

.btn-cta:active {
  transform: translateY(1px);
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1rem;
  border-radius: 10px;
}

.btn-text {
  font-weight: 600;
  color: var(--text);
}

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

/* Hero — the banner */

.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(480px circle at 100% 0%, rgba(13, 148, 136, 0.08), transparent 60%),
    radial-gradient(480px circle at 0% 100%, rgba(13, 148, 136, 0.06), transparent 60%);
  border-bottom: 1px solid var(--border);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 56px;
  padding: 104px 24px 96px;
}

.hero-copy {
  max-width: 620px;
}

.hero h1 {
  font-size: 3rem;
  line-height: 1.15;
  margin-bottom: 24px;
}

.lede {
  color: var(--text-dim);
  font-size: 1.15rem;
  max-width: 56ch;
  margin: 0 0 36px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 28px;
}

/* Hero mark — the dissolve on ink (teal-bright on ink, per brand rules) */

.hero-mark {
  position: relative;
  background: var(--ink);
  border: 1px solid rgba(45, 212, 191, 0.18);
  border-radius: 20px;
  padding: 40px 36px 32px;
  box-shadow: 0 24px 60px rgba(16, 25, 29, 0.22);
}

.dissolve {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

/* The mark itself — always rendered, never restyled */
.dissolve .d-core { fill: var(--teal-bright); }
.dissolve .d-hole { fill: var(--ink); }
.dissolve .d-particle { fill: var(--teal-bright); }

/* Evaporating ghosts — motion only; each drifts up the diagonal and fades */
.dissolve .ghost {
  fill: var(--teal-bright);
  transform-box: fill-box;
  transform-origin: center;
  opacity: 0;
  animation: evaporate 3.4s cubic-bezier(0.4, 0, 0.5, 1) infinite;
}
.dissolve .ghost.g2 { animation-delay: 1.13s; }
.dissolve .ghost.g3 { animation-delay: 2.26s; }

@keyframes evaporate {
  0%   { transform: translate(0, 0) scale(1);   opacity: 0; }
  12%  { opacity: 0.85; }
  100% { transform: translate(78px, -70px) scale(0.12); opacity: 0; }
}

.mark-tagline {
  margin: 24px 0 0;
  color: var(--mist);
  font-size: 0.98rem;
  line-height: 1.5;
  letter-spacing: -0.01em;
}

.mark-tagline span {
  color: var(--teal-bright);
}

/* Products */

.products {
  padding: 96px 0;
}

.products h2 {
  font-size: 2rem;
  max-width: 40ch;
  margin: 0 0 56px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 32px;
  box-shadow: 0 1px 2px rgba(16, 24, 32, 0.04);
  display: flex;
  flex-direction: column;
  scroll-margin-top: 88px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  transform: translateY(-3px);
  border-color: rgba(13, 148, 136, 0.35);
  box-shadow: 0 10px 28px rgba(16, 24, 32, 0.08);
}

.card-featured {
  border-color: rgba(13, 148, 136, 0.25);
}

.card-emblem {
  width: 84px;
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(13, 148, 136, 0.08);
  border: 1px solid rgba(13, 148, 136, 0.18);
  border-radius: 18px;
  margin-bottom: 22px;
}

.card-emblem svg {
  width: 54px;
  height: 54px;
  display: block;
}

.card .tag {
  display: inline-block;
  align-self: flex-start;
  background: rgba(13, 148, 136, 0.1);
  color: var(--accent-dark);
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 4px 12px;
  margin-bottom: 16px;
}

.card h3 {
  font-size: 1.2rem;
  margin-bottom: 12px;
}

.card p {
  color: var(--text-dim);
  font-size: 0.95rem;
  margin: 0 0 20px;
  flex-grow: 1;
}

.card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
}

.card-link {
  font-weight: 600;
  font-size: 0.9rem;
}

.card-meta {
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.studio-note {
  margin: 28px 0 0;
  color: var(--text-dim);
  font-size: 0.9rem;
}

/* About */

.about {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.about-inner {
  padding: 88px 24px;
  max-width: 640px;
  text-align: center;
  margin: 0 auto;
}

.about h2 {
  font-size: 1.8rem;
  margin-bottom: 20px;
}

.about p {
  color: var(--text-dim);
  font-size: 1.05rem;
  margin: 0;
}

.about .about-founder {
  margin-top: 20px;
  font-size: 0.95rem;
}

/* Footer */

.site-footer .wrap {
  padding: 56px 24px 32px;
}

.footer-contact {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 20px 32px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.footer-heading {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-links a {
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 0.8rem;
}

.footer-bottom a {
  color: var(--text-dim);
  font-weight: 500;
}

.footer-bottom a:hover {
  color: var(--accent);
}

.footer-register {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-top: 12px;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

@media (max-width: 600px) {
  .footer-contact {
    flex-direction: column;
    gap: 12px;
  }
  .footer-links {
    gap: 12px 20px;
  }
}

@media (max-width: 860px) {
  .card-grid {
    grid-template-columns: 1fr;
  }
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 80px 24px 72px;
  }
  .hero-mark {
    max-width: 420px;
  }
}

@media (max-width: 600px) {
  nav {
    gap: 16px;
  }
  nav a:not(.btn-cta) {
    display: none;
  }
  .hero-grid {
    padding: 64px 24px 56px;
    gap: 32px;
  }
  .hero h1 {
    font-size: 2.2rem;
  }
  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .hero-mark {
    padding: 32px 28px 26px;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 8px;
  }
  .footer-register {
    flex-direction: column;
    gap: 4px;
  }
}

/* Card detail link — sits beside the existing card links */

.card-detail {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--accent-dark);
}

/* ======================================================================
   Product subpages (mackescode.html / map2.html / mde-construct.html)
   ====================================================================== */

/* Breadcrumb */

.breadcrumb {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}

.breadcrumb a {
  color: var(--text-dim);
  font-weight: 500;
}

.breadcrumb a:hover {
  color: var(--accent);
}

.breadcrumb .sep {
  margin: 0 8px;
  opacity: 0.6;
}

/* Subpage hero */

.subhero {
  background:
    radial-gradient(520px circle at 100% 0%, rgba(13, 148, 136, 0.08), transparent 60%),
    radial-gradient(420px circle at 0% 100%, rgba(13, 148, 136, 0.05), transparent 60%);
  border-bottom: 1px solid var(--border);
}

.subhero-inner {
  padding: 44px 24px 64px;
  max-width: 820px;
}

.subhero .tag {
  display: inline-block;
  background: rgba(13, 148, 136, 0.1);
  color: var(--accent-dark);
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 4px 12px;
  margin: 24px 0 18px;
}

.subhero h1 {
  font-size: 2.6rem;
  line-height: 1.15;
  margin-bottom: 20px;
}

.subhero .lede {
  font-size: 1.12rem;
  margin-bottom: 28px;
}

.subhero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
}

/* Spec strip — key/value metadata under the hero */

.spec-strip {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
}

.spec-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
}

.spec-item {
  background: var(--bg-alt);
  padding: 22px 24px;
}

.spec-item dt {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.spec-item dd {
  margin: 0;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}

/* Section scaffolding on subpages */

.subsection {
  padding: 72px 0;
  border-bottom: 1px solid var(--border);
}

.subsection:last-of-type {
  border-bottom: none;
}

.subsection h2 {
  font-size: 1.7rem;
  margin-bottom: 14px;
}

.subsection > .wrap > .section-lede {
  color: var(--text-dim);
  font-size: 1.02rem;
  max-width: 62ch;
  margin: 0 0 40px;
}

/* Feature grid */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.feature {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.feature:hover {
  transform: translateY(-2px);
  border-color: rgba(13, 148, 136, 0.35);
  box-shadow: 0 8px 22px rgba(16, 24, 32, 0.07);
}

.feature h3 {
  font-size: 1.05rem;
  margin-bottom: 8px;
}

.feature h3 .idx {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent);
  margin-right: 8px;
}

.feature p {
  color: var(--text-dim);
  font-size: 0.92rem;
  margin: 0;
}

/* Languages */

.lang-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.lang {
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  padding: 20px 22px;
  background: var(--bg);
}

.lang .lang-name {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.lang .lang-name strong {
  font-size: 1.05rem;
}

.lang .lang-role {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-dark);
}

.lang p {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin: 0;
}

/* Checklist — used by Testing & Compliance */

.checklist {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px 32px;
}

.checklist li {
  position: relative;
  padding-left: 30px;
  color: var(--text-dim);
  font-size: 0.95rem;
  line-height: 1.5;
}

.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: rgba(13, 148, 136, 0.12);
  border: 1px solid rgba(13, 148, 136, 0.3);
}

.checklist li::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 7px;
  width: 5px;
  height: 9px;
  border: solid var(--accent-dark);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checklist li strong {
  color: var(--text);
  font-weight: 600;
}

/* Compliance-flavoured checklist uses the same marks on an alt panel */

.panel {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 32px;
}

/* Back-to-catalog CTA above the footer */

.subpage-cta {
  text-align: center;
  padding: 64px 24px;
}

.subpage-cta h2 {
  font-size: 1.5rem;
  margin-bottom: 20px;
}

@media (max-width: 860px) {
  .spec-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .feature-grid {
    grid-template-columns: 1fr;
  }
  .checklist {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .subhero h1 {
    font-size: 2rem;
  }
  .spec-grid {
    grid-template-columns: 1fr;
  }
}

/* Respect reduced-motion: no scroll animation, transitions, or hover lift */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
  .card:hover,
  .feature:hover,
  .btn-cta:active {
    transform: none;
  }
  /* Freeze the dissolve to its static three-particle mark */
  .dissolve .ghost {
    display: none;
  }
}
