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

:root {
  --accent-a: #E07834;
  --accent-b: #4A8EC4;
  --bg: #0D0D0F;
  --surface: #141418;
  --text-primary: #F0EDE8;
  --text-muted: #888780;
  --border: rgba(255,255,255,0.07);
  --border-strong: rgba(255,255,255,0.12);
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Outfit', system-ui, sans-serif;
  --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 28px; }

/* Language */
.t-en { display: none; }
html.lang-en .t-pl { display: none; }
html.lang-en .t-en { display: inline; }

/* NAV */
#nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  background: rgba(13,13,15,0.78);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1100px; margin: 0 auto; padding: 0 28px;
  height: 60px; display: flex; align-items: center; justify-content: space-between;
}

.logo { text-decoration: none; display: flex; align-items: center; gap: 10px; }
.logo-name { font-weight: 600; font-size: 13px; letter-spacing: 0.18em; color: var(--text-primary); }
.logo-sep  { color: var(--accent-a); font-size: 14px; opacity: 0.7; }
.logo-sub  { font-size: 12px; font-weight: 300; color: var(--text-muted); }

.nav-right { display: flex; align-items: center; gap: 16px; }

.lang-switch { display: flex; align-items: center; gap: 2px; }

.lang-btn {
  background: none; border: none; cursor: pointer;
  font-family: var(--font-body); font-size: 11px; font-weight: 500;
  letter-spacing: 0.1em; color: var(--text-muted);
  padding: 4px 7px; border-radius: 3px;
  transition: color 0.2s, background 0.2s;
}
.lang-btn.active { color: var(--accent-a); background: rgba(224,120,52,0.09); }
.lang-btn:hover:not(.active) { color: var(--text-primary); }
.lang-div { color: var(--border-strong); font-size: 13px; pointer-events: none; }

.nav-link {
  font-size: 12.5px; color: var(--text-muted); text-decoration: none;
  padding: 8px 16px; border: 1px solid var(--border); border-radius: 3px;
  transition: color 0.2s, border-color 0.2s;
}
.nav-link:hover { color: var(--accent-a); border-color: rgba(224,120,52,0.35); }

/* HERO */
#hero {
  position: relative; min-height: 100vh;
  display: flex; align-items: center;
  padding: 130px 0 90px; overflow: hidden;
}

.hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(224,120,52,0.048) 1px, transparent 1px),
    linear-gradient(90deg, rgba(224,120,52,0.048) 1px, transparent 1px);
  background-size: 64px 64px;
  animation: gridDrift 28s linear infinite;
  mask-image: radial-gradient(ellipse 90% 80% at 50% 40%, black 25%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 90% 80% at 50% 40%, black 25%, transparent 78%);
}

@keyframes gridDrift {
  from { background-position: 0 0; }
  to   { background-position: 64px 64px; }
}

.hero-glow {
  position: absolute; top: 12%; left: -6%;
  width: 540px; height: 540px;
  background: radial-gradient(circle, rgba(224,120,52,0.052) 0%, transparent 68%);
  pointer-events: none;
}

.hero-layout {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1.05fr 0.95fr;
  gap: 72px; align-items: center;
}

.hero-left { max-width: 680px; }

.hero-tag {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent-b); margin-bottom: 22px;
}
.hero-tag::before {
  content: ''; display: block; width: 18px; height: 1px;
  background: var(--accent-b); opacity: 0.6;
}

.hero-left h1 {
  font-family: var(--font-display);
  font-size: clamp(36px, 4.8vw, 58px);
  line-height: 1.06; color: var(--text-primary);
  margin-bottom: 26px; font-weight: 700;
}
.hero-left h1 em { font-style: italic; color: var(--accent-a); font-weight: 300; }

