/* ============================================================
   Ho Lin — holin.us  |  Shared Stylesheet
   ============================================================ */

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

:root {
  --cream:       #f5f0e8;
  --warm-white:  #faf7f2;
  --brick:       #b8512a;
  --clay:        #c97a4a;
  --charcoal:    #2a2520;
  --stone:       #4a4340;
  --light-stone: #c8bfb8;
  --rule:        #ddd5cc;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background-color: var(--warm-white);
  color: var(--charcoal);
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── NAV ── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 3rem;
  height: 64px;
  background: rgba(250, 247, 242, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
}

.nav-logo {
  font-family: 'Playfair Display', serif;
  font-weight: 600;
  font-size: 1.35rem;
  letter-spacing: 0.02em;
  color: var(--charcoal);
  text-decoration: none;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  gap: 2.5rem;
  list-style: none;
  align-items: center;
}

.nav-links > li { position: relative; }

.nav-links a {
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--stone);
  text-decoration: none;
  position: relative;
  transition: color 0.25s ease;
  display: flex;
  align-items: center;
  gap: 0.3em;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -3px; left: 0;
  width: 0; height: 1px;
  background: var(--brick);
  transition: width 0.3s ease;
}

.nav-links a:hover { color: var(--charcoal); }
.nav-links a:hover::after { width: 100%; }
.nav-links a.active { color: var(--brick); }
.nav-links a.active::after { width: 100%; }

/* dropdown caret */
.has-dropdown > a .caret {
  font-size: 0.55rem;
  opacity: 0.5;
  transition: transform 0.2s ease, opacity 0.2s ease;
  margin-left: 1px;
}

.has-dropdown:hover > a .caret,
.has-dropdown.open > a .caret {
  transform: rotate(180deg);
  opacity: 1;
}

/* dropdown menu */
.dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 18px);
  left: -1.2rem;
  background: var(--warm-white);
  border: 1px solid var(--rule);
  min-width: 180px;
  padding: 0.5rem 0;
  list-style: none;
  box-shadow: 0 8px 24px rgba(42,37,32,0.08);
}

.has-dropdown:hover .dropdown,
.has-dropdown.open .dropdown {
  display: block;
  animation: fadeUp 0.18s ease forwards;
}

.dropdown li a {
  display: block;
  padding: 0.55rem 1.2rem;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--stone);
  text-decoration: none;
  opacity: 1;
  animation: none;
  transition: color 0.2s ease, background 0.2s ease;
  white-space: nowrap;
}

.dropdown li a::after { display: none; }
.dropdown li a:hover { color: var(--brick); background: var(--cream); }

/* nav right */
.nav-right {
  display: flex;
  align-items: center;
  gap: 0;
}

.nav-divider {
  width: 1px; height: 20px;
  background: var(--rule);
  margin: 0 1.6rem;
}

.social-icons { display: flex; align-items: center; gap: 1rem; }

.social-icons a {
  color: var(--light-stone);
  text-decoration: none;
  display: flex;
  align-items: center;
  transition: color 0.2s ease, transform 0.2s ease;
}

.social-icons a:hover { color: var(--brick); transform: translateY(-2px); }
.social-icons svg { width: 16px; height: 16px; fill: currentColor; }

/* ── HAMBURGER ── */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 110;
  flex-shrink: 0;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--charcoal);
  transition: transform 0.3s ease, opacity 0.3s ease, width 0.3s ease;
  transform-origin: center;
}

.hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; width: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Mobile drawer */
.mobile-menu {
  display: none;
  position: fixed;
  top: 64px;
  left: 0; right: 0;
  background: var(--warm-white);
  border-bottom: 1px solid var(--rule);
  padding: 1.5rem 2rem 2rem;
  z-index: 99;
  flex-direction: column;
  gap: 0;
  box-shadow: 0 8px 24px rgba(42,37,32,0.08);
  max-height: calc(100vh - 64px);
  overflow-y: auto;
}

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

.mobile-menu > li {
  list-style: none;
  border-bottom: 1px solid var(--rule);
}

.mobile-menu > li:first-child { border-top: 1px solid var(--rule); }

.mobile-menu > li > a,
.mobile-menu > li > button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 1rem 0;
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--stone);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s ease;
}

.mobile-menu > li > a:hover,
.mobile-menu > li > button:hover { color: var(--brick); }
.mobile-menu > li > a.active { color: var(--brick); }

.mobile-caret {
  font-size: 0.6rem;
  opacity: 0.5;
  transition: transform 0.2s ease;
}

.mobile-submenu-toggle.open .mobile-caret { transform: rotate(180deg); opacity: 1; }

.mobile-sub {
  display: none;
  list-style: none;
  padding: 0.25rem 0 0.75rem 1rem;
  flex-direction: column;
  gap: 0;
}

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

.mobile-sub li a {
  display: block;
  padding: 0.6rem 0;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--light-stone);
  text-decoration: none;
  transition: color 0.2s ease;
}

.mobile-sub li a:hover { color: var(--brick); }

.mobile-social {
  display: flex;
  gap: 1.4rem;
  padding: 1.5rem 0 0.5rem;
  margin-top: 0.5rem;
}

.mobile-social a {
  color: var(--light-stone);
  display: flex;
  align-items: center;
  transition: color 0.2s ease;
}

.mobile-social a:hover { color: var(--brick); }
.mobile-social svg { width: 18px; height: 18px; fill: currentColor; }

/* ── FOOTER ── */
footer {
  padding: 2.5rem 3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--rule);
}

.footer-name {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--stone);
  letter-spacing: 0.02em;
}

.footer-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.footer-links a {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--light-stone);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-links a:hover { color: var(--brick); }

/* ── ANIMATIONS ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes imageFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes expandLine {
  from { opacity: 0; transform: scaleX(0); }
  to   { opacity: 1; transform: scaleX(1); }
}

/* ── SHARED RESPONSIVE ── */
@media (max-width: 900px) {
  nav { padding: 0 1.5rem; }

  .nav-links,
  .nav-right { display: none; }

  .hamburger { display: flex; }
}

@media (max-width: 600px) {
  footer { flex-direction: column; gap: 1.5rem; text-align: center; }
  .footer-links { justify-content: center; flex-wrap: wrap; }
}
