/* N.O.T.S. Studio Co. Limited, site styles
   Palette (edit here to restyle the whole site):
   #F5F8F2 page background | #E7F0E0 light panels | #3A7A3A brand green | #25502A dark green | #1E2B20 body text
   Fonts: DM Serif Display (English headings), Be Vietnam Pro (body), Noto Sans HK (Chinese) */

:root {
  --bg: #F5F8F2;
  --panel: #E7F0E0;
  --green: #3A7A3A;
  --deep: #25502A;
  --ink: #1E2B20;
  --line: rgba(37, 80, 42, .28);

  --body: "Be Vietnam Pro", "Noto Sans HK", "PingFang HK", "Microsoft JhengHei", system-ui, sans-serif;
  --display: "DM Serif Display", Georgia, "Times New Roman", serif;
  --cjk: "Be Vietnam Pro", "Noto Sans HK", "PingFang HK", "Microsoft JhengHei", sans-serif; /* Be Vietnam Pro first: letters and numbers use it, Chinese characters fall through to Noto Sans HK */

  --wrap: 1400px;
  --pad: clamp(1.6rem, 3vw, 3rem);
  --header-h: 84px;           /* updated automatically by js/main.js */
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 1rem; }
body {
  margin: 0; padding-top: var(--header-h);
  background: var(--bg); color: var(--ink);
  font-family: var(--body); font-size: 1rem; line-height: 1.7;
}
:lang(zh-HK) { font-family: var(--cjk); }
img { max-width: 100%; display: block; height: auto; }
a { color: var(--deep); text-underline-offset: 3px; }
a:hover { color: var(--green); }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid var(--deep); outline-offset: 3px; border-radius: 3px; }

.skip { position: absolute; left: -999px; top: 0; background: var(--deep); color: #fff; padding: .6rem 1rem; z-index: 200; }
.skip:focus { left: 0; }

/* ---------- Bilingual text ---------- */
.stack > .en, .stack > .zh { display: block; }
.stack > .zh { margin-top: .5em; }
.inline > .zh { margin-left: .4em; }
a.stack { display: block; }

/* ---------- Header (fixed, hides on scroll down, returns on scroll up) ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  background: var(--panel); border-bottom: 4px solid var(--green);
  box-shadow: 0 5px 12px rgba(30, 43, 32, .2);
  transition: transform .3s ease;
}
.site-header.is-hidden { transform: translateY(calc(-100% - 16px)); }
.header-inner {
  max-width: var(--wrap); margin: 0 auto; padding: .8rem var(--pad);
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 80px;
}
.brand { display: block; line-height: 0; }
.brand .logo-desktop { height: 70px; width: auto; }
.brand .logo-mobile { height: 46px; width: auto; display: none; }

.nav { display: flex; gap: 2.2rem; }
.nav a {
  text-decoration: none; color: var(--green); font-size: .98rem; padding: .4rem 0;
  border-bottom: 2px solid transparent; transition: color .2s, border-color .2s;
}
.nav a:hover { color: var(--deep); border-bottom-color: var(--deep); }
.nav a[aria-current="page"] { border-bottom-color: var(--green); font-weight: 500; }

.menu-toggle { display: none; background: none; border: 0; padding: .6rem .2rem; cursor: pointer; width: 48px; }
.menu-toggle span { display: block; height: 2px; background: var(--green); margin: 8px 0; transition: transform .2s; }
.menu-toggle:hover span:first-child { transform: translateX(-3px); }
.menu-toggle:hover span:last-child { transform: translateX(3px); }

/* Full-screen menu (phones and tablets) */
.menu { position: fixed; inset: 0; z-index: 100; background: var(--bg); display: flex; flex-direction: column; }
.menu-top { display: flex; align-items: center; justify-content: space-between; padding: .8rem var(--pad); min-height: 80px; }
.menu-top img { height: 46px; width: auto; }
.menu-close { background: none; border: 0; cursor: pointer; width: 48px; height: 48px; position: relative; }
.menu-close::before, .menu-close::after { content: ""; position: absolute; left: 10px; right: 10px; top: 23px; height: 2px; background: var(--ink); }
.menu-close::before { transform: rotate(45deg); }
.menu-close::after { transform: rotate(-45deg); }
.menu nav { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.4rem; padding-bottom: 6rem; }
.menu nav a { font-size: 1.8rem; line-height: 1.4; text-decoration: none; color: var(--ink); text-align: center; padding: .2rem 1rem; }
.menu nav a:hover { color: var(--green); }
.menu nav a .zh { font-size: .62em; color: var(--green); margin-top: .1em; }
body.menu-open { overflow: hidden; }

@media (max-width: 860px) {
  .nav { display: none; }
  .menu-toggle { display: block; }
  .brand .logo-desktop { display: none; }
  .brand .logo-mobile { display: block; }
}
.no-js .nav { display: flex; }
.no-js .menu-toggle { display: none; }

/* ---------- Layout ---------- */
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--pad); }
.section { padding: 3.2rem 0; }
@media (min-width: 900px) { .section { padding: 5rem 0; } }
p { margin: 0 0 1rem; max-width: 90ch; }

