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

:root {
  --dark: #1e2a3a;
  --dark-soft: #2d3f55;
  --orange: #f5a623;
  --orange-dark: #b8740a;
  --orange-hover: #e8970f;
  --sq: #808080;
  --ink: #1a2230;
  --text: #2b3543;
  --text-soft: #5b6573;
  --text-faint: #8a929e;
  --bg: #ffffff;
  --bg-alt: #f6f7f9;
  --border: #e6e8ec;
  --radius: 12px;
  --maxw: 1080px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 2rem; }

h1, h2, h3 { font-family: 'Oswald', sans-serif; font-weight: 600; letter-spacing: -0.3px; color: var(--ink); }

a { color: inherit; text-decoration: none; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---------- Logo ---------- */
.logo {
  font-family: 'Oswald', sans-serif; font-weight: 700; letter-spacing: -0.5px;
  font-size: 24px; line-height: 1; display: inline-flex; align-items: baseline;
}
.logo .rs { color: #fff; }
.logo .com { color: var(--orange); }
.logo .sq { display: inline-block; width: 8px; height: 8px; background: var(--sq); border-radius: 2px; margin: 0 4px; align-self: flex-end; margin-bottom: 2px; }

/* ---------- Navigace ---------- */
.nav {
  background: var(--dark); position: sticky; top: 0; z-index: 50;
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 1.1rem 2rem;
  display: flex; justify-content: space-between; align-items: center;
}
.nav-links { display: flex; gap: 2rem; }
.nav-links a {
  font-size: 14px; color: rgba(255,255,255,0.72); transition: color .15s;
}
.nav-links a:hover, .nav-links a:focus-visible { color: var(--orange); }
.nav-toggle { display: none; background: none; border: 0; color: #fff; font-size: 24px; cursor: pointer; }

/* ---------- Hero ---------- */
.hero { position: relative; background: var(--dark); overflow: hidden; }
.hero-code {
  position: absolute; top: 0; right: 0; bottom: 0; width: 55%;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px; line-height: 1.8; color: #fff; opacity: 0.13;
  white-space: pre; padding: 2rem; pointer-events: none; user-select: none;
  overflow: hidden; transform: scaleX(-1); transform-origin: center;
}
.hero-inner { position: relative; z-index: 2; max-width: 760px; padding: 6rem 0 5.5rem; }
.eyebrow {
  font-size: 12px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--orange); margin-bottom: 1.4rem; font-weight: 600;
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
}
.hero h1 { font-size: clamp(36px, 6vw, 54px); line-height: 1.08; color: #fff; margin-bottom: 1.5rem; }
.hero h1 em { font-style: normal; color: var(--orange); }
.hero p { font-size: clamp(16px, 2.4vw, 18px); color: rgba(255,255,255,0.78); max-width: 580px; margin-bottom: 2.2rem; }

.actions { display: flex; gap: 14px; flex-wrap: wrap; }
.btn {
  font-family: 'Inter', sans-serif; font-size: 15px; font-weight: 500;
  padding: 0.8rem 1.7rem; border-radius: 8px; cursor: pointer; border: none;
  display: inline-flex; align-items: center; gap: 8px; transition: all .14s;
}
.btn-p { background: var(--orange); color: #3a2200; }
.btn-p:hover, .btn-p:focus-visible { background: var(--orange-hover); }
.btn-s { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,0.35); }
.btn-s:hover, .btn-s:focus-visible { border-color: var(--orange); color: var(--orange); }
.btn-dark { background: var(--dark); color: #fff; }
.btn-dark:hover, .btn-dark:focus-visible { background: var(--dark-soft); }

/* ---------- Sekce ---------- */
section { padding: 4.5rem 0; }
.kicker {
  font-family: 'Oswald', sans-serif; font-size: 13px; letter-spacing: 2px;
  color: var(--orange-dark); font-weight: 600; margin-bottom: 0.6rem;
}
.sec-head h2 { font-size: clamp(26px, 4vw, 34px); margin-bottom: 0.6rem; }
.sec-head h2 em { font-style: normal; color: var(--orange-dark); }
.lede { font-size: 16px; color: var(--text-soft); max-width: 600px; margin-bottom: 2.5rem; }

.alt { background: var(--bg-alt); }

/* ---------- Služby ---------- */
.services {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1px; background: var(--border);
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.svc { background: var(--bg); padding: 1.8rem 1.6rem; transition: background .15s; }
.alt .svc { background: var(--bg-alt); }
.svc:hover { background: #fafbfc; }
.alt .svc:hover { background: #fff; }
.svc-ic {
  width: 46px; height: 46px; border-radius: 11px;
  background: rgba(30,42,58,0.06); display: flex; align-items: center; justify-content: center;
  margin-bottom: 1rem; font-size: 22px;
}
.svc:first-child .svc-ic { background: rgba(245,166,35,0.14); }
.svc h3 { font-size: 18px; font-weight: 500; margin-bottom: 0.5rem; }
.svc p { font-size: 14px; color: var(--text-soft); line-height: 1.55; }

/* ---------- O mně ---------- */
.about { display: grid; grid-template-columns: 1.4fr 1fr; gap: 3rem; align-items: start; }
.about p { font-size: 16px; line-height: 1.75; color: var(--text-soft); margin-bottom: 1.1rem; }
.about p strong { color: var(--ink); font-weight: 600; }
.timeline { border-left: 2px solid var(--border); padding-left: 1.5rem; display: flex; flex-direction: column; gap: 1.4rem; }
.tl-item { position: relative; }
.tl-item::before {
  content: ''; position: absolute; left: calc(-1.5rem - 6px); top: 6px;
  width: 9px; height: 9px; border-radius: 2px; background: var(--orange);
}
.tl-item .yr { font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 15px; color: var(--ink); }
.tl-item .desc { font-size: 14px; color: var(--text-soft); line-height: 1.5; }

/* ---------- Technologie ---------- */
.skills { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Jak pracuju ---------- */
.principles { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 2rem; }
.principle { position: relative; padding-top: 0.5rem; }
.p-num {
  font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 40px;
  color: var(--orange); opacity: 0.85; display: block; margin-bottom: 0.6rem; line-height: 1;
}
.principle h3 { font-size: 19px; font-weight: 500; margin-bottom: 0.5rem; }
.principle p { font-size: 15px; color: var(--text-soft); line-height: 1.6; }
.tag {
  font-family: 'Oswald', sans-serif; font-weight: 500; font-size: 15px; letter-spacing: 0.3px;
  padding: 9px 18px; border-radius: 8px; background: var(--bg);
  border: 1px solid var(--border); color: var(--ink);
}
.alt .tag { background: #fff; }
.tag.o { color: var(--orange-dark); border-color: rgba(245,166,35,0.45); }

/* ---------- Kontakt / patička ---------- */
.footer { background: var(--dark); padding: 3rem 0 1.8rem; position: relative; overflow: hidden; }
.footer-code {
  position: absolute; top: 0; left: 0; bottom: 0; width: 50%;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px; line-height: 1.8; color: #fff; opacity: 0.07;
  white-space: pre; padding: 2rem; pointer-events: none; user-select: none;
  overflow: hidden;
}
.footer .wrap { position: relative; z-index: 2; }
.footer-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  flex-wrap: wrap; gap: 2rem; margin-bottom: 2.2rem;
}
.footer-tag { font-size: 14px; color: rgba(255,255,255,0.6); max-width: 320px; line-height: 1.6; margin-top: 0.9rem; }
.footer h2 { color: #fff; font-size: 24px; margin-bottom: 0.5rem; }
.footer .contact-lead { color: rgba(255,255,255,0.7); font-size: 15px; margin-bottom: 1.2rem; }
.footer-links { display: flex; flex-direction: column; gap: 0.6rem; }
.footer-links a { font-size: 14px; color: rgba(255,255,255,0.72); transition: color .15s; }
.footer-links a:hover, .footer-links a:focus-visible { color: var(--orange); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12); padding-top: 1.2rem;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}
.footer-bottom span { font-size: 13px; color: rgba(255,255,255,0.45); }

/* ---------- Kontaktní formulář ---------- */
.contact-form { display: flex; flex-direction: column; gap: 0.8rem; max-width: 420px; margin-top: 0.3rem; }
.form-row { display: flex; gap: 0.8rem; flex-wrap: wrap; }
.form-row .field { flex: 1; min-width: 140px; }
.field { display: flex; flex-direction: column; }
.field label {
  font-size: 12px; color: rgba(255,255,255,0.55); margin-bottom: 0.3rem;
  letter-spacing: 0.3px;
}
.field input, .field textarea {
  font-family: 'Inter', sans-serif; font-size: 14px; color: #fff;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px; padding: 0.65rem 0.85rem; width: 100%; resize: vertical;
  transition: border-color .15s, background .15s;
}
.field input::placeholder, .field textarea::placeholder { color: rgba(255,255,255,0.35); }
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--orange); background: rgba(255,255,255,0.09);
}
.form-note { font-size: 12px; color: rgba(255,255,255,0.45); margin-top: 0.2rem; }
.form-note a { color: var(--orange); }
.kontakt-odkaz { color: var(--orange); white-space: nowrap; }
.cf-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Reference ---------- */
.ref-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}
.ref-card {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.ref-card:hover, .ref-card:focus-within {
  border-color: rgba(245,166,35,0.5);
  box-shadow: 0 8px 24px rgba(30,42,58,0.1); transform: translateY(-3px);
}
/* Náhled — vyšší část karty */
.ref-thumb {
  position: relative; aspect-ratio: 4 / 3; background: var(--bg-alt);
  overflow: hidden;
}
.ref-thumb img {
  width: 100%; height: 100%; object-fit: cover; object-position: top center;
  display: block; transition: transform .3s;
}
.ref-card:hover .ref-thumb img { transform: scale(1.04); }
.ref-badge {
  align-self: flex-start; margin-top: 0.2rem;
  font-family: 'Oswald', sans-serif; font-weight: 500;
  font-size: 12px; letter-spacing: 0.5px; text-transform: uppercase;
  padding: 4px 11px; border-radius: 6px; line-height: 1.4;
}
.ref-badge.eshop { background: rgba(245,166,35,0.92); color: #3a2200; }
.ref-badge.web { background: rgba(30,42,58,0.9); color: #fff; }
.ref-badge.kalk { background: rgba(45,63,85,0.9); color: #fff; }
.ref-badge.app { background: rgba(128,128,128,0.92); color: #fff; }
/* Textová část — dolní 1/3 */
.ref-body {
  padding: 1.1rem 1.3rem 1.3rem; display: flex; flex-direction: column; gap: 0.4rem;
}
.ref-body h3 { font-size: 18px; font-weight: 500; }
.ref-link {
  font-size: 14px; color: var(--orange-dark); word-break: break-all;
  transition: color .15s;
}
.ref-link:hover, .ref-link:focus-visible { color: var(--orange); }
.ref-private { font-size: 14px; color: var(--text-faint); }

/* ---------- Skok nahoru ---------- */
.to-top {
  position: fixed; right: 1.6rem; bottom: 1.6rem; z-index: 60;
  width: 46px; height: 46px; border-radius: 12px; border: none; cursor: pointer;
  background: var(--orange); color: #3a2200;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(30,42,58,0.25);
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity .2s, transform .2s, visibility .2s, background .15s;
}
.to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top:hover, .to-top:focus-visible { background: var(--orange-hover); }
.to-top:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* ---------- Hláška po odeslání (toast) ---------- */
.cf-hlaska {
  margin-top: 0.6rem; padding: 0.7rem 1rem; border-radius: 8px;
  font-size: 14px; line-height: 1.45;
  max-height: 0; opacity: 0; overflow: hidden;
  transform: translateY(-6px);
  transition: opacity .25s, transform .25s, max-height .25s, padding .25s, margin .25s;
  padding-top: 0; padding-bottom: 0; margin-top: 0;
}
.cf-hlaska.show {
  max-height: 200px; opacity: 1; transform: translateY(0);
  padding-top: 0.7rem; padding-bottom: 0.7rem; margin-top: 0.6rem;
}
.cf-hlaska.ok { background: rgba(67,160,71,0.18); color: #b9f6ca; border: 1px solid rgba(67,160,71,0.4); }
.cf-hlaska.chyba { background: rgba(229,57,53,0.16); color: #ff8a80; border: 1px solid rgba(229,57,53,0.4); }

/* ---------- Responsivita ---------- */
@media (max-width: 980px) {
  .ref-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .nav-links { display: none; }
  .about { grid-template-columns: 1fr; gap: 2rem; }
  .hero-inner { padding: 4rem 0 3.5rem; }
  .eyebrow { font-size: 11px; letter-spacing: 1px; white-space: normal; }
}

@media (max-width: 480px) {
  .ref-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
