/* RayMD — shared stylesheet */
:root {
  color-scheme: light;
  --bg: #f7faf9;
  --surface: #fff;
  --text: #18333a;
  --muted: #586e74;
  --accent: #167b80;
  --accent-hover: #106369;
  --border: #dce8e6;
  --shadow: 0 18px 40px rgba(22, 70, 78, 0.08);
  --radius: 16px;
  --page-max-width: 990px;
}

* { box-sizing: border-box; }

/* Reserve scrollbar space on both short and long pages to keep them aligned. */
html { scrollbar-gutter: stable; }

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  min-width: 280px;
  margin: 0;
  /* A subtle, shared wash of color, rather than a pronounced spot. */
  background: radial-gradient(circle at 15% 12%, rgba(22, 123, 128, 0.025), transparent 44%), var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.container { width: min(100% - 40px, var(--page-max-width)); margin: 0 auto; }

/* Shared branding/header: identical dimensions and alignment on both pages. */
.site-header { border-bottom: 1px solid var(--border); background: var(--surface); }
.header-inner {
  min-height: 90px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}
.brand { display: inline-flex; flex-direction: column; gap: 5px; color: inherit; text-decoration: none; }
.brand-name { font-size: 27px; font-weight: 750; line-height: 1; letter-spacing: -1.3px; }
.brand-name span { color: var(--accent); }
.brand-description { font-size: 11px; color: var(--muted); line-height: 1.4; }

/* Compact language link: the flag indicates the language of the target page. */
.header-actions { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.language-toggle {
  display: block;
  flex: none;
  width: 44px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 3px;
  overflow: hidden;
  background: transparent;
  cursor: pointer;
}
.language-toggle:hover { filter: brightness(.94); }
.language-flag {
  display: block;
  width: 100%;
  height: 100%;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
}
.contact-link:hover { background: var(--accent-hover); }
a:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }

.site-footer { margin-top: auto; flex-shrink: 0; border-top: 1px solid var(--border); padding: 10px 0; color: var(--muted); font-size: 11.5px; }

/* Discreet but always visible and directly accessible legal links. */
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 16px; }
.footer-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
.footer-links a { color: inherit; font: inherit; text-decoration: none; padding: 8px 0; }
/* Keep footer links visually unchanged on hover; keyboard focus uses the shared outline. */
.footer-links a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 3px; }

