/* ===== Reset & biến chung ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #1e1f29;
  --accent: #ff4f6e;
  --light: #f5f5f5;

  --header-bg: #ffffff;
  --header-text: var(--primary);
  --header-hover: var(--accent);

  --transition: 0.3s ease;
}

/* ===== Body & Container ===== */
html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', sans-serif;
  color: var(--primary);
  background: var(--light);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== Header ===== */
.site-header {
  position: fixed;
  width: 100%;
  top: 0;
  left: 0;
  background: var(--header-bg);
  z-index: 1000;
  transition: background var(--transition);
}

.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70px;
}

.site-header .logo,
.site-header .nav a {
  color: var(--header-text);
  text-decoration: none;
  transition: color var(--transition);
}

.site-header .logo:hover,
.site-header .nav a:hover {
  color: var(--header-hover);
}

/* Nav mặc định trên desktop */
.nav {
  display: flex;
  gap: 1.5rem;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-toggle span {
  width: 25px;
  height: 3px;
  background: var(--header-text);
  transition: background var(--transition);
}

.nav.open {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 70px;
  right: 20px;
  background: var(--header-bg);
  padding: 1rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* ===== Hero ===== */
.hero {
  height: 100vh;
  background: url('./main/pic1.png') center/cover no-repeat fixed;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-content {
  text-align: center;
  color: var(--light);
  animation: fadeInDown 1s ease forwards;
}

.hero-content h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.hero-content p {
  font-size: 1.25rem;
  margin-bottom: 2rem;
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: var(--accent);
  color: var(--light);
  text-decoration: none;
  border-radius: 4px;
  transition: background var(--transition);
}

.btn:hover {
  background: #e0435d;
}

/* ===== Sections chung ===== */
.section {
  padding: 100px 0;
}

.section-title {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 2rem;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.grid {
  display: grid;
  gap: 2rem;
}

.grid-auto-fit {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* ===== Features ===== */
#features .card {
  background: var(--light);
  padding: 1.5rem;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.card .icon {
  font-size: 2rem;
  margin-bottom: 1rem;
}

/* ===== Gallery ===== */
.gallery-grid {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.gallery-item {
  background: #ccc;
  height: 200px;
  border-radius: 8px;
  overflow: hidden;
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

/* ===== File Links Grid ===== */
.file-links-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

.file-link-card {
  flex: 0 0 180px;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: box-shadow var(--transition);
}

.file-link-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.file-link-card a {
  display: block;
  text-decoration: none;
  color: inherit;
}

.file-link-card img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
}

.file-link-card p {
  margin: 0.5rem;
  font-size: 0.95rem;
  line-height: 1.3;
}

/* ===== Footer ===== */
.site-footer {
  background: var(--primary);
  color: var(--light);
  padding: 2rem 0;
  text-align: center;
}

.site-footer .social a {
  margin: 0 0.5rem;
  color: var(--light);
  text-decoration: none;
  transition: color var(--transition);
}

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

/* ==== Slider ==== */
.slider {
  margin: 2rem auto;
  width: clamp(300px, 80vw, 1000px);
  max-width: 800px;
  aspect-ratio: 16 / 9;
  background-size: cover;
  background-position: center;
  box-shadow: 2px 2px 12px #f0f0f0;
  animation: slider 15s linear infinite;
  border-radius: 12px;
}

@keyframes slider {
  0%   { background-image: url(./file_link/lib1.png); }
  25%  { background-image: url(./file_link/lib2.png); }
  50%  { background-image: url(./file_link/lib3.png); }
  75%  { background-image: url(./file_link/lib4.png); }
  100% { background-image: url(./file_link/lib1.png); }
}

/* ===== Keyframes ===== */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== Scroll reveal ===== */
.show-on-scroll {
  opacity: 1 !important;
  transform: translateY(0) scale(1) !important;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .nav {
    display: none;
  }
  .nav-toggle {
    display: flex;
  }
}
