/* ==========================================================================
   EPIC — EP Innovation Centre at TUKE
   Clean Partner-Aligned Sans-Serif Styling (Onest + Helvetica Neue)
   ========================================================================== */

/* Self-hosted Onest variable font (latin + latin-ext for Slovak/Czech diacritics) */
@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("assets/fonts/onest-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("assets/fonts/onest-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Onest Fallback";
  src: local("Helvetica Neue"), local("Helvetica"), local("Arial");
  ascent-override: 92.2%;
  descent-override: 28.99%;
  line-gap-override: 0%;
  size-adjust: 105.2%;
}

:root {
  /* Color Palette — Warm Editorial Light Theme */
  --bg: #fbf6f4;
  --bg-subtle: #f6eee9;
  --fg: #211d1c;
  --fg-muted: #6b5d5d;
  --fg-subtle: #8e807e;
  
  --card: #ffffff;
  --border: #ecdcdc;
  --border-focus: #a3182f;
  
  --primary: #a3182f;
  --primary-hover: #881225;
  --primary-glow: rgba(163, 24, 47, 0.16);
  --primary-fg: #fbf6f4;
  --brand-ep: #a3182f;      /* exact EP crimson from official vector logo */
  --accent-text: #a3182f;   /* small red text / icons */
  --linkedin-text: #0077b5;
  
  --secondary: #f5e8e8;
  --secondary-fg: #6d1b28;
  
  --badge-bg: rgba(163, 24, 47, 0.08);
  --badge-fg: #a3182f;
  --badge-border: rgba(163, 24, 47, 0.2);
  
  --header-bg: rgba(251, 246, 244, 0.9);
  
  --shadow-sm: 0 2px 4px rgba(33, 29, 28, 0.04);
  --shadow-md: 0 8px 24px -6px rgba(33, 29, 28, 0.08);
  --shadow-lg: 0 20px 40px -15px rgba(33, 29, 28, 0.12);
  --shadow-hover: 0 16px 32px -8px rgba(163, 24, 47, 0.15);

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --font-sans: "Onest", "Onest Fallback", "Helvetica Neue", Helvetica, Arial, system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;

  --transition-fast: 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Dark Mode Overrides */
[data-theme="dark"] {
  --bg: #141212;
  --bg-subtle: #1a1717;
  --fg: #f4eeec;
  --fg-muted: #a39795;
  --fg-subtle: #796e6d;
  
  --card: #1c1819;
  --border: #2c2425;
  --border-focus: #e02d4b;
  
  --primary: #c9223c;
  --primary-hover: #e02d4b;
  --primary-glow: rgba(201, 34, 60, 0.25);
  --primary-fg: #ffffff;
  --brand-ep: #df1a33;      /* exact EP crimson from official dark vector logo */
  --accent-text: #ef5b70;   /* >= 4.9:1 on all dark surfaces */
  --linkedin-text: #4ba3dc;
  
  --secondary: #261e20;
  --secondary-fg: #f397a5;
  
  --badge-bg: rgba(201, 34, 60, 0.15);
  --badge-fg: #ff768b;
  --badge-border: rgba(201, 34, 60, 0.35);
  
  --header-bg: rgba(20, 18, 18, 0.9);
  
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 24px -6px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 20px 40px -15px rgba(0, 0, 0, 0.75);
  --shadow-hover: 0 16px 32px -8px rgba(201, 34, 60, 0.25);
}

/* Base & Reset */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  overflow-x: hidden;
}

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

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

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--fg);
}

h3, h4 {
  font-weight: 600;
  letter-spacing: -0.015em;
}

p {
  margin: 0;
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

button {
  font-family: inherit;
}

/* Accessibility Focus Ring */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

.container {
  max-width: 1152px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--primary);
  color: var(--primary-fg);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  z-index: 100;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  left: 20px;
  top: 20px;
}

/* Logo Switching based on Theme */
.logo-dark {
  display: none !important;
}

[data-theme="dark"] .logo-light {
  display: none !important;
}

[data-theme="dark"] .logo-dark {
  display: block !important;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  max-width: 1152px;
  margin: 0 auto;
  gap: 20px;
}

.nav-brand {
  display: flex;
  align-items: center;
}

.nav-logo {
  display: flex;
  align-items: center;
}