.hero-lead {
  font-size: 15px; line-height: 1.85; color: var(--text-muted);
  font-weight: 300; max-width: 500px; margin-bottom: 44px;
}

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* Buttons */
.btn {
  font-family: var(--font-body); font-size: 13px; font-weight: 500;
  letter-spacing: 0.03em; padding: 12px 22px; border-radius: 3px;
  text-decoration: none; display: inline-flex; align-items: center;
  cursor: pointer; transition: all 0.2s ease;
  border: 1px solid transparent; white-space: nowrap;
}
.btn-outline {
  color: var(--text-muted); border-color: var(--border-strong); background: transparent;
}
.btn-outline:hover { color: var(--accent-a); border-color: rgba(224,120,52,0.5); background: rgba(224,120,52,0.04); }
.btn-filled { background: var(--accent-a); color: #fff; border-color: var(--accent-a); }
.btn-filled:hover { background: #e88944; border-color: #e88944; box-shadow: 0 4px 24px rgba(224,120,52,0.35); }
.btn-lg { padding: 15px 30px; font-size: 14px; }

/* Code block */
.hero-code-wrap { display: flex; justify-content: flex-end; }

.code-block {
  width: 100%; max-width: 430px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 8px; overflow: hidden;
  box-shadow: 0 32px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(224,120,52,0.06);
  animation: codeIn 0.8s ease 0.3s both;
}

@keyframes codeIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.code-titlebar {
  display: flex; align-items: center; gap: 6px;
  padding: 11px 14px; border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}
.dot { width: 11px; height: 11px; border-radius: 50%; }
.dot-r { background: #ff5f57; } .dot-y { background: #febc2e; } .dot-g { background: #28c840; }

.code-filename {
  margin-left: 8px; font-size: 11px; font-family: var(--font-mono);
  color: var(--text-muted); opacity: 0.7;
}

.code-body {
  padding: 22px 24px 26px;
  font-family: var(--font-mono); font-size: 12px; line-height: 1.75; min-height: 300px;
}

#hero-code { display: block; white-space: pre; color: var(--accent-b); }
#hero-code .k { color: #E07834; }
#hero-code .s { color: #e4a44a; }
#hero-code .c { color: var(--text-muted); opacity: 0.6; font-style: italic; }
#hero-code .v { color: #F0EDE8; }

.cursor {
  display: inline-block; width: 7px; height: 13px;
  background: var(--accent-b); vertical-align: text-bottom;
  animation: blink 0.9s step-end infinite; margin-left: 1px;
}
@keyframes blink { 0%,100% { opacity:1; } 50% { opacity:0; } }

/* Sections */
.section { padding: 110px 0; }
.section-alt { background: var(--surface); }

.section-head { margin-bottom: 64px; }

.s-label {
  display: block; font-size: 10.5px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--accent-a);
  margin-bottom: 14px; font-weight: 500;
}

.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(26px, 3.6vw, 42px);
  color: var(--text-primary); line-height: 1.1;
  max-width: 620px; font-weight: 700;
}

/* Problem cards */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

.card {
  position: relative; z-index: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px; padding: 32px 28px;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
  will-change: transform;
}
.card:hover {
  z-index: 1; transform: translateY(-4px);
  border-color: rgba(224,120,52,0.45);
  box-shadow: 0 0 0 1px rgba(224,120,52,0.18), 0 20px 48px rgba(224,120,52,0.1);
}
.card-accent { width: 24px; height: 2px; background: var(--accent-a); margin-bottom: 20px; opacity: 0.65; }
.card h3 { font-size: 15px; font-weight: 600; color: var(--text-primary); margin-bottom: 10px; }
.card p { font-size: 13.5px; line-height: 1.85; color: var(--text-muted); font-weight: 300; }

/* Pillars */
.pillars { display: flex; flex-direction: column; }

.pillar {
  display: grid; grid-template-columns: 96px 1fr;
  gap: 36px; padding: 42px 0;
  border-bottom: 1px solid var(--border); align-items: start;
}
.pillar:last-child { border-bottom: none; }

.p-num {
  font-family: var(--font-display); font-size: 80px;
  line-height: 1; color: var(--text-primary);
  opacity: 0.07; letter-spacing: -0.03em;
  user-select: none; padding-top: 4px; font-weight: 700;
}

.p-body h3 {
  font-size: 16px; font-weight: 600; color: var(--text-primary);
  margin-bottom: 10px; margin-top: 12px;
}
.p-body p { font-size: 14px; line-height: 1.85; color: var(--text-muted); font-weight: 300; max-width: 620px; }

/* Case card */
.case-card {
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 10px; overflow: hidden;
}

.case-card-inner {
  display: grid; grid-template-columns: 1fr 1fr;
}

.case-card-text {
  padding: 44px 48px;
  border-right: 1px solid var(--border);
}

.case-badge {
  display: inline-flex; align-items: center;
  background: rgba(224,120,52,0.1);
  border: 1px solid rgba(224,120,52,0.22);
  border-radius: 3px; padding: 4px 10px;
  font-size: 10.5px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--accent-a);
  font-weight: 500; margin-bottom: 20px;
}

