/* Entdeckungsstation: der Zahlenblock als Produkt auf weißer Bühne.
   Gehäuse in Mitternacht, Zifferntasten in Porzellan, Aktionstasten in Aprikose. */
.discovery{overflow-x:clip}
.discovery-layout{display:grid;grid-template-columns:1fr 1fr;grid-template-areas:'intro device' 'stories stories';column-gap:clamp(40px,7vw,112px);row-gap:48px;align-items:center}
.discovery-intro{grid-area:intro}
.discovery-stories{grid-area:stories}
/* The keypad is the staged product; the four cards sit underneath in two columns, locked until answered. */
.discovery-device{grid-area:device;display:grid;place-items:center}
.discovery-intro h2{max-width:12ch}
.discovery-intro .lead{margin-top:24px}
.discovery-form{margin-top:40px}
.discovery-equation{display:flex;align-items:center;gap:18px;font-size:clamp(40px,4.2vw,58px);line-height:1.1;font-weight:600;letter-spacing:-.03em;font-variant-numeric:tabular-nums}
.discovery-equation input{width:2.4ch;min-width:84px;height:84px;padding:4px 8px;border:0;border-radius:22px;outline:none;box-shadow:none;background:var(--porcelain);color:var(--ink);text-align:center;font:inherit;caret-color:var(--accent);-webkit-text-fill-color:var(--ink);opacity:1;transition:background-color .2s ease,color .2s ease}
.discovery-equation input:hover{background:#eeedf5}
.discovery-equation input:focus{background:var(--lilac-soft)}
.discovery-equation input::placeholder{color:#8c8aa3;-webkit-text-fill-color:#8c8aa3;opacity:1}
.discovery-equation input[aria-invalid="true"]{background:#fde7dc}
.discovery-equation input:disabled{background:var(--lilac-soft);-webkit-text-fill-color:var(--accent)}
.discovery-feedback{display:flex;align-items:flex-start;gap:10px;min-height:3.2em;margin-top:16px;max-width:36ch;font-size:17px;line-height:1.55;color:var(--ink-2)}
.discovery-feedback::before{content:'';flex:none;width:22px;height:22px;margin-top:1px;border-radius:50%;background:#1c1b2e14 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2355536b' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M12 8v.01M12 11.5v4.5'/%3E%3C/svg%3E") center/16px no-repeat}
.discovery-feedback[data-state="error"]{color:#8a3a14}
.discovery-feedback[data-state="error"]::before{background:#fde7dc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a3a14' stroke-width='2.6' stroke-linecap='round'%3E%3Cpath d='m8 8 8 8M16 8l-8 8'/%3E%3C/svg%3E") center/16px no-repeat}
.discovery-feedback[data-state="success"]{color:var(--accent)}
.discovery-feedback[data-state="success"]::before{background:var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6.5 12.5 3.5 3.5 7.5-8'/%3E%3C/svg%3E") center/16px no-repeat}

/* Mechanische Tastengeometrie: Kappe, Flanke und Gehäusekante sind echte Ebenen. */
.calculator-stage{height:460px;width:100%;display:grid;place-items:center;perspective:1600px}
.calculator{position:relative;display:grid;grid-template-columns:repeat(4,72px);grid-template-rows:repeat(4,72px);gap:18px;padding:28px;border-radius:30px;transform:rotateX(12deg) rotateZ(-3deg);transform-style:preserve-3d;background:linear-gradient(160deg,#24225a 0%,var(--midnight) 60%);box-shadow:inset 0 1px 0 #ffffff26,inset 0 0 0 1px #ffffff12,0 50px 70px -30px #15143b66,0 18px 30px -18px #15143b4d}
.calculator::before{content:'';position:absolute;inset:0;z-index:-1;border-radius:inherit;background:#0b0a26;transform:translateY(9px) translateZ(-2px)}
.calc-key{appearance:none;position:relative;width:72px;height:72px;padding:0;border:0;border-radius:14px;background:transparent;color:var(--ink);transform:translateZ(8px);transform-style:preserve-3d;transition:transform 100ms ease-out,opacity .3s ease;touch-action:manipulation;user-select:none}
.calc-key .side{position:absolute;inset:4px 0 -7px 0;border-radius:14px;background:linear-gradient(130deg,#e4e0f6,#bdb6e2)}
.calc-key .top{position:absolute;inset:0;border-radius:14px;background:linear-gradient(140deg,#fff,#efedf8);box-shadow:inset 1px 1px 1px #fff,inset -2px -3px 2px #d6d1ee,0 4px 8px #0b0a2640}
.calc-key .char{position:relative;z-index:1;display:grid;place-items:center;width:100%;height:100%;font-size:28px;line-height:1;font-weight:600;transform:translateZ(2px);pointer-events:none}
.calc-key .char .icon{width:26px;height:26px;stroke-width:2}
.calc-key:active,.calc-key.is-pressed{transform:translate3d(0,4px,3px)}
.calc-key:focus,.calc-key:focus-visible{outline:none;box-shadow:none}
.calc-key:focus-visible .top{box-shadow:inset 0 0 0 3px var(--accent),0 4px 8px #0b0a2640}
.calc-key:disabled{cursor:default}
.calc-key:disabled .char{opacity:.38}
.calc-key--zero{grid-column:1 / 3;width:auto}
.calc-key--delete{grid-column:4;grid-row:1 / 3;height:auto}
.calc-key--enter{grid-column:4;grid-row:3 / 5;height:auto}
.calc-key--action{color:var(--ink)}
.calc-key--action .top{background:linear-gradient(140deg,#ffb68e,var(--apricot));box-shadow:inset 1px 1px 1px #ffd3b8,inset -2px -3px 2px #dd7a43,0 4px 8px #0b0a2640}
.calc-key--action .side{background:#d36c35}

/* Geschichten: die neueste Karte trägt Indigo, ältere treten zurück. */
.discovery-stories{min-width:0}
.discovery-status{display:flex;flex-wrap:wrap;align-items:center;gap:10px 16px;margin-bottom:32px}
.discovery-progress{white-space:nowrap}
.discovery-meter{display:flex;gap:6px}
.discovery-meter i{width:28px;height:8px;border-radius:999px;background:#1c1b2e1a;transition:background-color .4s ease,width .5s var(--ease-out)}
.discovery-meter[data-count="1"] i:nth-child(-n+1),.discovery-meter[data-count="2"] i:nth-child(-n+2),.discovery-meter[data-count="3"] i:nth-child(-n+3),.discovery-meter[data-count="4"] i{background:var(--accent)}
.discovery-progress{font-size:17px;font-weight:600;color:var(--ink-2);font-variant-numeric:tabular-nums}
.discovery-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.discovery-card{padding:32px 36px;border-radius:var(--r-lg);background:var(--porcelain);color:var(--ink);transition:background-color .5s ease,color .5s ease}
.discovery-card h3{font-size:22px;line-height:1.3;font-weight:600;letter-spacing:-.02em}
.discovery-card p,.discovery-card li{font-size:17px;line-height:1.65;color:var(--ink-2);max-width:64ch;transition:color .5s ease}
.discovery-card p{margin-top:12px}
.discovery-card__list{display:grid;gap:12px;margin:14px 0 0;padding:0;list-style:none}
.discovery-card__list li{position:relative;padding-left:18px}
.discovery-card__list li::before{content:'';position:absolute;left:0;top:.68em;width:7px;height:7px;border-radius:50%;background:var(--accent);transition:background-color .5s ease}
.discovery-card__list strong{font-weight:600;color:var(--ink);transition:color .5s ease}
.discovery-card.is-locked{background:transparent;box-shadow:inset 0 0 0 1.5px #1c1b2e1f}
.discovery-card.is-locked h3{color:var(--ink-2)}
.discovery-card.is-locked p{display:flex;align-items:center;gap:8px;font-size:16px;color:#6e6b85}
.discovery-card.is-locked p::before{content:'';flex:none;width:16px;height:16px;background:currentColor;-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Crect x='5' y='11' width='14' height='9' rx='2'/%3E%3Cpath d='M8 11V8a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E") center/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Crect x='5' y='11' width='14' height='9' rx='2'/%3E%3Cpath d='M8 11V8a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E") center/contain no-repeat}
.discovery-card.is-newest{background:var(--accent);color:#fff;box-shadow:0 30px 50px -30px #6c5dd380;animation:discovery-pop .55s var(--ease-out) both}
.discovery-card.is-newest p,.discovery-card.is-newest li{color:#f4f6ff}
.discovery-card.is-newest .discovery-card__list strong{color:#fff}
.discovery-card.is-newest .discovery-card__list li::before{background:#fff}
.discovery-next{width:fit-content;margin-top:24px}
@keyframes discovery-pop{from{opacity:0;transform:translateY(20px) scale(.97)}to{opacity:1;transform:none}}

@media(max-width:1180px){
  .calculator{grid-template-columns:repeat(4,62px);grid-template-rows:repeat(4,62px);gap:15px;padding:24px}
  .calc-key{width:62px;height:62px}
  .calc-key--zero{width:auto}.calc-key--delete,.calc-key--enter{height:auto}
  .calculator-stage{height:420px}
}
@media(max-width:900px){
  .calculator{grid-template-columns:repeat(4,54px);grid-template-rows:repeat(4,54px);gap:13px;padding:22px}
  .calc-key{width:54px;height:54px}
  .calc-key--zero{width:auto}.calc-key--delete,.calc-key--enter{height:auto}
  .calculator-stage{height:360px}
}
@media(max-width:760px){
  .discovery-layout{grid-template-columns:1fr;grid-template-areas:'intro' 'device' 'stories';row-gap:32px}
  .discovery-intro h2{max-width:14ch}
  .calculator-stage{height:360px}
    .discovery-cards{grid-template-columns:1fr}
  .discovery-card{padding:26px 24px}
  .discovery-next{margin:8px 0 12px}
}
@media(max-width:420px){
  .calculator{grid-template-columns:repeat(4,50px);grid-template-rows:repeat(4,50px);gap:12px;padding:18px;transform:rotateX(8deg)}
  .calc-key{width:50px;height:50px}
  .calc-key--zero{width:auto}.calc-key--delete,.calc-key--enter{height:auto}
  .calc-key .char{font-size:24px}
  .calculator-stage{height:320px}
  .discovery-equation{font-size:40px}
  .discovery-equation input{height:72px;min-width:76px}
}
@media(max-width:340px){
  .calculator{grid-template-columns:repeat(4,44px);grid-template-rows:repeat(4,44px);gap:10px;padding:16px}
  .calc-key{width:44px;height:44px}
  .calc-key--zero{width:auto}.calc-key--delete,.calc-key--enter{height:auto}
}
@media(prefers-reduced-motion:reduce){.calc-key{transition:none}.discovery-card{animation:none}}
