﻿*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --color-apple-blue: #0071e3;
  --color-link-blue: #0066cc;
  --color-signal-blue: #2997ff;
  --color-carbon: #1d1d1f;
  --color-frost: #f5f5f7;
  --color-ice: #f4f8fb;
  --color-smoke: #333333;
  --color-graphite: #474747;
  --color-ash: #707070;
  --color-mist: #858585;
  --color-onyx: #000000;
  --color-pebble: #e2e2e5;
  --font-sf: 'SF Pro Display', 'SF Pro Text', 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --nav-h: 48px;
  --trans-fast: 200ms ease;
  --trans-mid: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sf);
  background: var(--color-frost);
  color: var(--color-carbon);
  line-height: 1.47;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─── NAV ─── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(245, 245, 247, 0.85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--color-pebble);
  transition: background var(--trans-fast);
}

.navbar.scrolled {
  background: rgba(245, 245, 247, 0.95);
}

.nav-inner {
  max-width: 1440px;
  height: 100%;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo-mark {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.022em;
  color: var(--color-carbon);
  text-decoration: none;
  flex-shrink: 0;
  transition: opacity var(--trans-fast);
}

.nav-logo-mark:hover { opacity: 0.7; }

.nav-tabs {
  display: flex;
  list-style: none;
  gap: 0;
  align-items: center;
}

.tab-link {
  display: block;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: -0.022em;
  color: var(--color-carbon);
  text-decoration: none;
  transition: opacity var(--trans-fast), color var(--trans-fast);
  white-space: nowrap;
  position: relative;
}

.tab-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 12px;
  right: 12px;
  height: 2px;
  background: var(--color-apple-blue);
  border-radius: 2px 2px 0 0;
  transform: scaleX(0);
  transition: transform var(--trans-mid);
}

.tab-link:hover { opacity: 0.7; }

.tab-link.active {
  color: var(--color-apple-blue);
}

.tab-link.active::after {
  transform: scaleX(1);
}

/* ─── THEME / LANG TOGGLES ─── */
.theme-toggle,
.lang-toggle {
  background: none;
  border: 1px solid var(--color-pebble);
  border-radius: 980px;
  padding: 2px 10px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 400;
  color: var(--color-ash);
  font-family: var(--font-sf);
  transition: border-color var(--trans-fast), color var(--trans-fast);
  line-height: 1.6;
  margin-left: 4px;
}

.theme-toggle:hover,
.lang-toggle:hover {
  border-color: var(--color-link-blue);
  color: var(--color-link-blue);
}

.theme-icon { font-size: 0.85rem; }

/* ─── SECTIONS ─── */
.section {
  min-height: 100vh;
  padding-top: var(--nav-h);
}

.section-content {
  max-width: 980px;
  margin: 0 auto;
  padding: 80px 2rem;
}

.section-title {
  font-size: clamp(40px, 5vw, 56px);
  font-weight: 600;
  letter-spacing: 0.44px;
  color: var(--color-carbon);
  line-height: 1.07;
  margin-bottom: 24px;
}

.section-body {
  font-size: 17px;
  line-height: 1.47;
  letter-spacing: -0.272px;
  color: var(--color-ash);
  max-width: 680px;
  margin-top: 12px;
}

/* ─── HOME / HERO ─── */
.section-home {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 0;
  min-height: 60vh;
  overflow: hidden;
  background: var(--color-carbon);
}

.banner-wrap {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  opacity: 0.5;
}

.banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.3) 0%,
    rgba(0,0,0,0.05) 40%,
    rgba(0,0,0,0.65) 100%
  );
}

.home-logo-wrap {
  position: relative;
  z-index: 1;
  margin-top: 4rem;
}

/* ─── QUOTE ─── */
.quote-section {
  background: var(--color-carbon);
  padding: 64px 2rem;
  display: flex;
  justify-content: center;
  align-items: center;
  border-top: 1px solid var(--color-smoke);
}

.banner-quote-wrap { text-align: center; }

.banner-quote {
  font-family: 'Playfair Display', 'Georgia', serif;
  font-style: italic;
  font-size: clamp(18px, 2.5vw, 28px);
  font-weight: 400;
  letter-spacing: 0.196px;
  color: var(--color-frost);
  max-width: 740px;
  margin: 0 auto;
  line-height: 1.35;
}

/* ─── POSTS ─── */
.section-posts {
  background: var(--color-frost);
  border-top: 1px solid var(--color-pebble);
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 40px;
}

.posts-grid > *:nth-child(1) { order: 3; }
.posts-grid > *:nth-child(2) { order: 2; }
.posts-grid > *:nth-child(3) { order: 1; }

.post-card {
  background: #fff;
  border: 1px solid var(--color-pebble);
  border-radius: 8px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: box-shadow var(--trans-fast);
}

