/* Tilted — site styles
   Based on the look of the current Rails landing page: full-width photo header,
   Montserrat uppercase titles, two-column highlight rows, red buttons, dark contact band. */

@font-face { font-family: "Montserrat"; src: url("/assets/fonts/montserrat-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Montserrat"; src: url("/assets/fonts/montserrat-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Montserrat"; src: url("/assets/fonts/montserrat-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --red: #e0292d;       /* Tilted red, a touch darker so white text meets WCAG AA (4.6:1) */
  --red-dark: #c4252a;  /* hover, red text on white */
  --ink: #212529;       /* text, dark bars */
  --muted: #666666;     /* secondary text */
  --light: #f1f1f0;     /* light grey sections */
  --line: #dee2e6;
  --white: #ffffff;
  --display: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --wrap: 72rem;
  --gutter: clamp(1rem, 4vw, 2rem);
  --space: clamp(4.5rem, 9vw, 6.25rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 5.5rem; }
body { margin: 0; font-family: var(--body); font-size: 1.2rem; line-height: 1.75; color: var(--ink); background: var(--white); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--red); text-decoration: none; }
a:hover { color: var(--red-dark); text-decoration: underline; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; border-radius: 2px; }
p { margin: 0 0 1em; }

h1, h2, h3, h4 { font-family: var(--display); font-weight: 700; line-height: 1.2; margin: 0 0 0.6em; }
/* Sub headings in sentence case, like the hero subtitle: fewer all-caps on the page */
h3, .door .door-title { font-family: var(--body); font-weight: 600; text-transform: none; }
h1 { font-size: clamp(2.4rem, 5.9vw, 4.6875rem); line-height: 1; text-transform: uppercase; }
h2 { font-size: clamp(1.9rem, 3.2vw, 2.5rem); text-transform: uppercase; }
h3 { font-size: 1.5rem; }
.small { font-size: 0.875rem; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--white); padding: 0.75rem 1rem; z-index: 100; }
.skip:focus { left: 1rem; }

/* Buttons: Montserrat, uppercase, red */
.button { display: inline-block; font-family: var(--display); font-weight: 700; font-size: 1.125rem; text-transform: uppercase; padding: 1.25rem 2.5rem; background: var(--red); color: var(--white); border: 2px solid var(--red); border-radius: 0.25rem; line-height: 1.2; }
.button:hover { background: var(--red-dark); border-color: var(--red-dark); color: var(--white); text-decoration: none; }
.button-quiet { background: transparent; color: var(--white); border-color: var(--white); }
.button-quiet:hover { background: var(--white); border-color: var(--white); color: var(--ink); }
.button-small { padding: 0.6rem 1rem; font-size: 0.8125rem; }

/* Navigation: dark bar, diamond logo, white uppercase links */
.site-header { position: sticky; top: 0; z-index: 10; background: var(--ink); }
/* Over the hero photo the bar fades from transparent to dark and gets slightly slimmer as you scroll (--bar is set by script) */
.has-hero .site-header { position: fixed; left: 0; right: 0; background: rgba(33, 37, 41, var(--bar, 0)); padding: calc(0.75rem * (1 - var(--bar, 0))) 0; }
.header-row { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.75rem; }
.brand { display: flex; align-items: center; color: var(--white); }
.brand img { width: 52px; height: 52px; }
.brand span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.nav { display: flex; align-items: center; gap: 1.5rem; }
.nav-links { list-style: none; margin: 0; padding: 0; display: flex; gap: 1.75rem; }
.nav-menu { display: none; }
.nav-menu ul { list-style: none; margin: 0; padding: 0; }
.nav-links a, .nav-menu a { color: var(--white); font-family: var(--display); font-size: 0.9rem; font-weight: 400; text-transform: uppercase; letter-spacing: 1px; }
.nav-links a:hover, .nav-links a[aria-current] { color: var(--red); text-decoration: none; }
.lang-menu { position: relative; }
.lang-menu summary { display: flex; align-items: center; list-style: none; cursor: pointer; color: var(--white); padding: 0.25rem 0 0.25rem 0.25rem; background: none; }
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary:hover, .lang-menu[open] summary { opacity: 0.7; }
.lang-menu ul { position: absolute; right: 0; top: calc(100% + 0.6rem); min-width: 10rem; list-style: none; margin: 0; padding: 0.4rem 0; background: var(--ink); border-radius: 0.25rem; box-shadow: 0 8px 24px rgba(0,0,0,0.3); z-index: 20; }
.lang-menu a { display: flex; justify-content: space-between; gap: 1rem; padding: 0.55rem 1rem; color: var(--white); font-family: var(--display); font-size: 0.875rem; }
.lang-menu a:hover { color: var(--white); background: rgba(255,255,255,0.1); text-decoration: none; }
.lang-menu a[aria-current]::after { content: "\2713"; color: var(--white); }
@media (max-width: 62rem) {
  .nav { gap: 0.75rem; }
  .nav-links { display: none; }
  .nav-menu { display: block; }
  .nav-menu summary { display: block; list-style: none; cursor: pointer; color: var(--white); font-family: var(--display); font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 1px; padding: 0.5rem 0.75rem; border: 1px solid rgba(255,255,255,0.5); border-radius: 0.25rem; }
  .nav-menu summary::-webkit-details-marker { display: none; }
  .nav-menu ul { position: absolute; left: var(--gutter); right: var(--gutter); top: 100%; background: var(--ink); border-radius: 0.25rem; padding: 0.5rem 0; box-shadow: 0 8px 24px rgba(0,0,0,0.3); }
  .nav-menu li a { display: block; padding: 0.7rem 1rem; }
}
.cta-short { display: none; }
@media (max-width: 30rem) {
  .brand img { width: 42px; height: 42px; }
  .button-small { padding: 0.55rem 0.75rem; font-size: 0.75rem; white-space: nowrap; }
  .cta-long { display: none; }
  .cta-short { display: inline; }
}

.header-cta { transition: opacity 250ms ease, visibility 250ms; }
.header-cta.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }

/* Header: the photo full width, title over it, left aligned */
.hero { position: relative; color: var(--white); background: #333 center / cover no-repeat; }
.hero::before { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,0.55); }
.hero .wrap { position: relative; padding-top: clamp(8rem, 16vw, 12rem); padding-bottom: clamp(5rem, 12vw, 12rem); }
.hero h1 { max-width: 14em; color: var(--white); margin-bottom: 0.3em; }
.hero-sub { font-size: clamp(1.6rem, 3.6vw, 3.125rem); line-height: 1.35; margin: 0 0 1.5rem; max-width: 22em; }
.hero .lead { font-size: clamp(1.2rem, 1.8vw, 1.4rem); line-height: 1.6; max-width: 36em; margin-bottom: 2.25rem; color: #f1f1f1; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 0; }

/* Sections */
.section { padding: var(--space) 0; }
.section-light { background: var(--light); }
/* Colour per section: the blocks inside stay light so they read easily */
.section-red, .section-dark { color: var(--white); }
.section-red { background: var(--red); }
.section-dark { background: var(--ink); }
.section-red .section-head h2, .section-dark .section-head h2 { color: var(--white); }
.section-red .section-head p, .section-dark .section-head p { color: rgba(255,255,255,0.9); }
.section-red .door, .section-dark .door, .section-dark .highlight { color: var(--ink); }
.section-red :focus-visible { outline-color: var(--white); }
.section-red .door :focus-visible { outline-color: var(--ink); }
.section-head { text-align: center; max-width: 46rem; margin: 0 auto 3.5rem; }
.section-head h2 { margin-bottom: 0.75rem; font-size: clamp(2.25rem, 4.2vw, 3.25rem); }
.section-head p { color: var(--muted); font-size: 1.1rem; margin: 0; }

/* Highlight rows, as on the Rails page: title right-aligned left, text right */
.highlights { list-style: none; margin: 0; padding: 0; }
.highlight { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 6fr); gap: 1rem 3rem; padding: 1.75rem 0; max-width: 62rem; margin: 0 auto; }
.highlight h3 { font-size: clamp(1.5rem, 2.2vw, 1.9rem); text-align: right; line-height: 1.15; margin: 0; }
.highlight p:last-child { margin-bottom: 0; }
.highlight .strong { font-weight: 600; }
.why .highlight { background: var(--white); border-radius: 0.5rem; padding: clamp(1.5rem, 3vw, 2.5rem) clamp(1.5rem, 3.5vw, 3rem); margin-bottom: 1.25rem; box-shadow: 0 1px 2px rgba(0,0,0,0.06); }
.why .highlight:last-child { margin-bottom: 0; }
@media (max-width: 52rem) { .highlight { grid-template-columns: 1fr; } .highlight h3 { text-align: left; } }

/* Help blocks: four colour blocks that fade in gently */
.doors { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem; }
.door { display: flex; flex-direction: column; padding: clamp(1.75rem, 3.5vw, 2.75rem); border-radius: 0.5rem; }
.fade-ready [data-fade] { opacity: 0; transform: scale(0.94); transition: opacity 450ms ease-out, transform 450ms cubic-bezier(.2,1.3,.4,1); }
.fade-ready [data-fade].is-visible { opacity: 1; transform: none; }
/* Stagger the second block in each row */
@media (min-width: 46.01rem) { .fade-ready .doors > [data-fade]:nth-child(even) { transition-delay: 220ms; } }
/* Recent work: the whole block fades in calmly, no pop */
.fade-ready .cases[data-fade] { transform: none; transition: opacity 1200ms ease-out; }
.door h3, .door .door-title { font-size: clamp(1.4rem, 2vw, 1.75rem); margin-bottom: 1rem; }
.door p { max-width: 32em; }
.door-problem { font-weight: 600; }
.door-link { margin: auto 0 0; padding-top: 0.5rem; }
.door-link a { font-family: var(--display); font-weight: 700; font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 2px solid currentColor; }
.door-link a:hover { text-decoration: none; }
/* All blocks light with a red accent: easy to read and scan */
.door { background: #f4f4f3; color: var(--ink); }
.door a:not(.button), .door a:not(.button):hover { color: var(--ink); }
.door-link-inline { margin: 1.75rem 0; padding-top: 0; }
.door-link .button { display: block; width: 100%; text-align: center; border-bottom: 2px solid var(--red); font-size: 1rem; padding: 1rem 1.75rem; }
.door-link .button:hover { color: var(--white); }
.door-body p:last-child, .door-body ul:last-child { margin-bottom: 0; }
.door-body ul { list-style: none; margin: 0 0 1em; padding: 0; }
.door-body li { position: relative; padding-left: 1.4rem; margin-bottom: 0.5rem; }
.door-body li::before { content: ""; position: absolute; left: 0.1rem; top: 0.68em; width: 0.42rem; height: 0.42rem; background: var(--red); transform: rotate(45deg); }
@media (max-width: 46rem) { .doors { grid-template-columns: 1fr; gap: 1.5rem; } }

/* Steps: a real sequence, numbered inside the logo diamond */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2.5rem; text-align: center; }
.step-mark { display: grid; place-items: center; width: 3.5rem; height: 3.5rem; margin: 0.5rem auto 1.5rem; background: var(--red); transform: rotate(45deg); }
.step-mark span { transform: rotate(-45deg); color: var(--white); font-family: var(--display); font-weight: 700; font-size: 1.35rem; }
.steps h3 { font-size: 1.4rem; margin-bottom: 0.4rem; }
.steps p { color: var(--muted); font-size: 1.05rem; margin: 0; }
.steps-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 62rem; margin: 0 auto; }
@media (max-width: 56rem) { .steps, .steps-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 30rem) { .steps, .steps-3 { grid-template-columns: 1fr; } }

