/* =========================================================
   N.D. Digital — shared styles
   Palette: near-black navy + glowing teal accents ("high-tech")
   ========================================================= */

:root {
  --bg: #080d18;
  --bg-alt: #0c1424;
  --surface: #101a2e;
  --navy: #1b2a4a;
  --navy-2: #24365f;
  --teal: #1f7a6c;
  --teal-dark: #17594e;
  --teal-light: #3fc1ac;
  --heading: #eef2f8;
  --text: #93a1b8;
  --border: rgba(63, 193, 172, 0.16);
  --white: #ffffff;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
}

h1, h2, h3 {
  color: var(--heading);
  margin: 0 0 0.5em;
  font-weight: 700;
  line-height: 1.25;
}

p {
  margin: 0 0 1em;
}

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

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

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

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

.eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--teal-light);
  text-shadow: 0 0 12px rgba(63, 193, 172, 0.5);
  margin-bottom: 0.75em;
}

.section-heading {
  max-width: 680px;
  margin: 0 auto 48px;
  text-align: center;
}

.section-heading h2 {
  font-size: 2rem;
}

.examples-disclaimer {
  font-size: 0.85rem;
  font-style: italic;
  color: var(--text);
  opacity: 0.75;
  margin-top: -0.5em;
}

section {
  padding: 80px 0;
}

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

.btn {
  display: inline-block;
  padding: 14px 28px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: var(--teal);
  color: var(--white);
  box-shadow: 0 0 18px rgba(63, 193, 172, 0.35), 0 8px 20px rgba(0, 0, 0, 0.35);
}

.btn-primary:hover {
  background: var(--teal-dark);
  color: var(--white);
  box-shadow: 0 0 30px rgba(63, 193, 172, 0.6), 0 8px 24px rgba(0, 0, 0, 0.4);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.35);
  color: var(--white);
}

.btn-outline:hover {
  border-color: var(--teal-light);
  color: var(--teal-light);
  box-shadow: 0 0 20px rgba(63, 193, 172, 0.35);
  transform: translateY(-2px);
}

.btn-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

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

.site-header {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 24px rgba(0, 0, 0, 0.45);
}

.header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-img {
  height: 32px;
  width: auto;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.6rem;
  cursor: pointer;
}

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 32px;
  margin: 0;
  padding: 0;
}

.main-nav a {
  color: rgba(255, 255, 255, 0.75);
  font-weight: 500;
  font-size: 0.95rem;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--teal-light);
  text-shadow: 0 0 10px rgba(63, 193, 172, 0.5);
}

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

.hero {
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 55%, #0c2c28 100%);
  color: var(--white);
  padding: 110px 0 100px;
  text-align: center;
}

.hero h1 {
  color: var(--white);
  font-size: 2.75rem;
  max-width: 780px;
  margin: 0 auto 0.5em;
}

.hero .lead {
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.7);
  max-width: 620px;
  margin: 0 auto 2em;
}

.hero .btn-row {
  justify-content: center;
}

.page-hero {
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 100%);
  color: var(--white);
  padding: 90px 0 70px;
  text-align: center;
}

.page-hero h1 {
  color: var(--white);
  font-size: 2.4rem;
  margin-bottom: 0.4em;
}

.page-hero p {
  color: rgba(255, 255, 255, 0.7);
  max-width: 620px;
  margin: 0 auto;
  font-size: 1.05rem;
}

/* ---------- Grid / Cards ---------- */

.grid {
  display: grid;
  gap: 28px;
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 32px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(63, 193, 172, 0.45);
  box-shadow: 0 0 32px rgba(63, 193, 172, 0.2), 0 16px 32px rgba(0, 0, 0, 0.35);
}

.card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(63, 193, 172, 0.14);
  color: var(--teal-light);
  box-shadow: 0 0 16px rgba(63, 193, 172, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

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

.card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.4em;
}

.card p {
  margin-bottom: 0;
  font-size: 0.95rem;
}

/* ---------- Service page specific ---------- */

.service-block {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 20px;
  margin-bottom: 56px;
}

