/*
 * The Complete Company brand kit: colours, type, buttons, links, fields, cards and the
 * line drawings. Both of our sites use this one file:
 *
 *   - thecompletecompany.co.uk (ccc-website): this copy, assets/ccc-brand.css, is the source.
 *   - EstateOS (ccc-front): src/brand/ccc-brand.css, copied from here by scripts/sync-brand.mjs.
 *
 * Change it here, then run the sync script in ccc-front so the two sites stay the same.
 * Nothing here targets one site's markup: page-specific styling stays in each site's own files.
 */

/* ------------------------------------------------------------ Tokens */

:root {
  /* Brand colours */
  --ccc-maroon: #6b1d22;
  --ccc-maroon-bright: #a63a40;
  --ccc-maroon-deep: #4a1216;
  --ccc-maroon-soft: rgba(107, 29, 34, 0.1);
  --ccc-blush: #f6eaea;
  --ccc-brass: #d4a55f;
  --ccc-brass-light: #f1d3a1;
  --ccc-brass-soft: rgba(212, 165, 95, 0.55);
  --ccc-ink: #1b1011;
  --ccc-ink-soft: #4a3b3c;
  --ccc-night: #120a0b;
  --ccc-line: #e4d9d9;
  --ccc-line-strong: #cdbcbc;
  --ccc-paper: #fcf9f9;
  --ccc-error: #b3261e;
  --ccc-beacon: #ff5a4e;

  /* Maroon scale, 700 is the brand maroon */
  --ccc-red-25: #fcf9f9;
  --ccc-red-50: #f6eaea;
  --ccc-red-100: #efd9da;
  --ccc-red-200: #e0b9bb;
  --ccc-red-300: #c97c80;
  --ccc-red-400: #a63a40;
  --ccc-red-500: #8c2b30;
  --ccc-red-600: #761f26;
  --ccc-red-700: #6b1d22;
  --ccc-red-800: #4a1216;
  --ccc-red-900: #360d10;
  --ccc-red-950: #1b1011;

  /* Warm greys for text, borders and panels */
  --ccc-grey-25: #fcfbfb;
  --ccc-grey-50: #faf8f8;
  --ccc-grey-100: #f4f1f1;
  --ccc-grey-200: #e8e3e3;
  --ccc-grey-300: #d6cfcf;
  --ccc-grey-400: #a89d9e;
  --ccc-grey-500: #766a6b;
  --ccc-grey-600: #564a4b;
  --ccc-grey-700: #3f3435;
  --ccc-grey-800: #2a2122;
  --ccc-grey-900: #1b1011;
  --ccc-grey-950: #120a0b;

  /* Type */
  --ccc-font: "Catamaran", sans-serif;

  /* Shape, depth and motion */
  --ccc-radius: 14px;
  --ccc-radius-field: 10px;
  --ccc-radius-pill: 1.6em;
  --ccc-shadow-soft: 0 1px 4px rgba(27, 16, 17, 0.12);
  --ccc-shadow: 0 18px 40px -18px rgba(27, 16, 17, 0.35);
  --ccc-shadow-lift: 0 14px 28px -14px rgba(27, 16, 17, 0.55);
  --ccc-ease: cubic-bezier(0.19, 1, 0.22, 1);
  --ccc-ease-draw: cubic-bezier(0.65, 0, 0.35, 1);
}

::selection {
  background: var(--ccc-maroon);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--ccc-brass);
  outline-offset: 3px;
}

/* ----------------------------------------------------------- Buttons */

/* Round on one line, a soft rectangle when a narrow column wraps the label. */
.ccc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55em;
  min-height: 44px;
  padding: 0.7em 1.5em;
  border: 1.5px solid transparent;
  border-radius: var(--ccc-radius-pill);
  font-family: var(--ccc-font);
  font-weight: 500;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 0.35s var(--ccc-ease),
    box-shadow 0.35s var(--ccc-ease),
    background-color 0.3s ease,
    border-color 0.3s ease,
    color 0.3s ease;
}

.ccc-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--ccc-shadow-lift);
}

.ccc-btn:active {
  transform: translateY(0);
}

.ccc-btn--primary {
  background-color: var(--ccc-maroon);
  color: #fff;
}

.ccc-btn--primary:hover {
  background-color: var(--ccc-maroon-bright);
  color: #fff;
}

.ccc-btn--secondary {
  border-color: var(--ccc-maroon);
  background-color: #fff;
  color: var(--ccc-maroon);
}

.ccc-btn--secondary:hover {
  background-color: var(--ccc-blush);
  color: var(--ccc-maroon);
}

