/* =========================================================================
   Helen West — helenwest.ca landing site
   Built on the Helen West Design System tokens. Mobile first.
   ========================================================================= */

/* ---------- Base ---------- */

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

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

body {
  margin: 0;
  background: var(--surface-page);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }

h1, h2, h3, h4 { font-weight: var(--weight-regular); margin: 0; }
p { margin: 0; }

:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 2px solid transparent;   /* keeps a ring in forced-colours mode */
  outline-offset: 2px;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

:lang(zh), .zh { font-family: var(--font-zh); }

/* ---------- Utilities ---------- */

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translate(-50%, -120%);
  z-index: 100;
  padding: 12px 20px;
  background: var(--ink-900);
  color: var(--text-inverse);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  transition: transform var(--dur-fast) var(--ease-standard);
}
.skip-link:focus { transform: translate(-50%, 0); color: var(--text-inverse); text-decoration: none; }

.wrap {
  width: min(100% - (2 * var(--gutter)), var(--wrap-max, 900px));
  margin-inline: auto;
}

.wrap--narrow { --wrap-max: 760px; }
.wrap--wide { --wrap-max: 1080px; }

:root { --gutter: 20px; }
@media (min-width: 700px) { :root { --gutter: 32px; } }

.eyebrow {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--clay-600);
  margin: 0 0 28px;
  text-align: center;
}
.eyebrow--brass { color: var(--brass-400); margin-bottom: 18px; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 52px;
  padding: 0 28px;
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  line-height: 1;
  text-align: center;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-standard),
              color var(--dur-fast) var(--ease-standard),
              border-color var(--dur-fast) var(--ease-standard);
}
.btn:hover { text-decoration: none; }

.btn--primary { background: var(--action-primary-rest); color: var(--text-on-primary); }
.btn--primary:hover { background: var(--clay-700); color: var(--text-on-primary); }
.btn--primary:active { background: var(--clay-800); }

.btn--ghost { background: transparent; color: var(--clay-600); }
.btn--ghost:hover { background: var(--clay-100); color: var(--clay-700); }
.btn--ghost:active { background: var(--clay-100); color: var(--clay-800); }

.btn--secondary { background: transparent; color: var(--ink-900); border-color: var(--border-input); }
.btn--secondary:hover { background: var(--cream-100); color: var(--ink-900); }

.btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  margin-top: var(--space-7);
}
@media (max-width: 479px) {
  .cta-row { flex-direction: column; align-items: stretch; }
  .cta-row .btn { width: 100%; }
}

/* ---------- Header ---------- */

.page-top { position: relative; }

.site-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 36px var(--gutter) 0;
  text-align: center;
}
@media (min-width: 700px) { .site-header { padding-top: 44px; } }

.site-header__mark { width: 44px; height: 37px; }

.site-header__lockup {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--umber-600);
  line-height: 1.4;
}

/* Vertical brand accent: 诚信 · 坚韧 · 卓越
   Below 1200px it sits horizontally under the lockup so it survives on phones,
   where the original absolute position collided with the header. */
.accent-zh {
  font-size: var(--text-sm);
  letter-spacing: .3em;
  color: var(--umber-600);
  text-align: center;
  margin-top: var(--space-2);
}
@media (min-width: 1200px) {
  .accent-zh {
    position: absolute;
    top: 120px;
    right: max(24px, calc((100% - 1440px) / 2 + 72px));
    margin: 0;
    writing-mode: vertical-rl;
    /* Without this the vertical text wraps one glyph per line inside the
       header's short containing block and reads back to front. */
    white-space: nowrap;
    font-size: 15px;
    letter-spacing: .35em;
  }
}

/* ---------- Letter ---------- */

.letter { padding: 40px 0 56px; }
@media (min-width: 700px) { .letter { padding: 64px 0 88px; } }

.sheet {
  position: relative;
  background: var(--surface-card);
  border: 1px solid var(--sand-200);
  border-radius: 3px;
  padding: 40px 26px 36px;
  transform: rotate(-.35deg);
  box-shadow: 0 26px 55px rgba(43, 36, 27, .16), 0 3px 8px rgba(43, 36, 27, .07);
}
@media (min-width: 600px) { .sheet { padding: 56px 48px 52px; } }
@media (min-width: 900px) { .sheet { padding: 84px 96px 76px; } }

/* Second page peeking past the edges. Must be a child of the sheet so it can
   never overlap surrounding content. */
.sheet__under {
  position: absolute;
  inset: 12px -7px -6px 8px;
  z-index: -1;
  background: var(--surface-card);
  border: 1px solid var(--sand-200);
  border-radius: 3px;
  transform: rotate(.85deg);
  box-shadow: var(--shadow-card);
}

/* Folded bottom-right corner: ::before masks the sheet with the page colour,
   ::after draws the fold itself. */
.sheet::before,
.sheet::after {
  content: "";
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 40px;
  height: 40px;
}
@media (min-width: 600px) { .sheet::before, .sheet::after { width: 52px; height: 52px; } }

