/*
 * Royal City Clinic: every style on the site, in one file.
 *
 * 1. Design tokens: colours, shadows, heading sizes. Change a colour here and the whole site
 *    follows. Nowhere else in this file uses a hex code.
 * 2. Base: font, resets.
 * 3. Shared parts: header, buttons, sections, headings, cards, footer, booking band.
 * 4. Page sections, in the order they appear on the site.
 * 5. Motion: scroll animations, page transitions, reduced motion.
 *
 * Layout uses logical properties (margin-inline-start, inset-inline …) so an Arabic version
 * can mirror the page. Breakpoints: 640px (sm), 768px (md), 1024px (lg), 1280px (xl).
 */

/* ---- 1. Design tokens ----------------------------------------------------------------- */

:root {
  /* Primary: the brand blue. Hero, page intros, the Doctors band, footer, dark buttons. */
  --primary: #1f487e;
  --primary-deep: #0d2033;
  --primary-light: #5c899b; /* Adriatic blue; the middle of the brand gradient. */

  /* Secondary: the accent. Main buttons, labels above headings, links, icons, booking band. */
  --secondary: #4c956c;
  --secondary-deep: #1f6d63;
  --secondary-light: #5bbcae; /* Labels and dots on blue backgrounds. */
  --secondary-tint: #e4efec; /* Icon badges on white. */

  /* Text and backgrounds. */
  --ink: #10243b;
  --white: #ffffff;
  --background: #fbfaf7; /* The page behind everything. */
  --surface: #faf5f3; /* Header, menu and the light section bands. */
  --placeholder: #dfe4e0;

  --shadow-card: 0 4px 18px color-mix(in srgb, var(--surface) 1%, transparent);
  --shadow-card-hover: 0 6px 24px color-mix(in srgb, var(--surface) 1%, transparent);
  --shadow-nav: 0 8px 30px color-mix(in srgb, var(--primary) 14%, transparent);

  /* Heading sizes on phones and tablets; wider screens below. */
  --text-h1: 24px;
  --text-h2: 24px;
  --text-h3: 18px;
  --text-h5: 13px;

  /* The one easing for everything that moves, and the gentle overshoot for pop-ins. */
  --ease-smooth: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-pop: cubic-bezier(0.34, 1.25, 0.64, 1);
}

@media (min-width: 64rem) {
  :root {
    --text-h1: 42px;
    --text-h2: 33px;
  }
}

/* ---- 2. Base -------------------------------------------------------------------------- */

/* Licensed for this website only; never copy the font file elsewhere. */
@font-face {
  font-family: "Satoshi";
  src: url("../fonts/Satoshi-Variable.woff2") format("woff2");
  font-weight: 300 900;
  font-display: swap;
}

*,
::before,
::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: 0 solid;
}

html {
  line-height: 1.5;
  font-family: "Satoshi", ui-sans-serif, system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--background);
  color: var(--ink);
}

h1,
h2,
h3 {
  font-size: inherit;
  font-weight: inherit;
}

h1 {
  font-size: var(--text-h1);
}

h2 {
  font-size: var(--text-h2);
}

h3 {
  font-size: var(--text-h3);
}

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

ul {
  list-style: none;
}

img,
svg,
video,
iframe {
  display: block;
  max-width: 100%;
}

img,
video {
  height: auto;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
  background: transparent;
}

[hidden] {
  display: none !important;
}

main {
  /* Clips the sideways scroll animations, so they never add a horizontal scrollbar. */
  overflow-x: clip;
}

.center {
  text-align: center;
}

.skip-link {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link:focus {
  position: fixed;
  top: 16px;
  inset-inline-start: 16px;
  z-index: 50;
  width: auto;
  height: auto;
  clip-path: none;
  border-radius: 8px;
  background: var(--white);
  padding: 8px 16px;
  font-weight: 600;
  box-shadow: var(--shadow-nav);
}

/* ---- 3. Shared parts ------------------------------------------------------------------ */

/* Header: a floating bar that stays at the top. */
.header {
  position: sticky;
  top: 0;
  z-index: 40;
  padding: 16px 20px 0;
}

.header-bar {
  display: flex;
  height: 70px;
  align-items: center;
  justify-content: space-between;
  border-radius: 16px;
  background: var(--surface);
  padding: 0 22px;
  box-shadow: var(--shadow-nav);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  line-height: 1.05;
}

.brand img {
  width: 31px;
  height: 36px;
}

.brand-name {
  display: block;
  font-size: 18px;
  line-height: 1.5556;
  font-weight: 700;
}

.brand-tagline {
  display: block;
  margin-top: 2px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--secondary);
}

