/* ==========================================================================
   Felix Clarke
   Static rebuild of the Squarespace site. Typography, grid maths and the
   fade-in animation reproduce Squarespace 7.1's own formulas so the page
   renders identically at every viewport width.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */

:root {
  /* Type scale values, straight from the site's design settings */
  --heading-1-size-value: 4;
  --heading-2-size-value: 2.8;
  --heading-3-size-value: 2.2;
  --heading-4-size-value: 1.6;
  --large-text-size-value: 1.4;
  --normal-text-size-value: 1;
  --small-text-size-value: 0.9;

  /* Page metrics */
  --maxPageWidth: 2000px;
  --pagePadding: 4vw;
  --sqs-site-max-width: var(--maxPageWidth);
  --sqs-site-gutter: var(--pagePadding);
  --sqs-mobile-site-gutter: 6vw;

  /* Header */
  --header-logo-height: 43px;
  --header-mobile-logo-max-height: 30px;
  --header-vert-padding: 2vw;
  --mobile-header-vert-padding: 6vw;
  --header-height: 103px;

  /* Fonts */
  --heading-font-family: "Helvetica Neue", Arial, sans-serif;
  --heading-font-weight: 700;
  --heading-font-letter-spacing: -0.04em;
  --heading-font-line-height: 1.2em;
  --body-font-family: "Helvetica Neue", Arial, sans-serif;
  --body-font-weight: 400;
  --body-font-letter-spacing: 0em;
  --body-font-line-height: 1.5em;

  /* Colour */
  --white: #fff;
  --black: #000;

  /* Animation */
  --animation-duration: 0.9s;
  --animation-curve: linear;
}

/* --------------------------------------------------------------------------
   2. Reset
   -------------------------------------------------------------------------- */

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

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

