/* ==========================================================================
   Brutalist Portfolio — monospace, angular, minimal, readable
   CSS version: 2 (mapa pomniejszona, cache bust)
   ========================================================================== */

/* --- CSS Variables (Light / Dark) --- */
:root {
  --bg: #ffffff;
  --bg-alt: #f5f5f5;
  --text-primary: #000000;
  --text-secondary: #444444;
  --text-light: #777777;
  --accent: #780b12;
  --accent-hover: #9a0f18;
  --border: #000000;
  --card-bg: #ffffff;
  --header-bg: #ffffff;
  --footer-bg: #f5f5f5;
  --font-mono: 'IBM Plex Mono', 'SF Mono', Consolas, Monaco, monospace;
  --heading-bg: #3A57E8;
}

body.dark-mode {
  --bg: #0a0a0a;
  --bg-alt: #141414;
  --text-primary: #ffffff;
  --text-secondary: #b0b0b0;
  --text-light: #888888;
  --accent: #d89398;
  --accent-hover: #e8a8ad;
  --border: #333333;
  --card-bg: #0a0a0a;
  --header-bg: #0a0a0a;
  --footer-bg: #0a0a0a;
}

/* --- Reset & Base — monospace, readable --- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-primary);
  background: var(--bg);
  transition: background 0.2s ease, color 0.2s ease;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--text-primary); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: var(--accent); }
img {
  max-width: 100%;
  height: auto;
  display: block;
  border: none;
  outline: none;
  box-shadow: none;
}

/* --- Ogólne animacje (wyłączane przy prefers-reduced-motion) --- */
@media (prefers-reduced-motion: no-preference) {
  .animate-fade-in {
    animation: fadeIn 0.6s ease forwards;
  }
  .animate-fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
  }
  .animate-on-scroll {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.5s ease, transform 0.5s ease;
  }
  .animate-on-scroll.reveal {
    opacity: 1;
    transform: translateY(0);
  }
  .animate-on-scroll.stagger-1 { transition-delay: 0.1s; }
  .animate-on-scroll.stagger-2 { transition-delay: 0.2s; }
  .animate-on-scroll.stagger-3 { transition-delay: 0.3s; }
  .animate-on-scroll.stagger-4 { transition-delay: 0.4s; }
  .animate-on-scroll.stagger-5 { transition-delay: 0.5s; }
}
@media (prefers-reduced-motion: reduce) {
  .animate-on-scroll { opacity: 1; transform: none; }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Decode intro animation --- */
.decode-hidden {
  opacity: 0;
  transition: opacity 1.6s ease;
}
.decode-hidden.decode-visible {
  opacity: 1;
}
/* Header slides down from top */
.site-header.decode-hidden {
  transform: translateY(-100%);
  transition: opacity 1.2s ease, transform 1.2s ease;
}
.site-header.decode-hidden.decode-visible {
  transform: translateY(0);
}
/* Content below hero — slides up gently after decode */
.decode-content-hidden {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1.4s ease, transform 1.4s ease;
}
.decode-content-hidden.decode-visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .decode-content-hidden { opacity: 1; transform: none; }
}
/* During decode: elements with data-decode start invisible until JS fills them */
[data-decode] {
  min-height: 1.2em;
}
/* Blinking cursor at end of decode text */
.decode-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--accent);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: cursorBlink 0.6s step-end infinite;
}
@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}
/* Skip decode for reduced motion */
@media (prefers-reduced-motion: reduce) {
  .decode-hidden { opacity: 1; }
  .decode-cursor { display: none; }
}

