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

:root {
  --color-bg: #fafaf8;
  --color-surface: #f3f2ef;
  --color-text: #1a1a1a;
  --color-text-muted: #6b6b6b;
  --color-accent: #2a2a2a;
  --color-border: #e4e3df;

  --font-sans: 'Inter', system-ui, sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;

  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 8rem;

  --radius: 8px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  /* Card placeholder palette */
  --card-1: #e8e0d8;
  --card-2: #d8e0e8;
  --card-3: #dce8d8;
  --card-4: #e8d8e0;
  --card-5: #e0d8e8;
  --card-6: #e8e8d8;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

ul { list-style: none; }

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

/* ========================================
   TYPOGRAPHY
   ======================================== */
.section__label {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-sm);
}

.section__title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: var(--space-md);
}

.section__title em {
  font-style: italic;
  font-weight: 400;
}

.dot { color: #c0a882; }

/* ========================================
   LAYOUT
   ======================================== */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

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

/* ========================================
   NAVIGATION
   ======================================== */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 1.25rem var(--space-md);
  transition: background var(--transition), box-shadow var(--transition);
}

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

.nav__inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__logo {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.nav__links {
  display: flex;
  gap: var(--space-md);
}

.nav__links a {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--color-text-muted);
  transition: color var(--transition);
  position: relative;
}

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

.nav__links a:hover { color: var(--color-text); }
.nav__links a:hover::after { width: 100%; }

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav__toggle span {
  display: block;
  width: 24px; height: 1.5px;
  background: var(--color-text);
  transition: var(--transition);
}

/* Mobile Menu */
.mobile-menu {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--color-bg);
  z-index: 99;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.mobile-menu.open {
  opacity: 1;
  pointer-events: all;
}

.mobile-menu ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  text-align: center;
}

.mobile-menu a {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  font-style: italic;
  color: var(--color-text-muted);
  transition: color var(--transition);
}

.mobile-menu a:hover { color: var(--color-text); }

/* Navigation edit mode */
.nav__links a[data-key] {
  cursor: pointer;
}

body.edit-mode .nav__links a[data-key],
body.edit-mode .mobile-menu a[data-key] {
  contenteditable: false;
  outline: 1.5px dashed rgba(192, 168, 130, 0.7);
  outline-offset: 2px;
  border-radius: 3px;
  padding: 0.2rem 0.4rem;
  cursor: text;
}

body.edit-mode .nav__links a[data-key]:hover,
body.edit-mode .mobile-menu a[data-key]:hover {
  outline-color: rgba(192, 168, 130, 1);
}

/* Add nav item button */
.nav__add-item button,
.mobile-menu__add-item button {
  display: none;
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 0.5rem;
  transition: color var(--transition);
}

.nav__add-item button:hover,
.mobile-menu__add-item button:hover {
  color: var(--color-text);
}

body.edit-mode .nav__add-item button,
body.edit-mode .mobile-menu__add-item button {
  display: block;
}

/* ========================================
   HERO
   ======================================== */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 120px var(--space-md) var(--space-lg);
  max-width: 1100px;
  margin: 0 auto;
}

.hero__eyebrow {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-sm);
}

.hero__title {
  font-family: var(--font-serif);
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 600;
  line-height: 1.1;
  margin-bottom: var(--space-md);
  max-width: 14ch;
}

.hero__title em {
  font-style: italic;
  font-weight: 400;
}

.hero__desc {
  font-size: 1.1rem;
  color: var(--color-text-muted);
  max-width: 42ch;
  margin-bottom: var(--space-md);
  line-height: 1.8;
}

.hero__actions {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.hero__scroll-hint {
  margin-top: auto;
  padding-top: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--color-text-muted);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
}

.scroll-line {
  width: 60px; height: 1px;
  background: var(--color-border);
  position: relative;
  overflow: hidden;
}

.scroll-line::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: var(--color-text-muted);
  animation: scrollLine 2s ease-in-out infinite;
}

