/* Xuân Sơn — công trình thép. Cobalt sơn tôn, vàng an toàn, trắng bảng thông tin. */
:root {
  --cobalt: #173a8f;
  --cobalt-deep: #0f2563;
  --cobalt-line: #3a5fb8;
  --signal: #ffb703;
  --signal-ink: #3a2700;
  --paper: #f3f5f9;
  --white: #ffffff;
  --ink: #0d1730;
  --ink-soft: #3d4a68;
  --rule: #cdd5e4;
  --on-cobalt: #eaf0ff;
  --on-cobalt-soft: #b9c8ee;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --pad: clamp(1.25rem, 4vw, 3.5rem);
  --max: 76rem;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--body); font-size: 1.0625rem; line-height: 1.65;
  color: var(--ink); background: var(--paper);
}
::selection { background: var(--signal); color: var(--signal-ink); }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 3px; }
.on-cobalt :focus-visible { outline-color: var(--signal); }
a { color: inherit; text-underline-offset: 0.2em; }
img, svg { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 0.98; margin: 0; text-wrap: balance; letter-spacing: 0; text-transform: uppercase; }
h1 { font-size: clamp(3.4rem, 10vw, 7.5rem); }
h2 { font-size: clamp(2.3rem, 5.5vw, 4rem); }
h3 { font-size: 1.6rem; line-height: 1.05; }
p { margin: 0 0 1em; max-width: 68ch; }
.wrap { max-width: var(--max); margin: 0 auto; padding-inline: var(--pad); }
.skip { position: absolute; left: -999px; top: 0; background: var(--signal); color: var(--signal-ink); padding: .6rem 1rem; z-index: 99; }
.skip:focus { left: 0; }
table, .num { font-variant-numeric: tabular-nums; }
.ph { background: repeating-linear-gradient(135deg, #fff3cc 0 8px, #ffe9a3 8px 16px); color: var(--signal-ink); padding: .08em .4em; border-radius: 2px; font-size: .9em; display: inline-block; }

/* ---------- Header ---------- */
.site-head { background: var(--cobalt-deep); color: var(--white); position: sticky; top: 0; z-index: 20; border-bottom: 3px solid var(--signal); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.25rem; }
.brand { display: flex; align-items: center; gap: .75rem; flex-shrink: 0; text-decoration: none; font-family: var(--display); text-transform: uppercase; font-weight: 700; line-height: 1; }
.brand-mark { width: 2.65rem; height: 2.65rem; flex: none; object-fit: contain; }
.brand b { display: block; font-size: 1.55rem; letter-spacing: .02em; }
.brand small { display: block; font-size: .8rem; font-weight: 500; letter-spacing: .12em; color: var(--on-cobalt-soft); margin-top: .2rem; }
.head-end { display: flex; align-items: center; gap: .6rem; }
.nav { display: flex; gap: .1rem; align-items: center; justify-content: flex-end; }
.nav a { text-decoration: none; padding: .5rem .56rem; font-size: .88rem; font-weight: 500; color: var(--on-cobalt); border-radius: 3px; white-space: nowrap; transition: background .2s var(--ease), color .2s var(--ease); }
.nav a:hover { background: rgba(255,255,255,.12); }
.nav a[aria-current="page"] { background: var(--signal); color: var(--signal-ink); font-weight: 700; }
.lang-switch { display: inline-flex; align-items: center; gap: 2px; padding: 2px; background: rgba(255,255,255,.06); border: 1.5px solid var(--cobalt-line); border-radius: 3px; flex-shrink: 0; }
.lang-switch button { font-family: var(--display); font-weight: 700; font-size: .92rem; letter-spacing: .06em; line-height: 1; padding: .36rem .52rem; border: 0; border-radius: 2px; background: transparent; color: var(--on-cobalt); cursor: pointer; transition: background .2s var(--ease), color .2s var(--ease); }
.lang-switch button:hover { background: rgba(255,255,255,.12); }
.lang-switch button[aria-pressed="true"] { background: var(--signal); color: var(--signal-ink); }
.nav-toggle { display: none; background: none; border: 2px solid var(--on-cobalt-soft); color: var(--white); padding: .45rem .75rem; font: inherit; font-size: .95rem; font-weight: 600; border-radius: 3px; cursor: pointer; }
@media (max-width: 1200px) {
  .nav-toggle { display: block; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--cobalt-deep); flex-direction: column; align-items: stretch; padding: .5rem var(--pad) 1.2rem; border-bottom: 3px solid var(--signal); }
  .nav.open { display: flex; }
  .nav a { padding: .9rem .4rem; font-size: 1.05rem; border-bottom: 1px solid rgba(255,255,255,.12); border-radius: 0; }
}

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: .7rem; font: 700 1.05rem/1 var(--body); text-decoration: none; padding: 1.05rem 1.5rem; border-radius: 3px; border: 2px solid transparent; cursor: pointer; transition: transform .25s var(--ease), background .2s, box-shadow .25s var(--ease); }
.btn svg { width: 1.2rem; height: 1.2rem; transition: transform .3s var(--ease); }
.btn:hover svg { transform: translateX(4px); }
.btn-signal { background: var(--signal); color: var(--signal-ink); box-shadow: 0 6px 18px -6px rgba(0,0,0,.45); }
.btn-signal:hover { background: #ffc633; transform: translateY(-2px); }
.btn-signal:active { transform: translateY(0); }
.btn-line { border-color: var(--on-cobalt-soft); color: var(--white); }
.btn-line:hover { background: rgba(255,255,255,.1); }
.btn-ink { background: var(--cobalt); color: var(--white); }
.btn-ink:hover { background: var(--cobalt-deep); transform: translateY(-2px); }

/* ---------- Hero ---------- */
.on-cobalt { color: var(--on-cobalt); }
.sheet { /* corrugated painted-steel ground */
  background-color: var(--cobalt);
  background-image:
    repeating-linear-gradient(90deg, rgba(255,255,255,.055) 0 2px, rgba(0,0,0,.09) 2px 4px, transparent 4px 44px),
    linear-gradient(180deg, var(--cobalt) 0%, #123078 100%);
}
.hero { position: relative; overflow: hidden; padding-block: clamp(3rem, 8vw, 6rem) 0; }
.hero .wrap { position: relative; z-index: 2; }
.hero h1 { color: var(--white); max-width: 11ch; text-shadow: 0 3px 16px rgba(0,0,0,.45); }
.hero h1 em { font-style: normal; color: var(--signal); }
.hero-lede { font-size: clamp(1.1rem, 2vw, 1.3rem); color: var(--on-cobalt); max-width: 40ch; margin: 1.6rem 0 2rem; text-shadow: 0 2px 12px rgba(0,0,0,.45); }
.hero-cta { display: flex; flex-wrap: wrap; gap: .9rem; }
.hero-art { position: absolute; right: -2%; top: 1%; width: min(74vw, 56rem); z-index: 1; opacity: .84; pointer-events: none; -webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,.36) 0%, rgba(0,0,0,.85) 36%, #000 55%); mask-image: linear-gradient(90deg, rgba(0,0,0,.36) 0%, rgba(0,0,0,.85) 36%, #000 55%); }
.hero-art svg, .hero-art img { width: 100%; height: auto; }
.hero-art .strut { stroke: var(--on-cobalt); stroke-width: 1.6; stroke-linecap: round; opacity: .55; }
.hero-art .strut.hi { stroke: var(--signal); stroke-width: 2.4; opacity: 1; }
.hero-art .node { fill: var(--cobalt-deep); stroke: var(--signal); stroke-width: 2; }
.hero-art .ground { stroke: var(--on-cobalt-soft); stroke-width: 1.5; stroke-dasharray: 3 8; opacity: .6; }
@media (max-width: 800px) { .hero-art { width: 130vw; right: -45%; top: 14%; opacity: .35; } }
.hero-draw .strut { stroke-dasharray: 600; stroke-dashoffset: 600; animation: draw 2.4s var(--ease) forwards; }
.hero-draw .strut:nth-child(3n) { animation-delay: .25s; }
.hero-draw .strut:nth-child(3n+1) { animation-delay: .5s; }
.hero-draw .node { opacity: 0; animation: pop .6s var(--ease) 1.4s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pop { to { opacity: 1; } }

/* ---------- Project board (the six functions) ---------- */
.board { position: relative; z-index: 2; margin-top: clamp(3rem, 7vw, 5.5rem); background: var(--white); color: var(--ink); border-top: 8px solid var(--signal); box-shadow: 0 -18px 40px -18px rgba(0,0,0,.4); }
.board-head, .board-row { padding-inline: clamp(1rem, 3vw, 2rem); }
.board-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 1rem clamp(1rem, 3vw, 2rem); border-bottom: 2px solid var(--ink); font-family: var(--display); text-transform: uppercase; font-weight: 600; letter-spacing: .08em; font-size: 1.05rem; color: var(--cobalt); }
.board-row { display: grid; grid-template-columns: minmax(8.5rem, 14rem) 1fr auto; gap: 1.5rem; align-items: center; padding: 1.5rem clamp(1rem, 3vw, 2rem); border-bottom: 1px solid var(--rule); text-decoration: none; transition: background .25s var(--ease), padding .35s var(--ease); }
.board-row:hover { background: #fff7e0; padding-inline: clamp(1.4rem, 3.5vw, 2.5rem) clamp(.6rem, 2vw, 1.5rem); }
.board-row .field { font-family: var(--display); text-transform: uppercase; font-weight: 600; letter-spacing: .06em; color: var(--ink-soft); font-size: 1.05rem; }
.board-row .val { font-family: var(--display); text-transform: uppercase; font-weight: 700; font-size: clamp(1.7rem, 3.4vw, 2.5rem); line-height: 1; color: var(--cobalt-deep); }
.board-row .val small { display: block; font: 400 1rem/1.5 var(--body); text-transform: none; color: var(--ink-soft); margin-top: .5rem; max-width: 56ch; }
.board-row svg { width: 1.8rem; height: 1.8rem; color: var(--cobalt); transition: transform .3s var(--ease); }
.board-row:hover svg { transform: translateX(6px); }
@media (max-width: 700px) { .board-row { grid-template-columns: 1fr auto; } .board-row .field { grid-column: 1 / -1; margin-bottom: -.8rem; } }

/* ---------- Sections ---------- */
section { padding-block: clamp(3.5rem, 8vw, 6.5rem); }
.sec-head { max-width: 46rem; margin-bottom: 2.5rem; }
.sec-head h2 { color: var(--cobalt-deep); }
.sec-head p { margin-top: 1rem; color: var(--ink-soft); font-size: 1.15rem; }
.dark { background: var(--cobalt-deep); color: var(--on-cobalt); }
.dark .sec-head h2 { color: var(--white); }
.dark .sec-head p { color: var(--on-cobalt-soft); }

/* configurator */
.config { display: grid; grid-template-columns: minmax(0, 22rem) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; }
@media (max-width: 860px) { .config { grid-template-columns: 1fr; } }
.controls { display: grid; gap: 1.6rem; }
.ctl label { display: flex; justify-content: space-between; font-weight: 600; margin-bottom: .6rem; }
.ctl output { font-family: var(--display); font-size: 1.5rem; color: var(--signal); line-height: 1; }
input[type=range] { width: 100%; accent-color: var(--signal); height: 1.6rem; cursor: pointer; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; }
.seg button { font: 600 1rem var(--body); padding: .8rem; background: transparent; color: var(--on-cobalt); border: 2px solid var(--cobalt-line); border-radius: 3px; cursor: pointer; transition: background .2s, color .2s; }
.seg button[aria-pressed="true"] { background: var(--signal); color: var(--signal-ink); border-color: var(--signal); }
.stage { background: var(--cobalt); border: 2px solid var(--cobalt-line); border-radius: 4px; padding: 1rem; }
.stage svg { width: 100%; height: auto; }
.stage .strut { stroke: var(--on-cobalt); stroke-width: 1.4; stroke-linecap: round; opacity: .8; }
.stage .strut.top { stroke: var(--signal); stroke-width: 2; opacity: 1; }
.stage .node { fill: var(--cobalt-deep); stroke: var(--signal); stroke-width: 1.8; }
.readout { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--cobalt-line); margin-top: 1rem; border-radius: 3px; overflow: hidden; }
.readout div { background: var(--cobalt-deep); padding: .9rem 1rem; }
.readout dt { font-size: .85rem; color: var(--on-cobalt-soft); }
.readout dd { margin: 0; font-family: var(--display); font-weight: 700; font-size: 2.2rem; line-height: 1.1; color: var(--white); }
.note { font-size: .92rem; color: var(--on-cobalt-soft); margin-top: 1rem; }

/* process steps */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; counter-reset: s; }
.steps li { display: grid; grid-template-columns: 4.5rem 1fr; gap: 1.2rem; padding: 1.5rem 0; border-top: 1px solid var(--rule); counter-increment: s; }
.steps li::before { content: counter(s); font-family: var(--display); font-weight: 700; font-size: 3rem; line-height: .9; color: var(--signal); -webkit-text-stroke: 0; text-shadow: 0 0 0 var(--cobalt); }
.steps h3 { margin-bottom: .4rem; color: var(--cobalt-deep); }
.steps p { margin: 0; color: var(--ink-soft); }
.dark .steps li { border-color: var(--cobalt-line); }
.dark .steps h3 { color: var(--white); }
.dark .steps p { color: var(--on-cobalt-soft); }

/* split text blocks */
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1.5rem, 4vw, 4rem); }
.cols-wide-art { grid-template-columns: minmax(0, .82fr) minmax(0, 1.38fr); align-items: center; gap: clamp(1.5rem, 3.5vw, 3rem); }
@media (max-width: 800px) { .cols, .cols-wide-art { grid-template-columns: 1fr; } }
.list-rule { list-style: none; padding: 0; margin: 0; }
.list-rule li { padding: .9rem 0; border-top: 1px solid var(--rule); }
.list-rule li strong { display: block; font-family: var(--display); text-transform: uppercase; font-size: 1.35rem; color: var(--cobalt-deep); letter-spacing: .01em; }
.dark .list-rule li { border-color: var(--cobalt-line); }
.dark .list-rule li strong { color: var(--white); }

