/* ============================================================
   THEME — edit these variables to restyle the whole site
   ============================================================ */
:root {
  /* Backgrounds */
  --bg-main: rgb(242, 246, 248);
  --bg-light: #ffffff;
  --bg-dark: rgb(44, 79, 94);
  --bg-secondary: rgb(24, 59, 74);
  --bg-deepest: rgb(4, 39, 54);
  --bg-chart: #64c3fa;

  /* Brand (accents only) */
  --primary: rgb(23, 189, 244);
  --primary-dark: rgb(0, 149, 212);
  --primary-soft: rgba(23, 189, 244, 0.35);
  --primary-light: #64c3fa;
  --warning: rgb(245, 158, 11);

  /* HELPER COLOR: the bridge between dark teal and white.
     Every dark<->light transition passes through it. */
  --mist: rgb(172, 197, 208);
  --mist: color-mix(in srgb, var(--bg-deepest) 30%, var(--bg-main));

  /* Text */
  --text-on-dark: #ffffff;
  --text-on-dark-soft: rgba(255, 255, 255, 0.72);
  --text-on-light: rgb(4, 39, 54);
  --text-body: rgb(70, 70, 70);

  /* Surfaces & borders (subtle on purpose) */
  --glass: rgba(255, 255, 255, 0.04);
  --glass-strong: rgba(255, 255, 255, 0.07);
  --glass-border: rgba(255, 255, 255, 0.1);
  --border-light: rgb(225, 232, 236);
  --border-dark: rgb(74, 109, 124);
  --header-bg: rgba(4, 39, 54, 0.82);
  --shadow: rgba(4, 39, 54, 0.35);
  --shadow-light: rgba(4, 39, 54, 0.1);

  /* Buttons */
  --btn-primary-bg: #ffffff;
  --btn-primary-text: var(--bg-deepest);
  --btn-primary-hover-bg: var(--primary-light);

  /* Effects */
  --gradient-text: linear-gradient(
    180deg,
    #ffffff 45%,
    rgba(255, 255, 255, 0.7)
  );
  --blur: blur(18px);

  /* Typography */
  --font-heading: "Quicksand", sans-serif;
  --font-body: "Rubik", sans-serif;

  /* Layout */
  --header-height: 76px;
  --container: 1160px;
  --radius-s: 10px;
  --radius-m: 20px;
  --radius-l: 32px;
  --section-pad: clamp(80px, 11vw, 136px);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text-on-dark-soft);
  background: var(--bg-deepest);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
h1,
h2,
h3 {
  font-family: var(--font-heading);
  color: var(--text-on-dark);
  line-height: 1.06;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 {
  font-size: clamp(2.5rem, 5.4vw, 3.9rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
h2 {
  font-size: clamp(2rem, 4.2vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}
h3 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
p {
  margin: 0 0 1em;
  max-width: 58ch;
}
a {
  color: var(--primary-light);
  transition: color 0.2s;
}
a:hover {
  color: var(--text-on-dark);
}
img,
video,
svg {
  max-width: 100%;
  display: block;
}
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 4px;
  border-radius: 6px;
}
::selection {
  background: var(--primary-soft);
  color: var(--text-on-dark);
}
.container {
  width: min(var(--container), 100% - 40px);
  margin-inline: auto;
}
.section {
  position: relative;
  padding-block: var(--section-pad);
}
.section-head {
  margin-bottom: 60px;
  max-width: 620px;
}
.section-head p {
  font-size: 1.1rem;
}

/* FLOW: each section ends on the color the next one starts with
   hero (deepest>secondary) > video (secondary>mist>main) > features (main>mist)
   > screens (mist>secondary) > contact (secondary>deepest) > footer */

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 15px 28px;
  border-radius: 999px;
  font: 600 1rem var(--font-heading);
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    transform 0.3s var(--ease),
    background 0.3s,
    border-color 0.3s,
    box-shadow 0.3s;
}
.btn-primary {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}
.btn-primary:hover {
  background: var(--btn-primary-hover-bg);
  color: var(--btn-primary-text);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(23, 189, 244, 0.28);
}
.btn:active {
  transform: translateY(0) scale(0.98);
}
.btn-ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.22);
  color: var(--text-on-dark);
}
.btn-ghost:hover {
  color: var(--text-on-dark);
  background: var(--glass-strong);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-2px);
}

