/* ==========================================================================
   HOÀNG ANH QUÂN — Giao diện nền (layout, màu, typography)
   Hiệu ứng động nằm trong effects.css + effects.js
   ========================================================================== */

:root {
  --navy-950: #020c1c;
  --navy-900: #04142b;
  --navy-850: #05183a;
  --navy-800: #072a52;
  --navy-700: #0a3566;
  --sea-500: #1f78c4;
  --sea-300: #7cc4ff;
  --cyan-400: #3fd3f5;
  --cyan-300: #7fe9ff;
  --cyan-100: #d6f8ff;

  --ink: #eaf6ff;
  --ink-muted: rgba(220, 238, 255, .74);
  --ink-faint: rgba(220, 238, 255, .5);
  --line: rgba(160, 220, 255, .16);

  --radius: 14px;
  --radius-lg: 22px;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);

  --font-display: "Cormorant Garamond", "Times New Roman", serif;
  --font-body: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --header-h: 72px;

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--navy-900);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
p { margin: 0 0 1em; }

.container { width: min(1200px, 100% - 32px); margin-inline: auto; }

.skip-link {
  position: fixed; left: 16px; top: -60px; z-index: 200;
  padding: 10px 16px; border-radius: 8px;
  background: var(--cyan-300); color: var(--navy-900); font-weight: 600; text-decoration: none;
  transition: top .3s var(--ease-out);
}
.skip-link:focus { top: 12px; }

[data-scene]:focus { outline: none; }

.eyebrow {
  margin: 0 0 18px;
  font-size: .74rem; font-weight: 500;
  letter-spacing: .32em; text-transform: uppercase;
  color: var(--cyan-300);
}

/* ---------------- Header ---------------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  height: var(--header-h);
  padding: 0 clamp(16px, 4vw, 48px);
  color: #fff;
  isolation: isolate;
}
.site-header::before {          /* lớp nền mờ — chỉ đổi opacity khi cuộn */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: rgba(4, 20, 43, .72);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--line);
  opacity: 0;
  transition: opacity .5s var(--ease-out);
}
.site-header::after {           /* gradient nhẹ để chữ đọc được trên trời sáng */
  content: ""; position: absolute; inset: 0 0 -30px; z-index: -2; pointer-events: none;
  background: linear-gradient(180deg, rgba(4, 20, 43, .38), rgba(4, 20, 43, 0));
  transition: opacity .5s;
}
.site-header.is-scrolled::before { opacity: 1; }
.site-header.is-scrolled::after { opacity: 0; }

