/* Cedar Creek Care Home — one stylesheet. Three colours: siding grey, ink, oxblood. */
:root {
  --bg: #e6e1d8;        /* warm siding grey, the ground */
  --surface: #dad4c9;   /* one tone step of the ground */
  --ink: #231918;       /* warm near-black */
  --accent: #7a1520;    /* oxblood: the action and one field */

  --display: 'Gambarino', Georgia, 'Times New Roman', serif;
  --text: 'Atkinson Hyperlegible Next', 'Atkinson Hyperlegible', system-ui, sans-serif;

  /* five sizes */
  --s-body: clamp(1.125rem, 1.07rem + 0.22vw, 1.25rem);
  --s-lead: clamp(1.375rem, 1.18rem + 0.75vw, 1.875rem);
  --s-h3: clamp(1.625rem, 1.3rem + 1.2vw, 2.375rem);
  --s-head: clamp(2.375rem, 1.5rem + 3.4vw, 4.25rem);
  --s-title: clamp(3.25rem, 0.6rem + 8.4vw, 8rem);

  --m: clamp(16px, 2.4vw, 36px);
  --axis: 42%;
  --gap-section: clamp(88px, 10vw, 168px);

  --dur-fast: 140ms;
  --dur-slow: 700ms;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-emph: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--text);
  font-size: var(--s-body);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
