:root {
  --red: #d71920;
  --black: #111111;
  --white: #ffffff;
  --grey: #f3f3f3;
  --muted: #5c5c5c;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--black);
  background: var(--white);
}

.wrap {
  max-width: 44rem;
  margin: 0 auto;
  padding: 0 max(1.25rem, env(safe-area-inset-left)) 0 max(1.25rem, env(safe-area-inset-right));
}

h1, h2, h3 { line-height: 1.15; margin: 0; }

/* Hero */
.hero {
  background: var(--black);
  color: var(--white);
  padding: max(2.5rem, env(safe-area-inset-top)) 0 3rem;
}
.logo { display: block; width: 6.5rem; height: 6.5rem; margin-bottom: 1.5rem; color: #f2efe9; }
.logo svg { display: block; width: 100%; height: 100%; overflow: visible; }

/* Logo animation, copied from sampulman.dev (bs-mark). */
:root { --ease-design: cubic-bezier(.16, .84, .3, 1); --ease-mark: cubic-bezier(.2, .9, .2, 1); }
.bs-mark-ring { stroke-dasharray: 327; animation: bs-draw-ring 1.7s .4s var(--ease-design) both; }
.bs-mark-bar { transform-box: fill-box; transform-origin: bottom; animation: bs-grow .85s var(--ease-mark) both; animation-delay: var(--d, 0s); transition: transform .4s var(--ease-design); }
.bs-mark-bar.d1 { --d: .25s; } .bs-mark-bar.d2 { --d: .35s; } .bs-mark-bar.d3 { --d: .45s; } .bs-mark-bar.d4 { --d: .55s; }
.bs-mark:focus-visible .bs-mark-bar-2, .bs-mark:hover .bs-mark-bar-2 { transform: translateY(-23.35px); }
@keyframes bs-draw-ring { 0% { stroke-dashoffset: 327px; } to { stroke-dashoffset: 0; } }
@keyframes bs-grow { 0% { transform: scaleY(0); } to { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) {
  .bs-mark-bar, .bs-mark-ring { animation-duration: 1ms !important; animation-iteration-count: 1 !important; }
  .bs-mark-bar { transition-duration: 0.01ms !important; }
}
.hero h1 { font-size: clamp(2.4rem, 11vw, 3.75rem); font-weight: 800; letter-spacing: -0.02em; }
.rule { width: 100%; max-width: 20rem; height: 0.35rem; background: var(--red); margin: 0.75rem 0 0.9rem; }
.title { font-size: clamp(1.3rem, 5.5vw, 1.75rem); font-weight: 700; margin: 0 0 1.25rem; color: #e6e6e6; }
.lede { margin: 0 0 1.75rem; color: #e6e6e6; max-width: 34rem; }

.btn {
  display: inline-block;
  background: var(--red);
  color: var(--white);
  font-weight: 700;
  text-decoration: none;
  padding: 0.95rem 1.4rem;
  border-radius: 0.6rem;
  min-height: 3rem;
  word-break: break-word;
}
.btn:hover, .btn:focus-visible { background: #b5141a; }
.btn:focus-visible { outline: 3px solid var(--white); outline-offset: 3px; }

/* Sections */
main section { padding: 3rem 0; }
main section.wrap { padding-top: 3rem; padding-bottom: 3rem; }
h2 { font-size: 1.6rem; font-weight: 800; margin-bottom: 1.5rem; }
h2::after { content: ""; display: block; width: 3rem; height: 0.25rem; background: var(--red); margin-top: 0.6rem; }
h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: 0.35rem; }
p { margin: 0 0 1rem; }

.steps { list-style: none; margin: 0 0 1.5rem; padding: 0; counter-reset: step; }
.steps li {
  counter-increment: step;
  position: relative;
  padding: 0 0 1.25rem 3.25rem;
}
.steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: -0.1rem;
  width: 2.25rem; height: 2.25rem;
  border-radius: 50%;
  background: var(--black); color: var(--white);
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.steps p { margin: 0; }
.note { color: var(--muted); }

.band { background: var(--grey); }
.card {
  background: var(--white);
  border: 2px solid var(--black);
  border-radius: 0.9rem;
  padding: 1.25rem 1.25rem 0.25rem;
}
.muted { color: var(--muted); }

.contact .btn { margin-top: 0.25rem; }

/* 3D viewer */
.viewer { margin-top: 1.5rem; }
.viewer-stage {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 1rem;
  overflow: hidden;
  background: radial-gradient(120% 90% at 50% 30%, #ffffff 0%, #ececec 60%, #dcdcdc 100%);
  border: 2px solid var(--black);
}
.viewer-fallback, .viewer-fallback img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block;
  transition: opacity 0.6s ease;
}
.viewer-stage canvas {
  position: absolute; inset: 0; width: 100% !important; height: 100% !important; display: block;
  opacity: 0; transition: opacity 0.6s ease; cursor: grab;
}
.viewer-stage canvas:active { cursor: grabbing; }
.viewer.is-ready .viewer-stage canvas { opacity: 1; }
.viewer.is-ready .viewer-fallback { opacity: 0; pointer-events: none; }
.viewer-status {
  position: absolute; left: 0.75rem; bottom: 0.5rem; margin: 0;
  font-size: 0.85rem; color: var(--muted);
}
.viewer.is-loading .viewer-status::before {
  content: ""; display: inline-block; width: 0.8rem; height: 0.8rem; margin-right: 0.45rem; vertical-align: -0.1rem;
  border: 2px solid var(--red); border-right-color: transparent; border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.viewer-zoom {
  position: absolute; right: 0.6rem; top: 0.6rem; z-index: 2;
  display: none; flex-direction: column; gap: 0.4rem;
}
.viewer.is-ready .viewer-zoom { display: flex; }
.viewer-zoom button {
  width: 2.75rem; height: 2.75rem; border-radius: 50%;
  border: 2px solid var(--black); background: rgba(255,255,255,0.9); color: var(--black);
  font: 700 1.35rem/1 var(--font); cursor: pointer;
}

.viewer-controls {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.9rem 1.25rem; margin-top: 1rem;
}
.seg { display: inline-flex; border: 2px solid var(--black); border-radius: 0.7rem; overflow: hidden; }
.seg button {
  font: 700 0.95rem var(--font); padding: 0.65rem 0.9rem; min-height: 2.75rem;
  background: var(--white); color: var(--black); border: 0; cursor: pointer;
}
.seg button + button { border-left: 2px solid var(--black); }
.seg button[aria-pressed="true"] { background: var(--black); color: var(--white); }

.swatches { display: flex; flex-wrap: wrap; gap: 0.55rem; }
.swatch {
  width: 2.75rem; height: 2.75rem; border-radius: 50%; cursor: pointer;
  border: 2px solid rgba(0,0,0,0.25); background: var(--c);
  box-shadow: inset 0 -6px 10px rgba(0,0,0,0.12), inset 0 4px 8px rgba(255,255,255,0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.swatch:hover { transform: scale(1.06); }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--white), 0 0 0 5px var(--black); }
.sw-black { --c: #1c1c1e; } .sw-white { --c: #f4f2ee; } .sw-blue { --c: #2e64c8; }
.sw-lilac { --c: #b39ddb; } .sw-red { --c: #e8352c; } .sw-orange { --c: #e0562a; }
.colour-label { margin: 0; font-weight: 700; width: 100%; }
.viewer-hint { color: var(--muted); font-size: 0.9rem; margin: 0.5rem 0 0; }
.viewer.no-webgl .viewer-controls, .viewer.no-webgl .viewer-hint, .viewer:not(.has-webgl) .viewer-controls, .viewer:not(.has-webgl) .viewer-hint { display: none; }
button:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }

.photo { margin: 1.5rem 0; }
.photo img { display: block; width: 100%; height: auto; border-radius: 1rem; }
.photo figcaption { color: var(--muted); font-size: 0.9rem; margin-top: 0.5rem; }

@media (prefers-reduced-motion: reduce) {
  .viewer-fallback, .viewer-fallback img, .viewer-stage canvas, .swatch { transition: none; }
}

footer {
  background: var(--black);
  color: #cfcfcf;
  font-size: 0.9rem;
  padding: 1.5rem 0 max(1.5rem, env(safe-area-inset-bottom));
}
footer p { margin: 0; }
footer a { color: var(--white); }

@media (min-width: 48rem) {
  .viewer-stage { aspect-ratio: 16 / 10; }
  .colour-label { width: auto; }
  .hero { padding: 4.5rem 0 4rem; }
  main section, main section.wrap { padding-top: 4rem; padding-bottom: 4rem; }
}
