/* ============================================================
   Andy Wang - Portfolio Landing Page
   style.css
   ============================================================ */

/* -- RESET & VARIABLES -- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --black:      #0a0a0a;
  --white:      #f5f5f0;
  --accent:     #e8c4b8;
  --muted:      #888;
  --border:     rgba(0, 0, 0, 0.18);
  --font-mono:  'Courier Prime', monospace;
  --font-serif: 'IM Fell English', serif;
  --font-cn:    'Noto Serif SC', serif;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-mono);
  background: var(--white);
  color: var(--black);
  overflow-x: hidden;
}

/* -- CHINESE FONT OVERRIDES -- */
html[data-lang="zh"] body {
  font-family: var(--font-cn);
}
html[data-lang="zh"] .info-content p {
  font-family: var(--font-cn);
  letter-spacing: 0.06em;
  line-height: 2.2;
}
html[data-lang="zh"] .gallery-header h2 {
  font-family: var(--font-cn);
}
html[data-lang="zh"] .gallery-header .sub {
  font-family: var(--font-cn);
}

/* -- i18n VISIBILITY -- */
[data-i18n] {
  display: none;
}
html[data-lang="en"] [data-i18n="en"],
html[data-lang="zh"] [data-i18n="zh"] {
  display: inline;
}
/* Block-level overrides (e.g. <p>) */
html[data-lang="en"] p[data-i18n="en"],
html[data-lang="zh"] p[data-i18n="zh"] {
  display: block;
}

/* -- NAV -- */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 2px;
  padding: 10px 24px;
  background: rgba(245, 245, 240, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

nav a {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--black);
  padding: 4px 14px;
  border: 1px solid var(--border);
  transition: background 0.2s, color 0.2s;
}
nav a:hover {
  background: var(--black);
  color: var(--white);
}

/* Language toggle */
.lang-toggle {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  overflow: hidden;
  margin-left: 12px;
}
.lang-toggle button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 11px;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  font-family: var(--font-mono);
  color: var(--muted);
  transition: background 0.18s, color 0.18s;
}
.lang-toggle .sep {
  width: 1px;
  height: 16px;
  background: var(--border);
  display: inline-block;
  flex-shrink: 0;
}
.lang-toggle button.active {
  background: var(--black);
  color: var(--white);
}
.lang-toggle button:hover:not(.active) {
  background: rgba(0, 0, 0, 0.06);
  color: var(--black);
}

/* -- HERO SECTION -- */
#hero {
  position: relative;
  --hero-frame-width: 680px;
  --hero-frame-top: 80px;
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  padding-top: 44px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-image: url('../imgs/intro_bg.webp');
  background-size: cover;
  background-position: center top;
  z-index: 0;
  opacity: 0.72;
}

/* 3D render frame */
.hero-frame {
  position: relative;
  z-index: 2;
  width: var(--hero-frame-width);
  margin-top: 36px;
}
.hero-frame img {
  width: 100%;
  display: block;
  visibility: hidden;
}

/* Info / Art Gallery nav circles */
.bubbles-layer {
  position: absolute;
  top: calc(var(--hero-frame-top) + 60px);
  left: 50%;
  transform: translateX(-50%);
  width: var(--hero-frame-width);
  z-index: 3;
  pointer-events: none;
}
.bubbles-layer img {
  width: 100%;
  display: block;
  pointer-events: all;
}

/* Hero circle click targets */
.hero-hotspot {
  position: absolute;
  z-index: 6;
  display: block;
  border-radius: 50%;
}
.hero-hotspot-info {
  top: calc(var(--hero-frame-top) + 190px);
  left: calc(50% - 276px);
  width: 132px;
  height: 132px;
  transform: translate(-50%, -50%);
}
.hero-hotspot-gallery {
  top: calc(var(--hero-frame-top) + 123px);
  left: calc(50% + 273px);
  width: 144px;
  height: 144px;
  transform: translate(-50%, -50%);
}

/* Rotating decoration elements */
.rotation-deco {
  position: absolute;
  z-index: 2;
  pointer-events: none;
  transform-origin: 50% 50%;
}
.rotation-deco img {
  width: 100%;
  height: auto;
  display: block;
}
.rotation-info {
  top: calc(var(--hero-frame-top) + 95px);
  left: calc(50% - 382px);
  width: 320px;
  animation: rotateClockwise 14s linear infinite;
}
.rotation-gallery {
  top: calc(var(--hero-frame-top) - 40px);
  left: calc(50% + 210px);
  width: 210px;
  animation: rotateCounterClockwise 18s linear infinite;
}

/* Profile photo circle */
.profile-circle {
  position: absolute;
  z-index: 4;
  top: calc(var(--hero-frame-top) + 149px);
  left: 50%;
  transform: translateX(-50%);
  width: 156px;
  height: 156px;
  border-radius: 50%;
  border: 3px solid var(--black);
  overflow: hidden;
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.6), 0 4px 24px rgba(0, 0, 0, 0.18);
}
.profile-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Intro text image */
.hero-text-img {
  position: relative;
  z-index: 2;
  width: 560px;
  margin-top: -32px;
}
.hero-text-img img {
  width: 100%;
  display: block;
}

/* -- INFO / BIO SECTION -- */
#info {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.info-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.info-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.28;
}

.info-content {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
  padding: 60px 32px 80px;
}
.info-content p {
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 2;
  letter-spacing: 0.03em;
  color: var(--black);
}

/* Decorative diamond divider */
.diamond-rule {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}
.diamond-rule::before,
.diamond-rule::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--black);
}
.diamond-rule span {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--black);
  transform: rotate(45deg);
}

/* -- GALLERY SECTION -- */
#gallery {
  width: 100%;
  background: #f0efeb;
}

.gallery-header {
  text-align: center;
  padding: 64px 24px 36px;
}
.gallery-header h2 {
  font-family: var(--font-serif);
  font-size: clamp(28px, 5vw, 52px);
  font-weight: 400;
  letter-spacing: 0.08em;
}
.gallery-header .sub {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 10px;
}

.gallery-img-wrap {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px 80px;
}

.gallery-hover-wrap {
  position: relative;
  cursor: pointer;
  overflow: hidden;
}
.gallery-hover-wrap img {
  width: 100%;
  display: block;
  border: 1px solid rgba(0, 0, 0, 0.08);
}
.gallery-hover-wrap .hover-overlay {
  position: absolute;
  inset: 0;
  background-image: url('../imgs/gallery_hover.webp');
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 0.4s ease;
  mix-blend-mode: screen;
  pointer-events: none;
}
.gallery-hover-wrap:hover .hover-overlay {
  opacity: 0.55;
}

/* -- FOOTER -- */
footer {
  background: var(--black);
  color: var(--white);
  text-align: center;
  padding: 32px 24px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
}
footer a {
  color: var(--accent);
  text-decoration: none;
}
footer a:hover {
  text-decoration: underline;
}

/* -- ANIMATIONS -- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeUpCentered {
  from { opacity: 0; transform: translate(-50%, 28px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
@keyframes rotateClockwise {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes rotateCounterClockwise {
  from { transform: rotate(0deg); }
  to   { transform: rotate(-360deg); }
}

.hero-frame {
  animation: fadeUp 0.9s ease both;
  animation-delay: 0.1s;
}
.hero-text-img {
  animation: fadeUp 0.9s ease both;
  animation-delay: 0.35s;
}
.bubbles-layer {
  animation: fadeUpCentered 0.9s ease both;
  animation-delay: 0.2s;
}

/* Scroll-reveal */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
