:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #f6f8f6;
  --surface-strong: #eef3ee;
  --text: #2e3235;
  --muted: #626a70;
  --line: #dde3df;
  --green: #278d17;
  --red: #ed1b12;
  --gold: #c9bb5f;
  --shadow: 0 14px 36px rgba(31, 38, 35, 0.08);
  --radius: 8px;
  --container: min(1180px, calc(100vw - 40px));
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Montserrat", Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

body.dark {
  color-scheme: dark;
  --bg: #151719;
  --surface: #202326;
  --surface-strong: #292d30;
  --text: #eef1ef;
  --muted: #b8bfbb;
  --line: #343a3f;
  --shadow: 0 16px 42px rgba(0, 0, 0, 0.28);
}

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

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

button,
input {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 22px;
  min-height: 74px;
  padding: 10px max(20px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  width: 154px;
  min-width: 154px;
}

.brand img {
  width: 154px;
  height: 52px;
  object-fit: contain;
}

.site-nav {
  display: flex;
  justify-content: center;
  gap: 4px;
}

.site-nav a {
  border-radius: var(--radius);
  padding: 10px 12px;
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
}

.site-nav a:hover,
.site-nav a.active {
  background: var(--surface);
  color: var(--green);
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 96px;
  height: 38px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.segmented button,
.theme-toggle,
.nav-toggle {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.segmented button {
  font-size: 12px;
  font-weight: 800;
}

.segmented button.active {
  background: var(--bg);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.08);
}

.theme-toggle,
.nav-toggle {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-weight: 800;
}

.nav-toggle {
  display: none;
}

.hero {
  min-height: clamp(540px, 78vh, 760px);
  display: flex;
  align-items: end;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.68), rgba(0, 0, 0, 0.2) 52%, rgba(0, 0, 0, 0.06)),
    url("../assets/images/photo_clinic.png") center / cover no-repeat;
  color: #ffffff;
}

.hero-content {
  width: var(--container);
  margin: 0 auto;
  padding: 0 0 clamp(58px, 9vw, 96px);
}

.hero h1 {
  max-width: 720px;
  margin: 8px 0 14px;
  font-size: clamp(40px, 7vw, 76px);
  line-height: 1;
  letter-spacing: 0;
}

.hero p {
  max-width: 620px;
  font-size: 20px;
}

.hero-actions,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 11px 16px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius);
  font-weight: 800;
}

.button.primary {
  border-color: var(--green);
  background: var(--green);
  color: #ffffff;
}

.button.ghost {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.page {
  min-height: calc(100vh - 146px);
}

.page-hero {
  width: var(--container);
  margin: 0 auto;
  padding: 70px 0 36px;
  border-bottom: 1px solid var(--line);
}

.page-hero h1,
.section h2 {
  margin: 6px 0 0;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.08;
  letter-spacing: 0;
}

.section {
  width: var(--container);
  margin: 0 auto;
  padding: 54px 0;
}

.section-heading {
  max-width: 780px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0;
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.lead {
  max-width: 900px;
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 19px;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--line);
  transform: translateY(-22px);
}

.summary-item {
  min-height: 118px;
  padding: 22px;
  background: var(--bg);
}

.summary-item span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.summary-item strong {
  display: block;
  font-size: 17px;
  line-height: 1.35;
}

.two-column,
.contact-layout {
  display: grid;
  grid-template-columns: minmax(240px, 0.72fr) minmax(0, 1.28fr);
  gap: clamp(30px, 6vw, 70px);
  align-items: start;
}

.mission-grid {
  display: grid;
  gap: 14px;
}

.mission-card,
.doctor-card,
.content-card,
.service-card,
.contact-panel,
.admin-item,
.patient-section,
.list-panel,
.note-list p {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  box-shadow: var(--shadow);
}

.mission-card {
  padding: 22px;
}

.mission-card h3,
.doctor-card h3,
.content-card h3,
.service-card h3,
.patient-section h2 {
  margin: 0 0 8px;
  font-size: 20px;
  line-height: 1.25;
}

.mission-card p,
.mission-card li,
.doctor-card p,
.content-card p,
.service-card p,
.patient-section p {
  color: var(--muted);
}

.mission-card ul,
.service-card ul {
  margin: 12px 0 0;
  padding-left: 20px;
}

.service-preview,
.service-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.service-card {
  padding: 20px;
}

.service-card h3 {
  font-size: 17px;
}

.text-link {
  display: inline-flex;
  margin-top: 20px;
  color: var(--green);
  font-weight: 900;
}

.doctor-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.doctor-card {
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
}

.doctor-photo {
  position: relative;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(135deg, var(--surface), var(--surface-strong));
  color: var(--muted);
  font-weight: 900;
}

.doctor-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 10px;
  object-fit: contain;
  background: var(--surface);
}

