/* =========================================================
   PALMHAUS — Real Estate by Xiaolin Li
   Sophisticated, simple, modern editorial.
   Cream-yellow base • olive accent • bold sans-serif.
   ========================================================= */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
img, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }

/* ---------- Palette & Tokens ---------- */
:root {
  --bg: #F2EBD3;          /* warm cream-yellow */
  --bg-alt: #EAE1C2;      /* deeper sand */
  --paper: #F8F2DC;       /* highlight cream */
  --ink: #15171A;         /* near-black */
  --ink-soft: #2E332E;
  --muted: #7B7864;       /* warm taupe */
  --line: #CFC6A6;        /* hairline */
  --accent: #3D4A2C;      /* dark olive */
  --accent-soft: #A7984F; /* warm gold-olive */
  --leaf: #5C6A3F;        /* sage */

  --display: "Instrument Sans", "Inter Tight", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --serif: "Instrument Serif", Georgia, serif;    /* used only for occasional italic */
  --zh-serif: "Noto Serif TC", "Songti TC", "PingFang TC", serif;

  --max: 1320px;
  --gutter: clamp(20px, 4vw, 56px);

  --tr: 380ms cubic-bezier(.2,.7,.2,1);
}

/* ---------- Base ---------- */
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--ink); color: var(--bg); }

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 500;
  letter-spacing: -0.025em;
  margin: 0;
  color: var(--ink);
  font-stretch: 95%;
}
h1 { font-size: clamp(2.8rem, 8vw, 6.8rem); line-height: 0.98; letter-spacing: -0.035em; }
h2 { font-size: clamp(2rem, 5vw, 4.4rem); line-height: 1.02; letter-spacing: -0.03em; }
h3 { font-size: clamp(1.3rem, 2.2vw, 1.9rem); line-height: 1.15; }
h4 { font-size: 1.05rem; line-height: 1.3; }
p  { margin: 0 0 1.1em; }

h1 em, h2 em { font-family: var(--serif); font-style: italic; font-weight: 400; font-stretch: 100%; letter-spacing: -0.01em; }

.eyebrow {
  font-family: var(--sans);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--muted);
  font-weight: 500;
}
.lede {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.1rem, 1.6vw, 1.35rem);
  line-height: 1.45;
  color: var(--ink-soft);
  letter-spacing: -0.01em;
}

/* ---------- Layout ---------- */
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.wrap-narrow { max-width: 880px; margin: 0 auto; padding: 0 var(--gutter); }
section { padding: clamp(60px, 9vw, 140px) 0; }
.divider { height: 1px; background: var(--line); border: 0; margin: 0; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(242, 235, 211, .9);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--gutter);
  max-width: var(--max);
  margin: 0 auto;
}
.brand {
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.45rem;
  letter-spacing: -0.02em;
  display: flex; align-items: center; gap: 12px;
}
.brand-mark {
  display: inline-block; width: 16px; height: 16px;
  background: var(--accent); border-radius: 50%;
  position: relative;
}
.nav-links { display: flex; gap: 30px; }
.nav-links a {
  font-size: 0.86rem;
  letter-spacing: -0.005em;
  color: var(--ink);
  position: relative;
  padding: 4px 0;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px;
  height: 1px; background: var(--ink);
  transform: scaleX(0); transform-origin: left; transition: transform var(--tr);
}
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); }

.nav-cta {
  font-size: 0.85rem;
  border: 1px solid var(--ink); padding: 10px 22px; border-radius: 999px;
  transition: background var(--tr), color var(--tr);
}
.nav-cta:hover { background: var(--ink); color: var(--bg); }