/* On maroon or dark backgrounds */
.ccc-btn--light {
  background-color: #fff;
  color: var(--ccc-maroon);
}

.ccc-btn--light:hover {
  background-color: var(--ccc-blush);
  color: var(--ccc-maroon);
}

.ccc-btn--outline-light {
  border-color: rgba(255, 255, 255, 0.75);
  background-color: transparent;
  color: #fff;
}

.ccc-btn--outline-light:hover {
  border-color: #fff;
  background-color: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.ccc-btn__arrow {
  flex: 0 0 auto;
  width: 0.95em;
  height: 0.95em;
  transition: transform 0.35s var(--ccc-ease);
}

.ccc-btn:hover .ccc-btn__arrow {
  transform: translateX(4px);
}

/* ------------------------------------------------------------- Links */

/* Navigation links get a brass line that sweeps in from the left. */
.ccc-navlink {
  position: relative;
  text-decoration: none;
}

.ccc-navlink::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 2px;
  border-radius: 2px;
  background: var(--ccc-brass);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.45s var(--ccc-ease);
}

.ccc-navlink:hover::after,
.ccc-navlink[aria-current]::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* Text links on dark backgrounds, as in the footer. */
.ccc-link-light {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.45);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition:
    color 0.3s ease,
    text-decoration-color 0.3s ease,
    text-underline-offset 0.3s ease;
}

.ccc-link-light:hover {
  color: var(--ccc-brass);
  text-decoration-color: var(--ccc-brass);
  text-underline-offset: 6px;
}

/* ------------------------------------------------------------ Fields */

.ccc-field {
  border: 1px solid var(--ccc-line);
  border-radius: var(--ccc-radius-field);
  background-color: var(--ccc-paper);
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    background-color 0.25s ease;
}

.ccc-field:hover {
  border-color: var(--ccc-line-strong);
}

.ccc-field:focus,
.ccc-field:focus-within {
  outline: none;
  border-color: var(--ccc-maroon);
  background-color: #fff;
  box-shadow: 0 0 0 4px var(--ccc-maroon-soft);
}

/* ------------------------------------------------------------- Cards */

.ccc-card {
  border-radius: var(--ccc-radius);
  background-color: #fff;
  transition:
    transform 0.5s var(--ccc-ease),
    box-shadow 0.5s var(--ccc-ease),
    background-color 0.5s ease;
}

.ccc-card--lift:hover {
  transform: translateY(-6px);
  box-shadow: var(--ccc-shadow);
}

/* --------------------------------------------------- Blueprint grid */

/* A faint drawing-board grid behind a section. Add --light on dark backgrounds. */
.ccc-blueprint {
  --ccc-grid-line: rgba(107, 29, 34, 0.05);
  --ccc-grid-line-strong: rgba(107, 29, 34, 0.09);
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--ccc-grid-line-strong) 1px, transparent 1px),
    linear-gradient(90deg, var(--ccc-grid-line-strong) 1px, transparent 1px),
    linear-gradient(var(--ccc-grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--ccc-grid-line) 1px, transparent 1px);
  background-size:
    120px 120px,
    120px 120px,
    24px 24px,
    24px 24px;
}

.ccc-blueprint--light {
  --ccc-grid-line: rgba(255, 255, 255, 0.1);
  --ccc-grid-line-strong: rgba(255, 255, 255, 0.22);
}

/* --------------------------------------------------------- Drawings */

/* Every drawing comes from ccc-art.js. Strokes with the class "d" draw themselves when the
   drawing's wrapper gains "is-drawn"; shapes with "f" fade in. */
.ccc-art svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ccc-art .d {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset var(--ccc-draw, 1.4s) var(--ccc-ease-draw) var(--d, 0s);
}

.ccc-art .f {
  opacity: 0;
  transition: opacity 0.9s ease var(--d, 0s);
}

.ccc-art.is-drawn .d {
  stroke-dashoffset: 0;
}

.ccc-art.is-drawn .f {
  opacity: 1;
}

.ccc-art text {
  fill: currentColor;
  stroke: none;
  font: 600 11px/1 var(--ccc-font);
  letter-spacing: 0.08em;
}

.ccc-art .ccc-art__accent,
.ccc-art__measure {
  color: var(--ccc-brass);
}

.ccc-art__glow {
  fill: var(--ccc-brass);
  stroke: none;
}

.ccc-art.is-drawn .ccc-art__glow {
  opacity: 0.55;
}

.ccc-art__fill {
  fill: currentColor;
  stroke: none;
}