/* ---------- Header ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(160%) var(--blur);
  backdrop-filter: saturate(160%) var(--blur);
  border-bottom: 1px solid var(--glass-border);
  transition: box-shadow 0.3s;
}
.header.is-scrolled {
  box-shadow: 0 10px 30px var(--shadow);
}
.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font: 700 1.35rem var(--font-heading);
  letter-spacing: -0.03em;
  color: var(--text-on-dark);
  text-decoration: none;
  white-space: nowrap;
}
.logo:hover {
  color: var(--text-on-dark);
}
.logo-mark {
  flex: none;
  width: 38px;
  height: 38px;
  transition: transform 0.5s var(--ease);
}
.logo:hover .logo-mark {
  transform: rotate(-8deg) scale(1.06);
}
.logo-mark svg {
  width: 100%;
  height: 100%;
}
.nav {
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav a {
  position: relative;
  color: var(--text-on-dark-soft);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  white-space: nowrap;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 1px;
  background: var(--text-on-dark);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}
.nav a:hover {
  color: var(--text-on-dark);
}
.nav a:hover::after {
  transform: scaleX(1);
}
.lang-switch {
  display: flex;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  padding: 3px;
}
.lang-switch button {
  background: none;
  border: 0;
  color: var(--text-on-dark-soft);
  font: 600 0.8rem var(--font-heading);
  letter-spacing: 0.04em;
  padding: 6px 13px;
  border-radius: 999px;
  cursor: pointer;
  transition:
    background 0.25s,
    color 0.25s;
}
.lang-switch button[aria-pressed="true"] {
  background: var(--text-on-dark);
  color: var(--bg-deepest);
}
.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--glass-border);
  color: var(--text-on-dark);
  border-radius: var(--radius-s);
  padding: 8px 13px;
  font-size: 1.1rem;
  cursor: pointer;
}

/* ---------- Hero ---------- */
/* Fixed height + reserved text lines: switching language never moves the layout */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  align-content: center;
  min-height: clamp(680px, 90svh, 880px);
  padding-block: clamp(56px, 8vw, 110px);
  background: linear-gradient(180deg, var(--bg-deepest), var(--bg-secondary));
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(
      560px 400px at 90% 20%,
      rgba(23, 189, 244, 0.13),
      transparent 70%
    ),
    radial-gradient(
      520px 420px at 0% 35%,
      rgba(172, 197, 208, 0.1),
      transparent 70%
    );
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--glass) 1px, transparent 1px),
    linear-gradient(90deg, var(--glass) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(
    ellipse 70% 70% at 65% 45%,
    #000,
    transparent
  );
  mask-image: radial-gradient(ellipse 70% 70% at 65% 45%, #000, transparent);
}
.hero .container {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 72px;
  align-items: center;
}
.hero h1 {
  min-height: calc(3 * 1.06em);
  animation: rise 0.9s var(--ease) both;
}
.hero p {
  font-size: 1.15rem;
  min-height: calc(3 * 1.7em);
  animation: rise 0.9s 0.1s var(--ease) both;
}
.hero-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 14px;
  margin-top: 36px;
  animation: rise 0.9s 0.2s var(--ease) both;
}

/* Interactive dental chart */
.stage {
  padding: 34px 28px 26px;
  border-radius: var(--radius-l);
  background: linear-gradient(160deg, var(--glass-strong), var(--glass));
  border: 1px solid var(--glass-border);
  box-shadow:
    0 40px 80px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  display: grid;
  gap: 14px;
  animation: rise 1s 0.3s var(--ease) both;
}
.arch {
  display: flex;
  justify-content: center;
  gap: 6px;
}
.tooth-btn {
  flex: 1;
  max-width: 52px;
  padding: 4px 0 10px;
  background: none;
  border: 0;
  cursor: pointer;
  position: relative;
  transition: transform 0.35s var(--ease);
}
.tooth-btn:nth-child(4) {
  margin-right: 14px;
} /* midline */
.tooth-btn svg {
  width: 100%;
  fill: rgba(255, 255, 255, 0.9);
  stroke: rgba(4, 39, 54, 0.3);
  stroke-width: 1;
  transition:
    fill 0.3s,
    stroke 0.3s;
}
.tooth-btn.is-lower svg {
  transform: scaleY(-1);
}
.tooth-btn[data-status="treated"] svg {
  fill: var(--primary-light);
}
.tooth-btn[data-status="cavity"] svg {
  fill: var(--warning);
}
.tooth-btn:hover {
  transform: translateY(-4px);
}
.tooth-btn.is-lower:hover {
  transform: translateY(4px);
}
.tooth-btn[aria-pressed="true"] svg {
  stroke: var(--text-on-dark);
  stroke-width: 2.2;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.35));
}
.tooth-btn::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 0;
  height: 3px;
  border-radius: 3px;
  background: var(--primary);
  transform: translateX(-50%);
  transition: width 0.35s var(--ease);
}
.tooth-btn.is-lower::after {
  bottom: auto;
  top: 0;
}
.tooth-btn[aria-pressed="true"]::after {
  width: 18px;
}
.stage-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding-top: 18px;
  border-top: 1px solid var(--glass-border);
  color: var(--text-on-dark);
  font-family: var(--font-heading);
  font-weight: 600;
}
.stage-tooth b {
  color: var(--primary-light);
  font-size: 1.25rem;
  font-variant-numeric: tabular-nums;
}
.pill {
  padding: 5px 14px;
  border-radius: 999px;
  font: 500 0.85rem var(--font-body);
  white-space: nowrap;
  background: var(--glass-strong);
  color: var(--text-on-dark);
  transition:
    background 0.3s,
    color 0.3s;
}
.pill[data-status="cavity"] {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf4d;
}
.pill[data-status="treated"] {
  background: rgba(100, 195, 250, 0.18);
  color: var(--primary-light);
}

