/* S13: resume preview dialog. A sheet of paper over a dimmed page; the real pages lie on a desk. */
html:has(dialog.resume[open]) { overflow: hidden; }

.resume {
  width: min(1180px, calc(100vw - 32px));
  height: min(980px, calc(100vh - 32px));
  height: min(980px, calc(100dvh - 32px));
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 40px 90px -30px color-mix(in srgb, var(--dark) 70%, transparent), var(--hair);
  overflow: hidden;
}
.resume[open] { display: flex; }
.resume::backdrop {
  background: color-mix(in srgb, var(--dark) 64%, transparent);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
@media (prefers-reduced-motion: no-preference) {
  .resume[open] { animation: resume-in .34s var(--ease) both; }
  .resume[open]::backdrop { animation: resume-fade .28s ease-out both; }
}
@keyframes resume-in { from { opacity: 0; transform: translateY(14px) scale(.985); } }
@keyframes resume-fade { from { opacity: 0; } }

.resume__sheet {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  min-height: 0;
}

/* Head */
.resume__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
  padding: 22px 28px 20px;
  border-bottom: 1px solid var(--line);
}
.resume__kicker {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: var(--fs-tag);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--tag);
}
.resume__title {
  margin-top: 8px;
  font-size: clamp(2.25rem, 4vw, 3.25rem);
  line-height: .98;
}
.resume__titles { margin-right: auto; }
.resume__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.resume__open {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: .8rem;
  letter-spacing: .04em;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: .3em;
  text-decoration-color: var(--accent-2);
  text-decoration-thickness: 2px;
}
.resume__close {
  display: inline-flex;
  align-items: center;
  gap: .6em;
  padding: .6em 1.1em;
  border: 0;
  border-radius: 999px;
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--line);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: .8rem;
  letter-spacing: .04em;
  cursor: pointer;
  transition: background-color .2s;
}
.resume__close::after { content: '\00d7'; font-size: 1.25em; line-height: 1; }
@media (hover: hover) and (pointer: fine) {
  .resume__close:hover { background: var(--soft); }
}

/* Desk */
.resume__desk {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 22px 28px 40px;
  background:
    radial-gradient(120% 70% at 50% 0%, color-mix(in srgb, var(--paper) 55%, transparent), transparent 70%),
    var(--soft);
  overscroll-behavior: contain;
}
.resume__desk:focus-visible { outline-offset: -4px; }
.resume__hint {
  margin-bottom: 18px;
  text-align: center;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--mute-text);
}
.resume__pages {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
  align-items: start;
}
.resume__page {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: var(--white);
  /* paper lying on a desk: a hairline, a close contact shadow and a long soft one */
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--ink) 10%, transparent),
    0 2px 4px color-mix(in srgb, var(--ink) 14%, transparent),
    0 26px 44px -22px color-mix(in srgb, var(--ink) 55%, transparent);
  cursor: zoom-in;
}
.resume__page img { width: 100%; height: auto; aspect-ratio: 1200 / 1697; }
.resume__page[aria-pressed="true"] { cursor: zoom-out; }
.resume__page:focus-visible { outline-offset: 5px; }
.resume__page { scroll-margin-top: 16px; }

/* Zoomed: one column; the chosen page runs the full width, the other waits as a half-size sheet */
.resume.has-zoom .resume__pages { grid-template-columns: minmax(0, 1fr); justify-items: center; }
.resume.has-zoom .resume__page { width: 50%; }
.resume.has-zoom .resume__page[aria-pressed="true"] { width: 100%; }

/* Phone: stacked pages; a zoomed page is wider than the desk and pans sideways inside it */
@media (max-width: 720px) {
  .resume { width: calc(100vw - 16px); height: calc(100vh - 16px); height: calc(100dvh - 16px); border-radius: 18px; }
  .resume__head { gap: 14px; padding: 16px 16px 14px; align-items: center; }
  .resume__titles { order: 1; }
  .resume__title { margin-top: 4px; font-size: 2rem; }
  .resume__actions { order: 3; width: 100%; gap: 10px 16px; }
  .resume__titles { flex: 1; }
  .resume__close { order: 2; min-height: 44px; }
  .resume__download { min-height: 44px; }
  .resume__open { padding: 12px 0; }
  .resume__desk { padding: 16px 16px 32px; }
  .resume__pages { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .resume.has-zoom .resume__pages { justify-items: start; }
  .resume.has-zoom .resume__page { width: 100%; }
  .resume.has-zoom .resume__page[aria-pressed="true"] { width: max(100%, 820px); }
}