.nav {
  display: none;
  align-items: center;
  gap: 24px;
  font-size: 13.5px;
  font-weight: 500;
  color: color-mix(in oklab, var(--ink) 72%, transparent);
}

.nav a {
  transition: color 0.15s;
}

.nav a:hover {
  color: var(--secondary);
}

.nav a[aria-current="page"] {
  font-weight: 600;
  color: var(--ink);
}

.header-bar .header-book {
  display: none;
}

.menu-button {
  display: flex;
  width: 44px;
  height: 44px;
  margin-inline-end: -10px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.menu-button span {
  width: 24px;
  height: 2px;
  background: var(--primary);
}

/* The phone menu is a native popover: it opens, closes on Escape and closes on an outside tap
   with no JavaScript. Layout only while open, or it would never hide. */
.menu {
  inset-inline: 20px;
  top: 94px;
  bottom: auto;
  margin: 0;
  width: auto;
  height: auto;
  border-radius: 16px;
  border: 0;
  background: var(--surface);
  padding: 24px;
  color: color-mix(in oklab, var(--ink) 72%, transparent);
  box-shadow: var(--shadow-nav);
  font-size: 14px;
  line-height: 1.4286;
  font-weight: 500;
}

.menu:popover-open {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.menu a:not(.btn) {
  margin-block: -8px;
  padding-block: 8px;
}

.menu a[aria-current="page"] {
  font-weight: 600;
  color: var(--ink);
}

@media (min-width: 80rem) {
  .nav {
    display: flex;
  }
  .header-bar .header-book {
    display: inline-flex;
  }
  .menu-button,
  .menu,
  .menu:popover-open {
    display: none;
  }
}

/* A 2px underline that grows from the start on hover and keyboard focus, and stays under the
   current page's link. */
.nav a,
.footer a {
  position: relative;
}

.nav a::after,
.footer a::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: -5px;
  height: 2px;
  border-radius: 1px;
  background: var(--link-underline, var(--secondary));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease-smooth);
}

.nav a:dir(rtl)::after,
.footer a:dir(rtl)::after {
  transform-origin: right;
}

.nav a:hover::after,
.nav a:focus-visible::after,
.nav a[aria-current="page"]::after,
.footer a:hover::after,
.footer a:focus-visible::after {
  transform: scaleX(1);
}

/* Buttons: links styled as buttons. .btn is the green one. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  background: var(--secondary);
  padding: 14px 26px;
  font-size: 14px;
  line-height: 1.4286;
  font-weight: 600;
  color: var(--white);
  transition-property: color, background-color, translate, box-shadow;
  transition-duration: 0.2s;
  transition-timing-function: var(--ease-smooth);
}

.btn:hover {
  background: var(--secondary-deep);
  translate: 0 -2px;
  box-shadow: var(--shadow-card-hover);
}

.btn:active {
  translate: 0 0;
}

.btn:focus-visible {
  outline: 2px solid var(--secondary);
  outline-offset: 2px;
}

.btn-dark {
  background: var(--primary);
}

.btn-dark:hover {
  background: var(--primary-deep);
}

.btn-outline {
  border: 1.5px solid color-mix(in oklab, var(--white) 28%, transparent);
  background: transparent;
}

.btn-outline:hover {
  background: color-mix(in oklab, var(--white) 10%, transparent);
}

.btn-sm {
  border-radius: 10px;
  padding: 11px 20px;
  font-size: 13px;
  line-height: 1.5;
}

.menu .btn {
  display: flex;
}

/* Sections. .section sits on the page; .band is a rounded panel. */
.section {
  padding: 64px 24px 56px;
}

