/* MizarScot styles. The Figtree font is defined in fonts.css. */

:root {
  --colour-brand-teal: #007880;
  --colour-brand-teal-dark: #005a60;
  --colour-brand-teal-deep: #003a3e;
  --colour-brand-yellow: #f5c501;
  --colour-white: #ffffff;
  --colour-text-dark: #1a1a1a;
  --colour-text-muted: #4a5a5c;
  --colour-surface-tint: #eef5f5;
  --colour-rule: rgba(0, 90, 96, 0.16);
  --colour-hero-overlay: rgba(0, 58, 62, 0.88);
  --colour-footer-text-muted: #cfe3e4;
  --colour-footer-rule: rgba(255, 255, 255, 0.2);
  --colour-lightbox-backdrop: rgba(0, 28, 30, 0.9);
  --colour-lightbox-control: rgba(0, 28, 30, 0.75);
  --header-height: 4.75rem;
  --radius-photo: 0.875rem;
  --radius-control: 0.625rem;
}

* {
  box-sizing: border-box;
}

html {
  scroll-padding-top: calc(var(--header-height) + 1rem);
}

body {
  margin: 0;
  background: var(--colour-white);
  color: var(--colour-text-dark);
  font-family: "Figtree", system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

section,
.site-footer {
  padding-inline: max(1.25rem, calc((100% - 72rem) / 2));
}

section {
  padding-block: clamp(4rem, 9vw, 7rem);
}

h1,
h2,
h3 {
  margin: 0;
  text-wrap: balance;
}

h2 {
  font-size: clamp(2.125rem, 4.2vw, 3.25rem);
  font-weight: 750;
  line-height: 1.04;
  letter-spacing: -0.035em;
}

h2::after {
  display: block;
  width: 2.75rem;
  height: 0.25rem;
  margin-top: 1rem;
  border-radius: 1rem;
  background: var(--colour-brand-yellow);
  content: "";
}

p {
  margin: 0 0 1rem;
}

:focus-visible {
  outline: 3px solid var(--colour-text-dark);
  outline-offset: 3px;
}

.hero :focus-visible,
.site-footer :focus-visible,
.lightbox :focus-visible {
  outline-color: var(--colour-white);
}

.skip-link {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link:focus {
  top: 1rem;
  left: 1rem;
  z-index: 50;
  width: auto;
  height: auto;
  padding: 0.75rem 1rem;
  clip-path: none;
  background: var(--colour-brand-yellow);
  color: var(--colour-text-dark);
}

/* Header: slim, frosted and always in reach, with the phone number on larger screens */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 3px solid var(--colour-brand-yellow);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: saturate(1.4) blur(12px);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.5rem;
  min-height: var(--header-height);
  padding: 0.5rem max(1.25rem, calc((100% - 72rem) / 2));
}

.site-logo img {
  width: 6.75rem;
}

.nav-toggle {
  display: none;
  min-height: 2.75rem;
  margin-left: auto;
  padding: 0.5rem 1rem;
  border: 1.5px solid var(--colour-brand-teal-dark);
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--colour-brand-teal-dark);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.site-nav {
  width: 100%;
}

.site-nav-list,
.services-list,
.gallery-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav-list {
  display: flex;
  flex-direction: column;
}

.site-nav a {
  display: flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.5rem 0.25rem;
  color: var(--colour-text-dark);
  font-weight: 600;
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--colour-brand-teal-dark);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.35em;
}

.js-enabled .nav-toggle {
  display: inline-flex;
  align-items: center;
}

.js-enabled .site-nav {
  display: none;
}

.js-enabled .site-nav.site-nav-open {
  display: block;
}

.button-icon {
  flex-shrink: 0;
}

/* Buttons */
.button-primary,
.button-secondary,
.header-call,
.call-bar a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-control);
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.button-primary {
  border: 2px solid var(--colour-brand-yellow);
  background: var(--colour-brand-yellow);
  color: var(--colour-text-dark);
}

.button-primary:hover {
  border-color: var(--colour-white);
  background: var(--colour-white);
}

.button-secondary {
  border: 2px solid rgba(255, 255, 255, 0.85);
  background: transparent;
  color: var(--colour-white);
}

.button-secondary:hover {
  border-color: var(--colour-white);
  background: rgba(255, 255, 255, 0.12);
}

/* Phones use the call bar instead; the header button appears from 48em */
.header-call {
  display: none;
}

