/* Shared visual system for all non-home pages */
:root {
  --primary: #b96538;
  --acc: #b96538;
  --ink: #3a2010;
  --ink2: rgba(58, 32, 16, .62);
  --surface: rgba(255, 244, 232, .62);
  --surface-strong: rgba(255, 248, 240, .82);
  --line: rgba(128, 69, 35, .14);
  --shadow: 0 18px 50px rgba(113, 55, 24, .10);
}

html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(ellipse 60% 45% at 0% 12%, rgba(183, 112, 121, .27), transparent 70%),
    radial-gradient(ellipse 58% 42% at 100% 30%, rgba(226, 176, 91, .22), transparent 72%),
    linear-gradient(145deg, #fde9d5 0%, #f5d0ae 48%, #eab98e 100%);
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .22;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.16'/%3E%3C/svg%3E");
}

header {
  background: rgba(253, 232, 212, .72) !important;
  border-bottom: 1px solid rgba(128, 69, 35, .10);
  box-shadow: none !important;
  backdrop-filter: blur(18px) saturate(1.15);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
}

nav { height: 3.7rem; }
.nav-links { align-items: center; }
.nav-links a { position: relative; color: var(--ink2); }
.nav-links a::after {
  content: "";
  position: absolute;
  left: 50%; right: 50%; bottom: -.55rem;
  height: 1px;
  background: var(--acc);
  transition: left .2s ease, right .2s ease;
}
.nav-links a:hover::after,
.nav-links a.active::after { left: 0; right: 0; }
.sig-path { fill: var(--ink); }

main {
  position: relative;
  z-index: 1;
  padding-top: 3.7rem;
  min-height: calc(100vh - 3.7rem);
}

section { padding: clamp(3.5rem, 7vw, 6.5rem) 0; }
.container { width: min(1120px, calc(100% - 2.5rem)); padding: 0; }

h1, h2, h3, h4, .profile-name, .card-title,
.project-card-title, .timeline-title { color: var(--ink); }

h1, .profile-name {
  letter-spacing: -.035em;
  line-height: 1.12;
}

.section-title { margin-bottom: 2.5rem; }
.section-title::before {
  content: "FIELD NOTES / YAN LINYI";
  display: block;
  margin-bottom: .55rem;
  color: var(--acc);
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .16em;
}
.section-title h2 { margin-top: 0; letter-spacing: -.03em; }
.section-title p,
.description,
.profile-title,
.profile-bio,
.project-card-desc,
.capability-card p,
.card-date,
.timeline-subtitle { color: var(--ink2) !important; }

/* Warm glass surfaces */
.skill-card,
.project-card,
.module-card,
.capability-card,
.contact-card,
.contact-form,
.card,
.pdf-container {
  background: linear-gradient(145deg, rgba(255, 249, 241, .70), rgba(255, 236, 217, .42)) !important;
  border: 1px solid var(--line) !important;
  border-radius: 1rem !important;
  box-shadow: 0 1px 0 rgba(255,255,255,.56) inset;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.skill-card,
.project-card,
.module-card,
.capability-card,
.contact-card,
.card {
  position: relative;
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease !important;
}

.skill-card::before,
.project-card::before,
.module-card::before,
.capability-card::before,
.contact-card::before,
.card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  background: linear-gradient(180deg, transparent, var(--acc), transparent);
  opacity: 0;
  transition: opacity .25s ease;
}

.skill-card:hover,
.project-card:hover,
.module-card:hover,
.capability-card:hover,
.contact-card:hover,
.card:hover {
  transform: translateY(-5px) !important;
  border-color: rgba(185, 101, 56, .34) !important;
  box-shadow: var(--shadow) !important;
}
.skill-card:hover::before,
.project-card:hover::before,
.module-card:hover::before,
.capability-card:hover::before,
.contact-card:hover::before,
.card:hover::before { opacity: 1; }