/* Cases, as the portfolio grid */
.cases { --gap: 1.75rem; list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 2.5rem var(--gap); }
.cases > .case { flex: 0 0 calc((100% - 2 * var(--gap)) / 3); }
.case a { display: block; color: inherit; }
.case a:hover { text-decoration: none; }
.case h3 { text-align: center; margin-bottom: 0.75rem; font-size: 1.35rem; }
.case img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.case p { background: #f4f4f3; color: var(--muted); font-size: 1rem; text-align: center; padding: 1.25rem 1.5rem; margin: 0; }
.case a:hover h3 { color: var(--red); }
@media (max-width: 62rem) { .cases > .case { flex-basis: calc((100% - var(--gap)) / 2); } }
@media (max-width: 44rem) { .cases > .case { flex-basis: 100%; } }

/* Client logos: sized per logo (see _data/clients.yml) for equal visual weight; grey, in colour on hover */
.logos { list-style: none; margin: 0 auto; padding: 0; max-width: 64rem; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 2.75rem 3.5rem; }
.logos > li { flex: 0 0 auto; display: flex; }
.logos img { display: block; max-width: 100%; height: auto; filter: grayscale(1); opacity: 0.6; mix-blend-mode: multiply; transition: filter 250ms ease, opacity 250ms ease, transform 250ms ease; }
.logos li:hover img, .logos a:focus-visible img { filter: none; opacity: 1; }
.logos a:hover img { transform: scale(1.06); }
.fade-ready .logos > [data-fade], .fade-ready .steps > [data-fade] { transition-delay: var(--d, 0ms); }
@media (max-width: 30rem) { .fade-ready .steps > [data-fade] { transition-delay: 0ms; } }
@media (max-width: 30rem) { .logos { gap: 2rem 2rem; } .logos > li { max-width: 42%; } }

/* Team: round photos, centred */
.team { display: flex; flex-wrap: wrap; justify-content: center; gap: 2.5rem 4rem; }
.person { margin: 0; text-align: center; max-width: 22rem; display: flex; flex-direction: column; }
.person figcaption { flex: 1; display: flex; flex-direction: column; }
.person img { width: 14rem; height: 14rem; object-fit: cover; border-radius: 50%; border: 0.5rem solid rgba(0,0,0,0.1); margin: 0 auto 1.5rem; }
.person h3 { margin-bottom: 0.25rem; }
.person p { color: var(--muted); font-size: 1.2rem; line-height: 1.6; margin-bottom: 0.75rem; }
.person-links { display: flex; justify-content: center; gap: 1.25rem; font-size: 1.05rem; margin-top: auto; }
.outside { max-width: 40rem; margin: 3.5rem auto 0; text-align: center; color: var(--muted); }

/* Contact: dark band with the map, centred closing call to action */
.contact { background: var(--ink) center / cover no-repeat; color: var(--white); padding: clamp(5rem, 10vw, 8rem) 0; }
.contact.in-view { background-image: url("/assets/img/map-image.webp"); }
.contact-inner { text-align: center; max-width: 48rem; }
.contact h2 { color: var(--white); font-size: clamp(2.4rem, 5.6vw, 4.6875rem); line-height: 1.05; margin-bottom: 1.25rem; }
.contact .lead { color: #e9e9e9; font-size: clamp(1.2rem, 1.8vw, 1.4rem); line-height: 1.6; margin: 0 auto 2.5rem; max-width: 34em; }
.contact p:last-child { margin: 0; }
.button-large { font-size: 1.25rem; padding: 1.4rem 3rem; }

/* Landing pages */
.page-hero .wrap { padding-top: clamp(8rem, 14vw, 10rem); padding-bottom: clamp(4rem, 8vw, 7rem); }
.page-hero h1 { font-size: clamp(2.2rem, 4.8vw, 3.75rem); }
.lead-lines { margin-top: 1.75rem; }
.lead-lines p { margin: 0 0 0.9rem; font-size: clamp(1.3rem, 2vw, 1.6rem); line-height: 1.45; }
.lead-lines p:last-child { margin-bottom: 0; }
.page-hero.hero-plain { background: var(--ink); }
.page-hero.hero-plain::before { display: none; }
.crumb { font-family: var(--display); font-weight: 600; text-transform: uppercase; letter-spacing: 1px; font-size: 0.9rem; }
.crumb a { color: var(--white); }
.meta { color: #e1e1e1; margin: 0; }
.prose { max-width: 46rem; margin: 0 auto; }
.prose h2 { font-size: clamp(1.6rem, 2.6vw, 2rem); margin-top: 2em; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 2em; }
.prose ul { padding: 0; list-style: none; margin: 0 0 1.5em; }
.prose ul li { position: relative; padding-left: 1.5rem; margin-bottom: 0.6rem; }
.prose ul li::before { content: ""; position: absolute; left: 0.1rem; top: 0.68em; width: 0.45rem; height: 0.45rem; background: var(--red); transform: rotate(45deg); }
.prose strong { font-weight: 600; }
.case-image { margin-bottom: 2.5rem; height: auto; }

/* Language hint: small bar at the bottom of the screen */
.lang-hint { position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%); z-index: 30; display: flex; align-items: center; gap: 0.75rem; max-width: calc(100% - 2rem); padding: 0.6rem 0.6rem 0.6rem 1.1rem; background: var(--ink); color: var(--white); border-radius: 0.375rem; box-shadow: 0 8px 24px rgba(0,0,0,0.3); font-size: 0.95rem; }
.lang-hint[hidden] { display: none; }
.lang-hint p { margin: 0; }
.lang-hint a { color: var(--white); font-weight: 600; text-decoration: underline; white-space: nowrap; }
.lang-hint-close { flex: none; width: 2rem; height: 2rem; border: 0; border-radius: 0.25rem; background: transparent; color: var(--white); font-size: 1.4rem; line-height: 1; cursor: pointer; }
.lang-hint-close:hover { background: rgba(255,255,255,0.12); }

/* Footer */
.site-footer { padding: 3.5rem 0 2rem; font-size: 1rem; color: var(--muted); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 2fr); gap: 2rem 3rem; align-items: start; }
/* Footer logo as a 3D coin: a red diamond with a thick edge and raised white letters */
.coin { --s: 113px; --t: 12px; --red: #ef2e32; position: relative; width: 160px; height: 160px; transform-style: preserve-3d; }
.coin i { position: absolute; display: block; backface-visibility: hidden; }
.coin-body { position: absolute; left: 50%; top: 50%; width: var(--s); height: var(--s); margin: calc(var(--s) / -2); transform: rotateZ(45deg); transform-style: preserve-3d; }
.coin-edge-t, .coin-edge-b { left: 0; top: calc(50% - var(--t) / 2); width: 100%; height: var(--t); }
.coin-edge-l, .coin-edge-r { top: 0; left: calc(50% - var(--t) / 2); width: var(--t); height: 100%; }
.coin-edge-t { background: #c4252a; transform: rotateX(90deg) translateZ(calc(var(--s) / 2)); }
.coin-edge-b { background: #94191d; transform: rotateX(-90deg) translateZ(calc(var(--s) / 2)); }
.coin-edge-l { background: #ad2024; transform: rotateY(-90deg) translateZ(calc(var(--s) / 2)); }
.coin-edge-r { background: #a11e22; transform: rotateY(90deg) translateZ(calc(var(--s) / 2)); }
/* face: the diamond (masked from the logo); on top the letters in a few layers so they stand out */
.coin-face, .coin-letters { inset: 0; transform: translateZ(var(--z)); }
.coin-face { background: linear-gradient(135deg, #f4564f, var(--red) 45%, #d62529); -webkit-mask: url("/assets/img/logo-full.svg") center / contain no-repeat; mask: url("/assets/img/logo-full.svg") center / contain no-repeat; }
.coin-letters { background: url("/assets/img/logo-letters.svg") center / contain no-repeat; }
.coin-side { background-image: url("/assets/img/logo-letters-side.svg"); }
.coin-top { filter: drop-shadow(0 1px 0 rgba(120, 20, 16, 0.5)); }
.coin-back { transform: rotateY(180deg) translateZ(var(--z)); }
.footer-brand { justify-self: end; perspective: 600px; }
/* Logo turns like a coin, from its back to facing you, when it comes into view */
.footer-logo.spin-ready { transform: rotateY(180deg); }
.footer-logo.spin-ready.spin { transform: rotateY(0); animation: coin-turn 3s ease-in-out both; }
/* half a turn, past the front so you see the edge, then swing back and forth a little and settle slowly */
@keyframes coin-turn { 0% { transform: rotateY(180deg); } 38% { transform: rotateY(-40deg); } 60% { transform: rotateY(18deg); } 78% { transform: rotateY(-7deg); } 91% { transform: rotateY(2deg); } 100% { transform: rotateY(0); } }
.footer-grid p { margin: 0; max-width: 26em; }
.site-footer address { font-style: normal; line-height: 1.7; }
.site-footer address strong { font-family: var(--display); color: var(--ink); }
.footer-grid ul { list-style: none; margin: 0; padding: 0; line-height: 2; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--red); }
.footer-bottom { margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem; }
.footer-bottom p { margin: 0; }
@media (max-width: 46rem) { .footer-grid { grid-template-columns: 1fr; } }
.attribution { color: #6b6b6b; }
.attribution a { color: inherit; text-decoration: underline; }

.diamond { display: inline-block; width: 0.55em; height: 0.55em; background: var(--red); transform: rotate(45deg); margin-right: 0.6em; vertical-align: 0.1em; }
