/* Hollin Thwaite
 *
 * Colour from Lakeland building: limewashed walls for the page, Westmorland
 * slate for the ink, oak and brass on the key board, and holly red only on
 * the key fobs (hollin is the old Cumbrian word for holly).
 *
 * Type: Besley for headings and numbers, Public Sans for reading. Body text
 * starts at 18px because guests read this on a phone, often with large text.
 *
 * Sections: tokens, base, controls, header, footer, home, key board, rooms,
 * breakfast, staying, walks, booking, credits, motion. Mobile first.
 */

/* ---------- tokens ---------- */
:root {
  --lime: #f1f3f0;      /* limewash: the page */
  --lime-2: #e3e8e4;    /* panels, the board's wall */
  --line: #c9d1cb;
  --ink: #233430;       /* Westmorland slate: all text */
  --ink-2: #4a5b54;     /* secondary text, 7:1 on lime */
  --slate: #6f7f77;     /* borders that carry meaning, never body text */
  --holly: #8f2228;     /* key fobs, focus */
  --white: #fbfcfa;

  --head: "Besley", "Clarendon", "Rockwell", Georgia, serif;
  --body: "Public Sans", "Segoe UI", system-ui, sans-serif;

  --gutter: 20px;
  --max: 1180px;
  --bar: var(--sc-demo-bar, 0px);
  --radius: 3px;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--bar) + 76px); }
body {
  margin: 0;
  padding-top: var(--bar);
  background: var(--lime);
  color: var(--ink);
  font: 400 1.125rem/1.6 var(--body);
  overflow-wrap: break-word;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--holly); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--head); font-weight: 500; line-height: 1.15; margin: 0 0 0.5em; text-wrap: balance; }
