/* ============================================================
   Alex Chen 鈥?Personal Brand Site
   style.css
   ============================================================ */

/* ---------- CSS Variables ---------- */
:root {
  --bg: #fafafa;
  --text-primary: #1a1a2e;
  --text-secondary: #6b7280;
  --accent: #7a9e8c;
  --accent-light: #e8f0ec;
  --card-bg: #ffffff;
  --border: #e5e7eb;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    Helvetica, Arial, sans-serif;

  --spacing-xs: 8px;
  --spacing-sm: 16px;
  --spacing-md: 24px;
  --spacing-lg: 40px;
  --spacing-xl: 64px;
  --spacing-2xl: 96px;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-full: 50%;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.08);

  --transition: 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
  --transition-slow: 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);

  --nav-height: 64px;
  --max-width: 1080px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-primary);
  background: var(--bg);
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

.section {
  padding: var(--spacing-2xl) 0;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--spacing-lg);
  color: var(--text-primary);
}

/* ---------- Fade-in Animation ---------- */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--transition-slow),
    transform var(--transition-slow);
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Navbar ---------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-height);
  z-index: 100;
  background: rgba(250, 250, 250, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-brand {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  transition: color var(--transition);
}

.nav-brand:hover {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: var(--spacing-lg);
}

.nav-link {
  position: relative;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 4px 0;
  transition: color var(--transition);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width var(--transition);
}

.nav-link:hover {
  color: var(--text-primary);
}

.nav-link:hover::after {
  width: 100%;
}

/* ---------- Hamburger ---------- */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 36px;
  height: 36px;
  padding: 6px;
  background: transparent;
  border: none;
  cursor: pointer;
}

.hamburger .bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--transition);
  transform-origin: center;
}

.hamburger.active .bar:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.hamburger.active .bar:nth-child(2) {
  opacity: 0;
}

.hamburger.active .bar:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  padding-top: var(--nav-height);
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: var(--spacing-sm);
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  font-weight: 400;
  color: var(--text-secondary);
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.6;
}

/* --- Decorative elements --- */
.hero-deco {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.deco-ring {
  position: absolute;
  border: 1px solid var(--border);
  border-radius: 50%;
}

.deco-ring--1 {
  width: 420px;
  height: 420px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.deco-ring--2 {
  width: 560px;
  height: 560px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.deco-dot {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--accent-light);
  border-radius: 50%;
}

.deco-dot--1 {
  top: 18%;
  left: 22%;
  width: 6px;
  height: 6px;
}

.deco-dot--2 {
  top: 72%;
  left: 78%;
  width: 5px;
  height: 5px;
}

.deco-dot--3 {
  top: 28%;
  left: 75%;
  width: 4px;
  height: 4px;
}

/* ---------- About ---------- */
.about {
  background: var(--card-bg);
  border-top: 1px solid var(--border);
}

.about-grid {
  display: flex;
  gap: var(--spacing-xl);
  align-items: center;
}

.about-text {
  flex: 1 1 55%;
}

.about-text p {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-sm);
  line-height: 1.75;
}

.about-text p:last-child {
  margin-bottom: 0;
}

.about-photo {
  flex: 1 1 45%;
  display: flex;
  justify-content: center;
}

.about-img {
  width: 240px;
  height: 240px;
  border-radius: var(--radius-full);
  object-fit: cover;
  display: block;
}

/* ---------- Work ---------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-md);
}

.project-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform var(--transition),
    box-shadow var(--transition);
}

.project-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.card-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-thumb-label {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.15);
  user-select: none;
}

.card-body {
  padding: var(--spacing-sm) var(--spacing-md) var(--spacing-md);
}

.card-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: var(--spacing-xs);
  letter-spacing: -0.01em;
}

.card-desc {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-sm);
  line-height: 1.6;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.card-tags span {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-light);
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.02em;
}

/* ---------- Contact ---------- */
.contact {
  background: var(--card-bg);
  border-top: 1px solid var(--border);
}

.contact-content {
  max-width: 520px;
}

.contact-intro {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-lg);
  line-height: 1.75;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-lg);
}

.contact-item {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
  width: fit-content;
  padding: 4px 0;
  position: relative;
  transition: color var(--transition);
}

.contact-item::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width var(--transition);
}

.contact-item:hover {
  color: var(--accent);
}

.contact-item:hover::after {
  width: 100%;
}

.contact-icon {
  flex-shrink: 0;
  color: var(--accent);
}


.contact-item--plain {
  cursor: default;
}

.contact-item--plain::after {
  display: none;
}

.say-hello {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 32px;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  transition: background var(--transition),
    box-shadow var(--transition),
    transform var(--transition);
}

.say-hello:hover {
  background: #6a8d7b;
  box-shadow: 0 4px 16px rgba(122, 158, 140, 0.32);
  transform: translateY(-2px);
}

.say-hello:active {
  transform: translateY(0);
}

.say-hello.copied {
  background: var(--accent);
  pointer-events: none;
  opacity: 0.7;
}

/* ---------- Footer ---------- */
.footer {
  padding: var(--spacing-lg) 0;
  text-align: center;
}

.footer p {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Tablet & below */
@media (max-width: 768px) {
  .section-title {
    font-size: 1.625rem;
  }

  /* --- Nav --- */
  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    width: 100%;
    flex-direction: column;
    gap: 0;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition), padding var(--transition);
    padding: 0 var(--spacing-md);
  }

  .nav-links.open {
    max-height: 240px;
    padding: var(--spacing-sm) var(--spacing-md);
  }

  .nav-links li {
    width: 100%;
  }

  .nav-link {
    display: block;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
  }

  .nav-links li:last-child .nav-link {
    border-bottom: none;
  }

  .hamburger {
    display: flex;
  }

  /* --- About --- */
  .about-grid {
    flex-direction: column;
    text-align: center;
  }

  .about-photo {
    order: -1;
  }

  .about-img {
    width: 180px;
    height: 180px;
  }

  /* --- Work --- */
  .project-grid {
    grid-template-columns: 1fr;
  }

  /* --- Contact --- */
  .contact-content {
    max-width: 100%;
  }
}

/* Small phones */
@media (max-width: 480px) {
  .section {
    padding: var(--spacing-xl) 0;
  }

  .about-img {
    width: 140px;
    height: 140px;
  }

  .card-body {
    padding: var(--spacing-sm);
  }
}

/* Wide desktop 鈥?limit hero decoration scale */
@media (min-width: 1400px) {
  .deco-ring--1 {
    width: 520px;
    height: 520px;
  }

  .deco-ring--2 {
    width: 700px;
    height: 700px;
  }
}
