/* Keep the paper layout readable on phones, tablets, and touch laptops. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html.dialog-open body { position: fixed; top: var(--dialog-scroll-top, 0px); width: 100%; overflow: hidden; }
#dilans-harbor-resume .ir-desk {
  padding-left: max(25px, env(safe-area-inset-left, 0px));
  padding-right: max(25px, env(safe-area-inset-right, 0px));
  padding-top: max(18px, env(safe-area-inset-top, 0px));
  padding-bottom: max(18px, env(safe-area-inset-bottom, 0px));
}
#dilans-harbor-resume :is(button, a, summary) { touch-action: manipulation; }
#dilans-harbor-resume :is(.ir-project-copy, .ir-modal-intro, .hm-intro-copy, .wf-contact-copy) { min-width: 0; }
#dilans-harbor-resume :is(.ir-project-title, .project-page h1, #ir-modal-title, .ir-stack, #ir-modal-stack) { overflow-wrap: anywhere; }
#dilans-harbor-resume .ir-type-word { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
#dilans-harbor-resume .ir-project-modal { scroll-padding-top: 88px; }

@media (max-width: 820px), (any-pointer: coarse) {
  #dilans-harbor-resume :is(.ir-topbar a, .ir-contact-line a, .ir-modal-links a, .ir-modal-close, .ir-view-switch button, .ir-preview-controls button, .ir-replay-reveal, .project-filters button, .archive-empty button, .back-link, .screenshot-fullsize, .wf-contact-actions a, .wf-copy-email, .wf-contact-email, .wf-footer a, .wf-section-heading > a, .archive-end a) {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    min-width: 44px;
  }
  #dilans-harbor-resume :is(.project-search input, .wf-email-fallback input) { min-height: 48px; font-size: 16px; }
  #dilans-harbor-resume .ir-project-trigger:active { background: var(--ir-pale-blue); }
}

@media (max-width: 820px) {
  #dilans-harbor-resume { --page-gutter: clamp(18px, 4vw, 30px); --outer-gutter: clamp(6px, 1.5vw, 12px); }
  #dilans-harbor-resume .ir-desk {
    padding: var(--outer-gutter);
    padding-left: max(var(--outer-gutter), env(safe-area-inset-left, 0px));
    padding-right: max(var(--outer-gutter), env(safe-area-inset-right, 0px));
    padding-top: max(var(--outer-gutter), env(safe-area-inset-top, 0px));
    padding-bottom: max(var(--outer-gutter), env(safe-area-inset-bottom, 0px));
  }
  #dilans-harbor-resume .ir-document { padding: 0 var(--page-gutter); }
  #dilans-harbor-resume .ir-topbar { margin: 0 calc(-1 * var(--page-gutter)); padding: 10px var(--page-gutter); gap: 8px 16px; flex-wrap: wrap; }
  #dilans-harbor-resume .ir-topbar nav { min-width: 0; gap: 8px; flex: initial; }
  #dilans-harbor-resume .ir-topbar nav a { justify-content: center; padding: 8px; font-size: 13px; }
  #dilans-harbor-resume .ir-monogram { font-size: 30px; }
  #dilans-harbor-resume .ir-overline { flex-wrap: wrap; gap: 4px 16px; font-size: 12px; }
  #dilans-harbor-resume .hm-intro-copy > p { font-size: 16px; line-height: 1.7; }
  #dilans-harbor-resume .hm-intro-copy .ir-contact-line { gap: 24px; padding: 0; font-size: 14px; }
  #dilans-harbor-resume .ir-desktop-break { display: none; }
  #dilans-harbor-resume .wf-section-heading { flex-wrap: wrap; gap: 8px 16px; align-items: center; }
  #dilans-harbor-resume .wf-section-heading h2 { font-size: 26px; }
  #dilans-harbor-resume .ir-current-line p { font-size: 15px; line-height: 1.7; }
  #dilans-harbor-resume .ir-current-line { gap: 10px; margin-bottom: 12px; }
  #dilans-harbor-resume .ir-bullet { flex-shrink: 0; }
  #dilans-harbor-resume .ir-project-short { font-size: 15px; }
  #dilans-harbor-resume .ir-stack { font-size: 12px; line-height: 1.75; }
  #dilans-harbor-resume .ir-project-category { font-size: 12px; }
  #dilans-harbor-resume .project-facts dt { font-size: 12px; }
  #dilans-harbor-resume .project-facts dd { font-size: 15px; }

  /* A single rail keeps expanded experience readable at tablet widths too. */
  #dilans-harbor-resume .ir-tree { padding: 20px 0 0 32px; margin: 24px 0 0; }
  #dilans-harbor-resume .ir-tree::before { left: 8px; bottom: 24px; }
  #dilans-harbor-resume .ir-tree::after { left: 5px; bottom: 23px; }
  #dilans-harbor-resume .ir-tree-tip { left: 5px; }
  #dilans-harbor-resume .ir-tree-row { display: block; padding-bottom: 32px; }
  #dilans-harbor-resume .ir-tree-row::after { left: -27px; top: 7px; }
  #dilans-harbor-resume .ir-tree-row .ir-tree-year {
    position: static;
    display: block;
    writing-mode: horizontal-tb;
    transform: none;
    padding: 0;
    margin-bottom: 8px;
    font-size: 12px;
  }
  #dilans-harbor-resume .ir-role { width: 100%; padding: 0; border-top: 0; }
  #dilans-harbor-resume .ir-role::before { display: none; }
  #dilans-harbor-resume .ir-role-title { font-size: 26px; line-height: 1.25; overflow-wrap: anywhere; }
  #dilans-harbor-resume .ir-role-job { font-size: 14px; }
  #dilans-harbor-resume .ir-role-date { font-size: 12px; }
  #dilans-harbor-resume .ir-role-teaser { font-size: 15px; }
  #dilans-harbor-resume .ir-role-action { font-size: 13px; margin-top: 8px; padding: 8px 0; }
  #dilans-harbor-resume :is(.ir-role .ir-resume-bullets, .project-page .ir-resume-bullets) { font-size: 15px; line-height: 1.75; padding-left: 18px; }
  #dilans-harbor-resume .ir-role .ir-resume-bullets li { margin-bottom: 14px; }

  #dilans-harbor-resume .wf-contact-email { font-size: 15px; max-width: 100%; }
  #dilans-harbor-resume .wf-contact-actions { gap: 10px 20px; font-size: 14px; }
  #dilans-harbor-resume #wf-copy-email { font-size: 14px; }
  #dilans-harbor-resume .wf-contact-status { font-size: 13px; }
  #dilans-harbor-resume .wf-footer { margin: 0 calc(-1 * var(--page-gutter)); padding: 12px var(--page-gutter); }
  #dilans-harbor-resume .wf-footer > a { font-size: 12px; }
  #dilans-harbor-resume .back-link { font-size: 14px; margin-bottom: 20px; }
  #dilans-harbor-resume .project-page-image figcaption p { font-size: 15px; }
  #dilans-harbor-resume .screenshot-fullsize { font-size: 14px; }
}