.band {
  margin-inline: 20px;
  border-radius: 20px;
  padding: 56px 24px;
}

.band-surface {
  background: var(--surface);
}

.band-primary {
  background-color: var(--primary);
  color: var(--white);
}

/* The brand gradient: blue, then Adriatic blue, then teal towards the far corner. */
.band-gradient {
  background-image: linear-gradient(
    in oklab to bottom right,
    var(--primary) 30%,
    var(--primary-light) 70%,
    var(--secondary-light) 100%
  );
}

.band-gradient:dir(rtl) {
  background-image: linear-gradient(
    in oklab to bottom left,
    var(--primary) 30%,
    var(--primary-light) 70%,
    var(--secondary-light) 100%
  );
}

.band-cta {
  margin: 20px;
  padding-block: 58px;
  background-image: linear-gradient(120deg, var(--secondary), var(--secondary-deep));
  color: var(--white);
}

@media (min-width: 64rem) {
  .section,
  .band {
    padding-inline: 46px;
  }
}

/* Two columns side by side on wide screens: photo and text. */
.split {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 44px;
}

/* Card grids. */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
}

.gap-20 {
  gap: 20px;
}

@media (min-width: 40rem) {
  .grid-4,
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 48rem) {
  .grid-md-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 64rem) {
  .grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* The label, heading and intro sentence at the top of a section. */
.heading {
  margin-bottom: 40px;
  text-align: center;
}

.heading-compact {
  margin-bottom: 38px;
}

.eyebrow {
  margin-bottom: 12px;
  font-size: 12px;
  line-height: 1.3333;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--secondary);
}

.heading h1,
.heading h2 {
  font-weight: 600;
  color: var(--ink);
}

.lead {
  margin: 12px auto 0;
  max-width: 520px;
  font-size: 14.5px;
  line-height: 1.6;
  color: color-mix(in oklab, var(--ink) 60%, transparent);
}

.heading-compact .lead {
  font-size: 14px;
}

.light .eyebrow {
  color: var(--secondary-light);
}

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

.light .lead {
  color: color-mix(in oklab, var(--white) 70%, transparent);
}

/* Body text. */
.text {
  font-size: 14.5px;
  line-height: 1.65;
  color: color-mix(in oklab, var(--ink) 62%, transparent);
}

.band-primary .text {
  color: color-mix(in oklab, var(--white) 70%, transparent);
}

.small {
  font-size: 13px;
  line-height: 1.55;
  color: color-mix(in oklab, var(--ink) 55%, transparent);
}

/* Cards lift on hover; a photo inside a .card-media zooms a little. */
.card {
  border-radius: 14px;
  background: var(--white);
  box-shadow: var(--shadow-card);
  transition-property: box-shadow, translate;
  transition-duration: 0.3s;
  transition-timing-function: var(--ease-smooth);
}

.card:hover {
  translate: 0 -4px;
  box-shadow: var(--shadow-card-hover);
}

.card-bordered {
  border: 1px solid color-mix(in oklab, var(--ink) 7%, transparent);
  box-shadow: none;
}

.card-media {
  overflow: hidden;
  border-radius: 16px;
}

.card-media > img {
  width: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease-smooth);
}

.card-media:hover > img {
  transform: scale(1.05);
}

.card h2,
.card h3 {
  font-size: var(--text-h3);
  font-weight: 700;
}

/* A medical icon on a tinted badge. The wrapper keeps the space under it. */
.icon {
  margin-bottom: 16px;
}

.badge {
  display: inline-flex;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--secondary-tint);
  color: var(--secondary);
  transition: background-color 0.3s, color 0.3s;
}

.badge svg {
  width: 21px;
  height: 21px;
  fill: currentColor;
}

.card:hover .badge {
  background: var(--secondary);
  color: var(--white);
}

.badge-lg {
  width: 46px;
  height: 46px;
  border-radius: 9999px;
}

.badge-lg svg {
  width: 24px;
  height: 24px;
}

.badge-dark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: color-mix(in oklab, var(--white) 10%, transparent);
  color: var(--secondary-light);
}

