/* needsto.be-Hub — „Schriftmuster“: neutraler Grund, jede App als großer Schriftzug in ihrer eigenen Schrift.
   Gerüst und Bausteine kommen aus /ui.css; hier nur Theme und Signatur. Keine externen Quellen (CSP). */
@font-face { font-family: 'Instrument Sans'; src: url('/fonts/instrument-sans-latin.woff2') format('woff2'); font-weight: 400 700; font-display: swap; }
@font-face { font-family: 'Bricolage Grotesque'; src: url('/fonts/bricolage-grotesque-latin.woff2') format('woff2'); font-weight: 200 800; font-display: swap; }
@font-face { font-family: 'Barlow Semi Condensed'; src: url('/fonts/barlow-semi-condensed-600-latin.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Doto'; src: url('/fonts/Doto.ttf') format('truetype'); font-weight: 100 900; font-display: swap; }

:root {
  /* hell: Papier und Tinte · dunkel: warmes Schwarz, Orange aus dem Markenzeichen als Akzent */
  --bg: light-dark(#f1f0ec, #151412); --surface: light-dark(#fff, #201e1b); --ink: light-dark(#161616, #f1efe9);
  --ink-2: light-dark(#6f6f69, #a9a69d); --ink-3: light-dark(#a3a29b, #6d6a63); --line: light-dark(#d8d7d0, #312e2a); --field-line: light-dark(#c9c8c0, #45413b);
  --accent: light-dark(#161616, #f58c3b); --on-accent: light-dark(#f1f0ec, #1a0f05); --danger: light-dark(#c8321e, #f0705e);
  --font: 'Instrument Sans', ui-sans-serif, -apple-system, sans-serif;
  --mark-1: #f15b2a; --mark-2: #efaa4b; --mark-3: #f58c3b; --mark-4: #d94727;
}

.dot { display: inline-block; width: 8px; height: 8px; flex: none; }
.nt-title .dot { width: 12px; height: 12px; margin-right: 12px; vertical-align: .18em; }
.nt-section-h > span { display: inline-flex; align-items: center; gap: 8px; }

/* Suche: nur ein Unterstrich */
.find { display: flex; align-items: center; gap: 10px; height: 50px; margin-bottom: 2px; border-bottom: 1.5px solid var(--ink); color: var(--ink-2); }
.find input { flex: 1; min-width: 0; height: 48px; border: 0; outline: 0; background: none; font-size: 1.0625rem; }
.find input::placeholder { color: var(--ink-2); }
.find input::-webkit-search-cancel-button { -webkit-appearance: none; }
.find .nt-i { width: 20px; height: 20px; }
.hits { display: grid; gap: var(--s-5); }
.hits .nt-row { transition: transform .14s var(--ease-out); }
.hits .nt-row:active { transform: translateX(4px); background: none; }

/* Teilen-Hinweise */
.shares .nt-row { gap: var(--s-2); }

/* Apps: jede Zeile ein Schriftmuster ihrer App, randlos über die volle Breite */
.apps { display: grid; margin: 0 calc(var(--gutter) * -1); border-top: 1px solid var(--line); }
.app { --tint: light-dark(#e6e5df, #24221e); position: relative; isolation: isolate; display: flex; align-items: center; height: 118px; padding: 0 var(--gutter); overflow: hidden;
  border-bottom: 1px solid var(--line); font: 600 4rem/1 'Instrument Sans', sans-serif; letter-spacing: -.02em; }
.app::before { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--tint); transform: scaleX(0); transform-origin: left; transition: transform .32s var(--ease-out); }
.app > span { display: inline-block; animation: set .42s var(--ease-out) backwards; transition: transform .45s var(--ease-out); }
.app:nth-child(2) > span { animation-delay: .04s; } .app:nth-child(3) > span { animation-delay: .08s; } .app:nth-child(4) > span { animation-delay: .12s; } .app:nth-child(5) > span { animation-delay: .16s; }
.app i { font-style: normal; }
.app:active::before { transform: scaleX(1); transition-duration: .28s; }
@media (hover: hover) and (pointer: fine) { .app:hover::before { transform: scaleX(1); } .app:hover > span { transform: translateX(10px); } }
/* Satz aufbauen: der Schriftzug wird von links aufgedeckt */
@keyframes set { from { clip-path: inset(-40% 100% -40% -20%); transform: translateX(-6px); } to { clip-path: inset(-40% -20% -40% -20%); } }

.app-zivi { --tint: #23232a; background: #111113; border-bottom-color: light-dark(#111113, var(--line)); color: #fff; font-family: 'Doto', ui-monospace, monospace; font-weight: 900; font-size: 4.5rem; letter-spacing: 0; }
.app-zivi i { display: inline-block; width: .2em; height: .2em; margin-left: .08em; border-radius: 50%; background: #f5c518; color: transparent; overflow: hidden; }
.app-payment { --tint: light-dark(#dfe2ff, #1e2150); color: light-dark(#2b3bff, #8e97ff); font-family: 'Bricolage Grotesque', sans-serif; font-weight: 600; letter-spacing: -.04em; }
.app-payment i, .app-notes i { display: none; }
.app-wg { --tint: light-dark(#e8e8e4, #24221e); font-family: 'Barlow Semi Condensed', sans-serif; font-size: 4.5rem; letter-spacing: -.01em; }
.app-wg > span { display: inline-flex; align-items: baseline; gap: 10px; }
.app-wg i { width: 26px; height: 26px; border-radius: 50%; border: 6px solid #e3000f; background: var(--bg); color: transparent; overflow: hidden; }
.app-notes { --tint: #f2cf2a; background: #ffde3b; color: #141310; letter-spacing: -.05em; }

/* Neu anlegen: Aktionen aller Apps */
.quick { margin-top: var(--s-2); }

/* Einstieg: große Zeile, Strich-Felder */
.nt-gate .nt-title { font-size: clamp(2.875rem, 13vw, 4.5rem); line-height: .95; letter-spacing: -.04em; }
.nt-gate .nt-title em { font-style: normal; color: var(--ink-2); }
.nt-gate form { margin: 0; }
.signin { display: grid; gap: 22px; }
.lines { display: grid; }
.line { min-height: 56px; border: 0; border-bottom: 1px solid var(--line); outline: 0; background: transparent; padding: 0 2px; font-size: 1.125rem; transition: border-color .15s ease; }
.line:focus { border-bottom-color: var(--ink); }
.line::placeholder, .pw-row input::placeholder { color: var(--ink-3); }
.pw-row { display: flex; align-items: center; min-height: 56px; border-bottom: 1.5px solid var(--ink); padding: 0 0 0 2px; }
.pw-row input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 1.125rem; }
.pw-row button { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--ink); color: var(--bg); transition: transform .14s var(--ease-out); }
.pw-row button:active { transform: scale(.92); }
.pw-row svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.aside { justify-self: start; margin-left: -12px; }

/* Apps wählen: jede Kachel ein kleines Schriftmuster ihrer App; aus = nur Umriss, ohne App-Farben */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.tiles .tile { position: relative; display: flex; align-items: center; min-height: 72px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  font: 600 1.6875rem/1 'Instrument Sans', sans-serif; letter-spacing: -.02em; color: var(--ink); cursor: pointer; transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .12s var(--ease-out); }
.tiles .app-zivi { color: #fff; } .tiles .app-payment { color: light-dark(#2b3bff, #8e97ff); } .tiles .app-notes { color: #141310; }
.tiles .tile:not(:has(input:checked)) { background: transparent; color: var(--ink-3); border-style: dashed; border-color: var(--field-line); }
.tiles .tile:not(:has(input:checked)) i { filter: grayscale(1); opacity: .5; }
.tiles .tile.app-zivi, .tiles .tile.app-wg { font-size: 1.875rem; }
.tiles .tile.app-wg i { width: 13px; height: 13px; border-width: 3px; }
.tiles .tile.app-wg > span { gap: 5px; }
.tiles .tile input { position: absolute; opacity: 0; pointer-events: none; }
.tiles .tile:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 3px; }
.tiles .tile:active { transform: scale(.97); }
.tiles .tile i { font-style: normal; }

/* Notfallcodes, Zwei-Faktor-Schlüssel, Einladungslink */
.codes { padding: 16px 18px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  font: 500 1.0625rem/1.3 ui-monospace, 'SF Mono', Menlo, monospace; counter-reset: c; }
.codes li { counter-increment: c; white-space: nowrap; }
.codes li::before { content: counter(c); display: inline-block; width: 1.6em; color: var(--ink-3); font-size: 0.8125rem; }
.copy { justify-self: start; }
.secret { display: block; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); font: 500 1.1875rem/1.4 ui-monospace, 'SF Mono', Menlo, monospace; letter-spacing: .04em; overflow-wrap: anywhere; }
.nt-field > .copyline { font: 0.9375rem ui-monospace, 'SF Mono', Menlo, monospace; }

/* Konto */
.nt-row strong .nt-i { display: inline; margin-right: 8px; vertical-align: -3px; }
.nt-row small.warn { color: var(--danger); }
.settings .nt-stack { gap: var(--s-4); }
.quiet-times { padding: var(--s-2) 0 var(--s-3); }
.quiet:not(:has(input[name="quiet"]:checked)) .quiet-times { display: none; }
.logout { margin-top: var(--s-4); }
.passkey { justify-self: start; }
.facts dt { padding-top: 18px; font-size: var(--t-sm); font-weight: 600; color: var(--ink-2); }
.facts dd { margin: 4px 0 0; padding-bottom: 18px; border-bottom: 1px solid var(--line); }

/* Desktop: dieselbe Liste, größerer Satz */
@media (min-width: 960px) {
  .nt-main.wide { padding-left: 40px; padding-right: 40px; }
  .nt-top:has(+ .nt-main.wide) { padding-left: 40px; padding-right: 40px; }
  .nt-main.wide .find { max-width: 520px; }
  .apps { margin: 0 -24px; }
  .app { height: 150px; padding: 0 24px; font-size: 5.75rem; }
  .app-zivi, .app-wg { font-size: 6.5rem; }
  .app-wg i { width: 36px; height: 36px; border-width: 8px; }
}

/* Einstieg (motion.js setzt .arrive) */
.arrive .nt-mark i { animation: tile .5s cubic-bezier(.34, 1.56, .64, 1) both; animation-delay: calc(sibling-index() * 60ms); }
.arrive .nt-brand > span:last-child { animation: set .5s var(--ease-out) .2s both; }
/* Zeilen: erst läuft das Band ein, dann wird der Schriftzug gesetzt */
.arrive .app { animation: band .56s var(--ease-in-out) backwards; animation-delay: calc(sibling-index() * 70ms); }
.arrive .app > span { animation-duration: .5s; animation-delay: calc(sibling-index() * 70ms + .22s); }
.arrive .find { animation: rule .6s var(--ease-in-out) .1s both; }
@keyframes tile { from { opacity: 0; transform: scale(.3) rotate(90deg); } }
@keyframes band { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes rule { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

/* Interne Seitenwechsel: Formular schiebt sich von rechts herein (push), zurück nach rechts hinaus (pop) */
::view-transition-group(*) { animation-duration: .36s; animation-timing-function: var(--ease-in-out); }
::view-transition-old(root) { animation: .14s ease both vt-out; }
::view-transition-new(root) { animation: .3s var(--ease-out) both vt-in; }
html:active-view-transition-type(push)::view-transition-old(root) { animation: .36s var(--ease-in-out) both push-out; }
html:active-view-transition-type(push)::view-transition-new(root) { animation: .36s var(--ease-in-out) both push-in; }
html:active-view-transition-type(pop)::view-transition-old(root) { animation: .36s var(--ease-in-out) both push-in reverse; }
html:active-view-transition-type(pop)::view-transition-new(root) { animation: .36s var(--ease-in-out) both push-out reverse; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: scale(.985); } }
@keyframes push-out { to { opacity: 0; transform: translateX(-18%); } }
@keyframes push-in { from { transform: translateX(100%); } }

@media (prefers-reduced-motion: reduce) {
  .app > span, .arrive .app, .arrive .nt-mark i, .arrive .nt-brand > span:last-child, .arrive .find { animation: fade .2s ease both; transition: none; }
  .app:hover > span { transform: none; }
  .app::before { transition: opacity .2s ease; transform: none; opacity: 0; }
  .app:active::before, .app:hover::before { opacity: 1; }
  .pw-row button:active, .hits .nt-row:active, .tiles .tile:active { transform: none; }
  @keyframes fade { from { opacity: 0; } }
}