body {
  margin: 0;
  background: var(--black);
  color: var(--white);
  font-family: var(--body-font-family);
  font-weight: var(--body-font-weight);
  line-height: var(--body-font-line-height);
  letter-spacing: var(--body-font-letter-spacing);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { border: 0; }

h1, h2, h3, h4, p { margin: 0; }

a { color: inherit; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* --------------------------------------------------------------------------
   3. Typography
   Squarespace sizes type from a unitless scale value. Below 768px (portrait)
   the size is driven by viewport height, above it by viewport width, capped
   against the max page width. Both branches reproduced verbatim.
   -------------------------------------------------------------------------- */

h1, h2, h3, h4 {
  font-family: var(--heading-font-family);
  font-weight: var(--heading-font-weight);
  letter-spacing: var(--heading-font-letter-spacing);
}

h1 { font-size: calc((var(--heading-1-size-value) - 1) * calc(0.012 * min(100vh, 900px)) + 1rem); }
h2 { font-size: calc((var(--heading-2-size-value) - 1) * calc(0.012 * min(100vh, 900px)) + 1rem); }
h3 { font-size: calc((var(--heading-3-size-value) - 1) * calc(0.012 * min(100vh, 900px)) + 1rem); }
h4 { font-size: calc((var(--heading-4-size-value) - 1) * calc(0.012 * min(100vh, 900px)) + 1rem); }

h1 { line-height: calc(var(--heading-font-line-height) * (1 + (1 - var(--heading-1-size-value)) / 25)); }
h2 { line-height: calc(var(--heading-font-line-height) * (1 + (1 - var(--heading-2-size-value)) / 25)); }
h3 { line-height: calc(var(--heading-font-line-height) * (1 + (1 - var(--heading-3-size-value)) / 25)); }
h4 { line-height: calc(var(--heading-font-line-height) * (1 + (1 - var(--heading-4-size-value)) / 25)); }

p {
  font-family: var(--body-font-family);
  font-size: calc((var(--normal-text-size-value) - 1) * calc(0.012 * min(100vh, 900px)) + 1rem);
  line-height: var(--body-font-line-height);
}

.sqsrte-large {
  font-size: calc((var(--large-text-size-value) - 1) * calc(0.012 * min(100vh, 900px)) + 1rem);
}

@media screen and (min-width: 768px), screen and (orientation: landscape) {
  h1 { font-size: min(calc((var(--heading-1-size-value) - 1) * 1.2vw + 1rem), max(calc((var(--heading-1-size-value) - 1) * 0.012 * var(--maxPageWidth) + 1rem), calc(var(--heading-1-size-value) * 1rem))); }
  h2 { font-size: min(calc((var(--heading-2-size-value) - 1) * 1.2vw + 1rem), max(calc((var(--heading-2-size-value) - 1) * 0.012 * var(--maxPageWidth) + 1rem), calc(var(--heading-2-size-value) * 1rem))); }
  h3 { font-size: min(calc((var(--heading-3-size-value) - 1) * 1.2vw + 1rem), max(calc((var(--heading-3-size-value) - 1) * 0.012 * var(--maxPageWidth) + 1rem), calc(var(--heading-3-size-value) * 1rem))); }
  h4 { font-size: min(calc((var(--heading-4-size-value) - 1) * 1.2vw + 1rem), max(calc((var(--heading-4-size-value) - 1) * 0.012 * var(--maxPageWidth) + 1rem), calc(var(--heading-4-size-value) * 1rem))); }

  p { font-size: min(calc((var(--normal-text-size-value) - 1) * 1.2vw + 1rem), max(calc((var(--normal-text-size-value) - 1) * 0.012 * var(--maxPageWidth) + 1rem), calc(var(--normal-text-size-value) * 1rem))); }
  .sqsrte-large { font-size: min(calc((var(--large-text-size-value) - 1) * 1.2vw + 1rem), max(calc((var(--large-text-size-value) - 1) * 0.012 * var(--maxPageWidth) + 1rem), calc(var(--large-text-size-value) * 1rem))); }
}

/* Scaled text. Squarespace fits these headings to the width of their block,
   so the size is a fixed proportion of the container. Container query units
   give the same result in pure CSS, at any width. */
.scaled-text {
  container-type: inline-size;
  width: 100%;
}

.scaled-text > * {
  font-size: calc(var(--scale) * 1cqw);
  line-height: 1;
  /* The size is chosen to fill the block on one line, so it must not wrap. */
  white-space: pre;
}

/* --------------------------------------------------------------------------
   4. Header
   -------------------------------------------------------------------------- */

.header {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 10;
  background: transparent;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: var(--header-vert-padding) var(--sqs-site-gutter);
}

.header-inner--desktop { display: flex; }
.header-inner--mobile { display: none; }

.header-logo {
  display: block;
  height: auto;
  width: auto;
  max-width: 100%;
  max-height: var(--header-logo-height);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

/* Matches the height Squarespace's mobile burger control occupies */
.header-inner--mobile .header-actions { min-height: 37px; }

.header-icon {
  display: block;
  width: 27px;
  height: 27px;
  color: var(--white);
}

.header-icon svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.btn {
  display: inline-block;
  font-family: var(--body-font-family);
  font-size: 1rem;
  font-weight: 400;
  line-height: normal;
  letter-spacing: normal;
  text-transform: none;
  text-decoration: none;
  white-space: nowrap;
  padding: 16px 20.8px;
  border-radius: 300px;
  cursor: pointer;
}

.btn--border {
  color: var(--white);
  background: transparent;
  border: 0.8px solid var(--white);
}

.btn--solid {
  color: var(--black);
  background: var(--white);
  border: 0.8px solid var(--white);
}

/* On mobile the bar carries the logo and the burger only. The LinkedIn icon
   and the call to action move into the overlay menu. */
.header-inner--mobile .header-icon--bar,
.header-inner--mobile .header-actions-action--cta { display: none; }

/* Burger */
.header-burger { display: none; }

.header-burger-btn {
  display: block;
  padding: 0;
  margin: 0;
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--white);
}

.burger-box {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  width: 35px;
  height: 35px;
}

.burger-box span {
  display: block;
  height: 1px;
  width: 100%;
  background: currentColor;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

body.menu-open .burger-box span:first-child { transform: translateY(4px) rotate(45deg); }
body.menu-open .burger-box span:last-child { transform: translateY(-4px) rotate(-45deg); }

/* Mobile menu overlay */
.header-menu {
  position: fixed;
  inset: 0;
  z-index: 9;
  background: var(--black);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

body.menu-open .header-menu {
  opacity: 1;
  visibility: visible;
}

body.menu-open { overflow: hidden; }

.header-menu .header-icon { width: 40px; height: 40px; }

/* Squarespace collapses the header to the burger layout on any touch screen
   up to 1024px, and on any screen narrower than 800px. */
@media only screen and (pointer: coarse) and (max-width: 1024px),
       screen and (max-width: 799px) {
  .header-inner--desktop { display: none; }
  .header-inner--mobile { display: flex; }

  .header-inner { padding: 6vw; }

  .header-burger { display: flex; }
}

/* The smaller logo is a portrait phone rule, not a general mobile one. */
@media screen and (max-width: 767px) and (orientation: portrait) {
  .header-logo { max-height: var(--header-mobile-logo-max-height); }
}

/* --------------------------------------------------------------------------
   5. Sections
   -------------------------------------------------------------------------- */

.page-section {
  position: relative;
  background: var(--black);
}

.content-wrapper {
  position: relative;
  width: 100%;
}

.section-height--custom { min-height: 9px; }
.section-height--custom > .content-wrapper { padding-top: 0.1vmax; padding-bottom: 0.1vmax; }

.section-height--small { min-height: 33vh; }
.section-height--small > .content-wrapper { padding-top: 3.3vmax; padding-bottom: 3.3vmax; }

.section-height--medium { min-height: 66vh; }
.section-height--medium > .content-wrapper { padding-top: 6.6vmax; padding-bottom: 6.6vmax; }

/* The header sits over the page, so the first section clears it. */
.page-section--first { padding-top: var(--header-height); }

/* --------------------------------------------------------------------------
   6. Fluid grid
   8 columns plus gutters on mobile, 24 plus gutters from 768px, exactly as
   Squarespace's layout engine builds them.
   -------------------------------------------------------------------------- */

.fluid-engine {
  --fe-gap: 11px;
  --grid-gutter: calc(var(--sqs-mobile-site-gutter) - var(--fe-gap));
  --cell-max-width: calc((var(--sqs-site-max-width) - (var(--fe-gap) * (8 - 1))) / 8);

  display: grid;
  position: relative;
  grid-template-columns:
    minmax(var(--grid-gutter), 1fr)
    repeat(8, minmax(0, var(--cell-max-width)))
    minmax(var(--grid-gutter), 1fr);
  row-gap: 11px;
  column-gap: var(--fe-gap);
  overflow-x: clip;
}

@media (min-width: 768px) {
  .fluid-engine {
    --grid-gutter: calc(var(--sqs-site-gutter) - var(--fe-gap));
    --cell-max-width: calc((var(--sqs-site-max-width) - (var(--fe-gap) * (24 - 1))) / 24);
    --row-height-scaling-factor: 0.0215;
    --container-width: min(var(--sqs-site-max-width), calc(100vw - var(--sqs-site-gutter) * 2));

    grid-template-columns:
      minmax(var(--grid-gutter), 1fr)
      repeat(24, minmax(0, var(--cell-max-width)))
      minmax(var(--grid-gutter), 1fr);
  }
}

/* Sections whose blocks sit on a wider column gap */
.fe-ormonde,
.fe-legal { --fe-gap: 30px; }

/* Row counts, mobile then desktop */
.fe-hero    { grid-template-rows: repeat(17, minmax(24px, auto)); }
.fe-ormonde { grid-template-rows: repeat(13, minmax(24px, auto)); }
.fe-frank   { grid-template-rows: repeat(13, minmax(24px, auto)); }
.fe-spec    { grid-template-rows: repeat(13, minmax(24px, auto)); }
.fe-mbs     { grid-template-rows: repeat(12, minmax(24px, auto)); }
.fe-legal   { grid-template-rows: repeat(15, minmax(24px, auto)); }
.fe-guard   { grid-template-rows: repeat(10, minmax(24px, auto)); }
.fe-chat    { grid-template-rows: repeat(20, minmax(24px, auto)); }

@media (min-width: 768px) {
  .fe-hero    { grid-template-rows: repeat(14, minmax(calc(var(--container-width) * var(--row-height-scaling-factor)), auto)); }
  .fe-ormonde { grid-template-rows: repeat(15, minmax(calc(var(--container-width) * var(--row-height-scaling-factor)), auto)); }
  .fe-frank   { grid-template-rows: repeat(16, minmax(calc(var(--container-width) * var(--row-height-scaling-factor)), auto)); }
  .fe-spec    { grid-template-rows: repeat(19, minmax(calc(var(--container-width) * var(--row-height-scaling-factor)), auto)); }
  .fe-mbs     { grid-template-rows: repeat(18, minmax(calc(var(--container-width) * var(--row-height-scaling-factor)), auto)); }
  .fe-legal   { grid-template-rows: repeat(16, minmax(calc(var(--container-width) * var(--row-height-scaling-factor)), auto)); }
  .fe-guard   { grid-template-rows: repeat(15, minmax(calc(var(--container-width) * var(--row-height-scaling-factor)), auto)); }
  .fe-chat    { grid-template-rows: repeat(18, minmax(calc(var(--container-width) * var(--row-height-scaling-factor)), auto)); }
}

/* --------------------------------------------------------------------------
   7. Blocks
   -------------------------------------------------------------------------- */

.fe-block {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
}

.fe-block > .block {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  width: 100%;
}

/* Vertical placement of a block's content within its grid area */
.m-start > .block  { justify-content: flex-start; }
.m-center > .block { justify-content: center; }
.m-end > .block    { justify-content: flex-end; }

@media (min-width: 768px) {
  .d-start > .block  { justify-content: flex-start; }
  .d-center > .block { justify-content: center; }
  .d-end > .block    { justify-content: flex-end; }
}

/* Images that fill their block and crop.
   The image is taken out of flow so it cannot push the grid row taller than
   the layout intends; the row keeps the height the grid gives it. */
.img-fill {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.img-fill img {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
}

/* Images that keep their own proportions and sit centred */
.img-fit { width: 100%; }
.img-fit img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* --------------------------------------------------------------------------
   8. Grid placement, block by block
   -------------------------------------------------------------------------- */

.b-hero-portrait  { grid-area: 2 / 2 / 11 / 10;  z-index: 3; }
.b-hero-h1a       { grid-area: 11 / 2 / 14 / 10; z-index: 0; }
.b-hero-h1b       { grid-area: 13 / 2 / 16 / 10; z-index: 1; }
.b-hero-tag       { grid-area: 16 / 2 / 17 / 10; z-index: 2; }

.b-ormonde-a      { grid-area: 1 / 1 / 10 / 11;  z-index: 1; }
.b-ormonde-b      { grid-area: 8 / 1 / 14 / 11;  z-index: 3; }
.b-ormonde-title  { grid-area: 10 / 2 / 12 / 10; z-index: 4; }
.b-ormonde-sub    { grid-area: 12 / 2 / 14 / 10; z-index: 5; }

.b-frank-img      { grid-area: 1 / 1 / 10 / 11;  z-index: 1; }
.b-frank-title    { grid-area: 10 / 2 / 12 / 10; z-index: 6; }
.b-frank-sub      { grid-area: 12 / 2 / 14 / 10; z-index: 7; }

.b-spec-c         { grid-area: 1 / 1 / 10 / 11;  z-index: 1; }
.b-spec-a         { grid-area: 1 / 1 / 7 / 11;   z-index: 2; }
.b-spec-b         { grid-area: 7 / 1 / 13 / 11;  z-index: 3; }
.b-spec-title     { grid-area: 10 / 2 / 12 / 10; z-index: 5; }
.b-spec-sub       { grid-area: 12 / 2 / 14 / 10; z-index: 6; }

.b-mbs-img        { grid-area: 1 / 1 / 9 / 11;   z-index: 1; }
.b-mbs-title      { grid-area: 9 / 2 / 12 / 10;  z-index: 6; }
.b-mbs-sub        { grid-area: 11 / 2 / 13 / 10; z-index: 7; }

.b-legal-img      { grid-area: 1 / 1 / 11 / 11;  z-index: 1; }
.b-legal-title    { grid-area: 11 / 2 / 13 / 10; z-index: 2; }
.b-legal-sub      { grid-area: 13 / 2 / 15 / 10; z-index: 3; }

.b-guard-img      { grid-area: 1 / 2 / 7 / 10;   z-index: 1; }
.b-guard-title    { grid-area: 7 / 2 / 9 / 10;   z-index: 3; }
.b-guard-sub      { grid-area: 9 / 2 / 11 / 10;  z-index: 4; }

.b-chat-title     { grid-area: 1 / 2 / 3 / 10;   z-index: 2; }
.b-chat-form      { grid-area: 3 / 2 / 19 / 10;  z-index: 1; }
.b-chat-address   { grid-area: 19 / 2 / 21 / 10; z-index: 3; }

@media (min-width: 768px) {
  .b-hero-portrait  { grid-area: 1 / 3 / 15 / 15;  z-index: 1; }
  .b-hero-h1a       { grid-area: 7 / 13 / 10 / 21; z-index: 4; }
  .b-hero-h1b       { grid-area: 9 / 13 / 12 / 21; z-index: 3; }
  .b-hero-tag       { grid-area: 12 / 13 / 13 / 21; z-index: 2; }

  .b-ormonde-a      { grid-area: 1 / 2 / 12 / 14;  z-index: 1; }
  .b-ormonde-b      { grid-area: 1 / 14 / 12 / 26; z-index: 3; }
  .b-ormonde-title  { grid-area: 13 / 2 / 15 / 10; z-index: 4; }
  .b-ormonde-sub    { grid-area: 15 / 2 / 16 / 10; z-index: 5; }

  .b-frank-img      { grid-area: 2 / 2 / 17 / 26;  z-index: 1; }
  .b-frank-title    { grid-area: 13 / 3 / 15 / 11; z-index: 6; }
  .b-frank-sub      { grid-area: 15 / 3 / 16 / 11; z-index: 7; }

  .b-spec-c         { grid-area: 1 / 16 / 17 / 26; z-index: 1; }
  .b-spec-a         { grid-area: 1 / 2 / 17 / 9;   z-index: 2; }
  .b-spec-b         { grid-area: 1 / 9 / 17 / 16;  z-index: 3; }
  .b-spec-title     { grid-area: 17 / 2 / 19 / 10; z-index: 5; }
  .b-spec-sub       { grid-area: 19 / 2 / 20 / 10; z-index: 6; }

  .b-mbs-img        { grid-area: 1 / 2 / 19 / 26;  z-index: 1; }
  .b-mbs-title      { grid-area: 13 / 3 / 15 / 13; z-index: 6; }
  .b-mbs-sub        { grid-area: 15 / 3 / 16 / 11; z-index: 7; }

  .b-legal-img      { grid-area: 1 / 2 / 17 / 26;  z-index: 1; }
  .b-legal-title    { grid-area: 5 / 3 / 7 / 13;   z-index: 2; }
  .b-legal-sub      { grid-area: 7 / 3 / 8 / 11;   z-index: 3; }

  .b-guard-img      { grid-area: 1 / 2 / 16 / 18;  z-index: 1; }
  .b-guard-title    { grid-area: 3 / 19 / 5 / 25;  z-index: 3; }
  .b-guard-sub      { grid-area: 5 / 19 / 6 / 25;  z-index: 4; }

  .b-chat-title     { grid-area: 1 / 7 / 4 / 15;   z-index: 2; }
  .b-chat-form      { grid-area: 5 / 7 / 16 / 19;  z-index: 1; }
  .b-chat-address   { grid-area: 18 / 2 / 19 / 26; z-index: 3; }
}

/* --------------------------------------------------------------------------
   9. Contact form
   -------------------------------------------------------------------------- */

/* Field metrics follow Squarespace's own form block: 24px between fields,
   12px input padding, 6px/4px input margins, 2px corners, 100px textarea. */

.form-wrapper { width: 100%; color: var(--white); }

.field-list { line-height: normal; }

.field-list .field { position: relative; margin: 0 0 24px; }

.field-list .title {
  display: block;
  font-family: var(--body-font-family);
  font-size: 1rem;
  line-height: var(--body-font-line-height);
  color: var(--white);
}

.field-list .description {
  display: block;
  padding: 0.5em 0;
  font-size: 0.9rem;
  opacity: 0.7;
  white-space: pre-wrap;
}

.field-list .field-element {
  width: 100%;
  padding: 12px;
  margin: 6px 0 4px;
  border: 1px solid #ccc;
  border-radius: 2px;
  background: #fafafa;
  color: #000;
  font-family: var(--body-font-family);
  font-size: 1rem;
  line-height: normal;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}

.field-list .field-element:focus {
  background: #fff;
  outline: none;
  transition: background 0.1s ease-in;
}

.field-list textarea.field-element {
  min-height: 100px;
  font-size: max(16px, 1rem);
  resize: vertical;
}

/* Name splits into two columns, as Squarespace lays it out */
.field-list .fields.name {
  display: flex;
  gap: 4%;
}

.field-list .fields.name .field {
  width: 48%;
  margin-bottom: 0;
}

.form-button-wrapper--align-left { display: flex; justify-content: flex-start; }
.form-button-wrapper--align-center { display: flex; justify-content: center; }
.form-button-wrapper--align-right { display: flex; justify-content: flex-end; }

.form-success { display: none; }

.form-success p + p { margin-top: 0.75em; }

/* --------------------------------------------------------------------------
   10. Animation
   Elements start transparent and fade to full opacity when they scroll into
   view, over 0.9s on a linear curve, staggered in document order.
   -------------------------------------------------------------------------- */

.preFade {
  opacity: 0;
  transition-property: opacity;
  transition-duration: var(--animation-duration);
  transition-timing-function: var(--animation-curve);
}

.fadeIn { opacity: 1 !important; }

@media (prefers-reduced-motion: reduce) {
  .preFade { opacity: 1; transition: none; }
}