/* ---------- Video: secondary > mist > main ---------- */
.video {
  background: linear-gradient(
    180deg,
    var(--bg-secondary) 0,
    var(--bg-secondary) 250px,
    var(--mist) calc(100% - 120px),
    var(--bg-main) 100%
  );
}
.video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-l);
  border: 1px solid var(--glass-border);
  background: var(--bg-deepest);
  box-shadow: 0 50px 90px var(--shadow);
  overflow: hidden;
}
.video-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.video-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  color: var(--text-on-dark-soft);
  background: radial-gradient(
    circle at 50% 45%,
    var(--bg-dark),
    var(--bg-deepest) 75%
  );
  pointer-events: none;
}
.play-icon {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: var(--text-on-dark);
  display: grid;
  place-items: center;
  box-shadow: 0 10px 30px var(--shadow);
  animation: pulse 3s ease-out infinite;
}
.play-icon::after {
  content: "";
  border-left: 22px solid var(--bg-deepest);
  border-block: 13px solid transparent;
  margin-left: 6px;
}
@keyframes pulse {
  0% {
    box-shadow:
      0 10px 30px var(--shadow),
      0 0 0 0 rgba(255, 255, 255, 0.35);
  }
  70%,
  100% {
    box-shadow:
      0 10px 30px var(--shadow),
      0 0 0 28px rgba(255, 255, 255, 0);
  }
}
.video-frame.has-video .video-placeholder {
  display: none;
}

/* ---------- Features: main > mist (asymmetric grid, light + dark cards) ---------- */
.features {
  background: linear-gradient(
    180deg,
    var(--bg-main) 0,
    var(--bg-main) calc(100% - 220px),
    var(--mist) 100%
  );
  color: var(--text-body);
}
.features h2,
.features h3 {
  color: var(--text-on-light);
}
.feature-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 18px;
}
.feature {
  position: relative;
  overflow: hidden;
  grid-column: span 2;
  min-height: 250px;
  padding: 34px 30px;
  border-radius: var(--radius-m);
  background: var(--bg-light);
  border: 1px solid var(--border-light);
  transition:
    transform 0.45s var(--ease),
    box-shadow 0.45s var(--ease);
}
.feature:nth-child(1),
.feature:nth-child(4) {
  grid-column: span 4;
}
.feature:nth-child(5),
.feature:nth-child(6) {
  grid-column: span 3;
}
.feature::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  background: radial-gradient(
    340px circle at var(--mx, 50%) var(--my, 50%),
    rgba(23, 189, 244, 0.13),
    transparent 65%
  );
  transition: opacity 0.4s;
}
.feature:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 44px var(--shadow-light);
}
.feature:hover::before {
  opacity: 1;
}
.feature > * {
  position: relative;
}
.feature-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--bg-main);
  color: var(--primary-dark);
  display: grid;
  place-items: center;
  margin-bottom: 28px;
}
.feature-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.feature p {
  margin: 0;
  font-size: 0.98rem;
}
.feature:nth-child(1),
.feature:nth-child(4) {
  background: linear-gradient(160deg, var(--bg-secondary), var(--bg-deepest));
  border-color: var(--glass-border);
  color: var(--text-on-dark-soft);
}
.features .feature:nth-child(1) h3,
.features .feature:nth-child(4) h3 {
  color: var(--text-on-dark);
  font-size: 1.4rem;
}
.feature:nth-child(1) .feature-icon,
.feature:nth-child(4) .feature-icon {
  background: var(--glass-strong);
  color: var(--primary-light);
}
.feature:nth-child(1):hover,
.feature:nth-child(4):hover {
  box-shadow: 0 22px 44px var(--shadow);
}

