:root {
  --background: #f5f3ed;
  --foreground: #252521;
  --muted: #6b6a61;
  --line: #deddd4;
  --card: #faf9f5;
  --underline: #b6b3a7;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; line-height: 1.5; }

body {
  background: var(--background);
  color: var(--foreground);
  font-family: "Geist", ui-sans-serif, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
img, svg, canvas { display: block; max-width: 100%; }
::selection { background: #dcd9c9; }
:focus-visible { outline: 2px solid var(--muted); outline-offset: 5px; }

.portfolio-viewport { overflow: clip; }
.site-shell { max-width: 1100px; margin: 0 auto; padding: 0 48px; }

.skip-link {
  position: fixed; top: -80px; left: 24px; z-index: 100;
  background: var(--foreground); color: var(--background);
  padding: 12px 20px;
}
.skip-link:focus { top: 16px; }

/* ---------- Home layout ---------- */
.profile-container {
  display: flex; flex-direction: column;
  min-height: 100svh; padding: 64px 0 28px;
}
.intro {
  flex: 1; display: grid; grid-template-columns: .95fr 1.05fr;
  align-items: center; gap: 72px;
}
.intro-copy { min-width: 0; }
.intro h1 {
  margin: 0 0 10px; font-size: 42px; font-weight: 500;
  line-height: 1.15; letter-spacing: -1.8px;
}
.education { font-size: 15px; line-height: 1.7; }
.education .inline-link { font-weight: 500; }
.profile-bio {
  max-width: 385px; margin-top: 18px;
  color: var(--muted); font-size: 13px; line-height: 1.85;
}

/* ---------- Links ---------- */
.inline-link { position: relative; white-space: nowrap; }
.inline-link::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px;
  height: 1px; background: var(--underline);
}
.inline-link::after, .social-links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px;
  height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: 0; transition: transform .2s;
}
.inline-link:hover::after, .inline-link:focus-visible::after,
.social-links a:hover::after, .social-links a:focus-visible::after { transform: scaleX(1); }

/* ---------- Work / projects ---------- */
.work-section, .projects-section { margin-top: 30px; }
.work-section h2, .projects-section h2 { margin: 0 0 10px; font-size: 14px; font-weight: 500; }
.work-list, .project-list { padding-left: 17px; list-style: outside; }
.work-list li, .project-list li { margin: 6px 0; padding-left: 2px; font-size: 13px; line-height: 1.8; }
.work-list li::marker, .project-list li::marker { color: var(--muted); font-size: 8px; }
.experience-role { color: var(--muted); }
/* Small pill, matching the tags on the updates page */
.experience-tag {
  display: inline-block; margin-left: 6px; padding: 0 7px;
  border: 1px solid var(--line); border-radius: 20px;
  color: var(--muted); font-size: 10px; line-height: 1.6; vertical-align: 1px;
}
.experience-date { margin-left: 4px; color: var(--muted); white-space: nowrap; }

.more-projects {
  display: inline-flex; align-items: center; gap: 7px;
  margin-top: 14px; color: var(--muted); font-size: 12px;
}
.more-projects svg { transition: transform .2s; }
.more-projects:hover, .more-projects:focus-visible { color: var(--foreground); }
.more-projects:hover svg, .more-projects:focus-visible svg { transform: translateX(3px); }

.more-links { display: flex; flex-wrap: wrap; gap: 4px 22px; }
.page-links { margin-top: 16px; }

.social-links {
  display: flex; flex-wrap: wrap; gap: 20px; align-self: flex-start;
  margin-top: 40px; color: var(--muted); font-size: 11px;
}
.social-links a { position: relative; padding: 6px 0; }
.social-links a::after { bottom: 4px; }
.social-links a:hover { color: var(--foreground); }

/* ---------- Hover preview cards ---------- */
.link-preview { position: relative; display: inline-block; }
.link-preview-card {
  position: fixed; top: 0; left: 0; z-index: 50;
  display: none; width: 280px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 40px #25252114;
  font-size: 11px; line-height: 1.5; white-space: normal;
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity .18s, transform .18s, visibility .18s;
  pointer-events: none;
}
.link-preview-card[data-open="true"] { display: block; opacity: 1; visibility: visible; transform: translateY(0); }
.preview-image {
  width: 100%; height: 160px; object-fit: cover; object-position: top;
  border-bottom: 1px solid var(--line); border-radius: 11px 11px 0 0;
  background: var(--line);
}
/* Shown when the preview screenshot hasn't been added yet */
.preview-image.is-placeholder {
  display: grid; place-items: center;
  color: var(--muted); font-size: 10px; letter-spacing: .04em;
}
.preview-copy { display: flex; flex-direction: column; gap: 4px; padding: 13px 15px 15px; color: var(--muted); }
.preview-copy strong { color: var(--foreground); font-size: 12px; font-weight: 500; }
.preview-domain { margin-bottom: 6px; font-size: 9px; }

/* ---------- Dot portrait ---------- */
.portrait-section { position: relative; isolation: isolate; align-self: center; min-width: 0; }
.portrait-stage { position: relative; width: 100%; aspect-ratio: 1; }
.portrait-link { position: absolute; inset: 0; z-index: 3; display: block; }
.portrait-canvas {
  position: absolute; top: -30%; left: -30%;
  width: 160%; height: 160%; max-width: none; pointer-events: none;
}
.photography-hint {
  position: relative; z-index: 4; display: table;
  margin: 16px auto 0; padding: 6px 10px; border-radius: 20px;
  color: var(--muted); font-size: 11px;
  opacity: 0; pointer-events: none; transform: translateY(6px);
  transition: opacity .25s, transform .25s, color .2s;
}
.portrait-section:hover .photography-hint,
.portrait-section:focus-within .photography-hint { opacity: 1; pointer-events: auto; transform: translateY(0); }
.photography-hint:hover, .photography-hint:focus-visible { color: var(--foreground); }
.portrait-section[data-expanded="true"] .photography-hint {
  background: var(--background); box-shadow: 0 2px 12px #25252114;
}

/* Floating photos revealed when the portrait is hovered (ported from the template) */
.photo-universe { position: absolute; inset: 0; pointer-events: none; }
.portrait-preview-region { position: absolute; inset: -12%; z-index: -1; pointer-events: none; }
.photo-universe[data-expanded="true"] .portrait-preview-region { pointer-events: auto; }
.floating-photo {
  position: absolute; top: 50%; left: 50%; z-index: 2; display: block;
  width: var(--size); aspect-ratio: 3 / 4;
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translate(-50%, -50%) scale(.05);
  transition:
    left .85s cubic-bezier(.16, 1, .3, 1),
    top .85s cubic-bezier(.16, 1, .3, 1),
    transform .85s cubic-bezier(.16, 1, .3, 1),
    opacity .25s, visibility .25s;
}
.photo-universe[data-expanded="true"] .floating-photo {
  left: var(--x); top: var(--y);
  opacity: 1; visibility: visible; pointer-events: auto;
  transform: translate3d(0, 0, 0) scale(1) rotate(var(--angle));
  transition-delay: var(--delay);
}
.floating-photo-motion {
  position: relative; display: block; width: 100%; height: 100%;
  border-radius: 16px; box-shadow: 0 10px 35px #25252124;
  animation: photo-float var(--float-duration) ease-in-out infinite alternate;
  animation-play-state: paused;
}
.photo-universe[data-expanded="true"] .floating-photo-motion { animation-play-state: running; }
.floating-photo img { width: 100%; height: 100%; max-width: none; object-fit: cover; border-radius: 16px; }
@keyframes photo-float {
  0% { transform: translate(-5px, -10px) rotate(-3deg); }
  100% { transform: translate(6px, 16px) rotate(4deg); }
}

/* ---------- Sub-pages (projects, photography) ---------- */
.standalone-projects { max-width: 680px; margin: 75px auto; }
.standalone-projects h1, .gallery-section h1 {
  margin: 32px 0 20px; font-size: 28px; font-weight: 500; letter-spacing: -.8px;
}
.back-link { display: inline-block; padding: 8px 0; color: var(--muted); font-size: 12px; }
.back-link:hover { text-decoration: underline; text-underline-offset: 4px; }

.project-entries { list-style: none; }
.project-entry { padding: 18px 0; border-top: 1px solid var(--line); }
.project-entry:last-child { border-bottom: 1px solid var(--line); }
.project-entry-head { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; }
.project-entry h2 { font-size: 14px; font-weight: 500; }
.project-entry .year { color: var(--muted); font-size: 11px; flex-shrink: 0; }
.project-entry p { margin-top: 6px; color: var(--muted); font-size: 13px; line-height: 1.8; }
.project-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.project-tags span {
  padding: 2px 8px; border: 1px solid var(--line); border-radius: 20px;
  color: var(--muted); font-size: 10px;
}

.project-entry { scroll-margin-top: 24px; }
.project-entry:target h2 { text-decoration: underline; text-decoration-color: var(--underline); text-underline-offset: 4px; }

.cv-page { max-width: 880px; }
.cv-embed {
  display: block; width: 100%; height: 85vh; min-height: 560px; margin-top: 20px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--card);
}
.cv-intro { margin-bottom: 8px; color: var(--muted); font-size: 13px; line-height: 1.8; }
.cv-section { margin-top: 40px; scroll-margin-top: 24px; }
.cv-section h2 {
  margin-bottom: 4px; padding-bottom: 10px; border-bottom: 1px solid var(--line);
  font-size: 14px; font-weight: 500;
}
.cv-list { list-style: none; }
.cv-item { padding: 12px 0; border-bottom: 1px solid var(--line); }
.cv-compact .cv-item { padding: 9px 0; }
.cv-item-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.cv-item-head strong { font-size: 13px; font-weight: 500; line-height: 1.6; }
.cv-item-head em { font-style: normal; }
.cv-item-head span { flex-shrink: 0; color: var(--muted); font-size: 11px; }
.cv-item p, .cv-note { margin-top: 4px; color: var(--muted); font-size: 12.5px; line-height: 1.75; }
.cv-note { margin-top: 12px; }
.cv-note span { color: var(--foreground); font-weight: 500; }

