/* Dr. Ted Karolidis Dental: "the corner of Main & Martin"
   Road-sign grotesk for headings, a warm book serif for reading. */

:root {
  --pine: #173a32;      /* deep Halton pine: text and dark bands */
  --sign: #1e6b4f;      /* municipal street-sign green */
  --stone: #e7ece8;     /* escarpment limestone: page background */
  --paper: #fbfcfb;     /* enamel white */
  --awning: #e9b93a;    /* Main Street awning mustard: highlights */
  --muted: #4b5d57;
  --line: #c4cfc9;

  --f-sign: "DIN Alternate", "DIN Next", "Bahnschrift", "D-DIN", "Barlow", "Roboto Condensed", "Arial Narrow", sans-serif;
  --f-read: "Charter", "Bitstream Charter", "Iowan Old Style", "Sitka Text", "Palatino Linotype", Palatino, Georgia, serif;

  --step--1: clamp(0.88rem, 0.85rem + 0.15vw, 0.95rem);
  --step-0: clamp(1.05rem, 1rem + 0.25vw, 1.15rem);
  --step-1: clamp(1.25rem, 1.15rem + 0.5vw, 1.45rem);
  --step-2: clamp(1.6rem, 1.35rem + 1.1vw, 2.2rem);
  --step-3: clamp(2.3rem, 1.6rem + 3.2vw, 4.4rem);

  --wrap: 72rem;
  --gutter: clamp(1.1rem, 4vw, 2.5rem);
  --radius-sign: 10px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 5rem; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--stone);
  color: var(--pine);
  font-family: var(--f-read);
  font-size: var(--step-0);
  line-height: 1.6;
}

h1, h2, h3 {
  font-family: var(--f-sign);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
}
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); }
p { margin: 0 0 1em; max-width: 64ch; }

a { color: inherit; }
:focus-visible {
  outline: 3px solid var(--awning);
  outline-offset: 3px;
  border-radius: 3px;
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 10;
  background: var(--awning); color: var(--pine);
  padding: 0.6rem 1rem; font-family: var(--f-sign); font-weight: 700;
}
.skip:focus { top: 1rem; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3rem; padding: 0.7rem 1.3rem;
  font-family: var(--f-sign); font-weight: 700; font-size: var(--step-0);
  text-decoration: none; border-radius: 6px;
  border: 2px solid var(--pine);
  transition: background-color 0.15s, color 0.15s;
}
.btn--primary { background: var(--pine); color: var(--paper); }
.btn--primary:hover { background: var(--sign); border-color: var(--sign); }
.btn--ghost { background: transparent; color: var(--pine); }
.btn--ghost:hover { background: var(--paper); }
.btn--small { min-height: 2.5rem; padding: 0.4rem 0.9rem; font-size: var(--step--1); background: var(--awning); border-color: var(--awning); color: var(--pine); }
.btn--small:hover { background: var(--paper); }
.btn--block { width: 100%; margin-top: 0.5rem; }

/* Masthead */
.masthead {
  position: sticky; top: 0; z-index: 20;
  background: var(--paper); border-bottom: 1px solid var(--line);
  transition: box-shadow 0.25s;
}
.masthead.is-scrolled { box-shadow: 0 10px 24px -16px rgba(23, 58, 50, 0.45); }
.masthead__row { display: flex; align-items: center; gap: 1.5rem; min-height: 4.25rem; }
.wordmark {
  display: inline-flex; align-items: center; gap: 0.6rem;
  text-decoration: none; font-family: var(--f-sign); font-weight: 700; font-size: 1.35rem; line-height: 1;
}
.wordmark__mark { width: 1.9rem; height: 1.9rem; color: var(--sign); flex: none; }
.wordmark__sub { display: block; font-size: 0.72rem; font-weight: 400; color: var(--muted); margin-top: 0.2rem; letter-spacing: 0.02em; }
.nav { margin-left: auto; }
.nav ul { display: flex; gap: 1.4rem; list-style: none; margin: 0; padding: 0; }
.nav a { font-family: var(--f-sign); text-decoration: none; padding: 0.3rem 0; border-bottom: 2px solid transparent; }
.nav a:hover { border-bottom-color: var(--awning); }

@media (max-width: 47.99rem) {
  .nav { display: none; }
  .masthead__row { justify-content: space-between; }
}

