/*
  H2 Interiors — the only stylesheet of the site: tokens, base, layout and components.
  Sizes, colours and breakpoints mirror the live Elementor page (post 412, kit 8):
  tablet <= 1024px, phone <= 767px, slider phone mode <= 780px (its own custom HTML breakpoint).
*/

@font-face {
  font-family: "Forum";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/forum-latin-400.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --red: #ef5646;
  --ink: #313131;
  --ink-nav: #252525;
  --ink-muted: #54595f;
  --menu-ink: #33373d;
  --menu-hover: #3f444b;
  --footer-bg: #f6fafc;
  --white: #fff;
  --font: "Forum", sans-serif;
  --photo-fade: linear-gradient(180deg, rgb(255 255 255 / 0) 82%, #000 100%);
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--white);
  color: #333;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

img {
  display: block;
  max-width: 100%; /* non-text: an image never overflows its box */
  height: auto;
}

h1,
h2,
p,
ul,
address {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

address {
  font-style: normal;
}

a {
  color: var(--red);
  text-decoration: none;
}

b {
  font-weight: 700;
}

button {
  font: inherit;
}

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

main:focus {
  outline: none;
}

.visually-hidden {
  position: absolute;
  width: 1px; /* non-text: screen-reader-only label, never rendered */
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  border: 0;
  white-space: normal;
}

.skip-link {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 10000;
  padding: 10px 16px;
  background: var(--white);
  color: var(--ink-nav);
  font-size: 18px;
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.25);
  transform: translateY(calc(-100% - 20px));
}

.skip-link:focus {
  transform: none;
}

/* Full-bleed photo that fills its positioned box. */
.cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 9999;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: var(--white);
}

/* Exact source ratios: the small srcset files round their height, which would shift the page by a fraction of a pixel. */
.site-header__logo {
  align-self: flex-start;
  width: 75px;
  aspect-ratio: 460 / 446;
}

.site-nav {
  align-self: flex-end;
}

.site-nav__list {
  display: flex;
  gap: 45px;
}

.site-nav__link {
  display: block;
  padding: 13px 0;
  color: var(--ink-nav);
  font-size: 30px;
  line-height: 20px;
  text-transform: lowercase;
  transition: color 0.4s;
}

.site-nav__link:hover,
.site-nav__link:focus,
.site-nav__link.is-active {
  color: var(--red);
}

.menu-toggle {
  display: none;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  height: max(70vh, 240px);
  overflow: hidden;
}

.hero .cover {
  object-position: center bottom;
}

.hero::after,
.photo-band__layer::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--photo-fade);
  opacity: 0.7;
  pointer-events: none;
}

/* ---------- Photo band with parallax layer ---------- */

.photo-band {
  position: relative;
  height: max(75vh, 240px);
  overflow: hidden;
}

.photo-band--tall {
  height: max(85vh, 240px);
}

.photo-band__layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 115%;
  transform: translate3d(0, var(--parallax-y, 0px), 0);
}

/* ---------- Anchor spacers ---------- */

.anchor {
  height: 20px;
  scroll-margin-top: -10px;
}

/* ---------- Slider ---------- */

.slider__viewport {
  position: relative;
  height: 45vh;
  min-height: 320px;
  overflow: hidden;
  background: var(--white);
  container-type: inline-size;
}

.slider__track {
  display: flex;
  height: 100%;
  will-change: transform;
}

.slider__slide {
  flex: 0 0 33.3333cqw;
  height: 100%;
}

.slider__slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.slider__zone {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 2;
  width: 50%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  touch-action: pan-y;
}

.slider__zone--prev {
  left: 0;
}

.slider__zone--next {
  right: 0;
}

.slider__zone:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: -6px;
}

.slider.has-cursor .slider__zone {
  cursor: none;
}

.slider__cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 3;
  width: 0;
  height: 0;
  pointer-events: none;
  transform: translate3d(-1000px, -1000px, 0);
}

.slider__cursor-dot {
  width: 64px;
  height: 64px;
  margin: -32px 0 0 -32px;
  opacity: 0;
  transform: scale(0.6);
}

.slider__cursor.is-visible .slider__cursor-dot {
  opacity: 1;
  transform: scale(1);
}

.slider__cursor.is-left .slider__cursor-dot svg {
  transform: scaleX(-1);
}

.slider__nav {
  display: none;
  justify-content: center;
  align-items: center;
  gap: 16px;
  padding-top: 20px;
}

.slider__arrow {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1.5px solid var(--red);
  border-radius: 50%;
  background: var(--white);
  color: var(--red);
  cursor: pointer;
  touch-action: manipulation;
}