/* Prominent Brand Logo */
.nav-logo img {
  height: 28px;
  width: auto;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.nav-logo:hover img {
  opacity: 0.9;
  transform: scale(1.02);
}

@media (max-width: 640px) {
  .nav-logo img {
    height: 24px;
  }
}

.nav-links {
  display: none;
  align-items: center;
  gap: 28px;
  font-size: 14.5px;
  font-weight: 500;
}

.nav-links a {
  color: var(--fg-muted);
  position: relative;
  padding: 4px 0;
  transition: color var(--transition-fast);
}

.nav-links a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
  transition: width var(--transition-normal);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--fg);
}

.nav-links a.active::after {
  width: 100%;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Theme Toggle Button */

/* Language Switcher */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  margin-right: 8px;
}
.lang-link {
  color: var(--fg-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}
.lang-link:hover, .lang-link.active {
  color: var(--fg);
}
.lang-sep {
  color: var(--border-focus);
}

/* EPIC Portal Topbar Button */
.btn-portal-topbar {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 42px;
  padding: 0 16px;
  border-radius: var(--radius);
  background: var(--card);
  color: var(--fg);
  border: 1px solid var(--border);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-portal-topbar:hover {
  border-color: var(--primary);
  color: var(--accent-text);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-portal-topbar svg {
  width: 14px;
  height: 14px;
  transition: transform var(--transition-fast);
}

.btn-portal-topbar:hover svg {
  transform: translate(1px, -1px);
}

@media (max-width: 767px) {
  .btn-portal-topbar {
    display: none;
  }
}

.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: var(--radius);
  color: var(--fg);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.theme-toggle-btn:hover {
  border-color: var(--primary);
  color: var(--accent-text);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.theme-toggle-btn svg {
  width: 19px;
  height: 19px;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.theme-toggle-btn:hover svg {
  transform: rotate(20deg);
}

.icon-sun {
  display: none;
}

.icon-moon {
  display: block;
}

[data-theme="dark"] .icon-sun {
  display: block;
}

[data-theme="dark"] .icon-moon {
  display: none;
}

/* Mobile Nav Toggle Button */
.nav-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: var(--radius);
  color: var(--fg);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.nav-toggle-btn:hover {
  border-color: var(--primary);
}

.nav-toggle-btn svg {
  width: 22px;
  height: 22px;
}

.icon-close {
  display: none;
}

.nav-toggle-btn[aria-expanded="true"] .icon-menu {
  display: none;
}

.nav-toggle-btn[aria-expanded="true"] .icon-close {
  display: block;
}

/* Mobile Nav Drawer */
.mobile-nav {
  display: none;
  border-top: 1px solid var(--border);
  background: var(--bg);
  padding: 16px 24px 24px;
}

.mobile-nav.open {
  display: block;
  animation: slideDown 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.mobile-nav ul {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.mobile-nav ul a {
  display: block;
  padding: 10px 12px;
  font-size: 16px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  color: var(--fg);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.mobile-nav ul a:hover,
.mobile-nav ul a.active {
  background: var(--secondary);
  color: var(--accent-text);
}

.mobile-nav-cta {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@media (min-width: 768px) {
  .nav-links { display: flex; }
  .nav-toggle-btn { display: none; }
  .mobile-nav { display: none !important; }
}

/* ==========================================================================
   Common Section Styles & Eyebrows
   ========================================================================== */

section {
  position: relative;
  border-bottom: 1px solid var(--border);
  transition: border-color var(--transition-normal);
}

.section-pad {
  padding: 88px 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: 12px;
}

.eyebrow-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--badge-bg);
  color: var(--badge-fg);
  border: 1px solid var(--badge-border);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
  cursor: pointer;
  text-align: center;
  line-height: 1.3;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-fg);
  box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-outline {
  background: var(--card);
  color: var(--fg);
  border-color: var(--border);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--accent-text);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.btn-block {
  width: 100%;
}

.eyebrow-linkedin {
  color: var(--linkedin-text);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

.hero {
  background: radial-gradient(circle at 80% 20%, var(--primary-glow) 0%, transparent 60%);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  padding: 64px 24px 80px;
  max-width: 1152px;
  margin: 0 auto;
}

.hero h1 {
  font-size: clamp(33px, 4.4vw, 50px);
  line-height: 1.08;
  letter-spacing: -0.028em;
  margin: 12px 0 20px;
}

.hero-ep {
  font-weight: 280;
  color: var(--brand-ep);
  letter-spacing: -0.005em;
}

[data-theme="dark"] .hero-ep {
  font-weight: 300;
}

.hero p.lead {
  font-size: 18px;
  line-height: 1.65;
  color: var(--fg-muted);
  max-width: 560px;
}

.hero-cta {
  margin-top: 36px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.hero-image-wrap {
  position: relative;
}

.hero-image-frame {
  position: relative;
  z-index: 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.hero-image-frame:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.hero-image-frame picture img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.hero-image-frame:hover picture img {
  transform: scale(1.02);
}

.hero-image-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translate(-14px, 14px);
  background: var(--primary-glow);
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border);
  z-index: 0;
}

@media (min-width: 900px) {
  .hero-grid {
    grid-template-columns: 1.05fr 0.95fr;
    align-items: center;
    padding: 96px 24px 110px;
    gap: 56px;
  }
}

/* ==========================================================================
   About Section
   ========================================================================== */

.about {
  background: var(--bg-subtle);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas:
    "header"
    "body"
    "timeline";
  gap: 36px;
}

.about-heading {
  grid-area: header;
}

.about h2 {
  font-size: clamp(26px, 3.2vw, 36px);
  line-height: 1.18;
}

.about-body {
  grid-area: body;
  color: var(--fg-muted);
  font-size: 16px;
  line-height: 1.75;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.about-body .em {
  color: var(--fg);
  font-weight: 600;
}

.about-body blockquote {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 24px 28px;
  margin: 12px 0;
  font-style: normal;
  font-weight: 500;
  color: var(--fg);
  font-size: 16px;
  line-height: 1.7;
  box-shadow: var(--shadow-sm);
}

.about-body blockquote footer {
  margin-top: 14px;
  font-style: normal;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--fg-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.about-body blockquote footer::before {
  content: "—";
  color: var(--accent-text);
  font-weight: bold;
}

@media (min-width: 860px) {
  .about-grid {
    grid-template-columns: 1fr 2fr;
    grid-template-areas:
      "header body"
      "timeline body";
    gap: 28px 64px;
    align-items: start;
  }
}

/* About Section: Key Milestones Timeline */
.v-timeline-wrap {
  grid-area: timeline;
  margin-top: 0;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.v-timeline-label {
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--fg-muted);
  margin-bottom: 20px;
}

.v-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}

.v-step {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  position: relative;
  padding-bottom: 22px;
}

.v-step:last-child {
  padding-bottom: 0;
}

.v-step:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 11px;
  bottom: -11px;
  width: 2px;
  background: var(--border);
  z-index: 0;
}

.v-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg-subtle);
  border: 2px solid var(--primary);
  margin-top: 4px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.v-step-active .v-dot {
  background: var(--primary);
  box-shadow: 0 0 0 5px var(--primary-glow);
}

.v-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.v-date {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
  color: var(--accent-text);
}

.v-title {
  font-size: 14px;
  line-height: 1.45;
  color: var(--fg);
  font-weight: 500;
}


/* ==========================================================================
   Research Focus
   ========================================================================== */

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

.focus-header {
  margin-bottom: 44px;
  max-width: 720px;
}

.focus h2 {
  font-size: clamp(26px, 3.2vw, 36px);
  line-height: 1.18;
  margin-top: 8px;
}

.focus-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.focus-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.focus-card:hover {
  border-color: var(--border-focus);
  box-shadow: var(--shadow-hover);
}

.focus-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  background: var(--badge-bg);
  color: var(--accent-text);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.focus-card-icon svg {
  width: 22px;
  height: 22px;
}

.focus-card h3 {
  font-size: 20px;
  line-height: 1.3;
  color: var(--fg);
}

.focus-card p {
  margin-top: 14px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--fg-muted);
}

@media (min-width: 860px) {
  .focus-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==========================================================================
   EPIC Portal Section
   ========================================================================== */

.portal {
  background: var(--bg-subtle);
}

.portal-header {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 44px;
}

.portal-header-text {
  max-width: 680px;
}

.portal-header h2 {
  font-size: clamp(26px, 3.2vw, 36px);
  line-height: 1.18;
  margin-top: 8px;
}

.portal-lead {
  margin-top: 12px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--fg-muted);
}

.portal-header-cta {
  flex-shrink: 0;
}

.btn-portal-launch {
  white-space: nowrap;
  padding: 12px 24px;
  font-size: 14px;
}

.btn-portal-launch svg {
  transition: transform var(--transition-fast);
}

.btn-portal-launch:hover svg {
  transform: translate(2px, -2px);
}

.portal-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 860px) {
  .portal-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.portal-app-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}

.portal-app-card:hover {
  border-color: var(--border-focus);
  box-shadow: var(--shadow-hover);
}

.portal-app-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.portal-app-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  background: var(--badge-bg);
  color: var(--accent-text);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.portal-app-icon svg {
  width: 22px;
  height: 22px;
}

.portal-app-tag {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-text);
  background: var(--badge-bg);
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.portal-app-arrow {
  margin-left: auto;
  font-size: 18px;
  color: var(--fg-subtle);
  transition: transform var(--transition-fast), color var(--transition-fast);
}

.portal-app-card:hover .portal-app-arrow {
  color: var(--accent-text);
  transform: translate(2px, -2px);
}

.portal-app-card h3 {
  font-size: 20px;
  line-height: 1.3;
  color: var(--fg);
}

.portal-app-card p {
  margin-top: 14px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--fg-muted);
}

@media (max-width: 768px) {
  .portal-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 32px;
  }
  .portal-header-cta {
    width: 100%;
  }
  .btn-portal-launch {
    width: 100%;
  }
}

/* ==========================================================================
   Stats & Team Section
   ========================================================================== */

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

.stats h2 {
  font-size: clamp(26px, 3.2vw, 36px);
  line-height: 1.18;
}

.stats .note {
  margin-top: 8px;
  font-size: 14px;
  color: var(--fg-muted);
}

.stats-groups {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.stats-group h3 {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.stats-group h3::after {
  content: "";
  flex-grow: 1;
  height: 1px;
  background: var(--border);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 0;
  box-shadow: var(--shadow-sm);
}

.stat-cell {
  background: var(--card);
  padding: 28px 24px;
  transition: background-color var(--transition-fast);
}

.stat-cell:hover {
  background: var(--bg-subtle);
}

.stat-cell dt {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--fg-muted);
}

.stat-cell dd {
  margin: 10px 0 0;
  font-family: var(--font-sans);
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--accent-text);
  line-height: 1;
}

.stat-cell dd.dim {
  color: var(--fg-subtle);
}

@media (min-width: 768px) {
  .stat-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .stat-cell {
    padding: 32px 28px;
  }
  .stat-cell dd {
    font-size: 46px;
  }
}

/* ==========================================================================
   LinkedIn Section
   ========================================================================== */

#linkedin {
  background: var(--bg-subtle);
}

.linkedin-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.linkedin-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), #0077b5);
}

