/* Named color variables */

:root {
  --cloud: hsl(197deg 33% 96%);
  --platinum: hsl(197deg 24% 92%);
  --silver: hsl(197deg 14% 87%);
  --concrete: hsl(197deg 8% 63%);
  --smoke: hsl(197deg 8% 38%);
  --charcoal: hsl(197deg 12% 23%);
  --anthracite: hsl(197deg 16% 18%);
  --onyx--raw-hsl: 197deg 16% 15%;
  --onyx: hsl(var(--onyx--raw-hsl));
  --night: hsl(197deg 18% 7%);
  --crystal--raw-hsl: 194deg 81% 49%;
  --crystal: hsl(var(--crystal--raw-hsl));
  --azure: hsl(195deg 90% 41%);
  --ocean--raw-hsl: 196deg 100% 32%;
  --ocean: hsl(var(--ocean--raw-hsl));
  --mint--lightened--raw-hsl: 177deg 100% 40%; /* +5 lightness */
  --mint--lightened: hsl(var(--mint--lightened--raw-hsl));
  --mint--darkened--raw-hsl: 182deg 100% 30%; /* +5 degrees, -5 lightness */
  --mint--darkened: hsl(var(--mint--darkened--raw-hsl));
}



/* Semantic color variables */

:root {
  --text-color--primary: var(--night);
  --text-color--secondary: var(--smoke);
  --text-color--hero: white;
  --button-text-color--primary: white;
  --link-color: var(--mint--darkened);
  --list-marker-color: var(--mint--darkened);
  --blog-article-separator-color: var(--silver);
  --button-background-color--tile: hsla(var(--mint--darkened--raw-hsl) / 10%);
  --button-background-color--pill: var(--mint--darkened);
  --quote-background-color: hsla(var(--onyx--raw-hsl) / 5%);
  --box-background-color: var(--cloud);
  --header-hero-text-background: hsla(0deg 0% 0% / 33%);
  --header-background-color: var(--platinum);
  --section-background-color: white;
  --nav-background-color: var(--mint--darkened);
}

.section--fl-tint {
  --section-background-color: hsla(var(--mint--darkened--raw-hsl) / 15%);
}

.section--sp-tint {
  --section-background-color: hsla(var(--ocean--raw-hsl) / 15%);
}

footer {
  --button-background-color--pill: white;
  --section-background-color: var(--silver);
}

.section--sp-content,
.section--sp-tint {
  --link-color: var(--ocean);
  --button-background-color--pill: var(--azure);
  --list-marker-color: var(--ocean);
}

.box--floating {
  --box-background-color: hsla(0deg 0% 100% / 90%);
}

.section--sp-content .button__icon,
.section--sp-tint .button__icon {
  filter: invert(32%) sepia(61%) saturate(1539%) hue-rotate(163deg) brightness(92%) contrast(115%); /* to simulate color 'Ocean' */
}



/* Non-color variables */

:root {
  --animation-duration: 150ms;
  --border-radius--small: 10px;
  --border-radius--medium: 20px;
  --border-radius--large: 30px;
  --nav-height: 50px;
  --nav-side-items-width: 200px;
  --nav-item-side-padding: 10px;
}



/* Normalization rules */

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

html {
  line-height: 1.15; /* Correct the line height in all browsers. */
  -webkit-text-size-adjust: 100%; /* needed for iOS Safari landscape mode */
}

body {
  margin: 0; /* Remove the margin in all browsers. */
}

hr {
  height: 0; /* Add the correct height in Firefox. */
  color: inherit; /* Correct the inheritance of border color in Firefox. */
}

b,
strong {
  font-weight: bolder; /* Add the correct font weight in Edge and Safari. */
}



/* General rules */

html {
  height: 100svh;
}

body {
  display: flex;
  flex-flow: column nowrap;
  min-height: 100svh;
  font-family: 'Exo', sans-serif;
  font-size: 17px;
  line-height: 1.7;
  text-align: center;
  color: var(--text-color--primary);
  background-color: var(--section-background-color);
}

