/* ==========================================================
   Diego Gomez — resume site
   Concept: a blueprint drawing sheet. The hero is the one loud
   moment (plotted name, dimension line, CAD crosshair); the rest
   of the page is quiet, cool paper.
   ========================================================== */

:root {
  --blueprint: #1b47a8;
  --blueprint-deep: #163b8c;
  --grid-minor: rgba(255, 255, 255, 0.07);
  --grid-major: rgba(255, 255, 255, 0.15);
  --paper: #f3f6fb;
  --ink: #0f1e45;
  --muted: #55617d;
  --rule: #d3dbea;
  --signal: #ffc845;

  --font: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --pad-x: clamp(1.25rem, 5vw, 4rem);
  --ease: cubic-bezier(0.65, 0, 0.35, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  font-variation-settings: "wdth" 100;
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--blueprint);
  outline-offset: 3px;
  border-radius: 2px;
}

.hero :focus-visible,
.contact :focus-visible {
  outline-color: var(--signal);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: 0.5rem 1rem;
  background: var(--signal);
  color: var(--ink);
  font-weight: 600;
}

.skip-link:focus {
  top: 1rem;
}

/* ---------- Blueprint surface (hero + footer) ---------- */

.hero,
.contact {
  position: relative;
  color: #fff;
  background-color: var(--blueprint);
  background-image:
    linear-gradient(var(--grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
    linear-gradient(var(--grid-minor) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-minor) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  background-position: -1px -1px;
}

/* Sheet border, inset like a drawing frame */
.hero::before,
.contact::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  pointer-events: none;
}

/* ---------- Hero ---------- */

.hero {
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 2rem;
  padding: clamp(1.75rem, 3vw, 2.5rem) var(--pad-x);
  overflow: hidden;
}

.nav {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.monogram {
  display: inline-grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1.5px solid #fff;
  font-weight: 800;
  font-variation-settings: "wdth" 125;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.5vw, 2rem);
  font-size: 0.9375rem;
}

.nav-links a {
  text-decoration: none;
  padding-block: 0.25rem;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.nav-links a:hover {
  border-color: currentColor;
}

.nav-links .nav-cta {
  padding: 0.5rem 1rem;
  border: 1px solid var(--signal);
  color: var(--signal);
}

.nav-links .nav-cta:hover {
  background: var(--signal);
  color: var(--ink);
}

.drawing {
  position: relative;
  z-index: 1;
  align-self: center;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  grid-template-areas:
    "intro intro"
    "name  callouts"
    "dim   .";
  column-gap: clamp(1rem, 2vw, 1.5rem);
}

.intro {
  grid-area: intro;
  max-width: 36ch;
  margin-bottom: clamp(1rem, 2vw, 1.75rem);
  font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
  color: rgba(255, 255, 255, 0.82);
}

.name {
  grid-area: name;
  display: flex;
  flex-direction: column;
  font-size: clamp(3.25rem, 12.5vw, 10.5rem);
  font-weight: 800;
  font-variation-settings: "wdth" 125;
  line-height: 0.88;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

/* Dimension line: ticks at both ends, label breaks the line */
.dim {
  grid-area: dim;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 1.75rem;
  margin-top: clamp(1rem, 2vw, 1.5rem);
  color: var(--signal);
  background:
    linear-gradient(var(--signal), var(--signal)) left center / 1px 100% no-repeat,
    linear-gradient(var(--signal), var(--signal)) right center / 1px 100% no-repeat;
}

.dim::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: var(--signal);
}

.dim span {
  position: relative;
  padding: 0 0.875rem;
  background: var(--blueprint);
  font-size: 0.9375rem;
  font-weight: 600;
  white-space: nowrap;
}

/* Callouts with leader lines pointing back at the name */
.callouts {
  grid-area: callouts;
  display: grid;
  grid-template-rows: 1fr 1fr;
  align-items: center;
  font-size: clamp(0.9375rem, 1.3vw, 1.0625rem);
  line-height: 1.4;
}

.callouts li {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.callouts span {
  flex: 0 1 18rem;
}

.callouts li::before {
  content: "";
  flex: 1 1 2rem;
  max-width: 12rem;
  background:
    radial-gradient(circle, var(--signal) 3px, transparent 3.5px) left center / 7px 7px no-repeat,
    linear-gradient(var(--signal), var(--signal)) center / 100% 1px no-repeat;
  height: 7px;
  transform-origin: right center;
}

/* Title block, bottom-right like a real drawing sheet */
.titleblock {
  position: relative;
  z-index: 1;
  justify-self: end;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 15rem));
  border-top: 1px solid rgba(255, 255, 255, 0.45);
  border-left: 1px solid rgba(255, 255, 255, 0.45);
  background: var(--blueprint);
  font-size: 0.9375rem;
  line-height: 1.35;
}

.titleblock > div {
  padding: 0.625rem 0.875rem 0.75rem;
  border-right: 1px solid rgba(255, 255, 255, 0.45);
  border-bottom: 1px solid rgba(255, 255, 255, 0.45);
}

.titleblock dt {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.65);
}