.ccc-art__knockout {
  stroke: #fff;
}

.ccc-art__dot {
  fill: var(--ccc-beacon);
  stroke: none;
}

.ccc-art__beacon {
  fill: var(--ccc-beacon);
  stroke: none;
  animation: ccc-blink 2.4s steps(1, end) infinite;
}

/* Moving parts start once the drawing has finished. */
.ccc-art__smoke circle {
  fill: rgba(255, 255, 255, 0.35);
  stroke: none;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}

.ccc-art--on-light .ccc-art__smoke circle {
  fill: rgba(27, 16, 17, 0.18);
}

.ccc-art.is-drawn .ccc-art__smoke circle {
  animation: ccc-smoke 4.5s ease-out infinite;
}

.ccc-art.is-drawn .ccc-art__smoke circle:nth-child(2) {
  animation-delay: 1.5s;
}

.ccc-art.is-drawn .ccc-art__smoke circle:nth-child(3) {
  animation-delay: 3s;
}

.ccc-art__trolley {
  transform-box: view-box;
}

.ccc-art.is-drawn .ccc-art__trolley {
  animation: ccc-trolley 9s var(--ccc-ease-draw) 2.4s infinite alternate;
}

.ccc-art__load {
  transform-box: fill-box;
  transform-origin: 50% 0;
}

.ccc-art.is-drawn .ccc-art__load {
  animation: ccc-sway 3s ease-in-out 2.4s infinite alternate;
}

.ccc-art__hand {
  stroke-width: 2;
  transform-box: view-box;
  transform-origin: 200px 124px;
}

.ccc-art.is-drawn .ccc-art__hand {
  animation: ccc-spin 12s linear infinite;
}

.ccc-art.is-drawn .ccc-art__hand--hour {
  animation-duration: 144s;
}

.ccc-art__flag {
  transform-box: fill-box;
  transform-origin: 0 50%;
}

.ccc-art.is-drawn .ccc-art__flag {
  animation: ccc-flag 2.6s ease-in-out 2s infinite alternate;
}

.ccc-art.is-drawn .ccc-art__birds {
  animation: ccc-birds 16s linear 2s infinite;
}

.ccc-art__bubble {
  fill: var(--ccc-brass);
  stroke: none;
}

.ccc-art.is-drawn .ccc-art__bubble {
  animation: ccc-level 5s ease-in-out 2.5s infinite;
}

.ccc-art__north {
  transform-box: fill-box;
  transform-origin: center;
}

.ccc-art.is-drawn .ccc-art__north {
  animation: ccc-needle 5s ease-in-out 2s infinite alternate;
}

.ccc-art__bubbles circle {
  fill: var(--ccc-brass);
  stroke: none;
  opacity: 0;
}

.ccc-art.is-drawn .ccc-art__bubbles circle {
  animation: ccc-bubble 3.2s ease-in infinite;
}

.ccc-art.is-drawn .ccc-art__bubbles circle:nth-child(2) {
  animation-delay: 0.8s;
}

.ccc-art.is-drawn .ccc-art__bubbles circle:nth-child(3) {
  animation-delay: 1.6s;
}

.ccc-art.is-drawn .ccc-art__bubbles circle:nth-child(4) {
  animation-delay: 2.4s;
}

.ccc-art.is-drawn .ccc-art__liquid {
  animation: ccc-liquid 3s ease-in-out 2s infinite alternate;
}

/* Icon details: a badge that pops on, bars that grow, a bell that rings, a flag that waves. */
.ccc-art__pop {
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(0);
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.9s;
}

.ccc-art.is-drawn .ccc-art__pop {
  transform: scale(1);
}

.ccc-art__bar {
  fill: currentColor;
  stroke: none;
  transform-box: fill-box;
  transform-origin: bottom;
  transform: scaleY(0);
  transition: transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) var(--d, 0.6s);
}

.ccc-art.is-drawn .ccc-art__bar {
  transform: scaleY(1);
}

.ccc-art__bell {
  transform-box: fill-box;
  transform-origin: 50% 0;
}

.ccc-art.is-drawn .ccc-art__bell {
  animation: ccc-ring 4s ease-in-out 1.4s infinite;
}

.ccc-art__ping {
  fill: var(--ccc-beacon);
  stroke: none;
  transform-box: fill-box;
  transform-origin: center;
  opacity: 0;
}

.ccc-art.is-drawn .ccc-art__ping {
  animation: ccc-ping 2s cubic-bezier(0, 0, 0.2, 1) 1.4s infinite;
}