@keyframes scrollLine {
  0% { left: -100%; }
  50% { left: 0; }
  100% { left: 100%; }
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 1.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius);
  transition: var(--transition);
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn--primary {
  background: var(--color-text);
  color: var(--color-bg);
  border-color: var(--color-text);
}

.btn--primary:hover {
  background: #333;
  border-color: #333;
  transform: translateY(-1px);
}

.btn--ghost {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn--ghost:hover {
  border-color: var(--color-text);
  transform: translateY(-1px);
}

.btn--lg {
  padding: 1rem 2.5rem;
  font-size: 1rem;
}

/* ========================================
   ABOUT
   ======================================== */
.about {
  background: var(--color-surface);
}

.about__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  align-items: center;
}

.about__text p {
  color: var(--color-text-muted);
  margin-bottom: var(--space-sm);
  max-width: 48ch;
}

.about__skills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-top: var(--space-md);
}

.skill-tag {
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: 100px;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  background: var(--color-bg);
  transition: var(--transition);
}

.skill-tag:hover {
  border-color: var(--color-text);
  color: var(--color-text);
}

.about__photo {
  display: flex;
  justify-content: center;
}

.about__photo-img {
  width: 320px;
  height: 400px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  transition: transform var(--transition);
}

.about__photo-img:hover {
  transform: translateY(-4px);
}

.photo-placeholder {
  width: 320px;
  height: 400px;
  background: var(--color-border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  overflow: hidden;
  position: relative;
}

.photo-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

.photo-placeholder::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #e8e0d8 0%, #d8e0e8 100%);
  display: none;
}

.photo-placeholder span {
  position: relative;
  z-index: 1;
}

/* ========================================
   WORK / PORTFOLIO
   ======================================== */
.filter {
  display: flex;
  gap: var(--space-xs);
  margin-bottom: var(--space-lg);
}

.filter__btn {
  padding: 0.5rem 1.25rem;
  font-size: 0.85rem;
  font-family: var(--font-sans);
  font-weight: 400;
  background: transparent;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  border-radius: 100px;
  cursor: pointer;
  transition: var(--transition);
}

.filter__btn:hover,
.filter__btn.active {
  background: var(--color-text);
  color: var(--color-bg);
  border-color: var(--color-text);
}

.work__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

.work__card {
  transition: var(--transition);
}

.work__card.hidden {
  display: none;
}

.card__img {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: var(--space-sm);
}

.card__img--1 { background: var(--card-1); }
.card__img--2 { background: var(--card-2); }
.card__img--3 { background: var(--card-3); }
.card__img--4 { background: var(--card-4); }
.card__img--5 { background: var(--card-5); }
.card__img--6 { background: var(--card-6); }
.card__img--7 { background: #d8e8e0; }
.card__img--8 { background: #e8d8c8; }

/* If you add real images later: */
.card__img img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--transition);
}

.card__img img.card__img--empty,
.card__img img[src=""] {
  background: #e8e6e0;
  object-fit: none;
}

.work__card:hover .card__img img {
  transform: scale(1.04);
}

.card__overlay {
  position: absolute;
  inset: 0;
  background: rgba(26, 26, 26, 0);
  display: flex;
  align-items: flex-end;
  padding: var(--space-sm);
  transition: var(--transition);
}

.card__img:hover .card__overlay {
  background: rgba(26, 26, 26, 0.6);
}

.card__link {
  color: white;
  font-size: 0.875rem;
  font-weight: 500;
  opacity: 0;
  transform: translateY(6px);
  transition: var(--transition);
}

.card__img:hover .card__link {
  opacity: 1;
  transform: translateY(0);
}

.card__tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 0.25rem;
}

