/* Tokens from https://techdynamism.com/css/style.css — Lexend substitutes for commercial "Usual" */

:root {
  --td-green: #4eae52;
  --td-blue: #2097f1;
  --td-teal: #24aa8e;
  --td-navy: #0f1d47;
  --td-text: #859ccf;
  --td-text-light: #8faae5;
  --td-gray: #3f4a6c;
  --td-gray-50: rgba(118, 118, 118, 0.5);
  --td-light-gray: #e7e8ed;
  --td-light-blue: #b6ddfa;
  --td-light-green: #c5e4c6;
  --td-light-teal: #b7e3da;
  --td-mid: #5bba7d;
  --td-white: #fff;
  --lexend: "Lexend", system-ui, sans-serif;
  --usual: "Lexend", system-ui, sans-serif;
  /* Scaled iframe height = 900px * scale — .preview-clip matches this (no empty navy below) */
  --preview-scale: 0.42;
  --preview-scaled-h: calc(900px * var(--preview-scale));
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--usual);
  font-size: 18px;
  font-weight: 200;
  line-height: 1.55;
  letter-spacing: 0.08px;
  color: var(--td-gray);
  background: var(--td-light-gray);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1,
h2,
h3,
.hero-lede {
  font-family: var(--lexend);
  color: var(--td-navy);
  letter-spacing: -0.03em;
}

a {
  color: var(--td-navy);
  transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover {
  color: var(--td-blue);
}

.wrap {
  width: min(1120px, 100% - 2rem);
  margin-inline: auto;
}

/* Nav — same base as .hero (td-navy) */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--td-navy);
  border: none;
}

.nav-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.85rem 0 0.65rem;
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  line-height: 0;
}

.nav-logo {
  display: block;
  height: 40px;
  width: auto;
  max-width: min(200px, 55vw);
}

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

.nav-link {
  font-family: var(--usual);
  font-size: 18px;
  font-weight: 300;
  text-decoration: none;
  color: var(--td-white);
  padding: 0.35rem 0;
  border-bottom: 3px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.nav-link:hover {
  border-bottom-color: var(--td-white);
  color: var(--td-white);
  opacity: 1;
}

.nav-link--cta {
  color: var(--td-navy);
  background: var(--td-white);
  border: 2px solid var(--td-white);
  border-radius: 8px;
  padding: 0.5rem 1.1rem;
  font-weight: 400;
}

.nav-link--cta:hover {
  color: var(--td-white);
  background: transparent;
  box-shadow: 5px 5px 0 rgba(255, 255, 255, 0.35);
}

/* Hero — mirrors .home .hero */
.hero {
  background: url("https://techdynamism.com/img/td-arrows.svg") no-repeat 121% 55%,
    var(--td-navy);
  background-size: min(52%, 520px), auto;
  padding: 3.25rem 0 3.5rem;
  margin-top: 0;
}

.hero-inner h1 {
  margin: 0 0 1rem;
  font-style: normal;
  font-weight: 300;
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  line-height: 1.05;
  color: var(--td-white);
}

.hero-lede {
  margin: 0;
  max-width: 40rem;
  font-family: var(--usual);
  font-size: 18px;
  font-weight: 200;
  line-height: 1.55;
  letter-spacing: 0.08px;
  color: var(--td-text-light);
}

/* Main — light panel; top curve like #services */
.main-surface {
  flex: 1;
  background: var(--td-white) url("https://techdynamism.com/img/top-slice-3.svg") no-repeat top center;
  background-size: 100% auto;
  margin-top: -2px;
  padding: 5rem 0 3.5rem;
}

@media (max-width: 640px) {
  .main-surface {
    padding-top: 3.5rem;
  }

  .hero {
    background-position: 50% 120%, 0 0;
    background-size: 90%, auto;
  }
}

.main-inner .subheader {
  margin: 0 0 0.75rem;
}

.subheader {
  font-family: var(--usual);
  font-style: normal;
  font-weight: 400;
  font-size: 12px;
  line-height: 25px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--td-navy);
  border-bottom: 1px dashed var(--td-gray-50);
  padding: 0.5rem 0;
}

.main-inner .subheader:not(:first-child) {
  margin-top: 2.5rem;
}

.preview-note {
  margin: 0 0 0;
  padding: 1rem 1.15rem;
  font-size: 16px;
  font-weight: 200;
  color: var(--td-gray);
  background: rgba(182, 221, 250, 0.2);
  border: 1px solid rgba(15, 29, 71, 0.08);
  border-radius: 16px;
}