/* ---------- Screenshots: mist > secondary ---------- */
.screens {
  background: linear-gradient(
    180deg,
    var(--mist) 0,
    var(--mist) 230px,
    var(--bg-secondary) 100%
  );
  color: var(--text-body);
}
.screens h2 {
  color: var(--text-on-light);
}
.screen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}
.screen {
  margin: 0;
  padding: 14px 14px 18px;
  border-radius: var(--radius-m);
  background: linear-gradient(160deg, var(--bg-dark), var(--bg-deepest));
  border: 1px solid var(--glass-border);
  box-shadow: 0 24px 50px var(--shadow);
  transition: transform 0.5s var(--ease);
}
.screen::before {
  content: "";
  display: block;
  width: 48px;
  height: 10px;
  margin: 2px 4px 12px;
  background: radial-gradient(
      circle at 5px 5px,
      var(--border-dark) 4px,
      transparent 5px
    )
    0 0 / 16px 10px repeat-x;
}
.screen:hover {
  transform: translateY(-5px);
}
.screen-img {
  aspect-ratio: 16 / 10;
  background: var(--glass);
  border-radius: var(--radius-s);
  display: grid;
  place-items: center;
  color: var(--text-on-dark-soft);
  overflow: hidden;
}
.screen-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.screen figcaption {
  margin: 14px 4px 0;
  color: var(--text-on-dark);
  font: 600 1rem var(--font-heading);
}

/* ---------- Contact: secondary > deepest (heading left, rows right) ---------- */
.contact {
  background: linear-gradient(180deg, var(--bg-secondary), var(--bg-deepest));
}
.contact .container {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 80px;
  align-items: center;
}
.contact .section-head {
  margin: 0;
}
.contact-grid {
  display: grid;
  gap: 14px;
}
.contact-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 26px 30px;
  border-radius: var(--radius-m);
  background: rgba(255, 255, 255, 0.95);
  color: var(--text-body);
  transition:
    transform 0.4s var(--ease),
    box-shadow 0.4s var(--ease);
}
.contact-card:hover {
  transform: translateX(-6px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.25);
}
.contact-card h3 {
  color: var(--text-on-light);
  margin: 0;
}
.contact-card a {
  color: var(--primary-dark);
  font-weight: 500;
  font-size: 1.05rem;
  text-align: right;
  word-break: break-word;
}
.contact-card a:hover {
  color: var(--text-on-light);
}

/* ---------- Footer ---------- */
.footer {
  background: var(--bg-deepest);
  border-top: 1px solid var(--glass-border);
  color: var(--text-on-dark-soft);
  padding-block: 32px;
  font-size: 0.9rem;
}

/* ---------- Entrance (hero only) ---------- */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .feature,
  .feature:nth-child(n) {
    grid-column: span 1;
    min-height: 0;
  }
  .feature:nth-child(1),
  .feature:nth-child(4) {
    grid-column: span 2;
  }
}
@media (max-width: 860px) {
  .hero {
    min-height: 0;
  }
  .hero .container {
    grid-template-columns: 1fr;
    gap: 56px;
  }
  .hero p {
    min-height: calc(4 * 1.7em);
  }
  .contact .container {
    grid-template-columns: 1fr;
    gap: 48px;
  }
  .menu-toggle {
    display: block;
  }
  .nav {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    padding: 24px 20px;
    background: var(--header-bg);
    -webkit-backdrop-filter: var(--blur);
    backdrop-filter: var(--blur);
    border-bottom: 1px solid var(--glass-border);
  }
  .nav.is-open {
    display: flex;
  }
}
@media (max-width: 600px) {
  .feature-grid {
    grid-template-columns: 1fr;
  }
  .feature:nth-child(n) {
    grid-column: span 1;
  }
  .stage {
    padding: 26px 14px 20px;
  }
  .arch {
    gap: 3px;
  }
  .tooth-btn:nth-child(4) {
    margin-right: 8px;
  }
}
@media (max-width: 480px) {
  .hero-actions {
    flex-direction: column;
  }
  .hero-actions .btn {
    width: 100%;
  }
  .contact-card {
    flex-direction: column;
    align-items: flex-start;
  }
  .contact-card a {
    text-align: left;
  }
}