.slider__arrow svg {
  width: 20px;
  height: 20px;
}

/* ---------- Text sections ---------- */

.section {
  padding: 100px 0;
}

.section__inner {
  display: flex;
  flex-direction: column;
  gap: 50px;
  width: min(100%, 1100px); /* non-text: layout column of the page, the live 1100px content width; text inside takes its full width */
  margin-inline: auto;
}

.heading {
  color: var(--red);
  font-size: 2.4em;
  font-weight: 400;
  line-height: 1;
  text-align: center;
}

.heading--xl {
  font-size: 4em;
}

.lead {
  color: var(--ink);
  font-size: 2em;
  line-height: 2;
  text-align: center;
}

.lead--spaced {
  margin-bottom: 0.9rem;
}

.projects {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: repeat(6, auto);
  grid-auto-flow: column;
  gap: 20px 40px;
  padding: 20px;
}

.projects__item {
  color: var(--ink);
  font-size: 1.7em;
  line-height: 1.5;
}

.projects__dot {
  color: var(--red);
}

.team {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 50px;
}

.person__photo {
  width: 275px;
  margin: 0 auto 20px;
  aspect-ratio: 1067 / 1474;
}

.person__role,
.person__name,
.person__email {
  line-height: 1.5;
  text-align: center;
}

.person__role {
  color: var(--red);
  font-size: 1.6em;
  font-weight: 600;
}

.person__name,
.person__email {
  color: var(--ink);
  font-size: 1.4em;
}

.person__email a {
  color: inherit;
}

/* ---------- Footer ---------- */

.site-footer {
  padding: 50px 20px;
  background: var(--footer-bg);
}

.site-footer__inner {
  display: flex;
  flex-direction: column;
  gap: 20px;
  border-inline: 1px solid rgb(255 255 255 / 0.12);
}

.site-footer__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 30px;
}

.site-footer__brand {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 10px;
}

.site-footer__logo {
  width: 125px;
  aspect-ratio: 2189 / 1591;
}

.social {
  display: flex;
  gap: 30px;
}

.social__link {
  display: block;
  width: 25px; /* non-text: icon-only link, its name is visually hidden */
  height: 25px;
  color: var(--red);
}

.social__link:hover {
  opacity: 0.9;
}

.social__link svg {
  display: block;
  width: 25px;
  height: 25px;
  fill: currentColor;
}

.site-footer__address {
  flex: 1;
  font-weight: 500;
  text-align: end;
}

.site-footer__address a {
  color: var(--ink-muted);
}

.site-footer__copy {
  margin: -7px 0;
  color: var(--ink);
  font-size: 0.8em;
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
}

/* ---------- Tablet ---------- */

@media (max-width: 1024px) {
  .site-header__logo {
    width: 60px;
  }

  .site-nav {
    align-self: center;
  }

  .site-nav__list {
    gap: 47px;
  }

  .site-nav__link {
    font-size: 20px;
  }

  .hero,
  .photo-band,
  .photo-band--tall {
    height: max(50vh, 160px);
  }

  .anchor {
    height: 0;
    scroll-margin-top: 0;
  }

  .section {
    padding: 40px;
  }

  .section__inner {
    gap: 0;
  }

  /* The live page narrows these headings to 72%; balanced wrapping gives the same two lines at full width. */
  .heading {
    margin-bottom: 20px;
    font-size: 2em;
    text-wrap: balance;
  }

  .heading--xl {
    margin-bottom: 0;
    font-size: 3em;
  }

  .lead {
    font-size: 1.5em;
  }

  .projects {
    gap: 20px;
    padding: 10px;
  }

  .projects__item {
    font-size: 1em;
  }

  .team {
    column-gap: 0;
  }

  .person__role,
  .person__name {
    font-size: 1em;
  }

  .site-footer {
    padding: 40px;
  }

  .site-footer__row,
  .site-footer__brand {
    flex-direction: column;
  }

  .site-footer__logo {
    width: 90px;
  }

  .site-footer__address {
    text-align: center;
  }
}

/* ---------- Slider phone mode ---------- */

@media (max-width: 780px) {
  .slider__viewport {
    height: 40vh;
    min-height: 260px;
  }

  .slider__zone {
    cursor: pointer;
  }

  .slider.has-cursor .slider__zone {
    cursor: pointer;
  }

  .slider__cursor {
    display: none;
  }

  .slider__nav {
    display: flex;
  }

  .slider__track {
    gap: 4cqw;
    padding: 0 10cqw;
  }

  .slider__slide {
    flex-basis: 80cqw;
  }
}