.linkedin-card .li-left {
  display: flex;
  gap: 24px;
  align-items: center;
}

.li-icon {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: var(--radius);
  background: #0077b5;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 119, 181, 0.25);
}

.li-icon svg {
  width: 26px;
  height: 26px;
}

.linkedin-card .eyebrow {
  margin-bottom: 6px;
}

.linkedin-card h2 {
  font-size: clamp(22px, 2.6vw, 28px);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-top: 0;
  margin-bottom: 6px;
}

.linkedin-card .lead {
  margin-top: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--fg-muted);
}

.linkedin-card .btn {
  white-space: nowrap;
  flex-shrink: 0;
}

.linkedin-card .btn svg {
  width: 18px;
  height: 18px;
}

@media (min-width: 768px) {
  .linkedin-card {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    padding: 40px 44px;
  }
}

/* ==========================================================================
   Contact Section & Location
   ========================================================================== */

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

.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
}

.contact-info-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.contact-info-panel h2 {
  font-size: clamp(26px, 3.2vw, 36px);
  line-height: 1.18;
  margin-top: 4px;
  margin-bottom: 16px;
}

.contact-lead {
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--fg-muted);
  margin-bottom: 32px;
  max-width: 500px;
}

.contact dl {
  margin: 0 0 32px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.contact-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.contact-item .icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  background: var(--badge-bg);
  color: var(--accent-text);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--badge-border);
}