/* Hero: crops carried over unchanged from the approved site */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-top: 0;
  padding-bottom: 3rem;
  padding-inline: 1rem;
  overflow: hidden;
  background: var(--colour-brand-teal-dark);
  color: var(--colour-white);
}

.hero-media {
  position: relative;
  z-index: 0;
  aspect-ratio: 3 / 2;
  margin: 0 -1rem 1.5rem;
  overflow: hidden;
}

.hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 60% 64%;
  transform: scale(1.55);
  transform-origin: 60% 64%;
}

.hero-media::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 50%, var(--colour-brand-teal-dark) 90%);
  content: "";
}

/* A sweeping yellow curve, taken from the client's adverts, forms the hero's lower edge.
   It sits inside the existing bottom padding, so the hero keeps its height on phones. */
.hero::after {
  position: absolute;
  z-index: 2;
  right: -15%;
  bottom: -1.5rem;
  left: -15%;
  height: 3rem;
  border-top: 0.3125rem solid var(--colour-brand-yellow);
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  background: var(--colour-white);
  content: "";
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 40rem;
}

/* Phones match the live site's hero exactly; the premium type scale starts at 48em */
.hero h1 {
  margin-bottom: 1rem;
  font-size: clamp(2.25rem, 7vw, 4.5rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-wrap: wrap;
}

.hero-text {
  margin-bottom: 1.75rem;
  font-size: clamp(1.125rem, 2.5vw, 1.375rem);
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero-actions a {
  flex: 1 1 100%;
  min-height: 2.75rem;
  margin-top: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: 0.375rem;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.6;
}

/* Section intros: heading and lead share a row on wide screens */
.section-intro {
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.section-intro h2 {
  margin-bottom: 1.25rem;
}

.section-lead {
  max-width: 34rem;
  margin: 0;
  color: var(--colour-text-muted);
  font-size: clamp(1.125rem, 1.8vw, 1.25rem);
  line-height: 1.55;
}

/* Services: three equal photo-led areas, stacked on phones */
.room-grid {
  display: grid;
  gap: 3.5rem;
}

.room {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.room-photo-frame {
  aspect-ratio: 4 / 3;
  margin-bottom: 1.5rem;
  overflow: hidden;
  border-radius: var(--radius-photo);
  background: var(--colour-surface-tint);
}

.room-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.room-photo-mural {
  transform: scale(1.6);
  transform-origin: 92% 100%;
}

.room-title {
  margin-bottom: 0.75rem;
  font-size: clamp(1.5rem, 2.4vw, 1.875rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

/* Hairline rows make the services read as a clear, scannable list */
.service-item {
  padding-block: 0.7rem;
  border-top: 1px solid var(--colour-rule);
  font-weight: 500;
  line-height: 1.4;
}

.service-item:last-child {
  border-bottom: 1px solid var(--colour-rule);
}

/* Gallery on a pale tint, so the page has a clear rhythm of white and colour */
.gallery {
  background: var(--colour-surface-tint);
}

/* Layout matches the live site's gallery: two columns on phones with the first photo full width */
.gallery {
  padding-inline: 1rem;
}

.gallery h2 {
  margin-bottom: 1.5rem;
}

.gallery-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem 1rem;
}

.gallery-item {
  min-width: 0;
}

.gallery-item-feature {
  grid-column: 1 / -1;
}

.gallery-figure {
  margin: 0;
}

/* The link opens the photo pop-up; the layout is unchanged */
.gallery-link {
  display: block;
  overflow: hidden;
  border-radius: 0.5rem;
  cursor: zoom-in;
}

.gallery-link img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.gallery-figure figcaption {
  margin-top: 0.5rem;
  color: var(--colour-text-muted);
  font-size: 0.875rem;
}

/* "See more projects": a quiet outlined button, full width on phones like the hero buttons */
.gallery-more-button {
  display: block;
  width: 100%;
  min-height: 3rem;
  margin: 2rem auto 0;
  padding: 0.75rem 1.5rem;
  border: 2px solid var(--colour-brand-teal-dark);
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--colour-brand-teal-dark);
  font: inherit;
  font-size: 1.0625rem;
  font-weight: 650;
  line-height: 1.2;
  cursor: pointer;
}

.gallery-more-button[hidden] {
  display: none;
}

.gallery-more-button:hover,
.gallery-more-button:focus-visible {
  background: var(--colour-brand-teal-dark);
  color: var(--colour-white);
}

/* Footer: deep teal with a thin yellow line; the phone and email are the centrepiece */
.site-footer {
  padding-block: 3.5rem 1.5rem;
  border-top: 2px solid var(--colour-brand-yellow);
  background: var(--colour-brand-teal-deep);
  color: var(--colour-white);
}

.footer-grid {
  display: grid;
  gap: 2.5rem;
}

.footer-brand p {
  max-width: 30ch;
  margin: 0;
  color: var(--colour-footer-text-muted);
  font-size: 0.9375rem;
  line-height: 1.6;
}

/* The interim logo has a white background, so it sits on a small, quiet panel */
.footer-logo {
  display: inline-block;
  margin-bottom: 1.25rem;
  padding: 0.375rem 0.5rem;
  border-radius: 0.5rem;
  background: var(--colour-white);
}

.footer-logo img {
  width: 5.5rem;
}

.footer-heading {
  margin-bottom: 0.75rem;
  color: var(--colour-footer-text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0;
}

.footer-heading::after {
  display: none;
}

.footer-contact-list,
.footer-links-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-contact-link {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 2.75rem;
  color: var(--colour-white);
  font-size: clamp(1.375rem, 2.6vw, 2.25rem);
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.02em;
  overflow-wrap: normal;
  text-decoration: none;
}

.footer-links-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.75rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--colour-footer-rule);
}

.footer-links-list a,
.footer-top-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  color: var(--colour-footer-text-muted);
  font-weight: 400;
  text-decoration: none;
}

/* Links stay quiet until hovered or focused */
.footer-contact-link:hover,
.footer-contact-link:focus-visible,
.footer-links-list a:hover,
.footer-links-list a:focus-visible,
.footer-top-link:hover,
.footer-top-link:focus-visible {
  color: var(--colour-white);
  text-decoration: underline;
  text-decoration-color: var(--colour-brand-yellow);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.3em;
}

.footer-icon {
  flex-shrink: 0;
  color: var(--colour-brand-yellow);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 1.5rem;
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--colour-footer-rule);
  color: var(--colour-footer-text-muted);
  font-size: 0.875rem;
}

.footer-bottom p {
  margin: 0;
}

/* Phones: Call and Email stay one tap away */
.call-bar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 25;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.625rem;
  padding: 0.625rem 1rem calc(0.625rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--colour-rule);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(1.4) blur(12px);
}

