/* ==========================================================================
   Matyáš Knechtl – 3D modely a tisk na míru
   ========================================================================== */

:root {
  --bg: #F5F6F2;
  --surface: #FFFFFF;
  --ink: #15171A;
  --ink-2: #40443E;
  --muted: #5B6058;
  --muted-dark: #8A9084;
  --muted-dark-2: #C6CCBE;
  --border: #E4E7DE;
  --divider: #EEF0EA;
  --hover: #F0F2EC;
  --accent: #9AD045;
  --accent-hover: #AEDD62;
  --accent-soft: #EEF6E0;
  --accent-text: #3F6310;
  --status-dot: #7DB32E;

  --font: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;

  --shadow-card: 0 1px 2px rgba(21,23,26,.04), 0 12px 32px -18px rgba(21,23,26,.18);
  --shadow-lift: 0 24px 40px -22px rgba(21,23,26,.35);
  --ease-out: cubic-bezier(.2,.8,.2,1);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--accent-text); }
button { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
::selection { background: var(--accent); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

@keyframes mkblink { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 10px;
  transition: top .2s;
}
.skip-link:focus { top: 12px; color: #fff; }

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.site-header { position: sticky; top: 12px; z-index: 20; padding: 0 12px; }

/* Liquid glass: čiré sklo jen s lehkým rozmazáním, ostrý světelný lem
   a lom světla na okrajích (SVG filtr z main.js, jen v Chromiu) */
.bar {
  position: relative;
  max-width: 1200px; margin: 12px auto 0;
  padding: 8px 8px 8px 18px;
  display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap;
  background: rgba(255,255,255,.08);
  -webkit-backdrop-filter: blur(3px) saturate(170%) brightness(1.04);
          backdrop-filter: blur(3px) saturate(170%) brightness(1.04);
  border-radius: 999px;
  box-shadow:
    inset 1.5px 1.5px 0 -.5px rgba(255,255,255,.95),
    inset -1px -1px 0 -.5px rgba(255,255,255,.7),
    inset 0 0 0 .5px rgba(255,255,255,.35),
    inset 0 0 14px -4px rgba(255,255,255,.55),
    0 1px 1px rgba(21,23,26,.05),
    0 10px 30px -12px rgba(21,23,26,.22);
  overflow: hidden;
  isolation: isolate;
  transition: background-color .4s, color .4s, box-shadow .4s;
}
.bar.lg-refract {
  -webkit-backdrop-filter: url(#lg-filter) saturate(170%) brightness(1.04);
          backdrop-filter: url(#lg-filter) saturate(170%) brightness(1.04);
}
/* odlesk na lemu – světlo dopadá zleva shora, odraz vpravo dole */
.bar::before {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  border-radius: inherit; padding: 1px;
  background: linear-gradient(115deg,
    rgba(255,255,255,1) 0%, rgba(255,255,255,.1) 18%, rgba(255,255,255,0) 45%,
    rgba(255,255,255,0) 60%, rgba(255,255,255,.15) 85%, rgba(255,255,255,.9) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
/* jemný lesk skla podél horní hrany */
.bar::after {
  content: ''; position: absolute; z-index: -1; pointer-events: none;
  inset: 0; border-radius: inherit;
  background:
    radial-gradient(120% 90% at 20% -30%, rgba(255,255,255,.35), transparent 55%),
    radial-gradient(90% 90% at 95% 140%, rgba(255,255,255,.18), transparent 60%);
}
.bar .brand, .bar .nav a { text-shadow: 0 0 10px rgba(255,255,255,.9), 0 0 2px rgba(255,255,255,.6); }
.bar.on-dark .brand, .bar.on-dark .nav a { text-shadow: 0 0 10px rgba(0,0,0,.5), 0 1px 2px rgba(0,0,0,.35); }
/* tmavé sklo nad tmavým obsahem */
.bar.on-dark {
  color: #fff;
  background:
    linear-gradient(180deg, rgba(30,33,30,.56), rgba(21,23,26,.48));
  box-shadow:
    inset 1.5px 1.5px 0 -.5px rgba(255,255,255,.55),
    inset -1px -1px 0 -.5px rgba(255,255,255,.3),
    inset 0 0 14px -4px rgba(255,255,255,.18),
    0 1px 2px rgba(21,23,26,.2),
    0 12px 36px -14px rgba(0,0,0,.5);
}
.bar.on-dark::before { opacity: .6; }
.bar.on-dark::after { opacity: .35; }
.bar.on-dark .brand, .bar.on-dark .brand:hover,
.bar.on-dark .nav a:hover, .bar.on-dark .nav a.active { color: #fff; }
.bar.on-dark .brand-mark { background: rgba(255,255,255,.12); box-shadow: inset 0 1px 1px rgba(255,255,255,.25); }
.bar.on-dark .nav a { color: rgba(255,255,255,.72); }
.bar.on-dark .nav-glass {
  background: linear-gradient(180deg, rgba(255,255,255,.26), rgba(255,255,255,.1));
  box-shadow: inset 0 1px 1px rgba(255,255,255,.45), inset 0 -1px 1px rgba(255,255,255,.12), 0 4px 12px -6px rgba(0,0,0,.4);
}
.bar.on-dark .status-pill { color: #CFEA9E; background: rgba(154,208,69,.16); box-shadow: inset 0 1px 1px rgba(255,255,255,.18); }
.bar.on-dark .status-pill.busy { color: #F3CF97; background: rgba(217,145,47,.18); }
.bar.on-dark .lang-switch { background: rgba(255,255,255,.08); box-shadow: inset 0 1px 2px rgba(0,0,0,.3); }
.bar.on-dark .lang-switch button { color: #fff; transition: color .3s; }
.bar.on-dark .lang-switch button[aria-pressed="true"] { color: var(--ink); }
.bar .brand, .bar .nav a, .bar .status-pill, .bar .lang-switch { transition: color .3s, background .3s, box-shadow .3s; }

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .bar { background: rgba(255,255,255,.9); }
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; letter-spacing: -.01em; }
.brand:hover { color: var(--ink); }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; background: var(--ink); color: var(--accent);
  display: grid; place-items: center; font-family: var(--mono); font-size: 11px; font-weight: 600;
  transition: transform .4s var(--ease-out);
}
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.06); }

.nav {
  display: flex; gap: 2px; flex: 1 1 300px; min-width: 0;
  flex-wrap: nowrap; overflow-x: auto; white-space: nowrap;
  font-size: 14px; font-weight: 500; justify-content: safe center;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav { position: relative; }
.nav a {
  position: relative; z-index: 1;
  padding: 8px 14px; border-radius: 999px; color: var(--ink-2);
  transition: color .2s;
}
.nav a:hover, .nav a.active { color: var(--ink); }
.nav a::after {
  content: ''; position: absolute; left: 50%; bottom: 3px; width: 4px; height: 4px; margin-left: -2px;
  border-radius: 50%; background: var(--accent); transform: scale(0); transition: transform .25s var(--ease-out);
}
.nav a.active::after { transform: scale(1); }

/* skleněná čočka pod aktivním odkazem – přelévá se mezi položkami */
.nav-glass {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0; z-index: 0;
  border-radius: 999px; pointer-events: none; opacity: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.42), rgba(255,255,255,.12));
  -webkit-backdrop-filter: saturate(160%) brightness(1.06);
          backdrop-filter: saturate(160%) brightness(1.06);
  box-shadow:
    inset 1.5px 1.5px 0 -.5px rgba(255,255,255,1),
    inset -1px -1px 0 -.5px rgba(255,255,255,.8),
    inset 0 0 0 .5px rgba(21,23,26,.05),
    inset 0 0 10px -3px rgba(255,255,255,.7),
    0 2px 6px -2px rgba(21,23,26,.12),
    0 6px 14px -8px rgba(21,23,26,.16);
  transition:
    transform .55s cubic-bezier(.3,1.45,.5,1),
    width .55s cubic-bezier(.3,1.45,.5,1),
    opacity .3s;
}
.nav-glass.on { opacity: 1; }

.bar-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.status-pill {
  display: flex; align-items: center; gap: 7px; white-space: nowrap;
  font-size: 13px; font-weight: 500; color: var(--accent-text);
  background: rgba(238,246,224,.62);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.8), inset 0 0 0 .5px rgba(63,99,16,.12);
  padding: 7px 12px; border-radius: 999px;
}
.blink-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--status-dot); animation: mkblink 1.6s infinite; }
.status-pill.busy { color: #7A4A0E; background: rgba(251,240,221,.7); box-shadow: inset 0 1px 1px rgba(255,255,255,.8), inset 0 0 0 .5px rgba(122,74,14,.14); }
.status-pill.busy .blink-dot { background: #D9912F; }

.lang-switch {
  position: relative; display: flex; padding: 3px; border-radius: 999px;
  background: rgba(21,23,26,.05);
  box-shadow: inset 0 1px 2px rgba(21,23,26,.08), inset 0 -1px 0 rgba(255,255,255,.6);
  font-family: var(--mono); font-size: 12px; font-weight: 600;
}
.lang-switch::before {
  content: ''; position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(255,255,255,.7));
  box-shadow: inset 0 1px 1px #fff, 0 1px 3px rgba(21,23,26,.12), 0 4px 10px -4px rgba(21,23,26,.18);
  transition: transform .5s cubic-bezier(.3,1.45,.5,1);
}
html[lang="en"] .lang-switch::before { transform: translateX(100%); }
.lang-switch button {
  position: relative; border: 0; padding: 6px 10px; border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--ink); font: inherit;
}

@media (max-width: 680px) {
  .bar { padding: 8px 8px 4px 14px; row-gap: 4px; border-radius: 26px; }
  .nav {
    order: 3; flex-basis: 100%; justify-content: flex-start; margin: 0 -8px 0 -14px; padding: 0 8px;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 24px), transparent);
            mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 24px), transparent);
  }
}
@media (max-width: 440px) {
  .status-pill { padding: 9px; }
  .status-pill > span:last-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}