.skill-icon,
.capability-icon,
.contact-card-icon {
  background: rgba(185, 101, 56, .10) !important;
  color: var(--acc) !important;
}
.profile-image {
  border: 2px solid rgba(185, 101, 56, .52) !important;
  box-shadow: 0 18px 45px rgba(88, 41, 18, .18);
}
.social-link {
  background: rgba(255, 245, 234, .62) !important;
  border: 1px solid var(--line);
  color: var(--ink2) !important;
}
.social-link:hover { background: var(--acc) !important; color: #fff !important; transform: translateY(-2px); }

.project-tag, .card-tag {
  color: var(--acc) !important;
  background: rgba(185, 101, 56, .10) !important;
  border: 1px solid rgba(185, 101, 56, .08);
}
.project-card-link, .contact-card-content a,
.module-card h3 { color: var(--acc) !important; }

.tag {
  background: rgba(255, 244, 232, .54) !important;
  color: var(--ink2) !important;
  border: 1px solid var(--line);
}
.tag:hover, .tag.active { background: var(--acc) !important; color: white !important; }

.button-primary {
  background: var(--acc) !important;
  color: white;
  box-shadow: 0 8px 22px rgba(185, 101, 56, .22);
}
.button-primary:hover { background: #9d512c !important; transform: translateY(-2px); }
.button-ghost { color: var(--acc) !important; border-color: rgba(185, 101, 56, .55) !important; }
.button-ghost:hover { background: rgba(185, 101, 56, .10) !important; transform: translateY(-2px); }

.form-control {
  box-sizing: border-box;
  background: rgba(255, 249, 241, .58) !important;
  border: 1px solid var(--line) !important;
  border-radius: .65rem !important;
  color: var(--ink) !important;
}
.form-control:focus {
  border-color: rgba(185, 101, 56, .60) !important;
  box-shadow: 0 0 0 4px rgba(185, 101, 56, .10) !important;
}

.timeline::before { background: linear-gradient(var(--acc), rgba(185,101,56,.12)) !important; }
.timeline-dot {
  background: var(--acc) !important;
  box-shadow: 0 0 0 6px rgba(185, 101, 56, .12);
}
.timeline-date { color: var(--acc) !important; }

.pdf-container {
  box-sizing: border-box;
  box-shadow: 0 24px 70px rgba(89, 42, 18, .18) !important;
}
.pdf-viewer { inset: 0; width: 100%; height: 100%; border-radius: .9rem; }

.cv-container::before,
.contact-container::before {
  content: "OPEN TO BUILD / COLLABORATE";
  display: block;
  margin-bottom: .7rem;
  color: var(--acc);
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .16em;
}
.cv-container::before { content: "AI FDE / SOLUTIONS ENGINEER"; }

footer {
  position: relative;
  z-index: 1;
  background: linear-gradient(180deg, rgba(222, 163, 116, .20), rgba(189, 120, 75, .28)) !important;
  border-top: 1px solid rgba(128, 69, 35, .13) !important;
  color: var(--ink);
  padding: 2.2rem 0 !important;
  backdrop-filter: blur(12px);
}
footer .logo { color: var(--ink); }
.footer-links a, .copyright, footer p { color: var(--ink2) !important; }
.footer-links a:hover { color: var(--acc) !important; }

/* Dark mode follows the same brown/amber visual language. */
.dark-mode {
  --ink: #f8e8d8;
  --ink2: rgba(248, 232, 216, .62);
  --surface: rgba(58, 36, 27, .62);
  --line: rgba(255, 221, 190, .12);
  background:
    radial-gradient(ellipse 62% 50% at 0% 12%, rgba(130, 62, 66, .27), transparent 70%),
    radial-gradient(ellipse 58% 42% at 100% 30%, rgba(145, 87, 38, .22), transparent 72%),
    linear-gradient(145deg, #271a16, #1d1512 58%, #17110f) !important;
  color: var(--ink);
}
.dark-mode header { background: rgba(35, 24, 20, .75) !important; }
.dark-mode .skill-card,
.dark-mode .project-card,
.dark-mode .module-card,
.dark-mode .capability-card,
.dark-mode .contact-card,
.dark-mode .contact-form,
.dark-mode .card,
.dark-mode .pdf-container {
  background: linear-gradient(145deg, rgba(70, 45, 34, .72), rgba(39, 27, 23, .54)) !important;
}
.dark-mode footer { background: linear-gradient(180deg, rgba(52, 34, 27, .72), rgba(31, 22, 19, .92)) !important; }
.dark-mode .nav-links { background: rgba(35, 24, 20, .97) !important; }

@media (max-width: 768px) {
  .container { width: min(100% - 1.5rem, 1120px); }
  section { padding: 3rem 0; }
  .nav-links {
    top: 3.7rem !important;
    background: rgba(253, 232, 212, .97) !important;
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(18px);
  }
  .nav-links a::after { display: none; }
  .profile { margin-bottom: 3rem; }
  .profile-image { width: 132px; height: 132px; }
  .section-title::before { font-size: .58rem; }
  .skill-card, .project-card, .module-card,
  .capability-card, .contact-card, .card { border-radius: .85rem !important; }
  footer .footer-content { text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
