/* ============================================
   MARTIN MALKUS PORTFOLIO - CSS DESIGN SYSTEM
   ============================================ */

/* ========== CSS CUSTOM PROPERTIES ========== */
:root {
  /* Colors - Dark Theme with Red Accents */
  --color-bg-primary: #000000;
  --color-bg-secondary: #0a0a0a;
  --color-bg-tertiary: #141414;
  --color-text-primary: #ffffff;
  --color-text-secondary: #b0b0b0;
  --color-text-muted: #707070;
  --color-accent-primary: #DC143C;
  --color-accent-hover: #ff1744;
  --color-accent-dark: #a00f2a;

  /* Typography */
  --font-primary: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-secondary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Font Sizes */
  --text-xs: 0.75rem;
  /* 12px */
  --text-sm: 0.875rem;
  /* 14px */
  --text-base: 1rem;
  /* 16px */
  --text-lg: 1.125rem;
  /* 18px */
  --text-xl: 1.25rem;
  /* 20px */
  --text-2xl: 1.5rem;
  /* 24px */
  --text-3xl: 1.875rem;
  /* 30px */
  --text-4xl: 2.25rem;
  /* 36px */
  --text-5xl: 3rem;
  /* 48px */
  --text-6xl: 3.75rem;
  /* 60px */
  --text-7xl: 4.5rem;
  /* 72px */
  --text-8xl: 6rem;
  /* 96px */

  /* Spacing */
  --space-xs: 0.5rem;
  /* 8px */
  --space-sm: 1rem;
  /* 16px */
  --space-md: 1.5rem;
  /* 24px */
  --space-lg: 2rem;
  /* 32px */
  --space-xl: 3rem;
  /* 48px */
  --space-2xl: 4rem;
  /* 64px */
  --space-3xl: 6rem;
  /* 96px */

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.7);

  /* Layout */
  --container-width: 1200px;
  --section-padding: 6rem 2rem;
}

/* ========== RESET & BASE STYLES ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 90%;
  height: 100%;
  overflow-y: hidden;
  /* scrolling handled by JS transform, not window scroll */
  scroll-snap-type: y mandatory;
  scroll-padding-top: 72px;
  scrollbar-width: none;
  /* Firefox: hide scrollbar */
  -ms-overflow-style: none;
  /* IE/Edge: hide scrollbar */
}

html::-webkit-scrollbar {
  display: none;
  /* Chrome / Safari / Opera: hide scrollbar */
}

/* Scale up on large / high-resolution screens */
@media (min-width: 1921px) {
  html {
    font-size: 100%;
  }

  .section {
    padding-top: 110px;
    /* Sufficient breathing room below nav on big screens */
  }
}

@media (min-width: 2560px) {
  html {
    font-size: 115%;
  }

  .section {
    padding-top: 130px;
    /* More breathing room for 4K */
  }
}

body {
  font-family: var(--font-secondary);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--color-text-primary);
  background-color: var(--color-bg-primary);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background-color: var(--color-accent-primary);
  color: var(--color-text-primary);
}

/* ========== TYPOGRAPHY ========== */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-primary);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 {
  font-size: var(--text-7xl);
  font-weight: 800;
}

h2 {
  font-size: var(--text-5xl);
}

h3 {
  font-size: var(--text-3xl);
}

p {
  margin-bottom: var(--space-md);
}

a {
  color: var(--color-text-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-accent-primary);
}

/* ========== NAVIGATION ========== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background-color: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: var(--space-md) var(--space-lg);
}

.navbar-container {
  max-width: var(--container-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.navbar-container .logo {
  justify-self: start;
}

.navbar-container .lang-switcher {
  justify-self: end;
}

.logo {
  font-size: var(--text-xl);
  font-weight: 700;
  font-family: var(--font-primary);
  letter-spacing: -0.03em;
}

.logo-dot {
  color: var(--color-accent-primary);
}

.nav-menu {
  display: flex;
  gap: var(--space-lg);
  list-style: none;
  align-items: center;
}

.nav-link {
  font-size: var(--text-sm);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: relative;
  padding: var(--space-xs) 0;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--color-accent-primary);
  transition: width var(--transition-base);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.lang-switcher {
  display: flex;
  gap: var(--space-xs);
  align-items: center;
  font-size: var(--text-sm);
  font-weight: 600;
}

.lang-btn {
  background: none;
  border: none;
  color: var(--color-text-secondary);
  cursor: pointer;
  padding: var(--space-xs);
  transition: color var(--transition-fast);
  font-family: var(--font-primary);
  font-size: var(--text-sm);
}

.lang-btn.active {
  color: var(--color-accent-primary);
}

.lang-btn:hover {
  color: var(--color-text-primary);
}

.lang-separator {
  color: var(--color-text-muted);
}

/* Hamburger Menu for Mobile */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-xs);
}

