/* Dr. Naveen Maini / Park Royal Dentistry
   Direction: the dentist's chart. Cool chart paper, navy ink,
   and the two charting pencils (blue = done, red = needs care). */

:root {
  --paper: #eef2f1;
  --enamel: #ffffff;
  --ink: #14233a;
  --ink-2: #44546a;
  --blue: #2f5da8;
  --blue-wash: #dce6f4;
  --red: #b42318;
  --red-wash: #f6dedb;
  --rule: #c5d0d3;

  --serif: "Iowan Old Style", "Charter", "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --sans: "Avenir Next", "Avenir", "Segoe UI Variable Text", "Segoe UI", "Helvetica Neue", system-ui, sans-serif;

  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: clamp(1.75rem, 1.2rem + 2.2vw, 2.6rem);
  --step-3: clamp(2.4rem, 1.4rem + 4.6vw, 4.6rem);

  --gutter: clamp(1.25rem, 4vw, 3rem);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.1; margin: 0; text-wrap: balance; }
h2 { font-size: var(--step-2); letter-spacing: -0.01em; }
h3 { font-size: var(--step-1); }
p { margin: 0 0 1em; max-width: 65ch; }

a { color: var(--blue); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 2px; }

.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;
}

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 10;
  background: var(--ink); color: var(--enamel); padding: .6rem 1rem; border-radius: 4px;
}
.skip:focus { top: 1rem; }

.wrap { width: 100%; max-width: 76rem; margin-inline: auto; padding-inline: var(--gutter); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3rem; padding: .7rem 1.4rem;
  background: var(--blue); color: var(--enamel);
  font: 600 1rem/1.2 var(--sans); text-decoration: none;
  border: 2px solid var(--blue); border-radius: 999px;
  transition: background-color .2s var(--ease), color .2s var(--ease);
}
.btn:hover { background: var(--ink); border-color: var(--ink); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--enamel); }
.btn-small { min-height: 2.6rem; padding: .5rem 1.1rem; font-size: .95rem; }

/* Masthead */
.masthead { border-bottom: 1px solid var(--rule); background: var(--paper); }
.masthead-inner { display: flex; align-items: center; gap: 1.5rem; min-height: 4.5rem; }
.brand { display: flex; align-items: center; gap: .65rem; color: var(--ink); text-decoration: none; margin-right: auto; }
.brand-mark { width: 2rem; height: 2rem; fill: var(--enamel); stroke: var(--blue); stroke-width: 1.6; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-family: var(--serif); font-weight: 600; font-size: 1.15rem; }
.brand-sub { font-size: .85rem; color: var(--ink-2); }
.nav ul { display: flex; gap: 1.5rem; list-style: none; margin: 0; padding: 0; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 500; }
.nav a:hover { color: var(--blue); text-decoration: underline; }

/* Hero + chart + treatments share one grid so the chart can stay in view */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "hero" "chart" "services";
  gap: 2.5rem 4rem;
  padding-block: clamp(2.5rem, 6vw, 5rem) clamp(3rem, 7vw, 6rem);
}
.hero { grid-area: hero; }
.chart { grid-area: chart; }
.services { grid-area: services; }