main {
  flex-grow: 1;
}



/* Text formatting */

h1, h2, h3, h4, h5, p, ol, ul {
  width: 100%;
  margin: 0;
}

h2, h3, h4, h5, p, ol, ul {
  max-width: 600px;
}

h1 {
  max-width: 1000px;
  font-weight: 500;
  font-size: 48px;
}

h2 {
  font-weight: 500;
  font-size: 28px;
}

h3 {
  font-weight: 500;
  font-size: 24px;
}

h4 {
  font-weight: 600;
  font-size: 21px;
}

h4:not(:first-child) {
  margin-top: 30px;
}

.linearicon + h4 {
  margin-top: 10px;
}

h5 {
  font-weight: 600;
  font-size: 18px;
}

h5:not(:first-child) {
  margin-top: 20px;
}

p, ol, ul {
  hyphens: auto;
  -webkit-hyphens: auto;
}

h4 + p,
.linearicon + p,
p + p { /* insert a margin where appropriate */
  margin-top: 10px;
}

ul {
  padding-left: 18px;
  margin: 0;
  list-style-type: none;
}

ol {
  padding-left: 30px;
}

li {
  position: relative;
  margin-top: 10px;
}

ul li::before {
  content: "‣";
  position: absolute;
  left: -18px;
  color: var(--list-marker-color);
  transform: scale(1.5);
}

ol li {
  padding-left: 6px;
}

ol li::marker {
  font-weight: 600;
  color: var(--list-marker-color);
}

.header--with-hero h1 {
  color: var(--text-color--hero);
  text-shadow: 0 0 12px black;
  font-weight: 400;
}

@media screen and (max-width: 768px), screen and (max-height: 768px) {
  h1 {
    font-size: 40px;
  }
}

.section__header {
  margin-bottom: 30px;
  max-width: 600px;
  width: 100%;
}

.section__header--fl-tint {
  color: var(--mint--darkened);
  font-style: italic;
}

.section__header--logo {
  max-height: 100%;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  height: 45px;
}

.section__header--linearicons {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  gap: 25px;
}

footer .section__header--logo  {
  height: 30px;
  margin-bottom: 0;
  opacity: 0.75;
}

.brandguide-overlay-box h3 {
  margin-bottom: 20px;
}

.wall-of-text {
  text-align: left;
}

footer {
  color: var(--text-color--secondary);
  font-size: 14px;
}

.quote {
  display: inline-flex;
  font-style: italic;
  background-color: var(--quote-background-color);
  padding: 2px 8px 0 6px;
  border-radius: var(--border-radius--small);
}

.box h5 a,
.blog-article h3 a {
  text-decoration: none;
}

.date {
  font-style: italic;
  color: var(--text-color--secondary);
  font-weight: 500;
}




/* Links and buttons */

a {
  display: inline-flex;
  color: var(--link-color);
  transition: opacity var(--animation-duration);
}

a:hover {
  opacity: 0.75;
}

.button {
  flex-flow: row wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  line-height: 20px;
  padding: 11px 15px 9px 15px; /* top padding is larger to account for Exo font not being vertically centered */
  margin-top: 10px;
  text-decoration: none;
}

.button--tile {
  font-size: 20px;
  line-height: inherit;
  flex: 0 1 400px;
  border-radius: var(--border-radius--medium);
  gap: 20px;
  padding: 40px;
  margin: 0;
  background-color: var(--button-background-color--tile);
}

.button--pill {
  margin-top: 20px;
  border-radius: var(--border-radius--small);
  color: var(--button-text-color--primary);
  background-color: var(--button-background-color--pill);
}

.button--pill-inline {
  display: inline-flex;
  padding: 6px 8px 4px 8px;
  margin: 0;
}

footer .button--pill {
  color: var(--text-color--secondary);
  width: 200px;
}

footer a:not(.button) {
  color: inherit;
  line-height: 40px;
}




/* Icons and images */

img {
  border-style: none;
}

.blog-article > img {
  width: 100%;
}

