/* ========================================
   Portfolio · 金承旭
   Design: Editorial Minimalist / High-end
   ======================================== */

/* ---------- Design Tokens ---------- */
:root {
  --bg: #fafaf8;
  --bg-alt: #f3f1ee;
  --text: #1a1a18;
  --text-secondary: #6e6d6a;
  --text-tertiary: #a09e9a;
  --accent: #b0926e;
  --accent-soft: #d4c4ae;
  --accent-dim: rgba(176, 146, 110, 0.12);
  --border: #e4e1dc;
  --border-light: #edeae6;
  --card: #ffffff;
  --dark: #121210;
  --dark-secondary: #22211e;
  --dark-text: #e4e2de;
  --dark-text-secondary: #8a8884;

  --font-serif: "Noto Serif SC", "STSong", "SimSun", "Songti SC", serif;
  --font-sans: "Inter", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, sans-serif;

  --max-width: 1160px;
  --section-pad: clamp(80px, 12vw, 160px);
  --card-radius: 2px;
  --transition: 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
  --transition-slow: 0.7s cubic-bezier(0.22, 0.61, 0.36, 1);
  --transition-fast: 0.2s cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

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

body {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

::selection {
  background: var(--accent-dim);
  color: var(--text);
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.25;
}

.section-label {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 24px;
}

.section-heading {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 600;
  margin-bottom: 48px;
  letter-spacing: -0.01em;
}

.section-heading.large {
  font-size: clamp(36px, 5vw, 56px);
  margin-bottom: 64px;
}

/* ---------- Layout ---------- */
.section {
  padding: var(--section-pad) 0;
}

.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 clamp(24px, 5vw, 64px);
}

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 20px 0;
  transition: background var(--transition), padding var(--transition), box-shadow var(--transition);
}

.nav.scrolled {
  background: rgba(250, 250, 248, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 12px 0;
  box-shadow: 0 1px 0 var(--border-light);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 clamp(24px, 5vw, 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--text);
}

.nav-links {
  display: flex;
  gap: 40px;
}

.nav-links a {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
  position: relative;
  padding-bottom: 4px;
}

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

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--text);
  transition: transform var(--transition-fast);
}

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  padding: 120px 24px;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 720px;
}

.hero-overline {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 32px;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(48px, 10vw, 88px);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.1;
  margin-bottom: 24px;
}

.hero-subtitle {
  font-family: var(--font-serif);
  font-size: clamp(18px, 2.5vw, 24px);
  font-weight: 400;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  margin-bottom: 32px;
}

.hero-dot {
  margin: 0 12px;
  color: var(--accent);
}

.hero-desc {
  font-size: 15px;
  line-height: 2;
  color: var(--text-secondary);
  margin-bottom: 64px;
}

.hero-cta {
  margin-top: 8px;
}

.cta-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--text);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  transition: border-color var(--transition-fast), gap var(--transition-fast);
}

.cta-link:hover {
  border-color: var(--text);
  gap: 16px;
}

.cta-arrow {
  font-size: 12px;
  transition: transform var(--transition-fast);
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 50% 40%, rgba(176, 146, 110, 0.04) 0%, transparent 70%),
    radial-gradient(ellipse 80% 60% at 20% 80%, rgba(176, 146, 110, 0.03) 0%, transparent 60%);
  pointer-events: none;
}

/* ---------- About ---------- */
.about {
  background: var(--bg);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(48px, 8vw, 96px);
}

.edu-school {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 4px;
}

.edu-major {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.edu-year {
  font-size: 14px;
  color: var(--text-tertiary);
  margin-bottom: 24px;
}

.edu-courses {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.edu-courses span {
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--bg-alt);
  padding: 6px 14px;
  border-radius: 2px;
  letter-spacing: 0.03em;
}

.award-card {
  border: 1px solid var(--border);
  padding: 32px;
  background: var(--card);
  border-radius: var(--card-radius);
}

.award-year {
  font-family: var(--font-serif);
  font-size: 48px;
  font-weight: 600;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 8px;
}

.award-name {
  font-size: 16px;
  color: var(--text);
}

/* ---------- Projects ---------- */
.projects {
  background: var(--bg-alt);
}

.project-card {
  position: relative;
  margin-bottom: clamp(64px, 10vw, 120px);
  padding-left: 72px;
}

.project-card:last-child {
  margin-bottom: 0;
}

.project-index {
  position: absolute;
  left: 0;
  top: 0;
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 400;
  color: var(--text-tertiary);
  letter-spacing: 0.08em;
}

.project-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 6vw, 72px);
  align-items: start;
}