.scroll-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; pointer-events: none; }
.scroll-progress span {
  display: block; height: 100%; width: 100%; background: var(--accent);
  transform: scaleX(0); transform-origin: left; box-shadow: 0 0 8px var(--accent);
}

/* --------------------------------------------------------------------------
   Sections – common
   -------------------------------------------------------------------------- */
.section { max-width: 1200px; margin: 0 auto; padding: 88px 20px; scroll-margin-top: 100px; }
.section-head { display: flex; flex-direction: column; gap: 12px; margin-bottom: 40px; }
.section-label {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 12px; color: var(--muted); letter-spacing: .04em;
}
.section-label.on-dark { color: var(--muted-dark-2); letter-spacing: 0; }
h2 { margin: 0; font-size: clamp(34px, 4.6vw, 56px); font-weight: 700; letter-spacing: -.035em; line-height: 1; }
.mono-label { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.mono-label.on-dark { color: var(--muted-dark-2); margin-bottom: 6px; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 24px; box-shadow: var(--shadow-card);
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero { padding: 64px 20px 40px; }
.hero-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
  gap: 48px; align-items: center;
}
.hero-copy { display: flex; flex-direction: column; gap: 28px; min-width: 0; }
.tag-pill {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 12px; color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--border); padding: 7px 12px; border-radius: 999px;
}