.card__title {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.card__desc {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  line-height: 1.6;
  margin-bottom: var(--space-sm);
}

/* ========================================
   CONTACT
   ======================================== */
.contact__inner {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.contact__title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: var(--space-sm);
}

.contact__sub {
  color: var(--color-text-muted);
  margin-bottom: var(--space-md);
}

.contact__social {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  margin-top: var(--space-md);
}

.contact__social a {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  transition: color var(--transition);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  transition: var(--transition);
}

.contact__social a:hover {
  color: var(--color-text);
  text-decoration-color: var(--color-text);
}

/* ========================================
   FOOTER
   ======================================== */
.footer {
  padding: var(--space-md);
  border-top: 1px solid var(--color-border);
  text-align: center;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.footer__content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  max-width: 1100px;
  margin: 0 auto;
}

.footer__share-btn {
  padding: 0.4rem 1rem;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.footer__share-btn:hover {
  border-color: var(--color-text);
  color: var(--color-text);
  background: var(--color-surface);
}

/* ========================================
   QRCODE MODAL
   ======================================== */
.qrcode-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 26, 0.55);
  z-index: 400;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.qrcode-modal.open {
  display: flex;
}

.qrcode-modal__content {
  background: var(--color-bg);
  border-radius: 12px;
  padding: 2rem;
  max-width: 400px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.18);
  position: relative;
  text-align: center;
}

.qrcode-modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: color var(--transition);
  line-height: 1;
  padding: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qrcode-modal__close:hover {
  color: var(--color-text);
}

.qrcode-modal__title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: var(--color-text);
}

.qrcode-modal__qrcode {
  display: flex;
  justify-content: center;
  margin: 1.5rem 0;
  padding: 1rem;
  background: white;
  border-radius: 8px;
}

.qrcode-modal__qrcode canvas {
  max-width: 100%;
}

.qrcode-modal__desc {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: 1rem;
}

/* ========================================
   ANIMATIONS
   ======================================== */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.8s var(--transition) forwards;
}

.delay-1 { animation-delay: 0.15s; }
.delay-2 { animation-delay: 0.3s; }
.delay-3 { animation-delay: 0.45s; }

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
  :root {
    --space-xl: 5rem;
  }

  .nav__links { display: none; }

  .nav__toggle {
    display: flex;
  }

  .nav__toggle.open span:nth-child(1) {
    transform: translateY(6.5px) rotate(45deg);
  }
  .nav__toggle.open span:nth-child(2) {
    opacity: 0;
  }
  .nav__toggle.open span:nth-child(3) {
    transform: translateY(-6.5px) rotate(-45deg);
  }

  .about__grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .about__photo { order: -1; }

  .photo-placeholder {
    width: 100%;
    height: 280px;
  }

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

  .contact__social {
    flex-wrap: wrap;
    gap: var(--space-sm);
  }
}

@media (max-width: 520px) {
  .work__grid {
    grid-template-columns: 1fr;
  }

  .hero__title {
    font-size: clamp(2.5rem, 12vw, 4rem);
  }
}

/* ========================================
   EXPERIENCE / INTERNSHIP
   ======================================== */
.exp__list {
  display: flex;
  flex-direction: column;
}

.exp__item {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: var(--space-lg);
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--color-border);
}

.exp__item:first-child {
  border-top: 1px solid var(--color-border);
}

.exp__meta {
  padding-top: 0.2em;
}

.exp__period {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  letter-spacing: 0.03em;
  margin-bottom: 0.5rem;
}

.exp__tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  border-radius: 100px;
  padding: 0.2rem 0.65rem;
}

.exp__company {
  font-size: 1.05rem;
  font-weight: 500;
  margin-bottom: 0.2rem;
}

.exp__role {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.65rem;
}

.exp__desc {
  font-size: 0.88rem;
  color: var(--color-text-muted);
  line-height: 1.75;
  max-width: 52ch;
}

@media (max-width: 768px) {
  .exp__item {
    grid-template-columns: 1fr;
    gap: var(--space-xs);
  }
}

/* ========================================
   ADD / DELETE BUTTONS (edit mode)
   ======================================== */
.item-delete-btn {
  display: none;
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  background: rgba(20, 20, 20, 0.72);
  color: white;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  z-index: 10;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  flex-shrink: 0;
}

