/* Custom variables for theme */
:root {
  --bg-dark: #0f1211; /* Very dark background with a tiny hint of gray-green */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --accent-color: #9CCE2B; /* Official HTL Green */
  --accent-gradient: linear-gradient(135deg, #9CCE2B 0%, #83b220 100%);
  --accent-glow: rgba(156, 206, 43, 0.25);
  --card-bg: rgba(59, 59, 59, 0.45); /* Official HTL Gray (#3b3b3b) at 0.45 opacity */
  --card-border: rgba(255, 255, 255, 0.08);
  --card-border-hover: rgba(156, 206, 43, 0.45);
  --card-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
  --card-shadow-hover: 0 10px 40px -10px rgba(156, 206, 43, 0.35);
  --font-sans: 'Source Sans 3', 'Source Sans Pro', system-ui, -apple-system, sans-serif; /* Official HTL Font */
  --font-display: 'Source Sans 3', 'Source Sans Pro', var(--font-sans);
  --glass-bg: rgba(59, 59, 59, 0.3); /* Official HTL Gray */
  --glass-border: rgba(255, 255, 255, 0.06);
}

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

body {
  font-family: var(--font-sans);
  color: var(--text-primary);
  background: url('assets/background.jpg') no-repeat center center fixed;
  background-size: cover;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(9, 13, 22, 0.45) 0%, rgba(9, 13, 22, 0.9) 100%);
  z-index: -1;
  pointer-events: none;
}

/* Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
header {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: var(--glass-bg);
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 16px 0;
  transition: all 0.3s ease;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.logo-img {
  height: 38px;
  width: 82px;
  display: block;
  transition: transform 0.3s ease;
}

.logo:hover .logo-img {
  transform: scale(1.05);
}

.logo-text {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.search-container {
  position: relative;
  flex-grow: 1;
  max-width: 400px;
}

.search-input {
  width: 100%;
  padding: 12px 16px 12px 44px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: var(--font-sans);
  outline: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.search-input:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent-color);
  box-shadow: 0 0 0 4px rgba(156, 206, 43, 0.2);
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  pointer-events: none;
  transition: color 0.3s ease;
  display: flex;
  align-items: center;
}

.search-input:focus + .search-icon {
  color: var(--accent-color);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.time-widget {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 9999px;
}

.time-widget svg {
  color: var(--accent-color);
}

/* Main */
main {
  flex-grow: 1;
  padding: 60px 0;
}

.hero {
  text-align: center;
  margin-bottom: 50px;
  animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero h1 {
  font-family: var(--font-display);
  font-size: 2.75rem;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.hero p {
  font-size: 1.125rem;
  color: #cbd5e1; /* Brighter Slate-300 for higher contrast */
  max-width: 650px;
  margin: 0 auto;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
  line-height: 1.6;
}

/* Grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  animation: fadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}

/* Card */
.project-card {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--card-shadow);
  cursor: pointer;
  height: 100%;
}

.project-card:hover {
  transform: translateY(-6px);
  border-color: var(--card-border-hover);
  box-shadow: var(--card-shadow-hover);
  background: rgba(20, 30, 48, 0.55);
}

.project-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.03));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.icon-wrapper {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-card:hover .icon-wrapper {
  transform: scale(1.1);
  background: rgba(255, 255, 255, 0.08);
}

.project-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.arrow-link {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 2;
}

.project-card:hover .arrow-link {
  background: var(--accent-color);
  color: #fff;
  border-color: var(--accent-color);
  transform: rotate(-45deg);
}

.project-card-link {
  text-decoration: none;
  color: inherit;
}

.project-card-link::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  z-index: 1;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.project-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.project-description {
  font-size: 0.925rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Empty State */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  animation: fadeIn 0.5s ease;
}

.empty-state.active {
  display: flex;
}

.empty-icon {
  color: var(--text-secondary);
  opacity: 0.7;
}

.empty-state h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
}

.empty-state p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* Footer */
footer {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: var(--glass-bg);
  border-top: 1px solid var(--glass-border);
  padding: 24px 0;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: auto;
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.footer-links {
  display: flex;
  gap: 16px;
  margin-top: 4px;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Back Button & Imprint Page styles */
.back-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  margin-bottom: 30px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.back-button:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent-color);
  box-shadow: 0 0 15px var(--accent-glow);
  transform: translateX(-4px);
}

.back-button svg {
  transition: transform 0.3s ease;
}

.back-button:hover svg {
  transform: translateX(-2px);
}

.content-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 40px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--card-shadow);
  max-width: 800px;
  margin: 40px auto 60px auto;
  animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.content-card h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 24px;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 12px;
}

.content-card h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  margin: 20px 0 10px 0;
  color: var(--accent-color);
}

.content-card p {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 16px;
}

.content-card p strong {
  color: #fff;
}

.content-card a {
  color: var(--accent-color);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.content-card a:hover {
  text-decoration: underline;
}

.content-card ul {
  list-style-type: none;
  padding-left: 0;
  margin-bottom: 20px;
}

.content-card li {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 8px;
}

.content-card li strong {
  color: #fff;
  min-width: 120px;
  display: inline-block;
}

/* Media Queries */
@media (max-width: 640px) {
  .header-content {
    flex-direction: column;
    align-items: stretch;
  }
  .search-container {
    max-width: 100%;
  }
  .header-right {
    justify-content: space-between;
  }
  .hero h1 {
    font-size: 2.25rem;
  }
}