.badge-dark svg {
  width: 16px;
  height: 16px;
}

/* Short labels as white chips with a dot (branches, departments). */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.chips li {
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 10px;
  border: 1px solid color-mix(in oklab, var(--ink) 10%, transparent);
  background: var(--white);
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.chips li::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 9999px;
  background: var(--secondary);
}

.chips-center {
  margin-inline: auto;
  max-width: 860px;
  justify-content: center;
}

/* The blue band that opens most pages: a label, the page's title, a sentence. */
.page-intro {
  margin-top: 20px;
}

.page-intro .eyebrow,
.about-intro .eyebrow,
.promise .eyebrow,
.about-home .eyebrow {
  margin-bottom: 14px;
}

.page-intro .eyebrow,
.about-intro .eyebrow,
.promise .eyebrow {
  color: var(--secondary-light);
}

.page-intro h1,
.about-intro h1 {
  margin-bottom: 22px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.intro-text {
  max-width: 560px;
  font-size: 14.5px;
  line-height: 1.65;
  color: color-mix(in oklab, var(--white) 70%, transparent);
}

/* Article text: departments, privacy policy, terms. */
.prose {
  margin-inline: auto;
  max-width: 680px;
  font-size: 16px;
  line-height: 1.75;
  color: color-mix(in oklab, var(--ink) 75%, transparent);
}

.prose p {
  margin-bottom: 20px;
}

.prose h2 {
  margin: 40px 0 16px;
  line-height: 1.25;
  font-weight: 600;
  color: var(--ink);
}

.prose ul {
  margin-bottom: 24px;
  list-style: disc;
  padding-inline-start: 24px;
}

.prose li + li {
  margin-top: 8px;
}

.prose li::marker {
  color: var(--secondary);
}

/* Doctor cards. */
.doctor > img {
  aspect-ratio: 1;
}

.doctor-body {
  padding: 18px 20px;
  color: var(--ink);
}

.doctor-specialty {
  margin-top: 3px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--secondary);
}

.doctor-qualifications {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.5;
  color: color-mix(in oklab, var(--ink) 55%, transparent);
}

/* The booking band at the bottom of every page. */
.booking {
  display: grid;
  align-items: center;
  gap: 44px;
  scroll-margin-top: 96px;
}

.booking .eyebrow {
  margin-bottom: 16px;
  color: color-mix(in oklab, var(--white) 75%, transparent);
}

.booking h2 {
  margin-bottom: 16px;
  line-height: 1.12;
  font-weight: 600;
}

.booking-text {
  max-width: 330px;
  font-size: 15px;
  line-height: 1.65;
  color: color-mix(in oklab, var(--white) 80%, transparent);
}

.booking-box {
  border-radius: 16px;
  background: color-mix(in oklab, var(--white) 14%, transparent);
  padding: 24px;
}

.booking-box > p {
  margin-bottom: 20px;
  font-size: 15px;
  line-height: 1.6;
  color: color-mix(in oklab, var(--white) 90%, transparent);
}

.booking-actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.booking .btn {
  display: flex;
  border-radius: 9px;
  padding: 15px 24px;
}

/* White focus ring: the green one is invisible on this band. */
.booking .btn:focus-visible {
  outline-color: var(--white);
}

@media (min-width: 40rem) {
  .booking-actions {
    flex-direction: row;
  }
}

@media (min-width: 64rem) {
  .booking {
    grid-template-columns: 1fr 1.2fr;
  }
  .booking-box {
    padding: 32px;
  }
}

/* Footer. */
.footer {
  background: var(--primary);
  padding: 48px 24px 30px;
  color: color-mix(in oklab, var(--white) 66%, transparent);
  --link-underline: var(--secondary-light);
}

.footer a {
  transition: color 0.15s;
}

.footer a:hover {
  color: var(--white);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
  border-bottom: 1px solid color-mix(in oklab, var(--white) 10%, transparent);
  padding-bottom: 34px;
}

.footer-about {
  grid-column: span 2;
}

.footer-brand {
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 18px;
  line-height: 1.5556;
  font-weight: 700;
  color: var(--white);
}