.service-block .badge {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--navy);
  color: var(--teal-light);
  border: 1px solid rgba(63, 193, 172, 0.3);
  box-shadow: 0 0 14px rgba(63, 193, 172, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.service-block h2 {
  font-size: 1.6rem;
  margin-bottom: 0.4em;
}

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

/* ---------- Website Examples ---------- */

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

.example-card {
  cursor: pointer;
}

.example-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.example-card:hover .example-thumb,
.example-card:focus-visible .example-thumb {
  transform: translateY(-4px);
  border-color: rgba(63, 193, 172, 0.45);
  box-shadow: 0 0 32px rgba(63, 193, 172, 0.2), 0 16px 32px rgba(0, 0, 0, 0.35);
}

.example-thumb-frame {
  position: absolute;
  inset: 0;
  transition: transform 0.4s ease;
}

.example-card:hover .example-thumb-frame,
.example-card:focus-visible .example-thumb-frame {
  transform: scale(1.08);
}

.example-thumb-frame iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 400%;
  height: 400%;
  border: 0;
  pointer-events: none;
  transform: scale(0.25);
  transform-origin: top left;
}

.example-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 13, 24, 0.1) 0%, rgba(8, 13, 24, 0.85) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.example-card:hover .example-overlay,
.example-card:focus-visible .example-overlay {
  opacity: 1;
}

.example-overlay span {
  color: var(--white);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 10px 22px;
  border: 1px solid var(--teal-light);
  border-radius: 999px;
  background: rgba(63, 193, 172, 0.15);
  box-shadow: 0 0 20px rgba(63, 193, 172, 0.3);
}

.example-label {
  margin-top: 14px;
  text-align: center;
  font-weight: 600;
  color: var(--heading);
}

/* ---------- Example modal / lightbox ---------- */

body.modal-open {
  overflow: hidden;
}

.example-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.example-modal.open {
  display: flex;
}

.example-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 7, 14, 0.85);
  backdrop-filter: blur(4px);
}

.example-modal-panel {
  position: relative;
  width: 100%;
  max-width: 1100px;
  height: 85vh;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 0 60px rgba(63, 193, 172, 0.25), 0 30px 80px rgba(0, 0, 0, 0.6);
  animation: modalIn 0.25s ease;
  display: flex;
  flex-direction: column;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.example-modal-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}

.example-modal-panel iframe {
  flex: 1 1 auto;
  width: 100%;
  border: 0;
  display: block;
}

.example-modal-close {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: transparent;
  color: var(--white);
  border: 1px solid rgba(63, 193, 172, 0.4);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.example-modal-close:hover {
  background: var(--teal);
  box-shadow: 0 0 20px rgba(63, 193, 172, 0.5);
}

.example-modal-label {
  color: var(--heading);
  font-weight: 600;
  font-size: 0.9rem;
}

/* ---------- Why section ---------- */

.why-section {
  background: linear-gradient(160deg, var(--navy) 0%, #0c2c28 100%);
  color: rgba(255, 255, 255, 0.85);
  border-top: 1px solid rgba(63, 193, 172, 0.2);
  border-bottom: 1px solid rgba(63, 193, 172, 0.2);
}

.why-section .container {
  max-width: 820px;
  text-align: center;
}

.why-section h2 {
  color: var(--white);
}

.why-section p {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.75);
}

/* ---------- CTA banner ---------- */

.cta-banner {
  background: var(--bg-alt);
  text-align: center;
}

.cta-banner h2 {
  font-size: 1.9rem;
  margin-bottom: 0.3em;
}

.cta-banner p {
  max-width: 520px;
  margin: 0 auto 1.75em;
}

/* ---------- Form ---------- */

.form-wrap {
  max-width: 560px;
  margin: 0 auto;
}

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

.form-group label {
  display: block;
  font-weight: 600;
  color: var(--heading);
  margin-bottom: 6px;
  font-size: 0.95rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 13px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  color: var(--heading);
  background: var(--surface);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: rgba(147, 161, 184, 0.5);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--teal-light);
  box-shadow: 0 0 0 3px rgba(63, 193, 172, 0.15), 0 0 20px rgba(63, 193, 172, 0.25);
}

.form-group textarea {
  min-height: 140px;
  resize: vertical;
}

.form-note {
  font-size: 0.85rem;
  color: var(--text);
  margin-top: 24px;
  text-align: center;
}

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

.site-footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  color: rgba(255, 255, 255, 0.55);
  padding: 40px 0;
  font-size: 0.9rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-inner .logo-img {
  height: 26px;
}

.footer-nav {
  list-style: none;
  display: flex;
  gap: 24px;
  margin: 0;
  padding: 0;
}