/* ---------- Phone ---------- */

@media (max-width: 767px) {
  .site-header {
    padding: 10px;
  }

  .site-header__logo {
    width: 50px;
  }

  /* Without JS the three links stay visible in the header; with JS they move into the toggle menu. */
  .js .menu-toggle {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 33px;
    height: 33px;
    padding: 5.5px;
    border: 0;
    border-radius: 0;
    background: var(--red);
    color: var(--white);
    cursor: pointer;
  }

  .menu-toggle svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
  }

  .menu-toggle__close,
  .menu-toggle[aria-expanded="true"] .menu-toggle__open {
    display: none;
  }

  .menu-toggle[aria-expanded="true"] .menu-toggle__close {
    display: block;
  }

  .js .site-nav__list {
    position: absolute;
    top: calc(50% + 26.5px);
    right: 0;
    left: 0;
    z-index: 9997;
    display: block;
    background: var(--white);
    transform: scaleY(0);
    transform-origin: top;
    visibility: hidden;
    transition: transform 0.3s, visibility 0s 0.3s;
  }

  .js .site-header.is-menu-open .site-nav__list {
    transform: scaleY(1);
    visibility: visible;
    transition: transform 0.3s;
  }

  .js .site-nav__link {
    padding: 10px 20px;
    color: var(--menu-ink);
    transition: none;
  }

  .js .site-nav__link:hover,
  .js .site-nav__link:focus,
  .js .site-nav__link.is-active {
    background: var(--menu-hover);
    color: var(--white);
  }

  .hero,
  .photo-band,
  .photo-band--tall {
    height: max(40vh, 120px);
  }

  .slider {
    margin-top: 30px;
  }

  .section {
    padding: 40px 20px;
  }

  .heading {
    margin-bottom: 0;
    text-align: start;
    text-wrap: wrap;
  }

  .heading--xl {
    margin-bottom: 20px;
    font-size: 2.4em;
    text-align: center;
  }

  .lead {
    margin-top: 20px;
    font-size: 1.2em;
    line-height: 1.6;
    text-align: start;
  }

  .projects {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    grid-auto-flow: row;
    padding: 0;
  }

  /* The live list is two stacked columns 15px apart, items inside a column 20px apart. */
  .projects__item:nth-child(7) {
    margin-top: -5px;
  }

  .team {
    grid-template-columns: 1fr;
    row-gap: 15px;
  }

  .person__role,
  .person__name {
    font-size: 1.2em;
  }

  .person__email {
    font-size: 1em;
  }

  .site-footer {
    padding: 40px 20px;
  }

  .site-footer__brand {
    padding: 0;
  }

  .social {
    padding-bottom: 20px;
  }

  .site-footer__address {
    font-size: 0.75em;
  }

  .site-footer__copy {
    margin: 0;
  }
}

/* ---------- Motion: only opacity/transform, and none when the visitor asks for reduced motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  .photo-band__layer {
    transition: transform 1s cubic-bezier(0, 0.33, 0.07, 1.03);
  }

  .slider__track {
    transition: transform 0.75s cubic-bezier(0.65, 0, 0.35, 1);
  }

  .slider__cursor-dot {
    transition: opacity 0.2s ease, transform 0.2s ease;
  }

  /* First slider is above the fold: a CSS-only fade on load, nothing waits for JS. */
  .slider--fade-on-load .slider__slide:nth-child(n + 2):nth-child(-n + 4),
  .slider.is-shown .slider__slide:nth-child(n + 2):nth-child(-n + 4) {
    animation: fade-in 0.75s ease both;
  }

  .slider.is-pending .slider__slide:nth-child(n + 2):nth-child(-n + 4) {
    opacity: 0;
  }

  .slider .slider__slide:nth-child(2) {
    animation-delay: 0.175s;
  }

  .slider .slider__slide:nth-child(3) {
    animation-delay: 0.45s;
  }

  .slider .slider__slide:nth-child(4) {
    animation-delay: 0.725s;
  }

  /* Below-the-fold blocks: site.js marks them pending at load and shows them when they scroll in. */
  .reveal.is-pending {
    opacity: 0;
  }

  .reveal.is-shown {
    animation: fade-up 0.75s ease 275ms both;
  }

  .reveal--fade.is-shown {
    animation-name: fade-in;
  }

  .reveal--late.is-shown {
    animation-delay: 350ms;
  }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translate3d(0, 30px, 0);
  }

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

@keyframes fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}