picture { display: block; }
figure { margin: 0; }
h1, h2, h3 {
  font-family: var(--display);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.015em;
  margin: 0;
  text-wrap: balance;
}
p { margin: 0; }
a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: 0.18em; }
a, button, select, input, textarea { touch-action: manipulation; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.footer :focus-visible, .family :focus-visible, .tab :focus-visible, .wordmark:focus-visible, .clock :focus-visible, .callbar:focus-visible { outline-color: var(--bg); outline-offset: -6px; }
::selection { background: var(--accent); color: var(--bg); }

/* demo notice and skip link */
.demo {
  background: var(--ink);
  color: var(--bg);
  font-size: var(--s-body);
  line-height: 1.4;
  padding: 10px var(--m);
}
.skip {
  position: absolute; left: var(--m); top: -200px;
  background: var(--bg); color: var(--ink);
  padding: 12px 16px; z-index: 30; font-weight: 700;
}
.skip:focus { top: 8px; }

/* ---------- masthead: bar + mosaic ---------- */
.bar {
  display: grid;
  grid-template-columns: var(--axis) 1fr auto;
  align-items: stretch;
  min-height: 64px;
}
.bar-left { display: flex; }
.wordmark {
  display: flex; align-items: center;
  background: var(--ink); color: var(--bg);
  font-family: var(--display); font-size: var(--s-lead); line-height: 1;
  padding: 0 var(--m);
  text-decoration: none;
  white-space: nowrap;
}
.tab {
  list-style: none; margin: 0; padding: 0 var(--m) 0 12px;
  flex: 1;
  display: flex; align-items: stretch; gap: 4px;
  background: var(--accent);
}
.tab a {
  white-space: nowrap;
  display: flex; align-items: center;
  min-height: 64px; padding: 0 14px;
  color: var(--bg); text-decoration: none; font-weight: 700;
  transition: background-color var(--dur-fast) var(--ease);
}
.bar-call {
  grid-column: 3;
  display: flex; align-items: center;
  padding: 0 var(--m);
  font-weight: 700; text-decoration: underline; text-decoration-thickness: 2px;
  min-height: 64px;
}

.mosaic {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: 1fr 1fr;
  height: clamp(300px, 40svh, 460px);
  overflow: hidden;
}
.cell { position: relative; overflow: hidden; min-height: 0; }
.cell picture, .cell img { width: 100%; height: 100%; }
.cell img { object-fit: cover; }
.c-garden { grid-column: 1 / 3; grid-row: 1; }
.tile-ox { grid-column: 3; grid-row: 1 / 3; background: var(--accent); color: var(--bg); display: flex; align-items: flex-end; padding: 20px; }
.tile-ox p { font-family: var(--display); font-size: var(--s-h3); line-height: 1.05; }
.c-door { grid-column: 4; grid-row: 1 / 3; }
.tile-surface { grid-column: 5; grid-row: 1; background: var(--surface); }
.c-kitchen { grid-column: 6; grid-row: 1 / 3; }
.tile-ink { grid-column: 1; grid-row: 2; background: var(--ink); }
.tile-surface2 { grid-column: 2; grid-row: 2; background: var(--surface); }
.c-bed { grid-column: 5; grid-row: 2; }
.c-door img { object-position: 50% 60%; }

/* ---------- hero text ---------- */
.hero {
  display: grid;
  grid-template-columns: var(--axis) 1fr;
  padding: clamp(40px, 5vw, 72px) var(--m) clamp(56px, 6vw, 96px);
  column-gap: 0;
}
.title {
  grid-column: 2; grid-row: 1 / 3;
  font-size: var(--s-title);
  line-height: 0.92;
  letter-spacing: -0.03em;
  padding-left: 0;
  align-self: start;
}
.title .line { display: block; }
.hero-side { grid-column: 1; grid-row: 1; padding-right: clamp(24px, 4vw, 64px); display: grid; gap: 20px; align-content: start; }
.standfirst { font-size: var(--s-lead); line-height: 1.3; max-width: 30ch; }
.beds, .lic-line { max-width: 36ch; }
.beds strong { color: var(--accent); }
.actions { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; margin-top: 4px; }

.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 56px; padding: 12px 24px;
  background: var(--accent); color: var(--bg);
  font: 700 var(--s-body)/1.2 var(--text);
  text-decoration: none; border: 0; border-radius: 0; cursor: pointer;
  user-select: none; -webkit-user-select: none;
  transition: background-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.button:active { transform: translateY(1px) scale(0.98); }
.textlink { display: inline-flex; align-items: center; min-height: 48px; font-weight: 700; }

/* ---------- intro: lead over two-by-two ---------- */
.intro { padding: clamp(24px, 3vw, 48px) var(--m) var(--gap-section); background: var(--bg); }
.lead { font-family: var(--display); font-size: var(--s-lead); line-height: 1.2; max-width: 46ch; }
.four {
  display: grid; grid-template-columns: 1fr 1fr; gap: 40px clamp(32px, 4vw, 64px);
  margin-top: 64px;
  margin-left: var(--axis);
}
.four p { max-width: 38ch; }
.four strong { display: block; font-weight: 700; margin-bottom: 4px; }

/* ---------- showcase band ---------- */
.showcase { padding-bottom: var(--gap-section); }
.showcase h2 { font-size: var(--s-head); padding: 0 var(--m); margin: 0 0 48px var(--axis); }
.band { display: flex; height: clamp(420px, 68svh, 720px); }
.panel { position: relative; overflow: hidden; min-width: 0; }
.panel picture, .panel img { width: 100%; height: 100%; }
.panel img { object-fit: cover; }
.p1 { flex: 5; } .p2 { flex: 2; } .p3 { flex: 3; } .p4 { flex: 2; }
.panel-title {
  position: absolute; left: 0; top: 0;
  background: var(--bg); color: var(--ink);
  font-family: var(--display); font-size: var(--s-h3); line-height: 1.05;
  padding: 16px 24px 18px var(--m);
  max-width: 14ch;
}
.caption { padding: 16px var(--m) 0; margin-left: var(--axis); max-width: 60ch; }

/* ---------- the room ---------- */
.room { padding: 0 var(--m) var(--gap-section); }
.room-head { margin-bottom: 64px; }
.room-head h2 { font-size: var(--s-head); }
.sub { font-size: var(--s-lead); line-height: 1.3; max-width: 40ch; margin-top: 20px; }
.room-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; align-items: start; }
.room-photo { grid-column: 1 / 9; position: relative; }
.room-photo img { aspect-ratio: 16 / 10; object-fit: cover; width: 100%; }
.room-note {
  position: absolute; top: 0; right: 0;
  width: min(360px, 48%);
  background: var(--bg);
  padding: 0 0 20px 24px;
}
.room-side { grid-column: 9 / 13; display: grid; gap: 32px; }
.clock {
  background: var(--accent); color: var(--bg);
  padding: 28px 24px;
  min-height: 260px;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 12px;
}
.clock-now { font-family: var(--display); font-size: var(--s-lead); line-height: 1.15; }
.pairs { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 20px; margin: 0; }
.pairs dt { font-weight: 700; }
.pairs dd { margin: 0; line-height: 1.45; }