/* data table */
.tbl { width: 100%; border-collapse: collapse; font-size: 1rem; }
.tbl th, .tbl td { text-align: left; padding: .9rem 1rem .9rem 0; border-top: 1px solid var(--rule); vertical-align: top; }
.tbl thead th { border-top: 2px solid var(--ink); font-family: var(--display); text-transform: uppercase; letter-spacing: .06em; font-size: 1rem; color: var(--cobalt); }
.tbl td:first-child { font-weight: 700; color: var(--cobalt-deep); white-space: nowrap; }
.tbl-wrap { overflow-x: auto; }

/* placeholders for supplied assets */
.slot { border: 2px dashed var(--cobalt-line); border-radius: 4px; min-height: 16rem; display: grid; place-items: center; text-align: center; padding: 1.5rem; background: repeating-linear-gradient(45deg, rgba(23,58,143,.04) 0 14px, transparent 14px 28px); color: var(--ink-soft); }
.slot strong { display: block; font-family: var(--display); font-size: 1.5rem; text-transform: uppercase; color: var(--cobalt); letter-spacing: .03em; }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1rem; }
.slot.wide { min-height: 22rem; }
.dark .slot { color: var(--on-cobalt-soft); border-color: var(--cobalt-line); }
.dark .slot strong { color: var(--signal); }

