/* ============================================
   Paweł Kęska — Digital Consulting
   Dark / tech theme, blue accent from logo
   ============================================ */

:root, :root[data-theme="dark"] {
  --bg:        #0a0e1a;
  --bg-2:      #0c1120;
  --surface:   #121a2e;
  --surface-2: #16203a;
  --line:      rgba(255,255,255,.08);
  --line-str:  rgba(255,255,255,.14);

  --text:      #eef2fb;
  --muted:     #9aa4bd;
  --faint:     #6b7691;

  --blue:      #2e5bff;
  --blue-2:    #4d78ff;
  --blue-soft: rgba(46,91,255,.14);
  --glow:      rgba(46,91,255,.45);

  /* theme-dependent extras */
  --grid-line:    rgba(255,255,255,.025);
  --nav-bg:       rgba(10,14,26,.82);
  --drawer-bg:    rgba(10,14,26,.97);
  --title-g1:     #ffffff;
  --title-g2:     #b9c6ff;
  --card-grad-2:  rgba(18,26,46,.3);
  --diamond-soft: rgba(255,255,255,.06);
  --glow-a:       rgba(46,91,255,.16);
  --glow-b:       rgba(46,91,255,.08);
  --shadow:       rgba(0,0,0,.6);
  --photo-shadow: rgba(0,0,0,.7);

  --radius:    16px;
  --radius-sm: 10px;
  --maxw:      1140px;
  --nav-h:     92px;

  --ff-display: "Space Grotesk", system-ui, sans-serif;
  --ff-body:    "Inter", system-ui, -apple-system, sans-serif;

  --ease: cubic-bezier(.22,.61,.36,1);
}

:root[data-theme="light"] {
  --bg:        #f5f7fd;
  --bg-2:      #eef2fb;
  --surface:   #ffffff;
  --surface-2: #f2f5fd;
  --line:      rgba(15,23,48,.10);
  --line-str:  rgba(15,23,48,.16);

  --text:      #0f1730;
  --muted:     #55607a;
  --faint:     #8791a8;

  --blue:      #2e5bff;
  --blue-2:    #2e5bff;
  --blue-soft: rgba(46,91,255,.10);
  --glow:      rgba(46,91,255,.26);

  --grid-line:    rgba(15,23,48,.045);
  --nav-bg:       rgba(245,247,253,.82);
  --drawer-bg:    rgba(245,247,253,.98);
  --title-g1:     #0f1730;
  --title-g2:     #2e5bff;
  --card-grad-2:  rgba(46,91,255,.03);
  --diamond-soft: rgba(15,23,48,.06);
  --glow-a:       rgba(46,91,255,.10);
  --glow-b:       rgba(46,91,255,.05);
  --shadow:       rgba(20,30,60,.14);
  --photo-shadow: rgba(20,30,60,.22);
}

/* smooth theme transition */
.theme-anim body,
.theme-anim .nav, .theme-anim .nav.scrolled,
.theme-anim .footer,
.theme-anim .stat, .theme-anim .skill-card, .theme-anim .contact-btn,
.theme-anim .brands-list li {
  transition: background-color .3s var(--ease), border-color .3s var(--ease), color .3s var(--ease);
}

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 14px); }