/* ---------- care rows: photos in the side zone, text on the axis ---------- */
.care { padding: 0 var(--m) var(--gap-section); }
.care-head { margin-left: var(--axis); margin-bottom: 72px; }
.care-head h2 { font-size: var(--s-head); }
.row { display: grid; grid-template-columns: var(--axis) 1fr; margin-bottom: clamp(56px, 6vw, 96px); align-items: start; }
.row-text { grid-column: 2; grid-row: 1; max-width: 52ch; }
.row-text h3 { font-size: var(--s-h3); margin-bottom: 12px; }
.row-pic { grid-column: 1; grid-row: 1; justify-self: end; margin-right: clamp(24px, 4vw, 64px); }
.row-pic img { object-fit: cover; width: 100%; }
.w-a { width: 240px; } .w-a img { aspect-ratio: 4 / 5; }
.w-b { width: 320px; } .w-b img { aspect-ratio: 3 / 2; }
.license { margin-left: var(--axis); max-width: 52ch; background: var(--surface); padding: 24px; }

/* ---------- Elena ---------- */
.elena {
  display: grid; grid-template-columns: repeat(12, 1fr); gap: 0 16px;
  padding: 0 var(--m) var(--gap-section);
}
.elena-pic { grid-column: 2 / 6; }
.elena-pic img { aspect-ratio: 3 / 4; object-fit: cover; width: 100%; max-height: 78svh; }
.elena-text { grid-column: 7 / 13; padding-top: clamp(40px, 9vw, 120px); max-width: 60ch; }
.elena-text h2 { font-size: var(--s-head); margin-bottom: 32px; }
.quote { margin: 0 0 16px; }
.quote p { font-family: var(--display); font-size: var(--s-lead); line-height: 1.2; max-width: 34ch; }
.who { font-weight: 700; margin-bottom: 28px; }
.bio + .bio { margin-top: 16px; }

/* ---------- family quote: the oxblood page ---------- */
.family { background: var(--accent); color: var(--bg); padding: clamp(80px, 10vw, 160px) var(--m); }
.family figure { margin-left: var(--axis); max-width: 52ch; }
.family blockquote { margin: 0; }
.family blockquote p { font-family: var(--display); font-size: var(--s-lead); line-height: 1.2; }
.family figcaption { margin-top: 24px; }

/* ---------- FAQ: a band per question ---------- */
.faq-head {
  background: var(--surface);
  font-size: var(--s-head);
  min-height: 30svh;
  display: flex; align-items: flex-end;
  padding: 64px var(--m) 40px;
}
.q { display: grid; grid-template-columns: var(--axis) 1fr; padding: 48px var(--m); }
.q:nth-of-type(odd) { background: var(--bg); }
.q:nth-of-type(even) { background: var(--surface); }
.q h3 { font-size: var(--s-h3); padding-right: 32px; line-height: 1.1; }
.q p { max-width: 52ch; }