.hamburger span {
  width: 24px;
  height: 2px;
  background-color: var(--color-text-primary);
  transition: all var(--transition-fast);
}

/* ========== SECTIONS ========== */
.section {
  height: 100vh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  flex-direction: column;
  justify-content: center;
  /* Center content vertically for professional look */
  align-items: center;
  padding: 85px 2rem 40px;
  /* Minimum top padding to stay below fixed nav (72px) */
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

/* Experience needs internal scroll if content overflows viewport */
#experience {
  justify-content: flex-start;
  /* Revert to top-aligned for long content */
  padding-top: 140px;
  /* Extra space above section number */
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

#experience .container {
  justify-content: flex-start;
  /* Ensure container content also starts at top */
  margin-top: 0;
  margin-bottom: 0;
}

#experience::-webkit-scrollbar {
  display: none;
  /* Chrome / Safari */
}



.container {
  max-width: var(--container-width);
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  /* Centering block of header + content */
  flex: 1;
  min-height: 0;
}

/* ========== HERO SECTION ========== */
.hero {
  background: linear-gradient(135deg, #000000 0%, #1a0000 100%);
  position: relative;
  overflow: hidden;
  justify-content: center;
  /* Hero stays centered */
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 30% 50%, rgba(220, 20, 60, 0.15) 0%, transparent 60%);
  pointer-events: none;
}

.hero-content {
  display: flex;
  align-items: center;
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 0;
}

.hero-text {
  animation: fadeInUp 1s ease-out;
}

.hero-subtitle {
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-accent-primary);
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.hero-title {
  font-size: var(--text-8xl);
  margin-bottom: var(--space-md);
  line-height: 0.95;
}

.hero-description {
  font-size: var(--text-xl);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-xl);
  max-width: 600px;
}

.hero-btns {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-image {
  position: absolute;
  right: 7%;
  bottom: 0;
  height: 90%;
  display: flex;
  align-items: flex-end;
  pointer-events: none;
  animation: fadeIn 1.2s ease-out;
}

.hero-image img {
  height: 100%;
  width: auto;
  display: block;
}

/* ========== BUTTONS ========== */
.btn {
  display: inline-block;
  padding: var(--space-md) var(--space-xl);
  font-family: var(--font-primary);
  font-size: var(--text-base);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background-color: var(--color-accent-primary);
  color: var(--color-text-primary);
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left var(--transition-slow);
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-primary:hover {
  background-color: var(--color-accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(220, 20, 60, 0.4);
}

.btn-outline {
  background-color: transparent;
  border: 2px solid var(--color-text-primary);
  color: var(--color-text-primary);
}

.btn-outline:hover {
  background-color: var(--color-text-primary);
  color: var(--color-bg-primary);
  transform: translateY(-2px);
}

/* ========== SECTION TITLES ========== */
.section-header {
  text-align: center;
  margin-top: 0;
  margin-bottom: 4rem;
  flex-shrink: 0;
  width: 100%;
}

/* Link inside skill entries (e.g. SSPŠ) */
.skill-link {
  color: var(--color-accent-primary);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.skill-link:hover {
  border-bottom-color: var(--color-accent-primary);
}

.section-number {
  font-size: var(--text-sm);
  color: var(--color-accent-primary);
  font-weight: 700;
  letter-spacing: 0.1em;
  margin-bottom: 0.4rem;
  text-align: center;
}

.section-title {
  font-size: var(--text-5xl);
  margin-bottom: 0.6rem;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '.';
  color: var(--color-accent-primary);
}

.section-description {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  max-width: 700px;
  margin: 0 auto;
}

/* ========== SKILLS - NEW DESIGN ========== */
.skills-wrapper {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
}

.skills-category {
  margin-bottom: 1.2rem;
}

.skills-cat-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 0.8rem;
}

.skills-cat-title {
  font-family: var(--font-primary);
  font-size: var(--text-base);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  margin: 0;
}

.skills-cat-line {
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.15);
}

/* 2-column skill grid inside each half-width column */
.skills-new-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.2rem 1.8rem;
}

.skills-edu-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.2rem 1.8rem;
}

