@view-transition{
  navigation: auto;
}

::view-transition-group(root){
  animation-duration: 0.35s;
  animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

::view-transition-old(root){
  animation-name: pageOut;
}

::view-transition-new(root){
  animation-name: pageIn;
}

@keyframes pageOut{
  to{ opacity: 0; transform: translateY(-6px); }
}

@keyframes pageIn{
  from{ opacity: 0; transform: translateY(10px); }
}

/* JS soft-navigation fallback (router.js) - same keyframes as the native
   cross-document view-transition above, applied to <main> only so the
   header/footer chrome stays static instead of re-rendering every nav. */
main.routerExit{
  animation: pageOut 0.22s var(--ease) both;
}

main.routerEnter{
  animation: pageIn 0.32s var(--ease) both;
}

:root{
  --bg: #faf7f2;
  --card: #ffffff;
  --text: #201d1a;
  --muted: #5b564e;
  --faint: #8a8478;
  --border: #e6dfd2;
  --accent: #c9552f;
  --accent-dark: #a8461f;
  --accent-soft: rgba(201,85,47,0.10);
  --shadow: 0 10px 30px rgba(32,29,26,0.07);
  --shadow-hover: 0 16px 40px rgba(32,29,26,0.11);
  --radius: 18px;
  --radius-sm: 12px;
  --max: 860px;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: ui-serif, Georgia, "Iowan Old Style", "Times New Roman", serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
html { scroll-behavior: smooth; }

body{
  margin: 0;
  font-family: var(--serif);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  font-size: 16.5px;
}

a{ color: var(--accent); text-decoration: none; }
a:hover{ text-decoration: underline; }

.wrap{
  max-width: var(--max);
  margin: 0 auto;
  padding: 30px 20px 70px;
}

header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 0 34px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 34px;
}

.brand{
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand img{ display: block; }

.brandText{
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand h1{
  margin: 0;
  font-family: var(--sans);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

.brand p{
  margin: 0;
  color: var(--faint);
  font-family: var(--sans);
  font-size: 13px;
}

nav{
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
}

nav a{
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--faint);
  padding-bottom: 3px;
  border-bottom: 2px solid transparent;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}

nav a:hover{
  color: var(--text);
  text-decoration: none;
  border-bottom-color: var(--border);
}

nav a.active{
  color: var(--text);
  border-bottom-color: var(--accent);
}

@media (max-width: 720px){
  .wrap{ padding: 22px 16px 50px; }

  header{
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding-bottom: 22px;
    margin-bottom: 26px;
  }

  nav{ gap: 16px; }
}

.eyebrow{
  margin: 0 0 12px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent);
}

.headline{
  margin: 0 0 16px;
  font-family: var(--sans);
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text);
}

.lede{
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  max-width: 58ch;
}

.hero{
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 30px;
  align-items: start;
  margin-bottom: 40px;
}

@media (max-width: 720px){
  .hero{
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

.ctaRow{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
}
button.btn{ cursor: pointer; appearance: none; }
.btn:hover{
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.btn.primary{
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn.primary:hover{
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.sideCard{
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow);
  padding: 18px;
}

.headshot{
  width: 100%;
  max-width: 240px;
  height: auto;
  display: block;
  margin: 0 auto 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  object-fit: cover;
}

.meta{ display: grid; gap: 8px; }

.metaRow{
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--accent-soft);
}

.k{ font-family: var(--sans); color: var(--faint); font-size: 12px; }
.v{ font-family: var(--sans); color: var(--text); font-size: 12.5px; font-weight: 600; text-align: right; }

.card{
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 20px;
}

.card h2{
  margin: 0 0 12px;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--faint);
}

.card p{ margin: 0; color: var(--muted); }

.contactGrid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.contactOption{
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow);
  padding: 20px 14px;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  appearance: none;
  font-family: var(--sans);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.contactOption:hover{
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  text-decoration: none;
}

.contactOptionIcon{
  color: var(--accent);
}

.contactOptionTitle{
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}

.pageTitle{
  font-family: var(--sans);
  font-size: clamp(26px, 3.6vw, 34px);
  letter-spacing: -0.02em;
  margin: 0 0 10px;
}

.pageLede{
  color: var(--muted);
  font-size: 16.5px;
  max-width: 62ch;
  margin: 0 0 36px;
}

/* About timeline */
.timeline{ display: grid; gap: 10px; }

.timelineYear{
  font-family: var(--sans);
  font-weight: 700;
  font-size: 13px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 26px 0 10px;
}
.timelineYear:first-child{ margin-top: 0; }

.timelineEntry{
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.timelineEntry:last-child{ border-bottom: none; }

.timelineTitle{
  margin: 0 0 4px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 16px;
  color: var(--text);
}

.timelineDesc{
  margin: 0;
  color: var(--muted);
  font-size: 15.5px;
}

/* Spotify card */
.spotifyStatus{ margin: 0; color: var(--muted); font-size: 14.5px; }

.spotifyTrack{
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 12px;
  background: var(--accent-soft);
}

.spotifyTrack img{
  width: 56px;
  height: 56px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.spotifyTitle{ margin: 0; font-family: var(--sans); font-size: 14px; color: var(--text); }
.spotifyMeta{ margin: 2px 0 0; font-family: var(--sans); font-size: 13px; color: var(--muted); }

/* Projects: grouped by project, like the About timeline */
.projectsList{
  display: grid;
  gap: 28px;
}

.projectGroup{
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow);
  padding: 24px;
  transition: box-shadow 0.3s var(--ease);
}

.projectGroupHighlight{
  box-shadow: 0 0 0 3px var(--accent), var(--shadow-hover);
}

.projectGroupHeader{ margin-bottom: 16px; }

.projectGroupTitleRow{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.projectGroupTitle{
  margin: 0 0 4px;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 19px;
  color: var(--text);
}

.projectShareBtn{
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--faint);
  cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.projectShareBtn:hover{
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.projectGroupDate{
  margin: 0 0 10px;
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--faint);
}

.projectGroupDesc{
  margin: 0;
  color: var(--muted);
  font-size: 15.5px;
}

.projectPhotos{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

.projectPhotos img{
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--accent-soft);
  cursor: zoom-in;
  transition: transform 0.2s var(--ease);
}
.projectPhotos img:hover,
.projectPhotos img:focus-visible{
  transform: scale(1.03);
}

body.lightboxOpen{ overflow: hidden; }

.lightbox{
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: rgba(0, 0, 0, 0.85);
  cursor: zoom-out;
  animation: lightboxFadeIn 0.15s var(--ease);
}
.lightbox[hidden]{
  display: none;
}

@keyframes lightboxFadeIn{
  from{ opacity: 0; }
  to{ opacity: 1; }
}

.lightboxImg{
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  cursor: default;
}

.lightboxClose{
  position: fixed;
  top: 16px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s var(--ease);
}
.lightboxClose:hover{
  background: rgba(255, 255, 255, 0.22);
}

.lightboxNav{
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 28px;
  line-height: 48px;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s var(--ease);
}
.lightboxNav:hover{
  background: rgba(255, 255, 255, 0.22);
}
.lightboxPrev{ left: 20px; }
.lightboxNext{ right: 20px; }

.shareToast{
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translate(-50%, 12px);
  z-index: 1100;
  background: var(--text);
  color: var(--card);
  font-family: var(--sans);
  font-size: 13.5px;
  padding: 10px 18px;
  border-radius: 999px;
  box-shadow: var(--shadow-hover);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}
.shareToastVisible{
  opacity: 1;
  transform: translate(-50%, 0);
}

.projectsEmpty{
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  color: var(--faint);
  font-family: var(--sans);
  font-size: 14.5px;
}

.projectsNote{
  font-family: var(--sans);
  font-size: 13.5px;
  color: var(--faint);
  margin: 0 0 24px;
}

/* Dialogs */
dialog{
  width: min(540px, calc(100vw - 28px));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0;
  background: var(--card);
  color: var(--text);
  box-shadow: 0 24px 60px rgba(32,29,26,0.25);
}

dialog::backdrop{
  background: rgba(32,29,26,0.35);
}

.dialogInner{
  position: relative;
  padding: 22px;
  display: grid;
  gap: 14px;
}

.dialogClose{
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  appearance: none;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.dialogClose:hover{
  background: var(--accent-soft);
  color: var(--text);
}

.dialogTitle{
  margin: 0;
  font-family: var(--sans);
  font-size: 19px;
  letter-spacing: -0.01em;
}

.dialogLead{ margin: 0; color: var(--muted); font-size: 14px; }

.field{ display: grid; gap: 6px; }

.field label{
  font-family: var(--sans);
  font-size: 13px;
  color: var(--faint);
}

.field input,
.field textarea{
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: 16px;
  padding: 10px 11px;
  font-family: var(--sans);
}

.field textarea{ min-height: 96px; resize: vertical; }

.dialogActions{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-top: 2px;
}

.appointmentDialog{ width: min(980px, calc(100vw - 28px)); }

.appointmentFrame{
  width: 100%;
  height: min(78vh, 700px);
  border: 0;
  border-radius: 12px;
  background: #ffffff;
}

@media (max-width: 720px){
  .appointmentDialog{ width: calc(100vw - 18px); }
  .appointmentFrame{ height: 85vh; }
}

.resumeConfirm{
  margin-top: 6px;
  font-family: var(--sans);
  font-size: 13px;
  color: #2f6b46;
  border: 1px solid rgba(47,107,70,0.3);
  background: rgba(47,107,70,0.08);
  border-radius: 10px;
  padding: 10px 12px;
}

footer{
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  color: var(--faint);
  font-family: var(--sans);
  font-size: 12.5px;
  display: flex;
  justify-content: center;
  text-align: center;
  gap: 10px;
  flex-wrap: wrap;
}

@media (prefers-reduced-motion: reduce){
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*){ animation: none !important; }
}