@media (max-width: 640px) {
  #dilans-harbor-resume .hm-intro { padding: 24px 0 32px; }
  #dilans-harbor-resume .hm-masthead { min-height: 180px; gap: 12px; }
  #dilans-harbor-resume .hm-masthead h1 { min-width: 0; font-size: clamp(40px, 13cqw, 62px); letter-spacing: -1.5px; }
  #dilans-harbor-resume .hm-harbor { width: 40%; height: 128px; margin-top: 14px; }
  #dilans-harbor-resume .hm-intro-copy { flex-direction: column; align-items: flex-start; gap: 10px; }
  #dilans-harbor-resume :is(.ir-section, .ir-now, .ir-experience) { margin-bottom: 36px; }

  /* Give project text its full width and keep the real screenshots visible. */
  #dilans-harbor-resume .ir-project-trigger { padding: 20px 16px; }
  #dilans-harbor-resume .ir-project-overview,
  #dilans-harbor-resume .archive-list .ir-project-overview { grid-template-columns: minmax(0, 1fr); gap: 18px; padding: 12px 0 16px; }
  #dilans-harbor-resume .ir-project-title { font-size: clamp(29px, 7.5vw, 35px); line-height: 1.2; }
  #dilans-harbor-resume .archive-thumbnail,
  #dilans-harbor-resume .archive-list .archive-thumbnail { display: block; width: 100%; transform: none; padding: 6px; }
  #dilans-harbor-resume .archive-thumbnail img { height: clamp(120px, 36vw, 180px); filter: none; }
  #dilans-harbor-resume .ir-project-preview { flex-direction: column; align-items: flex-start; gap: 8px; }
  #dilans-harbor-resume .ir-project-preview > span:first-child { max-width: none; font-size: 12px; line-height: 1.65; }
  #dilans-harbor-resume .ir-open-copy { font-size: 13px; }

  #dilans-harbor-resume .archive-intro { padding: 24px 0; }
  #dilans-harbor-resume .archive-intro h1 { font-size: clamp(40px, 11vw, 60px); letter-spacing: -1.5px; }
  #dilans-harbor-resume .archive-intro p { font-size: 15px; line-height: 1.7; }
  #dilans-harbor-resume .archive-tools { gap: 14px; }
  #dilans-harbor-resume .project-search { order: -1; width: 100%; min-width: 0; max-width: none; }
  #dilans-harbor-resume .project-filters { gap: 8px; }
  #dilans-harbor-resume .project-filters button { font-size: 13px; padding: 10px 12px; }
  #dilans-harbor-resume .archive-count { font-size: 12px; }
  #dilans-harbor-resume .archive-end { flex-wrap: wrap; gap: 8px; }
  #dilans-harbor-resume .archive-end a { font-size: 14px; }
  #dilans-harbor-resume .project-page { padding-top: 24px; }
  #dilans-harbor-resume .project-page h1 { font-size: clamp(34px, 9vw, 54px); line-height: 1.15; letter-spacing: -1.2px; }
  #dilans-harbor-resume .project-page-description { font-size: 19px; }
  #dilans-harbor-resume .wf-contact-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #dilans-harbor-resume .wf-contact-actions :is(a, button) { justify-content: center; font-size: 14px; }
  #dilans-harbor-resume .wf-contact-actions .wf-email-action { grid-column: 1 / -1; min-height: 48px; }
}