h1, h2, h3 { margin: 0 0 1rem; text-wrap: balance; }
h2, h3 { font-family: var(--body); font-weight: 700; color: var(--deep); line-height: 1.3; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h2 .zh, h3 .zh { color: var(--green); font-family: var(--cjk); font-weight: 700; }

h1 { font-family: var(--display); font-weight: 400; color: var(--deep); line-height: 1.04; letter-spacing: -.005em; }
h1 .zh { font-family: var(--cjk); font-weight: 700; line-height: 1.25; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; font: inherit; font-weight: 500; font-size: 1rem; line-height: 1.4;
  padding: .85rem 1.5rem; border-radius: 10px; border: 2px solid var(--green);
  background: var(--green); color: #fff; text-align: center; text-decoration: none; cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease, color .2s ease, border-color .2s ease;
}
.btn:hover { background: var(--deep); border-color: var(--deep); color: #fff; transform: translateY(-3px); box-shadow: 0 8px 16px rgba(37, 80, 42, .28); }
.btn:active { transform: translateY(0) scale(.98); box-shadow: none; }
.btn.alt { background: transparent; color: var(--green); }
.btn.alt:hover { background: var(--green); border-color: var(--green); color: #fff; }
.btn.text { background: none; border-width: 0 0 2px; border-radius: 0; color: var(--green); padding: .8rem 0; box-shadow: none; }
.btn.text:hover { color: var(--deep); border-color: var(--deep); transform: none; box-shadow: none; background: none; }
.btn.text:active { transform: none; }
.btn.block { display: block; width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: .9rem; margin-top: 1.6rem; }

@media (min-width: 900px) {
  .btn { max-width: 15rem; }
  .btn:not(.text):not(.light) .inline > .en,
  .btn:not(.text):not(.light) .inline > .zh { display: block; margin-left: 0; }
  .btn.text, .btn.light { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  .btn, .site-header, .menu-toggle span { transition: none; }
  .btn:hover { transform: none; }
}

/* ---------- Home: hero with tree-ring graphic ---------- */
.hero { position: relative; overflow: hidden; background: var(--bg); }
.hero-art { position: absolute; left: 0; right: 0; top: -30%; bottom: -30%; pointer-events: none; will-change: transform; }
.hero-art img {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: max(150vw, 580px); max-width: none; opacity: .7;
}
.hero-inner { position: relative; max-width: var(--wrap); margin: 0 auto; padding: 3.5rem var(--pad); }
.hero h1 { font-size: clamp(2.2rem, 10.4vw, 4.6rem); max-width: none; }
.hero h1 .zh { font-size: .9em; color: var(--green); margin-top: .5em; }
/* Phone: the headline breaks into short lines. Desktop: only after "and" (these breaks are hidden). */
@media (min-width: 900px) { br.br-m { display: none; } }
.hero p { font-size: 1.05rem; max-width: 34ch; }
.hero .btn-row { flex-direction: column; align-items: center; margin-top: 2rem; }
.hero .btn { max-width: min(100%, 22rem); }
.hero .btn .inline > .en, .hero .btn .inline > .zh { display: block; margin-left: 0; }

@media (min-width: 900px) {
  /* Tall hero, ring centred behind left-aligned text */
  .hero-inner { min-height: max(560px, calc(100vh - var(--header-h))); padding-top: 4rem; padding-bottom: 4rem; display: flex; flex-direction: column; justify-content: center; }
  .hero h1 { font-size: clamp(2.8rem, 4.8vw, 3.8rem); max-width: none; }
  .hero h1 .zh { font-size: .82em; max-width: none; }
  .hero p { max-width: 62ch; }
  .hero-art img { width: min(1010px, 100vw); opacity: .55; }
  .hero .btn-row { flex-direction: row; align-items: stretch; }
  .hero .btn { max-width: 15rem; }
}

/* ---------- Home: sections ---------- */
.feature-photo { margin: 0; }
.feature-photo img { width: 100%; max-height: 560px; object-fit: cover; }

.cta .wrap { display: grid; gap: 1rem; }
.cta .btn { display: block; margin-top: .6rem; }
@media (min-width: 900px) {
  .cta .wrap { grid-template-columns: 1fr auto; align-items: center; gap: 3rem; }
  .cta .btn { display: inline-block; margin-top: 0; }
}

/* ---------- Page title band (Services, Tools) ---------- */
.page-hero { background: var(--panel); text-align: center; padding: 2.8rem var(--pad) 2.6rem; }
.page-hero h1 { font-size: clamp(2.4rem, 9vw, 3.6rem); margin: 0 auto; max-width: 16ch; }
.page-hero h1 .zh { color: var(--deep); font-size: .9em; margin-top: .4em; }
@media (min-width: 900px) {
  .page-hero { padding: 3.2rem var(--pad) 3rem; }
  .page-hero h1 { font-size: clamp(2.8rem, 4.8vw, 3.8rem); max-width: none; }
  .page-hero h1 .zh { font-size: .8em; }
}

/* ---------- Services ---------- */
.service + .service { margin-top: 2.8rem; }
.service h2, .service h2 .zh { color: var(--green); }
@media (min-width: 900px) {
  .services-section { padding-top: 6rem; }
  .service + .service { margin-top: 3.6rem; }
}

/* ---------- Contact (dark green section with form) ---------- */
.contact { background: var(--deep); color: var(--bg); padding: 3.4rem 0 3.8rem; }
.contact a { color: var(--bg); }
.contact h2 { color: var(--bg); margin: 0; padding-bottom: 1.2rem; }
.contact h2 .zh { color: var(--bg); }
.contact-grid { display: grid; }
.contact-list { margin-bottom: 2.4rem; }
@media (min-width: 900px) {
  .contact { padding: 5rem 0 5.5rem; }
  .contact-grid { grid-template-columns: 1fr 2fr; column-gap: 3.5rem; }
  .contact-title { grid-column: 1; grid-row: 1; }
  .contact-list { grid-column: 1; grid-row: 2; margin-bottom: 0; }
  form.enquiry { grid-column: 2; grid-row: 2; }
}

.info-row { border-bottom: 1px solid rgba(245, 248, 242, .6); padding: 1.3rem 0; }
.info-row:first-child { border-top: 2px solid var(--bg); }
.info-label { font-family: var(--display); font-size: 1.3rem; line-height: 1.3; margin: 0 0 .4rem; }
.info-value { margin: 0; }

form.enquiry { display: grid; gap: 1.2rem; }
.field label, .field .label { display: block; font-weight: 500; margin-bottom: .4rem; }
.field .req { font-weight: 400; opacity: .75; font-size: .92em; margin-left: .3em; }
.field .hint { display: block; opacity: .75; font-size: .92rem; margin: -.1rem 0 .5rem; }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; color: var(--ink); background: rgba(231, 240, 224, .88);
  border: 2px solid transparent; border-radius: 8px; padding: .8rem .9rem;
}
.field textarea { min-height: 8.5rem; resize: vertical; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: 3px solid var(--bg); outline-offset: 2px; }
.name-row { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; align-items: end; }
.name-row span { display: block; font-size: .92rem; margin-bottom: .25rem; }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.btn.light { background: var(--bg); border-color: var(--bg); color: var(--deep); justify-self: start; }
.btn.light:hover { background: var(--panel); border-color: var(--panel); color: var(--deep); }
.form-status { margin: 0; padding: .8rem 1rem; border-radius: 8px; display: none; max-width: none; }
.form-status.ok { display: block; background: var(--panel); color: var(--ink); }
.form-status.err { display: block; background: #FBEDE4; color: #5C2A12; }

/* ---------- Tools page ---------- */
.app-note { color: var(--green); margin-top: 2.4rem; }
.app-note p { max-width: none; }

.key { background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--green); border-radius: 0 0 8px 8px; padding: 1.5rem 1.4rem 1.3rem; max-width: 760px; margin-top: 1.6rem; }
.key-trail { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem .5rem; font-size: .88rem; opacity: .8; }
.key-trail li { display: flex; align-items: center; gap: .5rem; }
.key-trail li + li::before { content: ""; width: .9rem; border-top: 1px solid var(--green); }
.key-step { font-size: .92rem; opacity: .8; margin: 0 0 .3rem; }
.key h2 { font-size: 1.3rem; margin-bottom: 1rem; }
.key h2:focus { outline: none; }
.key-opts { list-style: none; margin: 0; padding: 0; display: grid; gap: .65rem; }
.key-opt {
  width: 100%; text-align: left; font: inherit; line-height: 1.5; color: var(--ink);
  background: var(--bg); border: 1px solid rgba(37, 80, 42, .45); border-left: 4px solid var(--green);
  border-radius: 8px; padding: .8rem 1rem; cursor: pointer; transition: background-color .2s, transform .2s;
}
.key-opt:hover { background: var(--panel); transform: translateX(3px); }
.key-actions { display: flex; flex-wrap: wrap; gap: .7rem 1.4rem; margin-top: 1.3rem; }
.link-btn { font: inherit; font-size: .95rem; background: none; border: 0; padding: .3rem 0; cursor: pointer; color: var(--deep); text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--green); }
.link-btn[disabled] { opacity: .45; cursor: default; text-decoration: none; }
.latin { font-style: italic; opacity: .85; margin: 0 0 1rem; }
.result ul { padding-left: 1.2rem; margin: 0 0 1rem; max-width: 60ch; }
.result li { margin-bottom: .4rem; }
.result .caution { border-left: 3px solid var(--green); padding-left: .9rem; font-size: .95rem; opacity: .9; }
.small { font-size: .92rem; }
.muted { opacity: .8; }

/* ---------- Footer ---------- */
.site-footer { background: var(--panel); padding: 2.8rem 0 3rem; }
.footer-grid { display: grid; gap: .6rem; }
.footer-logo { width: min(100%, 400px); height: auto; margin-bottom: 1rem; }
.footer-text p { margin: 0 0 .9rem; max-width: none; }
.footer-contact { margin-bottom: 1rem; }
@media (max-width: 899px) {
  .footer-logo { width: 100%; max-width: 32rem; margin: 0 auto 1.4rem; }
}
@media (min-width: 900px) {
  .footer-grid { grid-template-columns: 1fr minmax(220px, 280px); column-gap: 4rem; row-gap: 1rem; }
  .footer-logo { grid-column: 1; grid-row: 1; margin: 0; }
  .footer-text { grid-column: 1; grid-row: 2; }
  .footer-contact { grid-column: 2; grid-row: 1 / span 2; align-self: start; margin-top: .8rem; }
}
