/* ==========================================================================
   Digimarx AI — Stylesheet
   Tokens → Base → Layout → Components → Sections → Utilities → Media
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  /* Brand colors */
  --blue-700: #0A2F82;
  --blue-600: #0D3DAA;
  --blue-500: #2C56C4;
  --blue-50:  #EAF0FB;

  --green-600: #00B85E;
  --green-500: #00D26A;
  --green-50:  #E6FBF0;

  --white:   #FFFFFF;
  --gray-50: #F5F7FA;
  --gray-100:#EEF1F6;
  --gray-200:#E2E6ED;
  --gray-400:#9AA3B2;
  --gray-500:#6B7280;
  --ink:     #1A1A1A;

  /* Type */
  --font-display: 'Space Grotesk', 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-body: 'Inter', 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-mono: 'IBM Plex Mono', 'SFMono-Regular', Consolas, monospace;

  /* Layout */
  --container: 1200px;
  --header-h: 76px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;

  /* Shadows */
  --shadow-sm: 0 2px 10px rgba(13, 61, 170, 0.06);
  --shadow-md: 0 10px 30px rgba(13, 61, 170, 0.10);
  --shadow-lg: 0 20px 50px rgba(13, 61, 170, 0.14);

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Reset / Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--white);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink);
  line-height: 1.2;
  margin: 0 0 0.6em;
  letter-spacing: -0.01em;
}

p { margin: 0 0 1em; color: var(--gray-500); }

a { color: inherit; text-decoration: none; }

ul { margin: 0; padding: 0; list-style: none; }

button { font-family: inherit; cursor: pointer; }

input, textarea {
  font-family: inherit;
  font-size: 1rem;
  width: 100%;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
}
.skip-link:focus {
  left: 16px;
  top: 16px;
  z-index: 999;
  background: var(--blue-600);
  color: var(--white);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
}

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

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

section { padding: 104px 0; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--blue-600);
  margin: 0 0 14px;
  display: inline-block;
}

.section-head {
  max-width: 640px;
  margin: 0 0 56px;
}

.section-head h2 {
  font-size: clamp(1.75rem, 3vw, 2.4rem);
}

.section-sub {
  font-size: 1.05rem;
  color: var(--gray-500);
  margin-bottom: 0;
}

.card-grid {
  display: grid;
  gap: 24px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.96rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease), color 0.25s var(--ease), border-color .25s var(--ease);
  white-space: nowrap;
}

.btn-primary {
  background: var(--green-500);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  background: var(--green-600);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: transparent;
  color: var(--blue-600);
  border-color: var(--blue-600);
}
.btn-secondary:hover {
  background: var(--blue-50);
  transform: translateY(-2px);
}

.btn-sm { padding: 10px 20px; font-size: 0.88rem; }
.btn-block { width: 100%; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: box-shadow 0.3s var(--ease), border-color 0.3s var(--ease), height 0.3s var(--ease);
}

.site-header.is-scrolled {
  box-shadow: var(--shadow-sm);
  border-bottom-color: var(--gray-200);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.logo-mark {
  width: 34px;
  height: 34px;
  object-fit: contain;
  flex-shrink: 0;
}

.logo-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--white);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.logo-chip .logo-mark {
  width: 24px;
  height: 23px;
}

.logo-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.18rem;
  color: var(--ink);
}

.logo-ai {
  color: var(--green-600);
  background: var(--green-50);
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 0.78em;
  margin-left: 2px;
  vertical-align: 2px;
}

.nav { flex: 1; display: flex; justify-content: center; }

.nav-list { display: flex; gap: 36px; }

.nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
  position: relative;
  padding: 6px 0;
  transition: color 0.2s var(--ease);
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 2px;
  background: var(--green-500);
  transition: width 0.25s var(--ease);
}

.nav-link:hover { color: var(--blue-600); }
.nav-link:hover::after { width: 100%; }
.nav-link.is-active { color: var(--blue-600); }
.nav-link.is-active::after { width: 100%; }

.header-cta { flex-shrink: 0; }

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  padding: 0;
}

.menu-toggle span {
  display: block;
  height: 2px;
  width: 22px;
  margin: 0 auto;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}

.menu-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.is-open span:nth-child(2) { opacity: 0; }
.menu-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  padding-top: 80px;
  padding-bottom: 60px;
  background:
    radial-gradient(620px circle at 88% 12%, var(--green-50), transparent 60%),
    radial-gradient(720px circle at 8% 100%, var(--blue-50), transparent 55%),
    var(--white);
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 56px;
}

.hero-title {
  font-size: clamp(2.1rem, 4.6vw, 3.35rem);
  font-weight: 700;
  margin-bottom: 0.5em;
}

.hero-sub {
  font-size: 1.12rem;
  max-width: 540px;
  margin-bottom: 2em;
}

.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }

.hero-visual { position: relative; }