/* Alternating layout for visual rhythm */
.project-card:nth-child(even) .project-body {
  direction: ltr;
}

.project-card:nth-child(even) .project-image {
  order: 1;
}

.project-image {
  position: relative;
  overflow: hidden;
  border-radius: var(--card-radius);
  aspect-ratio: 4/3;
  background: var(--card);
  border: 1px solid var(--border);
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--transition-slow);
}

.project-card:hover .project-image img {
  transform: scale(1.03);
}

.project-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.placeholder-label {
  font-family: var(--font-serif);
  font-size: 15px;
  color: var(--text-tertiary);
  letter-spacing: 0.04em;
  z-index: 1;
  background: rgba(250, 250, 248, 0.7);
  padding: 8px 20px;
  border-radius: 2px;
  backdrop-filter: blur(4px);
}

/* Custom placeholder backgrounds per project */
.project-img-placeholder.terrn {
  background:
    linear-gradient(135deg, #f5f3ef 0%, #eae5dd 30%, #f0ece4 60%, #e8e3d9 100%);
}

.project-img-placeholder.terrn::before {
  content: '';
  position: absolute;
  inset: 20%;
  border: 1px solid rgba(0,0,0,0.04);
  border-radius: 50%;
  opacity: 0.5;
}

.project-img-placeholder.vr {
  background:
    linear-gradient(160deg, #f2f0ed 0%, #e6e3de 40%, #edeae5 70%, #e0ddd8 100%);
}

.project-img-placeholder.vr::before {
  content: '';
  position: absolute;
  inset: 15% 25%;
  border: 1px solid rgba(0,0,0,0.05);
  border-radius: 2px;
}

.project-img-placeholder.bench {
  background:
    linear-gradient(145deg, #f4f2ee 0%, #e9e5df 35%, #f0ece6 65%, #e5e1db 100%);
}

.project-img-placeholder.bench::before {
  content: '';
  position: absolute;
  bottom: 25%;
  left: 15%;
  right: 15%;
  height: 1px;
  background: rgba(0,0,0,0.06);
  box-shadow: 0 40px 0 rgba(0,0,0,0.04);
}

.project-img-placeholder.art {
  background:
    radial-gradient(ellipse at 40% 35%, #f0ece6 0%, #e6e2dc 50%, #eae5df 100%);
}

.project-img-placeholder.art::before {
  content: '';
  position: absolute;
  inset: 25%;
  border: 1px solid rgba(0,0,0,0.04);
  border-radius: 2px;
  transform: rotate(2deg);
}

/* Project info */
.project-meta {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.project-type {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--accent);
  text-transform: uppercase;
}

.project-date {
  font-size: 13px;
  color: var(--text-tertiary);
}

.project-title {
  font-size: clamp(24px, 3.5vw, 32px);
  font-weight: 600;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.project-subtitle {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-tertiary);
  font-family: var(--font-sans);
  letter-spacing: 0.02em;
}

.project-desc {
  font-size: 15px;
  line-height: 1.85;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.project-details {
  margin-bottom: 20px;
}

.project-details li {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 3px 0;
  padding-left: 16px;
  position: relative;
}

.project-details li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 4px;
  height: 1px;
  background: var(--accent-soft);
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.project-tags span {
  font-size: 11px;
  color: var(--text-secondary);
  background: var(--bg);
  padding: 4px 12px;
  border: 1px solid var(--border-light);
  border-radius: 2px;
  letter-spacing: 0.03em;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  padding-bottom: 4px;
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition-fast), gap var(--transition-fast);
}

.project-link:hover {
  border-color: var(--accent);
  gap: 10px;
}

/* ---------- Experience ---------- */
.experience {
  background: var(--bg);
}

.exp-list {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.exp-card {
  border-left: 1px solid var(--border);
  padding-left: 32px;
  transition: border-color var(--transition);
}

.exp-card:hover {
  border-left-color: var(--accent-soft);
}

.exp-header {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.exp-title {
  font-size: 22px;
  font-weight: 600;
}

.exp-role {
  font-size: 14px;
  color: var(--accent);
  font-weight: 400;
}

.exp-date {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-left: auto;
}

.exp-desc {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-secondary);
  max-width: 640px;
  margin-bottom: 16px;
}

.exp-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.exp-tags span {
  font-size: 11px;
  color: var(--text-tertiary);
  letter-spacing: 0.03em;
}

/* ---------- Skills ---------- */
.skills {
  background: var(--bg-alt);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(24px, 4vw, 40px);
}

.skill-card {
  background: var(--card);
  border: 1px solid var(--border-light);
  padding: 40px;
  border-radius: var(--card-radius);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.skill-card:hover {
  border-color: var(--border);
  box-shadow: 0 2px 24px rgba(0,0,0,0.03);
}

.skill-icon {
  font-size: 20px;
  color: var(--accent-soft);
  margin-bottom: 20px;
  opacity: 0.7;
}

.skill-name {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 12px;
}

.skill-desc {
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.skill-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-tools span {
  font-size: 11px;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 4px 10px;
  border-radius: 2px;
  letter-spacing: 0.03em;
  font-weight: 500;
}

.personal-note {
  margin-top: 48px;
  text-align: center;
}

.personal-note p {
  font-family: var(--font-serif);
  font-size: 18px;
  color: var(--text-secondary);
  font-style: italic;
}

/* ---------- Contact ---------- */
.contact {
  background: var(--dark);
  color: var(--dark-text);
  text-align: center;
}

.contact .section-label {
  color: var(--dark-text-secondary);
}

.contact-text {
  font-family: var(--font-serif);
  font-size: clamp(20px, 3vw, 28px);
  line-height: 1.6;
  margin-bottom: 48px;
  color: var(--dark-text);
}

.contact-br {
  display: none;
}

.contact-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-bottom: 32px;
}

.contact-link {
  font-size: 16px;
  font-weight: 500;
  color: var(--accent-soft);
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition-fast), color var(--transition-fast);
}

.contact-link:hover {
  color: #d4c4ae;
  border-color: var(--accent-soft);
}

.contact-sep {
  color: var(--dark-text-secondary);
  font-size: 14px;
}

.contact-note {
  font-size: 13px;
  color: var(--dark-text-secondary);
}

/* ---------- Footer ---------- */
.footer {
  background: var(--dark);
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 32px 0;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 clamp(24px, 5vw, 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-text {
  font-size: 12px;
  color: var(--dark-text-secondary);
  letter-spacing: 0.03em;
}

.footer-top {
  font-size: 12px;
  color: var(--dark-text-secondary);
  transition: color var(--transition-fast);
}

.footer-top:hover {
  color: var(--dark-text);
}

/* ---------- Scroll Reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.reveal:nth-child(2) { transition-delay: 0.05s; }
.reveal:nth-child(3) { transition-delay: 0.1s; }
.reveal:nth-child(4) { transition-delay: 0.15s; }
.reveal:nth-child(5) { transition-delay: 0.2s; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .project-body {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .project-card:nth-child(even) .project-image {
    order: -1;
  }

  .project-index {
    position: static;
    margin-bottom: 12px;
  }

  .project-card {
    padding-left: 0;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .nav.mobile-open {
    background: rgba(250, 250, 248, 0.98);
    backdrop-filter: blur(20px);
    height: 100vh;
  }

  .nav.mobile-open .nav-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 32px;
    position: absolute;
    inset: 0;
  }

  .nav.mobile-open .nav-links a {
    font-family: var(--font-serif);
    font-size: 28px;
    color: var(--text);
  }

  .hero-title {
    font-size: clamp(40px, 12vw, 64px);
  }

  .section-heading.large {
    font-size: clamp(28px, 8vw, 40px);
    margin-bottom: 40px;
  }

  .skills-grid {
    grid-template-columns: 1fr;
  }

  .contact-br {
    display: inline;
  }

  .project-image {
    aspect-ratio: 16/10;
  }

  .skill-card {
    padding: 28px;
  }
}

@media (max-width: 480px) {
  .exp-header {
    flex-direction: column;
    gap: 4px;
  }

  .exp-date {
    margin-left: 0;
  }

  .exp-card {
    padding-left: 20px;
  }

  .hero-desc {
    font-size: 14px;
  }

  .project-meta {
    flex-direction: column;
    gap: 4px;
  }

  .contact-links {
    flex-direction: column;
    gap: 16px;
  }

  .contact-sep {
    display: none;
  }
}