.name-wrap { position: relative; padding-top: 36px; container-type: inline-size; }
.name {
  position: relative; display: inline-block; margin: 0;
  font-weight: 800; font-size: clamp(44px, 19cqw, 150px); line-height: .92; letter-spacing: -.05em;
}
.name-layer { display: block; padding-top: .2em; color: transparent; }
.name-outline { -webkit-text-stroke: 1px #CDD1C6; }
.name-ink, .name-hot { position: absolute; inset: 0; clip-path: inset(100% 0 0 0); }
.name-ink {
  background: repeating-linear-gradient(to bottom, #15171A 0 5px, #2E322D 5px 6px);
  -webkit-background-clip: text; background-clip: text;
}
.name-hot { color: var(--accent); text-shadow: 0 0 18px rgba(154,208,69,.55); }

.nozzle { position: absolute; left: 0; top: 0; width: 44px; height: 64px; pointer-events: none; will-change: transform; }
.nozzle-head {
  position: absolute; left: 0; top: 0; width: 44px; height: 32px; background: var(--ink); border-radius: 9px;
  display: grid; place-items: center; box-shadow: 0 6px 16px -6px rgba(21,23,26,.5);
}
.nozzle-led { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.nozzle.idle .nozzle-led { animation: mkblink 1.6s infinite; }
.nozzle-block { position: absolute; left: 12px; top: 32px; width: 20px; height: 12px; background: #3A3E39; border-radius: 0 0 3px 3px; }
.nozzle-tip {
  position: absolute; left: 14px; top: 44px; width: 0; height: 0;
  border-left: 8px solid transparent; border-right: 8px solid transparent; border-top: 18px solid #B8BDB0;
}
.nozzle-drip {
  position: absolute; left: 19px; top: 59px; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 10px 2px rgba(154,208,69,.7);
  transition: opacity .3s;
}
.nozzle.idle .nozzle-drip { opacity: 0; }

.lead { margin: 0; font-size: clamp(18px, 1.6vw, 21px); line-height: 1.55; color: var(--ink-2); max-width: 540px; text-wrap: pretty; }

.progress-row {
  display: flex; align-items: center; gap: 12px; max-width: 540px;
  font-family: var(--mono); font-size: 12px; color: var(--muted);
}
.progress-row #print-status { white-space: nowrap; }
.progress-track { flex: 1; height: 4px; background: var(--border); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--accent); border-radius: 99px; }
.progress-pct { font-weight: 600; color: var(--ink); min-width: 38px; text-align: right; font-variant-numeric: tabular-nums; }

.cta-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 22px; font-size: 15px; font-weight: 600; border-radius: 14px;
  transition: background .2s, border-color .2s, transform .2s var(--ease-out), box-shadow .2s;
}
.btn:active { transform: translateY(1px) scale(.98); }
.btn-primary { background: var(--ink); color: #fff; box-shadow: 0 8px 20px -10px rgba(21,23,26,.6); }
.btn-primary:hover { background: #2A2E29; color: #fff; }
.btn-secondary { background: var(--surface); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--accent); color: var(--ink); }
.arrow { display: inline-block; transition: transform .25s var(--ease-out); }
.btn:hover .arrow, .btn-email:hover .arrow { transform: translateX(4px); }
.btn-text {
  padding: 10px 12px; background: transparent; border: 0; font-family: var(--mono); font-size: 12px;
  color: var(--muted); cursor: pointer; border-radius: 10px; transition: background .15s, color .15s;
}
.btn-text:hover { background: #ECEEE8; color: var(--ink); }
.spin-icon { display: inline-block; transition: transform .5s var(--ease-out); }
.btn-text:hover .spin-icon { transform: rotate(-180deg); }

/* --px/--py (kurzor, -0.5..0.5) a --hv (síla hoveru, 0..1) nastavuje initTilt() v main.js */
.hero-photo { --px: 0; --py: 0; --hv: 0; position: relative; min-width: 0; width: 100%; max-width: 460px; justify-self: center; }
.portrait {
  position: relative; aspect-ratio: 4 / 5; border-radius: 28px; overflow: hidden; background: #E9ECE4;
  box-shadow: 0 30px 60px -30px rgba(21,23,26,.35);
  transform: perspective(900px) rotateX(calc(var(--py) * -12deg)) rotateY(calc(var(--px) * 12deg));
  will-change: transform;
}
/* fotka uvnitř rámu lehce přiblíží a posune proti náklonu → hloubka */
.portrait img {
  width: 100%; height: 100%; object-fit: cover;
  transform: translate(calc(var(--px) * -14px), calc(var(--py) * -14px)) scale(calc(1 + var(--hv) * .06));
}
/* odlesk světla pod kurzorem */
.portrait::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(55% 45% at calc(50% + var(--px) * 100%) calc(50% + var(--py) * 100%), rgba(255,255,255,.55), transparent 70%);
  mix-blend-mode: soft-light;
  opacity: var(--hv);
}
.chip { position: absolute; z-index: 2; }
/* štítky „plavou“ před fotkou, proto se s kurzorem posunou víc než ona */
.chip-tool   { transform: translate(calc(var(--px) * 16px), calc(var(--py) * 12px)); }
.chip-region { transform: translate(calc(var(--px) * 22px), calc(var(--py) * 14px)); }
.chip-tool {
  left: -14px; bottom: 28px; display: flex; align-items: center; gap: 10px; padding: 10px 14px 10px 10px;
  background: rgba(255,255,255,.9); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid rgba(21,23,26,.06); border-radius: 16px; box-shadow: 0 12px 30px -14px rgba(21,23,26,.35);
  animation: float 6s ease-in-out infinite;
}
.chip-3d {
  width: 34px; height: 34px; border-radius: 10px; background: var(--accent);
  display: grid; place-items: center; font-family: var(--mono); font-size: 11px; font-weight: 600;
}
.chip-text { display: flex; flex-direction: column; }
.chip-text b { font-size: 14px; }
.chip-text span { font-size: 12px; color: var(--muted); }
.chip-region {
  right: -10px; top: 24px; padding: 8px 12px; background: var(--ink); color: #fff; border-radius: 12px;
  font-family: var(--mono); font-size: 12px; display: flex; align-items: center; gap: 8px;
  animation: float 6s ease-in-out -3s infinite;
}
@keyframes float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -6px; } }
@media (max-width: 520px) {
  .chip-tool { left: 8px; }
  .chip-region { right: 8px; }
}

/* Placeholder pro chybějící fotky */
.ph {
  position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 10px;
  text-align: center; padding: 20px;
  background:
    repeating-linear-gradient(135deg, rgba(21,23,26,.035) 0 10px, transparent 10px 20px),
    #E9ECE4;
  color: var(--muted); font-family: var(--mono); font-size: 12px;
}
.ph svg { width: 44px; height: 44px; opacity: .55; }

/* --------------------------------------------------------------------------
   About
   -------------------------------------------------------------------------- */
.about-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
  gap: 48px; align-items: start;
}
.about-text { margin: 0; font-size: clamp(21px, 2.3vw, 28px); line-height: 1.45; letter-spacing: -.015em; text-wrap: pretty; }
.process { display: flex; flex-direction: column; gap: 14px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 12px; }
.step { padding: 22px; display: flex; flex-direction: column; gap: 10px; position: relative; overflow: hidden; }
.badge {
  align-self: flex-start; font-family: var(--mono); font-size: 12px; font-weight: 600;
  color: var(--accent-text); background: var(--accent-soft); padding: 4px 9px; border-radius: 8px;
}
.card-title { font-size: 19px; font-weight: 600; letter-spacing: -.01em; }
.card-text { font-size: 15px; line-height: 1.5; color: var(--muted); text-wrap: pretty; }

