/* Shared base for the new pages. Fonts are the same self-hosted files as the
   Webflow stylesheet (public/fonts); tokens match its :root values. */

@font-face {
  font-family: 'GT America Expanded';
  src: url('../fonts/GT-America-Expanded-Bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: 'GT America Condensed';
  src: url('../fonts/GT-America-Condensed-Light.otf') format('opentype');
  font-weight: 300;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: 'GT America Condensed';
  src: url('../fonts/GT-America-Condensed-Medium.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: 'GT America Condensed';
  src: url('../fonts/GT-America-Condensed-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: 'GT America Condensed';
  src: url('../fonts/GT-America-Condensed-Thin.otf') format('opentype');
  font-weight: 100;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: 'Adobe Garamond Pro';
  src: url('../fonts/AGaramondPro-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: 'Adobe Garamond Pro';
  src: url('../fonts/AGaramondPro-Italic.otf') format('opentype');
  font-weight: 400;
  font-style: italic;
  font-display: block;
}

:root {
  --white: #fff;
  --black: #282828;
  --red: #e54242;
  --lightgrey: #f5f6f9;

  /* Motion tokens (see MOTION.md). Change the feel of the whole site here. */
  --motion-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --motion-duration-enter: 500ms;
  --motion-duration-hover: 180ms;
  --motion-stagger: 70ms;
  --motion-rise: 10px;
  --tooltip-radius: 8px;

  --edge: clamp(24px, 5vw, 72px);
  --pad-top: clamp(24px, 3.4vw, 48px);
  --pad-bottom: clamp(32px, 4.2vw, 60px);

  --font-expanded: 'GT America Expanded', 'Helvetica Neue', Arial, sans-serif;
  --font-condensed: 'GT America Condensed', 'Arial Narrow', Arial, sans-serif;
  --font-serif: 'Adobe Garamond Pro', Garamond, 'Times New Roman', serif;
}

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

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

body {
  margin: 0;
  background: var(--white);
  color: var(--black);
  font-family: var(--font-condensed);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Visually hidden, still read by screen readers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

img {
  display: block;
  max-width: 100%;
  border: 0;
}

/* Shared chrome: header (logo top left, signature top right) and footer */

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: var(--pad-top) var(--edge) var(--pad-bottom);
}

.site-logo {
  display: block;
  width: clamp(48px, 4.9vw, 70px);
  line-height: 0;
}

/* The mark is images/tom-logo.svg used as a mask, so it can take the colour
   (black, red on hover) and tilt a few degrees, as on the holding page. */
.site-logo-mark {
  display: block;
  width: 100%;
  aspect-ratio: 70 / 72;
  background-color: var(--black);
  -webkit-mask: url('../images/tom-logo.svg') center / 100% 100% no-repeat;
  mask: url('../images/tom-logo.svg') center / 100% 100% no-repeat;
  transition: background-color var(--motion-duration-hover), transform var(--motion-duration-hover);
}

.site-logo:focus-visible .site-logo-mark {
  background-color: var(--red);
  transform: rotate(4deg);
}

@media (hover: hover) {
  .site-logo:hover .site-logo-mark {
    background-color: var(--red);
    transform: rotate(4deg);
  }
}

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

/* Its own element so it can become a toggle or chat entry later. */
.site-signature {
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(44px, 4.2vw, 60px);
  aspect-ratio: 1;
}

.site-signature img {
  width: 83.3%;
  height: auto;
}

/* Footer: Contact and LinkedIn, bottom left */

.site-footer {
  display: flex;
  gap: clamp(32px, 3.3vw, 48px);
  padding: var(--pad-top) var(--edge) var(--pad-bottom);
}

.site-footer a {
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 24px;
  letter-spacing: -0.3429px;
  color: var(--black);
  text-decoration: underline transparent 1px;
  text-underline-offset: 4px;
  transition: color var(--motion-duration-hover), text-decoration-color var(--motion-duration-hover);
  /* 44px touch target without moving the text */
  padding-block: 10px;
  margin-block: -10px;
}

.site-footer a:focus-visible {
  color: var(--red);
  text-decoration-color: currentColor;
}

@media (hover: hover) {
  .site-footer a:hover {
    color: var(--red);
    text-decoration-color: currentColor;
  }
}

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

/* The avatar is only used in the header on mobile (the home page has its own, in its main area). */
.site-avatar {
  display: none;
}

/* Mobile: no underline on the footer links (a tap would otherwise leave it showing). */
@media (max-width: 767.98px) {
  .site-footer a,
  .site-footer a:hover,
  .site-footer a:focus-visible {
    text-decoration: none;
  }

  /* Case study header: avatar top right, signature at the end of the footer (as on the home page) */
  .case {
    position: relative;
  }

  .case .site-avatar {
    display: block;
    width: 56px;
    height: 56px;
    border-radius: 50%;
  }

  .case .site-signature {
    position: absolute;
    right: var(--edge);
    bottom: calc(var(--pad-bottom) - 10px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-logo:hover .site-logo-mark,
  .site-logo:focus-visible .site-logo-mark {
    transform: none;
  }

  .site-footer a {
    transition: none;
  }
}