.contact-item .icon svg {
  width: 19px;
  height: 19px;
}

.contact-item dt {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.contact-item dd {
  margin: 4px 0 0;
  font-size: 15px;
  color: var(--fg);
  line-height: 1.5;
}

.contact-item a {
  transition: color var(--transition-fast);
}

.contact-item a:hover {
  color: var(--accent-text);
}

.contact-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Map Embed (click-to-load) */
.contact-map-wrap {
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  min-height: 380px;
  display: flex;
  background-color: var(--bg-subtle);
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 32px 32px;
}

.map-placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 24px;
  background: radial-gradient(circle at center, var(--bg-subtle) 30%, transparent 75%);
}

.map-pin {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: var(--primary-fg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 8px var(--primary-glow);
  margin-bottom: 18px;
}

.map-pin svg {
  width: 26px;
  height: 26px;
}

.map-place {
  font-family: var(--font-sans);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.25;
  color: var(--fg);
}

.map-address {
  margin-top: 4px;
  font-size: 14.5px;
  color: var(--fg-muted);
}

.map-actions {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.map-note {
  margin-top: 16px;
  font-size: 12.5px;
  color: var(--fg-muted);
}

.contact-map-wrap iframe {
  width: 100%;
  height: 100%;
  min-height: 380px;
  border: 0;
  display: block;
}

/* Dark mode adjustment for Google Map */
[data-theme="dark"] .contact-map-wrap iframe {
  filter: invert(90%) hue-rotate(180deg) contrast(90%);
}

@media (min-width: 860px) {
  .contact-grid {
    grid-template-columns: 1fr 1.15fr;
    gap: 64px;
    align-items: center;
  }
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  background: var(--bg-subtle);
  border-top: 1px solid var(--border);
  transition: background-color var(--transition-normal);
}

.footer-inner {
  padding: 56px 24px 36px;
  max-width: 1152px;
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
}

.footer-logo {
  height: 26px;
  width: auto;
  max-width: 100%;
}

.footer-tag {
  margin-top: 14px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--fg-muted);
}

.footer-social {
  margin-top: 18px;
  display: inline-flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--fg);
  transition: all var(--transition-fast);
}