.hero h1 { font-size: var(--step-3); letter-spacing: -0.02em; line-height: 1.02; max-width: 14ch; }
.lede { font-size: 1.15rem; color: var(--ink-2); margin-top: 1.5rem; max-width: 52ch; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }
.status { margin-top: 1.25rem; font-size: .95rem; color: var(--ink-2); display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.status::before {
  content: ""; width: .6rem; height: .6rem; border-radius: 50%;
  background: var(--rule); flex: none;
}
.status.is-open::before { background: var(--blue); box-shadow: 0 0 0 3px var(--blue-wash); }
.status.is-closed::before { background: var(--red); }

/* The chart */
.chart {
  margin: 0;
  background: var(--enamel);
  border: 1px solid var(--rule);
  border-radius: 18px;
  padding: clamp(1rem, 3vw, 1.75rem);
  /* faint chart-paper grid */
  background-image:
    linear-gradient(var(--paper) 1px, transparent 1px),
    linear-gradient(90deg, var(--paper) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: -1px -1px;
}
.arch { display: block; width: 100%; max-width: 30rem; height: auto; margin-inline: auto; overflow: visible; }

.arch-label { font: italic 15px var(--serif); fill: var(--ink-2); }
.arch-side { font: 600 13px var(--sans); fill: var(--ink-2); }
.arch-mid { stroke: var(--rule); stroke-width: 1; stroke-dasharray: 3 5; }

.tooth {
  fill: var(--enamel);
  stroke: var(--ink);
  stroke-width: 1.5;
  transform-box: fill-box;
  transform-origin: center;
  transition: fill .35s var(--ease), stroke .35s var(--ease), stroke-width .35s var(--ease);
  animation: chart-in .5s var(--ease) backwards;
  animation-delay: calc(var(--i, 0) * 32ms + 150ms);
}
@keyframes chart-in { from { opacity: 0; transform: scale(.3); } }

.guard {
  fill: none; stroke: var(--blue); stroke-width: 34; stroke-linecap: round;
  opacity: 0; transition: opacity .4s var(--ease);
}
.scan { fill: var(--blue); opacity: 0; }

.chart[data-mark="blue"] .tooth.is-marked,
.chart[data-mark="scan"] .tooth.is-marked { fill: var(--blue-wash); stroke: var(--blue); stroke-width: 2.5; }
.chart[data-mark="red"] .tooth.is-marked { fill: var(--red-wash); stroke: var(--red); stroke-width: 2.5; }
.chart[data-mark="guard"] .guard { opacity: .18; }
.chart[data-mark="guard"] .tooth.is-marked { stroke: var(--blue); stroke-width: 2.5; }
.chart[data-mark="scan"] .scan { opacity: .35; animation: scan 2.2s linear 2 forwards; }
.chart[data-mark="calm"] .tooth.is-marked { fill: var(--blue-wash); stroke: var(--blue); animation: breathe 4s ease-in-out infinite; }

@keyframes scan { from { transform: translateX(0); opacity: .35; } 90% { opacity: .35; } to { transform: translateX(420px); opacity: 0; } }
@keyframes breathe { 50% { fill-opacity: .25; } }

.chart figcaption { margin-top: 1rem; border-top: 1px solid var(--rule); padding-top: 1rem; }
.chart-note { font-family: var(--serif); font-size: 1.1rem; min-height: 3.2em; margin-bottom: .75rem; }
.legend { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; list-style: none; margin: 0; padding: 0; font-size: .9rem; color: var(--ink-2); }
.legend li { display: flex; align-items: center; gap: .45rem; }
.swatch { width: .9rem; height: .9rem; border-radius: 50%; border: 2px solid; }
.swatch-blue { border-color: var(--blue); background: var(--blue-wash); }
.swatch-red { border-color: var(--red); background: var(--red-wash); }

/* Treatments */
.section-intro { color: var(--ink-2); margin-top: .75rem; }
.svc-list { list-style: none; margin: 1.75rem 0 0; padding: 0; border-top: 1px solid var(--rule); }
.svc { border-bottom: 1px solid var(--rule); padding: 1rem 0 1.1rem; }
.svc p { margin: .35rem 0 0 2rem; color: var(--ink-2); }
.svc-btn {
  display: flex; align-items: center; gap: .9rem; width: 100%;
  padding: .3rem 0; margin: 0; border: 0; background: none; cursor: pointer;
  font: inherit; color: var(--ink); text-align: left;
}
.svc-btn::before {
  content: ""; flex: none; width: 1.1rem; height: 1.1rem; border-radius: 50%;
  border: 1.5px solid var(--ink); background: var(--enamel);
  transition: background-color .25s var(--ease), border-color .25s var(--ease);
}
.svc-btn::after {
  content: "Show on chart"; margin-left: auto; font: 500 .85rem var(--sans); color: var(--blue);
  opacity: 0; transition: opacity .2s var(--ease);
}
.svc-btn:hover::after, .svc-btn:focus-visible::after { opacity: 1; }
.svc-btn:hover { color: var(--blue); }
.svc-btn[aria-pressed="true"] { color: var(--blue); }
.svc-btn[aria-pressed="true"]::before { background: var(--blue-wash); border-color: var(--blue); border-width: 3px; }
.svc-btn[aria-pressed="true"][data-mark="red"] { color: var(--red); }
.svc-btn[aria-pressed="true"][data-mark="red"]::before { background: var(--red-wash); border-color: var(--red); }
.svc-btn[aria-pressed="true"]::after { content: "On the chart"; opacity: 1; }

/* About */
.about { background: var(--ink); color: var(--enamel); padding-block: clamp(3.5rem, 8vw, 6.5rem); }
.about-grid { display: grid; gap: 3rem; grid-template-columns: minmax(0, 1fr); align-items: start; }
.about p { color: #d5dde8; }
.about h2 { margin-bottom: 1.25rem; }
.timeline { list-style: none; margin: 2.5rem 0 0; padding: 0; border-left: 2px solid #4a5d7c; }
.timeline li { position: relative; padding: 0 0 1.75rem 1.75rem; display: grid; gap: .2rem; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: -.5rem; top: .45rem;
  width: .9rem; height: .9rem; border-radius: 50%; background: var(--ink); border: 2px solid #9db8e6;
}
.timeline li:last-child::before { background: #9db8e6; }
.when { font-family: var(--serif); font-size: 1.5rem; font-weight: 600; color: var(--enamel); }
.what { color: #d5dde8; max-width: 50ch; }

/* Placeholders for owner photos */
.placeholder { margin: 0; }
.placeholder-frame {
  border-radius: 14px;
  background:
    repeating-linear-gradient(135deg, transparent 0 14px, rgba(47, 93, 168, .12) 14px 15px),
    var(--blue-wash);
  border: 1px dashed var(--blue);
}
.placeholder-portrait .placeholder-frame { aspect-ratio: 4 / 5; }
.placeholder-wide .placeholder-frame { aspect-ratio: 21 / 9; }
.placeholder figcaption { margin-top: .6rem; font-size: .9rem; color: var(--ink-2); }
.about .placeholder figcaption { color: #d5dde8; }
.about .placeholder-frame { background-color: #23395a; border-color: #9db8e6; }

/* Visit */
.visit { padding-block: clamp(3.5rem, 8vw, 6.5rem); }
.visit-grid { display: grid; gap: 2.5rem; grid-template-columns: minmax(0, 1fr); margin-top: 2rem; }
.visit-block h3 { margin-bottom: 1rem; }
.hours { border-collapse: collapse; width: 100%; max-width: 24rem; }
.hours th, .hours td { text-align: left; padding: .5rem .25rem; border-bottom: 1px solid var(--rule); font-weight: 400; }
.hours td { text-align: right; font-variant-numeric: tabular-nums; }
.hours tr.is-today th, .hours tr.is-today td { font-weight: 700; color: var(--blue); }
.hours tr.is-today th::after { content: " (today)"; font-weight: 400; color: var(--ink-2); }
address { font-style: normal; margin-bottom: 1rem; }
.fine { font-size: .92rem; color: var(--ink-2); margin-top: 1rem; }
.link { font-weight: 600; overflow-wrap: anywhere; }
.visit-book { background: var(--enamel); border: 1px solid var(--rule); border-radius: 18px; padding: 1.5rem; }

.milton-note {
  margin-top: 3rem; padding: 1.25rem 1.5rem; max-width: 48rem;
  border-left: 4px solid var(--red); background: var(--enamel);
  border-radius: 0 12px 12px 0;
}
.milton-note h3 { font-size: 1.15rem; margin-bottom: .5rem; }
.milton-note p { margin: 0; }
.placeholder-wide { margin-top: 3rem; }

/* Footer */
.footer { border-top: 1px solid var(--rule); padding-block: 2.5rem; font-size: .95rem; color: var(--ink-2); }
.footer-inner { display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 1fr); }
.footer p { margin: 0; }
.footer a { overflow-wrap: anywhere; }
.footer-name { font-family: var(--serif); font-weight: 600; color: var(--ink); font-size: 1.1rem; }
.footer-name span { font-family: var(--sans); font-weight: 400; font-size: .9rem; color: var(--ink-2); }

/* 404 */
.lost { padding-block: clamp(4rem, 12vw, 9rem); }
.lost h1 { font-size: var(--step-3); letter-spacing: -0.02em; max-width: 16ch; margin-bottom: 1.25rem; }

/* Small screens */
@media (max-width: 47.99rem) {
  .nav { display: none; }
  .hide-sm { display: none; }
}

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

@media (min-width: 60rem) {
  .split {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
    grid-template-areas: "hero chart" "services chart";
    align-items: start;
  }
  .chart { position: sticky; top: 1.5rem; align-self: start; }
  .about-grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 5rem; }
  .visit-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer-inner { grid-template-columns: 1.3fr 1fr 1.3fr auto; align-items: end; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .chart[data-mark="scan"] .scan { opacity: 0; }
}
