/* =========================================================
   layout.css — Header, nav, section scaffolding, footer
   ========================================================= */

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-height);
  background: transparent;
  backdrop-filter: none;
  border-bottom: none;
}

.header-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.logo {
  font-weight: 900;
  font-size: var(--fs-md);
  letter-spacing: 0.02em;
}

.main-nav {
  display: none; /* shown only on mobile via responsive.css */
}

.main-nav ul {
  display: flex;
  gap: var(--space-3);
}

.main-nav a {
  font-weight: 600;
  color: var(--color-text-muted);
  transition: color 0.2s ease;
}

.main-nav a:hover { color: var(--color-text); }

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.lang-switch {
  font-weight: 800;
  font-size: var(--fs-md);
  font-family: var(--font-base);
  border: none;
  padding: 0.6rem 1.25rem;
  color: var(--color-text);
  background: none;
  position: fixed;
  top: var(--space-3);
  left: var(--space-3);
  z-index: 3000;
}

/* Hamburger (mobile only — show via responsive.css) */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  position: fixed;
  top: var(--space-3);
  right: var(--space-3);
  z-index: 3000;
  width: auto;
  padding: 0.6rem 0.8rem;
  background: none;
  border: none;
  cursor: pointer;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Sections ---------- */
section {
  padding-block: var(--space-6);
}

#hero { padding-block: var(--space-6) var(--space-5); }

.about, .current-project {
  background: var(--color-bg-alt);
  text-align: center;
}

.current-project {
  position: relative;
  overflow: hidden;
}

.current-project::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../images/backgrounds/current-project-bg.gif") center / cover no-repeat;
  opacity: 0.18;
  pointer-events: none;
  z-index: 0;
}

.current-project > * {
  position: relative;
  z-index: 1;
}

.current-project-win {
  display: block;
  margin: 0 auto 1rem;
  max-width: 480px;
  width: 100%;
  border: 1px solid #717171;
  border-radius: 6px 6px 4px 4px;
  box-shadow:
    1px 1px 0 #e0e0e0 inset,
    -1px 0 0 #e0e0e0 inset,
    0 -1px 0 #e0e0e0 inset,
    0 4px 18px rgba(0,0,0,0.28);
  overflow: hidden;
  direction: ltr;
}

.current-project-win .xp-titlebar {
  background:
    linear-gradient(180deg,
      #dcdcdc 0%, #c8c8c8 8%,
      #b8b8b8 40%, #acacac 60%,
      #acacac 70%, #c4c4c4 90%,
      #b4b4b4 100%);
  border-radius: 5px 5px 0 0;
  cursor: default;
}

.current-project-win .xp-title {
  color: #1a1a1a;
  text-shadow: 0 1px 0 rgba(255,255,255,0.6);
}

.current-project-win .xp-title-icon {
  filter: none;
}

.current-project-win .exif-photo-body {
  height: auto;
}

.current-project-win .exif-photo-body img {
  width: 100%;
  height: auto;
  object-fit: unset;
  display: block;
  filter: grayscale(100%) blur(20px);

}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding-block: var(--space-3);
  text-align: center;
}

.site-footer p { margin: 0; color: var(--color-text-muted); font-size: var(--fs-xs); }

/* ---------- Clippy ---------- */
@keyframes clippy-idle {
  0%   { transform: translate(  0px,  0px); }
  25%  { transform: translate(  2px, -3px); }
  50%  { transform: translate(  0px, -5px); }
  75%  { transform: translate( -2px, -2px); }
  100% { transform: translate(  0px,  0px); }
}

.clippy-float {
  position: fixed;
  bottom: 2rem;
  right: 1rem;
  width: 140px;
  z-index: 3000;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  direction: ltr;
  animation: clippy-idle 4s ease-in-out infinite;
}

.clippy-idle {
  display: block;
  width: 135px;
  height: auto;
  transition: opacity 0.15s ease;
  opacity: 1;
}

.clippy-hover-a {
  display: block;
  width: 650px;
  height: auto;
  position: absolute;
  bottom: -27px;
  right: -2px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.clippy-hover-zh {
  display: block;
  width: 117px;
  height: auto;
  position: absolute;
  bottom: -9px;
  right: 10px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.clippy-float.show-a .clippy-idle    { opacity: 0; }
.clippy-float.show-a .clippy-hover-a { opacity: 1; }

/* zh mode: swap dig GIF for the hi-zh GIF on hover */
html[lang="zh"] .clippy-float.show-a .clippy-hover-a  { opacity: 0; }
html[lang="zh"] .clippy-float.show-a .clippy-hover-zh { opacity: 1; }

.clippy-close {
  position: absolute;
  top: -34px;
  right: 0;
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 3px;
  border: 1px solid rgba(0,0,0,0.4);
  cursor: pointer;
  background: linear-gradient(180deg, #e06050 0%, #c02810 45%, #a81800 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  font-family: "Marlett", "Tahoma", sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 0 rgba(255,255,255,0.3) inset;
  line-height: 1;
}
.clippy-close:hover { background: linear-gradient(180deg,#f07060 0%,#d83820 45%,#c02010 100%); }
.clippy-close:active { background: linear-gradient(180deg,#a81800 0%,#c02810 100%); box-shadow: none; }

.clippy-speech-zh {
  display: none;
  position: absolute;
  bottom: calc(100% + 80px);
  right: -8px;
  width: 160px;
  background: #ffffc0;
  border: 1px solid #000;
  border-radius: 5px;
  padding: 8px 10px;
  font-family: "Microsoft YaHei", "SimHei", Tahoma, "MS Sans Serif", sans-serif;
  font-size: 12px;
  line-height: 1.5;
  color: #000;
  direction: ltr;
  text-align: left;
  pointer-events: none;
  z-index: 1;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.18);
  animation: none;
}
.clippy-speech-zh::before {
  content: '';
  position: absolute;
  bottom: -10px;
  right: 22px;
  border: 9px solid transparent;
  border-top-color: #000;
  border-bottom: none;
}
.clippy-speech-zh::after {
  content: '';
  position: absolute;
  bottom: -8px;
  right: 23px;
  border: 8px solid transparent;
  border-top-color: #ffffc0;
  border-bottom: none;
}
html[lang="zh"] .clippy-float.show-a .clippy-speech-zh { display: block; }

/* ---------- Bing (zh Easter egg) ---------- */
#bing-float {
  display: none;
  position: fixed;
  width: 130px;
  height: auto;
  z-index: 2998;
  pointer-events: none;
}

.notepad-float {
  position: fixed;
  bottom: 2rem;
  left: 1.5rem;
  z-index: 3000;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  direction: ltr;
}

.notepad-float-img {
  display: block;
  width: 72px;
  height: auto;
  image-rendering: pixelated;
}


.notepad-float-label {
  display: block;
  text-align: center;
  font-family: "Tahoma", "Arial", sans-serif;
  font-size: 11px;
  color: #fff;
  text-shadow:
    1px  1px 1px #000,
   -1px -1px 1px #000,
    1px -1px 1px #000,
   -1px  1px 1px #000;
  margin-top: 3px;
  letter-spacing: 0.03em;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
}
