/* The second style (neu/): laid over styles.css. Still only the logo's four colours: black grounds for the
   opening, the steps and the contact, white for reading; blue and yellow as lines and accents. On black, text is
   white (21:1) or yellow (11.5:1); blue never carries text there (4.0:1), only lines and marks. */

:root {
  --ease: cubic-bezier(.2, .7, .2, 1);
  --draw-time: 1.6s;          /* a drawing drawing itself */
  --reveal-time: .7s;         /* a block coming up as it scrolls into view */
  --reveal-shift: 1.5rem;
  --lift: -0.375rem;          /* a card lifting under the pointer */
  --frame: 2px;               /* the frame of drawings, cards and sliders */
  --slide-w: min(85vw, 28rem);
  --handle: 3px;
  --eyebrow-bar: 2rem;
  --pair-offset: 2rem;        /* how far the drawing stands over the photo's corner */
}

/* ---------- black bands: the opening, the steps, the contact ---------- */
.hero, .section.dark { position: relative; background: var(--black); color: var(--ground); overflow: hidden; }
.hero h1, .section.dark h2, .section.dark h3 { color: var(--ground); }
.hero a, .section.dark a { color: var(--ground); }
.hero a:hover, .section.dark a:hover { color: var(--yellow); }
.hero :focus-visible, .section.dark :focus-visible { outline-color: var(--yellow); }
.hero .squares li::before { background: var(--yellow); }
.hero .call .tel { color: var(--yellow); }
.hero .call .tel:hover { color: var(--ground); }
.hero .wrap { position: relative; z-index: 1; }
.section.dark .rows li + li { border-top-color: var(--blue); }
.section.dark .address strong { color: var(--yellow); }
.section.dark + .section.dark { border-top: var(--hairline) solid var(--blue); }
.hero { padding-block: var(--space-section); }

.eyebrow { display: flex; align-items: center; gap: var(--space-tight); margin-bottom: var(--space-item); font-family: var(--font-menu); font-size: var(--size-small); font-weight: var(--weight-strong); color: var(--yellow); }
.eyebrow::before { content: ""; width: var(--eyebrow-bar); height: var(--bar-h); background: var(--yellow); }

/* moving tiles behind the home page's opening (neu.js draws them; nothing shows without it) */
.tiles { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }

/* ---------- a real photo and a drawing of the same work, in one frame ---------- */
.pair { position: relative; padding: 0 0 var(--pair-offset) var(--pair-offset); }
.pair > img { width: 100%; height: 100%; min-height: var(--intro-min); object-fit: cover; }
.pair .draw { position: absolute; left: 0; bottom: 0; width: 46%; margin: 0; padding: var(--space-tight); background: var(--black); color: var(--ground); border: var(--frame) solid var(--yellow); }
.section:not(.dark) .pair .draw { background: var(--ground); color: var(--black); border-color: var(--blue); }
.hero .halves { align-items: stretch; }
.hero .pair { height: 100%; }

/* ---------- drawings ---------- */
.draw { margin: 0; }
.art { display: block; width: 100%; height: auto; stroke: currentColor; }
.art .b { stroke: var(--blue); }
.art .y { stroke: var(--yellow); }
.art .thin { stroke-width: 1.5; }
.art .drop, .art .bubble, .art .chip, .art .grip rect, .art .foot path { stroke: none; }
.art .drop.b, .art .bubble.b, .art .grip.b rect { fill: var(--blue); }
.art .bubble.y, .art .chip.y, .art .foot.y path { fill: var(--yellow); }
.art .hand { stroke: var(--blue); }
.art .bead { stroke-dasharray: 4 4; }

/* with the script, lines draw themselves once in view; without it everything simply shows */
.js .art .ln { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset var(--draw-time) var(--ease); }
.js .in .art .ln { stroke-dashoffset: 0; }
.js .art .slide-in { transform: translateX(-12%); opacity: 0; transition: transform var(--draw-time) var(--ease), opacity var(--draw-time) var(--ease); }
.js .in .art .slide-in { transform: none; opacity: 1; }
.js .art .grip rect { opacity: 0; transition: opacity .3s var(--ease) calc(var(--i) * 25ms + .6s); }
.js .in .art .grip rect { opacity: 1; }
.js .art .foot, .js .art .chip { opacity: 0; transition: opacity .6s var(--ease) 1.2s; }
.js .in .art .foot, .js .in .art .chip { opacity: 1; }