.footer-about > p:last-child {
  max-width: 280px;
  font-size: 13px;
  line-height: 1.6;
}

.footer-col h2 {
  margin-bottom: 14px;
  font-size: var(--text-h5);
  font-weight: 700;
  color: var(--white);
}

.footer-col div {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 9px;
  font-size: 13px;
}

.footer-bottom {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  padding-top: 20px;
  font-size: 12px;
  line-height: 1.3333;
}

@media (min-width: 40rem) {
  .footer-bottom {
    flex-direction: row;
  }
}

@media (min-width: 64rem) {
  .footer {
    padding-inline: 46px;
  }
  .footer-grid {
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
  }
  .footer-about {
    grid-column: span 1;
  }
}

/* ---- 4. Page sections ----------------------------------------------------------------- */

/* Home: hero. The photos fill the hero and melt into the blue behind the text. */
.hero {
  position: relative;
  margin-top: 16px;
  display: flex;
  flex-direction: column;
}

.hero-text {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  background: var(--primary);
  padding: 64px 20px 24px;
}

.hero-eyebrow {
  margin-bottom: 22px;
  align-self: flex-start;
  border-radius: 9999px;
  background: color-mix(in oklab, var(--secondary-light) 14%, transparent);
  padding: 6px 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--secondary-light);
}

.hero h1 {
  margin-bottom: 22px;
  line-height: 1.07;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--white);
}

.hero-lead {
  margin-bottom: 26px;
  max-width: 400px;
  font-size: 16px;
  line-height: 1.65;
  color: color-mix(in oklab, var(--white) 85%, transparent);
}