.doctor-body {
  padding: 18px;
}

.doctor-meta {
  display: grid;
  gap: 8px;
  margin: 12px 0;
  color: var(--muted);
  font-size: 14px;
}

.doctor-details {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
}

.doctor-details li {
  color: var(--muted);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
  background: var(--bg);
}

th,
td {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  text-transform: uppercase;
}

td {
  color: var(--muted);
}

.list-panel {
  padding: 22px;
}

.list-panel ul {
  columns: 2;
  margin: 0;
  padding-left: 20px;
}

.list-panel li {
  break-inside: avoid;
  margin-bottom: 10px;
  color: var(--muted);
}

.note-list {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.note-list p {
  margin: 0;
  padding: 16px 18px;
  color: var(--muted);
}

.content-card {
  overflow: hidden;
}

.content-card img,
.content-card video,
.content-card iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  object-fit: cover;
  background: var(--surface);
}

.content-card-body {
  padding: 18px;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
}

.patient-sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.patient-section {
  padding: 22px;
}

.patient-section ul {
  margin: 14px 0 0;
  padding-left: 20px;
  color: var(--muted);
}

.contact-layout {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.82fr);
}

.contact-panel {
  padding: 24px;
}

.contact-lines,
.admin-list {
  display: grid;
  gap: 12px;
}

.contact-line {
  display: grid;
  gap: 4px;
}

.contact-line span,
.admin-item span {
  color: var(--muted);
  font-size: 14px;
}

.contact-line a,
.contact-line strong {
  color: var(--text);
  font-weight: 900;
}

.map-panel {
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.map-panel iframe {
  width: 100%;
  height: 360px;
  border: 0;
}

.admin-item {
  padding: 16px;
  box-shadow: none;
}

.admin-item strong {
  display: block;
  line-height: 1.35;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  width: var(--container);
  margin: 0 auto;
  padding: 28px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 980px) {
  .site-header {
    grid-template-columns: auto 1fr auto auto;
  }

  .nav-toggle {
    display: grid;
    grid-column: 3;
  }

  .header-actions {
    grid-column: 4;
  }

  .site-nav {
    position: absolute;
    top: 74px;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    padding: 12px 20px 18px;
    border-bottom: 1px solid var(--line);
    background: var(--bg);
  }

  .site-nav.open {
    display: flex;
  }

  .header-actions {
    justify-self: end;
  }

  .summary-strip,
  .two-column,
  .contact-layout,
  .patient-sections {
    grid-template-columns: 1fr;
  }

  .service-preview,
  .service-grid,
  .doctor-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  :root {
    --container: min(100vw - 28px, 1180px);
  }

  .site-header {
    gap: 10px;
    min-height: 68px;
    padding-inline: 14px;
  }

  .brand,
  .brand img {
    width: 118px;
    min-width: 118px;
  }

  .brand img {
    height: 44px;
  }

  .site-nav {
    top: 68px;
  }

  .segmented {
    width: 86px;
  }

  .hero {
    min-height: 560px;
    background-position: center;
  }

  .hero p {
    font-size: 17px;
  }

  .page-hero {
    padding-top: 46px;
  }

  .section {
    padding: 38px 0;
  }

  .service-preview,
  .service-grid,
  .doctor-grid {
    grid-template-columns: 1fr;
  }

  .list-panel ul {
    columns: 1;
  }

  .table-wrap {
    overflow: visible;
    border: 0;
  }

  table {
    min-width: 0;
    background: transparent;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
    width: 100%;
  }

  thead {
    display: none;
  }

  tr {
    margin-bottom: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg);
    box-shadow: var(--shadow);
    overflow: hidden;
  }

  td {
    display: grid;
    grid-template-columns: minmax(92px, 34%) minmax(0, 1fr);
    gap: 12px;
    padding: 12px 14px;
    overflow-wrap: anywhere;
    border-bottom: 1px solid var(--line);
  }

  td::before {
    content: attr(data-label);
    color: var(--text);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
  }

  td:first-child {
    background: var(--surface);
    color: var(--text);
    font-weight: 900;
  }

  td:last-child {
    border-bottom: 0;
  }

  .site-footer {
    flex-direction: column;
  }
}