.sheet::before {
  background: var(--surface-page);
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
}
.sheet::after {
  clip-path: polygon(0 0, 100% 0, 0 100%);
  background: linear-gradient(135deg, #FFFFFF 25%, #F3ECDF 62%, #DCCFBA 100%);
  filter: drop-shadow(-2px 2px 3px rgba(43, 36, 27, .18));
}

.letter__salutation {
  font-family: var(--font-display);
  font-size: clamp(34px, 8vw, 56px);
  line-height: 1.12;
  margin: 0 0 var(--space-2);
}

.rule {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: var(--space-5) 0 var(--space-6);
}
.rule::before,
.rule::after { content: ""; height: 1px; flex: 1; background: var(--sand-300); }
.rule__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brass-500); }

.letter__body {
  display: flex;
  flex-direction: column;
  gap: 22px;
  font-size: clamp(16px, 1.2vw + 12px, 18px);
  line-height: 1.75;
  color: var(--umber-700);
}

.signature {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  margin-top: var(--space-6);
  flex-wrap: wrap;
}
.signature__portrait {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top;
  box-shadow: var(--shadow-card);
  flex-shrink: 0;
}
.signature__name { font-family: var(--font-display); font-size: clamp(28px, 5vw, 34px); line-height: 1; }
.signature__meta { font-size: var(--text-sm); color: var(--umber-600); margin-top: 6px; }

/* ---------- Band layout ---------- */

.band { padding: 56px 0; }
@media (min-width: 700px) { .band { padding: 72px 0; } }

.band--sunken {
  background: var(--surface-sunken);
  border-top: 1px solid var(--sand-200);
  border-bottom: 1px solid var(--sand-200);
}
.band--ink { background: var(--surface-inverse); }
@media (min-width: 700px) { .band--ink { padding: 80px 0; } }

/* ---------- Services ---------- */

.services { list-style: none; margin: 0; padding: 0; }
.services__item {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2);
  padding: 22px 0;
  border-bottom: 1px solid var(--sand-300);
}
.services__item:last-child { border-bottom: 0; padding-bottom: 0; }
.services__item:first-child { padding-top: 0; }

@media (min-width: 560px) {
  .services__item {
    grid-template-columns: 80px 1fr;
    gap: var(--space-5);
    align-items: baseline;
    padding: 26px 0;
  }
}

.services__numeral {
  font-family: var(--font-display);
  font-size: clamp(24px, 4vw, 30px);
  line-height: 1;
  color: var(--brass-700);
}
.services__title { font-family: var(--font-display); font-size: clamp(21px, 3vw, 24px); margin-bottom: 6px; }
.services__text { font-size: 15px; line-height: 1.6; color: var(--umber-600); }

/* ---------- Timeline ---------- */

.timeline { margin: 0; }
.timeline__row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  padding: 16px 0;
  border-top: 1px solid var(--sand-200);
}
.timeline__row:first-child { border-top: 0; padding-top: 0; }

@media (min-width: 560px) {
  .timeline__row {
    grid-template-columns: 110px 1fr;
    gap: 28px;
    align-items: baseline;
    padding: 18px 0;
  }
}

.timeline dt { font-family: var(--font-display); font-size: var(--text-xl); color: var(--ink-900); }
.timeline dd { margin: 0; font-size: var(--text-base); line-height: 1.6; color: var(--umber-700); }

/* ---------- Contact band ---------- */

.contact-band { text-align: center; --wrap-max: 760px; }
.contact-band__title {
  font-family: var(--font-display);
  font-size: clamp(30px, 5.5vw, 44px);
  line-height: 1.15;
  color: var(--text-inverse);
  margin: 0 0 14px;
}
.contact-band__sub { font-size: var(--text-base); color: rgba(248, 243, 234, .78); margin: 0 0 var(--space-6); }

.contact-band__links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  font-family: var(--font-display);
  margin-bottom: var(--space-6);
}
.contact-band__phone { font-size: clamp(26px, 5vw, 32px); }
.contact-band__email { font-size: clamp(18px, 3.4vw, 24px); overflow-wrap: anywhere; }
.contact-band__links a { color: var(--text-inverse); }
.contact-band__links a:hover { color: #FFFFFF; }

/* ---------- Footer ---------- */

.site-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-6) var(--gutter) var(--space-7);
  text-align: center;
}
.site-footer__mark { width: 28px; height: 23px; }
.site-footer__line { font-size: 13px; line-height: 1.7; color: var(--umber-600); }
.site-footer__line a { color: var(--umber-600); text-decoration: underline; }
.site-footer__line a:hover { color: var(--clay-700); }
.site-footer__legal { font-size: var(--text-xs); color: var(--umber-600); max-width: 60ch; }

/* ---------- Inner pages ---------- */

.page-head { padding: 40px 0 var(--space-5); --wrap-max: 760px; }
@media (min-width: 700px) { .page-head { padding: 56px 0 var(--space-6); } }
.page-head__title { font-family: var(--font-display); font-size: clamp(32px, 6vw, 48px); line-height: 1.12; margin: 0 0 12px; }
.page-head__lede { font-size: clamp(16px, 1.2vw + 12px, 18px); line-height: 1.65; color: var(--umber-600); }