.menu-toggle { display: none; }
@media (max-width: 880px) {
  .nav-links, .nav-cta { display: none; }
  .menu-toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 0.85rem; }
  .mobile-open .nav-links {
    display: flex; flex-direction: column; gap: 22px;
    position: fixed; inset: 64px 0 0 0;
    background: var(--bg); padding: 40px var(--gutter);
    border-top: 1px solid var(--line);
  }
  .mobile-open .nav-links a { font-size: 1.2rem; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 16px 30px;
  font-size: 0.86rem; letter-spacing: -0.005em;
  border-radius: 999px;
  transition: background var(--tr), color var(--tr), border-color var(--tr), transform var(--tr);
  border: 1px solid var(--ink);
  color: var(--ink); background: transparent;
}
.btn:hover { background: var(--ink); color: var(--bg); }
.btn-filled { background: var(--ink); color: var(--bg); }
.btn-filled:hover { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.btn-light { border-color: var(--bg); color: var(--bg); background: transparent; }
.btn-light:hover { background: var(--bg); color: var(--ink); }

.text-link {
  display: inline-flex; gap: 10px; align-items: center;
  font-size: 0.9rem;
  padding-bottom: 4px; border-bottom: 1px solid var(--ink);
}
.text-link:hover { gap: 16px; transition: gap var(--tr); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: clamp(620px, 96vh, 980px);
  display: flex; align-items: flex-end;
  padding: 0 0 clamp(40px, 8vw, 100px);
  overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0; z-index: 0;
  background:
    linear-gradient(180deg, rgba(21,23,26,0.30) 0%, rgba(21,23,26,0.55) 55%, rgba(21,23,26,0.88) 100%),
    url("https://images.unsplash.com/photo-1613490493576-7fde63acd811?auto=format&fit=crop&w=2400&q=80") center/cover no-repeat;
  filter: saturate(0.95) contrast(1.02);
}
.hero-inner { position: relative; z-index: 1; color: var(--bg); width: 100%; }
.hero h1 {
  color: var(--bg);
  font-weight: 500;
  max-width: 18ch;
}
.hero h1 em { color: var(--bg); }
.hero .lede { color: rgba(242,235,211,.92); max-width: 56ch; margin-top: 24px; }
.hero-meta {
  display: flex; gap: 40px; margin-top: 36px; flex-wrap: wrap;
}
.hero-meta div .eyebrow { color: rgba(242,235,211,.65); }
.hero-meta div .val { font-family: var(--display); font-size: 1.3rem; font-weight: 500; }

/* ---------- Marquee strip ---------- */
.marquee {
  background: var(--accent); color: var(--bg);
  padding: 20px 0; overflow: hidden; white-space: nowrap;
  border-top: 1px solid var(--accent);
  border-bottom: 1px solid var(--accent);
}
.marquee-track {
  display: inline-flex; gap: 64px;
  animation: scroll 38s linear infinite;
  font-family: var(--display); font-size: 1.4rem; font-weight: 400;
  letter-spacing: -0.01em;
}
.marquee-track span::after { content: "✦"; margin-left: 64px; color: var(--accent-soft); }
@keyframes scroll { to { transform: translateX(-50%); } }

/* ---------- Section header ---------- */
.section-head {
  display: grid; grid-template-columns: 1fr 1fr; gap: 40px;
  align-items: end; margin-bottom: 70px;
  padding-top: 30px; border-top: 1px solid var(--line);
}
.section-head h2 { max-width: 16ch; }
.section-head p  { max-width: 52ch; color: var(--ink-soft); }
@media (max-width: 720px) { .section-head { grid-template-columns: 1fr; } }

/* ---------- Listing Grid ---------- */
.listings {
  display: grid; gap: 50px 36px;
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 1000px) { .listings { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .listings { grid-template-columns: 1fr; } }
.card {
  display: block; color: var(--ink);
}
.card .img-wrap {
  aspect-ratio: 4/5; overflow: hidden; background: var(--bg-alt);
  margin-bottom: 22px; position: relative;
  border-radius: 4px;
}
.card .img-wrap img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 1200ms cubic-bezier(.2,.7,.2,1);
}
.card:hover .img-wrap img { transform: scale(1.04); }
.card .badge {
  position: absolute; top: 14px; left: 14px;
  font-size: 0.68rem; letter-spacing: 0.18em; text-transform: uppercase;
  padding: 6px 12px; background: var(--bg); color: var(--ink);
  border-radius: 999px;
}
.card h3 { font-size: 1.3rem; margin-bottom: 6px; font-weight: 500; }
.card .meta { font-size: 0.88rem; color: var(--muted); }
.card .price { font-family: var(--display); font-size: 1.05rem; font-weight: 500; margin-top: 8px; }

/* ---------- Story / Split blocks ---------- */
.split {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 6vw, 100px); align-items: center;
}
.split.reverse > :first-child { order: 2; }
.split .img-wrap { aspect-ratio: 4/5; overflow: hidden; border-radius: 4px; }
.split .img-wrap img { width:100%; height:100%; object-fit: cover; }
@media (max-width: 820px) {
  .split { grid-template-columns: 1fr; }
  .split.reverse > :first-child { order: 0; }
}
.story-body p { font-size: 1.05rem; color: var(--ink-soft); }
.story-body p.first::first-letter {
  font-family: var(--serif); font-style: italic;
  font-size: 4.6rem; line-height: .9;
  float: left; padding: 6px 14px 0 0; color: var(--accent);
}

