@import url("/css/fonts.css");

:root {
  --bg: #16130f;
  --bg-2: #221e19;
  --ink: #f6f1e8;
  --muted: #b1a79b;
  --line: rgba(246, 241, 232, 0.14);
  --accent: #ff4d1c;
  --accent-ink: #1a0d06;
  --signal: #dff25a;
  --paper: #efeae1;
  --paper-ink: #1c1915;
  --paper-muted: #5e564c;
  --danger: #ffb1a6;
  --display: "Syne", "Segoe UI", sans-serif;
  --sans: "Outfit", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
  min-height: 100dvh;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: clip;
}
body.page-tool {
  overscroll-behavior: none;
  padding-bottom: calc(220px + env(safe-area-inset-bottom));
}
body.lock-scroll,
body.nfc-busy { overflow: hidden; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, a, input, select, textarea, summary, label { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button, .btn, summary { user-select: none; }
::selection { background: var(--signal); color: #17140c; }

.skip {
  position: absolute;
  left: 12px;
  top: 8px;
  transform: translateY(-140%);
  background: var(--signal);
  color: #17140c;
  padding: 10px 14px;
  z-index: 50;
  border-radius: 10px;
}
.skip:focus { transform: none; }

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: calc(8px + env(safe-area-inset-top)) 20px 8px;
  background: rgba(22, 19, 15, 0.94);
  border-bottom: 1px solid var(--line);
}
.brand {
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -0.05em;
  font-size: 22px;
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.brand b { color: var(--accent); font-weight: 800; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 14px 18px;
  border-radius: 14px;
  border: 1px solid transparent;
  font: 600 16px/1 var(--sans);
  text-decoration: none;
  cursor: pointer;
}
.btn-small { min-height: 44px; padding: 10px 14px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ink { background: #17140c; color: var(--signal); }
button:disabled,
.btn:disabled { opacity: 0.45; cursor: default; }
@media (hover: hover) {
  .btn-primary:hover { filter: brightness(1.05); }
  .btn-ghost:hover { border-color: var(--ink); }
}

.hero {
  padding: 28px 20px 12px;
  background-image: repeating-linear-gradient(
    -14deg,
    transparent,
    transparent 11px,
    rgba(255, 77, 28, 0.045) 11px,
    rgba(255, 77, 28, 0.045) 12px
  );
}
.kicker {
  margin: 0 0 12px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--signal);
}
h1, h2, h3 { font-family: var(--display); letter-spacing: -0.045em; line-height: 0.92; margin: 0; }
h1 { font-size: clamp(44px, 13vw, 92px); max-width: 9ch; }
h2 { font-size: clamp(34px, 8vw, 64px); max-width: 12ch; }
h3 { font-size: 28px; line-height: 1; }
.lede, .hero p, .steps p, .products p { color: var(--muted); }
.lede { font-size: 18px; max-width: 38ch; margin: 18px 0 0; }
.actions { display: flex; flex-direction: column; gap: 12px; margin-top: 28px; }

.plastik { display: grid; place-items: center; padding: 36px 0 18px; }
.plastik-card {
  width: min(280px, 78vw);
  aspect-ratio: 1.72 / 1;
  padding: 16px 16px 14px;
  border-radius: 18px;
  color: var(--ink);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), transparent 36%),
    linear-gradient(180deg, #3a3129, #221c17 55%, #15120f);
  box-shadow: 8px 16px 0 rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(255, 255, 255, 0.06);
  transform: rotate(-6deg);
  display: flex;
  flex-direction: column;
}
.plastik-top, .plastik-foot { display: flex; justify-content: space-between; align-items: center; }
.plastik-top { font-family: var(--display); font-weight: 800; letter-spacing: -0.05em; font-size: 22px; }
.nfc-mark { color: var(--signal); }
.chip {
  width: 42px;
  height: 32px;
  margin-top: auto;
  border-radius: 6px;
  background:
    linear-gradient(#d7b56a, #d7b56a) 0 7px / 100% 2px no-repeat,
    linear-gradient(#d7b56a, #d7b56a) 0 15px / 100% 2px no-repeat,
    linear-gradient(#d7b56a, #d7b56a) 0 23px / 100% 2px no-repeat,
    linear-gradient(90deg, #e7c98a, #a8833d);
}
.plastik-foot { margin-top: 12px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }

.strip {
  margin: 8px 0 0;
  padding: 16px 20px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.04em;
}

.block { padding: 56px 20px; }
.steps, .products { list-style: none; margin: 28px 0 0; padding: 0; }
.steps li, .products li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
}
.steps span, .products span {
  font-family: var(--mono);
  color: var(--accent);
  padding-top: 6px;
}
.steps h3, .products h3 { margin-bottom: 8px; }
.steps p, .products p { margin: 0; }

.paper { background: var(--paper); color: var(--paper-ink); }
.paper-inner { padding: 56px 20px; }
.kicker-dark { color: #9a3d16; }
.paper h2 { color: var(--paper-ink); }
.paper .products li { border-color: rgba(28, 25, 21, 0.14); }
.paper .products p { color: var(--paper-muted); }
.paper .products span { color: #c2410c; }
.spec { margin-top: 8px !important; font-family: var(--mono); font-size: 13px; letter-spacing: 0.04em; }
.paper-note { margin: 8px 0 0; max-width: 46ch; color: var(--paper-muted); }

.foot {
  padding: 28px 20px calc(28px + env(safe-area-inset-bottom));
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
}
.foot a { min-height: 44px; display: inline-flex; align-items: center; width: fit-content; }
.foot p { margin: 0; color: var(--muted); }
.copy { font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; }

.tool { width: min(640px, 100%); margin: 0 auto; padding: 16px 20px 12px; }
.tool h1 { max-width: 16ch; font-size: clamp(36px, 10vw, 64px); }
.tool .lede { margin-top: 12px; }
.block-tight { margin-top: 20px; }
.block-tight h2 { font-size: 28px; max-width: none; margin-bottom: 14px; }
.note, .hint { color: var(--muted); margin: 0; }
.note { margin-top: 16px; }
.hint { font-size: 14px; line-height: 1.45; }
.field { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.field span, .check span { font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
input, textarea, select {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #100e0c;
  color: var(--ink);
  font: 500 16px/1.35 var(--sans);
}
textarea { min-height: 112px; resize: vertical; }
select { appearance: none; }
.tiles { display: grid; gap: 8px; margin-top: 14px; }
.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-height: 68px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-2);
}
.tile span { font-weight: 600; }
.tile small { color: var(--muted); font-size: 13px; }
.tile input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  min-height: 0;
  padding: 0;
  border: 0;
}
.tile:has(input:checked) { border-color: var(--signal); background: #242814; }
.tile:has(input:focus-visible) { outline: 2px solid var(--signal); outline-offset: 3px; }
.code-row { display: grid; gap: 10px; margin-top: 12px; }
.code-row .field { margin-top: 0; }
.code-row .btn { width: 100%; }
.identity { margin-top: 22px; display: grid; gap: 10px; }
.identity .field { margin-top: 0; }
.mono { font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; margin: 0; color: var(--signal); }
.alert, .result { margin-top: 16px; padding: 12px 14px; border-radius: 12px; }
.alert { border: 1px solid #8a3d34; background: #2a1614; color: var(--danger); }
.result { border: 1px solid rgba(223, 242, 90, 0.45); background: #1c2212; }
.result p, .alert { margin: 0; }
.danger-zone { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 14px; }
.danger-zone:not([open]) > :not(summary) { display: none; }
.danger-zone summary { min-height: 48px; display: flex; align-items: center; cursor: pointer; color: var(--danger); }
.check { display: flex; gap: 10px; align-items: flex-start; margin-top: 4px; }
.check input { width: 22px; height: 22px; min-height: 22px; margin-top: 2px; }
.check span { text-transform: none; letter-spacing: 0; font-size: 15px; color: var(--ink); }

.dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: #16130f;
  border-top: 1px solid var(--line);
}
.dock p { margin: 0; color: var(--muted); font-size: 14px; min-height: 20px; }

.sheet {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(12, 10, 8, 0.72);
  display: flex;
  align-items: flex-end;
}
.sheet[hidden] { display: none !important; }
.sheet-card {
  width: min(640px, 100%);
  margin: 0 auto;
  background: var(--bg-2);
  border-radius: 22px 22px 0 0;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sheet-card h2 { font-size: 32px; max-width: 16ch; }
.sheet-card p { margin: 0; color: var(--muted); }
#sheet-cancel { align-self: flex-start; min-height: 44px; }

#nfc-shield {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  background: #100e0c;
  touch-action: none;
}
#nfc-shield[hidden] { display: none !important; }
.shield-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: calc(12px + env(safe-area-inset-top)) 16px 0;
}
.shield-center {
  pointer-events: none;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 24px;
  text-align: center;
}
#nfc-status {
  margin: 0;
  max-width: 16ch;
  font-family: var(--display);
  font-size: clamp(32px, 8vw, 48px);
  line-height: 0.95;
  letter-spacing: -0.04em;
}
.rings { width: 148px; height: 148px; position: relative; }
.rings span {
  position: absolute;
  inset: 0;
  border: 2px solid var(--signal);
  border-radius: 50%;
  animation: ping 1.8s ease-out infinite;
}
.rings span:nth-child(2) { animation-delay: 0.35s; }
.rings span:nth-child(3) { animation-delay: 0.7s; }
@keyframes ping {
  from { transform: scale(0.35); opacity: 0.9; }
  to { transform: scale(1); opacity: 0; }
}

:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }
[hidden] { display: none !important; }

@media (min-width: 720px) {
  .actions { flex-direction: row; align-items: center; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .code-row { grid-template-columns: 1fr auto; align-items: end; }
  .code-row .btn { width: auto; min-width: 112px; }
  .dock { left: 50%; right: auto; width: min(640px, 100%); transform: translateX(-50%); border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
}
@media (min-width: 900px) {
  .hero {
    width: min(1120px, calc(100% - 80px));
    margin: 0 auto;
    min-height: calc(100dvh - 72px);
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    align-items: center;
    gap: 32px;
    padding-top: 18px;
  }
  .plastik-card { width: 340px; transform: rotate(-8deg); }
  .block, .paper-inner { width: min(1120px, calc(100% - 80px)); margin: 0 auto; }
  .strip, .foot { width: min(1120px, calc(100% - 80px)); margin-left: auto; margin-right: auto; }
  .steps { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 28px; }
  .steps li { display: block; border-top: 0; padding: 0; }
  .products { display: grid; grid-template-columns: 1fr 1fr; gap: 0 40px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rings span { animation: none; opacity: 0.8; }
}
@media (max-width: 359px) {
  .tiles { grid-template-columns: 1fr; }
  h1 { font-size: 40px; }
}

.tap-shield { display: none; }
html.arming::before {
  content: "";
  position: fixed;
  left: 0;
  top: 0;
  height: 3px;
  width: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  background: var(--signal);
  z-index: 240;
  pointer-events: none;
  animation: tekte-arm var(--arm, 700ms) linear forwards;
}
@keyframes tekte-arm { to { transform: scaleX(1); } }
html.arming body { pointer-events: none; }
html.arming .tap-shield {
  display: block;
  pointer-events: auto;
  position: fixed;
  inset: 0;
  z-index: 220;
  background: transparent;
  touch-action: none;
}
@media (prefers-reduced-motion: reduce) {
  html.arming::before { animation: none; transform: scaleX(1); }
}

body.page-card { min-height: 100dvh; }
.page-card .stage {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: calc(18px + env(safe-area-inset-top)) 20px calc(20px + env(safe-area-inset-bottom));
}
.page-card h1 { max-width: 14ch; font-size: clamp(40px, 12vw, 68px); }
.page-card .detail { margin-top: 16px; color: var(--muted); font-size: 18px; line-height: 1.4; overflow-wrap: anywhere; }
.page-card .detail.text { color: var(--ink); font-size: clamp(22px, 6vw, 32px); white-space: pre-wrap; }
.page-card .secret {
  margin: 22px 0 0;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  font-size: 28px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.page-card .fine { margin: 14px 0 0; color: #8c8378; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; }
.page-card .go {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 96px;
  padding: 20px;
  border: 0;
  border-radius: 18px;
  background: var(--signal);
  color: #17140c;
  font: 700 22px/1.1 var(--sans);
  text-align: center;
  text-decoration: none;
}
html.arming .go { background: #8d9550; }
html.ready .go { background: var(--signal); }

.page-admin h1 { max-width: 12ch; font-size: clamp(36px, 10vw, 64px); }
.admin { width: min(880px, 100%); margin: 0 auto; padding: 20px 20px calc(40px + env(safe-area-inset-bottom)); }
.login-box { max-width: 440px; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 18px 0; }
.stat { margin: 0; border: 1px solid var(--line); border-radius: 16px; padding: 14px; background: var(--bg-2); }
.stat b { display: block; font-family: var(--display); font-size: 32px; letter-spacing: -0.04em; line-height: 1; }
.stat span { color: var(--muted); font-size: 13px; }
.make-form { display: grid; gap: 8px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.filter[aria-pressed="true"] { background: var(--signal); color: #17140c; border-color: transparent; }
.inventory, .fresh { display: grid; gap: 10px; margin-top: 16px; }
.card-row { border: 1px solid var(--line); border-radius: 16px; padding: 14px; background: #1c1814; }
.card-code { margin: 0; }
.card-code code { font-family: var(--mono); font-size: 16px; }
.card-meta { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid rgba(255, 177, 166, 0.45); }
.top-links { display: flex; align-items: center; gap: 14px; }
.top-links a { min-height: 44px; display: inline-flex; align-items: center; }
.shop-grid { display: grid; gap: 12px; margin-top: 18px; }
.shop-card, .product-chip {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg-2);
  text-decoration: none;
}
.shop-card img, .product-chip img, .shot-empty, .product-gallery img { width: 88px; height: 88px; object-fit: cover; border-radius: 12px; background: #100e0c; }
.shot { display: block; padding: 0; border: 0; background: transparent; cursor: zoom-in; }
.shop-card > a { display: flex; flex-direction: column; justify-content: center; min-height: 88px; text-decoration: none; }
.shot-empty { display: block; }
.shop-card b, .product-chip b { display: block; font-family: var(--display); letter-spacing: -0.04em; }
.shop-card small, .product-chip small { color: var(--muted); }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; padding: 0; list-style: none; }
.tag-list li { border: 1px solid var(--line); border-radius: 999px; padding: 4px 8px; color: var(--muted); font-size: 12px; }
.product-gallery { display: flex; gap: 8px; overflow: auto; margin-top: 12px; }
.product-gallery img { width: min(72vw, 280px); height: 180px; }
.photo-frame {
  position: fixed;
  inset: 0;
  z-index: 230;
  background: rgba(12, 10, 8, 0.96);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 10px;
  padding: calc(12px + env(safe-area-inset-top)) 12px calc(12px + env(safe-area-inset-bottom));
}
.photo-frame[hidden] { display: none; }
.photo-bar, .photo-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.photo-count { margin: 0; color: #f4efe6; }
.photo-stage { overflow: auto; min-height: 0; touch-action: pan-x pan-y; }
.photo-stage img { width: auto; max-width: 100%; max-height: 100%; height: auto; margin: 0 auto; object-fit: contain; border-radius: 8px; }
.photo-stage.z2 img, .photo-stage.z3 img { max-width: none; max-height: none; }
.photo-stage.z2 img { width: 180%; }
.photo-stage.z3 img { width: 280%; }
.price { margin: 14px 0 0; font-family: var(--display); font-size: 32px; }
.copy { white-space: pre-line; color: var(--muted); margin-top: 10px; }
.shot-keep { display: flex; align-items: center; gap: 10px; }
.shot-keep img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; }
.go-muted { background: #3a342c; color: var(--muted); }
.fine-link { display: inline-flex; min-height: 44px; align-items: center; color: var(--signal); }
.stack { display: grid; gap: 8px; }
.offer-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: end; }
.offer-row .btn { margin-bottom: 2px; }
.market { margin-top: 28px; }
.price-rows { list-style: none; margin: 12px 0 0; padding: 0; }
.price-rows li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
@media (min-width: 720px) {
  .shop-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 720px) {
  .stats { grid-template-columns: repeat(5, 1fr); }
  .make-form { grid-template-columns: 120px 1fr auto; align-items: end; }
  .make-form .hint { grid-column: 1 / -1; }
}
.qr-frame img { width: min(280px, 100%); height: auto; background: #fff; padding: 12px; border-radius: 12px; }
