/* ==========================================================================
   Yiklam Studio — global.css
   Shared design system: fonts · variables · reset · navigation · footer
   · buttons · language toggle · responsive foundation.

   Do NOT duplicate these rules into page or project stylesheets.
   --------------------------------------------------------------------------
   Brand:
     Warm cream      #FDF9F4
     Deep charcoal   #1F2A2A
     Sage green      #3E6B5C
     Terracotta      #B27D5A
   Type:
     Playfair Display (display / headings)
     IBM Plex Sans   (body)
     IBM Plex Mono   (labels / meta / tags)
   ========================================================================== */

:root {
  --bg: #FDF9F4;
  --surface: #FFFFFF;
  --surface-warm: #FCFAF6;
  --text: #1F2A2A;
  --muted: #4B5E55;
  --muted2: #6C7A6E;
  --accent: #3E6B5C;          /* sage green */
  --accent2: #B27D5A;         /* terracotta */
  --border: #EFE8DF;
  --border-strong: #E8DED2;
  --tag-bg: #F0EBE2;
  --tag-bg2: #EDF2EA;
  --pill-hover: #DEE6D8;

  --radius-lg: 32px;
  --radius-md: 24px;
  --radius-sm: 16px;
  --radius-pill: 60px;

  --max: 1200px;

  --shadow: 0 2px 14px rgba(31, 42, 42, 0.04);
  --shadow-hover: 0 8px 28px rgba(31, 42, 42, 0.07);

  --font-display: 'Playfair Display', 'Georgia', serif;
  --font-body: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', 'SFMono-Regular', Menlo, monospace;
}

/* ---------- Reset ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--accent);
  text-decoration: none;
}

/* ---------- Layout container ---------- */
.main-container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 32px;
}

/* ---------- Navigation ---------- */
.site-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 0 22px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  flex-wrap: wrap;
  gap: 18px;
  position: sticky;
  top: 0;
  z-index: 90;
  background: rgba(253, 249, 244, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Case-study pages place .site-nav directly under <body> (no .main-container
   wrapper), so it must re-create the container inset itself. Pages whose nav
   lives inside .main-container are not matched by this selector. */
body > .site-nav {
  max-width: var(--max);
  margin: 0 auto;
  padding-left: 32px;
  padding-right: 32px;
}

@media (max-width: 980px) {
  body > .site-nav {
    padding-left: 22px;
    padding-right: 22px;
  }
}

@media (max-width: 560px) {
  body > .site-nav {
    padding-left: 18px;
    padding-right: 18px;
  }
}

.site-logo {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.3px;
  background: linear-gradient(135deg, #1F2A2A 0%, #3E6B5C 100%);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  text-decoration: none;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
}

.nav-links {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}

.nav-links a {
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  color: #2C3E3A;
  transition: color 0.2s ease;
  position: relative;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
}

.nav-links a.active::after,
.nav-links a:hover::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

/* ---------- Language toggle ---------- */
.lang-toggle {
  background: var(--tag-bg2);
  border: none;
  padding: 8px 18px;
  border-radius: 40px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  color: #2C3E3A;
  transition: all 0.2s;
  font-family: var(--font-mono);
}

.lang-toggle:hover {
  background: var(--pill-hover);
  transform: scale(0.97);
}

.lang-en,
.lang-zh {
  transition: opacity 0.15s;
}

body[data-lang="en"] .lang-zh { display: none; }
body[data-lang="zh"] .lang-en { display: none; }

/* ---------- Buttons ---------- */
.btn {
  padding: 11px 26px;
  border-radius: 40px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.25s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}

.btn-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(62, 107, 92, 0.12);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  background: var(--tag-bg);
  transform: translateY(-2px);
}

/* ---------- Footer ---------- */
.site-footer {
  text-align: center;
  padding: 44px 20px 56px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted2);
}

.site-footer .footer-brand {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
}

.site-footer .footer-tagline {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.site-footer .footer-statement {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted2);
  opacity: 0.85;
  line-height: 1.6;
  max-width: 520px;
  margin: 0 auto;
}

.site-footer .footer-contact {
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
}

.site-footer .footer-update {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted2);
  margin: 6px 0 10px;
}

.site-footer a {
  color: var(--accent);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

/* ---------- Responsive foundation ---------- */
@media (max-width: 980px) {
  .main-container { padding: 0 22px; }
  .site-nav { padding: 20px 0 16px; }
  .nav-right { gap: 18px; }
  .nav-links { gap: 18px; }
}

@media (max-width: 560px) {
  .main-container { padding: 0 18px; }
  .site-nav { flex-direction: column; align-items: flex-start; }
  .nav-right { width: 100%; justify-content: space-between; }
}
