@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  --blue: #0033cc;      /* taken from the RPS logo */
  --blue-deep: #00218a;
  --ink: #11151f;
  --soft: #4b5263;
  --primer: #eceef1;
  --line: #d3d7de;
  --white: #fff;
  --gap: clamp(1rem, 2.4vw, 1.75rem);
  --space: clamp(3.5rem, 8vw, 6.5rem);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 6rem; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 400 1.0625rem/1.6 "Archivo", "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--white);
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--blue); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
h1, h2, h3 { margin: 0; line-height: 1.12; text-wrap: balance; }
h1, h2 { font-stretch: 118%; font-weight: 800; letter-spacing: -.015em; }
h2 { font-size: clamp(1.65rem, 3.4vw, 2.5rem); }
h3 { font-size: 1.2rem; font-weight: 700; }
p { margin: 0; max-width: 64ch; text-wrap: pretty; }
ul { margin: 0; padding: 0; list-style: none; }

.wrap { width: min(100% - 2.5rem, 76rem); margin-inline: auto; }
.block { padding-block: var(--space); }
.grey { background: var(--primer); }
.lead { margin-top: 1rem; color: var(--soft); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 20; background: var(--white); padding: .6rem 1rem; }

/* Buttons */
.btn {
  display: inline-block;
  padding: .8rem 1.3rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  border: 2px solid transparent;
  border-radius: 3px;
}
.btn.call { background: var(--blue); color: var(--white); }
.btn.call:hover { background: var(--blue-deep); }
.btn.light { background: var(--white); color: var(--blue); }
.btn.light:hover { background: var(--primer); }
.btn.outline { border-color: rgb(255 255 255 / .65); color: var(--white); }
.btn.outline:hover { border-color: var(--white); background: rgb(255 255 255 / .12); }

/* Header */
.top { position: sticky; top: 0; z-index: 10; background: var(--white); border-bottom: 1px solid var(--line); }
.top-row { display: flex; align-items: center; gap: 1.5rem; padding-block: .6rem; }
.logo img { width: 134px; }
.top nav { display: flex; gap: 1.6rem; margin-left: auto; }
.top nav a { color: var(--ink); text-decoration: none; font-weight: 600; padding-block: .5rem; white-space: nowrap; }
.top nav a:hover { color: var(--blue); text-decoration: underline; }

/* Hero */
.hero { position: relative; background: var(--blue); color: var(--white); overflow: hidden; }
.hero-photo { position: absolute; inset: 0 0 0 auto; width: 60%; clip-path: polygon(16% 0, 100% 0, 100% 100%, 0 100%); }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 30% 35%; }
.hero-text { position: relative; width: 41%; padding-block: clamp(3rem, 5.5vw, 5rem); }
.hero h1 { font-size: clamp(2.1rem, 3.35vw, 3rem); line-height: 1.06; }
.hero p { margin-top: 1.3rem; font-size: 1.15rem; max-width: 34ch; }
.hero .place { font-size: 1rem; }
.hero .place a { color: inherit; }
.hero :focus-visible, .contact :focus-visible { outline-color: var(--white); }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.8rem; }

/* Paint chips */
.colours { padding-block: clamp(2.5rem, 5vw, 4rem); background: var(--primer); }
.colours h2 { font-size: clamp(1.3rem, 2.2vw, 1.6rem); }
.colours p { margin-top: .4rem; color: var(--soft); }
.chips { display: grid; grid-template-columns: repeat(12, 1fr); gap: .6rem; margin-top: 1.6rem; }
.chips a {
  display: flex; flex-direction: column; height: 100%;
  background: var(--white); color: var(--ink); text-decoration: none;
  font-size: .82rem; line-height: 1.25; font-weight: 600;
  border-radius: 3px; overflow: hidden;
  box-shadow: 0 1px 2px rgb(17 21 31 / .16);
  transition: transform .18s ease;
}
.chips a::before { content: ""; height: 7rem; background: linear-gradient(155deg, rgb(255 255 255 / .3), transparent 42%) var(--paint); }
.chips a::before { box-shadow: inset 0 -1px 0 rgb(17 21 31 / .1); }
.chips span { padding: .55rem .6rem .7rem; }
.chips a:hover { transform: translateY(-5px); }

/* Services */
.services { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 6vw, 5rem); margin-top: 2.2rem; }
.services h3 { font-size: 1.35rem; padding-bottom: .8rem; border-bottom: 3px solid var(--blue); }
.services li { padding-block: .65rem; border-bottom: 1px solid var(--line); }
.note { margin-top: 2.2rem; color: var(--soft); }

/* Paint shop */
.shop { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
.shop-text p { margin-top: 1.2rem; }
.shop-photos { display: grid; grid-template-columns: repeat(6, 1fr); gap: .75rem; }
.shop-photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; grid-column: span 2; border-radius: 3px; }
.shop-photos img:nth-child(-n+2) { grid-column: span 3; }

/* Gallery */
#gallery h3 { margin-top: 2.6rem; font-size: 1.35rem; }
.projects { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); margin-top: 1.1rem; }
.project { color: var(--ink); text-decoration: none; scroll-margin-top: 1.5rem; }
.project .frame { display: block; overflow: hidden; border-radius: 3px; background: var(--primer); }
.project img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .35s ease; }
.project:hover img { transform: scale(1.035); }
.project .label { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding-top: .7rem; }
.project strong { font-weight: 700; }
.project:hover strong { color: var(--blue); text-decoration: underline; }
.project small { font-size: .92rem; color: var(--soft); white-space: nowrap; }
.project em { display: block; font-style: normal; font-size: .92rem; color: var(--soft); }
.project:target .frame { outline: 4px solid var(--blue); outline-offset: 3px; }