/* --------------------------------------------------------------------------
   Services + 3D viewport
   -------------------------------------------------------------------------- */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 16px; }
.viewport {
  position: relative; background: var(--ink); border-radius: 24px; overflow: hidden; min-height: 440px; min-width: 0;
  background-image: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1px);
  background-size: 18px 18px;
}
.viewport canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: pan-y; }
.viewport canvas.dragging { cursor: grabbing; }
.vp-top {
  position: absolute; left: 16px; right: 16px; top: 16px; display: flex; justify-content: space-between; gap: 12px;
  pointer-events: none; font-family: var(--mono); font-size: 11px;
}
.vp-file { color: #fff; background: rgba(255,255,255,.08); padding: 6px 10px; border-radius: 8px; }
.vp-rot { color: var(--muted-dark); padding: 6px 0; font-variant-numeric: tabular-nums; }
.vp-bottom {
  position: absolute; left: 16px; right: 16px; bottom: 16px; display: flex; justify-content: space-between;
  align-items: flex-end; gap: 12px; flex-wrap: wrap; pointer-events: none;
  font-family: var(--mono); font-size: 11px;
}
.vp-models { display: flex; gap: 4px; padding: 3px; background: rgba(255,255,255,.06); border-radius: 10px; pointer-events: auto; }
.vp-models button {
  border: 0; background: transparent; color: var(--muted-dark-2); font-family: var(--mono); font-size: 11px;
  padding: 6px 10px; border-radius: 7px; cursor: pointer; transition: background .15s, color .15s;
}
.vp-models button:hover { color: #fff; background: rgba(255,255,255,.06); }
.vp-models button[aria-pressed="true"] { background: var(--accent); color: var(--ink); font-weight: 600; }
.vp-hint { color: var(--muted-dark-2); padding: 6px 0; transition: opacity .4s; }
.viewport.touched .vp-hint { opacity: 0; }

.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 12px; min-width: 0; }
.skill { padding: 24px; display: flex; flex-direction: column; gap: 10px; transition: border-color .2s, transform .25s var(--ease-out); }
.skill:hover { border-color: var(--accent); transform: translateY(-2px); }
.check {
  width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-text);
  display: grid; place-items: center; font-size: 16px; font-weight: 700;
  transition: background .2s, color .2s, transform .3s var(--ease-out);
}
.skill:hover .check { background: var(--accent); color: var(--ink); transform: rotate(-8deg); }