.blog-article > img:not(:first-child) {
  margin-top: 10px;
}

.linearicon {
  font-family: 'Linearicons';
  line-height: 1;
  font-size: 40px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: antialiased;
}

.button__icon {
  height: 20px;
  margin-top: -1px; /* to account for top padding of button label  */
  filter: invert(41%) sepia(57%) saturate(4910%) hue-rotate(155deg) brightness(95%) contrast(101%); /* to simulate color 'Mint darkened' */
}

.button--pill .button__icon {
  filter: invert(100%); /* to simulate color 'white' */
}

.close-button {
  display: flex;
  padding: 15px;
  align-self: flex-end;
  cursor: pointer;
  filter: invert(79%) sepia(7%) saturate(284%) hue-rotate(155deg) brightness(93%) contrast(95%); /* to simulate color 'Ash' */
  transition: opacity var(--animation-duration);
}

.close-button:hover {
  opacity: 0.75;
}

.close-button img {
  width: 30px;
}

.background-image {
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}




/* Top bar elements */

#navbar {
  display: flex;
  width: 100%;
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: box-shadow var(--animation-duration);
  background-color: var(--nav-background-color);
}

nav {
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 500;
  padding-top: max(5px, env(safe-area-inset-top));
  padding-bottom: 5px;
  padding-left: max(5px, env(safe-area-inset-left));
  padding-right: max(10px, env(safe-area-inset-right));
}

nav a {
  display: flex;
  padding: 0 var(--nav-item-side-padding);
}

.goto-home {
  width: calc(136px + 2 * var(--nav-item-side-padding));
  flex-shrink: 0;
  height: 26px;
  margin-right: calc(var(--nav-side-items-width) - 136px - 2 * var(--nav-item-side-padding));
  background-position-x: var(--nav-item-side-padding);
  background-repeat: no-repeat;
  background-size: contain;
  background-image: url("../img/logo-futurelab-dark-bg.svg");
}

nav ul {
  display: flex;
  align-items: center;
  padding: 0;
  max-width: none;
}

nav li {
  display: flex;
  margin-top: 0;
}

nav li::before {
  display: none;
}

.page-nav a,
.lang-nav a {
  align-items: center;
  justify-content: center;
  height: 40px;
  padding-top: 2px;
  text-decoration: none;
  color: var(--button-text-color--primary);
}

.currentpage {
  opacity: 0.67;
  pointer-events: none;
}

.page-nav {
  justify-content: center;
  gap: 20px;
}

.lang-nav {
  justify-content: flex-end;
  flex-shrink: 0;
  width: calc(var(--nav-side-items-width) - 5px); /* reduced by 5px to account for bigger padding of nav element */
}

@media screen and (max-width: 768px) {
  :root {
    --nav-height: 85px;
  }

  #navbar {
    top: -45px;
  }

  nav {
    flex-wrap: wrap;
    padding-bottom: 0;
  }

  .goto-home {
    margin-right: 0;
  }

  .page-nav {
    order: 1;
    flex-basis: 100%;
  }

  .lang-nav {
    width: auto;
  }
}

@media screen and (max-width: 450px) {
  .page-nav {
    justify-content: space-between;
    gap: 0;
  }
}

@media screen and (max-width: 360px) {
  .page-nav {
    justify-content: space-between;
  }
}



/* Content sections */

footer,
section,
.brandguide-overlay {
  display: flex;
  flex-flow: column nowrap;
  align-items: center;
}

footer,
section {
  padding: 70px max(20px, env(safe-area-inset-right)) 70px max(20px, env(safe-area-inset-left));
  background-color: var(--section-background-color);
}

.section--map {
  position: relative;
  height: 50svh;
  max-height: 500px;
  min-height: 300px;
  justify-content: flex-end;
  align-items: stretch;
  padding: 0;
}

.section--map::after {
  position: absolute;
  content: " ";
  top: calc(50% - 20px);
  left: calc(50% - 20px);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--button-background-color--pill);
}