/* --- Container — max-width, generous padding --- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 48px;
}
@media (max-width: 768px) {
  .container { padding: 0 24px; }
}

/* ==========================================================================
   Header — fixed, angular, no blur
   ========================================================================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--header-bg);
  transition: transform 0.25s ease, background 0.2s ease;
  border-bottom: 1px solid var(--text-light);
}
.site-header.is-hidden {
  transform: translateY(-100%);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding-top: 0;
  padding-bottom: 0;
  gap: 32px;
}
.header-inner .logo {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  text-transform: uppercase;
  flex-shrink: 0;
}
.header-inner .logo:hover { color: var(--accent); }

.header-center {
  display: flex;
  align-items: center;
  gap: 48px;
  flex: 1;
  justify-content: center;
}
.main-nav .nav-links {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 40px;
}
.main-nav .nav-links a {
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-secondary);
  text-transform: uppercase;
  position: relative;
  transition: color 0.2s ease;
}
.main-nav .nav-links a::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -2px;
  width: 0;
  height: 1px;
  background: var(--text-primary);
  transition: width 0.25s ease, left 0.25s ease;
}
.main-nav .nav-links a:hover::after,
.main-nav .nav-links a.active::after {
  width: 100%;
  left: 0;
}
.main-nav .nav-links a:hover,
.main-nav .nav-links a.active { color: var(--text-primary); }

.header-social {
  display: flex;
  align-items: center;
  gap: 12px;
}
.header-social a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
}
.header-social a:hover { color: var(--accent); }

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
}
.header-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.header-location,
.header-time {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 400;
}
.header-time {
  color: var(--text-light);
}

#dark-mode-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--text-secondary);
  font-size: 1rem;
  transition: color 0.15s ease;
}
#dark-mode-toggle:hover { color: var(--text-primary); }

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--text-primary);
  font-size: 1.25rem;
}
@media (max-width: 1024px) {
  .menu-toggle { display: block; }
  .header-center { gap: 24px; }
  .header-meta { display: none; }
  .main-nav {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--header-bg);
    padding: 24px;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.2s ease, opacity 0.2s ease, visibility 0.2s ease;
  }
  .main-nav.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  .main-nav .nav-links {
    flex-direction: column;
    gap: 20px;
  }
  .main-nav .nav-links a { font-size: 0.9rem; }
}
@media (max-width: 768px) {
  .header-center .header-social { display: none; }
}

/* ==========================================================================
   Hero — minimal, large type, angular
   ========================================================================== */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 64px;
  padding-bottom: 100px;
}
.hero-inner {
  display: block;
}
.hero-title {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
  margin: 0 0 0.4em 0;
  color: var(--text-primary);
  text-transform: uppercase;
}
.hero-subtitle {
  font-size: clamp(0.9rem, 1.8vw, 1.05rem);
  font-weight: 400;
  color: var(--text-secondary);
  margin: 0 0 0.6em 0;
  max-width: 480px;
  line-height: 1.65;
}
.hero-link {
  margin: 0;
}
.hero-link a { color: var(--accent); font-weight: 500; }
.hero-link a:hover { text-decoration: underline; }

/* Hero: entrance handled by decode intro (JS), no CSS animation needed */

.scroll-indicator {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-light);
  font-size: 1.25rem;
  transition: opacity 0.2s ease;
}
@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(6px); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: translateY(0) scale(1); }
  50% { opacity: 0.75; transform: translateY(6px) scale(1.15); }
}
@media (prefers-reduced-motion: no-preference) {
  .scroll-indicator .scroll-arrow {
    display: inline-block;
    animation: pulse 2.2s ease-in-out infinite;
  }
}
@media (prefers-reduced-motion: reduce) {
  .scroll-indicator .scroll-arrow { animation: none; }
}
.hero { position: relative; }

/* Ładowanie strony — splash przy pierwszym wejściu */
.load-splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  pointer-events: none;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
.load-splash.is-hidden {
  opacity: 0;
  visibility: hidden;
}
.load-splash-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: var(--heading-bg);
  transition: width 0.1s linear;
}
.load-splash.loading .load-splash-bar {
  animation: loadBar 0.8s ease-out forwards;
}
@keyframes loadBar {
  to { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .load-splash .load-splash-bar { animation: none; width: 100%; }
  .load-splash.is-hidden { transition-duration: 0.15s; }
}

/* Dark mode: animacja ikony przy przełączeniu */
#dark-mode-icon.dark-mode-icon-spin {
  animation: iconSpin 0.4s ease;
}
@keyframes iconSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(180deg); }
}

/* ==========================================================================
   Section titles — uppercase, monospace
   ========================================================================== */
.section-title {
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  font-weight: 600;
  letter-spacing: 0.08em;
  margin: 0 0 2em 0;
  color: var(--text-primary);
  text-transform: uppercase;
}

/* ==========================================================================
   Featured Project — angular, border instead of shadow
   ========================================================================== */