/* Imprint and privacy pages use the same header, width and footer. */
.legal-main { flex: 1; padding: 62px 0 90px; }
.legal-content { max-width: 800px; }
.legal-content h1 { margin: 0 0 30px; font-size: clamp(37px, 6vw, 52px); line-height: 1.1; font-weight: 650; letter-spacing: -.05em; }
.legal-content h2 { margin: 32px 0 10px; font-size: 19px; line-height: 1.4; font-weight: 650; letter-spacing: -.02em; }
.legal-content p { margin: 9px 0; font-size: 15px; line-height: 1.8; color: var(--muted); }
.legal-content strong { color: var(--text); }
.legal-content address { font-style: normal; line-height: 1.8; font-size: 15px; color: var(--muted); }
.legal-content a { color: var(--accent-hover); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.legal-content section { border-top: 1px solid var(--border); padding-top: 10px; margin-top: 20px; }
.legal-content section:first-of-type { margin-top: 0; }
.legal-content [hidden] { display: none !important; }

/* Homepage */
.home-main { flex: 1; padding: 74px 0 80px; }
.home-intro { max-width: 760px; margin-bottom: 76px; }
.eyebrow {
  margin: 0 0 16px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.home-main h1 {
  margin: 0;
  font-size: clamp(39px, 6vw, 60px);
  font-weight: 650;
  letter-spacing: -.055em;
  line-height: 1.1;
}
.intro-copy {
  max-width: 680px;
  margin: 21px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.75;
}
.section-heading {
  margin: 0 0 12px;
  font-size: clamp(26px, 4vw, 34px);
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -.035em;
}
.features { border-top: 1px solid var(--border); padding-top: 40px; }
#features-title { text-align: center; }
.feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 46px;
  align-items: center;
  padding: 34px 0;
  border-bottom: 1px solid var(--border);
}
.feature h3 { margin: 0; font-size: clamp(22px, 3vw, 28px); font-weight: 650; letter-spacing: -.035em; }
.feature p { max-width: 440px; margin: 14px 0 0; color: var(--muted); font-size: 16px; line-height: 1.7; }
.feature-media {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #edf4f3;
  box-shadow: 0 12px 28px rgba(22, 70, 78, 0.14);
}
.feature-media img,
.feature-media video { display: block; width: 100%; height: 100%; object-fit: cover; }
.feature-media--square { aspect-ratio: 1 / 1; }
.feature--image-left > .feature-media { grid-column: 1; grid-row: 1; }
.feature--image-left > div { grid-column: 2; grid-row: 1; }
.feature--gallery { grid-template-columns: 1fr; gap: 22px; align-items: start; }
.feature--gallery > div:first-child {
  width: min(100%, 820px);
  margin: 0 auto;
  text-align: center;
}
.feature--gallery > div:first-child p {
  max-width: 760px;
  margin: 14px auto 0;
}

/* The primary interior gallery and the labelled anatomy strip reveal as one visual group. */
.gallery-reveal-group {
  display: grid;
  gap: 22px;
  min-width: 0;
}
.feature--gallery .feature-gallery {
  display: flex;
  gap: 18px;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 2px 16px;
  scroll-snap-type: x mandatory;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(88, 110, 116, .38) transparent;
  -webkit-overflow-scrolling: touch;
}
.feature--gallery .feature-gallery::-webkit-scrollbar { height: 7px; }
.feature--gallery .feature-gallery::-webkit-scrollbar-track { background: transparent; }
.feature--gallery .feature-gallery::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(88, 110, 116, .30);
}
.feature--gallery .feature-gallery .feature-media {
  flex: 0 0 calc((100% - 36px) / 3);
  width: auto;
  max-width: none;
  aspect-ratio: 3 / 4;
  scroll-snap-align: center;
  scroll-snap-stop: always;
}
.interested { padding: 58px 0 0; }
.interested p { max-width: 590px; margin: 12px 0 26px; color: var(--muted); font-size: 16px; line-height: 1.7; }