.content {
  width: 100%;
  max-width: 1200px;
  display: flex;
  flex-flow: column nowrap;
  align-items: center;
  justify-content: center;
}

.content--left-aligned {
  justify-content: flex-start;
}

.content--right-aligned {
  justify-content: flex-end;
}

.content--rows {
  flex-flow: row wrap;
  align-items: stretch;
  gap: 50px;
}

.content--team {
  margin-top: 50px;
  gap: 50px 100px;
}

footer {
  padding-top: 50px;
  padding-bottom: max(30px, env(safe-area-inset-bottom));
}

.footer__contact {
  font-size: 16px;
  margin: 10px 0 30px 0;
  display: flex;
  flex-flow: row wrap;
  justify-content: center;
  align-self: stretch;
  gap: 20px;
}

.content.gallery {
  flex-flow: row wrap;
  padding: 48px 0;
  max-width: 1640px;
}

.gallery figure {
  margin: 3px;
  overflow: hidden;
  display: flex;
  justify-content: center;
}

.brandguide-overlay {
  display: none;
  justify-content: center;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background-color: hsla(0deg 0% 0% / 67%);
  z-index: 2000;
}

.brandguide-overlay-box {
  background-color: var(--section-background-color);
  border-radius: var(--border-radius--large);
  margin: 10px;
  display: flex;
  flex-flow: column nowrap;
  align-items: center;
  max-width: 500px;
}

.brandguide-overlay--visible {
  display: flex;
}

.brandguide-overlay-content {
  padding: 0 15px 30px 15px;
  display: flex;
  width: 100%;
  flex-flow: column nowrap;
  align-items: center;
}



/* Header */

main header {
  display: flex;
  flex-flow: column nowrap;
  justify-content: flex-end;
  background-color: var(--header-background-color);
}

.header--with-hero {
  height: calc(100svh - var(--nav-height));
  max-height: 600px;
  position: relative;
}

.header--with-hero::before {
  position: absolute;
  content: " ";
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
}

.header__shadow-fade {
  max-height: 200px;
  flex-grow: 1;
  background: linear-gradient(to bottom, hsla(0deg 0% 0% / 0%) 0%, var(--header-hero-text-background) 100%);
  z-index: 1;
}

.header__text-container {
  display: flex;
  justify-content: center;
  z-index: 1;
  padding: 70px;
}

@media screen and (max-width: 768px), screen and (max-height: 768px) {
  .header__text-container {
    padding: 50px 20px;
  }
}

.header--with-hero .header__text-container {
  background-color: var(--header-hero-text-background);
}



/* Smaller elements */

.blog-article {
  margin-bottom: 40px;
  width: 100%;
  max-width: 600px;
  padding-bottom: 40px;
  padding-top: calc(40px + var(--nav-height)); /* Avoid titles ending up under the navbar when jumping to an anchor. */
  margin-top: calc(-1 * (40px + var(--nav-height)));
}

.blog-article:not(:last-child) {
  border-bottom: 2px solid var(--blog-article-separator-color);
}

@media screen and (max-width: 768px) {
  .blog-article {
    padding-top: calc(40px + 40px);
    margin-top: calc(-1 * (40px + 40px));
  }
}

.box {
  flex: 0 1 400px;
  padding: 25px 25px 20px 25px;
  border-radius: var(--border-radius--medium);
  background-color: var(--box-background-color);
}

.box--numbered {
  display: flex;
  align-items: center;
  gap: 15px;
}

.box.wall-of-text {
  padding-top: 20px;
}

.box__number {
  text-align: center;
  flex: 0 0 40px;
  font-weight: 700;
  font-size: 48px;
  line-height: 60px;
  padding-top: 6px;
  color: var(--list-marker-color);
}

.team-member {
  display: flex;
  flex-flow: column nowrap;
}

.team-member__image {
  width: 280px;
  height: 280px;
  border-radius: var(--border-radius--medium);
  margin-bottom: 10px;
}

.testimonial {
  margin: 20px 0 5px 0;
  display: flex;
  align-items: center;
  gap: 20px;
}