/* project photo gallery */
.proj-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 1.5rem; }
.proj-item { margin: 0; }
.proj-frame { aspect-ratio: 4 / 3; overflow: hidden; border-radius: 4px; border: 1px solid var(--rule); background: var(--cobalt-deep); }
.proj-frame img { width: 100%; height: 100%; object-fit: cover; transition: transform .55s var(--ease); }
.proj-item:hover .proj-frame img { transform: scale(1.03); }
.proj-item figcaption { margin-top: .75rem; font-family: var(--display); font-weight: 700; font-size: 1.35rem; line-height: 1.25; text-transform: uppercase; letter-spacing: .01em; color: var(--cobalt-deep); }
.dark .proj-frame { border-color: var(--cobalt-line); }
.dark .proj-item figcaption { color: var(--white); }

/* figure drawings */
.fig { margin: 0; align-self: center; background: var(--white); border: 1px solid var(--rule); border-radius: 4px; padding: 1.25rem; box-shadow: 0 10px 28px -18px rgba(15,37,99,.25); }
.fig svg, .fig img { width: 100%; height: auto; }
.fig figcaption { font-size: .95rem; font-weight: 500; color: var(--ink-soft); margin-top: .75rem; text-align: center; }
.fig .l { stroke: var(--cobalt); stroke-width: 1.6; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.fig .d { stroke: var(--ink-soft); stroke-width: 1; fill: none; stroke-dasharray: 4 4; }
.fig .k { fill: var(--signal); stroke: var(--cobalt-deep); stroke-width: 1.4; }
.fig text { font: 600 13px var(--body); fill: var(--ink-soft); }

/* CTA band */
.cta-band { background: var(--signal); color: var(--signal-ink); padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.cta-band .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem 3rem; }
.cta-band h2 { font-size: clamp(2.2rem, 5vw, 3.6rem); max-width: 16ch; }
.cta-band p { margin: .8rem 0 0; font-size: 1.1rem; }
.cta-band .btn-ink { background: var(--cobalt-deep); }

/* page hero (sub pages) */
.page-hero { position: relative; overflow: hidden; padding-block: clamp(3rem, 7vw, 5.5rem) clamp(2.5rem, 5vw, 4rem); }
.page-hero .wrap { position: relative; z-index: 2; }
.page-hero .hero-art { right: -2%; top: 50%; transform: translateY(-48%); width: min(74vw, 56rem); opacity: .82; -webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,.38) 0%, rgba(0,0,0,.85) 36%, #000 55%); mask-image: linear-gradient(90deg, rgba(0,0,0,.38) 0%, rgba(0,0,0,.85) 36%, #000 55%); }
@media (max-width: 900px) { .page-hero .hero-art { width: 115vw; right: -25%; top: 52%; opacity: .35; } }
.page-hero h1 { font-size: clamp(3rem, 8vw, 6rem); color: var(--white); max-width: 14ch; text-shadow: 0 3px 16px rgba(0,0,0,.45); }
.page-hero p { color: var(--on-cobalt); font-size: 1.2rem; max-width: 52ch; margin-top: 1.4rem; text-shadow: 0 2px 12px rgba(0,0,0,.45); }
.crumb { font-size: .9rem; margin-bottom: 1.2rem; color: var(--on-cobalt-soft); }
.crumb a { color: var(--on-cobalt); }

/* form */
.form { display: grid; gap: 1.1rem; max-width: 40rem; }
.form label { display: grid; gap: .4rem; font-weight: 600; }
.form input, .form select, .form textarea { font: inherit; padding: .85rem 1rem; border: 2px solid var(--rule); border-radius: 3px; background: var(--white); color: var(--ink); }
.form input:focus, .form select:focus, .form textarea:focus { border-color: var(--cobalt); outline: 3px solid rgba(255,183,3,.6); outline-offset: 0; }
.form textarea { min-height: 8rem; resize: vertical; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
@media (max-width: 600px) { .form .row { grid-template-columns: 1fr; } }

/* footer */
.foot { background: var(--cobalt-deep); color: var(--on-cobalt-soft); padding-block: 3rem 2rem; font-size: .98rem; }
.foot .grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2.5rem; }
@media (max-width: 800px) { .foot .grid { grid-template-columns: 1fr; } }
.foot h3 { color: var(--white); font-size: 1.25rem; margin-bottom: .8rem; letter-spacing: .05em; }
.foot-brand { display: flex; align-items: center; gap: .75rem; margin-bottom: .8rem; }
.foot-brand img { width: 2.55rem; height: 2.55rem; flex: none; object-fit: contain; }
.foot-brand h3 { margin-bottom: 0; line-height: 1.15; }
.foot ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.foot a { color: var(--on-cobalt); }
.foot .legal { border-top: 1px solid var(--cobalt-line); margin-top: 2.5rem; padding-top: 1.2rem; font-size: .88rem; }

/* reveal */
.rv { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.rv.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rv { opacity: 1; transform: none; transition: none; }
  .hero-draw .strut { animation: none; stroke-dashoffset: 0; }
  .hero-draw .node { animation: none; opacity: 1; }
  * { transition-duration: .01ms !important; }
}

/* video */
.vid { margin: 0; }
.vid video { width: 100%; max-height: 80vh; background: #000; border-radius: 4px; border: 2px solid var(--cobalt-line); display: block; }
.yt-box { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 4px; border: 2px solid var(--cobalt-line); overflow: hidden; }
.yt-box iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.yt-fallback { position: absolute; inset: 0; display: grid; place-items: center; text-decoration: none; }
.yt-fallback img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .92; transition: transform .4s var(--ease), opacity .25s; }
.yt-fallback:hover img { transform: scale(1.03); opacity: 1; }
.yt-play { position: relative; z-index: 1; width: 4.25rem; filter: drop-shadow(0 6px 14px rgba(0,0,0,.5)); transition: transform .25s var(--ease); }
.yt-fallback:hover .yt-play { transform: scale(1.08); }
.vid-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); gap: 1.5rem; }
.vid figcaption { font-size: .95rem; font-weight: 600; color: var(--ink-soft); margin-top: .65rem; }
.dark .vid figcaption { color: var(--on-cobalt-soft); }
