/* clar.tax · Zehn Feature-Karten mit Mockups
 * Abgeleitet aus lavern.ai (site/index.html, Zeilen 1193–1616), Apache-2.0,
 * Copyright (c) 2025-2026 Antti Innanen. Für clar.tax angepasst, siehe NOTICE. */

/* ═══════════════════════════════════════════════════════════════════
   FEATURE GRID — 10 boxes with light-paper mockups
   ═══════════════════════════════════════════════════════════════════ */
.features-head{margin:0 auto clamp(56px,8vw,90px);max-width:840px;text-align:center}
.features-grid{
  display:grid;grid-template-columns:repeat(2,1fr);
  gap:28px;max-width:var(--max);margin:0 auto
}
@media(max-width:860px){.features-grid{grid-template-columns:1fr;gap:20px}}

/* ─── Mobile (<=640px) — feature cards become a horizontal swipe deck.
   Each card takes 84% of viewport width so the next one peeks from
   the right edge — that peek is the affordance that says "swipe me".
   Scroll-snap keeps each card centered after a flick. ─── */
@media(max-width:640px){
  #features{padding:60px 0 80px}
  .features-head{padding:0 24px}
  .features-grid{
    display:flex;flex-direction:row;
    overflow-x:auto;overflow-y:visible;
    scroll-snap-type:x mandatory;
    scroll-padding:0 8%;
    gap:14px;
    padding:14px 8% 28px;
    margin:0;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:none;
    -ms-overflow-style:none
  }
  .features-grid::-webkit-scrollbar{display:none}
  .feature{
    flex:0 0 84%;min-width:84%;
    scroll-snap-align:center;
    /* Neutralise scroll-choreography variables — cards are always
       visible in carousel mode, no fade-in/out as the page scrolls. */
    opacity:1 !important;
    transform:none !important
  }
  .feature:hover{transform:none !important}
  /* Force the inner mockup content visible in carousel mode. The
     desktop "build on scroll" animation is driven by an
     IntersectionObserver watching vertical scroll, which never
     fires when the cards are in a horizontal scroll-snap carousel,
     so on mobile they would stay at opacity:0 forever. */
  .feature .feature-body > *,
  .feature .feature-body > .m-bubble.you,
  .feature .feature-body > .m-bubble.them,
  .feature .m-avatar,
  .feature .m-avatar-img{
    opacity:1 !important;
    transform:none !important;
    animation:none !important;
  }
}

/* ─── Hide the Stack section entirely on mobile. The 3D perspective
   parallax doesn't translate without hover, and the slab-overlay UX
   gets confused with a single-column layout. The principles it
   presents are already covered in the feature cards. ─── */
@media(max-width:640px){
  #tldr{display:none}
}

/* ─── Chip rows inside mockup cards on narrow phones (≤480px).
   The mockup is fixed at aspect-ratio 5/4, so the body has a
   hard vertical budget on a 315px-wide carousel slide (~173px
   inner). We need each chip to fit on a SINGLE line so that two
   chips + the ↕ arrow stack vertically without clipping.
   Shrinking avatar, badge, text, and gaps gets the worst-case
   row ("Indemnification cap is uncapped.") under the available
   width without wrapping. The chip ends up two lines tall:
     · row 1: [avatar] [BADGE] [single-line finding]
     · row 2: italic-feeling quote citation
   Total ≈ 60-70px per chip. Two chips + arrow ≈ 160px. Fits.
   ─── */
/* Specificity bumped with `.feature-mockup` prefix so these rules
   win against the default `.m-card{...}` rule that's defined later
   in the file (~line 1400). Plus `[style]` on the text span beats
   the inline style="...font-size:11.5px..." attribute the
   finding-row markup carries. */
