/* ==========================================================================
   T.W. Lam & Co — modern stylesheet
   Navy + gold corporate palette, Noto Serif SC display / Noto Sans SC body
   ========================================================================== */

:root {
  --navy-950: #071a2c;
  --navy-900: #0b2438;
  --navy-800: #113049;
  --navy-700: #1a4265;
  --blue-500: #2f6f9f;
  --gold: #c6a15b;
  --gold-dark: #a9833e;
  --gold-pale: #f4ecd9;
  --ink: #22303c;
  --muted: #5c6b7a;
  --line: #dde4eb;
  --bg: #f5f7fa;
  --white: #ffffff;
  --radius: 8px;
  --shadow-sm: 0 1px 2px rgba(10, 30, 50, 0.06);
  --shadow-md: 0 10px 28px rgba(10, 30, 50, 0.10);
  --font-display: "Noto Serif SC", Georgia, "Times New Roman", serif;
  --font-body: "Noto Sans SC", "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  --container: 1160px;
  --header-h: 74px;
}

/* ---------- Reset & base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--blue-500);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--navy-800);
}

ul, ol {
  padding-left: 1.3em;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.3;
  color: var(--navy-900);
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--gold);
  color: var(--navy-950);
  padding: 8px 16px;
  z-index: 200;
  border-radius: 0 0 6px 0;
  font-weight: 700;
}

.skip-link:focus {
  left: 0;
  color: var(--navy-950);
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 6px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.4;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn-gold {
  background: var(--gold);
  color: var(--navy-950);
}

.btn-gold:hover {
  background: var(--gold-dark);
  color: var(--navy-950);
}

.btn-navy {
  background: var(--navy-800);
  color: var(--white);
}

.btn-navy:hover {
  background: var(--navy-900);
  color: var(--white);
}

.btn-ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.55);
  color: var(--white);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
}

/* ---------- Top bar ---------- */
.topbar {
  background: var(--navy-950);
  color: #b9c6d3;
  font-size: 13px;
  line-height: 1.5;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 38px;
}

.topbar-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 24px;
}

.topbar-contact span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.topbar-contact svg {
  flex: none;
  opacity: 0.85;
}

.topbar a {
  color: #d8e2ec;
  text-decoration: none;
}

.topbar a:hover {
  color: var(--gold);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: var(--header-h);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.brand-mark {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 9px;
  background: var(--navy-900);
  color: var(--gold);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.5px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 21px;
  color: var(--navy-900);
  letter-spacing: 0.2px;
}

.brand-sub {
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.4px;
}

.site-nav ul {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  padding: 0;
}

.site-nav a {
  display: block;
  padding: 10px 14px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  border-radius: 6px;
  white-space: nowrap;
}

.site-nav a:hover {
  color: var(--navy-800);
  background: var(--bg);
}

.site-nav li.active a {
  color: var(--gold-dark);
  font-weight: 700;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  width: 44px;
  height: 40px;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.nav-toggle-bar {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--navy-900);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  color: var(--white);
  background: var(--navy-900);
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-image: url("../images/hero.jpg");
  background-size: cover;
  background-position: center 40%;
  opacity: 0.92;
}

.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, rgba(7, 26, 44, 0.92) 0%, rgba(7, 26, 44, 0.72) 42%, rgba(7, 26, 44, 0.25) 78%, rgba(7, 26, 44, 0.05) 100%);
}

.hero-inner {
  position: relative;
  padding: 108px 24px 116px;
  max-width: 680px;
  margin: 0;
  margin-left: max(24px, calc((100vw - var(--container)) / 2 + 24px));
}

.hero-kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--gold);
  font-weight: 700;
  font-size: 14.5px;
  letter-spacing: 0.3px;
}

.hero-kicker::before {
  content: "";
  width: 34px;
  height: 2px;
  background: var(--gold);
}

.hero h1 {
  color: var(--white);
  font-size: clamp(32px, 4.6vw, 52px);
  font-weight: 900;
  margin: 18px 0 20px;
  letter-spacing: 0.3px;
}

.hero-lead {
  font-size: 17px;
  color: #d6e0ea;
  max-width: 58ch;
  margin-bottom: 34px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

/* ---------- Values band ---------- */
.values-band {
  background: var(--navy-800);
  color: #c9d6e2;
  border-top: 3px solid var(--gold);
}

.values-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px 48px;
  padding: 30px 0;
}

.value h3 {
  color: var(--white);
  font-size: 19px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.value h3::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  flex: none;
}

.value p {
  margin-top: 4px;
  font-size: 14.5px;
}

/* ---------- Sections ---------- */
.section {
  padding: 84px 0;
}

