/* ============================
   Jeff Leung Property — Design Tokens & Styles
   Art Direction: Authoritative, warm, trustworthy — Hong Kong real estate
   Palette: Deep navy + warm gold accent (professional trust + premium feel)
   ============================ */

:root {
  /* Type Scale */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);
  --text-3xl: clamp(2.5rem, 1rem + 4vw, 5rem);

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Content widths */
  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1200px;
  --content-full: 100%;

  /* Font families */
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body: 'DM Sans', 'Helvetica Neue', sans-serif;
}

/* ===== LIGHT MODE ===== */
:root,
[data-theme='light'] {
  --color-bg: #f8f7f4;
  --color-surface: #ffffff;
  --color-surface-2: #f2f1ed;
  --color-surface-offset: #eae8e3;
  --color-divider: #d8d5cf;
  --color-border: #ccc9c2;
  --color-text: #1a1a2e;
  --color-text-muted: #5a5a6e;
  --color-text-faint: #9a99a8;
  --color-text-inverse: #f8f7f4;
  --color-primary: #1a3a5c;
  --color-primary-hover: #14304d;
  --color-primary-active: #0e243b;
  --color-accent: #c49a3c;
  --color-accent-hover: #a8832e;
  --color-accent-active: #8c6d22;
  --color-success: #2e7d32;
  --color-whatsapp: #25d366;
  --shadow-sm: 0 1px 2px oklch(0.2 0.01 260 / 0.06);
  --shadow-md: 0 4px 12px oklch(0.2 0.01 260 / 0.08);
  --shadow-lg: 0 12px 32px oklch(0.2 0.01 260 / 0.12);
}

/* ===== DARK MODE ===== */
[data-theme='dark'] {
  --color-bg: #0f0f1a;
  --color-surface: #1a1a2e;
  --color-surface-2: #22223a;
  --color-surface-offset: #1e1e32;
  --color-divider: #2e2e44;
  --color-border: #3a3a52;
  --color-text: #e0dfd8;
  --color-text-muted: #9a99a8;
  --color-text-faint: #6a697a;
  --color-text-inverse: #1a1a2e;
  --color-primary: #5a8ab5;
  --color-primary-hover: #4a7aa5;
  --color-primary-active: #3a6a95;
  --color-accent: #d4aa4c;
  --color-accent-hover: #e0ba6c;
  --color-accent-active: #eccc8c;
  --color-success: #4caf50;
  --color-whatsapp: #25d366;
  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.2);
  --shadow-md: 0 4px 12px oklch(0 0 0 / 0.3);
  --shadow-lg: 0 12px 32px oklch(0 0 0 / 0.4);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #0f0f1a;
    --color-surface: #1a1a2e;
    --color-surface-2: #22223a;
    --color-surface-offset: #1e1e32;
    --color-divider: #2e2e44;
    --color-border: #3a3a52;
    --color-text: #e0dfd8;
    --color-text-muted: #9a99a8;
    --color-text-faint: #6a697a;
    --color-text-inverse: #1a1a2e;
    --color-primary: #5a8ab5;
    --color-primary-hover: #4a7aa5;
    --color-primary-active: #3a6a95;
    --color-accent: #d4aa4c;
    --color-accent-hover: #e0ba6c;
    --color-accent-active: #eccc8c;
    --color-success: #4caf50;
    --color-whatsapp: #25d366;
    --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.2);
    --shadow-md: 0 4px 12px oklch(0 0 0 / 0.3);
    --shadow-lg: 0 12px 32px oklch(0 0 0 / 0.4);
  }
}

/* ===== GLOBAL LAYOUT ===== */
.container {
  max-width: var(--content-wide);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

.container--narrow {
  max-width: var(--content-default);
}

/* ===== SKIP LINK ===== */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  z-index: 100;
  text-decoration: none;
  font-size: var(--text-sm);
}
.skip-link:focus {
  top: var(--space-2);
}

/* ===== HEADER ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: oklch(from var(--color-bg) l c h / 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid oklch(from var(--color-text) l c h / 0.08);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: var(--space-3);
  gap: var(--space-4);
}

.header__logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  color: var(--color-text);
}

.header__logo-text {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  line-height: 1.2;
}

.header__logo-sub {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  display: block;
}

.header__nav {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.header__nav a {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
}

.header__nav a:hover,
.header__nav a.active {
  color: var(--color-text);
  background: oklch(from var(--color-text) l c h / 0.06);
}

.header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* Mobile hamburger */
.hamburger {
  display: none;
  padding: var(--space-2);
  color: var(--color-text);
}