.skill-new-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.skill-edu-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

/* Level label (PRO / EXPERT / NATIVE / FLUENT etc.) */
.skill-level-label {
  font-family: var(--font-primary);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
}

/* Skill name */
.skill-new-name {
  font-family: var(--font-primary);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 0;
  line-height: 1.3;
}

/* Small subtitle under skill name */
.skill-subtitle {
  font-family: var(--font-primary);
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--color-text-muted);
  margin: 0 0 0.1rem;
  opacity: 0.7;
  line-height: 1.3;
}

/* Row holding level label + block bar */
.skill-bar-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.3rem;
}

/* Segmented block bar */
.skill-blocks {
  display: flex;
  gap: 4px;
}

.sb {
  display: inline-block;
  width: 28px;
  height: 6px;
  border-radius: 2px;
}

.sb-filled {
  background-color: var(--color-accent-primary);
}

.sb-empty {
  background-color: rgba(255, 255, 255, 0.12);
}

/* ========== OLD SKILL BARS (kept, unused) ========== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-xl);
}

.skill-item {
  opacity: 0;
  transform: translateY(20px);
  transition: all var(--transition-slow);
}

.skill-item.visible {
  opacity: 1;
  transform: translateY(0);
}

.skill-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-sm);
}

.skill-name {
  font-size: var(--text-lg);
  font-weight: 600;
  font-family: var(--font-primary);
}

.skill-percentage {
  font-size: var(--text-sm);
  color: var(--color-accent-primary);
  font-weight: 700;
}

.skill-bar {
  height: 8px;
  background-color: var(--color-bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.skill-progress {
  height: 100%;
  background: linear-gradient(90deg, var(--color-accent-primary), var(--color-accent-hover));
  border-radius: 4px;
  width: 0;
  transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.skill-progress::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 60px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  animation: shimmer 2s ease-in-out infinite;
}


/* ========== TIMELINE ========== */
.timeline {
  position: relative;
  padding: var(--space-xl) 0;
}

/* Vertical connecting line — gradient fades out below last item */
.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--color-accent-primary) 60%, transparent 100%);
  transform: translateX(-50%);
}

/* Stop the line from dangling below the last experience card */
#experience .timeline {
  padding-bottom: 0;
}

.timeline-item {
  display: flex;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
  position: relative;
  opacity: 1;
  transform: none;
}

.timeline-item.visible {
  opacity: 1;
  transform: none;
}

.timeline-item:nth-child(even) {
  flex-direction: row-reverse;
}

.timeline-content {
  flex: 1;
  background-color: var(--color-bg-secondary);
  padding: var(--space-md) var(--space-lg);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
}

.timeline-date {
  font-size: var(--text-sm);
  color: var(--color-accent-primary);
  font-weight: 700;
  margin-bottom: var(--space-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.timeline-title {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-sm);
}

.timeline-company {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-md);
}

.timeline-description {
  color: var(--color-text-secondary);
  line-height: 1.7;
}

.timeline-description ul {
  margin-top: 1rem;
  padding-left: 1.5rem;
  color: var(--color-text-secondary);
}

.timeline-description ul li {
  margin-bottom: 0.5rem;
}

.timeline-description ul li:last-child {
  margin-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: 50%;
  top: var(--space-lg);
  width: 16px;
  height: 16px;
  background-color: var(--color-accent-primary);
  border: 4px solid var(--color-bg-primary);
  border-radius: 50%;
  transform: translateX(-50%);
  z-index: 1;
}



/* Skills two-column layout with subgrid-style row alignment */
.skills-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 1.2rem;
  width: 100%;
  max-width: 100%;
  margin: 0.4rem 0 0;
  /* align items within grid rows */
  align-items: start;
}

/* Each column stacks its two categories top-aligned within the row grid */
.skills-col {
  display: contents;
  /* display:contents removes the box, making children direct grid items */
}

/* Fallback for browsers with no subgrid / display:contents quirks:
   position IT/Ostatní on row 1 and Produkční/Vzdělání on row 2 */

