/* ============ MEI LIN WONG — OPHTHALMOLOGY ============ */
:root {
  --paper: #fbfaf7;
  --paper-2: #f3f1ea;
  --ink: #1a1a20;
  --ink-soft: #5b5b66;
  --teal: #3a9188;
  --line: rgba(26, 26, 32, 0.12);
  --spectral: linear-gradient(90deg, #8a63d2, #2e86c1, #3a9188, #d29d3a, #c25d7b);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Jost", sans-serif;
  font-weight: 300;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--teal); color: var(--paper); }

.serif { font-family: "Gloock", serif; font-weight: 400; }
.label {
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 500;
}
em { font-style: italic; }

.spectral-text {
  background: var(--spectral);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.spectral-rule {
  height: 2px;
  background: var(--spectral);
  opacity: 0.85;
  margin: 0 auto;
  max-width: min(1200px, calc(100% - 4.8rem));
}

/* ---- nav ---- */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.3rem 2.4rem;
  z-index: 50;
  background: rgba(251, 250, 247, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-mark {
  font-family: "Gloock", serif;
  font-size: 1.35rem;
  color: var(--ink);
  text-decoration: none;
}
.nav-links { display: flex; gap: 2rem; }
.nav-links a, .nav-cta { color: var(--ink-soft); text-decoration: none; transition: color 0.3s; }
.nav-links a:hover { color: var(--ink); }
.nav-cta {
  border: 1px solid var(--ink);
  color: var(--ink);
  padding: 0.55rem 1.2rem;
  border-radius: 100px;
  position: relative;
  overflow: hidden;
  transition: color 0.35s, border-color 0.35s;
}
.nav-cta::before {
  content: "";
  position: absolute; inset: 0;
  background: var(--spectral);
  opacity: 0;
  transition: opacity 0.35s;
  z-index: -1;
}
.nav-cta:hover { color: #fff; border-color: transparent; }
.nav-cta:hover::before { opacity: 1; }

/* ---- hero ---- */
.hero {
  min-height: 100svh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  align-items: center;
  gap: 2rem;
  max-width: 1280px;
  margin: 0 auto;
  padding: 7rem 2.4rem 4rem;
}
.iris-wrap {
  position: relative;
  display: grid;
  place-items: center;
  order: 2;
}
#iris {
  width: min(46vw, 560px);
  height: auto;
  aspect-ratio: 1;
  border-radius: 50%;
  cursor: none;
}
.iris-halo {
  position: absolute;
  width: 115%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #8a63d222, #2e86c122, #3a918822, #d29d3a22, #c25d7b22, #8a63d222);
  filter: blur(40px);
  z-index: -1;
  animation: halo-spin 24s linear infinite;
}
@keyframes halo-spin { to { transform: rotate(360deg); } }

.hero-copy { order: 1; }
.hero-title {
  font-family: "Gloock", serif;
  font-weight: 400;
  font-size: clamp(2.6rem, 5.6vw, 4.9rem);
  line-height: 1.06;
  margin: 1.4rem 0 1.8rem;
}
.hero-title span { display: block; }
.hero-title em { white-space: nowrap; }
.hero-title em {
  background: var(--spectral);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub { max-width: 30rem; color: var(--ink-soft); font-size: 1.05rem; }
.hero-hint { margin-top: 2.6rem; color: var(--ink-soft); opacity: 0.75; }

/* ---- sections ---- */
section { max-width: 1200px; margin: 0 auto; padding: 7.5rem 2.4rem; scroll-margin-top: 4.5rem; }
.sec-head { margin-bottom: 4rem; }
.sec-head h2 {
  font-size: clamp(2rem, 4.2vw, 3.2rem);
  margin-top: 0.9rem;
  letter-spacing: -0.01em;
}

/* ---- intro ---- */
.intro { text-align: center; }
.intro-lede {
  font-family: "Gloock", serif;
  font-size: clamp(1.4rem, 2.8vw, 2.1rem);
  line-height: 1.5;
  max-width: 52rem;
  margin: 0 auto 4.5rem;
}
.intro-lede em {
  background: var(--spectral);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stats {
  display: flex; justify-content: center; gap: 5rem; flex-wrap: wrap;
}
.stat-num { font-size: clamp(2.4rem, 4.5vw, 3.6rem); }
.stat-label { color: var(--ink-soft); margin-top: 0.4rem; }

/* ---- services ---- */
.svc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
}
.svc {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 2.2rem 1.9rem 2.4rem;
  background: #fff;
  position: relative;
  transition: transform 0.4s var(--ease), box-shadow 0.4s;
}
.svc:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 48px rgba(26, 26, 32, 0.09);
}
.svc::before {
  content: "";
  position: absolute; inset: -1px;
  border-radius: 18px;
  padding: 1.5px;
  background: var(--spectral);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s;
}
.svc:hover::before { opacity: 1; }
.svc-dot {
  display: block;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--dot, var(--teal));
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--dot, var(--teal)) 18%, transparent);
  margin-bottom: 1.4rem;
}
.svc h3 { font-size: 1.32rem; margin-bottom: 0.7rem; line-height: 1.25; }
.svc p { color: var(--ink-soft); font-size: 0.95rem; }
.svc-note {
  background: var(--paper-2);
  border-style: dashed;
  display: grid;
  place-items: center;
  text-align: center;
}
.svc-quote { font-size: 1.25rem; line-height: 1.5; }

