@layer print {
  @page {
    size: A4 portrait;
    margin: 14mm 12mm 16mm;
  }

  @media print {
    /* the same four type roles, in pt */
    :root {
      --text-body: 10.5pt;
      --text-label: 8.5pt;
      --text-heading: 18pt;
      --text-display: 36pt;
      --header-h: 0px;
      --gutter: 0px;
    }

    *,
    *::before,
    *::after {
      animation: none !important;
      transition: none !important;
      transform: none !important;
    }

    /* decorations stay off the submission PDF (page plan unchanged) */
    .deco {
      display: none !important;
    }

    .site-header,
    .nav-toggle,
    .skip-link,
    .site-nav {
      display: none !important;
    }

    .links a::after {
      display: none;
    }

    html {
      scroll-padding-top: 0;
    }

    body {
      padding-block-start: 0;
      font-family: "Pretendard Print", sans-serif;
      font-size: var(--text-body);
      background: var(--color-bg);
      print-color-adjust: exact;
      -webkit-print-color-adjust: exact;
    }

    h3 {
      font-weight: 600;
    }

    /* cover takes about 40% of page 1 so the keywords can start there */
    .cover {
      min-block-size: 0;
      padding-block: 10mm;
      gap: 4mm;
    }

    .cover-orbs {
      display: none !important;
    }

    .cover h1 {
      font-size: var(--text-display);
      font-weight: 600;
    }

    /* keywords: the static state, the sage half-circle behind the four steps set two by two
       (no counter, no SCROLL DOWN); the band keeps the page width instead of the screen's full bleed */
    #contact {
      &::before {
        display: none;
      }
    }

    .keywords {
      padding-block: 4mm 0;
    }

    .keyword-count,
    .keyword-line,
    .keywords-scroll {
      display: none !important;
    }

    .keywords-stage {
      --line: 9mm;
      grid-template-columns: repeat(2, auto);
      justify-content: center;
      column-gap: 12mm;
      break-inside: avoid;

      & > .eyebrow {
        grid-column: 1 / -1;
      }
    }

    .keywords-circle {
      grid-column: 1 / -1;
      grid-row: 2 / span 3;
      /* the page content width (A4 minus the 12mm side margins), centred on the steps */
      inline-size: 186mm;
      margin-inline: calc(50% - 93mm);
      margin-block-start: 4mm;
    }

    /* wide and flat, so both columns of steps sit inside the circle */
    .keywords-disc {
      --disc: 400mm;
    }

    .keyword-block {
      padding-block: 3mm;
      padding-inline: 4mm;
      break-inside: avoid;

      &:nth-child(4),
      &:nth-child(5) {
        grid-row: 3;
        padding-block-start: calc(4mm + var(--line) + 4mm);
      }

      &:nth-child(5) {
        grid-column: 2;
      }

      &:nth-child(6),
      &:nth-child(7) {
        grid-row: 4;
        padding-block-end: 7mm;
      }

      &:nth-child(7) {
        grid-column: 2;
      }
    }

    .keyword-lead {
      font-size: var(--text-label);
    }

    .keyword-title {
      font-size: 22pt;
      font-weight: 600;
    }

    /* cards stay whole, two per row on A4 */
    .company {
      padding-block: 8mm;
    }

    .project-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 5mm;
    }

    .project {
      break-inside: avoid;
      box-shadow: none;

      &:has(a, .shot-link):hover,
      &:has(a, .shot-link):focus-within {
        box-shadow: none;
      }

      &:target {
        outline: none;
      }
    }

    h2,
    h3,
    .company > .period,
    .company-desc {
      break-after: avoid;
    }

    .eyebrow {
      font-size: var(--text-label);
    }

    /* phone slot: styled so Phase 3 can fill it; stays hidden and empty here */
    .contact-phone:not([hidden]) {
      display: block;
      color: var(--color-ink);
      font-size: var(--text-body);
      font-weight: 400;
    }

    /* empty screenshot frames stay out of the PDF; a picture makes the frame appear again.
       the "No image" frame prints like on screen */
    .shot:not(:has(picture, img)):not([data-empty="no-image"]) {
      display: none;
    }

    .shot-dialog {
      display: none !important;
    }

    .shot-link {
      cursor: auto;
    }

    .shot img {
      transform: none !important;
      transition: none !important;
    }

    /* page plan: cover + keywords | skills | career heading + companies | contact.
       the career list is gone (2026-11-17), so the heading opens the GI Data page instead of trailing the skills page */
    #skills {
      break-before: page;
    }

    #career {
      break-before: page;
      break-after: avoid;
    }

    .company > .eyebrow,
    .company > h2,
    .company > .period,
    .company > .company-desc {
      break-after: avoid;
    }

    .company > .project-grid {
      break-before: avoid;
    }

    #contact {
      break-inside: avoid;
      break-after: avoid;
      margin-block: 8mm 0;
      padding-block: 8mm;
    }

    body > footer {
      break-before: avoid;
      padding-block: 6mm 0;
    }

    main > section:not(.cover, .keywords, .company, #contact) {
      padding-block: 8mm;
    }

    /* the career heading opens a fresh page, so the page margin is its top space; GI Data follows closely
       so its whole card grid still fits under the heading on that page */
    main > section#career {
      padding-block: 0;
    }

    #career + .company {
      padding-block-start: 5mm;
    }

    .skills {
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 4mm;
      margin-block-start: 5mm;
    }

    .skills > div {
      padding: 4mm;
    }

    /* injected phone: label + accent underlined link */
    .contact-phone-label {
      display: block;
      font-size: var(--text-label);
      font-weight: 600;
      color: var(--color-ink-3);
    }

    .contact-phone a {
      color: var(--color-accent);
      text-decoration: underline;
      overflow-wrap: anywhere;
    }

    .contact-phone:not([hidden]) {
      margin-block-start: 2mm;
    }

    /* motion-state guards: nothing may be printed in its pre-entry state */
    .nav-overlay {
      display: none !important;
    }

    .keyword-block,
    .keyword-lead,
    .keyword-dial,
    .keyword-title,
    .cover-line,
    .cover-intro {
      opacity: 1 !important;
      visibility: visible !important;
    }

    .cover-line {
      display: block;
    }
  }
}