body {
  font-family: var(--ff-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }

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

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.section { padding: clamp(72px, 11vw, 140px) 0; position: relative; }

h1, h2, h3 { font-family: var(--ff-display); font-weight: 600; line-height: 1.1; letter-spacing: -.01em; }

/* ---------- Animated background ---------- */
.bg-field { position: fixed; inset: 0; z-index: -2; overflow: hidden; pointer-events: none; }
.bg-field::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(900px 600px at 78% -8%, var(--glow-a), transparent 60%),
    radial-gradient(700px 500px at 0% 30%, var(--glow-b), transparent 60%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
}
.bg-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(1200px 900px at 60% 0%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(1200px 900px at 60% 0%, #000 20%, transparent 75%);
}
.bg-diamond {
  position: absolute; display: block;
  border: 1.5px solid rgba(46,91,255,.22);
  transform: rotate(45deg);
  border-radius: 6px;
  animation: float 16s var(--ease) infinite;
}
.bg-diamond.d1 { width: 260px; height: 260px; top: 8%;  right: -60px; animation-delay: 0s; }
.bg-diamond.d2 { width: 150px; height: 150px; top: 62%; left: -40px;  border-color: var(--diamond-soft); animation-delay: -5s; }
.bg-diamond.d3 { width: 90px;  height: 90px;  top: 40%; right: 12%;   border-color: rgba(46,91,255,.3); animation-delay: -9s; }

@keyframes float {
  0%,100% { transform: rotate(45deg) translateY(0); }
  50%     { transform: rotate(45deg) translateY(-26px); }
}

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  transition: background .3s var(--ease), border-color .3s, backdrop-filter .3s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: var(--nav-h); }

.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo { width: 48px; height: 48px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text strong { font-family: var(--ff-display); font-weight: 600; font-size: 1.12rem; letter-spacing: -.01em; }
.brand-text em { font-style: normal; font-size: .72rem; color: var(--faint); letter-spacing: .12em; text-transform: uppercase; }

.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links > a { font-size: .92rem; color: var(--muted); font-weight: 500; transition: color .2s; position: relative; }
.nav-links > a:hover { color: var(--text); }
.nav-links > a::after {
  content: ""; position: absolute; left: 0; bottom: -6px; width: 0; height: 2px;
  background: var(--blue); transition: width .25s var(--ease);
}
.nav-links > a:hover::after { width: 100%; }

.lang-switch { display: flex; align-items: center; gap: 6px; padding-left: 14px; border-left: 1px solid var(--line-str); }
.lang-switch button { background: none; border: none; color: var(--faint); font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; padding: 2px; transition: color .2s; }
.lang-switch button.active { color: var(--blue-2); }
.lang-switch button:hover { color: var(--text); }
.lang-switch span { color: var(--faint); font-size: .8rem; }

/* theme switch (sun / moon) */
.theme-switch { display: flex; align-items: center; gap: 4px; padding-left: 14px; margin-left: 4px; border-left: 1px solid var(--line-str); }
.theme-switch button {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 8px; background: none; border: none;
  color: var(--faint); cursor: pointer; transition: color .2s, background .2s;
}
.theme-switch button svg { width: 17px; height: 17px; display: block; }
.theme-switch button:hover { color: var(--text); background: var(--blue-soft); }
.theme-switch button.active { color: var(--blue-2); background: var(--blue-soft); }

/* logo variants per theme */
.logo-color { display: none; }
:root[data-theme="light"] .logo-white { display: none; }
:root[data-theme="light"] .logo-color { display: block; }

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-toggle span { width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .3s var(--ease), opacity .2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 28px; border-radius: 999px; font-weight: 600; font-size: .95rem;
  transition: transform .2s var(--ease), box-shadow .3s, background .25s, border-color .25s;
  border: 1px solid transparent; cursor: pointer;
}
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 8px 30px -8px var(--glow); }
.btn-primary:hover { background: var(--blue-2); transform: translateY(-2px); box-shadow: 0 14px 40px -8px var(--glow); }
.btn-ghost { border-color: var(--line-str); color: var(--text); }
.btn-ghost:hover { border-color: var(--blue); color: var(--blue-2); transform: translateY(-2px); }

/* ---------- Hero ---------- */
.hero { min-height: 100svh; display: flex; align-items: center; padding-top: calc(var(--nav-h) + 24px); position: relative; }
.hero-inner { display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center; width: 100%; }

.eyebrow, .section-eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--ff-display); font-size: .8rem; font-weight: 600;
  letter-spacing: .18em; text-transform: uppercase; color: var(--blue-2);
}
.eyebrow::before, .section-eyebrow::before {
  content: "◆"; font-size: .7rem; color: var(--blue);
}