/* ---- exam ---- */
.exam-list { list-style: none; max-width: 46rem; }
.exam-step {
  display: flex; gap: 2rem;
  padding: 2.2rem 0;
  border-bottom: 1px solid var(--line);
  align-items: flex-start;
}
.exam-step:last-child { border-bottom: 0; }
.step-ring {
  flex: 0 0 auto;
  width: 3.4rem; height: 3.4rem;
  border: 1px solid var(--ink);
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 1.3rem;
  transition: background 0.35s, color 0.35s, transform 0.35s var(--ease), border-color 0.35s;
}
.exam-step:hover .step-ring {
  background: var(--ink); color: var(--paper);
  transform: scale(1.08);
}
.exam-step h4 { font-size: 1.3rem; margin-bottom: 0.4rem; }
.exam-step p { color: var(--ink-soft); font-size: 0.97rem; }

/* ---- snellen chart ---- */
.chart { text-align: center; }
.snellen {
  margin: 3.5rem auto 2.5rem;
  display: flex; flex-direction: column; align-items: center;
  gap: 2.2rem;
}
.sn-row { display: block; line-height: 1; letter-spacing: 0.12em; }
.sn-1 { font-size: clamp(4rem, 11vw, 9rem); }
.sn-2 { font-size: clamp(2.4rem, 6.6vw, 5.4rem); opacity: 0.92; }
.sn-3 { font-size: clamp(1.5rem, 4vw, 3.2rem); opacity: 0.82; }
.sn-4 { font-size: clamp(0.95rem, 2.4vw, 1.9rem); opacity: 0.7; }
.sn-5 { font-size: clamp(0.55rem, 1.3vw, 1rem); opacity: 0.55; }
.chart-foot {
  display: flex; justify-content: center; gap: 3rem;
  color: var(--ink-soft); opacity: 0.7;
}

/* ---- contact ---- */
.contact { text-align: center; }
.contact-title { font-size: clamp(2.6rem, 6.5vw, 5rem); margin-bottom: 2.4rem; }
.contact-title em {
  background: var(--spectral);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.contact-link {
  font-size: clamp(1.1rem, 2.4vw, 1.6rem);
  color: var(--ink);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  border-image: linear-gradient(90deg, #8a63d2, #2e86c1, #3a9188, #d29d3a, #c25d7b) 1;
  border-bottom: 2px solid;
  padding-bottom: 0.25rem;
  transition: opacity 0.3s;
}
.contact-link:hover { opacity: 0.65; }
.contact-meta { color: var(--ink-soft); margin-top: 2.2rem; }

/* ---- footer ---- */
.footer {
  border-top: 1px solid var(--line);
  padding: 2.2rem 2.4rem 2.8rem;
  color: var(--ink-soft);
}
.footer-row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin-bottom: 1rem; }
.footer-row a { color: var(--ink); }
.footer-note { font-size: 0.8rem; max-width: 46rem; opacity: 0.75; }
.footer-note a { color: var(--ink); text-decoration: none; border-bottom: 1px solid rgba(0,0,0,0.3); }
.footer-note a:hover { border-bottom-color: var(--ink); }

/* ---- reveals ---- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: 0.1s; }
.reveal.d2 { transition-delay: 0.2s; }
.reveal.d3 { transition-delay: 0.32s; }
.reveal.d4 { transition-delay: 0.48s; }

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

/* ---- responsive ---- */
@media (max-width: 920px) {
  .nav { padding: 1rem 1.3rem; }
  .nav-links { display: none; }
  section { padding: 5rem 1.4rem; }
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    padding-top: 7rem;
    gap: 3rem;
  }
  .iris-wrap { order: 1; }
  #iris { width: min(72vw, 380px); }
  .hero-copy { order: 2; }
  .hero-sub { margin: 0 auto; }
  .svc-grid { grid-template-columns: 1fr; }
  .stats { gap: 2.5rem; }
  .exam-step { gap: 1.2rem; }
  .chart-foot { gap: 1.4rem; }
}