.hero-pills {
  margin-bottom: 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.hero-pills li {
  border-radius: 9999px;
  border: 1px solid color-mix(in oklab, var(--white) 22%, transparent);
  padding: 7px 14px;
  font-size: 12px;
  line-height: 1.3333;
  font-weight: 500;
  color: color-mix(in oklab, var(--white) 85%, transparent);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.hero-actions .btn-outline {
  padding-inline: 24px;
}

.hero-media {
  position: relative;
  isolation: isolate;
  height: 300px;
}

/* Photos cross-fade every 10 seconds (js/main.js). The incoming one fades in on top; the
   outgoing one hides only afterwards, so the background never shows through. */
.slideshow {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.slideshow img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1s cubic-bezier(0.4, 0, 0.2, 1) 1s;
}

.slideshow img.is-active {
  z-index: 10;
  opacity: 1;
  transition-delay: 0s;
}

/* The blue fading into the photo: top to bottom on small screens, from the start side on
   large ones. Eased stops, so the fade has no visible edge. */
.hero-fade {
  --fade-direction: to bottom;
  --fade-from: 0%;
  --fade-to: 80%;
  --fade-span: calc(var(--fade-to) - var(--fade-from));
  position: absolute;
  inset: 0;
  z-index: 20;
  background-image: linear-gradient(
    var(--fade-direction),
    var(--primary) var(--fade-from),
    color-mix(in oklab, var(--primary) 96%, transparent) calc(var(--fade-from) + var(--fade-span) * 0.125),
    color-mix(in oklab, var(--primary) 84%, transparent) calc(var(--fade-from) + var(--fade-span) * 0.25),
    color-mix(in oklab, var(--primary) 68%, transparent) calc(var(--fade-from) + var(--fade-span) * 0.375),
    color-mix(in oklab, var(--primary) 50%, transparent) calc(var(--fade-from) + var(--fade-span) * 0.5),
    color-mix(in oklab, var(--primary) 32%, transparent) calc(var(--fade-from) + var(--fade-span) * 0.625),
    color-mix(in oklab, var(--primary) 16%, transparent) calc(var(--fade-from) + var(--fade-span) * 0.75),
    color-mix(in oklab, var(--primary) 4%, transparent) calc(var(--fade-from) + var(--fade-span) * 0.875),
    transparent var(--fade-to)
  );
}

@media (min-width: 64rem) {
  .hero {
    min-height: max(560px, calc(100svh - 102px));
    flex-direction: row;
    align-items: center;
  }
  .hero-text {
    max-width: 640px;
    background: transparent;
    padding: 64px 46px;
  }
  .hero-media {
    position: absolute;
    inset: 0;
    height: auto;
  }
  .hero-fade {
    --fade-direction: to right;
    --fade-from: 30%;
    --fade-to: 90%;
  }
  .hero-fade:dir(rtl) {
    --fade-direction: to left;
  }
}

/* Home: about, with the video. */
.about-home {
  padding: 64px 20px;
  scroll-margin-top: 96px;
}

.about-home h2,
.promise h2 {
  margin-bottom: 18px;
  line-height: 1.15;
  font-weight: 600;
}

.about-home .text,
.about-intro .text {
  margin-bottom: 14px;
  max-width: 520px;
}

.about-intro .text {
  max-width: 560px;
}

.about-home .text:last-of-type,
.about-intro .text:last-of-type {
  margin-bottom: 24px;
}

.about-home .chips {
  margin-bottom: 26px;
}

.about-home .btn {
  padding-block: 13px;
  font-size: 13.5px;
  line-height: 1.5;
}

.video {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border-radius: 16px;
}

.video img,
.video video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video video {
  opacity: 0;
  transition: opacity 0.7s;
}

.video video.is-started {
  opacity: 1;
}

.video-toggle {
  position: absolute;
  inset-inline-end: 16px;
  bottom: 16px;
  display: flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: color-mix(in oklab, var(--primary) 55%, transparent);
  color: var(--white);
  backdrop-filter: blur(8px);
  transition: background-color 0.15s;
}

.video-toggle:hover {
  background: color-mix(in oklab, var(--primary) 80%, transparent);
}

.video-toggle:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 2px;
}

.video-toggle svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

@media (min-width: 64rem) {
  .about-home {
    grid-template-columns: 1fr 1.1fr;
    padding-inline: 46px;
  }
}

/* Home: accreditations. */
.accreditations {
  margin-inline: auto;
  display: grid;
  max-width: 760px;
  gap: 20px;
}

.accreditation {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 26px 24px;
}

.accreditation img {
  width: 160px;
  height: 160px;
  flex-shrink: 0;
  object-fit: contain;
}

.accreditation h3 {
  margin-bottom: 7px;
}

@media (min-width: 40rem) {
  .accreditation {
    flex-direction: row;
    padding-inline: 32px;
  }
}

/* Home: services. */
.services {
  display: grid;
  gap: 22px;
}

.photo {
  position: relative;
  overflow: hidden;
}

.photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.services-photo {
  min-height: 280px;
  border-radius: 16px;
}

.services-cards {
  display: grid;
  gap: 16px;
}

.service {
  padding: 24px 22px;
}

.service h3 {
  margin-bottom: 8px;
  font-weight: 600;
}

.service .small {
  font-size: 12.5px;
}

@media (min-width: 40rem) {
  .services-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 64rem) {
  .services {
    grid-template-columns: repeat(2, 1fr);
  }
  .services-photo {
    min-height: 420px;
  }
}

/* Home: "Why Royal City" slider. A native scroll-snap row: it swipes on touch screens and
   scrolls with a trackpad or the arrow keys; js/main.js adds the arrows and dots. */
.carousel {
  margin-inline: auto;
  max-width: 1100px;
}

.carousel-track {
  display: flex;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  border-radius: 14px;
  border: 1px solid color-mix(in oklab, var(--ink) 7%, transparent);
  background: var(--white);
}

.carousel-track::-webkit-scrollbar {
  display: none;
}

.carousel-track:focus-visible {
  outline: 2px solid var(--secondary);
  outline-offset: 2px;
}

.slide {
  display: grid;
  width: 100%;
  flex-shrink: 0;
  scroll-snap-align: start;
}

.slide > img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

.slide-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 32px 24px;
}

.slide-text h3 {
  margin-bottom: 7px;
  font-weight: 700;
}

.slide-text .text {
  max-width: 420px;
}