.brand {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--font-display); font-weight: 600; font-size: 1.22rem;
  letter-spacing: .14em; text-decoration: none; white-space: nowrap;
}
.brand__mark {
  width: 12px; height: 12px;
  border-radius: 50% 0 50% 50%;
  transform: rotate(-45deg);
  background: radial-gradient(circle at 35% 60%, #fff 0 18%, var(--cyan-300) 50%, var(--sea-500) 100%);
  box-shadow: 0 0 12px rgba(127, 233, 255, .6);
}
.brand:focus-visible { outline: 2px solid var(--cyan-300); outline-offset: 6px; border-radius: 6px; }

.site-nav ul { display: flex; gap: clamp(14px, 2.4vw, 34px); margin: 0; padding: 0; list-style: none; }
.site-nav a {
  position: relative; display: inline-block; padding: 8px 2px;
  font-size: .76rem; font-weight: 500; letter-spacing: .18em; text-transform: uppercase;
  text-decoration: none; color: rgba(255, 255, 255, .8);
  transition: color .3s;
}
.site-nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan-300), transparent);
  transform: scaleX(0); transition: transform .5s var(--ease-out);
}
.site-nav a:hover, .site-nav a[aria-current] { color: #fff; }
.site-nav a:hover::after, .site-nav a[aria-current]::after { transform: scaleX(1); }
.site-nav a:focus-visible { outline: 2px solid var(--cyan-300); outline-offset: 4px; border-radius: 4px; }

@media (max-width: 760px) {
  :root { --header-h: 84px; }
  .site-header { flex-direction: column; justify-content: center; gap: 0; padding: 8px 16px 4px; }
  .brand { font-size: 1.05rem; }
  .site-nav { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav ul { gap: 16px; padding: 0 2px; }
  .site-nav a { font-size: .66rem; letter-spacing: .12em; white-space: nowrap; }
}

/* ---------------- Nút ---------------- */
.btn {
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 26px;
  border: 1px solid transparent; border-radius: 999px;
  font: 500 .8rem/1 var(--font-body); letter-spacing: .14em; text-transform: uppercase;
  text-decoration: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .35s var(--ease-out), box-shadow .35s var(--ease-out),
              background-color .35s, border-color .35s, filter .35s, opacity .35s;
}
.btn--primary {
  color: var(--navy-900);
  background: linear-gradient(135deg, #b4f3ff 0%, var(--cyan-400) 48%, #2a9ae6 100%);
  box-shadow: 0 10px 30px -12px rgba(63, 211, 245, .6);
}
.btn--ghost {
  color: #fff;
  background-color: rgba(255, 255, 255, .1);
  border-color: rgba(255, 255, 255, .45);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 16px 38px -14px rgba(63, 211, 245, .7); }
.btn--ghost:hover { background-color: rgba(255, 255, 255, .18); border-color: rgba(255, 255, 255, .8); }
.btn:focus-visible { outline: 2px solid var(--cyan-100); outline-offset: 3px; }
.btn:active { transform: translateY(0); filter: brightness(.94); transition-duration: .1s; }
.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: .42; cursor: not-allowed; transform: none; box-shadow: none; filter: saturate(.4);
}

/* ---------------- Hero ---------------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; place-items: center;
  min-height: 100vh; min-height: 100svh;
  background: #4b97dc;
  color: #fff;
}
.hero__layers { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.layer { position: absolute; inset: -6% -5%; will-change: transform; }

.layer--sky {
  background:
    radial-gradient(48% 34% at 66% 54%, rgba(255, 244, 214, .7), rgba(255, 244, 214, 0) 70%),
    linear-gradient(180deg, #164f99 0%, #2b72c2 24%, #5ba3e2 42%, #a6d3f5 54%, #dcefff 60%, #dcefff 100%);
}
.sun {
  position: absolute; left: 66%; top: 55%;
  width: 110px; height: 110px; margin: -55px;
  border-radius: 50%;
  background: radial-gradient(circle, #fffaf0 0 30%, rgba(255, 240, 205, .6) 48%, rgba(255, 240, 205, 0) 72%);
  animation: sun-breathe 9s ease-in-out infinite alternate;
}
@keyframes sun-breathe { from { transform: scale(.95); opacity: .9; } to { transform: scale(1.05); opacity: 1; } }

.layer--ocean {
  top: 58%; bottom: -6%;
  overflow: hidden;
  background: linear-gradient(180deg, #3b8fd0 0%, #1d63a8 12%, #0d417e 40%, #072a57 72%, #05183a 100%);
}
.layer--ocean::before {         /* hơi sương trên đường chân trời */
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .55), rgba(255, 255, 255, 0));
}
.sea-glint {                    /* vệt phản chiếu mặt trời */
  position: absolute; left: 50%; top: 0; width: 32%; height: 72%;
  transform-origin: 50% 0;
  background: repeating-linear-gradient(180deg, rgba(255, 250, 230, .8) 0 2px, rgba(255, 250, 230, 0) 2px 11px);
  -webkit-mask: radial-gradient(50% 100% at 50% 0, #000 0, rgba(0, 0, 0, .45) 45%, transparent 100%);
  mask: radial-gradient(50% 100% at 50% 0, #000 0, rgba(0, 0, 0, .45) 45%, transparent 100%);
  mix-blend-mode: screen;
  opacity: .7;
  animation: glint-shimmer 4.5s ease-in-out infinite alternate;
  will-change: transform, opacity;
}
@keyframes glint-shimmer { from { opacity: .5; } to { opacity: .85; } }

.sea-wave {
  position: absolute; left: 0; top: var(--top, 10%);
  width: 200%; height: var(--h, 40px);
  opacity: var(--o, .4);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 60' preserveAspectRatio='none'%3E%3Cpath d='M0 30 Q180 14 360 30 T720 30 T1080 30 T1440 30' fill='none' stroke='white' stroke-opacity='.55' stroke-width='1.2'/%3E%3C/svg%3E");
  background-size: 50% 100%;
  background-repeat: repeat-x;
  animation: wave-drift var(--dur, 30s) linear infinite;
  will-change: transform;
}
.sea-wave--rev { animation-direction: reverse; }
@keyframes wave-drift { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(-50%, 0, 0); } }

/* Mây — dùng chung cho hero và lớp chuyển cảnh */
.cloud,
.veil__cloud {
  background:
    radial-gradient(closest-side, rgba(255,255,255,.95), rgba(255,255,255,.6) 55%, rgba(255,255,255,0)) 4% 78% / 38% 62% no-repeat,
    radial-gradient(closest-side, rgba(255,255,255,1), rgba(255,255,255,.65) 55%, rgba(255,255,255,0)) 32% 42% / 42% 92% no-repeat,
    radial-gradient(closest-side, rgba(255,255,255,.97), rgba(255,255,255,.6) 55%, rgba(255,255,255,0)) 62% 30% / 40% 100% no-repeat,
    radial-gradient(closest-side, rgba(244,250,255,.92), rgba(244,250,255,.5) 55%, rgba(244,250,255,0)) 92% 74% / 34% 60% no-repeat,
    radial-gradient(closest-side, rgba(220,236,250,.75), rgba(220,236,250,0)) 50% 92% / 96% 34% no-repeat;
}
.cloud {
  position: absolute; left: var(--x); top: var(--y);
  width: var(--w); aspect-ratio: 2.6 / 1;
  opacity: var(--o, .8);
  filter: blur(var(--b, 4px));
  animation: cloud-drift var(--dur, 90s) ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes cloud-drift { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(var(--travel, 8vw), 0, 0); } }

.hero__content {
  position: relative; z-index: 2;
  max-width: 980px;
  padding: calc(var(--header-h) + 4vh) 16px 24vh;
  text-align: center;
  will-change: transform, opacity;
}
.hero .eyebrow { color: var(--cyan-100); text-shadow: 0 1px 14px rgba(6, 40, 90, .5); }
.hero__title {
  margin: 0;
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(2.8rem, 9.5vw, 7.6rem); line-height: 1;
  letter-spacing: .06em; text-transform: uppercase;
  text-shadow: 0 2px 40px rgba(6, 40, 90, .5), 0 1px 2px rgba(6, 40, 90, .35);
}
.hero__lead {
  max-width: 560px; margin: 22px auto 0;
  font-size: clamp(1rem, 1.6vw, 1.12rem);
  color: rgba(255, 255, 255, .92);
  text-shadow: 0 1px 18px rgba(6, 40, 90, .55);
}
.hero__cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 34px; }