/* the small movements that keep going while a drawing is in view */
.in .art .drop { animation: drip 1.4s ease-in infinite; }
.in .art .drop.d2 { animation-delay: .7s; }
.in .art .drop.d3 { animation-delay: .35s; }
.in .art .bubble { animation: rise 2.4s ease-out infinite; }
.in .art .bubble.b2 { animation-delay: .6s; }
.in .art .bubble.b3 { animation-delay: 1.2s; }
.in .art .bubble.b4 { animation-delay: 1.8s; }
.in .art .door { transform-box: fill-box; transform-origin: left center; animation: swing 4s var(--ease) 1.5s infinite; }
.in .art .spatula { animation: smooth 2.2s ease-in-out 1.2s infinite; }
.in .art .chip { animation: mend 4.4s ease-in-out 1.2s infinite; }
.in .art .spark { animation: twinkle 4.4s ease-in-out 1.2s infinite; }
.in .art .hand { transform-origin: 32px 32px; animation: turn 6s linear infinite; }
.in .art .bead { animation: flow 1s linear infinite; }
.art .drop, .art .bubble, .art .spark { opacity: 0; }
.js .art .spark { opacity: 0; }
@keyframes drip { 0% { opacity: 1; transform: translateY(0); } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(36px); } }
@keyframes rise { 0% { opacity: 0; transform: translateY(0); } 20% { opacity: 1; } 100% { opacity: 0; transform: translateY(-34px); } }
@keyframes swing { 0%, 15% { transform: scaleX(1); } 40%, 70% { transform: scaleX(.15); } 95%, 100% { transform: scaleX(1); } }
@keyframes smooth { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-10px, 6px); } }
@keyframes mend { 0%, 40% { opacity: 1; } 60%, 90% { opacity: 0; } 100% { opacity: 1; } }
@keyframes twinkle { 0%, 50% { opacity: 0; } 65% { opacity: 1; } 85%, 100% { opacity: 0; } }
@keyframes turn { to { transform: rotate(360deg); } }
@keyframes flow { to { stroke-dashoffset: -16; } }

/* ---------- the four services: a drawing on each card ---------- */
.services { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gutter); }
.svc { display: flex; flex-direction: column; padding: var(--space-item); border: var(--frame) solid var(--blue); color: var(--black); text-decoration: none; transition: transform .3s var(--ease), border-color .3s var(--ease); }
.svc:hover { transform: translateY(var(--lift)); border-color: var(--black); }
.svc:hover h3 { text-decoration: underline; }
.svc .draw { color: var(--black); }
.svc h3 { margin-top: var(--space-item); font-size: var(--size-sub); line-height: var(--lh-sub); }
.svc p { margin-top: var(--space-tight); font-size: var(--size-small); }
.svc .more { margin-top: auto; padding-top: var(--space-tight); color: var(--blue); text-decoration: underline; text-underline-offset: var(--underline-offset); }

/* photo cards lift too */
.card { transition: transform .3s var(--ease); }
.card:hover { transform: translateY(var(--lift)); }

/* ---------- the five steps on black: a yellow line that runs through them ---------- */
.timeline { counter-reset: step; display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--gutter); margin: var(--space-block) 0 0; padding: 0; list-style: none; position: relative; }
.timeline::before { content: ""; position: absolute; left: 0; right: 0; top: calc(var(--size-title) * var(--lh-head) / 2); height: var(--bar-h); background: var(--yellow); transform-origin: left; }
.js .timeline::before { transform: scaleX(0); transition: transform 2.4s var(--ease); }
.js .timeline.in::before { transform: none; }
.timeline li { counter-increment: step; position: relative; font-size: var(--size-small); }
.timeline li::before { content: counter(step); display: inline-flex; align-items: center; justify-content: center; min-width: calc(var(--size-title) * var(--lh-head)); padding-inline: var(--space-tight); background: var(--black); color: var(--yellow); font-family: var(--font-head); font-size: var(--size-title); font-weight: var(--weight-head); line-height: var(--lh-head); position: relative; }
.timeline .icon { width: 4rem; margin: var(--space-item) 0; color: var(--ground); }