/* ---------- Areas ---------- */
.areas-grid {
  columns: 3; column-gap: 60px;
  font-family: var(--display);
  font-size: clamp(1.6rem, 2.6vw, 2.4rem);
  line-height: 1.45;
  font-weight: 500;
  letter-spacing: -0.025em;
}
.areas-grid a,
.areas-grid span {
  display: block; padding: 8px 0;
}
.areas-grid a { border-bottom: 1px solid transparent; transition: color var(--tr), padding var(--tr), border-color var(--tr); }
.areas-grid a:hover { color: var(--accent); padding-left: 14px; border-color: var(--line); }
@media (max-width: 900px) { .areas-grid { columns: 2; } }
@media (max-width: 560px) { .areas-grid { columns: 1; } }

/* ---------- Testimonials ---------- */
.quotes {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px;
}
.quote {
  border-top: 1px solid var(--line);
  padding-top: 26px;
}
.quote .body {
  font-family: var(--display); font-weight: 400;
  font-size: 1.2rem; line-height: 1.4; color: var(--ink);
  margin-bottom: 22px; letter-spacing: -0.015em;
}
.quote .author { font-size: 0.8rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.quote .stars { color: var(--accent-soft); letter-spacing: 4px; font-size: 0.95rem; margin-bottom: 14px; }
@media (max-width: 900px) { .quotes { grid-template-columns: 1fr; } }

/* ---------- Stat rows (PDF inspired) ---------- */
.stat-row {
  display: grid; grid-template-columns: 1fr auto 1fr;
  gap: 40px; align-items: center;
  padding: 30px 0;
  border-top: 1px solid var(--line);
}
.stat-row:last-child { border-bottom: 1px solid var(--line); }
.stat-row .big {
  font-family: var(--display); font-weight: 300;
  font-size: clamp(3rem, 8vw, 7rem); line-height: 1;
  letter-spacing: -0.04em;
  justify-self: end;
}
.stat-row .label { color: var(--muted); font-size: 0.95rem; max-width: 32ch; }

/* ---------- Blog ---------- */
.blog-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 56px 40px;
}
.post-card { display: block; color: var(--ink); }
.post-card .img-wrap { aspect-ratio: 3/2; overflow: hidden; margin-bottom: 22px; border-radius: 4px; }
.post-card .img-wrap img { width:100%; height:100%; object-fit: cover; transition: transform 1200ms ease; }
.post-card:hover .img-wrap img { transform: scale(1.04); }
.post-card .tag {
  display:inline-block; font-size:0.74rem; letter-spacing:0.18em; text-transform:uppercase;
  color: var(--accent); margin-bottom: 12px; font-weight: 500;
}
.post-card h3 { font-size: 1.7rem; margin-bottom: 12px; font-weight: 500; line-height: 1.15; }
.post-card p { color: var(--ink-soft); font-size: 0.98rem; }
.post-card .date { font-size: 0.78rem; color: var(--muted); margin-top: 12px; }
@media (max-width: 820px) { .blog-grid { grid-template-columns: 1fr; } }