.section-alt {
  background: var(--white);
}

.section-head {
  max-width: 720px;
  margin-bottom: 44px;
}

.section-head.center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.section-head .rule {
  width: 42px;
  height: 3px;
  background: var(--gold);
  border-radius: 2px;
  margin-bottom: 16px;
}

.section-head.center .rule {
  margin-left: auto;
  margin-right: auto;
}

.section-head h2 {
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 800;
  margin-bottom: 12px;
}

.section-head p {
  color: var(--muted);
  font-size: 16px;
}

/* ---------- Services cards ---------- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}

.service-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 28px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.service-card:hover {
  box-shadow: var(--shadow-md);
  border-color: #c3cfdc;
  transform: translateY(-3px);
}

.service-icon {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  background: var(--navy-900);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.service-card h3 {
  font-size: 20px;
  margin-bottom: 10px;
}

.service-card p {
  color: var(--muted);
  font-size: 14.5px;
  flex: 1;
}

.service-card .card-link {
  margin-top: 18px;
  font-weight: 700;
  font-size: 14.5px;
  color: var(--navy-800);
  text-decoration: none;
}

.service-card .card-link:hover {
  color: var(--gold-dark);
}

.range-list {
  margin-top: 40px;
  padding: 26px 30px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.range-list h3 {
  font-size: 17px;
  margin-bottom: 14px;
}

.range-chips {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px 20px;
  list-style: none;
  padding: 0;
  font-size: 14.5px;
}

.range-chips li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--ink);
}

.range-chips svg {
  flex: none;
  margin-top: 4px;
  color: var(--gold-dark);
}

/* ---------- Split sections ---------- */
.split {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}

.split-image {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.split-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 4 / 3;
}

.split-body h2 {
  font-size: clamp(25px, 2.8vw, 32px);
  font-weight: 800;
  margin: 14px 0 16px;
}

.split-body p {
  color: var(--muted);
  margin-bottom: 14px;
}

.split-body ul {
  margin: 6px 0 18px;
}

.split-body li {
  margin-bottom: 7px;
}

.note-box {
  border-left: 3px solid var(--gold);
  background: var(--gold-pale);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 16px 20px;
  margin: 22px 0;
  font-size: 14.5px;
  color: var(--ink);
}

.note-box strong {
  color: var(--navy-900);
}

/* ---------- CTA band ---------- */
.cta-band {
  background: var(--navy-900);
  color: var(--white);
  padding: 64px 0;
}

.cta-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}

.cta-inner h2 {
  color: var(--white);
  font-size: clamp(24px, 2.6vw, 30px);
  font-weight: 800;
  margin-bottom: 6px;
}

.cta-inner p {
  color: #b9c6d3;
}

/* ---------- Page hero (subpages) ---------- */
.page-hero {
  background: linear-gradient(115deg, var(--navy-950) 0%, var(--navy-800) 70%, var(--navy-700) 100%);
  color: var(--white);
  padding: 56px 0 58px;
  border-bottom: 3px solid var(--gold);
}

.breadcrumb {
  font-size: 13.5px;
  color: #9fb1c1;
  margin-bottom: 14px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.breadcrumb a {
  color: #c6d4e0;
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--gold);
}

.breadcrumb .sep {
  opacity: 0.6;
}

.page-hero h1 {
  color: var(--white);
  font-size: clamp(28px, 3.6vw, 40px);
  font-weight: 900;
  margin-bottom: 12px;
}

.page-hero .page-lead {
  color: #cdd9e4;
  font-size: 16.5px;
  max-width: 66ch;
}

/* ---------- Page body grid ---------- */
.page-body {
  padding: 56px 0 84px;
}

.page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 48px;
  align-items: start;
}

.page-main {
  min-width: 0;
}

.page-main h2 {
  font-size: 23px;
  font-weight: 800;
  margin: 34px 0 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--line);
}

.page-main h2:first-child {
  margin-top: 0;
}

.page-main h3 {
  font-size: 17px;
  margin: 22px 0 8px;
}

.page-main p {
  margin-bottom: 14px;
  color: #35424e;
}

.page-main ol,
.page-main ul {
  margin: 6px 0 18px;
  padding-left: 1.4em;
}

.page-main li {
  margin-bottom: 8px;
}

.page-main li::marker {
  color: var(--gold-dark);
  font-weight: 700;
}

.service-list {
  list-style: none;
  padding: 0;
  margin: 10px 0 20px;
}

.service-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}

.service-list li:last-child {
  border-bottom: none;
}

.service-list svg {
  flex: none;
  margin-top: 4px;
  color: var(--gold-dark);
}

