/* ==========================================================
   Yiwen Zhang — Personal Site
   Global nav + site styles (Kyson-inspired minimal nav)
   Design tokens live in css/tokens.css — this file only adds
   site-specific styles on top of them.
   ========================================================== */

:root {
  --nav-height: 72px;
  --max-width: 1200px;
}

* {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

/* Utility: italic serif accent (Newsreader italic — use sparingly) */
.accent-italic {
  font-family: var(--font-body);
  font-style: italic;
}

/* ---------- Header / Nav ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.site-header.scrolled {
  border-bottom-color: var(--border);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.nav {
  max-width: var(--max-width);
  height: var(--nav-height);
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Brand: icon + stacked text */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
}

/* Placeholder for your future animated icon (40x40) */
.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.brand-role {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.brand-name {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* Desktop links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
  list-style: none;
}

.nav-link {
  text-decoration: none;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 500;
  position: relative;
  padding: 4px 0;
}

/* Underline grow effect on hover / active */
.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: var(--text);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
  transform: scaleX(1);
}

/* CTA pill button */
.nav-cta {
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--snow);
  background: var(--ink);
  padding: 10px 24px;
  border-radius: var(--radius-pill);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.nav-cta:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

/* ---------- Mobile ---------- */

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu {
  display: none;
  flex-direction: column;
  padding: 8px 32px 24px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.mobile-menu.open { display: flex; }

.mobile-link {
  text-decoration: none;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.mobile-link:last-child { border-bottom: none; }

.mobile-cta {
  margin-top: 12px;
  text-align: center;
  color: var(--snow);
  background: var(--ink);
  border-radius: var(--radius-pill);
  border-bottom: none;
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  .nav { padding: 0 20px; }
}

/* ---------- Temporary section placeholders ---------- */

.placeholder-section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 120px 32px;
  border-bottom: 1px solid var(--border);
}

.placeholder-section h1 {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 600;
  letter-spacing: var(--tracking-display);
  margin-bottom: 12px;
}

.placeholder-section p {
  color: var(--text-muted);
}