.carousel-controls {
  margin-top: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.carousel-arrow {
  display: flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  border: 1px solid color-mix(in oklab, var(--ink) 12%, transparent);
  background: var(--white);
  color: var(--ink);
  transition: color 0.15s, border-color 0.15s;
}

.carousel-arrow:hover {
  border-color: var(--secondary);
  color: var(--secondary);
}

.carousel-arrow:disabled {
  pointer-events: none;
  opacity: 0.35;
}

.carousel-arrow svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.carousel-arrow svg:dir(rtl) {
  scale: -1 1;
}

.carousel-dots {
  display: flex;
}

.carousel-dots button {
  display: flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
}

.carousel-dots button::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background: color-mix(in oklab, var(--ink) 20%, transparent);
  transition: width 0.3s, background-color 0.3s;
}

.carousel-dots button[aria-current="true"]::before {
  width: 24px;
  background: var(--secondary);
}

.carousel-arrow:focus-visible,
.carousel-dots button:focus-visible {
  outline: 2px solid var(--secondary);
  outline-offset: 2px;
}

@media (min-width: 64rem) {
  .slide {
    grid-template-columns: 1fr 1fr;
  }
  .slide > img {
    aspect-ratio: 4 / 3;
  }
  .slide-text {
    padding-inline: 48px;
  }
}

/* Home: insurer logos. Without JavaScript, or for visitors who prefer reduced motion, a
   wrapped row. js/main.js repeats them and makes them scroll left to right. */
.marquee-track {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

.marquee-track li {
  display: flex;
  height: 74px;
  width: 182px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid color-mix(in oklab, var(--ink) 8%, transparent);
  background: var(--white);
  padding: 0 20px;
}

.marquee-track img {
  height: 40px;
  width: 100%;
  object-fit: contain;
}

.marquee.is-moving {
  overflow: hidden;
  mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
}

.is-moving .marquee-track {
  width: max-content;
  flex-wrap: nowrap;
  gap: 14px;
  animation: marquee var(--duration, 63s) linear infinite;
}

.marquee.is-moving:hover .marquee-track {
  animation-play-state: paused;
}

/* Moves by exactly one copy (half the track, gaps included), so the loop is seamless. */
@keyframes marquee {
  from {
    transform: translateX(calc(-50% - 7px));
  }
  to {
    transform: translateX(0);
  }
}

/* About page. */
.about-intro {
  margin-block: 20px;
}

.about-intro > img,
.promise > img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 16px;
}

.statement > img {
  aspect-ratio: 16 / 9;
}

.statement-body {
  padding: 24px 28px 32px;
}

.statement h3 {
  margin-bottom: 8px;
  font-size: var(--text-h5);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--secondary);
}

.tagline {
  margin-bottom: 12px;
  font-size: 21px;
  line-height: 1.3;
  font-weight: 600;
}

.value,
.department,
.contact-card {
  padding: 26px 24px;
}

.value h3,
.department h2,
.contact-card h2 {
  margin-bottom: 7px;
}

.promise .text {
  margin-bottom: 24px;
  max-width: 520px;
}

.points {
  display: grid;
  gap: 12px;
}

.points li {
  display: flex;
  gap: 12px;
  font-size: 13.5px;
  line-height: 1.5;
  color: color-mix(in oklab, var(--white) 85%, transparent);
}

.points li::before {
  content: "";
  margin-top: 7px;
  width: 7px;
  height: 7px;
  flex-shrink: 0;
  border-radius: 9999px;
  background: var(--secondary-light);
}