.featured-project {
  padding: 100px 0 80px;
}
@media (max-width: 768px) {
  .featured-project { padding: 60px 0 50px; }
}
.featured-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 20px;
}
.featured-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  text-transform: uppercase;
}
.featured-meta {
  font-size: 0.8rem;
  color: var(--text-light);
}
.featured-card {
  display: grid;
  grid-template-columns: 1fr 1.8fr;
  gap: 48px;
  align-items: start;
}
@media (max-width: 1024px) {
  .featured-card { grid-template-columns: 1fr; }
}
.featured-content .featured-title {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 0 0 0.4em 0;
  text-transform: uppercase;
}
.featured-content .featured-title a { color: var(--text-primary); }
.featured-content .featured-title a:hover { color: var(--accent); }
.featured-desc {
  color: var(--text-secondary);
  margin: 0 0 1.5em 0;
  max-width: 520px;
  line-height: 1.7;
  font-size: 0.9rem;
}
.featured-hero-text {
  order: 2;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 120px;
}
.featured-hero-text a {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #2563eb;
  text-decoration: none;
  transition: color 0.2s ease;
}
.featured-hero-text a:hover {
  color: #1d4ed8;
}
body.dark-mode .featured-hero-text a {
  color: #60a5fa;
}
body.dark-mode .featured-hero-text a:hover {
  color: #93c5fd;
}
.btn {
  display: inline-block;
  padding: 10px 20px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-primary);
  background: transparent;
  transition: color 0.2s ease, transform 0.2s ease;
  border: none;
  outline: none;
  box-shadow: none;
}
.btn:hover { color: var(--accent); transform: translateY(-1px); }
body.dark-mode .btn { color: var(--text-primary); }
.cta-arrow {
  display: inline-block;
  transition: transform 0.25s ease;
}
.btn:hover .cta-arrow,
.project-link:hover .cta-arrow {
  transform: translateX(4px);
}
@media (prefers-reduced-motion: reduce) {
  .cta-arrow { transition: none; }
  .btn:hover .cta-arrow, .project-link:hover .cta-arrow { transform: none; }
}
body.dark-mode .btn:hover { color: var(--accent); }

/* ==========================================================================
   Projects grid — single column, angular cards
   ========================================================================== */
.projects-grid {
  padding: 0 0 100px;
}
@media (max-width: 768px) {
  .projects-grid { padding: 0 0 60px; }
}
.project-card {
  margin-bottom: 80px;
  padding-bottom: 0;
  border: none;
  border-bottom: none;
  box-shadow: none;
}
.project-card:last-child { margin-bottom: 0; }
/* Split: tekst lewo, zdjęcie prawo (jak Portez) */
.project-link {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
  color: inherit;
  transition: color 0.15s ease;
}
@media (max-width: 768px) {
  .project-link {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}
.project-link {
  border: none;
  outline: none;
  box-shadow: none;
}
.project-link:hover { color: inherit; }
.project-link:hover .project-cta { color: var(--accent); text-decoration: underline; }
.project-info {
  order: 1;
}
.project-image-wrap {
  order: 2;
  position: relative;
  border-radius: 0;
  overflow: hidden;
  border: none;
  outline: none;
  box-shadow: none;
}
/* Link inside .project-image-wrap (e.g. featured map) — no border/outline */
.project-image-wrap a {
  display: block;
  border: none;
  outline: none;
  box-shadow: none;
}
.project-image-wrap a:hover,
.project-image-wrap a:focus,
.project-image-wrap a:active {
  border: none;
  outline: none;
  box-shadow: none;
}
.project-image-wrap img {
  width: 100%;
  height: auto;
  max-height: min(38vh, 280px);
  object-fit: cover;
  object-position: center;
  transition: transform 0.35s ease;
  border: none;
  outline: none;
  box-shadow: none;
}
/* Featured section: mapa — pomniejszona w ramce, całe zdjęcie widoczne */
.featured-card .featured-map-wrap,
.featured-card .project-image-wrap.featured-map-wrap {
  order: 2;
  width: 100%;
  min-width: 0;
  overflow: visible;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-left: 1.5rem;
}
.featured-card .featured-map-wrap a,
.featured-card .project-image-wrap.featured-map-wrap a {
  display: block;
  border: none;
  outline: none;
  box-shadow: none;
}
.featured-card .featured-map-wrap img,
.featured-card .project-image-wrap.featured-map-wrap img,
.featured-card img[src*="2025_Polish_presidential_election"] {
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: min(32vh, 260px) !important;
  display: block;
  margin-left: auto;
  margin-right: auto;
  object-fit: contain !important;
  object-position: center;
  border: none;
  outline: none;
  box-shadow: none;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: auto;
  backface-visibility: hidden;
}
@media (max-width: 768px) {
  .featured-card .featured-map-wrap img,
  .featured-card .project-image-wrap.featured-map-wrap img,
  .featured-card img[src*="2025_Polish_presidential_election"] {
    max-height: min(28vh, 200px) !important;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .project-link:hover .project-image-wrap img {
    transform: scale(1.03);
  }
}
@media (prefers-reduced-motion: reduce) {
  .project-image-wrap img { transition: none; }
}
@media (max-width: 768px) {
  .project-image-wrap { order: 2; }
  .project-image-wrap img { max-height: min(32vh, 220px); }
  .project-image-wrap img[src*="apron-logo"] { max-height: min(44vh, 320px); }
}
.project-image-wrap img[src*="1599457609166"] { object-fit: contain; background: var(--bg-alt); }
/* Apron logo — przybliżyć (większy wyświetlany rozmiar) */
.project-image-wrap img[src*="apron-logo"] { max-height: min(52vh, 400px); }
/* Alex Portfolio — to samo okienko co inne karty, zdjęcie oddalone w środku (contain jak Auto Estate) */
.project-image-wrap img[src*="alex-portfolio-globe"] { object-fit: contain; background: var(--bg-alt); }
.project-badges {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.badge {
  display: inline-block;
  padding: 6px 10px;
  font-size: 0.7rem;
  font-weight: 600;
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--text-primary);
  color: var(--bg);
  border-radius: 0;
  border: none;
}
body.dark-mode .badge { background: var(--text-primary); color: var(--bg); }
.project-title {
  font-size: clamp(1.1rem, 1.8vw, 1.4rem);
  font-weight: 700;
  margin: 0 0 0.3em 0;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.project-desc {
  color: var(--text-secondary);
  margin: 0 0 0.4em 0;
  line-height: 1.65;
  font-size: 0.9rem;
}
.project-cta {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-primary);
}

/* ==========================================================================
   Contact — minimal, angular
   ========================================================================== */
.contact {
  padding: 100px 0;
  background: var(--bg-alt);
}
@media (max-width: 768px) {
  .contact { padding: 60px 0; }
}
.contact-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}
@media (max-width: 768px) {
  .contact-inner { grid-template-columns: 1fr; }
}
.contact-info .section-title { margin-bottom: 0.5em; }
.contact-address,
.contact-email {
  margin: 0.5em 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}
.contact-email a { color: var(--accent); }
.contact-social {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.contact-social a {
  font-weight: 500;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  color: var(--text-secondary);
}
.contact-social a:hover { color: var(--accent); }

/* ==========================================================================
   Footer — minimal
   ========================================================================== */
.site-footer {
  padding: 32px 0;
  background: var(--footer-bg);
  text-align: center;
}
.footer-contact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  text-align: left;
  margin-bottom: 2rem;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}
@media (max-width: 600px) {
  .footer-contact { grid-template-columns: 1fr; text-align: center; }
}
.footer-contact h3 {
  margin: 0 0 0.5rem 0;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-primary);
}
.footer-contact p { margin: 0; color: var(--text-secondary); font-size: 0.9rem; }
.footer-contact a { color: var(--accent); }
.copyright {
  margin: 0;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: var(--text-light);
}

