/* Halabi Vision Center
   Palette: brand teal from the logo, a deep teal for text and buttons,
   white paper, a cool mist tint, and walnut from the store's cabinetry. */
:root {
  --teal: #1fa29c;
  --teal-deep: #0f6f6a;
  --ink: #12302e;
  --muted: #4b6563;
  --paper: #ffffff;
  --mist: #eef6f5;
  --line: #d3e3e1;
  --walnut: #5a3a26;
  --walnut-soft: #f3ebe4;
  --u: clamp(9.5px, min(1.2vw, 1.5vh), 13.5px); /* eye-chart unit: 6/6 line = 1u */
  --wrap: 1160px;
  --gutter: clamp(16px, 4vw, 40px);
  --font: "Readex Pro", "Segoe UI", Tahoma, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  font-weight: 350;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--teal-deep); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--teal-deep); outline-offset: 3px; border-radius: 4px; }

/* Language switching: both languages live in the page, one is hidden. */
html[data-lang="en"] .t-ar, html[data-lang="ar"] .t-en { display: none !important; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 24px; min-height: 72px; }
.brand { display: flex; align-items: center; flex: none; }
.brand img { height: 48px; width: auto; }
.nav { display: flex; gap: 26px; margin-inline-start: auto; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 400; font-size: 15.5px; }
.nav a:hover { color: var(--teal-deep); text-decoration: underline; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.lang-toggle {
  font: inherit; font-size: 15px; font-weight: 500; color: var(--teal-deep);
  background: none; border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 14px; cursor: pointer;
}
.lang-toggle:hover { border-color: var(--teal); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font: inherit; font-weight: 500; font-size: 16px; line-height: 1.2;
  padding: 13px 20px; border-radius: 10px; text-decoration: none;
  border: 1.5px solid transparent; cursor: pointer; text-align: center;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--teal-deep); color: #fff; }
.btn-primary:hover { background: var(--ink); color: #fff; }
.btn-line { border-color: var(--teal-deep); color: var(--teal-deep); background: #fff; }
.btn-line:hover { background: var(--mist); color: var(--ink); }
.btn-small { padding: 9px 14px; font-size: 15px; }
.num { direction: ltr; unicode-bidi: isolate; display: inline-block; white-space: nowrap; }

/* Hero: the eye chart */
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: calc(100svh - 73px); }
.chart-board {
  display: flex; flex-direction: column; justify-content: center;
  padding: clamp(36px, 6vw, 80px) var(--gutter);
  background: var(--paper);
}
.chart { margin: 0 auto; width: 100%; max-width: 620px; }
.chart-line {
  display: grid; grid-template-columns: 3.4em 1fr; align-items: center;
  margin: 0;
}
.chart-line .acuity {
  font-size: 12px; font-weight: 400; color: var(--teal-deep);
  letter-spacing: 0.02em; direction: ltr; text-align: start;
}
.chart-line .letters {
  text-align: center; font-weight: 600; letter-spacing: 0.14em; line-height: 1.12;
  color: var(--ink); white-space: nowrap;
}
html[data-lang="ar"] .chart-line .letters { letter-spacing: 0; font-weight: 600; line-height: 1.35; }
html[data-lang="ar"] .l60 .letters, html[data-lang="ar"] .l36 .letters { line-height: 1.12; }
.l60 .letters { font-size: calc(var(--u) * 10); letter-spacing: 0.08em; }
.l36 .letters { font-size: calc(var(--u) * 6); }
.l24 .letters { font-size: calc(var(--u) * 4); }
.l18 .letters { font-size: calc(var(--u) * 3); }
.l12 .letters { font-size: calc(var(--u) * 2); }
.l9  .letters { font-size: calc(var(--u) * 1.5); }
.l6  .letters { font-size: calc(var(--u) * 1.1); font-weight: 500; }
.chart-line + .chart-line { margin-top: calc(var(--u) * 0.9); }
.chart-rule { height: 3px; background: var(--ink); width: 62%; margin: calc(var(--u) * 0.9) auto 0; }
.hero-copy { max-width: 620px; margin: clamp(28px, 4vw, 44px) auto 0; width: 100%; }
.hero-copy p { margin: 0 0 22px; font-size: 18px; color: var(--muted); max-width: 52ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-photo { position: relative; margin: 0; background: var(--mist); }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 40% center; }
.hero-photo figcaption {
  position: absolute; inset-inline-start: 18px; bottom: 18px;
  background: rgba(255, 255, 255, 0.92); color: var(--ink);
  font-size: 14px; padding: 7px 12px; border-radius: 8px;
}

/* One deliberate motion: the chart comes into focus like a lens clicking in. */
@media (prefers-reduced-motion: no-preference) {
  .js .chart-line { animation: focus-in 1100ms cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--i) * 120ms + 150ms); }
  @keyframes focus-in {
    0% { filter: blur(9px); opacity: 0.25; }
    55% { filter: blur(2.5px); opacity: 0.85; }
    100% { filter: blur(0); opacity: 1; }
  }
}

/* Sections */
section { scroll-margin-top: 80px; }
.band { padding-block: clamp(64px, 9vw, 120px); }
.band-mist { background: var(--mist); }
h2 {
  font-size: clamp(30px, 4.2vw, 46px); line-height: 1.12; font-weight: 600;
  letter-spacing: -0.01em; margin: 0 0 18px; max-width: 20ch;
}
html[data-lang="ar"] h2 { letter-spacing: 0; line-height: 1.3; }
h3 { font-size: 20px; line-height: 1.3; font-weight: 500; margin: 0 0 6px; }
.lead { font-size: clamp(18px, 1.6vw, 20px); color: var(--muted); max-width: 58ch; margin: 0 0 18px; }
p { max-width: 64ch; }