/* LEFT col: 1st category = row 1, 2nd = row 2 */
.skills-col:first-child .skills-category:nth-child(1) {
  grid-column: 1;
  grid-row: 1;
}

.skills-col:first-child .skills-category:nth-child(2) {
  grid-column: 1;
  grid-row: 2;
}

/* RIGHT col: 1st category = row 1, 2nd = row 2 */
.skills-col:last-child .skills-category:nth-child(1) {
  grid-column: 2;
  grid-row: 1;
}

.skills-col:last-child .skills-category:nth-child(2) {
  grid-column: 2;
  grid-row: 2;
}

/* Reset any extra top margin on Vzdělání — alignment is handled by grid */
.skills-edu-aligned {
  margin-top: 0;
  align-self: start;
}

@media (max-width: 768px) {
  .skills-two-col {
    grid-template-columns: 1fr;
    grid-template-rows: unset;
  }

  /* Restore normal block order on mobile */
  .skills-col {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
  }

  .skills-col:first-child .skills-category:nth-child(1),
  .skills-col:first-child .skills-category:nth-child(2),
  .skills-col:last-child .skills-category:nth-child(1),
  .skills-col:last-child .skills-category:nth-child(2) {
    grid-column: unset;
    grid-row: unset;
  }
}


/* ========== GALLERY ========== */
.gallery-filters {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  margin-bottom: var(--space-sm);
  flex-wrap: wrap;
}

.filter-btn {
  padding: var(--space-sm) var(--space-lg);
  background-color: var(--color-bg-secondary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all var(--transition-base);
  border-radius: 4px;
}

.filter-btn:hover,
.filter-btn.active {
  background-color: var(--color-accent-primary);
  color: var(--color-text-primary);
  border-color: var(--color-accent-primary);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-md);
}

.gallery-item {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition-base);
}

.gallery-item.hidden {
  display: none;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.gallery-item:hover img {
  transform: scale(1.1);
}

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.9) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--space-lg);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
}