/* ==========================================================================
   Page content (About, CV) — monospace, readable
   ========================================================================== */
.page-main {
  padding-top: 64px;
  padding-bottom: 80px;
  min-height: 100vh;
}
.page-content {
  max-width: 680px;
  margin: 0 auto;
}
.page-content h1 {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 0 0 0.25em 0;
  text-transform: uppercase;
}
.page-content .lead {
  font-size: 1rem;
  color: var(--text-secondary);
  margin: 0 0 2em 0;
  line-height: 1.7;
}
.page-content .page-meta {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: -1em 0 1.5em 0;
}
.page-content h2 {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  margin: 2.2em 0 0.5em 0;
  padding: 0.4em 0.75em;
  text-transform: uppercase;
  background: var(--heading-bg);
  color: #ffffff;
  display: inline-block;
}
.page-content h2:first-of-type { margin-top: 0; }
body.dark-mode .page-content h2 {
  background: #4d6aeb;
  color: #ffffff;
}
.page-content h3 { font-size: 0.95rem; font-weight: 600; margin: 1.5em 0 0.4em 0; letter-spacing: 0.03em; }
.page-content p { margin: 0 0 1em 0; line-height: 1.7; color: var(--text-primary); font-size: 0.95rem; }
.page-content ul { margin: 0 0 1em 0; padding-left: 1.5em; }
.page-content li { margin-bottom: 0.35em; line-height: 1.6; }
.page-content hr {
  border: none;
  height: 0;
  margin: 2.5em 0;
}
.page-content .image-wrap,
.page-content .image-main {
  margin: 1.5em 0;
  border: none;
  outline: none;
  box-shadow: none;
}
/* Zdjęcia mieszczą się na ekranie z odstępem (laptop + telefon) */
.page-content .image-wrap img,
.page-content .image-main img {
  width: 100%;
  max-height: min(calc(100vh - 220px), 620px);
  object-fit: contain;
  object-position: center;
  border-radius: 0;
  margin-left: auto;
  margin-right: auto;
  display: block;
}
@media (max-width: 768px) {
  .page-content .image-wrap img,
  .page-content .image-main img {
    max-height: min(calc(100vh - 200px), 400px);
  }
}
.page-content .gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 1.5em 0;
  border: none;
  outline: none;
  box-shadow: none;
}
.page-content .gallery-grid a,
.page-content .gallery-grid div {
  border: none;
  outline: none;
  box-shadow: none;
}
@media (max-width: 600px) {
  .page-content .gallery-grid { grid-template-columns: 1fr; }
}
.page-content .gallery-grid img {
  width: 100%;
  max-height: min(45vh, 320px);
  object-fit: cover;
  object-position: center;
  border-radius: 0;
}
@media (max-width: 768px) {
  .page-content .gallery-grid img {
    max-height: min(40vh, 260px);
  }
}