.item-delete-btn:hover { background: #c0392b; }

body.edit-mode .item-delete-btn { display: flex; }

/* Delete btn on exp items needs relative positioning on parent */
.exp__item { position: relative; }

.exp__item .item-delete-btn {
  top: 1.2rem;
  right: 0;
}

/* Add card button */
.add-card-btn {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: var(--space-md);
  border: 2px dashed var(--color-border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  transition: var(--transition);
  margin-top: var(--space-md);
}

.add-card-btn:hover {
  border-color: var(--color-text-muted);
  color: var(--color-text);
  background: rgba(0,0,0,0.02);
}

.add-card-btn__icon {
  font-size: 2rem;
  font-weight: 200;
  line-height: 1;
}

/* Only show add button in edit mode */
body.edit-mode .add-card-btn { display: flex; }

/* Add experience button */
.add-item-btn {
  display: none;
  align-items: center;
  gap: 0.5rem;
  margin-top: var(--space-sm);
  padding: 0.6rem 1.2rem;
  border: 1.5px dashed var(--color-border);
  border-radius: 50px;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  transition: var(--transition);
}

.add-item-btn:hover {
  border-color: var(--color-text-muted);
  color: var(--color-text);
}

.add-item-btn__icon { font-size: 1.1rem; font-weight: 300; }

body.edit-mode .add-item-btn { display: flex; }

/* ========================================
   MESSAGES / GUESTBOOK
   ======================================== */
.messages__inner {
  max-width: 640px;
}

.messages__sub {
  color: var(--color-text-muted);
  margin-bottom: var(--space-lg);
  font-size: 1rem;
}

.message-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.message-form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
}

.message-form__input,
.message-form__textarea {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  background: var(--color-bg);
  color: var(--color-text);
  outline: none;
  transition: border-color var(--transition);
  resize: none;
}

.message-form__input:focus,
.message-form__textarea:focus {
  border-color: var(--color-text);
}

.message-form__textarea { min-height: 120px; }

.message-form__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.message-form__hint {
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

/* ========================================
   CONTACT METHODS
   ======================================== */
.contact-methods {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
  margin-top: var(--space-lg);
  max-width: 500px;
}

.contact-method {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
  text-decoration: none;
  color: inherit;
  transition: all var(--transition);
  cursor: pointer;
  position: relative;
}

.contact-method--hidden {
  background: var(--color-surface);
  border: 1px dashed var(--color-border);
}

.contact-method__value--hidden {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  font-style: italic;
}

.contact-method:hover {
  border-color: var(--color-text);
  background: var(--color-surface);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.contact-method__icon {
  font-size: 2.5rem;
  flex-shrink: 0;
  line-height: 1;
}

.contact-method__content {
  flex: 1;
}

.contact-method__title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  color: var(--color-text);
}

.contact-method__value {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  word-break: break-all;
  font-family: 'Courier New', monospace;
}

.contact-method:hover .contact-method__value {
  color: var(--color-text);
}

.message-success {
  display: none;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: var(--color-surface);
  border-radius: var(--radius);
}

.message-success.visible { display: flex; }

.message-success__icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #2a7a4f;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.message-success p {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

@media (max-width: 520px) {
  .message-form__row { grid-template-columns: 1fr; }

  .contact-methods {
    grid-template-columns: 1fr;
  }

  .contact-method {
    flex-direction: column;
    text-align: center;
  }

  .contact-method__icon {
    font-size: 2rem;
  }
}
.pwd-modal {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 26, 0.55);
  z-index: 400;
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.pwd-modal.open {
  display: flex;
}

.pwd-modal__box {
  background: var(--color-bg);
  border-radius: 12px;
  padding: 2rem;
  width: 300px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.18);
}

.pwd-modal__title {
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 1rem;
  color: var(--color-text);
}

.pwd-modal__input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  background: var(--color-bg);
  color: var(--color-text);
  outline: none;
  transition: border-color var(--transition);
  margin-bottom: 0.4rem;
}

.pwd-modal__input:focus {
  border-color: var(--color-text);
}

.pwd-modal__error {
  font-size: 0.78rem;
  color: #c0392b;
  margin-bottom: 1rem;
  min-height: 1.2em;
  opacity: 0;
  transition: opacity 0.2s;
}

