/* ==========================================================================
   AyzalSoft — résumé sheet
   A single US-Letter page, previewed on screen and printed 1:1.

   This replaces the 37 KB <doc-page> web component the page used to depend on.
   For a fixed one-page document the whole behaviour is a sized box plus an
   @page rule, so it does not need JavaScript.
   ========================================================================== */

@page {
  size: letter;
  margin: 0;
}

:root {
  color-scheme: light;

  --sheet-w: 8.5in;
  --sheet-h: 11in;
  --sheet-pad-y: 0.45in;
  --sheet-pad-x: 0.55in;

  /* On Paper the accent roles invert relative to the site: Gate reads at
     5.17:1 on white where it failed on Ink, and Slate is a legible 4.76:1. */
  --resume-ink: #0f172a;      /* Ink   */
  --resume-muted: #64748b;    /* Slate */
  --resume-accent: #2563eb;   /* Gate  */
  --resume-packet: #06b6d4;   /* Packet */
  --resume-rule: rgb(15 23 42 / 0.14);
  --resume-mark: rgb(15 23 42 / 0.45);

  --font-heading: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, sans-serif;
}

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

body {
  margin: 0;
  padding: 24px 16px;
  background: #0f172a;
  color: var(--resume-ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

/* --- The sheet ------------------------------------------------------------ */

.sheet {
  width: var(--sheet-w);
  min-height: var(--sheet-h);
  margin-inline: auto;
  padding: var(--sheet-pad-y) var(--sheet-pad-x);
  background: #fff;
  box-shadow: 0 12px 32px rgb(0 0 0 / 0.35);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* --- Type ----------------------------------------------------------------- */

h1,
h2,
h3 {
  margin: 0;
}

p {
  margin: 0;
}

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

a:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

li {
  orphans: 3;
  widows: 3;
}

.name {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 34px;
  line-height: 1.02;
  letter-spacing: -0.02em;
}

.role {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 13px;
  line-height: 1.15;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--resume-accent);
  white-space: nowrap;
}

.tagline {
  font-size: 11px;
  line-height: 1.25;
  color: var(--resume-muted);
}

/* --- Header --------------------------------------------------------------- */

.resume-header {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 11px 14px 10px;
  border: 1px solid var(--resume-rule);
}

/* Corner registration marks, drawn as eight hairline gradients on one
   pseudo-element (see .blueprint in site.css). */
.resume-header::before {
  content: "";
  position: absolute;
  inset: -6px;
  pointer-events: none;
  background-repeat: no-repeat;
  background-image:
    linear-gradient(var(--resume-mark), var(--resume-mark)),
    linear-gradient(var(--resume-mark), var(--resume-mark)),
    linear-gradient(var(--resume-mark), var(--resume-mark)),
    linear-gradient(var(--resume-mark), var(--resume-mark)),
    linear-gradient(var(--resume-mark), var(--resume-mark)),
    linear-gradient(var(--resume-mark), var(--resume-mark)),
    linear-gradient(var(--resume-mark), var(--resume-mark)),
    linear-gradient(var(--resume-mark), var(--resume-mark));
  background-size:
    1px 11px, 11px 1px,
    1px 11px, 11px 1px,
    1px 11px, 11px 1px,
    1px 11px, 11px 1px;
  background-position:
    left 5px top 0, left 0 top 5px,
    right 5px top 0, right 0 top 5px,
    left 5px bottom 0, left 0 bottom 5px,
    right 5px bottom 0, right 0 bottom 5px;
}

.resume-header__identity {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.resume-header__contact {
  display: flex;
  flex-direction: column;
  gap: 1px;
  text-align: right;
  font-size: 10.5px;
  line-height: 1.35;
  color: var(--resume-muted);
  white-space: nowrap;
}

.resume-header__contact a:first-child {
  color: var(--resume-ink);
  font-weight: 600;
}

/* --- Sections ------------------------------------------------------------- */

.resume-section {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.resume-section--roomy {
  gap: 7px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 13.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  line-height: 1;
}

.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--resume-rule);
}

.summary {
  font-size: 13px;
  line-height: 1.45;
  text-wrap: pretty;
}

/* --- Job / project entries ------------------------------------------------ */

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

.job__head,
.entry-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.job__title {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
}

.job__meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  font-size: 12px;
  line-height: 1.3;
  color: var(--resume-accent);
}

.dates {
  font-size: 11.5px;
  color: var(--resume-muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.place {
  color: var(--resume-muted);
  white-space: nowrap;
}

.bullets {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 2px 0 0;
  padding-left: 15px;
  list-style-type: square;
  font-size: 13px;
  line-height: 1.45;
}

.bullets strong {
  font-weight: 600;
}

/* --- Projects ------------------------------------------------------------- */

.projects {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 13px;
  line-height: 1.4;
}

.project__name {
  font-weight: 600;
}

.project__name--plain {
  color: var(--resume-accent);
}

.project__stack {
  font-family: var(--font-heading);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--resume-muted);
  white-space: nowrap;
}

/* --- Skills --------------------------------------------------------------- */

.skills {
  display: grid;
  /* Content-sized label columns rather than fixed px, so the labels cannot
     collide with their values if the webfont fails and a wider fallback face
     is substituted. */
  grid-template-columns: max-content 1fr max-content 1fr;
  row-gap: 3px;
  column-gap: 10px;
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
}

.skills dt {
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--resume-muted);
}

.skills dd {
  margin: 0;
}

/* --- Education ------------------------------------------------------------ */

.education {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.education__title {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 12.5px;
  line-height: 1.25;
}

.education__title span {
  font-weight: 400;
  color: var(--resume-muted);
}

.certs {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  line-height: 1.4;
}

/* --- Footer line ---------------------------------------------------------- */

.languages {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding-top: 2px;
  font-size: 13px;
}

.languages .section-title {
  white-space: nowrap;
}

.languages .section-title::after {
  flex: none;
  width: 18px;
}

/* Below the paper width the sheet stops pretending to be paper and reflows as
   an ordinary page. Shrinking a 8.5in sheet to fit a phone renders 13px body
   text at about 6px, which is unreadable; reflowing keeps it legible. Print is
   unaffected — the @media print block at the end restores exact 8.5×11in
   geometry, so the PDF is identical either way. */
@media screen and (max-width: 860px) {
  body {
    padding: 0;
    background: #fff;
  }

  .sheet {
    width: 100%;
    min-height: 0;
    padding: 28px 22px 40px;
    box-shadow: none;
    gap: 14px;
  }

  .resume-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .resume-header__contact {
    text-align: left;
    white-space: normal;
  }

  /* These only need to hold their line when the paper width guarantees room. */
  .role,
  .project__stack,
  .place {
    white-space: normal;
  }

  .job__head,
  .job__meta,
  .entry-line,
  .certs {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .skills {
    grid-template-columns: 1fr;
    row-gap: 0;
  }

  .skills dt {
    margin-top: 9px;
  }

  .skills dt:first-of-type {
    margin-top: 0;
  }

  .languages {
    flex-wrap: wrap;
  }
}

/* --- Print ---------------------------------------------------------------- */

@media print {
  body {
    padding: 0;
    background: none;
  }

  .sheet {
    width: var(--sheet-w);
    height: var(--sheet-h);
    min-height: 0;
    margin: 0;
    box-shadow: none;
    transform: none;
    break-inside: avoid;
  }

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