/* About */
.about { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr); gap: clamp(32px, 6vw, 80px); align-items: center; }
.about-photo img { border-radius: 14px; aspect-ratio: 3 / 4; object-fit: cover; width: 100%; }
.about-photo figcaption { font-size: 14px; color: var(--muted); margin-top: 10px; }
.focus-list { list-style: none; padding: 0; margin: 30px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
.focus-list li { display: flex; gap: 12px; align-items: baseline; padding: 12px 0; border-top: 1px solid var(--line); font-weight: 400; }

/* Tumbling E: the optotype used to test children who can't read yet */
.tumble { font-weight: 700; color: var(--teal); display: inline-block; width: 1em; height: 1em; text-align: center; flex: none; line-height: 1; }
.r90 { transform: rotate(90deg); } .r180 { transform: rotate(180deg); } .r270 { transform: rotate(270deg); }

/* Services */
.services { list-style: none; padding: 0; margin: 40px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 clamp(28px, 5vw, 64px); }
.services li { display: grid; grid-template-columns: 1.6em 1fr; align-items: start; gap: 14px; padding: 24px 0; border-top: 1px solid var(--line); }
.services .tumble { font-size: 22px; margin-top: 2px; }
.services p { margin: 0; color: var(--muted); }

/* Ortho-K */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 80px); align-items: start; }
.split figure { margin: 0; }
.split figure img { border-radius: 14px; width: 100%; aspect-ratio: 5 / 4; object-fit: cover; }
.note { font-size: 15px; color: var(--muted); border-inline-start: 3px solid var(--teal); padding-inline-start: 14px; margin: 18px 0 0; }
.steps { list-style: none; counter-reset: step; padding: 0; margin: 28px 0 28px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 44px 1fr; gap: 14px; padding: 16px 0; border-top: 1px solid var(--line); }
.steps li::before {
  content: counter(step); width: 36px; height: 36px; border-radius: 50%;
  border: 1.5px solid var(--teal-deep); color: var(--teal-deep);
  display: grid; place-items: center; font-weight: 500; font-size: 15px;
}
.steps strong { font-weight: 500; display: block; }
.steps span { color: var(--muted); }

/* Keratoconus */
.lens-types { list-style: none; padding: 0; margin: 34px 0 30px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 clamp(20px, 3vw, 40px); }
.lens-types li { border-top: 3px solid var(--teal); padding-top: 16px; }
.lens-types p { margin: 0; color: var(--muted); }

/* Visit */
.visit { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(32px, 5vw, 64px); align-items: stretch; }
.visit dl { margin: 26px 0 28px; }
.visit dt { font-size: 14px; color: var(--muted); margin-top: 18px; }
.visit dd { margin: 2px 0 0; font-size: 18px; font-weight: 400; }
.hours { border-collapse: collapse; margin-top: 4px; }
.hours td { padding: 3px 0; font-size: 17px; }
.hours td + td { padding-inline-start: 18px; }
.visit-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.map { border: 1px solid var(--line); width: 100%; height: 100%; min-height: 380px; border-radius: 14px; background: #fff; }
.social { display: flex; gap: 18px; margin-top: 22px; font-size: 15.5px; }

/* Footer */
.site-footer { background: var(--walnut); color: #f6ede6; padding-block: 56px 40px; }
.site-footer a { color: #fff; }
.footer-grid { display: grid; grid-template-columns: auto 1fr auto; gap: 32px 48px; align-items: start; }
.site-footer img { height: 70px; width: auto; }
.site-footer p { margin: 0 0 6px; max-width: none; font-size: 15px; }
.footer-links { display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.legal { margin-top: 34px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, 0.18); font-size: 13.5px; color: #e6d8cd; }

/* Mobile action bar */
.action-bar { display: none; }

/* Privacy page */
.doc { max-width: 760px; }
.doc h1 { font-size: clamp(34px, 5vw, 52px); line-height: 1.1; font-weight: 600; margin: 0 0 8px; }
.doc .updated { color: var(--muted); margin: 0 0 34px; }
.doc h2 { font-size: 24px; max-width: none; margin: 38px 0 10px; letter-spacing: 0; }
.doc ul { padding-inline-start: 22px; }
.doc li { margin: 6px 0; }
.doc li::marker { color: var(--teal-deep); }

@media (max-width: 980px) {
  .nav { display: none; }
  .header-actions { margin-inline-start: auto; }
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero-photo { height: 58vw; max-height: 460px; }
  .about, .split, .visit { grid-template-columns: 1fr; }
  .about-photo { max-width: 420px; }
  .split figure { order: -1; }
  .footer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  body { padding-bottom: 76px; }
  .brand img { height: 42px; }
  .header-call { display: none; }
  .services, .focus-list, .lens-types { grid-template-columns: 1fr; }
  .lens-types li + li { margin-top: 22px; }
  .hero-actions .btn { flex: 1 1 auto; }
  .chart-line { grid-template-columns: 2.6em 1fr; }
  .chart-line .acuity { font-size: 10.5px; }
  .action-bar {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
    position: fixed; inset-inline: 0; bottom: 0; z-index: 30;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.97); border-top: 1px solid var(--line);
  }
  .action-bar .btn { width: 100%; }
}