.preview-note code {
  font-size: 0.88em;
  background: var(--td-white);
  padding: 0.12em 0.35em;
  border-radius: 6px;
  color: var(--td-navy);
}

.demos {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  margin: 0;
  padding: 0;
  width: 100%;
}

.demo-card {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  width: 100%;
  background: var(--td-white);
  border-radius: 20px;
  border: 1px solid rgba(15, 29, 71, 0.08);
  box-shadow: none;
  overflow: hidden;
  transition: box-shadow 0.25s ease;
}

.demo-card:nth-child(even) {
  flex-direction: row-reverse;
}

.demo-card:hover {
  box-shadow: 0 12px 40px rgba(15, 29, 71, 0.08);
}

@media (max-width: 768px) {
  .demo-card,
  .demo-card:nth-child(even) {
    flex-direction: column;
    align-items: stretch;
  }

  .demo-card .preview {
    order: 1;
  }

  .demo-card .card-body {
    order: 2;
  }
}

.card-hit {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.preview {
  position: relative;
  flex: 1 1 50%;
  width: 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  min-height: 0;
  background: var(--td-navy);
  border-inline-end: 1px solid rgba(15, 29, 71, 0.12);
  overflow: hidden;
}

.preview-clip {
  width: 100%;
  height: var(--preview-scaled-h);
  flex: 0 0 auto;
  position: relative;
  overflow: hidden;
}

.preview-loader {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  background: rgba(15, 29, 71, 0.88);
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.preview-clip.is-loaded .preview-loader {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preview-spinner {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.18);
  border-top-color: var(--td-blue);
  animation: preview-spin 0.7s linear infinite;
}

@keyframes preview-spin {
  to {
    transform: rotate(360deg);
  }
}

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

.demo-card:nth-child(even) .preview {
  border-inline-end: none;
  border-inline-start: 1px solid rgba(15, 29, 71, 0.12);
}

@media (max-width: 768px) {
  .preview {
    width: 100%;
    flex: 0 0 auto;
    justify-content: flex-start;
    border-inline: none !important;
    border-bottom: 1px solid rgba(15, 29, 71, 0.12);
  }
}

.preview-scale {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  width: calc(100% / var(--preview-scale));
  height: 900px;
  transform-origin: top left;
  transform: scale(var(--preview-scale));
  pointer-events: none;
}

.preview iframe {
  width: 1440px;
  height: 900px;
  border: 0;
  background: #fff;
}

.card-body {
  position: relative;
  z-index: 1;
  flex: 1 1 50%;
  width: 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  min-height: 0;
  padding: clamp(1.25rem, 4vw, 2.5rem) clamp(1.25rem, 5vw, 3rem);
  pointer-events: none;
}

@media (max-width: 768px) {
  .card-body {
    width: 100%;
    flex: 0 0 auto;
    padding: 1.35rem clamp(1rem, 4vw, 1.5rem) 1.75rem;
  }
}

.demo-card .cta {
  pointer-events: none;
}

.card-body h2 {
  margin: 0 0 0.35rem;
  font-family: var(--lexend);
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--td-navy);
}

.demo-description {
  margin: 0 0 1rem;
  font-size: 15px;
  font-weight: 200;
  line-height: 1.5;
  color: var(--td-gray);
  max-width: 42ch;
}

.cta {
  display: inline-block;
  font-family: var(--usual);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--td-navy);
  padding: 8px 14px;
  border: 2px solid var(--td-navy);
  border-radius: 8px;
  box-shadow: 5px 5px 0 var(--td-navy);
  background: var(--td-white);
}

.demo-card:hover .cta {
  background: var(--td-navy);
  color: var(--td-white);
  box-shadow: 2px 2px 0 var(--td-navy);
}

/* Footer — simplified from .footer */
.site-footer {
  background: url("https://techdynamism.com/img/footer-bg.svg") no-repeat top center,
    var(--td-navy);
  background-size: 100% auto;
  margin-top: 0;
  padding: 6rem 0 3rem;
  color: var(--td-text-light);
}

.site-footer a {
  color: var(--td-white);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-footer a:hover {
  color: var(--td-light-blue);
}

.footer-inner p {
  margin: 0;
  font-size: 16px;
  font-weight: 200;
  text-align: center;
  color: var(--td-text);
}