/* Hero */
.hero { padding: clamp(2.5rem, 6vw, 5.5rem) 0 clamp(2rem, 5vw, 4rem); overflow: hidden; }
.hero__grid { display: grid; gap: 2.5rem; align-items: center; }
@media (min-width: 56rem) {
  .hero__grid { grid-template-columns: 1.25fr 1fr; gap: 4rem; }
}
.hero__kicker { font-family: var(--f-sign); color: var(--sign); font-size: var(--step-1); margin-bottom: 0.6rem; }
.hero__title { font-size: var(--step-3); max-width: 13ch; margin-bottom: 0.45em; }
.hero__lede { font-size: var(--step-1); line-height: 1.55; color: var(--pine); max-width: 36ch; }
@media (max-width: 30rem) { .hero__lede { font-size: var(--step-0); } }

.status {
  display: flex; align-items: center; gap: 0.7rem;
  margin: 1.6rem 0 1.4rem; padding: 0.7rem 1rem;
  background: var(--paper); border-left: 4px solid var(--line);
  max-width: 34rem;
}
.status p { margin: 0; font-family: var(--f-sign); font-size: var(--step-0); line-height: 1.3; }
.status__dot { width: 0.75rem; height: 0.75rem; border-radius: 50%; background: var(--muted); flex: none; }
.status.is-open { border-left-color: var(--sign); }
.status.is-open .status__dot { background: var(--sign); box-shadow: 0 0 0 4px rgba(30, 107, 79, 0.2); }

