/* ================================
   COMPONENTS.CSS
   Reusable — shared across pages
================================ */

/* ── Custom cursor ── */
.cursor {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: opacity 0.2s;
}

.cursor-inner {
  background: #ffffff;
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 10px 18px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

/* ── Nav base (all pages) ── */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: clamp(16px, 2vw, 22px) 0;
  border-bottom: 0.5px solid var(--color-line);
  gap: clamp(16px, 2vw, 32px);
  transition: border-color 0.4s var(--ease-out);
  flex-wrap: wrap;
}

/* ── Enhanced sticky nav (homepage + about) ── */
nav.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--color-bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
}

.nav-logo {
  font-family: var(--font-display);
  font-size: clamp(16px, 1.4vw, 18px);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--color-ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
.nav-logo .dot {
  transform: translateY(-3px);
}

/* ── Nav meta (Currently / Based in) ── */
.nav-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.35;
  flex: 0 1 auto;
}
.nav-meta-label {
  font-size: var(--text-xs);
  color: var(--color-quiet);
  letter-spacing: 0.01em;
}
.nav-meta-value {
  font-size: var(--text-sm);
  color: var(--color-ink);
  letter-spacing: -0.005em;
  font-weight: 500;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.4vw, 32px);
  margin-left: auto;
}

.nav-links {
  display: flex;
  gap: clamp(14px, 2.4vw, 32px);
  list-style: none;
}

.nav-links a {
  position: relative;
  font-size: var(--text-sm);
  color: var(--color-mute);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color 0.2s var(--ease-out);
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 1px;
  background: var(--color-ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease-out);
}
.nav-links a:hover { color: var(--color-ink); }
.nav-links a:hover::after,
.nav-links a.is-current::after { transform: scaleX(1); }
.nav-links a.is-current { color: var(--color-ink); }

/* ── Theme toggle (circular) ── */
.theme-btn {
  width: clamp(32px, 3vw, 36px);
  height: clamp(32px, 3vw, 36px);
  border-radius: 50%;
  border: 0.5px solid var(--color-line);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-mute);
  flex-shrink: 0;
  transition: color 0.2s var(--ease-out), border-color 0.2s var(--ease-out), background 0.2s var(--ease-out);
}
.theme-btn:hover {
  color: var(--color-ink);
  border-color: var(--color-ink);
}
.theme-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
}

/* ── Footer — standard (inside .page, case study pages) ── */
footer {
  padding: 28px 0;
  margin-top: 48px;
  border-top: 0.5px solid var(--color-line);
  display: flex;
  justify-content: space-between;
  font-size: var(--text-sm);
  color: var(--color-mute);
  letter-spacing: 0.02em;
  transition: border-color 0.4s var(--ease-out);
}

/* ── Footer — site-foot (outside .page, homepage + about) ── */
footer.site-foot {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 28px var(--gutter);
  border-top: 0.5px solid var(--color-line);
  display: flex;
  justify-content: space-between;
  font-size: var(--text-sm);
  color: var(--color-mute);
  letter-spacing: 0.02em;
  margin-top: 0;
}

/* ================================
   RESPONSIVE — nav & footer
================================ */

/* Laptop — hide secondary nav-meta first */
@media (max-width: 1100px) {
  nav.site-nav .nav-meta:nth-of-type(2) { display: none; }
}

/* Tablet — hide all meta blocks */
@media (max-width: 900px) {
  nav.site-nav .nav-meta { display: none; }
}

/* Mobile */
@media (max-width: 640px) {
  .cursor { display: none; }
  nav { padding: 14px 0; gap: 12px; }

  /* Stack site-foot vertically with consistent spacing */
  footer.site-foot {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 24px var(--gutter);
  }
  footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}

/* Very small mobile — drop Contact link if cramped */
@media (max-width: 420px) {
  .nav-links { gap: 14px; }
  .nav-links li:nth-child(3) { display: none; }
}
