/* djsj.co.uk site styles. Palette and type follow design-reference/old-site-reference.md:
   purple #5513a0, yellow #fee13e, navy #212539. Font: Outfit (SIL OFL, assets/fonts/OFL.txt),
   standing in for the old theme's commercial Cocogoose. */

@font-face {
  font-family: "Outfit";
  src: url("/assets/fonts/outfit-latin.woff2") format("woff2");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --purple: #5513a0;
  --purple-dark: #3d0c76;
  --purple-soft: #efe8f8;
  --yellow: #fee13e;
  --navy: #212539;
  --ink: #0e0e0e;
  --muted: #5f6270;
  --bg: #ffffff;
  --bg-alt: #f3f6fa;
  --line: #e2e6ee;
  --radius: 14px;
  --max: 1140px;
  --shadow: 0 10px 30px rgba(33, 37, 57, .10);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Outfit", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--navy);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--purple); }
a:hover { color: var(--purple-dark); }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--yellow); color: var(--ink); padding: 8px 14px; z-index: 50; font-weight: 700; }
.skip:focus { left: 8px; }

/* Type */
h1, h2, h3, h4 { color: var(--ink); line-height: 1.15; margin: 0 0 14px; }
h1 { font-weight: 800; font-size: clamp(2.2rem, 5.5vw, 3.6rem); letter-spacing: -.01em; }
h2 { font-weight: 300; font-size: clamp(1.7rem, 3.4vw, 2.5rem); letter-spacing: -.01em; }
h3 { font-weight: 700; font-size: 1.2rem; }
p { margin: 0 0 16px; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 62ch; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 12px; margin: 0 0 10px;
  font-size: .78rem; font-weight: 800; letter-spacing: .22em; text-transform: uppercase; color: var(--ink);
}
.eyebrow::after { content: ""; width: 34px; height: 2px; background: currentColor; }
.light, .light h1, .light h2, .light h3, .light .eyebrow { color: #fff; }
.light .lead, .light p { color: rgba(255,255,255,.88); }
.prose { max-width: 70ch; }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li { margin: 6px 0; }
.gap-note { background: #fff7c7; padding: 0 4px; border-radius: 4px; }

/* Buttons */
.btn {
  display: inline-block; background: var(--yellow); color: var(--ink); text-decoration: none;
  padding: 15px 28px; border-radius: 6px; font-weight: 800; font-size: .82rem; letter-spacing: .14em;
  text-transform: uppercase; border: 0; cursor: pointer; transition: transform .2s ease, box-shadow .2s ease, background .2s;
}
.btn:hover { color: var(--ink); background: #ffd800; transform: translateY(-2px); box-shadow: 0 8px 18px rgba(0,0,0,.15); }
.btn.purple { background: var(--purple); color: #fff; }
.btn.purple:hover { background: var(--purple-dark); color: #fff; }
.btn.ghost { background: transparent; color: #fff; box-shadow: inset 0 0 0 2px rgba(255,255,255,.8); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn.ghost:hover { background: rgba(255,255,255,.12); }

/* Header */
.site-header { background: var(--purple); position: sticky; top: 0; z-index: 20; box-shadow: 0 2px 14px rgba(0,0,0,.18); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 76px; }
.logo img { height: 36px; width: auto; }
nav a { margin-left: 26px; text-decoration: none; color: #fff; font-weight: 600; position: relative; }
nav a:not(.cta)::after { content: ""; position: absolute; left: 0; right: 100%; bottom: -6px; height: 2px; background: var(--yellow); transition: right .25s ease; }
nav a:not(.cta):hover::after, nav a[aria-current="page"]::after { right: 0; }
nav a:hover { color: #fff; }
nav a[aria-current="page"] { color: var(--yellow); }
nav a.cta { background: var(--yellow); color: var(--ink); padding: 10px 18px; border-radius: 6px; font-weight: 800; }
nav a.cta:hover { background: #ffd800; color: var(--ink); }
.menu-toggle {
  display: none; background: transparent; border: 2px solid rgba(255,255,255,.7); border-radius: 6px;
  padding: 8px 14px; font: inherit; font-weight: 700; color: #fff; cursor: pointer;
}
@media (max-width: 760px) {
  .site-header .wrap { position: relative; height: 68px; }
  .logo img { height: 30px; }
  .menu-toggle { display: inline-block; }
  nav {
    display: none; position: absolute; top: 68px; left: 0; right: 0; background: var(--purple-dark);
    padding: 6px 20px 20px; box-shadow: 0 12px 20px rgba(0,0,0,.2);
  }
  .site-header.open nav { display: block; }
  nav a { display: block; margin: 0; padding: 13px 0; border-bottom: 1px solid rgba(255,255,255,.15); }
  nav a:not(.cta)::after { display: none; }
  nav a.cta { display: inline-block; margin-top: 16px; border-bottom: 0; }
}

/* Homepage hero with photo and text carousel */
.hero { position: relative; color: #fff; overflow: hidden; background: var(--purple-dark); }
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(100deg, rgba(61,12,118,.94) 0%, rgba(85,19,160,.82) 45%, rgba(85,19,160,.35) 100%);
}
.hero .wrap { position: relative; z-index: 2; padding-top: 70px; padding-bottom: 60px; min-height: min(82vh, 640px); display: flex; flex-direction: column; justify-content: center; }
.hero h1, .hero h2 { color: #fff; max-width: 17ch; }
.hero h2 { font-weight: 700; font-size: clamp(2rem, 5vw, 3.2rem); }
.hero p { color: rgba(255,255,255,.9); font-size: 1.2rem; max-width: 54ch; }
.hero .hl { color: var(--yellow); }

/* Inner page header with wave */
.page-header { background: var(--purple); color: #fff; position: relative; padding: 70px 0 120px; overflow: hidden; }
.page-header::before {
  content: ""; position: absolute; inset: 0; opacity: .12;
  background: repeating-linear-gradient(135deg, transparent 0 22px, rgba(255,255,255,.6) 22px 23px);
}
.page-header .wrap { position: relative; }
.page-header h1 { color: #fff; text-transform: uppercase; letter-spacing: .02em; max-width: 22ch; }
.page-header p { color: rgba(255,255,255,.9); max-width: 60ch; font-size: 1.15rem; }
.page-header .meta { font-size: .95rem; opacity: .9; }
.wave { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: 90px; display: block; }

/* Sections */
section.block { padding: 90px 0; position: relative; }
section.alt { background: var(--bg-alt); }
section.purple { background: var(--purple); }
section.yellow-left { overflow: hidden; }
section.yellow-left::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 30%; background: var(--yellow); }
section.yellow-left .wrap { position: relative; }
.section-title { margin-bottom: 44px; max-width: 760px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.split.reverse > :first-child { order: 2; }
.split img, .photo { border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; object-fit: cover; }
.feature-photo { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow); margin: -60px 0 0; position: relative; z-index: 2; }
@media (max-width: 860px) {
  section.block { padding: 64px 0; }
  .split { grid-template-columns: 1fr; gap: 28px; }
  .split.reverse > :first-child { order: 0; }
  section.yellow-left::before { width: 100%; height: 8px; bottom: auto; }
  .feature-photo { margin-top: -40px; }
}

/* Cards and grids */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.grid.four { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; position: relative;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: transparent; }
.card h3 { font-size: .95rem; letter-spacing: .08em; text-transform: uppercase; color: var(--purple); }
.card h3 a { color: inherit; text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; }
.card p { color: var(--muted); margin: 0; }
.card .more { display: inline-block; margin-top: 12px; font-weight: 700; font-size: .9rem; }
.card .icon {
  width: 52px; height: 52px; border-radius: 50%; background: var(--purple-soft); color: var(--purple);
  display: grid; place-items: center; font-weight: 800; margin-bottom: 16px;
}

/* Numbered steps */
.steps { counter-reset: step; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 28px; }
.steps > div { position: relative; padding-left: 60px; }
.steps > div::before {
  counter-increment: step; content: counter(step, decimal-leading-zero);
  position: absolute; left: 0; top: 0; width: 44px; height: 44px; border-radius: 50%;
  background: var(--yellow); color: var(--ink); display: grid; place-items: center; font-weight: 800; font-size: .9rem;
}
.light .steps > div::before { background: var(--yellow); }

/* Process tiles with photos (homepage) */
.process { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.process .tile { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .25s ease; }
.process .tile:hover { transform: translateY(-6px); }
.process .tile img { aspect-ratio: 1 / 1; object-fit: cover; width: 100%; }
.process .tile div { padding: 18px 20px 22px; }
.process .num { font-weight: 800; color: var(--purple); }
.process h3 { margin: 4px 0 6px; }
.process p { margin: 0; color: var(--muted); font-size: .98rem; }
.purple-base { position: relative; }
.purple-base::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 120px; background: var(--purple); z-index: 0; }
.purple-base .wrap { position: relative; z-index: 1; }
@media (max-width: 900px) { .process { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .process { grid-template-columns: 1fr; } }

/* Brand proof strip */
.brands { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.brand { border-radius: var(--radius); overflow: hidden; background: #fff; box-shadow: var(--shadow); text-decoration: none; color: var(--ink); transition: transform .25s ease; display: block; }
.brand:hover { transform: translateY(-6px); color: var(--ink); }
.brand img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.brand .name { padding: 14px 18px; font-weight: 700; }
.brand .name small { display: block; font-weight: 400; color: var(--muted); }
.brand.text-only { background: var(--navy); color: #fff; display: flex; flex-direction: column; justify-content: flex-end; min-height: 100%; }
.brand.text-only .mark { flex: 1; display: grid; place-items: center; font-size: 2.2rem; font-weight: 800; letter-spacing: .06em; color: var(--yellow); aspect-ratio: 4 / 3; }
.brand.text-only .name small { color: rgba(255,255,255,.75); }
@media (max-width: 900px) { .brands { grid-template-columns: repeat(2, 1fr); } }

/* Carousel (hero slides and Work). Swipeable, arrows and dots, never auto-advances. */
.carousel { position: relative; }
.carousel-track {
  display: flex; gap: 24px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-bottom: 4px;
}
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-track > * { scroll-snap-align: start; flex: 0 0 auto; }
.hero .carousel-track { gap: 0; }
.hero .carousel-track > * { width: 100%; padding-right: 8px; }
.carousel-controls { display: flex; align-items: center; gap: 14px; margin-top: 26px; }
.carousel-controls button.arrow {
  width: 48px; height: 48px; border-radius: 6px; border: 0; background: var(--yellow); color: var(--ink);
  font-size: 1.3rem; font-weight: 800; cursor: pointer; transition: transform .2s;
}
.carousel-controls button.arrow:hover { transform: translateY(-2px); }
.carousel-controls button.arrow:disabled { opacity: .4; cursor: default; transform: none; }
.dots { display: flex; gap: 4px; }
/* 28px tap target around a 12px dot */
.dots button { width: 28px; height: 28px; border: 0; background: transparent; padding: 0; cursor: pointer; display: grid; place-items: center; }
.dots button::after { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--purple); box-sizing: border-box; }
.dots button[aria-current="true"]::after { background: var(--purple); }
.hero .dots button::after { border-color: #fff; }
.hero .dots button[aria-current="true"]::after { background: var(--yellow); border-color: var(--yellow); }
.case-card { width: min(86%, 520px); background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.case-card img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.case-card .body { padding: 22px 24px 26px; }
.case-card h3 { font-size: 1.25rem; }
.case-card p { color: var(--muted); }
.case-card .mark { aspect-ratio: 4 / 3; background: var(--navy); color: var(--yellow); display: grid; place-items: center; font-size: 2.6rem; font-weight: 800; letter-spacing: .06em; }

/* Case studies page */
.case { padding: 70px 0; border-top: 1px solid var(--line); }
.case:first-of-type { border-top: 0; }
.case .site { margin: 0 0 18px; }
.case dl { display: grid; grid-template-columns: 170px 1fr; gap: 12px 24px; margin: 0; }
.case dt { font-weight: 800; color: var(--purple); }
.case dd { margin: 0; color: var(--muted); }
.case .mark { aspect-ratio: 3 / 2; background: var(--navy); color: var(--yellow); display: grid; place-items: center; font-size: 3rem; font-weight: 800; border-radius: var(--radius); }
@media (max-width: 640px) { .case dl { grid-template-columns: 1fr; gap: 4px; } .case dd { margin-bottom: 12px; } }

/* Team */
.team { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 260px)); gap: 28px; }
.team figure { margin: 0; text-align: center; }
.team img { aspect-ratio: 3 / 4; object-fit: cover; width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); }
.team figcaption { margin-top: 14px; font-weight: 800; font-size: 1.1rem; color: var(--ink); }
.team figcaption small { display: block; font-weight: 400; color: var(--muted); font-size: .95rem; }

/* FAQ */
details { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 18px 22px; margin: 0 0 12px; max-width: 76ch; transition: box-shadow .2s; }
details[open] { box-shadow: var(--shadow); }
summary { font-weight: 700; cursor: pointer; color: var(--ink); }
details p { margin: 12px 0 0; color: var(--muted); }

/* Blog */
.posts { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.post-card { background: #fff; border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); border-top: 5px solid var(--yellow); transition: transform .25s ease; position: relative; }
.post-card:hover { transform: translateY(-6px); }
.post-card time, .post-card .by { font-size: .9rem; color: var(--muted); }
.post-card h3 { font-size: 1.3rem; margin: 6px 0 10px; }
.post-card h3 a { color: var(--ink); text-decoration: none; }
.post-card h3 a::after { content: ""; position: absolute; inset: 0; }
.article { max-width: 72ch; }
.article h2 { font-size: 1.5rem; font-weight: 700; margin-top: 34px; }
.article .posted { margin-top: 40px; color: var(--muted); font-size: .95rem; }

/* Tables (privacy) */
table { border-collapse: collapse; width: 100%; margin: 8px 0 16px; background: #fff; }
th, td { text-align: left; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid var(--line); }
th { background: var(--purple-soft); color: var(--ink); }

/* Quote call to action */
.quote-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 30px; }
.quote-cta .quote { font-size: clamp(1.3rem, 2.6vw, 1.8rem); font-weight: 300; margin: 0; color: inherit; }
.contact-points { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; margin-top: 28px; }
.contact-points .card h3 { margin-bottom: 6px; }

/* Enquiry form */
.form-wrap { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 34px; max-width: 780px; }
form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
form label { display: block; font-weight: 700; margin: 0 0 6px; font-size: .95rem; color: var(--ink); }
form input, form select, form textarea {
  width: 100%; padding: 13px 14px; border: 1px solid #cfd5df; border-radius: 6px; font: inherit; background: #fff; color: var(--navy);
}
form input:focus, form select:focus, form textarea:focus { outline: none; border-color: var(--purple); box-shadow: 0 0 0 3px rgba(85,19,160,.18); }
form textarea { min-height: 150px; resize: vertical; }
form > div, form .row > div { margin-bottom: 16px; }
.hp { position: absolute; left: -9999px; }
.status { margin-top: 12px; font-weight: 600; }
.status.error { color: #b3261e; }
.note { font-size: .9rem; color: var(--muted); margin-top: 10px; }
.cf-turnstile { margin: 6px 0 16px; }
@media (max-width: 600px) { form .row { grid-template-columns: 1fr; gap: 0; } .form-wrap { padding: 22px; } }

/* Footer */
.site-footer { background: var(--purple); color: rgba(255,255,255,.88); border-top: 5px solid var(--yellow); padding: 70px 0 30px; font-size: .97rem; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { color: var(--yellow); }
.footer-cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 34px; }
.footer-cols .fh { color: var(--yellow); font-size: .8rem; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; margin-bottom: 14px; }
.footer-cols ul { list-style: none; margin: 0; padding: 0; }
.footer-cols li { margin: 0 0 8px; }
.footer-cols .logo img { height: 32px; margin-bottom: 16px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.18); margin-top: 40px; padding-top: 22px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; font-size: .9rem; }
.footer-bottom .legal { flex-basis: 100%; margin: 0; font-size: .82rem; color: rgba(255,255,255,.75); }
@media (max-width: 860px) { .footer-cols { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-cols { grid-template-columns: 1fr; } }

/* Simple centred pages (thank-you, 404) */
.centre-page { padding: 110px 0; text-align: center; }
.centre-page .lead { margin: 0 auto 26px; }

/* Scroll-in motion. Only runs when JavaScript has added .js to <html>. */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .carousel-track { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .card:hover, .btn:hover, .brand:hover, .post-card:hover, .process .tile:hover { transform: none; }
}
