/*
  TruewardHR holding page. Colours and type match the full site (full-site/src/styles/global.css).
  External file on purpose: the Content Security Policy blocks inline styles.
*/

@font-face {
  font-family: "Inter Variable";
  src: url("/fonts/inter-latin-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4 Variable";
  src: url("/fonts/source-serif-4-latin-wght.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #0C2846;
  --ink-soft: #3D4A63;
  --teal: #1E6F6A;
  --teal-deep: #175955;
  --teal-tint: #E2EEEC;
  --sand: #F4EFE6;
  --sand-deep: #E6DDCC;
  --grey: #E9ECEF;
  --gold: #C99D2B;
  --paper: #FFFFFF;
  --font-display: "Source Serif 4 Variable", Georgia, "Times New Roman", serif;
  --font-sans: "Inter Variable", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(1rem, 4vw, 2.5rem);
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-feature-settings: "cv11", "ss01";
}

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

.wrap {
  width: 100%;
  max-width: 76rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Header */
.site-header { padding-block: 1.75rem; }
.site-header img { height: 2.75rem; width: auto; }

/* Main layout: text and contact on the left, artwork on the right */
.layout {
  flex: 1;
  display: grid;
  gap: 3rem;
  align-items: center;
  padding-block: 2rem 4rem;
}

h1 {
  margin: 0;
  max-width: 19ch;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.25rem, 1.65rem + 2.4vw, 3.5rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.rule {
  display: block;
  width: 4rem;
  height: 3px;
  margin-block: 1.75rem;
  background: var(--gold);
}

.lead {
  margin: 0;
  max-width: 30em;
  color: var(--ink-soft);
  font-size: clamp(1.125rem, 1.06rem + 0.3vw, 1.3125rem);
  line-height: 1.6;
}

/* Contact card */
.contact {
  margin-top: 2.5rem;
  max-width: 34rem;
  padding: 1.75rem;
  border-radius: 10px;
  background: var(--sand);
}
.contact h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.5rem;
  line-height: 1.25;
}
.contact > p {
  margin: 0.5rem 0 0;
  color: var(--ink-soft);
}
.contact ul {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}
.contact a {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 3.5rem;
  padding: 0.625rem 0.875rem;
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  transition: background-color 150ms ease, box-shadow 150ms ease;
}
.contact a:hover { box-shadow: inset 0 0 0 2px var(--teal); }
.contact a:hover .value { color: var(--teal-deep); text-decoration: underline; text-underline-offset: 0.2em; }
.icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 6px;
  background: var(--teal-tint);
  color: var(--teal);
}
.icon svg { width: 1.375rem; height: 1.375rem; }
.label {
  display: block;
  color: var(--ink-soft);
  font-size: 0.8125rem;
  line-height: 1.4;
}
.value {
  display: block;
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* Back link on the 404 page */
.back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  color: var(--teal);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.back svg { width: 1.125rem; height: 1.125rem; }
.back:hover { color: var(--teal-deep); }

/* Artwork (404 page) */
.art { width: 100%; max-width: 36rem; margin-inline: auto; }

/* Home: the video plays behind the page with the text on top. The poster frame doubles as
   the backdrop, so the page looks the same before the video loads and without motion.
   Phones and tablets: the video fills the first screen and scrolls away with the page.
   Wide screens: it stays fixed behind everything (see the media query at the end). */
.has-video {
  --hero: max(100svh, 40rem);
  background: var(--ink);
}
.bg-video {
  position: absolute;
  inset: 0 0 auto;
  height: var(--hero);
  z-index: -1;
  overflow: hidden;
  background: var(--ink) url("/video/workspace-poster.jpg") center / cover no-repeat;
}
/* Upright phones play an upright crop of the clip (see bg-video.js); this is its first frame.
   The video has no poster of its own: this backdrop shows through until it plays. */
@media (max-width: 47.99rem) and (orientation: portrait) {
  .bg-video { background-image: url("/video/workspace-portrait-poster.jpg"); }
}
.bg-video__media {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.9s ease;
}
/* The tray stays on the desk at the end of the clip, so the last second dissolves back to
   the empty desk (the poster) before the clip starts again. */
.bg-video__media.is-fading { opacity: 0; }
/* Navy shade only where the text sits, so the rest of the video shows clearly. On phones and
   tablets: dark at the top behind the heading, clear over the desk, then into navy. */
.bg-video__shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgb(12 40 70 / 0.85) 0, rgb(12 40 70 / 0.75) 27rem, rgb(12 40 70 / 0.1) 35rem, rgb(12 40 70 / 0.1) calc(100% - 7rem), var(--ink) 100%);
}
.has-video h1 { color: var(--paper); }
.has-video .lead { color: rgb(255 255 255 / 0.92); }
.has-video h1,
.has-video .lead { text-shadow: 0 1px 3px rgb(12 40 70 / 0.45); }
.has-video .site-footer { color: rgb(255 255 255 / 0.85); border-top-color: rgb(255 255 255 / 0.2); }
.layout--video { align-items: start; }
/* The contact card starts near the bottom of the first screen, so the desk shows above it and
   the card's heading still peeks into view. 17.75rem = header, top padding, card margin and peek. */
.layout--video .intro__text { min-height: calc(var(--hero) - 17.75rem); }

/* Pause control for keyboard users: hidden until it receives focus, like a skip link. */
.video-toggle {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 10;
  padding: 0.625rem 1rem;
  border: 0;
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  font: 600 0.9375rem/1.2 var(--font-sans);
  cursor: pointer;
  transform: translateY(-200%);
}
.video-toggle:focus-visible {
  transform: none;
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

/* Footer */
.site-footer {
  padding-block: 1.5rem 2rem;
  border-top: 1px solid var(--grey);
  color: var(--ink-soft);
  font-size: 0.9375rem;
}
.site-footer p { margin: 0; }

/* Keyboard focus: clear on white and on sand */
a:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}

@media (min-width: 64rem) {
  .layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 4rem;
    padding-block: 3rem 5rem;
  }
  .layout--video { grid-template-columns: minmax(0, 36rem) 1fr; }
  .layout--video .intro__text { min-height: 0; }
  .bg-video {
    position: fixed;
    inset: 0;
    height: auto;
  }
  /* Dark behind the text column, clearing a little past its edge so the desk shows on the right. */
  .bg-video__shade {
    --text-edge: calc(max(0px, (100vw - 76rem) / 2) + var(--gutter) + 36rem);
    background: linear-gradient(90deg, rgb(12 40 70 / 0.82) 0, rgb(12 40 70 / 0.72) var(--text-edge), rgb(12 40 70 / 0.08) calc(var(--text-edge) + 14rem));
  }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