.titleblock dd {
  font-weight: 600;
}

/* CAD crosshair, follows a fine pointer inside the hero */
.crosshair {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s;
}

.hero.is-tracking .crosshair {
  opacity: 1;
}

.crosshair-x,
.crosshair-y {
  position: absolute;
  background: rgba(255, 255, 255, 0.4);
}

.crosshair-x {
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
}

.crosshair-y {
  top: 0;
  bottom: 0;
  left: 0;
  width: 1px;
}

.crosshair-readout {
  position: absolute;
  top: 0;
  left: 0;
  padding: 0.125rem 0.375rem;
  background: var(--signal);
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

@media (hover: hover) and (pointer: fine) {
  .hero {
    cursor: crosshair;
  }
  .hero a {
    cursor: pointer;
  }
}

/* ---------- Load sequence: the name gets plotted ---------- */

@media (prefers-reduced-motion: no-preference) {
  .name span {
    color: transparent;
    -webkit-text-stroke: 1.5px #fff;
    clip-path: inset(0 100% 0 0);
    animation:
      plot 1.1s var(--ease) forwards,
      ink 0.5s ease forwards;
  }

  .name span:nth-child(1) {
    animation-delay: 0.15s, 1.25s;
  }

  .name span:nth-child(2) {
    animation-delay: 0.45s, 1.4s;
  }

  .dim {
    transform: scaleX(0);
    animation: draw 0.7s var(--ease) 1.3s forwards;
  }

  .dim span,
  .callouts li {
    opacity: 0;
    animation: appear 0.5s ease forwards;
  }

  .dim span {
    animation-delay: 1.8s;
  }

  .callouts li::before {
    transform: scaleX(0);
    animation: draw 0.6s var(--ease) forwards;
  }

  .callouts li:nth-child(1),
  .callouts li:nth-child(1)::before {
    animation-delay: 1.6s;
  }

  .callouts li:nth-child(2),
  .callouts li:nth-child(2)::before {
    animation-delay: 1.8s;
  }
}

@keyframes plot {
  to { clip-path: inset(0 0 0 0); }
}

@keyframes ink {
  to {
    color: #fff;
    -webkit-text-stroke-color: transparent;
  }
}

@keyframes draw {
  to { transform: scaleX(1); }
}

@keyframes appear {
  to { opacity: 1; }
}

/* ---------- Paper sections ---------- */

main {
  padding-bottom: clamp(2rem, 6vw, 5rem);
}

.section {
  display: grid;
  grid-template-columns: minmax(9rem, 15rem) minmax(0, 46rem);
  gap: 1.5rem clamp(2rem, 6vw, 5rem);
  max-width: 82rem;
  margin: 0 auto;
  padding: clamp(3.5rem, 8vw, 6rem) var(--pad-x) 0;
}

.section > h2 {
  position: sticky;
  top: 2rem;
  align-self: start;
  padding-top: 0.875rem;
  border-top: 3px solid var(--blueprint);
  font-size: clamp(1.5rem, 2.4vw, 1.875rem);
  font-weight: 700;
  font-variation-settings: "wdth" 112;
  line-height: 1.15;
}

.section-body {
  padding-top: 0.875rem;
  border-top: 1px solid var(--rule);
}

.lede {
  font-size: clamp(1.375rem, 2.6vw, 1.875rem);
  line-height: 1.35;
  font-weight: 500;
  letter-spacing: -0.005em;
  margin-bottom: 1.25rem;
  max-width: 30ch;
}

.section-body > p:not(.lede) {
  max-width: 62ch;
  color: var(--muted);
}

h3 {
  font-size: 1.25rem;
  font-weight: 700;
  font-variation-settings: "wdth" 106;
  line-height: 1.3;
}

.org {
  font-weight: 500;
}

.when {
  color: var(--muted);
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
}

/* Experience timeline: entries are a real sequence, so a rail fits */
.timeline > li {
  position: relative;
  padding: 0.25rem 0 2.5rem 2rem;
  border-left: 1px solid var(--rule);
  margin-left: 0.3125rem;
}

.timeline > li:first-child {
  margin-top: 1.25rem;
}

.timeline > li:last-child {
  padding-bottom: 0.5rem;
}

.timeline > li::before {
  content: "";
  position: absolute;
  left: -0.375rem;
  top: 0.55rem;
  width: 0.6875rem;
  height: 0.6875rem;
  background: var(--paper);
  border: 2px solid var(--blueprint);
  transform: rotate(45deg);
}

.timeline > li:first-child::before {
  background: var(--blueprint);
}

.entry-head {
  margin-bottom: 0.75rem;
}

.timeline ul li {
  position: relative;
  padding-left: 1.125rem;
  max-width: 62ch;
}

.timeline ul li + li {
  margin-top: 0.375rem;
}

.timeline ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 0.5rem;
  height: 1px;
  background: var(--muted);
}