h1 { font-size: clamp(2rem, 6.4vw, 3.4rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.6rem, 4.4vw, 2.2rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
p, dd, li { text-wrap: pretty; }
figure { margin: 0; }
address { font-style: normal; }
.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 12px; top: calc(var(--bar) + 12px); z-index: 60; background: var(--white); padding: 10px 14px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
main > * { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 10px 22px;
  border: 2px solid var(--ink); border-radius: var(--radius);
  background: var(--ink); color: var(--lime);
  font: 600 1.05rem/1.2 var(--body); text-decoration: none; text-align: center;
  cursor: pointer;
}
.btn:hover { background: #1a2825; }
.btn--quiet { background: transparent; color: var(--ink); }
.btn--quiet:hover { background: var(--lime-2); }
.input {
  width: 100%; min-height: 48px; padding: 10px 12px;
  border: 1.5px solid var(--slate); border-radius: var(--radius);
  background: var(--white); color: var(--ink);
  font: 400 1.05rem/1.3 var(--body);
}
textarea.input { min-height: 96px; resize: vertical; }
.input:focus-visible { outline-offset: 0; border-color: var(--ink); }
label, legend { display: block; font-weight: 600; margin-bottom: 6px; }

/* ---------- header ---------- */
.top {
  position: sticky; top: var(--bar); z-index: 40;
  background: var(--lime);
  border-bottom: 1px solid var(--line);
}
.top__in {
  width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto;
  display: flex; align-items: center; gap: 8px; min-height: 60px;
}
.brand { font: 700 clamp(1.1rem, 5vw, 1.3rem)/1 var(--head); white-space: nowrap; text-decoration: none; margin-right: auto; padding: 8px 0; }
.top__call, .top__menu {
  min-height: 44px; padding: 8px 14px; border-radius: var(--radius);
  font: 600 1rem/1 var(--body); color: var(--ink);
}
.top__call { display: inline-flex; align-items: center; text-decoration: none; border: 1.5px solid var(--ink); }
.top__menu { background: none; border: 1.5px solid transparent; cursor: pointer; }
.top__menu[aria-expanded="true"] { border-color: var(--line); background: var(--lime-2); }
.nav { display: none; }
.nav.is-open {
  display: block; position: absolute; left: 0; right: 0; top: 100%;
  background: var(--lime); border-bottom: 1px solid var(--line);
  padding: 8px var(--gutter) 20px;
}
.nav ul { list-style: none; margin: 0; padding: 0; }
.nav a { display: block; padding: 12px 0; font-size: 1.15rem; text-decoration: none; }
.nav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; }
.nav__book a { font-weight: 600; }

@media (min-width: 900px) {
  .top__menu, .top__call { display: none; }
  .nav, .nav.is-open { display: block; position: static; padding: 0; border: 0; background: none; }
  .nav ul { display: flex; gap: 26px; align-items: center; }
  .nav a { padding: 8px 0; font-size: 1rem; }
  .nav__book a { border: 1.5px solid var(--ink); padding: 9px 16px; border-radius: var(--radius); }
}

/* ---------- footer ---------- */
.foot { margin-top: 96px; background: var(--ink); color: var(--lime); }
.foot a { color: var(--lime); }
.foot__in {
  width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto;
  display: grid; gap: 28px; padding: 48px 0 32px;
}
.foot__name { font: 700 1.5rem/1.2 var(--head); margin-bottom: 8px; }
.foot__reach a { font-weight: 600; }
.foot__links { list-style: none; margin: 0; padding: 0; columns: 2; }
.foot__links li { padding: 4px 0; }
.foot__demo {
  width: min(100% - 2 * var(--gutter), var(--max)); margin: 0 auto; padding: 20px 0 32px;
  border-top: 1px solid #3d504a; color: #c9d3ce; font-size: 0.95rem;
}
@media (min-width: 800px) { .foot__in { grid-template-columns: 1fr 1fr 1fr; } }

/* ---------- home ---------- */
.intro { display: grid; gap: 28px; padding-top: 24px; }
.intro h1 { margin-bottom: 14px; }
.intro__lede { font-size: 1.2rem; color: var(--ink-2); max-width: 34em; }
.reach { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 12px; }
.reach li { display: grid; }
.reach__main { font: 700 1.3rem/1.3 var(--head); text-decoration: none; overflow-wrap: anywhere; }
.reach__main:hover { text-decoration: underline; }
.reach span { color: var(--ink-2); font-size: 1rem; }
@media (min-width: 1000px) {
  .intro { grid-template-columns: 1fr 1.08fr; gap: 56px; align-items: start; padding-top: 56px; }
  .intro__text { padding-top: 12px; }
}

.house { display: grid; gap: 24px; margin-top: 80px; }
.house__photo img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; object-position: 50% 62%; }
.house__text { max-width: 38em; }
@media (min-width: 900px) {
  .house { grid-template-columns: 1.5fr 1fr; gap: 48px; align-items: end; }
}

.rooms { margin-top: 88px; }
.rooms__intro { color: var(--ink-2); max-width: 36em; }
.roomlist { list-style: none; margin: 28px 0 0; padding: 0; }
.roomlist__item {
  display: grid; grid-template-columns: 42px 1fr; column-gap: 16px;
  padding: 22px 0; border-top: 1px solid var(--line);
}
.roomlist__item:last-child { border-bottom: 1px solid var(--line); }
.roomlist .fob { width: 42px; grid-row: span 2; }
.roomlist h3 { margin-bottom: 6px; }
.roomlist h3 a { text-decoration: none; }
.roomlist h3 a:hover { text-decoration: underline; }
.roomlist p { margin-bottom: 4px; }
.roomlist__facts { color: var(--ink-2); font-size: 1rem; }
.roomlist__price { grid-column: 2; font: 700 1.3rem/1.2 var(--head); margin: 8px 0 0; }
.roomlist__price span { font: 400 1rem var(--body); color: var(--ink-2); }
@media (min-width: 800px) {
  .roomlist__item { grid-template-columns: 52px 1fr 160px; column-gap: 28px; align-items: start; }
  .roomlist .fob { width: 48px; grid-row: auto; }
  .roomlist__price { grid-column: auto; text-align: right; margin-top: 4px; }
}

.fob path { fill: var(--holly); }
.fob circle { fill: var(--lime); }
.fob text { font: 700 26px var(--head); fill: #f3efe2; }

.eat { display: grid; gap: 24px; margin-top: 88px; }
.eat__photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
@media (min-width: 900px) { .eat { grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; } }

.ask { margin-top: 88px; }
.answers { margin-block: 24px; display: grid; gap: 28px; }
.answers dt { font: 500 1.25rem/1.3 var(--head); margin-bottom: 6px; }
.answers dd { margin: 0; max-width: 36em; }
@media (min-width: 900px) { .answers { grid-template-columns: 1fr 1fr; column-gap: 56px; row-gap: 36px; } }

.out { margin-top: 88px; }
.walklist { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 16px; }
.walklist li { display: grid; }
.walklist a { font: 500 1.25rem/1.3 var(--head); }
.walklist span { color: var(--ink-2); }

/* ---------- key board ---------- */
.keys {
  background: var(--lime-2);
  padding: 20px var(--gutter) 24px;
  margin-inline: calc(-1 * var(--gutter));
}
.keys h2 { font-size: 1.6rem; margin-bottom: 14px; }
.when { display: grid; grid-template-columns: 1fr 96px; gap: 12px; align-items: end; margin-bottom: 18px; }
.when__go { grid-column: 1 / -1; }
.js .when__go { display: none; }
.keys__board { position: relative; }
.board { display: block; width: 100%; height: auto; }
.keys__hits { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(5, 1fr); }
.keys__hit {
  appearance: none; border: 0; background: transparent; margin: 24% 4% 3%; padding: 0;
  border-radius: 8px; cursor: pointer;
}
.keys__hit:focus-visible { outline: 3px solid var(--white); box-shadow: 0 0 0 6px var(--holly); }
.keys__say { margin: 16px 0 0; font-size: 1.1rem; min-height: 3.2em; }
.keys__say strong { font-weight: 600; }
.linkish { font: inherit; color: inherit; background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 0.18em; cursor: pointer; }
.keys__board.is-resting .board { opacity: 0.55; }
.keys__room { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.keys__room h3 { display: flex; align-items: center; gap: 12px; font-size: 1.5rem; margin-bottom: 8px; }
.keys__room h3 .fob { width: 30px; flex: none; }
.keys__room .price { font: 700 1.4rem/1.3 var(--head); margin: 12px 0 4px; }
.keys__room .price + p { color: var(--ink-2); font-size: 1rem; }
.keys__acts { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; margin-top: 16px; }
.keys__acts .btn { flex: 1 1 260px; }
@media (min-width: 600px) {
  .keys { margin-inline: 0; padding: 28px 28px 30px; border-radius: var(--radius); }
  .when { grid-template-columns: 1fr 120px; }
}

/* the drawing */
.board__oak { stroke: #6e4f30; stroke-width: 1.5; }
.board__bevel { fill: none; stroke: #b48c60; stroke-opacity: 0.5; stroke-width: 1.2; }
.board__grain { fill: none; stroke: #6e4f30; stroke-width: 1.2; opacity: 0.45; }
.board__screw { fill: #c7a254; stroke: #6b4f20; }
.hook__num { font: 700 26px var(--head); fill: #f3efe2; }
.hook--taken .hook__num, .hook--closed .hook__num { opacity: 0.6; }
.hook__mark { fill: #6f4c2b; opacity: 0; transition: opacity 0.4s; }
.hook--taken .hook__mark, .hook--closed .hook__mark { opacity: 0.5; }
.hook__plate { fill: #d2ad5c; stroke: #6b4f20; }
.hook__cup { fill: none; stroke: #c9a24e; stroke-width: 3.2; stroke-linecap: round; }
.key__shadow { fill: #3b2510; opacity: 0.35; filter: url(#ht-soft); }
.key__ring { fill: none; stroke: #a7a79f; stroke-width: 1.8; }
.key__bow { fill: none; stroke: #c9a24e; stroke-width: 3.6; }
.key__metal { fill: #c9a24e; stroke: #8d6d2b; stroke-width: 0.8; }
.key__fob { fill: var(--holly); stroke: #5e1217; stroke-width: 1; }
.key__shine { fill: none; stroke: #fff; stroke-opacity: 0.22; stroke-width: 3; stroke-linecap: round; }
.key__eye { fill: #7a5532; stroke: #4a0f13; }
.key__num { font: 700 25px var(--head); fill: #f3efe2; }
.key__hit { fill: transparent; }
.key__swing { transform-box: fill-box; transform-origin: 50% 0; transition: transform 0.25s ease-out; }
.is-selected .key__swing { transform: translateY(-5px); }
.is-selected .key__fob { fill: #a62a31; }

/* ---------- inner pages ---------- */
.pagehead { padding-top: 40px; margin-bottom: 40px; }
.pagehead p { font-size: 1.2rem; color: var(--ink-2); max-width: 36em; }
.note { color: var(--ink-2); font-size: 1rem; margin-top: 48px; }

/* rooms */
.room { display: grid; gap: 20px; margin-bottom: 72px; scroll-margin-top: calc(var(--bar) + 76px); }
.room__view img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.room__view figcaption { font-size: 0.98rem; color: var(--ink-2); margin-top: 8px; }
.room h2 { display: flex; align-items: center; gap: 14px; }
.room h2 .fob { width: 34px; flex: none; }
.facts { margin: 20px 0 24px; display: grid; gap: 0; }
.facts div { display: grid; grid-template-columns: 7.5em 1fr; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.facts dt { font-weight: 600; }
.facts dd { margin: 0; }
@media (min-width: 900px) {
  .room { grid-template-columns: 1.25fr 1fr; gap: 48px; align-items: start; }
  .room:nth-of-type(even) .room__view { order: 2; }
}

/* breakfast */
.menu { display: grid; gap: 32px; }
.menu__photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.menu__card { max-width: 38em; }
.menu__card h2 { font-size: 1.5rem; margin-top: 1.4em; }
.menu__card h2:first-child { margin-top: 0; }
.menu__card dl { margin: 0; }
.menu__card dl div { padding: 10px 0; }
.menu__card dt { font-weight: 600; }
.menu__card dd { margin: 0; color: var(--ink-2); }
@media (min-width: 900px) {
  .menu { grid-template-columns: 1fr 1.1fr; gap: 56px; align-items: start; }
  .menu__photo { position: sticky; top: calc(var(--bar) + 90px); }
}

/* staying */
.answers--all { margin-top: 0; }
.answers--all > div { scroll-margin-top: calc(var(--bar) + 76px); }
.find { margin-top: 80px; scroll-margin-top: calc(var(--bar) + 76px); }
.find__cols { display: grid; gap: 8px; }
.find h3 { margin-top: 1em; }
.find__address { font-weight: 600; margin-top: 12px; }
@media (min-width: 900px) { .find__cols { grid-template-columns: repeat(3, 1fr); gap: 40px; } }

/* walks */
.walk { display: grid; gap: 20px; margin-bottom: 64px; scroll-margin-top: calc(var(--bar) + 76px); }
.walk__photo img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.walk__numbers { font: 700 1.15rem/1.4 var(--head); }
.walk__grade { color: var(--ink-2); }
@media (min-width: 900px) { .walk { grid-template-columns: 1fr 1.2fr; gap: 48px; align-items: center; } }

/* booking: styled apart from the site, as a booking system's page would be */
.demo-note { border-left: 4px solid var(--holly); padding: 4px 0 4px 14px; font-size: 1.05rem !important; }
.booking { display: grid; gap: 32px; max-width: 1000px; }
.booking__sum { background: var(--lime-2); padding: 22px; border-radius: var(--radius); }
.booking__sum h2 { display: flex; align-items: center; gap: 12px; font-size: 1.5rem; }
.booking__sum h2 .fob { width: 30px; }
.booking__sum dl { margin: 12px 0 0; }
.booking__sum dl div { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-top: 1px solid var(--line); }
.booking__sum dt { color: var(--ink-2); }
.booking__sum dd { margin: 0; font-weight: 600; text-align: right; }
.booking__sum .total dd { font: 700 1.3rem var(--head); }
.booking__form { max-width: 34em; }
.booking__form h2 { font-size: 1.5rem; }
.field { margin: 0 0 20px; border: 0; padding: 0; }
.field--check { display: flex; gap: 12px; align-items: flex-start; }
.field--check input { width: 24px; height: 24px; margin: 2px 0 0; flex: none; accent-color: var(--ink); }
.field--check label { font-weight: 400; }
.hint { color: var(--ink-2); font-size: 0.98rem; margin: 6px 0 0; }
.opt { font-weight: 400; color: var(--ink-2); }
.input[aria-invalid="true"] { border-color: var(--holly); border-width: 2px; }
.field-error { color: var(--holly); font-weight: 600; font-size: 1rem; margin: 6px 0 0; }
.form-error:empty { display: none; }
.form-error { color: var(--holly); font-weight: 600; }
.booking__pay { color: var(--ink-2); }
.booking__done { background: var(--lime-2); padding: 26px; border-radius: var(--radius); }
.booking__done:focus { outline: none; }
@media (min-width: 900px) {
  .booking { grid-template-columns: 1fr 1.2fr; gap: 56px; align-items: start; }
  .booking__sum { position: sticky; top: calc(var(--bar) + 90px); }
  .booking__done { grid-column: 2; }
}

/* credits */
.credits { list-style: none; padding: 0; margin-block: 0; display: grid; gap: 16px; }
.credits li { display: grid; }
.credits span { color: var(--ink-2); font-size: 1rem; }

/* ---------- motion ---------- */
/* One moment only: when the dates change, the keys of free rooms drop back
   onto their hooks and settle. */
@keyframes settle {
  0% { transform: translateY(-14px) rotate(0deg); opacity: 0; }
  45% { transform: translateY(0) rotate(5deg); opacity: 1; }
  70% { transform: rotate(-3deg); }
  88% { transform: rotate(1.2deg); }
  100% { transform: rotate(0deg); }
}
.board.is-fresh .key__swing { animation: settle 0.8s ease-out both; }
.board.is-fresh .hook:nth-child(5n + 2) .key__swing { animation-delay: 0.03s; }
.board.is-fresh .hook:nth-child(5n + 4) .key__swing { animation-delay: 0.06s; }
@media (prefers-reduced-motion: reduce) {
  .board.is-fresh .key__swing { animation: none; }
  .key__swing, .hook__mark { transition: none; }
}