/* --------------------------------------------------------------------------
   Projects
   -------------------------------------------------------------------------- */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: 16px; }
.project { padding: 10px; display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s; }
.project:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.project-media {
  position: relative; aspect-ratio: 4 / 3; border-radius: 16px; overflow: hidden; background: var(--divider);
  border: 0; padding: 0; width: 100%; display: block;
}
button.project-media { cursor: zoom-in; }
.project-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease-out); }
.project:hover .project-media img { transform: scale(1.04); }
.project-code {
  position: absolute; left: 10px; top: 10px; z-index: 1; font-family: var(--mono); font-size: 11px;
  background: rgba(255,255,255,.9); padding: 5px 9px; border-radius: 8px; pointer-events: none; color: var(--ink);
}
.project-body { padding: 16px 10px 12px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.project-body h3 { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: -.01em; }
.project-body p { margin: 0; }

/* --------------------------------------------------------------------------
   Gear
   -------------------------------------------------------------------------- */
.gear-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 16px; }
.gear-card { padding: 8px 24px 12px; }
.gear-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 16px 0; }
.gear-head .tag {
  font-family: var(--mono); font-size: 11px; color: var(--accent-text); background: var(--accent-soft);
  padding: 4px 9px; border-radius: 8px;
}
.kv { display: flex; justify-content: space-between; gap: 16px; padding: 13px 0; border-top: 1px solid var(--divider); font-size: 15px; }
.kv span:first-child { color: var(--muted); }
.kv span:last-child { font-weight: 600; text-align: right; }
.kv .tbd { color: var(--muted-dark); font-weight: 500; font-style: italic; }