@media (max-width: 767px) {
  .header__nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-surface);
    flex-direction: column;
    padding: var(--space-4);
    border-bottom: 1px solid var(--color-divider);
    box-shadow: var(--shadow-md);
  }
  .header__nav.is-open {
    display: flex;
  }
  .header__nav a {
    width: 100%;
    padding: var(--space-3) var(--space-4);
  }
  .hamburger {
    display: block;
  }
}

/* ===== THEME TOGGLE ===== */
.theme-toggle {
  padding: var(--space-2);
  color: var(--color-text-muted);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}
.theme-toggle:hover {
  color: var(--color-text);
  background: oklch(from var(--color-text) l c h / 0.06);
}

/* ===== HERO ===== */
.hero {
  padding: clamp(var(--space-12), 8vw, var(--space-24)) 0;
  text-align: left;
}

.hero__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
  align-items: center;
}

@media (min-width: 768px) {
  .hero__grid {
    grid-template-columns: 1.2fr 0.8fr;
  }
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-accent);
  background: oklch(from var(--color-accent) l c h / 0.1);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-4);
  font-weight: 500;
}

.hero__title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  color: var(--color-text);
  margin-bottom: var(--space-4);
}

.hero__subtitle {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
  max-width: 52ch;
}

.hero__cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.hero__stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
  padding: var(--space-6);
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}

.hero__stat-value {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--color-primary);
}

.hero__stat-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 500;
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  text-decoration: none;
  cursor: pointer;
  border: none;
  min-height: 44px;
}

.btn--primary {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}
.btn--primary:hover {
  background: var(--color-primary-hover);
}
.btn--primary:active {
  background: var(--color-primary-active);
}

.btn--whatsapp {
  background: var(--color-whatsapp);
  color: #fff;
}
.btn--whatsapp:hover {
  background: #20bd5a;
}

.btn--outline {
  background: transparent;
  color: var(--color-text);
  border: 1px solid oklch(from var(--color-text) l c h / 0.15);
}
.btn--outline:hover {
  background: oklch(from var(--color-text) l c h / 0.05);
}

.btn--accent {
  background: var(--color-accent);
  color: #1a1a2e;
}
.btn--accent:hover {
  background: var(--color-accent-hover);
}

/* ===== SECTIONS ===== */
.section {
  padding: clamp(var(--space-8), 6vw, var(--space-20)) 0;
}

.section--alt {
  background: var(--color-surface-2);
}

.section__header {
  margin-bottom: var(--space-8);
}

.section__eyebrow {
  font-size: var(--text-xs);
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.section__title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--color-text);
}

.section__subtitle {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  margin-top: var(--space-2);
  max-width: 60ch;
}

/* ===== SERVICE CARDS ===== */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: var(--space-4);
}

.service-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-interactive), transform var(--transition-interactive);
}

.service-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.service-card__icon {
  width: 40px;
  height: 40px;
  color: var(--color-accent);
  margin-bottom: var(--space-4);
}

.service-card__title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  margin-bottom: var(--space-2);
}

.service-card__desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.7;
}

/* ===== FAQ ===== */
.faq-list {
  max-width: var(--content-default);
}

.faq-item {
  border-bottom: 1px solid oklch(from var(--color-text) l c h / 0.08);
}

.faq-item__question {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-5) 0;
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
  text-align: left;
  cursor: pointer;
  gap: var(--space-4);
  min-height: 44px;
}

.faq-item__question::after {
  content: '+';
  font-size: var(--text-lg);
  color: var(--color-accent);
  flex-shrink: 0;
  transition: transform var(--transition-interactive);
}

.faq-item.is-open .faq-item__question::after {
  content: '−';
}

.faq-item__answer {
  display: none;
  padding-bottom: var(--space-5);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.8;
}

.faq-item.is-open .faq-item__answer {
  display: block;
}

/* ===== ARTICLES / BLOG ===== */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
  gap: var(--space-6);
}

.article-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  transition: box-shadow var(--transition-interactive), transform var(--transition-interactive);
  display: flex;
  flex-direction: column;
}

.article-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.article-card__img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--color-surface-2);
}

.article-card__body {
  padding: var(--space-5);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.article-card__tag {
  font-size: var(--text-xs);
  color: var(--color-accent);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.article-card__title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  margin-bottom: var(--space-2);
  line-height: 1.3;
}

.article-card__excerpt {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.7;
  flex: 1;
}

.article-card__meta {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-top: var(--space-3);
}

/* ===== ARTICLE PAGE ===== */
.article-page {
  max-width: var(--content-narrow);
  margin-inline: auto;
  padding: clamp(var(--space-8), 6vw, var(--space-16)) var(--space-4);
}

.article-page__back {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  margin-bottom: var(--space-6);
}
.article-page__back:hover {
  color: var(--color-text);
}

.article-page__tag {
  font-size: var(--text-xs);
  color: var(--color-accent);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.article-page__title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  margin-bottom: var(--space-3);
}

.article-page__meta {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-bottom: var(--space-8);
}

.article-page__content h2 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  margin-top: var(--space-8);
  margin-bottom: var(--space-3);
}