.pwd-modal__error.visible {
  opacity: 1;
}

.pwd-modal__actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-6px); }
  40%       { transform: translateX(6px); }
  60%       { transform: translateX(-4px); }
  80%       { transform: translateX(4px); }
}

.shake { animation: shake 0.4s ease; }

/* ========================================
   EDIT MODE
   ======================================== */
.edit-toolbar {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.edit-trigger-btn {
  background: var(--color-text);
  color: var(--color-bg);
  border: none;
  border-radius: 50px;
  padding: 0.6rem 1.25rem;
  font-size: 0.8rem;
  font-family: var(--font-sans);
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
  transition: var(--transition);
}

.edit-trigger-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.22);
}

.edit-save-bar {
  display: none;
  gap: 0.5rem;
  align-items: center;
}

.edit-action-btn {
  border: none;
  border-radius: 50px;
  padding: 0.6rem 1.25rem;
  font-size: 0.8rem;
  font-family: var(--font-sans);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 2px 12px rgba(0,0,0,0.12);
}

.edit-action-btn--save {
  background: #2a7a4f;
  color: white;
}

.edit-action-btn--save:hover {
  background: #236040;
  transform: translateY(-1px);
}

.edit-action-btn--export {
  background: var(--color-text);
  color: var(--color-bg);
}

.edit-action-btn--export:hover {
  background: #333;
  transform: translateY(-1px);
}

.edit-action-btn--cancel {
  background: var(--color-surface);
  color: var(--color-text-muted);
}

body.edit-mode .edit-save-bar { display: flex; }
body.edit-mode .edit-trigger-btn { display: none; }

/* Top banner when editing */
body.edit-mode::before {
  content: '✏  编辑模式 — 点击文字修改，点击图片更换，完成后点击「保存」';
  position: fixed;
  top: 0; left: 0; right: 0;
  background: #c0a882;
  color: white;
  text-align: center;
  padding: 0.45rem 1rem;
  font-size: 0.75rem;
  font-family: var(--font-sans);
  letter-spacing: 0.04em;
  z-index: 300;
}

/* Editable element indicators */
body.edit-mode [data-key] {
  outline: 1.5px dashed rgba(192, 168, 130, 0.7);
  outline-offset: 4px;
  border-radius: 3px;
  cursor: text;
}

body.edit-mode [data-key]:hover {
  outline-color: #c0a882;
  background: rgba(192, 168, 130, 0.06);
}

body.edit-mode [data-key]:focus {
  outline: 2px solid #c0a882;
  outline-offset: 4px;
  background: rgba(192, 168, 130, 0.08);
}

.new-card-editor-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.new-card-editor-box {
  background: #fff;
  border-radius: 12px;
  padding: 1.25rem;
  width: min(90vw, 440px);
  box-shadow: 0 12px 36px rgba(0,0,0,0.18);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.new-card-editor-box h3 {
  margin: 0;
  font-size: 1.1rem;
}

.new-card-editor-box label {
  display: flex;
  flex-direction: column;
  font-size: 0.8rem;
  color: #333;
}

.new-card-editor-box input,
.new-card-editor-box textarea {
  margin-top: 0.25rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  width: 100%;
  font-family: var(--font-sans);
}

.new-card-editor-box textarea { resize: vertical; min-height: 90px; }

.new-card-editor-preview {
  width: 100%;
  height: 170px;
  border: 1px dashed var(--color-border);
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
}

.new-card-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.new-card-editor-actions button {
  border: none;
  border-radius: 8px;
  padding: 0.55rem 0.95rem;
  cursor: pointer;
  font-family: var(--font-sans);
}

.new-card-editor-actions #newCardCancel {
  background: var(--color-surface);
  color: var(--color-text-muted);
}

.new-card-editor-actions #newCardCreate {
  background: var(--color-text);
  color: var(--color-bg);
}

/* Image edit hint overlay */
.card__img-edit-hint,
.photo-placeholder .card__img-edit-hint {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.52);
  z-index: 3;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.8rem;
  font-family: var(--font-sans);
  letter-spacing: 0.06em;
  border-radius: var(--radius);
  pointer-events: none;
}