.scroll-cue {
  position: absolute; left: 50%; bottom: 28px; z-index: 2;
  width: 26px; height: 42px; margin-left: -13px;
  border: 1.5px solid rgba(255, 255, 255, .6); border-radius: 14px;
}
.scroll-cue span {
  position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px;
  border-radius: 2px; background: #fff;
  animation: cue 2.2s var(--ease-in-out) infinite;
}
.scroll-cue:focus-visible { outline: 2px solid var(--cyan-100); outline-offset: 4px; }
@keyframes cue { 0% { transform: translateY(0); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(14px); opacity: 0; } }

/* ---------------- Section chung ---------------- */
.section { position: relative; padding: clamp(100px, 14vh, 150px) 0 clamp(80px, 12vh, 130px); }
.section__head { max-width: 720px; margin-bottom: clamp(36px, 6vh, 64px); }
.section__title {
  margin: 0;
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(2.4rem, 5.6vw, 4.4rem); line-height: 1.05;
}
.section__lead { margin: 18px 0 0; max-width: 60ch; font-size: 1.05rem; color: var(--ink-muted); }

.section--moments { background: var(--navy-850); }
.section--world {
  background: linear-gradient(180deg, var(--navy-800) 0%, var(--navy-700) 100%);
  overflow: hidden;
}
.section--world::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(40% 30% at 85% 10%, rgba(127, 233, 255, .1), transparent 70%),
    radial-gradient(35% 30% at 10% 90%, rgba(124, 196, 255, .08), transparent 70%);
}
.section--about { background: #041329; }

/* ---------------- Wave divider ---------------- */
.wave-divider {
  position: relative; overflow: hidden;
  height: clamp(56px, 8vw, 120px);
  margin: -1px 0;
  background: var(--from);
}
.wave-divider svg {
  position: absolute; left: 0; bottom: -1px;
  width: 200%; height: 100%;
  fill: var(--to);
  animation: wave-drift 46s linear infinite;
  will-change: transform;
}
.wave-divider .wd-back { opacity: .4; animation-duration: 64s; animation-direction: reverse; }

/* ---------------- Gallery ---------------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: clamp(200px, 30vw, 420px);
  gap: clamp(10px, 1.4vw, 18px);
  margin: 0; padding: 0; list-style: none;
}
.gallery__item { grid-column: span 3; }
.gallery__item.g-wide { grid-column: span 4; }
.gallery__item.g-tall { grid-column: span 2; }

@media (max-width: 640px) {
  .gallery { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 52vw; }
  .gallery__item, .gallery__item.g-tall { grid-column: span 1; }
  .gallery__item.g-wide { grid-column: span 2; }
}

.photo {
  position: relative; display: block;
  width: 100%; height: 100%;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--navy-800);
  box-shadow: 0 18px 40px -28px rgba(0, 0, 0, .8);
  transform: translateZ(0);
  transition: transform .6s var(--ease-out), box-shadow .6s var(--ease-out);
  -webkit-tap-highlight-color: transparent;
  outline: none;
}
.photo img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 1.2s var(--ease-out);
}
.photo::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 45%; pointer-events: none;
  background: linear-gradient(0deg, rgba(4, 20, 43, .7), transparent);
  opacity: 0; transition: opacity .5s;
}
.photo:hover {
  transform: translateY(-6px);
  box-shadow: 0 0 0 1px rgba(127, 233, 255, .25), 0 28px 60px -26px rgba(63, 211, 245, .45);
}
.photo:hover img { transform: scale(1.045); }
.photo:focus-visible { box-shadow: 0 0 0 2px var(--cyan-300), 0 0 0 7px rgba(127, 233, 255, .22); }
.photo:active { transform: translateY(-2px); }

.photo__sheen {               /* ánh sáng phản chiếu theo vị trí chuột */
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(280px circle at var(--px, 50%) var(--py, 30%), rgba(200, 248, 255, .26), rgba(127, 233, 255, .06) 40%, transparent 65%),
    linear-gradient(180deg, rgba(255, 255, 255, .07), transparent 35%);
  mix-blend-mode: screen;
  opacity: 0; transition: opacity .5s;
}
.photo:hover .photo__sheen { opacity: 1; }