.testimonial__image {
  width: 100px;
  height: 100px;
  border-radius: var(--border-radius--small);
}



/* Background blur effect */

#navbar,
.box--floating,
.brandguide-overlay {
  backdrop-filter: blur(10px) saturate(200%);
  -webkit-backdrop-filter: blur(10px) saturate(200%);
}



/* Gallery media queries */

@media only screen and (min-width: 1032px) {

  .gallery figure,
  .gallery .landscape img {
    height: 240px;
  }

  .gallery figure,
  .gallery .portrait  img {
    width: 240px;
  }
}

@media only screen and (min-width: 642px) and (max-width: 1031px) {

  .gallery figure,
  .gallery .landscape img {
    height: 192px;
  }

  .gallery figure,
  .gallery .portrait  img {
    width: 192px;
  }
}

@media only screen and (min-width: 372px) and (max-width: 641px) {

  .gallery figure,
  .gallery .landscape img {
    height: 156px;
  }

  .gallery figure,
  .gallery .portrait  img {
    width: 156px;
  }
}

@media only screen and (max-width: 371px) {
  /* Distribute gallery items with narrow screens */

  .gallery figure,
  .gallery .landscape img {
    height: 120px;
  }

  .gallery figure,
  .gallery .portrait  img {
    width: 120px;
  }
}




/* Media queries and rules for dark content */

@media (prefers-color-scheme: dark) {
  :root {
    --text-color--primary: var(--platinum);
    --text-color--secondary: var(--concrete);
    --text-color--hero: hsla(0deg 0% 100% / 90%);
    --button-text-color--primary: var(--text-color--primary);
    --link-color: var(--mint--lightened);
    --list-marker-color: var(--mint--lightened);
    --blog-article-separator-color: var(--smoke);
    --button-background-color--tile: hsla(var(--mint--lightened--raw-hsl) / 15%);
    --quote-background-color: hsla(0deg 0% 100% / 5%);
    --box-background-color: var(--charcoal);
    --header-background-color: var(--charcoal);
    --section-background-color: var(--anthracite);
    --nav-background-color: hsl(182deg 78% 29%);
  }

  .section--fl-tint {
    --section-background-color: hsla(var(--mint--lightened--raw-hsl) / 10%);
  }

  .section--sp-tint {
    --section-background-color: hsla(var(--crystal--raw-hsl) / 15%);
  }

  .section--sp-content,
  .section--sp-tint {
    --link-color: var(--crystal);
    --button-background-color--pill: var(--ocean);
    --list-marker-color: var(--azure);
  }

  footer {
    --button-background-color--pill: hsla(0deg 0% 100% / 10%);
    --section-background-color: var(--night);
  }

  .header--with-hero::before {
    background-color: hsla(0deg 0% 0% / 25%);
  }

  section img:not(.button__icon) {
    opacity: 0.75;
  }

  .box--floating {
    --box-background-color: hsla(var(--onyx--raw-hsl) / 90%);
  }

  .button__icon {
    filter: invert(56%) sepia(86%) saturate(1199%) hue-rotate(132deg) brightness(95%) contrast(101%); /* to simulate color 'Mint lightened' */
  }

  .section--sp-content .button__icon,
  .section--sp-tint .button__icon {
    filter: invert(81%) sepia(62%) saturate(4906%) hue-rotate(155deg) brightness(92%) contrast(91%); /* to simulate color 'Crystal' */
  }

  .button--pill .button__icon {
    filter: invert(100%) sepia(1%) saturate(3169%) hue-rotate(166deg) brightness(99%) contrast(89%); /* to simulate color 'Platinum' */
  }
}

.section--smartpolice-teaser {
  --text-color--primary: var(--platinum);
  color: var(--text-color--primary);
}

.section--smartpolice-teaser .button {
  color: var(--crystal);
}

.section--smartpolice-teaser .button__icon {
  filter: invert(81%) sepia(62%) saturate(4906%) hue-rotate(155deg) brightness(92%) contrast(91%); /* to simulate color 'Crystal' */
}