@media (min-width: 40rem) {
  .points {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 64rem) {
  .about-intro {
    grid-template-columns: 1.1fr 1fr;
  }
  .promise {
    grid-template-columns: 1fr 1.1fr;
  }
}

/* Departments: the whole card is the link. */
.department {
  position: relative;
}

.department a {
  transition: color 0.15s;
}

.department:hover a {
  color: var(--secondary);
}

.department a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.department a:focus-visible {
  outline: none;
}

.department:has(a:focus-visible) {
  outline: 2px solid var(--secondary);
  outline-offset: 2px;
}

/* Contact page. */
.contact-card address {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  font-size: 14px;
  line-height: 1.4286;
  font-style: normal;
}

.contact-card address a,
.field-note a {
  font-weight: 600;
  color: var(--secondary);
  transition: color 0.15s;
}

.contact-card address a:hover,
.field-note a:hover {
  color: var(--secondary-deep);
}

.map {
  height: 360px;
  width: 100%;
  border-radius: 16px;
  border: 1px solid color-mix(in oklab, var(--ink) 7%, transparent);
}

@media (min-width: 48rem) {
  .map {
    grid-column: span 2;
  }
}

.contact-form {
  margin-inline: auto;
  display: grid;
  max-width: 720px;
  gap: 20px;
}

.field label {
  margin-bottom: 8px;
  display: block;
  font-size: 13px;
  font-weight: 600;
}

.field input,
.field textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid color-mix(in oklab, var(--ink) 15%, transparent);
  background: var(--white);
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.4286;
}

.field input:focus-visible,
.field textarea:focus-visible {
  outline: 2px solid var(--secondary);
  outline-offset: 2px;
}

.field-note {
  margin-top: 8px;
  font-size: 12.5px;
  color: color-mix(in oklab, var(--ink) 55%, transparent);
}

.field-note a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.form-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}

.form-actions .btn {
  border-radius: 10px;
  padding: 13px 24px;
}

.form-actions .btn:disabled {
  opacity: 0.6;
  translate: none;
  box-shadow: none;
}

.form-status {
  font-size: 14px;
  line-height: 1.4286;
}

@media (min-width: 40rem) {
  .contact-form {
    grid-template-columns: repeat(2, 1fr);
  }
  .field-wide,
  .form-actions {
    grid-column: 1 / -1;
  }
}

/* ---- 5. Motion ------------------------------------------------------------------------ */

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
}

@keyframes fade-out {
  to {
    opacity: 0;
  }
}

/* Page load: the hero text fades up line by line. */
.hero-text > * {
  animation: fade-up 1.1s var(--ease-smooth) both;
}

.hero-text > :nth-child(2) {
  animation-delay: 150ms;
}

.hero-text > :nth-child(3) {
  animation-delay: 300ms;
}

.hero-text > :nth-child(4) {
  animation-delay: 450ms;
}

.hero-text > :nth-child(5) {
  animation-delay: 600ms;
}

/* Scroll animations: js/main.js marks each [data-reveal] element below the fold "out", then
   "in" the first time it scrolls into view. data-reveal picks the entrance: up, pop, start
   (from the left in English) or end. Without JavaScript everything just shows. */
[data-reveal-state="out"] {
  opacity: 0;
}

[data-reveal-state="in"] {
  animation: reveal 1.2s var(--ease-smooth) var(--reveal-delay, 0s) both;
}

[data-reveal="pop"][data-reveal-state="in"] {
  animation-duration: 1s;
  animation-timing-function: var(--ease-pop);
}

[data-reveal="up"] {
  --reveal-y: 24px;
}

[data-reveal="pop"] {
  --reveal-scale: 0.92;
}

[data-reveal="start"] {
  --reveal-x: -40px;
}

[data-reveal="end"] {
  --reveal-x: 40px;
}

[data-reveal="start"]:dir(rtl) {
  --reveal-x: 40px;
}

[data-reveal="end"]:dir(rtl) {
  --reveal-x: -40px;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translate(var(--reveal-x, 0), var(--reveal-y, 0)) scale(var(--reveal-scale, 1));
  }
}

/* Page transitions (browsers that support them): the old page fades out, the new one fades
   up. The header and footer stay put. */
@view-transition {
  navigation: auto;
}

main {
  view-transition-name: page;
}

.header {
  view-transition-name: header;
}

.footer {
  view-transition-name: footer;
}

::view-transition-old(page) {
  animation: 250ms ease-in both fade-out;
}

::view-transition-new(page) {
  animation: 700ms var(--ease-smooth) 150ms both fade-up;
}

/* One switch for visitors who prefer reduced motion, so no animation can forget it. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation-duration: 0s !important;
    animation-delay: 0s !important;
  }
}