.case-card-text h3 {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 700; color: var(--text-primary);
  line-height: 1.15; margin-bottom: 10px;
}

.case-sub {
  font-size: 13.5px; color: var(--text-muted);
  font-weight: 300; margin-bottom: 24px; line-height: 1.7;
}

.case-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }

.chip {
  font-size: 11.5px; font-weight: 400; color: var(--accent-b);
  background: rgba(74,142,196,0.08);
  border: 1px solid rgba(74,142,196,0.22);
  border-radius: 3px; padding: 4px 10px;
}

.case-card-text > p {
  font-size: 13.5px; line-height: 1.9; color: var(--text-muted); font-weight: 300;
}

.case-card-diagram {
  padding: 44px 36px;
  display: flex; align-items: center; justify-content: center;
}
.case-card-diagram svg { width: 100%; max-width: 360px; height: auto; }

/* CTA */
#cta {
  padding: 110px 0;
  border-top: 1px solid var(--border);
  position: relative; overflow: hidden;
}
#cta::before {
  content: ''; position: absolute;
  top: 0; left: 50%; transform: translateX(-50%);
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(224,120,52,0.04) 0%, transparent 65%);
  pointer-events: none;
}

.cta-box {
  max-width: 540px; margin: 0 auto;
  text-align: center; position: relative;
}

.cta-box h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.8vw, 44px);
  line-height: 1.1; color: var(--text-primary);
  margin: 14px 0 18px; font-weight: 700;
}

.cta-sub {
  font-size: 14px; line-height: 1.85;
  color: var(--text-muted); font-weight: 300; margin-bottom: 48px;
}

.cta-phone-wrap {
  display: flex; flex-direction: column;
  align-items: center; gap: 8px; margin-bottom: 28px;
}

.cta-phone-label {
  font-size: 10.5px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--text-muted); font-weight: 400;
}

.cta-phone-number {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.5vw, 42px);
  font-weight: 700; color: var(--text-primary);
  text-decoration: none; letter-spacing: 0.02em;
  transition: color 0.2s;
}
.cta-phone-number:hover { color: var(--accent-a); }

/* Footer */
#footer { padding: 28px 0; border-top: 1px solid var(--border); }

.footer-inner { display: flex; align-items: center; justify-content: center; }

.footer-copy {
  font-size: 12px; color: var(--text-muted);
  opacity: 0.45; letter-spacing: 0.04em; font-weight: 300;
}

/* Scroll Reveal */
.reveal {
  opacity: 0; transform: translateY(22px);
  transition: opacity 0.65s ease, transform 0.65s ease;
  will-change: opacity, transform;
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-d1 { transition-delay: 0.08s; }
.reveal-d2 { transition-delay: 0.16s; }
.reveal-d3 { transition-delay: 0.24s; }

/* Hero entrance */
.hero-in { animation: heroIn 0.75s ease both; }
.hero-in-d1 { animation-delay: 0.1s; }
.hero-in-d2 { animation-delay: 0.22s; }
.hero-in-d3 { animation-delay: 0.38s; }
.hero-in-d4 { animation-delay: 0.5s; }
@keyframes heroIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 960px) {
  .hero-layout { grid-template-columns: 1fr; gap: 52px; }
  .hero-code-wrap { justify-content: flex-start; }
  .code-block { max-width: 100%; }
  .cards { grid-template-columns: 1fr; gap: 14px; }
  .pillar { grid-template-columns: 72px 1fr; gap: 24px; }
  .p-num { font-size: 60px; }
  .case-card-inner { grid-template-columns: 1fr; }
  .case-card-text { border-right: none; border-bottom: 1px solid var(--border); }
}

@media (max-width: 640px) {
  .hero-code-wrap { display: none; }
  .section { padding: 72px 0; }
  #hero { padding: 110px 0 72px; }
  .section-head { margin-bottom: 44px; }
  .pillar { grid-template-columns: 1fr; gap: 4px; padding: 32px 0; }
  .p-num { font-size: 40px; opacity: 0.05; }
  .case-card-text { padding: 32px 24px; }
  .case-card-diagram { padding: 28px 24px; }
}