body.edit-mode .card__img,
body.edit-mode .photo-placeholder {
  cursor: pointer;
}

body.edit-mode .card__img:hover .card__img-edit-hint,
body.edit-mode .photo-placeholder:hover .card__img-edit-hint {
  display: flex;
}

/* About photo placeholder needs relative positioning for hint overlay */
.photo-placeholder {
  position: relative;
}

/* ========================================
   SCROLL PROGRESS BAR
   ======================================== */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  background: var(--color-accent);
  z-index: 9999;
  transition: width 0.1s linear;
}

/* ========================================
   CUSTOM CURSOR
   ======================================== */
body.custom-cursor-active,
body.custom-cursor-active * {
  cursor: none !important;
}

.custom-cursor {
  position: fixed;
  top: -18px;
  left: -18px;
  width: 36px;
  height: 36px;
  border: 1.5px solid var(--color-accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 10000;
  will-change: transform;
  transition: width 0.25s ease, height 0.25s ease, border-color 0.2s, background 0.2s;
}

.custom-cursor.hover {
  width: 60px;
  height: 60px;
  top: -30px;
  left: -30px;
  background: rgba(42, 42, 42, 0.08);
  border-color: var(--color-accent);
}

.custom-cursor__dot {
  position: fixed;
  top: -3px;
  left: -3px;
  width: 6px;
  height: 6px;
  background: var(--color-accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 10001;
  will-change: transform;
}

/* ========================================
   LIGHTBOX
   ======================================== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.lightbox.open {
  opacity: 1;
  pointer-events: all;
}

.lightbox__overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.88);
  backdrop-filter: blur(6px);
}

.lightbox__content {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 2.5rem;
  align-items: center;
  max-width: 1000px;
  width: 92vw;
  padding: 2rem;
  transform: translateY(20px);
  transition: transform 0.35s ease;
}

.lightbox.open .lightbox__content {
  transform: translateY(0);
}

.lightbox__image-wrap {
  flex: 0 0 55%;
  border-radius: 10px;
  overflow: hidden;
  background: #111;
}

.lightbox__image {
  width: 100%;
  height: auto;
  max-height: 70vh;
  object-fit: contain;
  display: block;
}

.lightbox__info {
  flex: 1;
  color: #f5f5f3;
}

.lightbox__tag {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #aaa;
  margin-bottom: 0.75rem;
}

.lightbox__title {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 1rem;
  color: #fff;
}

.lightbox__desc {
  font-size: 0.9rem;
  line-height: 1.7;
  color: #bbb;
}

.lightbox__close {
  position: fixed;
  top: 1.5rem;
  right: 2rem;
  background: none;
  border: 1.5px solid rgba(255,255,255,0.25);
  color: #fff;
  font-size: 1.5rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s;
  z-index: 2;
}

.lightbox__close:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.5);
}

.lightbox__nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.08);
  border: 1.5px solid rgba(255,255,255,0.2);
  color: #fff;
  font-size: 2rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 2;
}

.lightbox__nav:hover {
  background: rgba(255,255,255,0.18);
}

.lightbox__nav--prev { left: 1.5rem; }
.lightbox__nav--next { right: 1.5rem; }

@media (max-width: 680px) {
  .lightbox__content {
    flex-direction: column;
    gap: 1.25rem;
    padding: 1rem;
    padding-top: 3.5rem;
    max-height: 92vh;
    overflow-y: auto;
  }
  .lightbox__image-wrap { flex: unset; width: 100%; }
  .lightbox__nav--prev { left: 0.5rem; }
  .lightbox__nav--next { right: 0.5rem; }
}

/* ========================================
   HERO ROLE ROTATOR
   ======================================== */
.hero__role-rotator {
  display: inline-block;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.hero__role-rotator.fade-out {
  opacity: 0;
  transform: translateY(-6px);
}

/* Card cursor pointer when not in edit mode */
body:not(.edit-mode) .work__card {
  cursor: pointer;
}