.footer-social:hover {
  border-color: var(--primary);
  color: var(--accent-text);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.footer-social svg {
  width: 18px;
  height: 18px;
}

.footer-explore-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.footer-explore ul {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14px;
}

.footer-explore a {
  color: var(--fg-muted);
  transition: color var(--transition-fast);
}

.footer-explore a:hover {
  color: var(--accent-text);
}

.footer-bottom {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: var(--fg-muted);
}

@media (min-width: 640px) {
  .footer-grid {
    grid-template-columns: 1.2fr 0.8fr;
  }
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

/* ==========================================================================
   Back to Top Button
   ========================================================================== */

.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 40;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--fg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: all var(--transition-fast);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  border-color: var(--primary);
  color: var(--accent-text);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.back-to-top svg {
  width: 18px;
  height: 18px;
}

/* ==========================================================================
   404 Page (Grid Telemetry Node Disconnected)
   ========================================================================== */

.not-found-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at 50% 25%, var(--primary-glow) 0%, transparent 65%), var(--bg);
}

.not-found-main {
  flex: 1 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px 24px 80px;
}

.not-found-card {
  position: relative;
  max-width: 620px;
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 36px 44px;
  box-shadow: var(--shadow-lg);
  text-align: center;
  overflow: hidden;
}

.not-found-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), #df1a33, #0077b5);
}

.telemetry-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--badge-bg);
  border: 1px solid var(--badge-border);
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: 22px;
}

.telemetry-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-text);
  box-shadow: 0 0 0 0 var(--primary-glow);
  animation: pulseNode 2s infinite ease-in-out;
}

@keyframes pulseNode {
  0% {
    box-shadow: 0 0 0 0 rgba(163, 24, 47, 0.5);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(163, 24, 47, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(163, 24, 47, 0);
  }
}

.not-found-card h1 {
  font-size: clamp(30px, 4.2vw, 44px);
  line-height: 1.12;
  letter-spacing: -0.028em;
  margin: 0 0 14px;
}

.not-found-lead {
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--fg-muted);
  max-width: 520px;
  margin: 0 auto 30px;
}

.not-found-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 0;
}

.not-found-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-subtle);
  padding: 20px 24px;
  text-align: center;
  font-size: 12.5px;
  color: var(--fg-muted);
}

.not-found-footer p {
  margin: 0;
}

@media (max-width: 640px) {
  .not-found-main {
    padding: 36px 16px 56px;
  }
  .not-found-card {
    padding: 36px 20px 32px;
  }
  .not-found-actions .btn {
    width: 100%;
  }
}