/* --------------------------------------------------------------------------
   Contact
   -------------------------------------------------------------------------- */
.section-contact { padding-bottom: 40px; }
.contact-panel {
  --mx: 80%; --my: 0%;
  position: relative; overflow: hidden;
  background: var(--ink); color: #fff; border-radius: 32px;
  padding: clamp(28px, 5vw, 64px);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 40px;
}
.contact-glow {
  position: absolute; right: -120px; top: -120px; width: 360px; height: 360px; border-radius: 50%;
  background: radial-gradient(circle, rgba(154,208,69,.28), transparent 70%); pointer-events: none;
}
.contact-cursor-glow {
  position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .4s;
  background: radial-gradient(420px circle at var(--mx) var(--my), rgba(154,208,69,.12), transparent 60%);
}
.contact-panel:hover .contact-cursor-glow { opacity: 1; }
.contact-main { position: relative; display: flex; flex-direction: column; gap: 24px; }
.contact-lead { margin: 0; font-size: clamp(28px, 3.4vw, 44px); line-height: 1.1; font-weight: 700; letter-spacing: -.035em; text-wrap: pretty; }
.email-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn-email {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 16px 24px; background: var(--accent); border-radius: 14px; font-size: 17px; font-weight: 600; color: var(--ink);
  transition: background .2s, transform .2s var(--ease-out); word-break: break-all;
}
.btn-email:hover { background: var(--accent-hover); color: var(--ink); }
.btn-copy {
  display: inline-flex; align-items: center; gap: 6px; padding: 16px 16px; border-radius: 14px; cursor: pointer;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); color: var(--muted-dark-2);
  font-family: var(--mono); font-size: 12px; transition: background .2s, color .2s, border-color .2s;
}
.btn-copy:hover { background: rgba(154,208,69,.14); border-color: rgba(154,208,69,.4); color: #fff; }
.contact-links { position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; }
.links-list { display: flex; flex-direction: column; gap: 8px; }
.link-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-radius: 16px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); color: #fff;
  transition: background .2s, border-color .2s;
}
.link-row:hover { background: rgba(154,208,69,.14); border-color: rgba(154,208,69,.4); color: #fff; }
.link-row .name { font-size: 18px; font-weight: 600; }
.link-row .handle { font-family: var(--mono); font-size: 13px; color: var(--muted-dark-2); }
.link-row .handle i { font-style: normal; display: inline-block; transition: transform .25s var(--ease-out); }
.link-row:hover .handle i { transform: translate(3px, -3px); color: var(--accent); }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  max-width: 1200px; margin: 0 auto; padding: 24px 20px 40px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted);
}
.footer-right { display: flex; gap: 20px; flex-wrap: wrap; }
.to-top { color: var(--muted); }
.to-top:hover { color: var(--accent-text); }