.photo__label {
  position: absolute; left: 16px; right: 16px; bottom: 14px; z-index: 2;
  font-size: .74rem; letter-spacing: .16em; text-transform: uppercase;
  color: #fff; text-shadow: 0 1px 12px rgba(0, 0, 0, .6);
  opacity: 0; transform: translateY(6px);
  transition: opacity .5s var(--ease-out), transform .5s var(--ease-out);
}
.photo:hover::after, .photo:focus-visible::after { opacity: 1; }
.photo:hover .photo__label, .photo:focus-visible .photo__label { opacity: 1; transform: none; }
@media (hover: none) {
  .photo::after { opacity: 1; }
  .photo__label { opacity: 1; transform: none; }
}

/* ---------------- Thế giới của tôi ---------------- */
.world__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(16px, 2vw, 28px); }
@media (max-width: 860px) { .world__grid { grid-template-columns: 1fr; max-width: 560px; } }

.world-card {
  position: relative;
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .02));
  overflow: hidden;
}
.world-card__media { height: auto; aspect-ratio: 4 / 3; border-radius: 0; box-shadow: none; }
.world-card__media:hover { transform: none; box-shadow: none; }
.world-card { transition: transform .6s var(--ease-out), box-shadow .6s var(--ease-out), border-color .6s; }
.world-card:hover {
  transform: translateY(-6px);
  border-color: rgba(127, 233, 255, .3);
  box-shadow: 0 28px 60px -30px rgba(63, 211, 245, .45);
}
.world-card__body { padding: 22px 24px 26px; }
.world-card h3 { margin: 0 0 8px; font-family: var(--font-display); font-weight: 600; font-size: 1.8rem; }
.world-card p { margin: 0; color: var(--ink-muted); }

.world__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: clamp(32px, 5vh, 52px); }

/* ---------------- Về tôi ---------------- */
.about {
  display: grid; grid-template-columns: 5fr 6fr; align-items: center;
  gap: clamp(32px, 5vw, 80px);
}
@media (max-width: 860px) { .about { grid-template-columns: 1fr; } }
.about__visual { height: auto; aspect-ratio: 4 / 5; border-radius: var(--radius-lg); }
.about__visual:hover { transform: translateY(-4px); }
.about__text p { color: var(--ink-muted); font-size: 1.05rem; }
.about__text strong { color: var(--ink); font-weight: 600; }
.about__facts {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 28px;
  margin: 28px 0 32px; padding: 22px 0; border-block: 1px solid var(--line);
}
.about__facts dt { font-size: .7rem; letter-spacing: .22em; text-transform: uppercase; color: var(--cyan-300); }
.about__facts dd { margin: 4px 0 0; }
.about__cta { display: flex; flex-wrap: wrap; gap: 14px; }

/* ---------------- Footer ---------------- */
.site-footer { background: #030f22; border-top: 1px solid var(--line); color: var(--ink-faint); font-size: .88rem; }
.site-footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding: 28px 0; }
.site-footer p { margin: 0; }
.site-footer a { text-decoration: none; color: var(--ink-muted); }
.site-footer a:hover { color: var(--cyan-300); }
.site-footer a:focus-visible { outline: 2px solid var(--cyan-300); outline-offset: 4px; border-radius: 4px; }

/* ---------------- Giảm chuyển động ---------------- */
@media (prefers-reduced-motion: reduce) {
  .cloud, .sea-wave, .sea-glint, .sun, .wave-divider svg, .scroll-cue span { animation: none !important; }
  .btn, .photo, .photo img, .world-card { transition-duration: .01ms !important; }
}