.post-card:hover {
  box-shadow: rgba(0,0,0,0.12) 0 4px 16px;
}

.post-tag {
  display: inline-block;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: -0.022em;
  color: var(--color-ash);
  background: var(--color-pebble);
  border-radius: 980px;
  width: fit-content;
}

.post-title {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.105px;
  color: var(--color-carbon);
  line-height: 1.19;
}

.post-date {
  font-size: 12px;
  letter-spacing: -0.022em;
  color: var(--color-ash);
}

.post-excerpt {
  font-size: 14px;
  letter-spacing: -0.224px;
  color: var(--color-ash);
  line-height: 1.29;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-read-more {
  font-size: 17px;
  font-weight: 400;
  letter-spacing: -0.272px;
  color: var(--color-link-blue);
  text-decoration: none;
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
  transition: opacity var(--trans-fast);
}

.post-read-more:hover { opacity: 0.75; }

/* ─── ABOUT ─── */
.section-about {
  background: var(--color-ice);
  border-top: 1px solid var(--color-pebble);
}

.cores-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 24px;
  font-size: 17px;
  font-weight: 400;
  letter-spacing: -0.272px;
  color: var(--color-link-blue);
  text-decoration: none;
  transition: opacity var(--trans-fast);
}

.cores-link:hover { opacity: 0.75; }

/* ─── GOALS ─── */
.section-goals {
  background: var(--color-frost);
  border-top: 1px solid var(--color-pebble);
}

.goals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 40px;
}

.goal-card {
  background: #fff;
  border: 1px solid var(--color-pebble);
  border-radius: 8px;
  padding: 24px;
  transition: box-shadow var(--trans-fast);
}

.goal-card:hover {
  box-shadow: rgba(0,0,0,0.1) 0 4px 16px;
}

.goal-num {
  font-size: 40px;
  font-weight: 600;
  letter-spacing: 0.44px;
  line-height: 1.07;
  color: var(--color-pebble);
  display: block;
  margin-bottom: 12px;
}

.goal-card h3 {
  font-size: 17px;
  font-weight: 400;
  letter-spacing: -0.272px;
  color: var(--color-carbon);
  line-height: 1.47;
}

.goal-card p {
  font-size: 14px;
  letter-spacing: -0.224px;
  color: var(--color-ash);
  line-height: 1.29;
  margin-top: 8px;
}

/* ─── DONATE ─── */
.section-donate {
  background: var(--color-ice);
  border-top: 1px solid var(--color-pebble);
  display: flex;
  align-items: center;
  justify-content: center;
}

.donate-inner {
  align-items: center;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.donate-msg {
  font-size: 17px;
  letter-spacing: -0.272px;
  color: var(--color-ash);
  max-width: 480px;
  text-align: center;
  line-height: 1.47;
  margin-top: 16px;
}

.donate-msg-sub {
  font-size: 14px;
  letter-spacing: -0.224px;
  color: var(--color-ash);
  margin-top: 8px;
}

.donate-msg strong {
  color: var(--color-carbon);
  font-weight: 600;
}

.donate-vn-link {
  color: var(--color-link-blue);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.donate-vn-link:hover { opacity: 0.75; }

.donate-qr {
  width: min(260px, 60vw);
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--color-pebble);
  display: block;
  margin: 24px auto 0;
}

/* ─── CONTACT ─── */
.section-contact {
  background: var(--color-frost);
  border-top: 1px solid var(--color-pebble);
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 40px;
}

.contact-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--color-pebble);
  border-radius: 8px;
  padding: 24px;
  text-decoration: none;
  color: var(--color-carbon);
  flex: 1;
  min-width: 180px;
  transition: box-shadow var(--trans-fast);
}

.contact-card:hover {
  box-shadow: rgba(0,0,0,0.1) 0 4px 16px;
}

.contact-icon {
  width: 28px;
  height: 28px;
  color: var(--color-ash);
  flex-shrink: 0;
}

.contact-label {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: -0.022em;
  color: var(--color-ash);
}

.contact-handle {
  font-size: 14px;
  font-weight: 400;
  letter-spacing: -0.224px;
  color: var(--color-carbon);
  text-align: center;
}

/* ─── FOOTER ─── */
.footer {
  background: var(--color-frost);
  border-top: 1px solid var(--color-pebble);
  padding: 24px 2rem;
  text-align: center;
  font-size: 12px;
  letter-spacing: -0.022em;
  color: var(--color-ash);
}

/* ─── MODAL ─── */
.post-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms ease;
}

.post-backdrop.open {
  opacity: 1;
  pointer-events: all;
}

.post-modal {
  background: #fff;
  border: 1px solid var(--color-pebble);
  border-radius: 8px;
  width: 85vw;
  max-width: 960px;
  height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(16px) scale(0.98);
  transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: rgba(0,0,0,0.22) 3px 5px 30px 0px;
}