/* --------------------------------------------------------------------------
   Toast + lightbox
   -------------------------------------------------------------------------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 50;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14px; font-weight: 500;
  box-shadow: 0 16px 40px -16px rgba(21,23,26,.6);
  transition: opacity .25s, transform .35s var(--ease-out);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.lightbox {
  border: 0; padding: 0; background: transparent; max-width: min(1100px, 94vw); max-height: 92vh; overflow: visible;
}
.lightbox::backdrop { background: rgba(21,23,26,.82); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.lightbox[open] { animation: lbIn .3s var(--ease-out); }
@keyframes lbIn { from { opacity: 0; transform: scale(.96); } }
.lightbox img { max-width: 100%; max-height: 80vh; border-radius: 18px; margin: 0 auto; }
.lightbox-caption { color: #fff; text-align: center; padding: 14px 8px 0; font-size: 15px; }
.lightbox-close {
  position: absolute; right: -8px; top: -48px; width: 40px; height: 40px; border-radius: 12px; border: 0; cursor: pointer;
  background: rgba(255,255,255,.12); color: #fff; font-size: 16px;
}
.lightbox-close:hover { background: var(--accent); color: var(--ink); }

/* --------------------------------------------------------------------------
   Reveal animace – prvky se „vytisknou“ po vrstvách zdola nahoru
   -------------------------------------------------------------------------- */