.footer-nav a {
  color: rgba(255, 255, 255, 0.55);
}

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

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

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

  .grid-2,
  .tool-grid {
    grid-template-columns: 1fr;
  }

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

  .examples-grid {
    grid-template-columns: 1fr;
    max-width: 360px;
    margin: 0 auto;
  }
}

@media (max-width: 720px) {
  .nav-toggle {
    display: block;
  }

  .main-nav {
    display: none;
    width: 100%;
  }

  .main-nav.open {
    display: block;
  }

  .header-inner {
    flex-wrap: wrap;
  }

  .main-nav ul {
    flex-direction: column;
    gap: 4px;
    padding: 16px 0 4px;
  }

  .main-nav a {
    display: block;
    padding: 10px 0;
  }

  .hero h1 {
    font-size: 2.1rem;
  }

  .hero {
    padding: 80px 0 70px;
  }

  section {
    padding: 56px 0;
  }
}

/* ---------- Chat widget ---------- */

.chat-widget {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 900;
}

.chat-toggle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  background: var(--teal);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(63, 193, 172, 0.45), 0 8px 20px rgba(0, 0, 0, 0.4);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.chat-toggle:hover {
  background: var(--teal-dark);
  transform: translateY(-2px);
  box-shadow: 0 0 28px rgba(63, 193, 172, 0.6), 0 8px 24px rgba(0, 0, 0, 0.45);
}

.chat-toggle svg {
  width: 26px;
  height: 26px;
}

.chat-toggle .icon-close {
  display: none;
}

.chat-widget.open .chat-toggle .icon-chat {
  display: none;
}

.chat-widget.open .chat-toggle .icon-close {
  display: block;
}

.chat-hint {
  position: absolute;
  right: 74px;
  bottom: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--heading);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 0 20px rgba(63, 193, 172, 0.2), 0 8px 20px rgba(0, 0, 0, 0.35);
  animation: chatHintFloat 2.4s ease-in-out infinite;
}

.chat-widget.open .chat-hint,
.chat-widget.hint-dismissed .chat-hint {
  display: none;
}

@keyframes chatHintFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.chat-panel {
  position: absolute;
  right: 0;
  bottom: 76px;
  width: 340px;
  max-width: calc(100vw - 48px);
  height: 460px;
  max-height: calc(100vh - 140px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 0 40px rgba(63, 193, 172, 0.18), 0 20px 50px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.chat-widget.open .chat-panel {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.chat-header {
  flex: 0 0 auto;
  padding: 14px 16px;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-header span {
  font-weight: 600;
  color: var(--heading);
  font-size: 0.95rem;
}

.chat-close {
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
}

.chat-close:hover {
  color: var(--teal-light);
}

.chat-messages {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-message {
  max-width: 85%;
  padding: 10px 13px;
  border-radius: 12px;
  font-size: 0.88rem;
  line-height: 1.5;
}

.chat-message.assistant {
  align-self: flex-start;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--text);
  border-bottom-left-radius: 3px;
}

.chat-message.user {
  align-self: flex-end;
  background: var(--teal);
  color: var(--white);
  border-bottom-right-radius: 3px;
}

.chat-message.error {
  align-self: flex-start;
  background: rgba(220, 38, 38, 0.12);
  border: 1px solid rgba(220, 38, 38, 0.35);
  color: #fca5a5;
}

.chat-message.typing {
  align-self: flex-start;
  color: var(--text);
  font-style: italic;
}

.chat-input-row {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
}

.chat-input-row input {
  flex: 1 1 auto;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--heading);
  font-family: inherit;
  font-size: 0.88rem;
}

.chat-input-row input:focus {
  outline: none;
  border-color: var(--teal-light);
  box-shadow: 0 0 0 3px rgba(63, 193, 172, 0.15);
}

.chat-input-row button {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: none;
  background: var(--teal);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease;
}

.chat-input-row button:hover {
  background: var(--teal-dark);
}

.chat-input-row button svg {
  width: 18px;
  height: 18px;
}

@media (max-width: 480px) {
  .chat-widget {
    right: 16px;
    bottom: 16px;
  }

  .chat-panel {
    width: calc(100vw - 32px);
    height: calc(100vh - 120px);
    bottom: 72px;
  }

  .chat-hint {
    right: 0;
    bottom: 72px;
    font-size: 0.75rem;
  }
}