/* ==========================================================================
   Small Screen Optimizations (Mobile <= 480px)
   ========================================================================== */

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }

  .nav-inner {
    padding: 10px 16px;
  }

  .section-pad {
    padding: 60px 0;
  }

  .hero-grid {
    padding: 44px 16px 60px;
    gap: 36px;
  }

  .hero p.lead {
    font-size: 16.5px;
  }

  .hero-cta {
    flex-direction: column;
    width: 100%;
    gap: 10px;
  }

  .hero-cta .btn {
    width: 100%;
  }

  .hero-image-wrap::after {
    transform: translate(-8px, 8px);
  }

  .about-body {
    font-size: 15px;
    gap: 18px;
  }

  .about-body blockquote {
    padding: 18px 18px;
    font-size: 15px;
    margin: 8px 0;
  }

  .focus-cards,
  .portal-grid {
    gap: 16px;
  }

  .focus-card,
  .portal-app-card {
    padding: 24px 20px;
  }

  .focus-card h3,
  .portal-app-card h3 {
    font-size: 18.5px;
  }

  .stats-groups {
    margin-top: 28px;
    gap: 28px;
  }

  .stat-cell {
    padding: 18px 12px;
  }

  .stat-cell dt {
    font-size: 11.5px;
    line-height: 1.35;
  }

  .stat-cell dd {
    font-size: 30px;
    margin-top: 6px;
  }

  .linkedin-card {
    padding: 24px 18px;
    gap: 20px;
  }

  .linkedin-card .li-left {
    gap: 14px;
  }

  .li-icon {
    width: 44px;
    height: 44px;
    border-radius: 8px;
  }

  .li-icon svg {
    width: 22px;
    height: 22px;
  }

  .linkedin-card .btn {
    width: 100%;
  }

  .contact-grid {
    gap: 36px;
  }

  .contact-lead {
    margin-bottom: 24px;
    font-size: 15px;
  }

  .contact dl {
    margin: 0 0 24px;
    gap: 18px;
  }

  .contact-cta-row .btn {
    width: 100%;
  }

  .contact-map-wrap {
    min-height: 280px;
  }

  .contact-map-wrap iframe {
    min-height: 280px;
  }

  .footer-inner {
    padding: 44px 16px 28px;
  }

  .footer-logo {
    height: 22px;
  }

  .back-to-top {
    bottom: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
  }
}

/* ==========================================================================
   Scroll Reveal Animations
   ========================================================================== */

.reveal-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-on-scroll.revealed {
  opacity: 1;
  transform: translateY(0);
}

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

/* ==========================================================================
   Print Stylesheet
   ========================================================================== */

@media print {
  *, *::before, *::after {
    background: transparent !important;
    color: #111111 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  body {
    font-size: 11pt;
    line-height: 1.5;
    background: #ffffff !important;
    color: #111111 !important;
  }

  /* Hide interactive navigation, togglers and animations */
  .site-header,
  .theme-toggle-btn,
  .nav-toggle-btn,
  .mobile-nav,
  .back-to-top,
  .hero-image-wrap::after,
  .contact-map-wrap {
    display: none !important;
  }

  /* Typography and page flow */
  h1, h2, h3 {
    page-break-after: avoid;
    break-after: avoid;
    color: #000000 !important;
  }

  .hero-ep {
    color: #a3182f !important;
  }

  blockquote,
  .focus-card,
  .portal-app-card,
  .stat-grid,
  .linkedin-card,
  .v-timeline-wrap {
    page-break-inside: avoid;
    break-inside: avoid;
    border: 1px solid #dcdcdc !important;
  }

  .section-pad {
    padding: 24pt 0 !important;
  }

  /* Print link destination annotations for key contact methods */
  .contact-item a[href^="tel:"]::after {
    content: " (" attr(href) ")";
  }
  .contact-cta-row a[href^="mailto:"]::after {
    content: " (epic@tuke.sk)";
  }
}


/* Team Roster */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-top: 24px;
}
.team-card {
  padding: 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.team-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--surface);
  margin-bottom: 16px;
}
.team-card h4 {
  font-size: 18px;
  color: var(--fg);
  margin-bottom: 4px;
}
.team-role {
  font-size: 14px;
  color: var(--fg-muted);
}
.team-org {
  font-size: 14px;
  font-weight: 500;
  color: var(--primary);
  margin-top: 8px;
}


/* Thesis Topics */
.thesis-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 800px;
}
.thesis-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.thesis-item summary {
  padding: 20px 24px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 500;
  font-size: 16px;
  list-style: none; /* Hide default arrow */
}
.thesis-item summary::-webkit-details-marker {
  display: none;
}
.thesis-title {
  color: var(--fg);
}
.thesis-type {
  font-size: 13px;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  padding: 4px 10px;
  border-radius: 100px;
}
.thesis-content {
  padding: 0 24px 24px 24px;
  color: var(--fg-muted);
  font-size: 15px;
  line-height: 1.6;
}
.thesis-item[open] summary {
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.thesis-btn {
  margin-top: 16px;
}

@media (max-width: 600px) {
  .thesis-item summary {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}