.page-content .img-center {
  max-width: 85%;
  margin-left: auto;
  margin-right: auto;
  border: none;
  outline: none;
  box-shadow: none;
}
.page-content .img-center img {
  max-height: min(calc(100vh - 220px), 560px);
}
@media (max-width: 768px) {
  .page-content .img-center { max-width: 100%; }
  .page-content .img-center img { max-height: min(calc(100vh - 200px), 380px); }
}

/* CV specific */
.education-flags {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 10px;
  vertical-align: middle;
}
.education-flags img {
  width: 36px;
  height: 27px;
  object-fit: contain;
  border-radius: 0;
  background: var(--bg-alt);
  padding: 2px;
}
.company-logo {
  display: inline-block;
  vertical-align: middle;
  margin-left: 10px;
  width: 56px;
  height: 56px;
  object-fit: contain;
}
.cv-download {
  margin-bottom: 2em;
}
.cv-download .btn { display: inline-flex; align-items: center; gap: 8px; }

/* ==========================================================================
   Project subpages (Projects/*) — zdjęcia mieszczą się na ekranie z odstępem
   ========================================================================== */
.project-page .page-content img,
.project-page .image.main img,
.project-page .image.fit img,
.project-page .page-content .image-main img,
.project-page .page-content .image-fit img {
  max-width: 100%;
  max-height: min(calc(100vh - 220px), 620px);
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
  border-radius: 0;
  margin: 1em auto;
  display: block;
}
@media (max-width: 768px) {
  .project-page .page-content img,
  .project-page .image.main img,
  .project-page .image.fit img,
  .project-page .page-content .image-main img,
  .project-page .page-content .image-fit img {
    max-height: min(calc(100vh - 200px), 400px);
  }
}
.project-page .page-content .box.alt .image.fit,
.project-page .box.alt .image.fit {
  margin: 1.5em 0;
}

/* Zdjęcie główne na podstronie projektu — bez ramki, obcięcie ramki z grafiki */
.page-content .image-frame,
.project-page .page-content .image-frame,
.page-content .image-main,
.project-page .page-content .image-main {
  margin: 1.5em 0;
  border: none;
  outline: none;
  box-shadow: none;
  overflow: hidden;
}
.page-content .image-frame img,
.project-page .page-content .image-frame img,
.page-content .image-main img,
.project-page .page-content .image-main img {
  object-fit: contain;
  max-height: min(calc(100vh - 260px), 580px);
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  border: none;
  outline: none;
  box-shadow: none;
}
/* Obcięcie szarej ramki z grafiki globu (Alex Portfolio) */
.page-content .image-frame img[src*="alex-portfolio-globe"],
.project-page .page-content .image-frame img[src*="alex-portfolio-globe"] {
  transform: scale(1.05);
  transform-origin: center;
}
@media (max-width: 768px) {
  .page-content .image-frame img,
  .project-page .page-content .image-frame img,
  .page-content .image-main img,
  .project-page .page-content .image-main img {
    max-height: min(calc(100vh - 220px), 360px);
  }
}
.project-page .btn {
  margin-top: 0.5em;
}
.project-page .page-content pre,
.project-page .page-content code {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  background: var(--bg-alt);
  padding: 0.25em 0.4em;
}
.project-page .page-content pre {
  padding: 1em;
  overflow-x: auto;
  margin: 1em 0;
}
.project-page .page-content details {
  margin: 1em 0;
}
.project-page .page-content details summary {
  cursor: pointer;
  font-weight: 600;
  padding: 0.5em 0;
}
.project-page .page-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1em 0;
  font-size: 0.9rem;
}
.project-page .page-content th,
.project-page .page-content td {
  text-align: left;
  padding: 0.5em 0.75em;
}
.project-page .page-content th {
  font-weight: 600;
}
.project-page .page-content blockquote {
  margin: 1.5em 0;
  padding-left: 1em;
  color: var(--text-secondary);
}