.gallery-title {
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.gallery-category {
  font-size: var(--text-sm);
  color: var(--color-accent-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ========== CONTACT FORM ========== */
.contact-content {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: var(--space-xl);
  align-items: start;
  width: 100%;
}

.contact-info h3 {
  margin-bottom: var(--space-sm);
}

.contact-item {
  margin-bottom: var(--space-md);
}

.contact-label {
  font-size: var(--text-sm);
  color: var(--color-accent-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-xs);
  font-weight: 600;
}

.contact-value {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
}

.form-group {
  margin-bottom: var(--space-xs);
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: var(--space-md);
  background-color: var(--color-bg-secondary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  color: var(--color-text-primary);
  font-family: var(--font-secondary);
  font-size: var(--text-base);
  transition: all var(--transition-base);
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-accent-primary);
  box-shadow: 0 0 0 3px rgba(220, 20, 60, 0.1);
}

.form-textarea {
  min-height: 90px;
  resize: vertical;
}

/* ========== FOOTER (now inside contact section) ========== */
.footer {
  display: none;
}

.contact-footer-bar {
  margin-top: 1.5rem;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  font-size: var(--text-sm);
}

.social-links {
  display: flex;
  gap: var(--space-lg);
}

.social-link {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: var(--color-text-primary);
  transition: all var(--transition-base);
}

.social-link:hover {
  background-color: var(--color-accent-primary);
  border-color: var(--color-accent-primary);
  color: var(--color-text-primary);
  transform: translateY(-3px);
}

/* ========== FULLPAGE ENGINE ========== */
#fp-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  will-change: transform;
  transition: transform 0.9s cubic-bezier(0.645, 0.045, 0.355, 1.000);
}

/* Side dot navigation */
.fp-dots {
  position: fixed;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.fp-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
  display: block;
}

.fp-dot.active {
  background: var(--color-accent-primary);
  border-color: var(--color-accent-primary);
  transform: scale(1.5);
}

.fp-dot:hover:not(.active) {
  background: rgba(255, 255, 255, 0.55);
}

@media (max-width: 768px) {
  .fp-dots {
    display: none;
  }
}

/* ========== ANIMATIONS ========== */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shimmer {
  0% {
    transform: translateX(-100px);
    opacity: 0;
  }

  20% {
    opacity: 1;
  }

  80% {
    opacity: 1;
  }

  100% {
    transform: translateX(var(--bar-width, 1000px));
    opacity: 0;
  }
}

/* ========== GALLERY EMBED PANELS ========== */
.gallery-subtabs {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
  flex-wrap: wrap;
}

.subtab-btn {
  padding: var(--space-xs) var(--space-lg);
  background-color: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all var(--transition-base);
  border-radius: 4px;
  font-family: var(--font-primary);
}

.subtab-btn:hover,
.subtab-btn.active {
  background-color: rgba(220, 20, 60, 0.15);
  color: var(--color-accent-primary);
  border-color: var(--color-accent-primary);
}

.sv-panel {
  display: none;
}

.sv-panel.active {
  display: block;
  animation: fadeIn 0.4s ease-out;
}

.sv-embed-card {
  max-width: 900px;
  margin: 0 auto;
  background-color: var(--color-bg-secondary);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
  padding: var(--space-md);
}

.sv-embed-label {
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-accent-primary);
  margin-bottom: var(--space-xs);
}

.sv-embed-wrapper {
  border-radius: 8px;
  overflow: hidden;
  background: #000;
  margin-bottom: var(--space-md);
}

.sv-video-wrapper {
  position: relative;
  padding-top: 56.25%;
  /* 16:9 */
}

.sv-video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.sv-tour-wrapper {
  height: 500px;
}

.sv-tour-wrapper iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.sv-website-wrapper {
  height: 550px;
}

.sv-website-wrapper iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.sv-embed-desc {
  color: var(--color-text-secondary);
  font-size: var(--text-base);
  margin: 0;
}

/* ========== RESPONSIVE DESIGN ========== */

/* ---- Desktop (1025px+): baseline styles ---- */
@media (max-width: 1024px) {
  :root {
    --text-8xl: 4.5rem;
    --text-7xl: 3.5rem;
    --text-6xl: 3rem;
  }

  .hero-content {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
  }

  .timeline::before {
    left: 0;
  }

  .timeline-item,
  .timeline-item:nth-child(even) {
    flex-direction: row;
    padding-left: var(--space-xl);
  }

  .timeline-dot {
    left: 0;
  }

  .contact-content {
    grid-template-columns: 1fr;
  }

  .skills-grid {
    grid-template-columns: 1fr;
  }

  .skills-new-grid {
    grid-template-columns: 1fr 1fr;
  }

  .skills-edu-grid {
    grid-template-columns: 1fr;
  }
}

/* ---- Tablet landscape (900px) ---- */
@media (max-width: 900px) {
  .section {
    padding: 5rem 1.8rem 1.5rem;
  }

  /* Hero: hide image at tablet width, text takes full width */
  .hero-image {
    display: none;
  }

  /* Skills: stack to one column */
  .skills-two-col {
    grid-template-columns: 1fr;
  }

  /* Vzdělání alignment not needed when stacked */
  .skills-edu-aligned {
    margin-top: 0 !important;
  }

  /* Hobby cards: show 2 at a time */
  .hobby-card {
    flex: 0 0 calc(50% - 0.75rem);
  }

  /* Hobbies section: give carousel more space */
  .hobbies-outer {
    gap: 0.5rem;
  }
}

/* ---- Tablet portrait / large mobile (768px) ---- */
@media (max-width: 768px) {
  :root {
    --text-8xl: 3rem;
    --text-7xl: 2.5rem;
    --text-6xl: 2rem;
    --text-5xl: 2rem;
    --section-padding: 4rem 1.5rem;
  }

  /* Mobile hamburger */
  .hamburger {
    display: flex;
  }

  .nav-menu {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.98);
    flex-direction: column;
    padding: var(--space-xl);
    transform: translateX(100%);
    transition: transform var(--transition-base);
    gap: var(--space-md);
  }

  .nav-menu.active {
    transform: translateX(0);
  }

  /* Nav link stays in one line on mobile menu */
  .nav-link-zajmy {
    white-space: nowrap;
    font-size: var(--text-xs);
    letter-spacing: 0.03em;
  }

  /* Phone mode: get rid of section numbers and scale elements */
  .section-number {
    display: none !important;
  }

  .section-header {
    margin-bottom: 2rem !important;
  }

  .section-title {
    font-size: 1.8rem !important;
  }

  .section-description {
    font-size: 0.9rem !important;
    line-height: 1.4;
  }

  .section {
    height: 100svh;
    padding: 180px 1.5rem 30px !important;
    /* V11 UNSTOPPABLE: Guaranteed clearance */
    display: block !important;
    /* Kill flex centering which causes cropping */
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    box-sizing: border-box !important;
  }

  /* Home still needs flex for vertical centering */
  #home {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
    padding: 80px 1.5rem 30px !important;
  }

  /* Deep-centering: break the grid and center everything */
  .hero-content {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    text-align: center !important;
  }

  .hero-text {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
  }

  /* Explicitly hide hero image on mobile to avoid overlap/caching issues */
  .hero-image {
    display: none !important;
  }

  .section .container {
    margin: 0 auto;
    /* Prevent container from shifting up into navbar */
    width: 100%;
    justify-content: center;
    padding-top: 0 !important;
  }

  .section-header {
    margin-top: 0 !important;
    padding-top: 0 !important;
    display: block !important;
    visibility: visible !important;
  }

  /* Centering for Hero buttons on all phones */
  .hero-btns {
    justify-content: center;
  }

  /* Content subheadings */
  .section h3 {
    font-size: 1.25rem !important;
    margin-bottom: 1rem !important;
  }

  /* Section header smaller on tablet */
  .section-header {
    margin-top: 1.2rem;
    margin-bottom: 3.5rem;
  }

  .section-title {
    font-size: var(--text-4xl);
  }

  /* Skills: single column grids */
  .skills-new-grid {
    grid-template-columns: 1fr 1fr;
  }

  .skills-cat-title {
    white-space: normal;
  }

  /* Contact: tighter layout */
  .contact-content {
    gap: var(--space-md);
  }

  /* Timeline: linear layout */
  .timeline {
    padding: var(--space-md) 0;
  }

  .timeline::before {
    left: 8px;
  }

  .timeline-item,
  .timeline-item:nth-child(even) {
    flex-direction: row;
    padding-left: var(--space-lg);
    margin-bottom: var(--space-md);
  }

  .timeline-dot {
    left: 0;
    top: var(--space-md);
  }

  .timeline-content {
    padding: var(--space-sm) var(--space-md);
  }

  /* Gallery grid */
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }

  /* Hobbies: arrows smaller, card padding tighter */
  .hobbies-arrow {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }
}