.hero-title {
  font-size: clamp(3rem, 8vw, 5.6rem); margin: 18px 0 6px; letter-spacing: -.03em;
  background: linear-gradient(180deg, var(--title-g1) 30%, var(--title-g2) 130%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { font-family: var(--ff-display); font-size: clamp(1rem, 2vw, 1.25rem); color: var(--text); font-weight: 500; margin-bottom: 20px; }
.hero-lead { font-size: 1.08rem; color: var(--muted); max-width: 34em; margin-bottom: 34px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }

.hero-visual { position: relative; display: flex; justify-content: center; }
.hero-photo-frame { position: relative; width: min(360px, 78%); }
.hero-photo-frame::before {
  content: ""; position: absolute; inset: -18px; border-radius: 24px;
  background: linear-gradient(145deg, var(--blue), transparent 55%);
  opacity: .5; filter: blur(28px); z-index: -1;
}
.hero-photo {
  width: 100%; border-radius: 20px; border: 1px solid var(--line-str);
  box-shadow: 0 40px 80px -30px var(--photo-shadow);
}
.frame-diamond { position: absolute; border: 2px solid var(--blue); transform: rotate(45deg); border-radius: 4px; }
.fd1 { width: 60px; height: 60px; top: -26px; left: -26px; background: var(--bg); }
.fd2 { width: 34px; height: 34px; bottom: -14px; right: 34px; border-color: var(--blue-2); }

.scroll-hint { position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); width: 26px; height: 42px; border: 2px solid var(--line-str); border-radius: 14px; }
.scroll-hint span { position: absolute; top: 8px; left: 50%; width: 4px; height: 8px; background: var(--blue-2); border-radius: 2px; transform: translateX(-50%); animation: scrolldot 1.6s var(--ease) infinite; }
@keyframes scrolldot { 0% { opacity: 0; transform: translate(-50%, 0); } 40% { opacity: 1; } 80%,100% { opacity: 0; transform: translate(-50%, 14px); } }

/* ---------- Stats ---------- */
.stats { padding: 10px 0 0; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.stat {
  text-align: center; padding: 34px 20px; border: 1px solid var(--line);
  border-radius: var(--radius); background: linear-gradient(180deg, var(--surface), transparent);
}
.stat-num { display: block; font-family: var(--ff-display); font-size: clamp(2.4rem, 5vw, 3.4rem); font-weight: 700; color: var(--blue-2); letter-spacing: -.02em; }
.stat-label { display: block; color: var(--muted); font-size: .95rem; margin-top: 6px; }

/* ---------- Section head ---------- */
.section-head { max-width: 640px; margin-bottom: 52px; }
.section-title { font-size: clamp(1.9rem, 4.5vw, 2.9rem); margin-top: 14px; }

/* ---------- About ---------- */
.about-inner { display: grid; grid-template-columns: .8fr 1.2fr; gap: 60px; align-items: center; }
.photo-card { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line-str); }
.photo-card::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(160deg, transparent 55%, rgba(46,91,255,.22));
  pointer-events: none;
}
.photo-card img { width: 100%; }
.about-copy p { color: var(--muted); margin-bottom: 18px; font-size: 1.05rem; }
.about-note { color: var(--faint) !important; font-size: .98rem !important; padding-top: 8px; border-top: 1px solid var(--line); margin-top: 6px; }

/* ---------- Skills ---------- */
.skills-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.skill-card {
  padding: 32px 28px; border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface), var(--card-grad-2));
  transition: transform .3s var(--ease), border-color .3s, box-shadow .3s;
  position: relative; overflow: hidden;
}
.skill-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--blue), transparent);
  transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease);
}
.skill-card:hover { transform: translateY(-5px); border-color: var(--line-str); box-shadow: 0 24px 50px -24px var(--shadow); }
.skill-card:hover::before { transform: scaleX(1); }
.skill-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: 12px; margin-bottom: 18px;
  background: var(--blue-soft); color: var(--blue-2); font-size: 1.2rem;
}
.skill-card h3 { font-size: 1.2rem; margin-bottom: 10px; }
.skill-card p { color: var(--muted); font-size: .96rem; }

