/* ==========================================================
   Refined layer: soft shadows, gentle easing, quiet reveal.
   Loaded after styles.css.
   ========================================================== */
:root {
  --radius: 12px;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --soft: 0 10px 30px var(--shadow);
}

/* Smooth theme switching */
body, .site-header, .card .ph, .btn, .pill, .tag, .contact-box, .panel, .edu > div, .theme-toggle {
  transition: background-color 300ms var(--ease), color 300ms var(--ease), border-color 300ms var(--ease), transform 300ms var(--ease), box-shadow 300ms var(--ease);
}

/* Header: quiet, with a hairline */
.site-header { backdrop-filter: saturate(1.2) blur(10px); -webkit-backdrop-filter: saturate(1.2) blur(10px); }
.nav a { transition: background-color 250ms var(--ease), color 250ms var(--ease); }
.theme-toggle { border: 1px solid var(--line); }
.theme-toggle:hover { transform: none; background: var(--sky); border-color: var(--accent); }
.theme-toggle svg { transition: transform 400ms var(--ease); }
.theme-toggle:hover svg { transform: rotate(18deg); }

/* Eyebrow: short accent rule */
.eyebrow { display: flex; align-items: center; gap: 12px; }
.eyebrow::before { content: ""; width: 28px; height: 1px; background: var(--accent); }

/* Buttons: flat, soft lift */
.btn { border: 1px solid var(--accent); box-shadow: none; }
.btn:hover { transform: translateY(-2px); box-shadow: var(--soft); border-color: var(--accent-hover); }
.btn:active { transform: translateY(0); box-shadow: none; }
.btn.secondary { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn.secondary:hover { background: var(--sky); color: var(--ink); border-color: var(--accent); }
[data-theme="dark"] .btn.secondary:hover { background: var(--sage); }

/* Tags and pills */
.tag { border: 0; transform: none; font-weight: 500; }
.pill { border: 1px solid var(--line); }
.pill:hover { transform: none; background: var(--sky); border-color: var(--accent); box-shadow: none; }
.pill[aria-pressed="true"] { transform: none; box-shadow: none; background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pill[aria-pressed="true"]:hover { background: var(--ink); }

/* Cards: calm lift with a soft shadow */
.card .ph { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: none; transform: none; background: var(--gray-box); }
.card:nth-child(n) .ph { background: var(--gray-box); transform: none; }
.card:hover .ph { transform: translateY(-4px); box-shadow: var(--soft); }
.card:hover h3 { text-decoration: none; }
.card h3 { margin-top: 4px; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size 350ms var(--ease); align-self: flex-start; padding-bottom: 2px; }
.card:hover h3 { background-size: 100% 1px; }
.card .tag { margin-top: 0; }

/* Panels */
.contact-box, .panel, .edu > div { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: none; }
.contact-box { border-color: transparent; }
.panel { border-color: transparent; }
.edu > div:hover { box-shadow: var(--soft); }
.ph { border-radius: var(--radius); }
.case-section .ph, .ph.wide { border: 1px solid var(--line); box-shadow: none; }
.timeline li::before { width: 11px; height: 11px; left: calc(-1 * var(--s3) - 6.5px); top: 9px; background: var(--accent); border: 2px solid var(--bg); box-shadow: 0 0 0 1px var(--accent); }

/* Quiet page reveal: opacity + small rise, staggered */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
main .page-title, main .hero .wrap > *, main .section-head, main .pills, main .back, main .meta, main .lede,
main .grid-2 > *, main .grid-3 > *, main .two-col > *, main .edu > *, main .timeline li, main .contact-list li, main .panel, main .case-section {
  animation: rise 400ms var(--ease) both;
}
main .hero .wrap > :nth-child(2) { animation-delay: 40ms; }
main .hero .wrap > :nth-child(3) { animation-delay: 80ms; }
main .hero .wrap > :nth-child(4) { animation-delay: 120ms; }
main .grid-2 > :nth-child(2), main .grid-3 > :nth-child(2), main .timeline li:nth-child(2), main .contact-list li:nth-child(2) { animation-delay: 50ms; }
main .grid-2 > :nth-child(3), main .grid-3 > :nth-child(3), main .timeline li:nth-child(3), main .contact-list li:nth-child(3) { animation-delay: 100ms; }
main .grid-2 > :nth-child(4) { animation-delay: 150ms; }
main .grid-2 > :nth-child(5) { animation-delay: 200ms; }
main .grid-2 > :nth-child(6) { animation-delay: 250ms; }

@media (prefers-reduced-motion: reduce) {
  main * { animation: none !important; }
  .btn:hover, .card:hover .ph { transform: none; }
}