/* Awards */
.awards li {
  display: grid;
  grid-template-columns: minmax(8rem, 13rem) minmax(0, 1fr);
  gap: 0.25rem 1.5rem;
  align-items: baseline;
  padding: 1rem 0;
  border-bottom: 1px solid var(--rule);
}

.awards li:first-child {
  padding-top: 0.25rem;
}

.place {
  color: var(--blueprint);
  font-size: 1.25rem;
  font-weight: 700;
  font-variation-settings: "wdth" 112;
  line-height: 1.3;
}

/* Certifications as a parts list */
.certs {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.certs th {
  text-align: left;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
  padding: 0 1rem 0.625rem 0;
  border-bottom: 1px solid var(--ink);
}

.certs td {
  padding: 0.875rem 1rem 0.875rem 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

.certs td:first-child {
  font-weight: 600;
}

.certs th:last-child,
.certs td:last-child {
  padding-right: 0;
  text-align: right;
  white-space: nowrap;
}

/* Skills */
.skills {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem;
}

.skills h3 {
  font-size: 1.0625rem;
  margin-bottom: 0.75rem;
}

.skills li {
  position: relative;
  padding: 0.375rem 0 0.375rem 1.25rem;
  border-bottom: 1px solid var(--rule);
}

.skills li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.05em;
  width: 0.4375rem;
  height: 0.4375rem;
  background: var(--blueprint);
}

/* Education */
.education {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem;
}

/* ---------- Contact footer ---------- */

.contact {
  padding: clamp(4rem, 10vw, 7.5rem) var(--pad-x) clamp(2.5rem, 5vw, 3.5rem);
}

.contact-inner {
  position: relative;
  max-width: 82rem;
  margin-inline: auto;
}

.contact h2 {
  font-size: clamp(2.25rem, 6vw, 4.5rem);
  font-weight: 800;
  font-variation-settings: "wdth" 125;
  line-height: 1;
  text-transform: uppercase;
}

.contact-inner > p:not(.fineprint) {
  margin-top: 1rem;
  font-size: 1.125rem;
  color: rgba(255, 255, 255, 0.82);
}

.email {
  display: block;
  width: fit-content;
  margin-top: clamp(1.5rem, 3vw, 2.5rem);
  font-size: clamp(1.25rem, 4.2vw, 3rem);
  font-weight: 600;
  font-variation-settings: "wdth" 100;
  line-height: 1.2;
  overflow-wrap: anywhere;
  text-decoration: none;
  border-bottom: 3px solid var(--signal);
  padding-bottom: 0.25rem;
  transition: color 0.2s;
}

.email:hover {
  color: var(--signal);
}

.contact .fineprint {
  margin-top: clamp(3rem, 8vw, 5rem);
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.65);
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .drawing {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "intro"
      "name"
      "dim"
      "callouts";
    justify-self: start;
  }

  .name {
    width: fit-content;
  }

  .dim {
    width: 100%;
    max-width: 100%;
  }

  .callouts {
    grid-template-rows: none;
    gap: 0.75rem;
    margin-top: 1.75rem;
  }

  .callouts li::before {
    flex: 0 0 1.5rem;
  }

  .titleblock {
    justify-self: stretch;
  }
}

@media (max-width: 760px) {
  .section {
    grid-template-columns: minmax(0, 1fr);
  }

  .section > h2 {
    position: static;
  }

  .section-body {
    border-top: 0;
    padding-top: 0;
  }

  .skills,
  .education {
    grid-template-columns: minmax(0, 1fr);
  }

  .awards li {
    grid-template-columns: minmax(0, 1fr);
  }

  .certs thead {
    display: none;
  }

  .certs tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 0.875rem 0;
    border-bottom: 1px solid var(--rule);
  }

  .certs td {
    padding: 0;
    border: 0;
  }

  .certs td:first-child {
    grid-column: 1 / -1;
  }

  .certs td:nth-child(2) {
    color: var(--muted);
  }
}

@media (max-width: 640px) {
  .nav-links li:not(:last-child) {
    display: none;
  }

  .titleblock {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    font-size: 0.875rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
