:root { --fade-dur: .7s;}

html, body { height: 100%; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 system-ui, Segoe UI, Inter, Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }

/* Containers & Sections */
.container {
  max-width: var(--maxw);
  margin-left: 20px;
  padding: 0 var(--gutter);
}
.section {
  padding: clamp(28px, 6vw, 60px) 0;
  scroll-margin-top: calc(var(--nav-h) + 8px);
}
.title {
  font-size: clamp(48px, 4vw, 36px);
  line-height: 1.2;
  margin: 0 0 6px;
  text-align: center;
}
.subtitle { color: var(--muted); text-align: center; margin: 0; }

/* =========================================
   3) Motion: Page fade-in
========================================= */
.page {
  opacity: 0;
  animation: pageFade var(--fade-dur) ease-out forwards;
}
@keyframes pageFade {
  from { opacity: 0; transform: translateY(6px); filter: blur(6px); }
  to   { opacity: 1; transform: translateY(0);   filter: blur(0); }
}
@media (prefers-reduced-motion: reduce) {
  .page { animation: none; opacity: 1; }
}

nav {
  padding: 1rem;
  display: flex;
  z-index: 10;
}

/*LOGO*/
.logo {
    color: #000;
    text-align: center;
    font:16px/1.6 system-ui, Segoe UI, Roboto, Inter, Arial, sans-serif;
    font-size: 40px;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
}

/* HAMBURGER MENU */
.ham-menu {
  height: 50px;
  width: 50px;
  margin-left: auto;
  position: relative;
  cursor: pointer;
}

.ham-menu span {
  height: 5px;
  width: 100%;
  background-color: #000000;
  border-radius: 25px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: 0.3s ease;
  z-index: 999;

}

/* Hamburger bar positions */
.ham-menu span:nth-child(1) {
  top: 25%;
}

.ham-menu span:nth-child(3) {
  top: 75%;
}

/* Hamburger animation (X state) */
.ham-menu.active span {
  background-color: #000000;
}

.ham-menu.active span:nth-child(1) {
  top: 50%;
  transform: translate(-50%, -50%) rotate(225deg);
}

.ham-menu.active span:nth-child(2) {
  opacity: 0;
}

.ham-menu.active span:nth-child(3) {
  top: 50%;
  transform: translate(-50%, -50%) rotate(315deg);
}

/* OFF-SCREEN MENU */
.off-screen-menu {
  background: #ffffff;
  height: 100vh;
  width: 100%;
  max-width: 450px;
  position: fixed;
  top: 0;
  right: -450px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: right;
  font-size: 3rem;
  transition: 0.3s ease;
  z-index: 9;
}

.off-screen-menu.active {
  right: 0;
}

.off-screen-menu ul {
  list-style: none;
  padding: 0;
}

.off-screen-menu a {
  color: rgb(0, 0, 0);
  padding: 20px 0;
  cursor: pointer;
  transition: 0.2s;
  font-family: "Secular One", sans-serif;
  font-size: 30px; 
  transform: translateY(-100%);
  text-decoration: none;
  display: block;
}

.off-screen-menu a:hover {
  color: #00f0f0;
}

.off-screen-menu .logo {
  position: fixed;
  transform: translate(-5%, -30%); 
  width: 324px;
  height: 384px;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0.4;
  transition: opacity 0.3s ease;
  z-index: 5;
}

.off-screen-menu .logo:hover {
  opacity: 1;
}

span {
  color: red;
  font-weight: bold;
}

/* Diagonal Grid with Light – fixed background */
body::before{
  content: "";
  position: fixed;
  inset: 0;                   /* phủ toàn bộ viewport */
  z-index: -2;                /* dưới toàn bộ nội dung */
  pointer-events: none;       /* không cản click/scroll */
  background-color: #fafafa;  /* giống bg-[#fafafa] */

  background-image:
    repeating-linear-gradient(
      45deg,
      rgba(0,0,0,0.1) 0,
      rgba(0,0,0,0.1) 1px,
      transparent 1px,
      transparent 20px
    ),
    repeating-linear-gradient(
      -45deg,
      rgba(0,0,0,0.1) 0,
      rgba(0,0,0,0.1) 1px,
      transparent 1px,
      transparent 20px
    );

  background-size: 40px 40px; /* khoảng cách mắt lưới */
}

footer {
  background: #e8e8e8;
  border-top: 1px solid #ccc;
  padding: 20px 0;
  margin-top: 40px;
  text-align: center ;
}

.back:hover { text-decoration: underline; }