.update-year { margin-top: 36px; }
.update-year h2 {
  padding-bottom: 10px; border-bottom: 1px solid var(--line);
  font-size: 14px; font-weight: 500;
}
.update-list { list-style: none; }
.update {
  display: grid; grid-template-columns: 88px 1fr; gap: 16px;
  padding: 14px 0; border-bottom: 1px solid var(--line);
}
.update-date { padding-top: 3px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.update-tag {
  display: inline-block; margin-bottom: 6px; padding: 1px 8px;
  border: 1px solid var(--line); border-radius: 20px;
  color: var(--muted); font-size: 10px;
}
.update-body p { font-size: 13px; line-height: 1.8; }
.update-body strong { font-weight: 500; }
/* Feed links can wrap across lines, which the absolutely positioned underline can't
   follow, so use a native underline here instead. */
.update-body .inline-link {
  white-space: normal;
  text-decoration: underline;
  text-decoration-color: var(--underline);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: text-decoration-color .2s;
}
.update-body .inline-link::before, .update-body .inline-link::after { display: none; }
.update-body .inline-link:hover, .update-body .inline-link:focus-visible { text-decoration-color: currentColor; }

.gallery-section { padding: 50px 0; }
.gallery-section h1 { margin-bottom: 40px; }
.photo-grid { columns: 3; column-gap: 22px; }
.gallery-photo { display: block; width: 100%; margin: 0 0 22px; break-inside: avoid; }
.gallery-image {
  display: block; width: 100%; height: auto; overflow: hidden; border-radius: 14px; background: var(--line);
  transition: transform .35s cubic-bezier(.2, .7, .3, 1);
}
.gallery-image.is-placeholder {
  display: grid; place-items: center; color: var(--muted); font-size: 11px;
}
.gallery-photo:hover .gallery-image { transform: scale(1.025); }
/* On the three-column layout, start a new column at these photos so the arrangement stays fixed */
@media (min-width: 1001px) {
  .gallery-photo.col-start { break-before: column; }
}
.photo-caption {
  display: block; height: 40px; padding-top: 14px;
  color: var(--muted); font-size: 11px; line-height: 1.5;
  opacity: 0; transform: translateY(5px); transition: opacity .25s, transform .3s;
}
.gallery-photo:hover .photo-caption { opacity: 1; transform: translateY(0); transition-delay: 80ms; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .site-shell { padding: 0 32px; }
  .intro { gap: 32px; }
  .work-list li, .project-list li { font-size: 12px; }
  .photo-grid { columns: 2; }
}
@media (max-width: 700px) {
  .site-shell { padding: 0 28px; }
  .profile-container { padding: 34px 0 30px; }
  .intro { grid-template-columns: 1fr; gap: 28px; align-content: start; }
  .portrait-section { width: 100%; max-width: 280px; margin: 0 auto; }
  .intro h1 { font-size: 36px; letter-spacing: -1.2px; }
  .education { font-size: 14px; }
  .work-list li, .project-list li { margin: 8px 0; font-size: 12px; }
  .work-section, .projects-section { margin-top: 27px; }
  .social-links { margin-top: 36px; }
  .link-preview-card { width: 250px; }
  .preview-image { height: 145px; }
  .standalone-projects { margin: 40px auto; }
  .gallery-section { padding-top: 24px; }
  .photo-grid { column-gap: 16px; }
  .photo-caption { height: auto; padding-bottom: 10px; opacity: 1; transform: none; }
}
@media (max-width: 480px) { .photo-grid { columns: 1; } }
@media (hover: none) {
  .photography-hint { opacity: 1; pointer-events: auto; transform: none; }
  .photo-caption { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