/* ---------- visit: say + form ---------- */
.visit {
  display: grid; grid-template-columns: var(--axis) 1fr;
  padding: var(--gap-section) var(--m);
  background: var(--bg);
}
.visit-say { padding-right: clamp(24px, 4vw, 64px); display: grid; gap: 20px; align-content: start; }
.visit-say h2 { font-size: var(--s-head); }
.visit-say > p:first-of-type { font-size: var(--s-lead); line-height: 1.3; max-width: 26ch; }
.visit-links { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.visit-pic { width: 160px; margin-top: 16px; }
.visit-pic img { aspect-ratio: 1; object-fit: cover; }
.form { display: grid; gap: 22px; max-width: 640px; background: var(--surface); padding: clamp(24px, 3vw, 40px); align-self: start; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 700; }
.opt { font-weight: 400; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
input, select, textarea {
  font: 400 var(--s-body)/1.4 var(--text);
  color: var(--ink);
  background: var(--bg);
  border: 2px solid var(--ink);
  border-radius: 0;
  min-height: 56px;
  padding: 12px 14px;
  width: 100%;
}
textarea { min-height: 120px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
input:user-invalid { border-color: var(--accent); border-width: 3px; }
.hp { position: absolute !important; left: -10000px; top: 0; opacity: 0; pointer-events: none; }
.form .button { justify-self: start; }

/* ---------- footer ---------- */
.footer { background: var(--accent); color: var(--bg); padding: clamp(56px, 7vw, 112px) var(--m) clamp(40px, 5vw, 72px); overflow: hidden; }
.footer-name { font-family: var(--display); font-size: var(--s-title); line-height: 0.95; letter-spacing: -0.03em; }
.footer-row { display: grid; grid-template-columns: var(--axis) 1fr; margin-top: 72px; gap: 32px 0; }
.footer address { font-style: normal; display: grid; gap: 10px; font-family: var(--display); font-size: var(--s-h3); line-height: 1.15; align-content: start; }
.footer address a { text-decoration-thickness: 2px; overflow-wrap: anywhere; display: inline-flex; align-items: center; min-height: 48px; }
.footer-facts { display: grid; gap: 14px; max-width: 52ch; align-content: start; }

/* ---------- phone call bar ---------- */
.callbar { display: none; }

/* ---------- hover only where hover exists ---------- */
@media (hover: hover) and (pointer: fine) {
  .button:hover { background: var(--ink); }
  .tab a:hover { background: var(--ink); }
  .textlink:hover, .bar-call:hover, a:hover { text-decoration-thickness: 3px; }
}

/* ---------- motion: transform only, content never hidden ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .title .line { animation: rise var(--dur-slow) var(--ease-emph) both; }
  .js .title .line + .line { animation-delay: 110ms; }
  .js .hero-side > * { animation: rise 600ms var(--ease-emph) both; animation-delay: 220ms; }
  .js .cell img { animation: settle 1400ms var(--ease-emph) both; }
  .js [data-reveal] > * { transform: translateY(18px); transition: transform var(--dur-slow) var(--ease-emph); }
  .js [data-reveal] > *:nth-child(2) { transition-delay: 80ms; }
  .js [data-reveal] > *:nth-child(3) { transition-delay: 160ms; }
  .js [data-reveal] > *:nth-child(n+4) { transition-delay: 240ms; }
  .js [data-reveal].is-in > * { transform: none; }
  .js .band.is-in .panel img { animation: settle 1400ms var(--ease-emph) both; }
}
@keyframes rise { from { transform: translateY(0.35em); } to { transform: none; } }
@keyframes settle { from { transform: scale(1.06); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ---------- tablet ---------- */
@media (max-width: 1100px) {
  :root { --axis: 34%; }
  .tab a { padding: 0 10px; }
  .four { grid-template-columns: 1fr; }
  .room-photo { grid-column: 1 / 13; }
  .room-side { grid-column: 1 / 13; grid-template-columns: 1fr 1fr; }
  .elena-pic { grid-column: 1 / 6; }
}
@media (max-width: 900px) {
  .q { grid-template-columns: 1fr; gap: 12px; }
  .q h3 { padding-right: 0; }
  .tab { display: none; }
  .bar { grid-template-columns: auto 1fr auto; }
  .bar-left { grid-column: 1; }
}

/* ---------- phone: its own composition ---------- */
@media (max-width: 700px) {
  :root { --axis: 0px; }
  body { padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
  .demo { padding: 8px var(--m); }
  .bar { min-height: 56px; }
  .wordmark { font-size: 1.5rem; }
  .bar-call { min-height: 56px; }
  .mosaic {
    grid-template-columns: 1.1fr 1fr 1fr;
    height: clamp(170px, 24svh, 240px);
  }
  .c-door { grid-column: 1; grid-row: 1 / 3; }
  .c-garden { grid-column: 2 / 4; grid-row: 1; }
  .tile-ox { grid-column: 2 / 4; grid-row: 2; padding: 10px 14px; align-items: center; }
  .tile-ox p { font-size: 1.375rem; }
  .tile-ox br { display: none; }
  .c-kitchen, .c-bed, .tile-ink, .tile-surface, .tile-surface2 { display: none; }
  .hero { grid-template-columns: 1fr; padding-top: 24px; padding-bottom: 48px; }
  .title { grid-column: 1; grid-row: 1; font-size: clamp(3rem, 13vw, 4.25rem); margin-bottom: 16px; }
  .hero-side { grid-column: 1; grid-row: 2; padding-right: 0; gap: 14px; }
  .standfirst { font-size: 1.25rem; }
  .beds { font-size: 1.125rem; }
  .actions .button { width: 100%; }
  .lead, .four, .showcase h2, .caption, .care-head, .license, .family figure { margin-left: 0; }
  .four { margin-top: 40px; gap: 28px; }
  .showcase h2 { margin-bottom: 32px; }
  .band { display: grid; grid-template-columns: 64fr 36fr; grid-template-rows: 1fr 1fr; height: 76svh; }
  .p1 { grid-column: 1; grid-row: 1; } .p2 { grid-column: 2; grid-row: 1; }
  .p3 { grid-column: 1; grid-row: 2; } .p4 { grid-column: 2; grid-row: 2; }
  .band { grid-template-areas: none; }
  .p3 { grid-column: 1; } 
  .panel-title { font-size: 1.375rem; padding: 12px 16px 14px var(--m); max-width: 12ch; }
  .room-head { margin-bottom: 36px; }
  .room-photo img { aspect-ratio: 4 / 3; }
  .room-note { position: static; width: auto; padding: 16px 0 0; background: none; }
  .room-side { grid-template-columns: 1fr; margin-top: 24px; }
  .clock { min-height: 0; }
  .pairs { grid-template-columns: 1fr; gap: 16px; }
  .care-head { margin-bottom: 48px; }
  .row { grid-template-columns: 1fr; margin-bottom: 56px; }
  .row-text { grid-column: 1; grid-row: 1; }
  .row-pic { grid-column: 1; grid-row: 2; margin: 24px 0 0; justify-self: start; }
  .w-a { width: 70%; justify-self: end; } .w-b { width: 100%; }
  .elena { grid-template-columns: 1fr; }
  .elena-pic { grid-column: 1; width: 72%; }
  .elena-text { grid-column: 1; padding-top: 32px; }
  .quote p { font-size: 1.5rem; }
  .family blockquote p { font-size: 1.5rem; }
  .faq-head { min-height: 26svh; padding: 40px var(--m) 28px; }
  .q { grid-template-columns: 1fr; gap: 12px; padding: 32px var(--m); }
  .q h3 { font-size: 1.5rem; padding-right: 0; }
  .visit { grid-template-columns: 1fr; gap: 40px; padding-top: 88px; padding-bottom: 88px; }
  .visit-say { padding-right: 0; }
  .visit-links .button { width: 100%; }
  .visit-pic { display: none; }
  .two { grid-template-columns: 1fr; }
  .form { padding: 20px; margin: 0 calc(var(--m) * -1); }
  .form .button { width: 100%; }
  .footer-row { grid-template-columns: 1fr; margin-top: 40px; }
  .footer address { font-size: 1.625rem; }
  .callbar {
    display: flex; align-items: center; justify-content: center;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    min-height: calc(64px + env(safe-area-inset-bottom, 0px));
    padding: 8px var(--m) calc(8px + env(safe-area-inset-bottom, 0px));
    background: var(--ink); color: var(--bg);
    font-weight: 700; font-size: 1.25rem; text-decoration: none;
    user-select: none; -webkit-user-select: none;
  }
  .callbar:active { background: var(--accent); }
}

/* ---------- thanks page ---------- */
.thanks { display: grid; grid-template-columns: var(--axis) 1fr; padding: clamp(64px, 8vw, 128px) var(--m) var(--gap-section); gap: 32px 0; }
.thanks > div, .thanks .actions { grid-column: 2; }
.thanks h1 { font-size: var(--s-head); }
.thanks-pic { grid-column: 1; grid-row: 1 / 3; width: min(320px, 80%); }
.thanks-pic img { aspect-ratio: 3 / 4; object-fit: cover; }
@media (max-width: 700px) {
  .thanks { grid-template-columns: 1fr; }
  .thanks > div, .thanks .actions, .thanks-pic { grid-column: 1; grid-row: auto; }
}