.article-page__content h3 {
  font-size: var(--text-base);
  font-weight: 700;
  margin-top: var(--space-6);
  margin-bottom: var(--space-2);
}

.article-page__content p {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: 1.8;
  margin-bottom: var(--space-4);
}

.article-page__content ul,
.article-page__content ol {
  padding-left: var(--space-6);
  margin-bottom: var(--space-4);
}

.article-page__content li {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: 1.8;
  margin-bottom: var(--space-2);
}

.article-page__content strong {
  color: var(--color-text);
  font-weight: 600;
}

.article-page__content table {
  margin: var(--space-6) 0;
  border: 1px solid oklch(from var(--color-text) l c h / 0.1);
  border-radius: var(--radius-md);
  overflow: hidden;
  font-size: var(--text-sm);
}

.article-page__content th {
  background: var(--color-surface-2);
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-weight: 600;
  color: var(--color-text);
}

.article-page__content td {
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid oklch(from var(--color-text) l c h / 0.06);
  color: var(--color-text-muted);
}

/* CTA Box in articles */
.article-cta {
  background: var(--color-surface-2);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-top: var(--space-8);
  text-align: center;
}

.article-cta__title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  margin-bottom: var(--space-2);
}

.article-cta__text {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}

/* ===== ABOUT ===== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
  align-items: start;
}

@media (min-width: 768px) {
  .about-grid {
    grid-template-columns: 1fr 1.5fr;
  }
}

.about-card {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.about-card__avatar {
  width: 120px;
  height: 120px;
  border-radius: var(--radius-full);
  background: var(--color-surface-2);
  margin: 0 auto var(--space-4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--color-primary);
}

.about-card__name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
}

.about-card__role {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

.about-card__licence {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-top: var(--space-1);
}

.about-card__contacts {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.about-detail h2 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  margin-bottom: var(--space-3);
}

.about-detail p {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: 1.8;
  margin-bottom: var(--space-4);
}

.about-detail ul {
  padding-left: var(--space-5);
  margin-bottom: var(--space-6);
}

.about-detail li {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.8;
  margin-bottom: var(--space-1);
}

/* ===== CONTACT ===== */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: var(--space-4);
}

.contact-method {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  text-align: center;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  transition: box-shadow var(--transition-interactive), transform var(--transition-interactive);
  display: block;
}

.contact-method:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.contact-method__icon {
  width: 48px;
  height: 48px;
  margin: 0 auto var(--space-3);
  color: var(--color-primary);
}

.contact-method__label {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  margin-bottom: var(--space-1);
}

.contact-method__value {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* ===== FOOTER ===== */
.footer {
  background: var(--color-surface-2);
  padding: var(--space-8) 0;
  margin-top: var(--space-12);
  border-top: 1px solid oklch(from var(--color-text) l c h / 0.06);
}

.footer__inner {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: var(--space-8);
}

@media (max-width: 767px) {
  .footer__inner {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
}

.footer__brand p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.7;
  margin-top: var(--space-3);
}

.footer__col-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-3);
}

.footer__links {
  list-style: none;
  padding: 0;
}

.footer__links li {
  margin-bottom: var(--space-2);
}

.footer__links a {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
}
.footer__links a:hover {
  color: var(--color-text);
}

.footer__bottom {
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid oklch(from var(--color-text) l c h / 0.06);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

/* ===== NAVIGATION SECTION LINKS (for SPA) ===== */
.nav-section {
  scroll-margin-top: var(--space-16);
}

/* ===== FLOATING WHATSAPP BUTTON ===== */
.fab-whatsapp {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  width: 56px;
  height: 56px;
  background: var(--color-whatsapp);
  color: #fff;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  z-index: 40;
  text-decoration: none;
  transition: transform var(--transition-interactive), box-shadow var(--transition-interactive);
}
.fab-whatsapp:hover {
  transform: scale(1.08);
}
.fab-whatsapp:active {
  transform: scale(0.95);
}

/* ===== PAGE NAVIGATION (for multi-section pages) ===== */
.page-sections {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-8);
}

.page-sections a {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-decoration: none;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  border: 1px solid oklch(from var(--color-text) l c h / 0.1);
}
.page-sections a:hover {
  color: var(--color-text);
  border-color: oklch(from var(--color-text) l c h / 0.2);
}

/* ===== RESPONSIVE UTILITY ===== */
@media (max-width: 767px) {
  .hide-mobile { display: none; }
}
@media (min-width: 768px) {
  .hide-desktop { display: none; }
}