.call-bar a {
  padding-inline: 1rem;
}

.call-bar-call {
  background: var(--colour-brand-yellow);
  color: var(--colour-text-dark);
}

.call-bar-email {
  background: var(--colour-brand-teal-dark);
  color: var(--colour-white);
}

body {
  padding-bottom: calc(4.25rem + env(safe-area-inset-bottom));
}

/* Lightbox */
.lightbox {
  width: fit-content;
  max-width: 92vw;
  max-height: 94vh;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--colour-white);
}

.lightbox::backdrop {
  background: var(--colour-lightbox-backdrop);
}

.lightbox-figure {
  margin: 0;
}

.lightbox-image {
  width: auto;
  max-width: 100%;
  max-height: 82vh;
  margin-inline: auto;
  border-radius: var(--radius-photo);
}

.lightbox-caption {
  margin-top: 0.875rem;
  text-align: center;
}

.lightbox-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0.5rem 1rem;
  border: 0;
  border-radius: var(--radius-control);
  background: var(--colour-lightbox-control);
  color: var(--colour-white);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

@media (min-width: 30em) {
  .hero-actions a {
    flex: 0 0 auto;
  }
}

@media (min-width: 48em) {
  .site-logo img {
    width: 8rem;
  }

  .nav-toggle,
  .js-enabled .nav-toggle {
    display: none;
  }

  .site-nav,
  .js-enabled .site-nav,
  .js-enabled .site-nav.site-nav-open {
    display: block;
    width: auto;
    margin-left: auto;
  }

  .site-nav-list {
    flex-direction: row;
    gap: 1.75rem;
  }

  .header-call {
    display: inline-flex;
    min-height: 2.75rem;
    padding: 0.5rem 1.125rem;
    background: var(--colour-brand-teal-dark);
    color: var(--colour-white);
  }

  .header-call:hover {
    background: var(--colour-brand-teal-deep);
  }

  .call-bar {
    display: none;
  }

  body {
    padding-bottom: 0;
  }

  .hero {
    padding-bottom: 4.5rem;
    padding-inline: max(1.25rem, calc((100% - 72rem) / 2));
  }

  .hero::after {
    bottom: -2.5rem;
    height: 5rem;
    border-top-width: 0.4375rem;
  }

  .hero-media {
    aspect-ratio: 16 / 9;
    margin: 0 -1.25rem 1.75rem;
  }

  .hero h1 {
    margin-bottom: 1.25rem;
    font-size: clamp(2.5rem, 7.2vw, 5rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.04em;
    text-wrap: balance;
  }

  .hero-text {
    max-width: 32rem;
    margin-bottom: 2rem;
    font-size: clamp(1.125rem, 2.2vw, 1.3125rem);
    line-height: 1.5;
  }

  .hero-actions a {
    min-height: 3rem;
    margin-top: 0;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-control);
    font-size: 1.0625rem;
    font-weight: 650;
    line-height: 1.2;
  }

  .section-intro {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
    gap: 3rem;
    align-items: end;
  }

  .section-intro h2 {
    margin-bottom: 0;
  }

  /* Three equal areas of the home in one aligned row */
  .room-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem;
    align-items: start;
  }

  .gallery {
    padding-inline: max(1.25rem, calc((100% - 72rem) / 2));
  }

  .gallery-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .gallery-more-button {
    width: auto;
    margin-top: 2.5rem;
  }

  /* The feature photo fills two rows so the grid stays rectangular */
  .gallery-item-feature {
    grid-column: 1;
    grid-row: span 2;
  }

  .gallery-item-feature .gallery-figure {
    display: flex;
    flex-direction: column;
    height: 100%;
  }

  .gallery-item-feature .gallery-link {
    flex: 1 1 0;
    min-height: 0;
  }

  .gallery-item-feature .gallery-link img {
    height: 100%;
    aspect-ratio: auto;
  }

  /* Brand on the left, contact on the right */
  .footer-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
    gap: 3rem;
    align-items: start;
  }
}