/* ---- Small mobile (480px) ---- */
@media (max-width: 480px) {
  :root {
    --text-8xl: 2rem;
    --text-7xl: 1.75rem;
    --text-6xl: 1.5rem;
    --text-5xl: 1.5rem;
    --text-4xl: 1.25rem;
    --text-2xl: 1.1rem;
    --text-xl: 1rem;
    --text-lg: 0.9rem;
    --text-base: 0.85rem;
    --text-sm: 0.75rem;
    --space-xl: 1.5rem;
    --space-lg: 1.2rem;
    --space-md: 1rem;
  }

  .section-header {
    margin-bottom: 1.5rem !important;
  }

  .section-title {
    font-size: 1.6rem !important;
  }

  .section-description {
    font-size: 0.8rem !important;
    line-height: 1.3;
  }

  /* Shared centering for specific sections that need more top room */
  /* Consolidated mobile section boost for V11 absolute safety */
  #experience,
  #skills,
  #gallery,
  #contact {
    display: block !important;
    padding-top: 180px !important;
  }

  .section::-webkit-scrollbar {
    display: none;
  }

  /* Skills: single column */
  .skills-new-grid {
    grid-template-columns: 1fr;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .hero-title {
    font-size: 3rem !important;
    margin-bottom: 1rem;
  }

  .hero-subtitle {
    font-size: 0.7rem !important;
  }

  .hero-description {
    font-size: 0.9rem !important;
    margin-bottom: 1.5rem;
  }

  .btn {
    padding: 0.8rem 1.2rem !important;
    font-size: 0.85rem !important;
  }

  .timeline-item,
  .timeline-item:nth-child(even) {
    padding-left: 1.2rem !important;
    gap: 0.8rem !important;
  }

  .timeline-content {
    padding: 0.8rem 1rem !important;
  }

  .timeline-title {
    font-size: 1.1rem !important;
    margin-bottom: 0.25rem !important;
  }

  .timeline-company {
    font-size: 0.85rem !important;
    margin-bottom: 0.5rem !important;
  }

  .skills-new-grid,
  .skills-edu-grid {
    gap: 0.6rem 0.8rem !important;
  }

  .skill-new-name {
    font-size: 0.85rem !important;
  }

  .skill-level-label {
    font-size: 0.55rem !important;
  }

  .sb {
    width: 20px !important;
    height: 4px !important;
  }

  .contact-content {
    gap: 1.5rem !important;
  }

  .contact-item {
    margin-bottom: 0.8rem !important;
  }

  .contact-value {
    font-size: 0.9rem !important;
  }

  .form-group {
    margin-bottom: 0.5rem !important;
  }

  .form-input,
  .form-textarea {
    padding: 0.6rem 0.8rem !important;
    font-size: 0.85rem !important;
  }

  .hobby-card {
    flex: 0 0 calc(50% - 1rem) !important;
    /* Reduced width to 50% (approx 30% smaller than previous 70%) */
    aspect-ratio: 1 / 1.1 !important;
    /* Unified square-ish size */
    padding: 0.8rem 0.5rem !important;
    gap: 0.3rem !important;
    justify-content: center !important;
  }

  .hobby-icon {
    font-size: 1.4rem !important;
  }

  .hobby-name {
    font-size: 0.7rem !important;
  }
}