/* ---------- before and after ---------- */
.slider-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: var(--space-item) var(--gutter); }
.slider-head h2 { min-width: 0; }
.slider-nav { display: flex; gap: var(--space-tight); }
.slider-nav button { width: var(--tap); height: var(--tap); border: var(--frame) solid var(--blue); background: var(--ground); color: var(--blue); font: inherit; font-weight: var(--weight-bold); cursor: pointer; }
.slider-nav button:hover { background: var(--blue); color: var(--ground); }
.slides { display: grid; grid-auto-flow: column; grid-auto-columns: var(--slide-w); gap: var(--gutter); overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; padding-bottom: var(--space-item); scrollbar-color: var(--blue) var(--ground); }
.compare { margin: 0; scroll-snap-align: start; }
.compare .frame { position: relative; aspect-ratio: 4 / 3; overflow: hidden; border: var(--frame) solid var(--black); }
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.compare .before { clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.compare .handle { position: absolute; top: 0; bottom: 0; left: var(--pos); width: var(--handle); margin-left: calc(var(--handle) / -2); background: var(--yellow); pointer-events: none; }
.compare .handle::after { content: "\2194"; position: absolute; top: 50%; left: 50%; display: flex; align-items: center; justify-content: center; width: var(--tap); height: var(--tap); transform: translate(-50%, -50%); background: var(--yellow); color: var(--black); font-weight: var(--weight-bold); }
.compare input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.compare .frame:has(input:focus-visible) { outline: var(--focus) solid var(--black); outline-offset: var(--focus); }
.compare .tag { position: absolute; top: var(--space-tight); padding: var(--space-small) var(--space-tight); background: var(--black); color: var(--ground); font-family: var(--font-menu); font-size: var(--size-small); font-weight: var(--weight-strong); pointer-events: none; }
.compare .tag.v { left: var(--space-tight); }
.compare .tag.n { right: var(--space-tight); background: var(--blue); }
.compare figcaption { margin-top: var(--space-tight); font-size: var(--size-small); font-weight: var(--weight-strong); }

/* ---------- blocks rise into view (only with the script) ---------- */
.js .reveal { opacity: 0; transform: translateY(var(--reveal-shift)); transition: opacity var(--reveal-time) var(--ease), transform var(--reveal-time) var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }

@media (max-width: 60rem) {
  .services { grid-template-columns: 1fr 1fr; }
  .timeline { grid-template-columns: 1fr; }
  .timeline::before { left: calc(var(--size-title) * var(--lh-head) / 2); right: auto; top: 0; bottom: 0; width: var(--bar-h); height: auto; transform-origin: top; }
  .js .timeline::before { transform: scaleY(0); }
  .timeline li { display: grid; grid-template-columns: auto 4rem 1fr; gap: var(--space-item); align-items: start; }
  .timeline .icon { margin: 0; }
  .hero .pair { order: -1; }
  .pair > img { aspect-ratio: var(--ratio); height: auto; min-height: 0; }
}
@media (max-width: 30rem) {
  /* on a phone a service card lies flat: the drawing beside the words */
  .services { grid-template-columns: 1fr; gap: var(--space-item); }
  .svc { display: grid; grid-template-columns: 6rem minmax(0, 1fr); column-gap: var(--space-item); align-content: start; }
  .svc .draw { grid-row: 1 / span 3; align-self: center; }
  .svc h3 { margin-top: 0; }
  .svc .more { grid-column: 2; }
  .timeline li { grid-template-columns: auto 3rem 1fr; }
  .timeline .icon { width: 3rem; }
}
@media (max-width: 23rem) {
  /* the narrowest phones: too little room beside the drawing for "Austauschwannen", so it stands above again */
  .svc { display: flex; }
  .svc .draw { width: 70%; }
  .svc h3 { margin-top: var(--space-item); }
}
@media (prefers-reduced-motion: reduce) {
  .js .reveal, .js .art .ln, .js .art .slide-in, .js .art .grip rect, .js .art .foot, .js .art .chip, .js .timeline::before { transition: none; }
  .art *, .art .drop, .art .bubble { animation: none !important; }
  .svc, .card { transition: none; }
  .svc:hover, .card:hover { transform: none; }
}