@media (min-width: 64em) {
  .site-logo img {
    width: 8.75rem;
  }

  .hero {
    min-height: min(85vh, 46rem);
    padding-top: 6rem;
    padding-bottom: 6.5rem;
  }

  .hero::after {
    bottom: -3.5rem;
    height: 7rem;
    border-top-width: 0.5rem;
  }

  .hero-media {
    position: absolute;
    inset: 0;
    aspect-ratio: auto;
    margin: 0;
    container-type: size;
  }

  .hero-image {
    --hero-image-width: max(105cqw, 280cqh);
    inset: 0 auto auto auto;
    right: calc(-1 * min(0.12 * var(--hero-image-width), var(--hero-image-width) - 100cqw));
    width: var(--hero-image-width);
    max-width: none;
    height: auto;
    transform: translateY(-23%);
  }

  .hero-media::after {
    background:
      linear-gradient(to top, var(--colour-hero-overlay) 0%, transparent 40%),
      linear-gradient(to right, var(--colour-hero-overlay) 0%, var(--colour-hero-overlay) 50%, transparent 85%);
  }

  .hero-content {
    max-width: 36rem;
  }

  .room-grid {
    gap: 3rem;
  }

  .site-footer {
    padding-block: 4.5rem 1.75rem;
  }

  /* The contact block sits close to the brand instead of halfway across the page */
  .footer-grid {
    grid-template-columns: minmax(0, 20rem) minmax(0, 1fr);
    gap: 5rem;
  }

  .footer-contact-link {
    font-size: 1.625rem;
  }

  .footer-logo img {
    width: 6rem;
  }

  .footer-bottom {
    margin-top: 4rem;
  }
}

/* One orchestrated moment: the hero text settles in once on load */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  /* Newly revealed photos settle in gently */
  .gallery-item-revealed {
    animation: gallery-item-reveal 0.4s ease-out both;
  }

  .hero-content > * {
    animation: hero-rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }

  .hero-content > :nth-child(2) {
    animation-delay: 0.08s;
  }

  .hero-content > :nth-child(3) {
    animation-delay: 0.16s;
  }
}

@keyframes hero-rise {
  from {
    opacity: 0;
    transform: translateY(0.75rem);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes gallery-item-reveal {
  from {
    opacity: 0;
    transform: translateY(0.75rem);
  }

  to {
    opacity: 1;
    transform: none;
  }
}