@media (max-width: 480px) {
  #dilans-harbor-resume .ir-topbar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 8px var(--page-gutter) 12px; }
  #dilans-harbor-resume .ir-monogram { justify-self: start; }
  #dilans-harbor-resume .ir-topbar nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; width: 100%; }
  #dilans-harbor-resume .ir-topbar nav a { padding: 8px 4px; }
}

/* A full-height project sheet also fits a phone held in landscape. */
@media (max-width: 640px), (max-height: 500px) and (any-pointer: coarse) {
  #dilans-harbor-resume .ir-project-modal {
    inset: 0;
    margin: 0;
    width: 100%;
    max-width: none;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    padding: 0 max(20px, env(safe-area-inset-right, 0px)) 0 max(20px, env(safe-area-inset-left, 0px));
    border: 0;
    box-shadow: none;
    scroll-padding-top: 80px;
  }
  #dilans-harbor-resume .ir-modal-toolbar { min-height: 64px; padding: max(8px, env(safe-area-inset-top, 0px)) 0 8px; gap: 12px; }
  #dilans-harbor-resume .ir-project-modal::backdrop { backdrop-filter: none; }
  #dilans-harbor-resume .ir-modal-close { min-width: 76px; justify-content: flex-end; font-size: 14px; }
  #dilans-harbor-resume .ir-modal-owner > span { font-size: 12px; margin-left: 8px; }
  #dilans-harbor-resume .ir-modal-heading { padding: 24px 0 20px; }
  #dilans-harbor-resume #ir-modal-title { font-size: clamp(34px, 9vw, 44px); line-height: 1.15; letter-spacing: -1.2px; }
  #dilans-harbor-resume #ir-modal-description { font-size: 17px; }
  #dilans-harbor-resume .ir-modal-action-row { gap: 8px; }
  #dilans-harbor-resume .ir-modal-links { width: 100%; gap: 8px 24px; font-size: 14px; }
  #dilans-harbor-resume .ir-modal-links a { padding: 10px 0; }
  #dilans-harbor-resume .ir-view-switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; width: 100%; }
  #dilans-harbor-resume .ir-view-switch button { justify-content: center; min-height: 48px; padding: 12px 8px; font-size: 14px; }
  #dilans-harbor-resume .ir-modal-bullets { font-size: 15px; line-height: 1.75; padding-left: 20px; }
  #dilans-harbor-resume .ir-modal-bullets li { padding-left: 3px; }
  #dilans-harbor-resume #ir-modal-stack { font-size: 12px; line-height: 1.8; }
  #dilans-harbor-resume .screenshot-preview { padding: 8px; }
  #dilans-harbor-resume .screenshot-preview img { width: auto; max-width: 100%; max-height: 56vh; max-height: 56svh; margin: 0 auto; }
  #dilans-harbor-resume .ir-preview-figure h3 { font-size: 26px; }
  #dilans-harbor-resume #ir-preview-caption { font-size: 15px; line-height: 1.7; }
  #dilans-harbor-resume .ir-preview-controls { gap: 8px; }
  #dilans-harbor-resume .ir-preview-controls button { font-size: 14px; }
  #dilans-harbor-resume .ir-modal-footer { flex-wrap: wrap; gap: 8px 16px; padding-bottom: max(16px, env(safe-area-inset-bottom, 0px)); }
}