@media(max-width:480px){
  .feature-mockup .m-card{padding:9px 11px;gap:5px}
  .feature-mockup .m-card .m-row{gap:6px}
  .feature-mockup .m-card .m-avatar-img.sm{width:18px;height:18px}
  .feature-mockup .m-card .m-tag{font-size:8px;padding:1px 5px;letter-spacing:.3px}
  .feature-mockup .m-card .m-row > span[style]:last-child{font-size:10.5px !important;line-height:1.3 !important}
  .feature-mockup .m-quote{font-size:10px;line-height:1.4}
  .feature-mockup .feature-body{padding:18px 14px}
  /* Delivery and Briefing cards push the body padding even tighter
     because their content has the most lines. */
  .feature-mockup:has(.m-doc-large) .feature-body,
  .briefing-card .feature-body{padding:12px 14px !important}

  /* ─── Delivery card (#07) doc — has to fit a header + title +
     intro paragraph + 3-item bullet list + footer inside a ~173px
     mockup body. Every line is dialled tight; the content reads
     like a memo, just at a smaller scale. ─── */
  .feature-mockup .m-doc-large{padding:7px 10px 6px;gap:3px;border-radius:8px}
  .feature-mockup .m-doc-large-title{font-size:11.5px;padding-bottom:2px;line-height:1.15}
  .feature-mockup .m-doc-large-tag{font-size:7px;padding:1.5px 5px;letter-spacing:1px}
  .feature-mockup .m-doc-large-meta{font-size:7px;letter-spacing:0.8px}
  .feature-mockup .m-doc-large-body{font-size:9px;line-height:1.32}
  .feature-mockup .m-doc-large-body p{margin-bottom:3px}
  .feature-mockup .m-doc-large-body ul{gap:1.5px}
  .feature-mockup .m-doc-large-body li{font-size:8.5px;padding-left:8px;line-height:1.3}
  .feature-mockup .m-doc-large-body li::before{top:4px;width:3px;height:3px}
  .feature-mockup .m-doc-large-footer{font-size:6.5px;padding-top:3px;letter-spacing:0.8px}
  .feature-mockup .m-doc-stamp{width:6px;height:6px}

  /* ─── Briefing card (#08) bubbles — fit 4 bubbles inside a 173px
     mockup body by shrinking type, tightening padding, hiding the
     typing-dots flourish. The `.briefing-card` class lives on the
     <article>, so it's the ancestor of `.feature-mockup`, not its
     child — that's why these selectors lead with `.briefing-card`. */
  .briefing-card .feature-body{gap:4px !important}
  .briefing-card .m-row{gap:5px !important}
  .briefing-card .m-bubble{
    font-size:10px;
    line-height:1.3;
    padding:4px 8px;
    max-width:92%;
    border-radius:10px;
  }
  .briefing-card .m-typing{display:none}
}
/* ↑ Close of @media(max-width:480px). Without this `}`, every
   rule that follows — .feature, .feature-mockup, .mac-chrome,
   .m-card, the whole mockup styling system — was trapped inside
   the narrow-mobile media query and never applied on viewports
   wider than 480px. The site looked broken on every desktop
   resolution. Do not delete this brace. */