.backlink {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  letter-spacing: .04em;
  margin-bottom: var(--space-5);
}

.prose { --wrap-max: 720px; font-size: var(--text-base); line-height: 1.7; color: var(--umber-700); }
.prose h2 { font-family: var(--font-display); font-size: clamp(22px, 3.5vw, 28px); color: var(--ink-900); margin: var(--space-7) 0 var(--space-3); }
.prose h3 { font-family: var(--font-display); font-size: var(--text-xl); color: var(--ink-900); margin: var(--space-6) 0 var(--space-2); }
.prose p, .prose ul, .prose ol { margin: 0 0 var(--space-4); }
.prose ul, .prose ol { padding-left: 1.25em; }
.prose li { margin-bottom: var(--space-2); }

/* ---------- Contact page ---------- */

.contact-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-7); --wrap-max: 1080px; }
@media (min-width: 900px) { .contact-grid { grid-template-columns: 1fr 1.15fr; gap: var(--space-8); align-items: start; } }

.detail-list { display: flex; flex-direction: column; gap: var(--space-5); margin: 0; }
.detail-list__label {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--clay-600);
  margin-bottom: 4px;
}
.detail-list__value { font-size: var(--text-base); line-height: 1.6; color: var(--umber-700); margin: 0; }
.detail-list__value--lg { font-family: var(--font-display); font-size: var(--text-xl); }
.detail-list__value a { overflow-wrap: anywhere; }

.map-frame {
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--cream-100);
  margin-top: var(--space-5);
}
.map-frame iframe { width: 100%; height: 100%; border: 0; display: block; }

.card {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-5);
}
@media (min-width: 600px) { .card { padding: var(--space-6); } }

/* ---------- Forms ---------- */

.form { display: flex; flex-direction: column; gap: var(--space-5); }
.form__row { display: grid; grid-template-columns: 1fr; gap: var(--space-5); }
@media (min-width: 560px) { .form__row { grid-template-columns: 1fr 1fr; } }

.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 13px; font-weight: var(--weight-bold); color: var(--umber-700); }
.field__req { color: var(--clay-600); }
.field__hint { font-size: var(--text-xs); color: var(--umber-600); }
.field__error { font-size: var(--text-xs); font-weight: var(--weight-bold); color: var(--error); }

.input, .select, .textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.4;
  color: var(--text-body);
  background: var(--surface-card);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-md);
  transition: border-color var(--dur-fast) var(--ease-standard);
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--umber-600); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--clay-600); }
.textarea { min-height: 132px; resize: vertical; }

.select {
  appearance: none;
  padding-right: 42px;
  cursor: pointer;
  /* Chevron drawn as an inline SVG data URL rather than a text character, so it
     scales cleanly and does not depend on a font that may not contain it. */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9' fill='none'%3E%3Cpath d='M1 1.5 7 7.5l6-6' stroke='%236C5D4B' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
}

[aria-invalid="true"] { border-color: var(--error); }
[aria-invalid="true"]:focus { border-color: var(--error); }

.checkfield { display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: start; }
.checkfield input[type="checkbox"] {
  width: 22px; height: 22px; margin: 0;
  accent-color: var(--clay-600);
  cursor: pointer;
}
.checkfield label { font-size: var(--text-sm); line-height: 1.55; color: var(--umber-700); cursor: pointer; }

.honeypot {
  position: absolute !important;
  left: -9999px !important;
  width: 1px; height: 1px;
  overflow: hidden;
}

.alert {
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-md);
  border: 1px solid;
  font-size: 15px;
  line-height: 1.6;
}
.alert h2 { font-family: var(--font-body); font-size: 15px; font-weight: var(--weight-bold); margin: 0 0 6px; }
.alert ul { margin: 6px 0 0; padding-left: 1.2em; }
.alert a { font-weight: var(--weight-bold); }
.alert--error { background: #F9EEEA; border-color: var(--error); color: #7A2E1C; }
.alert--error a { color: #7A2E1C; }
.alert--success { background: var(--sage-100); border-color: var(--sage-500); color: var(--sage-700); }

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Print ---------- */

@media print {
  .skip-link, .cta-row, .band--ink, .map-frame, .form { display: none; }
  body { background: #fff; }
  .sheet { transform: none; box-shadow: none; }
  .sheet__under, .sheet::before, .sheet::after { display: none; }
}

/* ---------- Small additions ---------- */

.card__title { font-family: var(--font-display); font-size: clamp(22px, 3vw, 26px); margin: 0 0 18px; }
.alert--spaced { margin-bottom: 22px; }
.page-head--center { text-align: center; }

.site-header__home {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: inherit;
}
.site-header__home:hover { color: inherit; text-decoration: none; }
.site-header__home:hover .site-header__lockup { color: var(--clay-700); }