/* ---------- Article ---------- */
.article-hero {
  padding: 100px 0 40px;
}
.article-hero h1 { max-width: 22ch; font-size: clamp(2.2rem, 5vw, 4.5rem); }
.article-hero .meta {
  display: flex; gap: 18px; align-items: center;
  font-size: 0.82rem; letter-spacing: 0.04em;
  color: var(--muted); margin-bottom: 32px; flex-wrap: wrap;
}
.article-hero .meta .dot { width: 4px; height: 4px; background: var(--muted); border-radius: 50%; }
.article-cover { aspect-ratio: 16/9; overflow: hidden; margin: 50px 0 70px; border-radius: 6px; }
.article-cover img { width:100%; height:100%; object-fit: cover; }
.prose {
  max-width: 720px; margin: 0 auto;
  font-size: 1.1rem; line-height: 1.78; color: var(--ink-soft);
}
.prose p { margin: 0 0 1.3em; }
.prose h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 2.2em 0 0.7em; color: var(--ink); font-weight: 500; letter-spacing: -0.02em; }
.prose h3 { font-size: 1.35rem; margin: 1.8em 0 0.4em; color: var(--ink); font-weight: 500; }
.prose blockquote {
  border-left: 3px solid var(--accent); padding-left: 26px;
  font-family: var(--serif); font-style: italic; font-size: 1.45rem;
  color: var(--ink); margin: 2em 0;
  line-height: 1.4;
}
.prose a { border-bottom: 1px solid var(--line); }
.prose a:hover { border-color: var(--ink); }
.prose ul, .prose ol { padding-left: 1.4em; margin-bottom: 1.4em; }
.prose ul li, .prose ol li { margin-bottom: 0.5em; }
.prose-zh { font-family: var(--zh-serif); }
.prose-zh h2, .prose-zh h3 { font-family: var(--zh-serif); font-weight: 500; }

/* ---------- Contact ---------- */
.contact-grid {
  display: grid; grid-template-columns: 1fr 1.2fr; gap: 64px;
}
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; } }
.form-embed {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 6px; overflow: hidden;
}
.form-embed iframe { width: 100%; border: 0; min-height: 1400px; display:block; }
.contact-info dl {
  display: grid; grid-template-columns: 110px 1fr; gap: 18px 24px;
  font-size: 1rem; margin: 0;
}
.contact-info dt { color: var(--muted); text-transform: uppercase; font-size: 0.74rem; letter-spacing: 0.18em; padding-top: 4px; }
.contact-info dd { margin: 0; }
.contact-info a { border-bottom: 1px solid var(--line); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--accent); color: var(--bg);
  padding: 90px 0 30px;
}
.foot-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px;
  border-bottom: 1px solid rgba(242,235,211,.18);
  padding-bottom: 60px;
}
@media (max-width: 820px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .foot-grid { grid-template-columns: 1fr; } }
.foot-grid h4 { color: var(--bg); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.22em; font-family: var(--sans); font-weight: 500; margin-bottom: 20px; }
.foot-grid ul { list-style: none; padding: 0; margin: 0; }
.foot-grid li { margin-bottom: 10px; font-size: 0.95rem; }
.foot-grid a:hover { color: var(--accent-soft); }
.foot-brand { font-family: var(--display); font-size: 2.4rem; font-weight: 500; letter-spacing: -0.025em; }
.foot-tag { color: rgba(242,235,211,.75); margin-top: 16px; max-width: 36ch; font-size: 0.95rem; }
.foot-bottom {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 18px;
  padding-top: 30px; font-size: 0.78rem; color: rgba(242,235,211,.55);
}
.foot-bottom a:hover { color: var(--bg); }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 800ms ease, transform 800ms cubic-bezier(.2,.7,.2,1); }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- Misc ---------- */
.text-center { text-align: center; }
.subtle { color: var(--muted); }
.tag-pill {
  display: inline-block; padding: 6px 14px; border: 1px solid var(--line);
  border-radius: 999px; font-size: 0.78rem; color: var(--ink-soft);
  margin-right: 6px;
}

/* Decorative thin rule for the editorial layouts */
.rule {
  border: 0; height: 1px; background: var(--line); margin: 0;
}
.rule-thick {
  border: 0; height: 1px; background: var(--ink); margin: 0;
}
