/* ===== Base ===== */
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  line-height: 1.6;
  color: #222;
  background-color: white;
  margin: 0;
  width: 100%;
  overflow-x: hidden;
}

/* ===== Layout ===== */
header,
nav,
main,
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
}

main {
  position: relative;
  z-index: 1;
}

footer {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

/* ===== Text spacing ===== */
header h1 {
  font-size: 2rem;
  margin-bottom: 0.25rem;
}

header p {
  color: #555;
  margin-top: 0;
}

/* ===== Navigation ===== */

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

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
}

.logo a {
  font-weight: 600;
  font-size: 35px;
  text-decoration: none;
  color: inherit;
}

.nav-bar {
  max-width: 1200px;
  width: 100%;
  height: auto;
  margin: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-links {
  display: flex;
  gap: 2rem;
  flex-direction: row;
  align-items: center;
  position: static;
  height: auto;
  width: auto;
  nav-right: auto;
  top: auto;
  background: none;
  box-shadow: none;
}

.nav-links a {
  color: black;
  text-decoration: none;
  font-weight: 500;
  text-align: right;
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
}

a {
  text-decoration: none;
}

/* ===== Content Sections ===== */
section {
  position: relative;
  z-index: 1;
  scroll-margin-top: 90px;
}

section h1,
section h2 {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

p {
  max-width: 65ch;
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

img {
  max-width: 100%;
  height: auto;
}

/* ===== Footer ===== */
footer {
  text-align: center;
  font-size: 0.9rem;
  color: #666;
  border-top: 1px solid #e5e5e5;
}

/* ===== Diagram Section ===== */
.diagram-section {
  background: linear-gradient(180deg, #f9fbff 0%, #eef3f9 100%);
  width: 100%;
  margin-left: calc(50% - 50vw);
  padding: 2rem;
}

.diagram-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.diagram-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.diagram-header h2 {
  font-size: 2rem;
  font-weight: 600;
  color: #0f172a;
}

.diagram-header p {
  font-size: 1rem;
  color: #475569;
  max-width: 620px;
  margin: 0.5rem auto 0;
}

.ecg-diagram {
  width: 100%;
  height: 220px;
  margin: 3rem 0;
}

.ecg-diagram polyline {
  fill: none;
  stroke: #16a34a;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 2000;
  stroke-dashoffset: 2000;
  animation: draw-ecg 4s ease-in-out infinite;
  filter: drop-shadow(0 0 4px rgba(22,163,74,0.4));
}

@keyframes draw-ecg {
  to {
      stroke-dashoffset: 0;
  }
}

/** == Technology Image */
.content-selection {
  width: 100%;
  max-width: 850px;
  margin: 0 auto;
  padding: 20px;
  box-sizing: border-box;
}

.section-image {
  width: 100%;
  height: auto;
}

/* ===== How It Works ===== */
.how-it-works {
  max-width: 900px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

.how-it-works h2 {
  text-align: center;
  margin-bottom: 2.5rem;
}

.steps {
  max-width: 650px;
  margin: 0 auto 3rem;
  padding-left: 1.5rem;
}

.steps li {
  margin-bottom: 1.2rem;
  line-height: 1.6;
}

.system-describe p {
  max-width: 65ch;
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

/* ===== Team Section ===== */
.team-section {
  max-width: 1100px;
  margin: auto;
  padding: 4rem 2rem;
}

.team-intro {
  max-width: 700px;
  margin: 0 auto 3rem;
  text-align: center;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
}

.team-card {
  text-align: center;
}

.team-card img {
  width: 100%;
  max-width: 180px;
  object-fit: cover;
  border-radius: 50%;
  margin-bottom: 1rem;
}

.team-card .role {
  font-weight: 600;
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 0.5rem;
  letter-spacing: 0.3px;
}

.team-card .bio {
  font-size: 0.9rem;
  max-width: 240px;
  margin: 0 auto;
  text-align: center;
  line-height: 1.5;
}

/* LinkedIn icons */
.linkedin-link {
  display: inline-flex;
  vertical-align: middle;
  margin-left: 6px;
}

.linkedin-icon {
  width: 18px;
  height: 18px;
  fill: #0a66c2;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.linkedin-link:hover .linkedin-icon {
  transform: scale(1.15);
  opacity: 0.85;
}

/* ===== Contact Form ===== */
.contact-section {
  width: 100%;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  background-color: #117ca7;
  color: white;
  padding: 3rem 1.5rem;
  border-radius: 6px;
}

.contact-section form {
  max-width: 500px;
  margin: 0 auto;
}

.contact-section input,
.contact-section textarea {
  background-color: white;
  color: black;
  border: 1px solid black;
  width: 100%;
  padding: 0.5rem;
  font-size: 1rem;
  margin-top: 0.25rem;
}

.contact-section button {
  background-color: rgb(204, 103, 103);
  color: white;
  padding: 0.6rem 1.2rem;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  width: auto;
}

/* Base for deskstop to stay same */
.nav-toggle {
  display: none;
}

/* Hamburger Icon for mobile only */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 26px;
  height: 20px;
  cursor: pointer;
}

.hamburger span {
  height: 3px;
  width: 100%;
  background-color: #222;
  border-radius: 2px;
}

/* ===== Responsive Mobile Adjustments ===== */
@media (max-width: 768px) {
  /* Navigation stacked */
  .nav-bar {
    flex-direction: column;
    align-items: center;
    padding: 1rem;
  }

  /* Show hamburger*/
  .hamburger {
    display: flex;
  }

  /* Show hamburger */
  .hamburger {
    display: flex;
  }

  /* Hide nav by default */
  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    height: 100vh;
    width: 240px;
    background: white;
    display: flex;
    flex-direction: column;
    padding-top: 5rem;
    padding-left: 1.5rem;
    gap: 1.8rem;
    transition: right 0.3s ease;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    z-index: 9999;
  }

  .nav-links a {
    font-size: 1.2rem;
  }

  /* When checkbox is checked → show menu */
  .nav-toggle:checked ~ .nav-links {
    right: 0;
  }
}


  .logo a {
    font-size: 28px;
  }

  .team-grid {
    grid-template-columns: repeat(auto-fit, minimax(100px, 1fr));
    gap: 1.5rem;
  }

  .team-card img {
    max-width: 140px;
  }

@media (max-width: 768px) {
  .diagram-header h2 {
    font-size: 1.5rem;
  }

  .diagram-header p {
    font-size: 0.9rem;
  }

  .ecg-diagram {
    height: 120px;
  }

  .section-image {
    max-width: 100%;
    margin: 1rem auto;
  }

  .steps {
    padding-left: 0.8rem;
  }

  .steps li {
    font-size: 0.95rem;
  }

  .how-it-works h2 {
    font-size: 1.5rem;
  }

  .contact-section {
    padding: 2rem 1rem;
  }

  .contact-section button {
    width: none;
    padding: 0.8rem;
  }

  .system-describe p {
    font-size: 0.9rem;
  }
}