/* Award */
.award { background: var(--ink); color: var(--white); padding-block: clamp(3rem, 6vw, 5rem); }
.award-row { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: var(--gap); align-items: center; }
.award h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
.award blockquote { margin: 1.2rem 0; font-size: 1.2rem; line-height: 1.5; }
.award blockquote p::before { content: "\201C"; }
.award blockquote p::after { content: "\201D"; }
.award div > p { color: #c3c9d6; }
.award img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 3px; }

/* Spares */
.spares { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem var(--gap); margin-top: 2.2rem; }
.spares p { margin-top: .5rem; }
.spares img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 3px; }

/* Contact */
.contact { background: var(--blue); color: var(--white); padding-block: var(--space); }
.contact a { color: inherit; }
.contact-row { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 6vw, 5rem); }
.contact p { margin-top: 1.2rem; max-width: 40ch; font-size: 1.1rem; }
.contact dl { margin: 0; display: grid; gap: 1.5rem; }
.contact dt { color: #c9d5ff; }
.contact dd { margin: 0; font-size: 1.15rem; overflow-wrap: anywhere; }
.contact .big { font-size: clamp(2rem, 4.4vw, 3rem); font-weight: 800; font-stretch: 112%; line-height: 1.15; text-decoration: none; white-space: nowrap; }
.contact .big:hover { text-decoration: underline; }

footer { background: var(--blue-deep); color: #c9d5ff; padding-block: 1.4rem; font-size: .92rem; }

/* Photo viewer */
#viewer { width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #0b0e15; color: var(--white); }
#viewer[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); grid-template-columns: minmax(0, 1fr); }
#viewer::backdrop { background: #0b0e15; }
#viewer :focus-visible { outline-color: var(--white); outline-offset: -3px; }
#viewer-photos:focus { outline: none; }
.viewer-bar { display: flex; align-items: center; gap: 1rem; padding: .8rem 1.25rem; }
.viewer-bar h2 { font-size: 1.1rem; }
#viewer-count { margin-left: auto; color: #c3c9d6; white-space: nowrap; font-variant-numeric: tabular-nums; }
#viewer button { font: inherit; font-weight: 700; color: var(--ink); background: var(--white); border: 0; border-radius: 3px; cursor: pointer; }
#viewer #viewer-close { padding: .6rem 1rem; }
#viewer-photos { display: flex; min-height: 0; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; }
#viewer-photos::-webkit-scrollbar { display: none; }
#viewer-photos img { flex: 0 0 100%; width: 100%; height: 100%; min-width: 0; object-fit: scale-down; scroll-snap-align: center; scroll-snap-stop: always; padding: 0 1rem 1.25rem; }
#viewer .step { position: absolute; top: 50%; width: 3rem; height: 3.5rem; margin-top: -1.5rem; padding: 0; display: grid; place-items: center; }
#viewer .step[hidden] { display: none; }
.step.prev { left: 1rem; }
.step.next { right: 1rem; }
.step svg { width: 1.5rem; fill: none; stroke: currentColor; stroke-width: 2.6; }

@media (max-width: 1000px) {
  .chips { grid-template-columns: repeat(6, 1fr); }
  .shop { grid-template-columns: 1fr; }
  .award-row { grid-template-columns: 1fr 1fr; }
  .award-row > div { grid-column: 1 / -1; }
  .top nav { gap: 1.1rem; }
}

@media (max-width: 820px) {
  html { scroll-padding-top: 1.5rem; }
  .top { position: static; border: 0; }
  .top-row { flex-wrap: wrap; gap: .5rem 1rem; justify-content: space-between; padding-bottom: 0; }
  .top nav { order: 3; width: 100%; margin: 0 0 .2rem; gap: .5rem; justify-content: space-between; }
  .top nav a { font-size: .98rem; padding-block: .6rem; }
  .logo img { width: 112px; }
  .top .btn { padding: .7rem 1rem; }

  .hero-photo { position: static; width: 100%; clip-path: polygon(0 0, 100% 0, 100% 88%, 0 100%); }
  .hero-photo img { aspect-ratio: 16 / 10; height: auto; }
  .hero-text { width: 100%; padding-block: 1.6rem 2.8rem; }
  .hero p { max-width: 46ch; margin-top: 1rem; }

  .projects { grid-template-columns: 1fr 1fr; }
  .project:first-child { grid-column: 1 / -1; }
  #viewer .step { top: auto; bottom: 1.25rem; margin: 0; width: 4rem; }
  #viewer-photos img { padding-bottom: 5.75rem; }
  .contact-row { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .chips { grid-template-columns: repeat(3, 1fr); }
  .chips a::before { height: 4.5rem; }
  .services { grid-template-columns: 1fr; }
  .shop-photos img, .shop-photos img:nth-child(-n+2) { grid-column: span 3; }
  .shop-photos img:last-child { grid-column: 1 / -1; }
  .project .label { display: block; padding-top: .5rem; }
  .project small { display: block; }
  .projects { gap: 1.4rem .75rem; }
  .spares { grid-template-columns: 1fr; gap: 1.4rem; }
}

@media (max-width: 350px) {
  .top nav a { font-size: .86rem; }
  .top .btn { padding: .65rem .7rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .chips a, .project img { transition: none; }
  .chips a:hover, .project:hover img { transform: none; }
}