#heroSvg { width: 100%; height: auto; }

.hub-node { fill: var(--blue-600); }
.leaf-circle { fill: var(--white); stroke: var(--gray-200); stroke-width: 1.5; filter: drop-shadow(0 6px 16px rgba(13,61,170,0.10)); }

.hub-line {
  stroke: var(--gray-400);
  stroke-width: 1.6;
  stroke-dasharray: 5 6;
  fill: none;
  opacity: 0.85;
  animation: dashFlow 2.6s linear infinite;
}

@keyframes dashFlow {
  to { stroke-dashoffset: -44; }
}

.hub-node, .leaf-node {
  animation: popIn 0.6s var(--ease) backwards;
}
.hub-node { animation-delay: 0.1s; }
.leaf-node:nth-of-type(2) { animation-delay: 0.22s; }
.leaf-node:nth-of-type(3) { animation-delay: 0.34s; }
.leaf-node:nth-of-type(4) { animation-delay: 0.46s; }
.leaf-node:nth-of-type(5) { animation-delay: 0.58s; }

@keyframes popIn {
  from { opacity: 0; transform: scale(0.6); }
  to { opacity: 1; transform: scale(1); }
}

.leaf-node circle.leaf-circle { animation: pulse 3.4s ease-in-out infinite; transform-origin: center; }

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.045); }
}

/* ---------- Cards ---------- */
.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--blue-50);
}

.card-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  background: var(--blue-50);
  color: var(--blue-600);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}

.card-icon svg { width: 26px; height: 26px; }
.card-icon--sm { width: 46px; height: 46px; }
.card-icon--sm svg { width: 22px; height: 22px; }

.card:hover .card-icon {
  background: var(--green-500);
  color: var(--ink);
}

.card h3 { font-size: 1.18rem; margin-bottom: 0.5em; }
.card p { margin-bottom: 0; font-size: 0.97rem; }

/* ---------- Services ---------- */
.services-grid { grid-template-columns: repeat(4, 1fr); }

/* ---------- Why Us ---------- */
.why-us { background: var(--gray-50); }
.why-grid {
  grid-template-columns: repeat(5, 1fr);
}

/* ---------- Featured Solutions ---------- */
.solutions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

.solution-panel {
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.solution-panel:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }

.panel-services { background: var(--blue-50); }
.panel-products { background: var(--green-50); }

.panel-tag {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--white);
  padding: 5px 12px;
  border-radius: 20px;
  display: inline-block;
  margin-bottom: 18px;
  color: var(--blue-600);
  box-shadow: var(--shadow-sm);
}

.panel-products .panel-tag { color: var(--green-600); }

.solution-panel h3 { font-size: 1.3rem; margin-bottom: 22px; }

.solution-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid rgba(13, 61, 170, 0.08);
  font-weight: 500;
  font-size: 1rem;
}

.solution-list li:first-child { border-top: none; }

.solution-list svg {
  width: 19px; height: 19px;
  flex-shrink: 0;
  color: var(--blue-600);
}

.panel-products .solution-list svg { color: var(--green-600); }

/* live product card (Gumroad-linked item inside the Digital Products list) */
.product-live {
  border-top: none !important;
  padding: 6px !important;
  margin: 2px 0 10px;
  border-radius: var(--radius-md);
  background: var(--white);
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.product-live:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.product-live-link {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  color: inherit;
}

.product-thumb {
  width: 56px;
  height: 56px;
  border-radius: 9px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--gray-100);
  box-shadow: 0 2px 8px rgba(13, 61, 170, 0.12);
}

.product-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.product-name {
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.badge-live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--green-600);
  background: var(--green-50);
  padding: 3px 9px;
  border-radius: 20px;
  white-space: nowrap;
}

.badge-live::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green-500);
}

.product-cta {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--blue-600);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.panel-products .solution-list .product-cta svg {
  width: 14px;
  height: 14px;
  color: var(--blue-600);
  transition: transform 0.25s var(--ease);
}

.product-live:hover .product-cta svg {
  transform: translate(3px, -3px);
}

/* ---------- Roadmap ---------- */
.roadmap { background: var(--gray-50); }

.timeline {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  padding-top: 12px;
}

.timeline-track {
  position: absolute;
  top: 11px;
  left: 8%;
  right: 8%;
  height: 2px;
  background: repeating-linear-gradient(to right, var(--gray-400) 0 6px, transparent 6px 12px);
}

.timeline-stage {
  position: relative;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 36px 28px 28px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.timeline-stage:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }

.stage-node {
  position: absolute;
  top: -11px;
  left: 28px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--green-500);
  border: 4px solid var(--white);
  box-shadow: 0 0 0 1px var(--gray-200);
}

.timeline-stage:nth-child(2) .stage-node { background: var(--blue-600); }
.timeline-stage:nth-child(3) .stage-node { background: var(--ink); }