.js .reveal:not(.in), .js .reveal-fade:not(.in) { opacity: 0; }
.js .reveal-fade.in { animation: fadeUp .8s var(--ease-out) var(--d, 0s) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* Tisk: plynule odkrýváme zdola nahoru (--pd = délka podle výšky prvku, viz main.js),
   po horní hraně jede „tryska“ – zelená linka s dohasínající teplou stopou –
   a přes celý prvek jsou vidět vrstvy, které po dotištění zmizí (vychladnou). */
.js .reveal { --pd: 1.1s; --print-ease: cubic-bezier(.35,.1,.25,1); position: relative; }
.js .reveal.in:not(.settled) {
  animation: printIn var(--pd) var(--print-ease) var(--d, 0s) both;
}
.js .reveal.in:not(.settled)::before,
.js .reveal.in:not(.settled)::after {
  content: ''; position: absolute; left: 0; right: 0; pointer-events: none; z-index: 5;
}
/* tryska + teplá, čerstvě nanesená vrstva pod ní */
.js .reveal.in:not(.settled)::before {
  height: 56px;
  background:
    linear-gradient(to bottom, var(--accent) 0 2px, rgba(154,208,69,.28) 2px, rgba(154,208,69,0) 100%),
    repeating-linear-gradient(to bottom, rgba(154,208,69,.35) 0 1px, transparent 1px 4px);
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent);
          mask-image: linear-gradient(to bottom, #000, transparent);
  filter: drop-shadow(0 0 6px rgba(154,208,69,.7));
  animation: nozzle var(--pd) var(--print-ease) var(--d, 0s) both;
}
/* vrstvy přes celý díl, po dotištění vychladnou */
.js .reveal.in:not(.settled)::after {
  top: 0; bottom: 0; border-radius: inherit;
  background: repeating-linear-gradient(to bottom, rgba(21,23,26,.07) 0 1px, transparent 1px 4px);
  animation: layerCool calc(var(--pd) + .7s) ease-out var(--d, 0s) both;
}
.js .viewport.reveal.in:not(.settled)::after,
.js .contact-panel.reveal.in:not(.settled)::after {
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,.07) 0 1px, transparent 1px 4px);
}
@keyframes printIn {
  from { opacity: 1; clip-path: inset(100% -60px -60px -60px); }
  to   { opacity: 1; clip-path: inset(0 -60px -60px -60px); }
}
@keyframes nozzle {
  0%   { top: 100%; opacity: 0; }
  6%   { opacity: 1; }
  88%  { opacity: 1; }
  100% { top: 0; opacity: 0; }
}
@keyframes layerCool {
  0%, 55% { opacity: 1; }
  100%    { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .js .reveal:not(.in), .js .reveal-fade:not(.in) { opacity: 1; }
  .js .reveal::before, .js .reveal::after { display: none !important; }
}

/* --------------------------------------------------------------------------
   Pozadí za matným sklem (js/bg3d.js)
   Díly v „komoře tiskárny“ ve třech hloubkách – čím dál od skla,
   tím víc rozmazané. Přes všechno matné plexi se zrnem.
   -------------------------------------------------------------------------- */
.bg3d, .frost { position: fixed; inset: 0; pointer-events: none; }
.bg3d { z-index: -2; width: 100vw; height: 100vh; opacity: 0; transition: opacity 1.2s var(--ease-out); }
.bg3d-far  { filter: blur(22px) saturate(.9); }
.bg3d-mid  { filter: blur(11px); }
.bg3d-near { filter: blur(2.5px); }
.has-bg3d .bg3d-far { opacity: .8; }
.has-bg3d .bg3d-mid, .has-bg3d .bg3d-near { opacity: 1; }
.frost {
  z-index: -1;
  display: none;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    linear-gradient(180deg, rgba(245,246,242,.34), rgba(245,246,242,.48));
}
.has-bg3d .frost { display: block; }