/* ---------- Experience / Timeline ---------- */
.timeline { position: relative; max-width: 780px; margin: 0 auto; padding-left: 34px; }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px;
  background: linear-gradient(180deg, var(--blue), var(--line) 85%);
}
.tl-item { position: relative; padding-bottom: 42px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-marker {
  position: absolute; left: -34px; top: 5px; width: 16px; height: 16px;
  transform: rotate(45deg); background: var(--blue); border-radius: 3px;
  box-shadow: 0 0 0 5px rgba(46,91,255,.15);
}
.tl-marker--edu { background: var(--surface-2); border: 2px solid var(--blue-2); }
.tl-date { font-family: var(--ff-display); font-size: .82rem; font-weight: 600; letter-spacing: .06em; color: var(--blue-2); text-transform: uppercase; }
.tl-content h3 { font-size: 1.22rem; margin: 6px 0 2px; }
.tl-role { color: var(--faint); font-weight: 400; font-size: .9rem; font-family: var(--ff-body); }
.tl-sub { color: var(--text); font-size: .92rem; font-weight: 500; margin-bottom: 8px; }
.tl-content > p:last-child { color: var(--muted); font-size: .98rem; }

/* ---------- Brands ---------- */
.brands { margin-top: 72px; text-align: center; }
.brands-label { font-size: .8rem; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); margin-bottom: 22px; }
.brands-list { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.brands-list li {
  font-family: var(--ff-display); font-weight: 500; font-size: 1.05rem; color: var(--muted);
  padding: 10px 22px; border: 1px solid var(--line); border-radius: 999px;
  transition: color .25s, border-color .25s, background .25s;
}
.brands-list li:hover { color: var(--text); border-color: var(--blue); background: var(--blue-soft); }

/* ---------- Contact ---------- */
.contact-inner { display: grid; grid-template-columns: 1.2fr .8fr; gap: 60px; align-items: center; }
.contact-lead { color: var(--muted); font-size: 1.08rem; max-width: 32em; margin: 16px 0 34px; }
.contact-actions { display: flex; flex-direction: column; gap: 14px; max-width: 440px; }
.contact-btn {
  display: flex; align-items: center; gap: 18px; padding: 18px 24px;
  border: 1px solid var(--line-str); border-radius: var(--radius);
  background: var(--surface); transition: transform .2s var(--ease), border-color .25s, background .25s;
}
.contact-btn:hover { transform: translateY(-2px); border-color: var(--blue); background: var(--surface-2); }
.contact-btn-ic {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; flex: none; border-radius: 12px;
  background: var(--blue-soft); color: var(--blue-2); font-size: 1.3rem;
}
.contact-btn-txt { display: flex; flex-direction: column; line-height: 1.3; overflow: hidden; }
.contact-btn-txt em { font-style: normal; font-size: .78rem; color: var(--faint); text-transform: uppercase; letter-spacing: .1em; }
.contact-btn-txt strong { font-family: var(--ff-display); font-weight: 600; font-size: 1.08rem; color: var(--text); overflow: hidden; text-overflow: ellipsis; }
.linkedin-link { display: inline-block; margin-top: 26px; color: var(--blue-2); font-weight: 600; transition: gap .2s; }
.linkedin-link:hover { color: var(--text); }
.contact-photo { display: flex; justify-content: center; }
.photo-card--sm { width: min(300px, 80%); }

/* ---------- Footer ---------- */
.footer { background: var(--bg-2); color: var(--text); padding: 40px 0; border-top: 1px solid var(--line-str); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.footer-brand { display: flex; align-items: center; gap: 14px; font-family: var(--ff-display); font-weight: 600; color: var(--text); }
.footer-logo { width: 44px; height: 44px; }
.footer-copy { color: var(--faint); font-size: .9rem; }

/* ---------- Mobile quick-contact widget ---------- */
.quick-contact { display: none; }
@media (max-width: 720px) {
  .quick-contact {
    position: fixed; left: 14px; right: 14px; bottom: 14px; z-index: 90;
    display: flex; flex-direction: column; gap: 2px;
    padding: 7px; border-radius: 16px;
    background: var(--nav-bg);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--line-str);
    box-shadow: 0 14px 40px -12px var(--shadow);
    transition: opacity .35s var(--ease), transform .35s var(--ease);
  }
  .quick-contact.hide { opacity: 0; transform: translateY(130%); pointer-events: none; }
  .qc-row { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 11px; }
  .qc-row:active { background: var(--blue-soft); }
  .qc-ic {
    width: 32px; height: 32px; flex: none; display: flex; align-items: center; justify-content: center;
    border-radius: 9px; background: var(--blue-soft); color: var(--blue-2);
  }
  .qc-ic svg { width: 16px; height: 16px; display: block; }
  .qc-row > span:last-child { font-family: var(--ff-display); font-weight: 600; font-size: .95rem; color: var(--text); }
  .scroll-hint { display: none; }
}

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 40px; text-align: center; padding-top: 20px; }
  .hero-copy { order: 2; }
  .hero-visual { order: 1; }
  .hero-cta { justify-content: center; }
  .hero-lead { margin-left: auto; margin-right: auto; }
  .about-inner { grid-template-columns: 1fr; gap: 36px; }
  .about-photo { max-width: 360px; margin: 0 auto; }
  .contact-inner { grid-template-columns: 1fr; gap: 40px; }
  .contact-photo { order: -1; }
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .nav-links {
    position: fixed; inset: var(--nav-h) 0 auto 0;
    flex-direction: column; align-items: flex-start; gap: 4px;
    background: var(--drawer-bg); backdrop-filter: blur(16px);
    padding: 18px 24px 28px; border-bottom: 1px solid var(--line);
    transform: translateY(-140%); transition: transform .35s var(--ease); pointer-events: none;
  }
  .nav-links.open { transform: translateY(0); pointer-events: auto; }
  .nav-links > a { width: 100%; padding: 12px 0; font-size: 1.05rem; border-bottom: 1px solid var(--line); }
  .nav-links > a::after { display: none; }
  .lang-switch { padding: 12px 0 0; border-left: none; }
  .theme-switch { padding: 8px 0 0; margin-left: 0; border-left: none; }
  .nav-toggle { display: flex; }
}

@media (max-width: 560px) {
  .stats-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
  .brands-list li { font-size: .95rem; padding: 8px 16px; }
  .contact-btn-txt strong { font-size: .98rem; }
  .container { padding: 0 20px; }
}

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