.stage-label {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray-500);
  display: block;
  margin-bottom: 14px;
}

.timeline-stage h3 { font-size: 1.18rem; margin-bottom: 0.45em; }
.timeline-stage p { margin-bottom: 0; font-size: 0.96rem; }

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 60px;
  align-items: start;
}

.contact-info .section-sub { margin-bottom: 32px; }

.info-list { display: flex; flex-direction: column; gap: 18px; }

.info-list li {
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 500;
  font-size: 0.98rem;
  color: var(--ink);
}

.info-list svg {
  width: 22px; height: 22px;
  flex-shrink: 0;
  color: var(--green-600);
  background: var(--green-50);
  border-radius: 50%;
  padding: 5px;
  box-sizing: content-box;
}

.info-list a {
  color: var(--ink);
  transition: color 0.2s var(--ease);
}

.info-list a:hover {
  color: var(--blue-600);
  text-decoration: underline;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  margin: -1px;
  padding: 0;
  border: 0;
}

.contact-form {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-sm);
}

.form-row { margin-bottom: 22px; }

.form-row label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.form-row input,
.form-row textarea {
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  color: var(--ink);
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
  resize: vertical;
}

.form-row input:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--blue-500);
  box-shadow: 0 0 0 4px var(--blue-50);
}

.form-row input.is-invalid,
.form-row textarea.is-invalid {
  border-color: #E0455A;
}

.field-error {
  display: block;
  min-height: 1.1em;
  font-size: 0.82rem;
  color: #E0455A;
  margin-top: 6px;
}

.form-status {
  margin: 16px 0 0;
  font-size: 0.92rem;
  font-weight: 500;
  min-height: 1.2em;
}

.form-status.success { color: var(--green-600); }
.form-status.error { color: #E0455A; }

/* ---------- Footer ---------- */
.site-footer { background: var(--blue-700); color: var(--white); }

.footer-inner {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 40px;
  padding: 64px 24px 40px;
  align-items: start;
}

.logo-text--footer { color: var(--white); }

.footer-tagline {
  color: rgba(255, 255, 255, 0.7);
  margin-top: 14px;
  font-size: 0.95rem;
  max-width: 320px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.95rem;
  transition: color 0.2s var(--ease);
}
.footer-links a:hover { color: var(--green-500); }

.footer-social {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.social-link {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.95rem;
  transition: color 0.2s var(--ease);
}

.social-link svg { width: 19px; height: 19px; flex-shrink: 0; }
.social-link:hover { color: var(--green-500); }

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 22px 24px;
  text-align: center;
}

.footer-bottom p {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
}

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--blue-600);
  color: var(--white);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), background 0.3s var(--ease);
  z-index: 90;
}

.back-to-top svg { width: 20px; height: 20px; }

.back-to-top.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top:hover { background: var(--blue-700); }

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 1;
  transform: none;
}

.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

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

/* stagger children inside grids that are revealed as a group */
.card-grid .card.reveal:nth-child(1) { transition-delay: 0s; }
.card-grid .card.reveal:nth-child(2) { transition-delay: 0.08s; }
.card-grid .card.reveal:nth-child(3) { transition-delay: 0.16s; }
.card-grid .card.reveal:nth-child(4) { transition-delay: 0.24s; }
.card-grid .card.reveal:nth-child(5) { transition-delay: 0.32s; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1080px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .why-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; margin-bottom: 8px; }
}

@media (max-width: 900px) {
  section { padding: 80px 0; }

  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero { padding-top: 56px; text-align: left; }
  .hero-visual { max-width: 420px; margin: 0 auto; order: -1; }
  .hero-content { text-align: left; }
  .hero-sub { max-width: none; }

  .contact-grid { grid-template-columns: 1fr; gap: 40px; }

  .timeline { grid-template-columns: 1fr; gap: 44px; }
  .timeline-track { display: none; }
}

@media (max-width: 760px) {
  .nav { display: none; }
  .header-cta { display: none; }
  .menu-toggle { display: flex; }

  .nav.is-open {
    display: flex;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    box-shadow: var(--shadow-md);
    padding: 12px 0 24px;
  }

  .nav.is-open .nav-list {
    flex-direction: column;
    gap: 4px;
    width: 100%;
    padding: 0 24px;
  }

  .nav.is-open .nav-link {
    display: block;
    padding: 14px 0;
    border-bottom: 1px solid var(--gray-100);
  }

  .nav.is-open .nav-link::after { display: none; }

  .services-grid { grid-template-columns: 1fr; }
  .why-grid { grid-template-columns: 1fr; }
  .solutions-grid { grid-template-columns: 1fr; }

  .footer-inner { grid-template-columns: 1fr; gap: 32px; padding: 48px 24px 32px; }
}

@media (max-width: 480px) {
  .container { padding: 0 18px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { width: 100%; }
  .contact-form { padding: 28px; }
  .solution-panel { padding: 28px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}