/* ---- Short viewports (notebook screens, NOT mobile, height < 800px) ---- */
@media (min-width: 769px) and (max-height: 799px) {
  .section {
    padding-top: 80px;
    /* Even tighter for short laptop screens */
  }

  #experience {
    padding-top: 100px;
  }

  #contact {
    padding-top: 120px;
  }

  /* Section header: less top breathing room */
  .section-header {
    margin-top: 0;
    margin-bottom: 2rem;
  }

  .section-description {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
    /* Clamp description on short screens */
  }

  /* Hobbies: tighter cards */
  .hobby-card {
    padding: 1.2rem 1rem;
  }

  .hobby-icon {
    font-size: 2rem;
  }

  .hobby-name {
    font-size: var(--text-base);
  }

  /* Reduce gaps in skills and contact for short screens */
  .skills-new-grid,
  .skills-edu-grid {
    gap: 0.8rem 1.2rem;
  }

  .contact-container {
    gap: 2rem;
  }

  .contact-info-grid {
    gap: 1.5rem;
  }

  /* Reduce embed card padding */
  .sv-embed-card {
    padding: 0.75rem;
  }

  .sv-embed-label {
    margin-bottom: 0.1rem;
  }

  .sv-embed-label+div {
    max-width: 420px !important;
  }
}

/* ========== HOBBIES CAROUSEL ========== */
/* Outer: wraps arrow buttons + carousel */
.hobbies-outer {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  margin: 1.5rem 0 1rem;
}

.hobbies-carousel-wrap {
  flex: 1;
  overflow: hidden;
  position: relative;
  /* fade edges */
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
}

.hobbies-track {
  display: flex;
  gap: 1.5rem;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

/* Arrow navigation buttons */
.hobbies-arrow {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(220, 20, 60, 0.4);
  background: rgba(220, 20, 60, 0.08);
  color: var(--color-text-primary);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hobbies-arrow:hover {
  background: var(--color-accent-primary);
  border-color: var(--color-accent-primary);
  transform: scale(1.08);
}

.hobbies-arrow:disabled {
  opacity: 0.25;
  cursor: default;
}

.hobby-card {
  /* always 4 visible: calc((100% - 3*gap) / 4) */
  flex: 0 0 calc(25% - 1.125rem);
  background: var(--color-bg-secondary);
  border: 1px solid rgba(220, 20, 60, 0.15);
  border-radius: 16px;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  cursor: default;
  user-select: none;
}

.hobby-card:hover {
  border-color: var(--color-accent-primary);
  /* Glow ring — no translateY means no clipping by overflow:hidden parents */
  box-shadow: 0 0 0 2px rgba(220, 20, 60, 0.45),
    0 8px 30px rgba(220, 20, 60, 0.22);
}

.hobby-icon {
  font-size: 2.8rem;
  line-height: 1;
}

.hobby-name {
  font-family: var(--font-primary);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 0;
  letter-spacing: -0.01em;
}

/* Dots below carousel */
.hobbies-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.hobby-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
}

.hobby-dot.active {
  background: var(--color-accent-primary);
  border-color: var(--color-accent-primary);
  transform: scale(1.4);
}