.cta { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.cta__note { margin-top: 1rem; font-size: var(--step--1); color: var(--muted); }

/* Street-corner illustration */
.corner { margin: 0; justify-self: center; width: min(100%, 26rem); }
.corner__art { display: block; width: 100%; height: auto; overflow: visible; }
.corner__post { fill: #6f7c77; }
.corner__cap { fill: var(--pine); }
.corner__sign rect { fill: var(--sign); }
.corner__sign .corner__inset { fill: none; stroke: var(--paper); stroke-width: 3; }
.corner__sign text {
  fill: var(--paper); font-family: var(--f-sign); font-weight: 700;
  font-size: 46px; letter-spacing: 0.06em;
}
.corner__sign--a { transform-origin: 208px 84px; }
.corner__sign--b { transform-origin: 208px 190px; }
.corner__plate rect { fill: var(--awning); }
.corner__plate text { fill: var(--pine); font-family: var(--f-sign); font-weight: 700; }
.corner__plate-small { font-size: 16px; }
.corner__plate-big { font-size: 30px; }
.corner figcaption { text-align: center; font-family: var(--f-sign); color: var(--muted); margin-top: 0.5rem; }

/* The one orchestrated moment: the signs settle into place on load. */
@media (prefers-reduced-motion: no-preference) {
  .corner__sign--a { animation: swing-a 1.6s cubic-bezier(.3,1.4,.5,1) both 0.15s; }
  .corner__sign--b { animation: swing-b 1.8s cubic-bezier(.3,1.4,.5,1) both 0.35s; }
  /* End states listed first (step order is irrelevant in CSS). */
  @keyframes swing-a { to { transform: rotate(0); } 30% { opacity: 1; } from { transform: rotate(-7deg); opacity: 0; } }
  @keyframes swing-b { to { transform: rotate(0); } 30% { opacity: 1; } from { transform: rotate(6deg); opacity: 0; } }
}

/* Fees band */
.fees { background: var(--pine); color: var(--paper); padding: clamp(3rem, 7vw, 5.5rem) 0; }
.fees__grid { display: grid; gap: 1.5rem 4rem; }
@media (min-width: 52rem) { .fees__grid { grid-template-columns: 1.1fr 1fr; align-items: start; } }
.fees__title { font-size: var(--step-3); color: var(--awning); max-width: 11ch; margin: 0; }
.fees__body p { font-size: var(--step-1); line-height: 1.5; }
.pay { list-style: none; margin: 1.5rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.6rem; }
.pay li {
  font-family: var(--f-sign); font-size: var(--step--1);
  padding: 0.45rem 0.85rem; border: 1.5px solid rgba(251, 252, 251, 0.55); border-radius: 999px;
}

/* Sections */
.services, .hours, .doctor, .visit { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.section-head { margin-bottom: 2.25rem; }
.section-head p { color: var(--muted); margin: 0; }

/* Services: a walk down Main Street. A road runs down the left, each group
   of services is a stop marked by a street sign. motion.js fills the road
   (--route, 0 to 1) as you scroll and reveals each stop. */
.svc {
  --rail-pad: 2.4rem; --rail-x: 0.3rem; --rail-w: 10px; --dot: 1.3rem;
  position: relative; display: grid; gap: 3rem;
  padding-left: var(--rail-pad);
}
@media (min-width: 48rem) { .svc { --rail-pad: 4rem; --rail-x: 0.9rem; gap: 4rem; } }

.svc__rail {
  position: absolute; top: 0.4rem; bottom: 0; left: var(--rail-x); width: var(--rail-w);
  background: var(--line); border-radius: 999px; overflow: hidden;
}
.svc__rail::after {
  content: ""; position: absolute; inset: 0;
  background:
    repeating-linear-gradient(to bottom, var(--awning) 0 12px, transparent 12px 24px) center / 2px 100% no-repeat,
    var(--pine);
  transform: scaleY(var(--route, 1)); transform-origin: top;
}

.svc__group { position: relative; display: grid; gap: 1rem 3rem; align-items: start; }
@media (min-width: 56rem) { .svc__group { grid-template-columns: minmax(17rem, 0.85fr) 1.15fr; } }
.svc__group::before {
  /* the stop on the road */
  content: ""; position: absolute; top: calc(1.55rem - var(--dot) / 2);
  left: calc(var(--rail-x) + var(--rail-w) / 2 - var(--dot) / 2 - var(--rail-pad));
  width: var(--dot); height: var(--dot); border-radius: 50%;
  background: var(--awning); border: 3px solid var(--pine);
}

.svc__sign { display: flex; align-items: center; gap: 0.9rem; }
.svc__sign h3 {
  margin: 0; padding: 0.55rem 0.95rem 0.6rem;
  background: var(--sign); color: var(--paper);
  border-radius: var(--radius-sign);
  box-shadow: inset 0 0 0 3px var(--sign), inset 0 0 0 5px var(--paper), 0 6px 14px -8px rgba(23, 58, 50, 0.6);
  transform-origin: 1.2rem 0;
}
.svc__icon {
  width: 3.1rem; height: 3.1rem; flex: none;
  fill: none; stroke: var(--pine); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.svc__icon-accent { stroke: var(--sign); }

.svc__group--urgent { background: var(--paper); padding: 1.25rem; border-radius: var(--radius-sign); }
.svc__group--urgent::before { top: calc(1.25rem + 1.55rem - var(--dot) / 2); }
.svc__group--urgent .svc__sign h3 { background: var(--awning); color: var(--pine); box-shadow: inset 0 0 0 3px var(--awning), inset 0 0 0 5px var(--pine), 0 6px 14px -8px rgba(23, 58, 50, 0.6); }
.svc__group--urgent .svc__icon-accent { stroke: #b0400f; }
.svc__group--urgent .btn { grid-column: 1 / -1; }
@media (min-width: 56rem) { .svc__group--urgent .btn { grid-column: 2; width: auto; justify-self: start; } }

.svc dl { margin: 0; }
.svc dl > div { padding: 0.85rem 0; border-bottom: 1px solid var(--line); }
.svc dl > div:first-child { padding-top: 0.3rem; }
.svc dl > div:last-child { border-bottom: 0; }
.svc dt { font-family: var(--f-sign); font-weight: 700; font-size: var(--step-0); }
.svc dd { margin: 0.2rem 0 0; color: var(--muted); max-width: 52ch; }

/* Hours: a week timetable, 8 a.m. to 6 p.m. in half-hour steps */
.hours { background: var(--paper); }
.week { --name-w: 7.5rem; --time-w: 11rem; max-width: 60rem; }
.week__axis, .day {
  display: grid;
  grid-template-columns: var(--name-w) 1fr var(--time-w);
  gap: 0 1.25rem; align-items: center;
}
.week__axis { font-family: var(--f-sign); font-size: var(--step--1); color: var(--muted); height: 1.5rem; }
.week__axis span { grid-column: 2; grid-row: 1; justify-self: start; transform: translateX(-50%); }
.week__axis .t8 { margin-left: 0; transform: none; }
.week__axis .t10 { margin-left: 20%; }
.week__axis .t12 { margin-left: 40%; }
.week__axis .t14 { margin-left: 60%; }
.week__axis .t16 { margin-left: 80%; }
.week__axis .t18 { margin-left: 100%; transform: translateX(-100%); }

.week__days { list-style: none; margin: 0; padding: 0; }
.day { padding: 0.65rem 0; border-top: 1px solid var(--line); position: relative; }
.day__name { font-family: var(--f-sign); font-weight: 700; }
.day__time { font-family: var(--f-sign); font-variant-numeric: tabular-nums; }
.day__track {
  display: grid; grid-template-columns: repeat(20, 1fr);
  height: 1.6rem; position: relative;
  background:
    repeating-linear-gradient(to right, var(--line) 0 1px, transparent 1px 10%) ,
    var(--stone);
  border-radius: 4px;
}
.day__bar { grid-row: 1; background: var(--sign); border-radius: 4px; }
.day__bar--mon, .day__bar--thu { grid-column: 2 / 17; }
.day__bar--tue { grid-column: 3 / 21; }
.day__bar--wed { grid-column: 5 / 21; }
.day--closed .day__name, .day--closed .day__time { color: var(--muted); font-weight: 400; }

.day.is-today { background: linear-gradient(90deg, rgba(233, 185, 58, 0.28), rgba(233, 185, 58, 0.08)); }
.day.is-today .day__name::after { content: " (today)"; font-weight: 400; }
.day.is-today .day__bar { background: var(--pine); }
.day__now {
  position: absolute; top: -0.35rem; bottom: -0.35rem; left: var(--now, 0%);
  width: 3px; margin-left: -1px; background: var(--awning); border-radius: 2px;
  box-shadow: 0 0 0 1px var(--pine);
}

@media (max-width: 40rem) {
  .week__axis, .day {
    grid-template-columns: 1fr auto;
    grid-template-areas: "name time" "track track";
    gap: 0.4rem 1rem;
  }
  .day__name { grid-area: name; }
  .day__time { grid-area: time; text-align: right; }
  .day__track { grid-area: track; }
  .week__axis span { grid-column: 1 / -1; }
}

/* Doctor */
.doctor__grid { display: grid; gap: 2.5rem; align-items: start; }
@media (min-width: 52rem) { .doctor__grid { grid-template-columns: 0.8fr 1.2fr; gap: 4rem; } }
.doctor__reg { font-size: var(--step--1); color: var(--muted); }

/* Designed photo placeholders (see ASSETS.md) */
.placeholder {
  margin: 0; display: grid; place-items: center; text-align: center; position: relative;
  background:
    repeating-linear-gradient(135deg, transparent 0 14px, rgba(23, 58, 50, 0.07) 14px 15px),
    var(--paper);
  border: 2px dashed var(--line); border-radius: var(--radius-sign);
  color: var(--muted); font-family: var(--f-sign); padding: 1.5rem;
}
.placeholder--portrait { aspect-ratio: 4 / 5; }
.placeholder--wide { aspect-ratio: 16 / 9; grid-column: 1 / -1; }
.placeholder figcaption { position: absolute; bottom: 1rem; left: 0; right: 0; font-size: var(--step--1); }

/* Visit */
.visit__grid { display: grid; gap: 2.5rem 4rem; }
@media (min-width: 52rem) { .visit__grid { grid-template-columns: 1.2fr 1fr; } }
.visit__addr { font-style: normal; font-size: var(--step-1); line-height: 1.5; margin-bottom: 1rem; }
.visit__hint { font-size: var(--step-0); color: var(--muted); }
.visit__area { color: var(--muted); }
.link { font-family: var(--f-sign); font-weight: 700; text-decoration-thickness: 2px; text-underline-offset: 4px; text-decoration-color: var(--awning); }
.link:hover { color: var(--sign); }

.contact { list-style: none; margin: 0; padding: 0; align-self: start; }
.contact li { display: grid; grid-template-columns: 4.5rem 1fr; align-items: baseline; padding: 1rem 0; border-top: 1px solid var(--line); }
.contact li:last-child { border-bottom: 1px solid var(--line); }
.contact__how { color: var(--muted); font-family: var(--f-sign); }
.contact a { font-family: var(--f-sign); font-weight: 700; font-size: var(--step-1); text-decoration: none; overflow-wrap: anywhere; }
.contact a:hover { text-decoration: underline; text-decoration-color: var(--awning); }

/* Footer */
.footer { background: var(--pine); color: var(--paper); padding: 2rem 0; font-size: var(--step--1); }
.footer__row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem; }
.footer p { margin: 0; }

/* Motion. Load: the hero copy settles in with the signs. Scroll: services
   stops, hours bars and payment chips. Hidden start states only apply once
   motion.js has added .motion (so no-JS and reduced-motion show everything). */
@media (prefers-reduced-motion: no-preference) {
  :root { --ease-out: cubic-bezier(.2, .8, .2, 1); --ease-swing: cubic-bezier(.3, 1.4, .5, 1); }

  .hero__copy > * { animation: settle 0.9s var(--ease-out) both; }
  .hero__kicker { animation-delay: 0.05s; }
  .hero__title { animation-delay: 0.15s; }
  .hero__lede { animation-delay: 0.3s; }
  .status { animation-delay: 0.45s; }
  .cta { animation-delay: 0.55s; }
  .cta__note { animation-delay: 0.65s; }
  @keyframes settle { to { opacity: 1; transform: none; } from { opacity: 0; transform: translateY(0.9rem); } }

  .status.is-open .status__dot { animation: pulse 2.4s ease-out infinite 1.2s; }
  @keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(30, 107, 79, 0.45); }
    70%, 100% { box-shadow: 0 0 0 10px rgba(30, 107, 79, 0); }
  }

  /* The corner drifts up gently as you leave the hero, where supported. */
  @supports (animation-timeline: scroll()) {
    .corner__art { animation: drift linear both; animation-timeline: scroll(root); animation-range: 0 90vh; }
    @keyframes drift { to { transform: translateY(-2.5rem); } }
  }

  .btn { transition: background-color 0.15s, color 0.15s, transform 0.2s var(--ease-out); }
  .btn:hover { transform: translateY(-2px); }
  .btn:active { transform: none; }

  /* Services: each stop lights up, its sign swings in, the icon draws, the rows follow. */
  .svc__rail::after { transition: transform 0.12s linear; }
  .motion .svc__group::before { background: var(--paper); transform: scale(0.6); transition: background-color 0.3s, transform 0.5s var(--ease-swing); }
  .motion .svc__group.is-in::before { background: var(--awning); transform: none; }

  .motion .svc__sign h3 { opacity: 0; }
  .motion .is-in .svc__sign h3 { animation: sign-swing 1.4s var(--ease-swing) both 0.1s; }
  @keyframes sign-swing { to { transform: none; opacity: 1; } 30% { opacity: 1; } from { transform: rotate(-9deg); opacity: 0; } }

  .motion .svc__icon path { stroke-dasharray: 1; stroke-dashoffset: 1; }
  .motion .is-in .svc__icon path { stroke-dashoffset: 0; transition: stroke-dashoffset 1.1s var(--ease-out) 0.2s; }
  .motion .is-in .svc__icon .svc__icon-accent { transition-delay: 0.9s; transition-duration: 0.6s; }

  .motion .svc__group dl > div,
  .motion .svc__group--urgent .btn { opacity: 0; transform: translateX(1.25rem); }
  .motion .svc__group.is-in dl > div,
  .motion .svc__group--urgent.is-in .btn { opacity: 1; transform: none; transition: opacity 0.6s, transform 0.7s var(--ease-out); transition-delay: 0.35s; }
  .motion .svc__group.is-in dl > div:nth-child(2) { transition-delay: 0.47s; }
  .motion .svc__group.is-in dl > div:nth-child(3) { transition-delay: 0.59s; }
  .motion .svc__group--urgent.is-in .btn { transition-delay: 0.55s; }

  /* Hours: each day's opening bar grows across the timetable. */
  .motion .week .day__bar { transform: scaleX(0); transform-origin: left; }
  .motion .week.is-in .day__bar { transform: none; transition: transform 0.9s var(--ease-out) 0.1s; }
  .motion .week.is-in .day:nth-child(2) .day__bar { transition-delay: 0.2s; }
  .motion .week.is-in .day:nth-child(3) .day__bar { transition-delay: 0.3s; }
  .motion .week.is-in .day:nth-child(4) .day__bar { transition-delay: 0.4s; }
  .motion .week .day__now { opacity: 0; }
  .motion .week.is-in .day__now { opacity: 1; transition: opacity 0.4s 1.2s; }

  /* Fees: payment chips arrive one after another. */
  .motion .pay li { opacity: 0; transform: translateY(0.6rem) scale(0.96); }
  .motion .pay.is-in li { opacity: 1; transform: none; transition: opacity 0.5s, transform 0.6s var(--ease-swing); }
  .motion .pay.is-in li:nth-child(2) { transition-delay: 0.12s; }
  .motion .pay.is-in li:nth-child(3) { transition-delay: 0.24s; }
}

@media print {
  .masthead { position: static; }
  .motion [data-reveal] * { opacity: 1 !important; transform: none !important; animation: none !important; stroke-dashoffset: 0 !important; }
}

/* 404 */
.lost { padding: clamp(4rem, 12vw, 8rem) 0; }
.lost h1 { font-size: var(--step-3); max-width: 14ch; }