/* Contact page */
.contact-main {
  flex: 1;
  display: grid;
  align-content: start;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  gap: 26px;
  padding: 54px 0 76px;
}
.content-panel, .form-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.content-panel {
  padding: 28px;
  background: linear-gradient(180deg, #fff 0%, #f3f9f8 100%);
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 26px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
}
.back-link:hover { text-decoration: underline; }
.contact-main .eyebrow { margin-bottom: 14px; letter-spacing: .14em; }
.contact-main h1 {
  margin: 0;
  font-size: clamp(30px, 4.5vw, 42px);
  font-weight: 660;
  line-height: 1.05;
  letter-spacing: -.05em;
}
.contact-intro { margin: 18px 0 0; color: var(--muted); font-size: 16px; line-height: 1.75; }
.form-panel { padding: 28px; }
.contact-main form { display: grid; gap: 22px; }
.contact-main label { display: grid; gap: 9px; font-size: 14px; font-weight: 650; }
.contact-main input, .contact-main textarea {
  width: 100%;
  border: 1px solid #c8d9d6;
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 16px;
}
.contact-main input { min-height: 50px; padding: 0 14px; }
.contact-main textarea { min-height: 180px; padding: 14px; line-height: 1.6; resize: vertical; }
.contact-main input:focus, .contact-main textarea:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(22, 123, 128, 0.16);
}
.contact-main button {
  justify-self: start;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: var(--surface);
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}
.contact-main button:hover { border-color: var(--accent-hover); background: var(--accent-hover); }
.note { margin: 18px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.status {
  display: none;
  margin: 0 0 22px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  background: #f0f8f7;
  font-size: 14px;
  line-height: 1.5;
}
.status[data-visible="true"] { display: block; }
.hidden-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

@media (max-width: 900px) {
  .contact-main { grid-template-columns: 1fr; }
}

@media (max-width: 690px) {
  /* On narrow screens, keep each portrait view large enough to inspect and
     retain horizontal scrolling instead of shrinking the images. */
  .feature--gallery .feature-gallery {
    gap: 12px;
    padding: 4px calc((100% - clamp(220px, 72vw, 300px)) / 2) 16px;
    scroll-padding-inline: calc((100% - clamp(220px, 72vw, 300px)) / 2);
  }
  .feature--gallery .feature-gallery .feature-media {
    flex-basis: clamp(220px, 72vw, 300px);
  }
  .header-inner { min-height: 84px; }
  .home-main { padding: 48px 0 60px; }
  .legal-main { padding: 42px 0 70px; }
  .home-intro { margin-bottom: 50px; }
  .feature { grid-template-columns: 1fr; gap: 20px; padding: 30px 0; }
  .feature--image-left > div { grid-column: 1; grid-row: 1; }
  .feature--image-left > .feature-media { grid-column: 1; grid-row: 2; }
  .feature-media { max-width: 540px; }
}

@media (max-width: 640px) {
  .header-inner { flex-wrap: wrap; padding: 14px 0; }
  .header-actions { gap: 8px; }
  .contact-main { padding-top: 34px; }
  .content-panel, .form-panel { padding: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .contact-main button { transition: none; }
}

/* Horizontally scrollable supplementary anatomy gallery. */
.anatomy-strip {
  display: flex;
  gap: 14px;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 3px 3px 16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(88, 110, 116, .38) transparent;
  scroll-snap-type: x mandatory;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}
.anatomy-strip::-webkit-scrollbar { height: 7px; }
.anatomy-strip::-webkit-scrollbar-track { background: transparent; }
.anatomy-strip::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(88, 110, 116, .30);
}
.anatomy-strip-item {
  /* Exactly five thumbnails fit at the site's maximum content width.
     This avoids a tiny initial offset when the third item is centered. */
  flex: 0 0 calc((100% - 56px) / 5);
  aspect-ratio: 4 / 3;
  overflow: hidden;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #edf4f3;
  box-shadow: 0 8px 20px rgba(22, 70, 78, .11);
  scroll-snap-align: center;
  scroll-snap-stop: always;
}
.anatomy-strip-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* All product images can be opened in a fullscreen viewer. */
.feature-media img,
.feature-media video,
.anatomy-strip-item img { cursor: zoom-in; }

.image-viewer {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  background: rgba(8, 18, 21, .94);
  cursor: zoom-out;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.image-viewer[hidden] { display: none; }
.image-viewer img,
.image-viewer video {
  display: block;
  max-width: 94vw;
  max-height: 94dvh;
  width: auto;
  height: auto;
  object-fit: contain;
  transform-origin: center center;
  will-change: transform;
  cursor: grab;
  -webkit-user-drag: none;
  user-select: none;
}
.image-viewer img:active,
.image-viewer video:active { cursor: grabbing; }
body.image-viewer-open { overflow: hidden; }

@media (max-width: 690px) {
  .anatomy-strip { gap: 10px; }
  .anatomy-strip-item { flex-basis: 150px; }
}


/* Contact-form error page returned directly by contact.php. */
.form-error-page {
  display: block;
  min-height: 100vh;
  padding: 36px 18px;
}
.form-error-main {
  width: min(100%, 650px);
  margin: 0 auto;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.form-error-main h1 {
  margin: 0 0 16px;
  font-size: clamp(26px, 5vw, 34px);
}
.form-error-main p {
  line-height: 1.65;
  color: var(--muted);
}
.form-error-main a {
  color: var(--accent-hover);
  font-weight: 600;
}
.form-error-main label {
  display: block;
  margin-top: 22px;
  font-size: 14px;
  font-weight: 600;
}
.form-error-main input,
.form-error-main textarea {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 12px;
  border: 1px solid #c7d9d7;
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}
.form-error-main textarea {
  min-height: 145px;
  resize: vertical;
  line-height: 1.6;
}
.form-error-main .back { display: inline-block; margin-top: 24px; }


/* Subtle scroll reveal. Content remains fully visible if JavaScript is unavailable. */
.reveal-enabled .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 500ms ease,
    transform 500ms cubic-bezier(.2, .7, .2, 1);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
.reveal-enabled .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal[data-reveal-delay="60"] { --reveal-delay: 60ms; }
.reveal[data-reveal-delay="70"] { --reveal-delay: 70ms; }
.reveal[data-reveal-delay="80"] { --reveal-delay: 80ms; }
.reveal[data-reveal-delay="120"] { --reveal-delay: 120ms; }

@media (prefers-reduced-motion: reduce) {
  .reveal-enabled .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
