:root {
  /* Colours of the old ducvietjsc.vn: white page, warm taupe header, dark brown
     bands, red accent. Dark sections redefine these tokens for themselves. */
  --bg: #FFFFFF;
  --panel: #F6F4F3;
  --slot: #ECE8E7;
  --line: #E4DEDD;
  --footer: #F6F4F3;
  --taupe: #534949;
  --brown: #403535;
  --heading: #403535;
  --text: #333333;
  --soft: #4A4444;
  --muted: #6B6363;
  --dim: #756D6D;
  /* --red is the old site's accent for lines and large type; buttons use the
     slightly deeper --red-btn and links --red-text so small text stays readable. */
  --red: #E5414A;
  --red-btn: #D93640;
  --red-text: #C42B34;
  --red-hover: #A3222A;
  --shadow: rgba(64, 53, 53, 0.28);
  --gutter: clamp(20px, 5.5vw, 80px);
  --display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --body: 'Barlow', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  /* Softness + motion. One easing curve everywhere so the site moves as one thing. */
  --radius: 12px;
  --radius-sm: 8px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --fast: 0.2s;
  --slow: 0.6s;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img { max-width: 100%; height: auto; display: block; }
/* Body copy is justified; the last line of each paragraph stays left-aligned. */
p, li, blockquote { text-align: justify; text-justify: inter-word; }
a { color: var(--red-text); text-decoration: none; transition: color var(--fast) var(--ease); }
a:hover { color: var(--red-hover); }
:focus-visible { outline: 2px solid var(--red-text); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; background: var(--text); color: var(--bg); padding: 10px 14px; z-index: 30; }

/* ---------- type ---------- */
.eyebrow { font-family: var(--display); font-size: 17px; letter-spacing: 0.22em; color: var(--red-text); text-transform: uppercase; }
.mono { font-family: var(--mono); font-size: 14px; }
.accent { color: var(--red-text); }
.display-xl, .display-md, .display-sm { font-family: var(--display); font-weight: 700; text-transform: uppercase; color: var(--heading); }
.display-xl { font-size: clamp(48px, 5.6vw, 84px); line-height: 1.16; }
.display-xl span { display: block; margin-top: 0.08em; color: var(--muted); }
.display-md { font-size: clamp(40px, 4.8vw, 68px); line-height: 1.16; }
.display-sm { font-size: 34px; line-height: 1.18; }
.lead { font-size: clamp(18px, 1.4vw, 20px); color: var(--soft); max-width: 640px; }

/* ---------- buttons ---------- */
.btn { display: inline-block; padding: 16px 28px; font-weight: 600; font-size: 17px; border: 1px solid transparent; border-radius: var(--radius-sm); text-align: center; transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease), border-color var(--fast) var(--ease), transform var(--fast) var(--ease), box-shadow var(--fast) var(--ease); }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--red-btn); color: #FFFFFF; }
.btn-primary:hover { background: var(--red-text); color: #FFFFFF; box-shadow: 0 10px 24px -10px rgba(196, 43, 52, 0.6); }
.btn-outline { border-color: var(--text); color: var(--text); }
.btn-outline:hover { background: var(--text); color: var(--bg); }
.btn-light { background: var(--red-btn); color: #FFFFFF; }
.btn-light:hover { background: var(--red-text); color: #FFFFFF; }

/* ---------- header ---------- */
.site-header { --text: #FFFFFF; --muted: #D9CFCE; --line: rgba(255, 255, 255, 0.16); --red-text: #FFB0B3; --red-hover: #FFD3D5; background: var(--taupe); color: var(--text); display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 22px var(--gutter); border-bottom: 1px solid var(--line); transition: padding var(--fast) var(--ease), background-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease); }
.brand { display: flex; align-items: center; gap: 14px; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-logo { width: 48px; height: 48px; background: #FFFFFF; }
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-family: var(--display); font-weight: 700; font-size: 26px; letter-spacing: 0.04em; line-height: 1.1; }
.brand-sub { font-size: 12px; color: var(--muted); letter-spacing: 0.14em; }
.site-nav { display: flex; gap: clamp(18px, 2.4vw, 36px); font-size: 16px; font-weight: 500; }
.site-nav-inner { display: contents; }
.site-nav a { position: relative; color: var(--text); padding: 6px 0; }
.site-nav a::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--red); transform: scaleX(0); transform-origin: left; transition: transform 0.3s var(--ease); }
.site-nav a:hover { color: var(--red-hover); }
.site-nav a:hover::after, .site-nav a[aria-current="page"]::after { transform: scaleX(1); }
.header-actions { display: flex; gap: 12px; }
.header-cta { padding: 14px 22px; font-size: 15px; white-space: nowrap; }
.site-header .btn-outline:hover { color: var(--taupe); }
.mobile-bar { display: none; }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--text); font: 600 15px var(--body); padding: 10px 16px; cursor: pointer; }
@media (min-width: 761px) {
  html { scroll-padding-top: 110px; }
  .site-header { position: sticky; top: 0; z-index: 15; }
  /* Set by the header script once the page scrolls: compact, frosted, lifted. */
  .site-header.is-scrolled { padding-top: 14px; padding-bottom: 14px; background: rgba(83, 73, 73, 0.94); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: 0 12px 30px -18px var(--shadow); }
}

/* ---------- home ---------- */
.hero { display: grid; grid-template-columns: 1.15fr 1fr; gap: 56px; padding: 88px var(--gutter); align-items: center; }
.hero-copy { display: flex; flex-direction: column; gap: 28px; }
.hero-actions, .cta-actions { display: flex; flex-wrap: wrap; gap: 16px; }

.photo-slot { background: var(--slot); border: 1px solid var(--line); border-radius: var(--radius); display: flex; align-items: flex-end; padding: 18px; color: var(--muted); }
.photo-slot .mono { font-size: 12px; }
.photo-slot-hero { height: 600px; padding: 24px; }
.photo-slot-wide { aspect-ratio: 16 / 7; }
.photo-slot-card { aspect-ratio: 4 / 3; }
.card-photo { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; border-radius: var(--radius); background: var(--slot); transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), filter 0.4s var(--ease); }
.hero-photo { height: 600px; width: 100%; object-fit: cover; background: var(--slot); transform: scale(1.04); transition: transform 6s linear; }
.hero-gallery { position: relative; min-width: 0; display: grid; border-radius: var(--radius); overflow: hidden; touch-action: pan-y; }
/* Slides share one grid cell and crossfade; the inactive ones stay out of the tab order. */
.hero-slide { margin: 0; position: relative; grid-area: 1 / 1; overflow: hidden; opacity: 1; transition: opacity 0.8s var(--ease), visibility 0s; }
.hero-slide:not(.is-active) { opacity: 0; visibility: hidden; transition: opacity 0.8s var(--ease), visibility 0s 0.8s; }
.hero-slide.is-active .hero-photo { transform: scale(1); }
.hero-slide img { display: block; }
.hero-slide figcaption, .hero-controls { --text: #FFFFFF; --panel: rgba(255, 255, 255, 0.12); --line: rgba(255, 255, 255, 0.2); --red-text: #FFB0B3; --red-hover: #FFD3D5; color: var(--text); }
.hero-slide figcaption { position: absolute; left: 16px; bottom: 16px; max-width: calc(100% - 210px); padding: 12px 16px; background: rgba(64, 53, 53, 0.82); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-radius: var(--radius-sm); font-weight: 600; }
.hero-controls { position: absolute; right: 16px; bottom: 16px; display: flex; align-items: center; gap: 12px; padding: 6px; background: rgba(64, 53, 53, 0.82); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-radius: var(--radius-sm); }
.hero-controls button { width: 44px; height: 44px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; color: var(--text); font-size: 20px; cursor: pointer; transition: background-color var(--fast) var(--ease), border-color var(--fast) var(--ease); }
@media (hover: hover) { .hero-controls button:hover { background: var(--red-btn); border-color: var(--red-btn); } }

.hero-video { display: block; transform: none; }

/* ---------- video lightbox ---------- */
.video-dialog { width: min(1100px, calc(100% - 32px)); max-width: none; padding: 0; border: 0; border-radius: var(--radius); background: #000000; overflow: visible; }
.video-dialog::backdrop { background: rgba(20, 16, 16, 0.86); }
.video-frame { aspect-ratio: 16 / 9; }
.video-frame iframe { display: block; width: 100%; height: 100%; border: 0; border-radius: var(--radius); }
.video-close { position: absolute; right: 0; bottom: calc(100% + 8px); width: 44px; height: 44px; background: none; border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 6px; color: #FFFFFF; font-size: 26px; line-height: 1; cursor: pointer; }
.video-close:hover { background: var(--red-btn); border-color: var(--red-btn); }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stat { padding: 40px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.stat:first-child { padding-left: var(--gutter); }
.stat:last-child { border-right: 0; }
.stat-value { font-family: var(--display); font-size: 72px; font-weight: 700; color: var(--red); line-height: 1; }
.stat-label { font-size: 16px; color: var(--muted); }

.section { padding: 104px var(--gutter); display: flex; flex-direction: column; gap: 48px; }
.section + .section, .hero + .section, .article + .section { padding-top: 0; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.section-head > div { display: flex; flex-direction: column; gap: 12px; }
.section-link { font-size: 17px; font-weight: 600; }

.tile-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.tile { --pad: 36px; background: var(--panel); padding: var(--pad); min-height: 250px; display: flex; flex-direction: column; gap: 14px; color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: background-color 0.3s var(--ease), border-color 0.3s var(--ease), transform 0.3s var(--ease), box-shadow 0.3s var(--ease); }
.tile:hover { background: #FFFFFF; color: var(--text); border-color: #D6CDCC; transform: translateY(-4px); box-shadow: 0 18px 40px -24px var(--shadow); }
.tile .mono { color: var(--red-text); }
.tile .display-sm { color: var(--heading); }
.tile p { color: var(--muted); }
.tile-photo { width: calc(100% + 2 * var(--pad)); max-width: none; margin: calc(-1 * var(--pad)) calc(-1 * var(--pad)) 10px; aspect-ratio: 16 / 10; object-fit: cover; background: var(--slot); transition: transform 0.6s var(--ease); }
.tile:hover .tile-photo { transform: scale(1.04); }
.tile-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tile-static, .tile-static:hover { background: var(--panel); min-height: 0; border-color: var(--line); transform: none; box-shadow: none; }
.tile-accent { background: var(--red-btn); color: #FFFFFF; border-color: var(--red-btn); }
.tile-accent:hover { background: var(--red-text); color: #FFFFFF; border-color: var(--red-text); box-shadow: 0 18px 40px -20px rgba(196, 43, 52, 0.6); }
.tile-accent .mono, .tile-accent p, .tile-accent .display-sm { color: #FFFFFF; }

.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.card { display: flex; flex-direction: column; gap: 16px; color: var(--text); }
.card:hover, .card:hover .card-title { color: var(--red-text); }
.card:hover .card-photo { transform: translateY(-4px); box-shadow: 0 18px 40px -22px var(--shadow); filter: brightness(1.04); }
.card-title { transition: color var(--fast) var(--ease); }
.card-title { color: var(--heading); font-family: var(--display); font-size: 28px; font-weight: 600; text-transform: uppercase; line-height: 1.1; }
.card-meta { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.card p { color: var(--muted); font-size: 16px; }

/* ---------- inner pages ---------- */
.page-head { padding: 72px var(--gutter) 56px; display: flex; flex-direction: column; gap: 16px; border-bottom: 1px solid var(--line); }
.page-body { padding: 72px var(--gutter) 104px; display: flex; flex-direction: column; gap: 48px; }

.post-list { display: flex; flex-direction: column; }
.post-row { display: grid; grid-template-columns: 220px 1fr auto; gap: 32px; align-items: center; padding: 28px 0; border-bottom: 1px solid var(--line); color: var(--text); transition: color var(--fast) var(--ease); }
.post-row:first-child { border-top: 1px solid var(--line); }
.post-row:hover, .post-row:hover h2 { color: var(--red-text); }
.post-row h2 { color: var(--heading); transition: color var(--fast) var(--ease); font-family: var(--display); font-size: 30px; font-weight: 600; text-transform: uppercase; line-height: 1.1; margin-top: 8px; }
.post-thumb { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-sm); background: var(--slot); padding: 0; }
.post-row p { color: var(--muted); font-size: 16px; margin-top: 8px; }
.post-row .arrow { color: var(--red-text); font-size: 22px; transition: transform 0.3s var(--ease); }
.post-row:hover .arrow { transform: translateX(6px); }

/* Heading, cover and body share one centred column so their edges line up. */
.article { padding: 56px var(--gutter) 104px; display: flex; flex-direction: column; align-items: center; gap: 40px; }
.article > * { width: 100%; max-width: 860px; }
.article-head { display: flex; flex-direction: column; gap: 16px; }
.back { font-weight: 600; font-size: 15px; }
.article-cover { aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius); background: var(--slot); }
.prose { font-size: 18px; line-height: 1.7; color: var(--soft); }
.prose > * + * { margin-top: 1.1em; }
.prose h2, .prose h3 { font-family: var(--display); text-transform: uppercase; color: var(--heading); line-height: 1.1; margin-top: 1.8em; }
.prose h2 { font-size: 36px; }
.prose h3 { font-size: 26px; }
.prose strong { color: var(--text); }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li + li { margin-top: 0.4em; }
.prose img { border-radius: var(--radius-sm); background: var(--slot); }
.prose em { color: var(--muted); font-size: 16px; }
.video { aspect-ratio: 16 / 9; background: var(--slot); border-radius: var(--radius); overflow: hidden; }
.video iframe { width: 100%; height: 100%; border: 0; display: block; }
.prose blockquote { margin-left: 0; margin-right: 0; padding-left: 20px; border-left: 3px solid var(--red); color: var(--text); }
.prose table { width: 100%; border-collapse: collapse; font-size: 16px; }
.prose th, .prose td { text-align: left; padding: 12px 14px; border: 1px solid var(--line); }
.prose th { color: var(--text); background: var(--panel); }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.office-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.office { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; display: flex; flex-direction: column; gap: 8px; }
.office h2 { color: var(--heading); font-family: var(--display); font-size: 26px; text-transform: uppercase; }
.office dl { margin: 8px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 16px; }
.office dt { color: var(--muted); }
.office dd { margin: 0; color: var(--soft); overflow-wrap: anywhere; }

/* ---------- CTA + footer ---------- */
.cta-band { --heading: #FFFFFF; background: var(--brown); color: #FFFFFF; padding: 56px var(--gutter); display: flex; justify-content: space-between; align-items: center; gap: 32px; flex-wrap: wrap; }
.cta-band > div:first-child { display: flex; flex-direction: column; gap: 10px; max-width: 640px; }
.cta-band .btn-outline { border-color: #FFFFFF; color: #FFFFFF; }
.cta-band .btn-outline:hover { background: #FFFFFF; color: var(--brown); }
.cta-band .mono { color: #FFB0B3; }

.site-footer { background: var(--footer); border-top: 1px solid var(--line); padding: 64px var(--gutter) 40px; display: flex; flex-direction: column; gap: 48px; }
.footer-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 40px; }
.footer-col { display: flex; flex-direction: column; gap: 10px; font-size: 16px; color: var(--soft); }
.footer-col a { color: var(--soft); }
.footer-col a:hover { color: var(--red-hover); }
.footer-title { font-family: var(--display); font-size: 22px; font-weight: 700; text-transform: uppercase; color: var(--heading); }
.footer-title-accent { color: var(--red-text); }
.footer-legal { border-top: 1px solid var(--line); padding-top: 24px; font-size: 14px; color: var(--dim); display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.social-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--soft); font-size: 15px; font-weight: 600; }
.social-link:hover { color: #FF0000; }

/* ---------- responsive ---------- */
@media (max-width: 1320px) {
  .header-catalogue { display: none; }
}
@media (max-width: 1100px) {
  .header-actions { display: none; }
  .hero { grid-template-columns: 1fr; padding-top: 64px; padding-bottom: 64px; }
  .photo-slot-hero, .hero-photo { height: 380px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: 32px var(--gutter); border-bottom: 1px solid var(--line); }
  .stat:nth-child(2n) { border-right: 0; }
  .stat:nth-last-child(-n+2) { border-bottom: 0; }
  .tile-grid, .card-grid, .office-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .site-header { flex-wrap: wrap; padding-top: 16px; padding-bottom: 16px; }
  .nav-toggle { display: block; }
  /* Menu slides open instead of popping; grid 0fr -> 1fr animates to the content's real height. */
  .site-nav { display: grid; grid-template-rows: 0fr; width: 100%; opacity: 0; visibility: hidden; transition: grid-template-rows 0.35s var(--ease), opacity 0.25s var(--ease), visibility 0s 0.35s; }
  .site-nav.is-open { grid-template-rows: 1fr; opacity: 1; visibility: visible; transition: grid-template-rows 0.35s var(--ease), opacity 0.25s var(--ease), visibility 0s; }
  .site-nav-inner { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
  .site-nav a { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .site-nav a::after { display: none; }
  .site-nav a[aria-current="page"] { color: var(--red-text); }
  .section { padding-top: 64px; padding-bottom: 64px; gap: 32px; }
  .page-head { padding-top: 48px; padding-bottom: 40px; }
  .page-body { padding-top: 48px; padding-bottom: 64px; }
  .tile-grid, .card-grid, .office-grid, .footer-grid { grid-template-columns: 1fr; }
  .tile { --pad: 28px; min-height: 0; }
  .stat-value { font-size: 52px; }
  .post-row { grid-template-columns: 104px 1fr; gap: 16px; align-items: start; padding: 20px 0; }
  .post-row h2 { font-size: 22px; margin-top: 4px; }
  .post-row p { display: none; }
  .post-row .arrow { display: none; }
  .photo-slot-hero, .hero-photo { height: 260px; }
  .tile-grid-2 { grid-template-columns: 1fr; }
  .photo-slot-wide, .article-cover { aspect-ratio: 4 / 3; }
  .btn { width: 100%; }
  .hero-actions, .cta-actions { width: 100%; }
  .hero-slide figcaption { position: static; max-width: none; border-radius: 0; background: var(--brown); }
  .hero-controls { position: static; justify-content: space-between; border-radius: 0; background: var(--brown); }
  .section-link, .footer-col a { display: inline-block; padding: 9px 0; }
  .mobile-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 8px var(--gutter) calc(8px + env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--line); box-shadow: 0 -8px 24px -16px var(--shadow); }
  .mobile-bar .btn { padding: 14px 8px; font-size: 15px; white-space: nowrap; }
  body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
}

/* ---------- scroll reveal ---------- */
/* Only when JS is running (base layout adds .js), so content never stays hidden without it. */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity var(--slow) var(--ease), transform var(--slow) var(--ease); transition-delay: calc(var(--i, 0) * 80ms); }
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; transition-delay: 0s !important; animation-duration: 0.01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
  .btn:hover, .tile:hover, .card:hover .card-photo { transform: none; }
}

@media print {
  .js .reveal { opacity: 1; transform: none; }
}