.feature{
  background:var(--surface-2);
  border:1px solid var(--hair);
  border-radius:var(--r-lg);overflow:hidden;
  display:flex;flex-direction:column;
  box-shadow:var(--shadow-md), var(--ring-top);
  /* Scroll-choreographed: --sy and --so are written by the rAF
     scroll handler. Cards fade in as they enter, peak when centered,
     fade out as they leave. */
  opacity:var(--so, 1);
  transform:scale(var(--ss, .9)) translateY(var(--sy, 30px));
  transition:border-color .45s var(--ease),box-shadow .55s var(--ease)
}
.feature:hover{
  border-color:var(--hair-strong);
  box-shadow:var(--shadow-lg), var(--ring-top), var(--glow-warm);
  --sy:-6px
}
.feature-mockup{
  position:relative;aspect-ratio:5/4;
  /* Soft cream radial spotlight — Legora-class light wash */
  background:
    radial-gradient(ellipse 100% 80% at 50% 35%,
      rgba(255,253,245,1) 0%,
      rgba(252,250,242,0.7) 40%,
      rgba(244,242,234,0.4) 70%,
      rgba(250,250,250,0) 100%),
    linear-gradient(160deg, #F8F6EE 0%, #F1EFE5 100%);
  border-bottom:1px solid var(--hair);
  overflow:hidden;display:flex;flex-direction:column;
  padding-top:36px; /* clears the Mac chrome bar */
  isolation:isolate
}
/* ─── Mac chrome — proper macOS window top bar ─── */
.mac-chrome{
  position:absolute;top:0;left:0;right:0;height:36px;
  display:flex;align-items:center;gap:8px;padding:0 14px;
  background:linear-gradient(180deg,
    rgba(255,253,245,0.78) 0%,
    rgba(240,236,224,0.55) 100%);
  border-bottom:1px solid rgba(20,19,16,0.07);
  backdrop-filter:blur(8px);
  -webkit-backdrop-filter:blur(8px);
  z-index:3
}
.mac-chrome i{
  width:11px;height:11px;border-radius:50%;
  box-shadow:
    inset 0 -1px 0 rgba(0,0,0,0.10),
    inset 0 1px 0 rgba(255,255,255,0.30),
    0 0 0 0.5px rgba(0,0,0,0.06)
}
.mac-chrome i.r{background:linear-gradient(180deg,#FF6157 0%,#DE3F39 100%)}
.mac-chrome i.y{background:linear-gradient(180deg,#FEBE2E 0%,#DEA226 100%)}
.mac-chrome i.g{background:linear-gradient(180deg,#28C940 0%,#1AA631 100%)}
.mac-chrome .stage-title{
  margin-left:auto;margin-right:auto;
  font-family:var(--mono);font-size:10.5px;
  color:var(--dim);letter-spacing:.4px;
  transform:translateX(-22px); /* offset for the dots on the left */
  display:inline-flex;align-items:center;gap:7px
}
/* Live indicator — small green pulsing dot inside the chrome title */
.mac-chrome .live-dot{
  width:6px;height:6px;border-radius:50%;
  background:var(--accent);flex:none;position:relative
}
.mac-chrome .live-dot::after{
  content:'';position:absolute;inset:-3px;border-radius:50%;
  border:1.5px solid var(--accent);opacity:0;
  animation:liveBlink 2.4s ease-out infinite
}
@keyframes liveBlink{
  0%{transform:scale(.6);opacity:.7}
  80%,100%{transform:scale(1.9);opacity:0}
}
@media(prefers-reduced-motion:reduce){.mac-chrome .live-dot::after{animation:none}}
/* Subtle inner highlight for premium card glass feel */
.feature-mockup::after{
  content:'';position:absolute;inset:0;pointer-events:none;
  background:radial-gradient(ellipse 60% 50% at 50% 10%,
    rgba(255,255,255,0.55) 0%,
    rgba(255,255,255,0.18) 30%,
    transparent 60%);
  mix-blend-mode:soft-light;z-index:0
}
.feature-body{
  position:relative;z-index:1;
  flex:1;padding:36px 32px;display:flex;flex-direction:column;
  justify-content:center;align-items:stretch;
  gap:10px;font-family:var(--mono);font-size:11px;color:var(--muted);
  overflow:hidden
}
.feature-caption{
  padding:26px 28px 30px;display:flex;flex-direction:column;gap:10px
}
.feature-num{
  font-family:var(--mono);font-size:10px;font-weight:500;
  letter-spacing:1.5px;text-transform:uppercase;color:var(--muted)
}
/* Lighter number — was 600 black, looked too heavy. Now matches the
   surrounding mono caps weight (500) and uses --text without bold. */
.feature-num span{color:var(--text);font-weight:500}
.feature-title{
  font-family:var(--sans);font-size:24px;font-weight:500;
  line-height:1.15;letter-spacing:-0.02em;color:var(--text)
}
.feature-title em{font-style:normal;font-weight:500;color:var(--text)}
.feature-desc{
  font-family:var(--sans);font-size:14px;color:var(--muted);
  line-height:1.6;max-width:50ch
}

/* Mockup atoms — light theme */
.m-row{display:flex;align-items:center;gap:10px}
.m-dot{width:7px;height:7px;border-radius:50%;background:var(--text);flex:none}
.m-dot.dim{background:var(--dim)}
.m-dot.ok{background:var(--accent)}
.m-dot.warn{background:var(--unsicher)}
.m-bar{height:5px;border-radius:3px;background:rgba(20,19,16,0.08);overflow:hidden}
.m-bar span{display:block;height:100%;background:var(--text)}
.m-bubble{
  padding:10px 15px;border-radius:18px;
  font-family:var(--sans);font-size:12px;font-weight:400;
  line-height:1.5;letter-spacing:-0.005em;
  max-width:78%;color:var(--text);position:relative
}
.m-bubble.you{
  background:linear-gradient(180deg,#1e1c18 0%,#141310 100%);
  color:var(--bg);
  align-self:flex-end;border-bottom-right-radius:6px;
  box-shadow:0 2px 6px rgba(20,19,16,0.15),0 1px 2px rgba(20,19,16,0.08)
}
.m-bubble.them{
  background:#fff;border:1px solid var(--hair-strong);
  align-self:flex-start;border-bottom-left-radius:6px;
  box-shadow:0 2px 6px rgba(20,19,16,0.06),0 1px 2px rgba(20,19,16,0.03)
}
/* Typing indicator — three pulsing dots, looped continuously */
.m-typing{
  display:inline-flex;gap:4px;padding:11px 16px;
  background:#fff;border:1px solid var(--hair-strong);
  border-radius:18px;border-bottom-left-radius:6px;
  align-self:flex-start;
  box-shadow:0 2px 6px rgba(20,19,16,0.06)
}
.m-typing i{
  width:5px;height:5px;border-radius:50%;background:var(--muted);
  animation:typingPulse 1.4s ease-in-out infinite
}
.m-typing i:nth-child(2){animation-delay:.18s}
.m-typing i:nth-child(3){animation-delay:.36s}
@keyframes typingPulse{
  0%,80%,100%{opacity:.3;transform:translateY(0)}
  40%{opacity:1;transform:translateY(-2px)}
}
@media(prefers-reduced-motion:reduce){.m-typing i{animation:none}}
.m-tag{
  display:inline-block;font-family:var(--mono);font-size:9px;
  padding:2px 7px;border-radius:3px;letter-spacing:.5px;
  background:var(--warm-soft);color:var(--warm);
  text-transform:uppercase;font-weight:500
}
.m-tag.ok{background:var(--accent-soft);color:var(--accent)}
.m-tag.warn{background:rgba(198,138,22,0.13);color:#855806}
.m-tag.danger{background:rgba(180,71,46,0.11);color:#933520}
.m-tag.neutral{background:rgba(20,19,16,0.06);color:var(--text)}
.m-card{
  background:#fff;border:1px solid var(--hair);
  border-radius:var(--r-md);padding:11px 14px;display:flex;flex-direction:column;gap:6px;
  box-shadow:var(--shadow-sm)
}
.m-avatar{
  width:26px;height:26px;border-radius:50%;flex:none;
  background:#EFEDE5;border:1px solid var(--hair-strong);
  display:flex;align-items:center;justify-content:center;
  font-family:var(--sans);font-style:normal;font-size:12px;
  font-weight:500;color:var(--text)
}
/* DiceBear avatar image — drop-in replacement for .m-avatar letter circle */
.m-avatar-img{
  width:30px;height:30px;border-radius:50%;flex:none;
  background:#EFEDE5;border:1px solid var(--hair-strong);
  object-fit:cover;display:block
}
.m-avatar-img.sm{width:22px;height:22px}

/* Single clar.tax deliverable — full editorial document mockup for the
   Delivery card. Writes itself in line-by-line when the card builds. */
.m-doc-large{
  background:#fff;border:1px solid var(--hair);border-radius:10px;
  padding:14px 16px 12px;box-shadow:var(--shadow-md);
  display:flex;flex-direction:column;gap:8px;width:100%;
  font-family:var(--sans)
}
.m-doc-large-header{
  display:flex;justify-content:space-between;align-items:center;gap:8px
}
.m-doc-large-tag{
  font-family:var(--mono);font-size:8px;font-weight:600;
  letter-spacing:1.6px;text-transform:uppercase;
  background:var(--text);color:var(--bg);
  padding:3px 8px;border-radius:3px
}
.m-doc-large-meta{
  font-family:var(--mono);font-size:8.5px;font-weight:500;
  letter-spacing:1.2px;text-transform:uppercase;color:var(--muted)
}
.m-doc-large-title{
  font-family:var(--sans);font-size:15px;font-weight:600;
  letter-spacing:-0.012em;color:var(--text);line-height:1.2;
  padding-bottom:4px;border-bottom:1px solid var(--hair)
}
.m-doc-large-body{
  font-family:var(--sans);font-size:11px;line-height:1.5;color:var(--muted)
}
.m-doc-large-body p{margin-bottom:7px}
.m-doc-large-body ul{
  list-style:none;display:flex;flex-direction:column;gap:5px
}
.m-doc-large-body li{
  position:relative;padding-left:11px;font-size:10.5px
}
.m-doc-large-body li::before{
  content:'';position:absolute;left:2px;top:6px;
  width:4px;height:4px;border-radius:50%;background:var(--text)
}
.m-doc-large-body li strong{color:var(--text);font-weight:600}
.m-doc-large-footer{
  display:flex;align-items:center;gap:8px;
  font-family:var(--mono);font-size:8.5px;font-weight:500;
  letter-spacing:1.2px;text-transform:uppercase;color:var(--dim);
  padding-top:6px;border-top:1px solid var(--hair)
}
.m-doc-stamp{
  display:inline-block;width:8px;height:8px;border-radius:50%;
  background:var(--text);flex:none
}
/* Each body line writes itself in sequentially after the card builds. */
.feature .m-doc-large-body p,
.feature .m-doc-large-body li,
.feature .m-doc-large-title,
.feature .m-doc-large-footer{
  opacity:0;transform:translateY(4px)
}
.feature.built .m-doc-large-title{
  animation:lineWriteIn .5s ease-out .4s forwards
}
.feature.built .m-doc-large-body p{
  animation:lineWriteIn .5s ease-out .8s forwards
}
.feature.built .m-doc-large-body li:nth-of-type(1){
  animation:lineWriteIn .5s ease-out 1.2s forwards
}
.feature.built .m-doc-large-body li:nth-of-type(2){
  animation:lineWriteIn .5s ease-out 1.55s forwards
}
.feature.built .m-doc-large-body li:nth-of-type(3){
  animation:lineWriteIn .5s ease-out 1.9s forwards
}
.feature.built .m-doc-large-footer{
  animation:lineWriteIn .5s ease-out 2.3s forwards
}
@keyframes lineWriteIn{
  to{opacity:1;transform:translateY(0)}
}
.feature.built .m-doc-stamp{
  animation:statusBlink 2.4s ease-in-out 2.8s infinite
}

/* Soul card — each principle types itself in on a different beat */
.feature .m-soul-line{opacity:0;transform:translateX(-6px)}
.feature.built .m-soul-line{
  animation:soulLineIn .55s ease-out forwards
}
.feature.built .m-soul-line:nth-of-type(1){animation-delay:.5s}
.feature.built .m-soul-line:nth-of-type(2){animation-delay:1.0s}
.feature.built .m-soul-line:nth-of-type(3){animation-delay:1.5s}
@keyframes soulLineIn{
  to{opacity:1;transform:translateX(0)}
}

/* Knowledge card — sources cascade in one row at a time */
.feature.built .feature-body .m-row{opacity:1}
/* (rows are flex parents so we don't reset their opacity globally,
   but specifically inside the Knowledge body we want a stagger) */

.m-quote{
  font-family:var(--sans);font-style:normal;font-weight:400;
  font-size:13px;line-height:1.45;color:var(--text)
}