.service-list .li-body {
  flex: 1;
  min-width: 0;
}

.service-list .li-sub {
  display: block;
  font-size: 13.5px;
  color: var(--muted);
  margin-top: 2px;
}

/* ---------- Aside ---------- */
.page-aside {
  position: sticky;
  top: calc(var(--header-h) + 20px);
}

.aside-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 22px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.aside-card h2 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
  color: var(--navy-900);
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 2px solid var(--gold);
  display: flex;
  align-items: center;
  gap: 9px;
}

.aside-menu {
  list-style: none;
  padding: 0;
}

.aside-menu li {
  margin: 0;
}

.aside-menu a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: 6px;
  color: var(--ink);
  text-decoration: none;
  font-size: 14.5px;
  border-left: 2px solid transparent;
}

.aside-menu a:hover,
.aside-menu a.active {
  background: var(--bg);
  border-left-color: var(--gold);
  color: var(--navy-800);
  font-weight: 700;
}

.aside-contact address {
  font-style: normal;
  color: var(--ink);
  font-size: 14.5px;
  margin-bottom: 12px;
  line-height: 1.7;
}

.aside-contact .contact-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 8px;
  font-size: 14.5px;
}

.aside-contact svg {
  flex: none;
  color: var(--gold-dark);
}

/* ---------- Contact form ---------- */
.contact-form {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow-sm);
  margin-top: 20px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 22px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-field.full {
  grid-column: 1 / -1;
}

.form-field label {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy-800);
}

.form-field label em {
  color: #b02a2a;
  font-style: normal;
  font-weight: 400;
}

.form-field input,
.form-field textarea {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 11px 13px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink);
  background: var(--white);
  width: 100%;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-field textarea {
  resize: vertical;
  min-height: 150px;
}

.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(198, 161, 91, 0.22);
}

.form-field.has-error input,
.form-field.has-error textarea {
  border-color: #b02a2a;
}

.field-error {
  display: none;
  font-size: 12.5px;
  color: #b02a2a;
}

.has-error .field-error {
  display: block;
}

.form-note {
  font-size: 13px;
  color: var(--muted);
  margin-top: 14px;
}

.form-actions {
  margin-top: 22px;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--navy-900);
  color: var(--white);
  padding: 13px 22px;
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  font-size: 14.5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 300;
  max-width: min(90vw, 520px);
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy-950);
  color: #a9b8c6;
  font-size: 14.5px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr 1.1fr;
  gap: 44px;
  padding: 56px 24px 40px;
}

.footer-col h3 {
  color: var(--white);
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-col h3::before {
  content: "";
  width: 22px;
  height: 2px;
  background: var(--gold);
}

.footer-brand {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 21px;
  color: var(--white);
  margin-bottom: 10px;
}

.footer-about p {
  margin-bottom: 16px;
}

.footer-col ul {
  list-style: none;
  padding: 0;
}

.footer-col li {
  margin-bottom: 9px;
}

.footer-col a {
  color: #b9c6d3;
  text-decoration: none;
}

.footer-col a:hover {
  color: var(--gold);
}

.footer-col address {
  font-style: normal;
  line-height: 1.8;
  margin-bottom: 12px;
}

.footer-col .contact-line {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 8px;
}

.footer-col .contact-line svg {
  flex: none;
  margin-top: 4px;
  color: var(--gold);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  padding: 18px 0;
  font-size: 13px;
  color: #7f93a5;
}

.footer-bottom .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .page-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .page-aside {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }

  .range-chips {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 860px) {
  .nav-toggle {
    display: flex;
  }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    display: none;
    padding: 10px 24px 18px;
  }

  .site-nav.is-open {
    display: block;
  }

  .site-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
  }

  .site-nav a {
    padding: 12px 10px;
    white-space: normal;
  }

  .topbar-contact .topbar-hide-md {
    display: none;
  }

  .services-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .split {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .split-image {
    order: -1;
  }

  .values-inner {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .hero-inner {
    margin-left: auto;
    padding: 84px 24px 90px;
    max-width: 640px;
  }
}

@media (max-width: 640px) {
  .section {
    padding: 60px 0;
  }

  .topbar-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .brand-sub {
    font-size: 10.5px;
  }

  .brand-name {
    font-size: 18px;
  }

  .page-grid {
    gap: 32px;
  }

  .page-aside {
    grid-template-columns: 1fr;
  }

  .range-chips {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .contact-form {
    padding: 22px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 44px 24px 32px;
  }

  .footer-bottom .container {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .hero-actions .btn {
    width: 100%;
    text-align: center;
  }
}

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