.post-backdrop.open .post-modal {
  transform: translateY(0) scale(1);
}

.post-modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--color-pebble);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex-shrink: 0;
}

.post-modal-header-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.post-modal-tag {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: -0.022em;
  color: var(--color-ash);
  background: var(--color-pebble);
  padding: 2px 10px;
  border-radius: 980px;
  width: fit-content;
}

.post-modal-title {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.105px;
  color: var(--color-carbon);
  line-height: 1.19;
}

.post-modal-date {
  font-size: 12px;
  letter-spacing: -0.022em;
  color: var(--color-ash);
}

.post-modal-close {
  background: none;
  border: 1px solid var(--color-pebble);
  border-radius: 980px;
  color: var(--color-ash);
  cursor: pointer;
  padding: 4px 12px;
  font-size: 14px;
  line-height: 1.4;
  flex-shrink: 0;
  transition: border-color var(--trans-fast), color var(--trans-fast);
  font-family: var(--font-sf);
}

.post-modal-close:hover {
  border-color: var(--color-carbon);
  color: var(--color-carbon);
}

.post-modal-body {
  padding: 24px;
  overflow-y: auto;
  font-size: 17px;
  letter-spacing: -0.272px;
  color: var(--color-ash);
  line-height: 1.47;
  flex: 1;
}

.post-modal-body::-webkit-scrollbar { width: 6px; }
.post-modal-body::-webkit-scrollbar-track { background: transparent; }
.post-modal-body::-webkit-scrollbar-thumb {
  background: var(--color-pebble);
  border-radius: 3px;
}

.post-modal-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 12px 0;
  display: block;
}

/* ─── LANG TOAST ─── */
.lang-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 300;
  background: #fff;
  border: 1px solid var(--color-pebble);
  box-shadow: rgba(0,0,0,0.12) 0 4px 16px;
  color: var(--color-carbon);
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: -0.224px;
  max-width: 320px;
  line-height: 1.4;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 300ms ease, transform 300ms ease;
  pointer-events: none;
}

.lang-toast.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  .nav-inner { padding: 0 1rem; }
  .tab-link { padding: 4px 8px; font-size: 11px; }
  .section-content { padding: 56px 1.25rem; }
}

@media (max-width: 500px) {
  .nav-tabs { gap: 0; }
  .tab-link { padding: 4px 6px; font-size: 10px; }
}

/* ─── OPTIONAL DARK MODE (toggle) ─── */
body.dark {
  background: #1d1d1f;
  color: #f5f5f7;
}

body.dark .navbar {
  background: rgba(29, 29, 31, 0.85);
  border-bottom-color: #333;
}

body.dark .navbar.scrolled {
  background: rgba(29, 29, 31, 0.97);
}

body.dark .nav-logo-mark,
body.dark .tab-link { color: #f5f5f7; }

body.dark .tab-link.active { color: #2997ff; }

body.dark .section-posts,
body.dark .section-goals,
body.dark .section-contact { background: #1d1d1f; }

body.dark .section-about,
body.dark .section-donate { background: #111; }

body.dark .quote-section { background: #111; border-top-color: #333; }

body.dark .post-card,
body.dark .goal-card,
body.dark .contact-card,
body.dark .post-modal { background: #2c2c2e; border-color: #3a3a3c; }

body.dark .post-title,
body.dark .goal-card h3,
body.dark .core-name,
body.dark .section-title,
body.dark .contact-handle,
body.dark .post-modal-title { color: #f5f5f7; }

body.dark .post-excerpt,
body.dark .post-date,
body.dark .section-body,
body.dark .goal-card p,
body.dark .donate-msg,
body.dark .contact-label,
body.dark .post-modal-body { color: #ababab; }

body.dark .post-tag,
body.dark .post-modal-tag { background: #3a3a3c; color: #ababab; }

body.dark .footer { background: #1d1d1f; border-top-color: #333; color: #6e6e73; }

body.dark .theme-toggle,
body.dark .lang-toggle { border-color: #3a3a3c; color: #ababab; }

body.dark .donate-qr { border-color: #3a3a3c; }
body.dark .post-modal-header { border-bottom-color: #3a3a3c; }
body.dark .post-modal-close { border-color: #3a3a3c; color: #ababab; }

body.dark .banner-overlay {
  background: linear-gradient(to bottom, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.1) 40%, rgba(0,0,0,0.75) 100%);
}

body.dark .cores-main { background: #1d1d1f; }
body.dark .core-card { background: #2c2c2e; border-color: #3a3a3c; }
body.dark .core-img-wrap,
body.dark .core-img-placeholder { background: #3a3a3c; }
body.dark .core-role { background: #3a3a3c; }


body.dark .tab-link::after { background: var(--color-signal-blue); }