.ccc-art__pennant {
  fill: currentColor;
  transform-box: fill-box;
  transform-origin: left center;
}

.ccc-art.is-drawn .ccc-art__pennant {
  animation: ccc-wave 2.4s ease-in-out infinite;
}

.ccc-art__heart {
  fill: currentColor;
  transform-box: fill-box;
  transform-origin: center;
}

.ccc-art.is-drawn .ccc-art__heart {
  animation: ccc-beat 1.6s ease-in-out infinite;
}

/* Skyline windows glow brass and a few of them twinkle. */
.ccc-win {
  fill: var(--ccc-brass);
  stroke: none;
  opacity: 0;
  transition: opacity 1s ease 2.2s;
}

.ccc-art.is-drawn .ccc-win {
  opacity: 0.14;
}

.ccc-art.is-drawn .ccc-win--lit {
  animation: ccc-twinkle var(--t, 6s) ease-in-out var(--o, 0s) infinite alternate;
}

/* --------------------------------------------------------- Keyframes */

@keyframes ccc-blink {
  0%,
  60% {
    opacity: 1;
  }
  61%,
  100% {
    opacity: 0.15;
  }
}

@keyframes ccc-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes ccc-smoke {
  0% {
    opacity: 0;
    transform: translate(0, 0) scale(0.6);
  }
  20% {
    opacity: 0.9;
  }
  100% {
    opacity: 0;
    transform: translate(18px, -46px) scale(2.2);
  }
}

@keyframes ccc-trolley {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(150px);
  }
}

@keyframes ccc-sway {
  from {
    transform: rotate(-2.5deg);
  }
  to {
    transform: rotate(2.5deg);
  }
}

@keyframes ccc-flag {
  from {
    transform: skewY(-4deg) scaleX(0.92);
  }
  to {
    transform: skewY(4deg) scaleX(1);
  }
}

@keyframes ccc-birds {
  from {
    transform: translate(-60px, 10px);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  to {
    transform: translate(360px, -20px);
    opacity: 0;
  }
}

@keyframes ccc-level {
  0%,
  100% {
    transform: translateX(-9px);
  }
  45%,
  55% {
    transform: translateX(0);
  }
  75% {
    transform: translateX(6px);
  }
}

@keyframes ccc-needle {
  from {
    transform: rotate(-12deg);
  }
  to {
    transform: rotate(12deg);
  }
}

@keyframes ccc-bubble {
  0% {
    opacity: 0;
    transform: translateY(0);
  }
  15% {
    opacity: 0.9;
  }
  100% {
    opacity: 0;
    transform: translateY(-44px);
  }
}

@keyframes ccc-liquid {
  from {
    transform: translateX(-6px);
  }
  to {
    transform: translateX(6px);
  }
}

@keyframes ccc-twinkle {
  0%,
  35% {
    opacity: 0.14;
  }
  50%,
  100% {
    opacity: 0.95;
  }
}

@keyframes ccc-ring {
  0%,
  55%,
  100% {
    transform: rotate(0);
  }
  60% {
    transform: rotate(14deg);
  }
  66% {
    transform: rotate(-12deg);
  }
  72% {
    transform: rotate(9deg);
  }
  78% {
    transform: rotate(-6deg);
  }
  84% {
    transform: rotate(3deg);
  }
}

@keyframes ccc-ping {
  0% {
    transform: scale(1);
    opacity: 0.6;
  }
  80%,
  100% {
    transform: scale(2.6);
    opacity: 0;
  }
}

@keyframes ccc-wave {
  0%,
  100% {
    transform: skewY(0) scaleX(1);
  }
  50% {
    transform: skewY(-8deg) scaleX(0.88);
  }
}

@keyframes ccc-beat {
  0%,
  40%,
  100% {
    transform: scale(1);
  }
  15% {
    transform: scale(1.18);
  }
  28% {
    transform: scale(1.05);
  }
}

/* ----------------------------------------------------- Reduced motion */

@media (prefers-reduced-motion: reduce) {
  .ccc-btn,
  .ccc-btn__arrow,
  .ccc-navlink::after,
  .ccc-card,
  .ccc-art .d,
  .ccc-art .f,
  .ccc-art__pop,
  .ccc-art__bar,
  .ccc-win {
    transition: none !important;
  }

  .ccc-btn:hover,
  .ccc-card--lift:hover {
    transform: none;
  }

  .ccc-art * {
    animation: none !important;
  }

  .ccc-art .d {
    stroke-dasharray: none;
  }
}

@media print {
  .ccc-art,
  .ccc-blueprint {
    display: none !important;
  }
}
