/* Resume page (dark) */
/* --u = 1 Figma px. Fixed at 1px on mobile; on desktop it scales with the window exactly like the portfolio page. */
body.resume { --u: 1px; --line: #454749; background: var(--ink); color: #fff; }

.r-wrap { width: calc(100% - 32px); margin-inline: auto; }
.r-content { width: min(100%, calc(1000 * var(--u))); margin-inline: auto; }

/* Nav: pinned, with the buttons at the same height as the portfolio page (24 design-px on desktop, 12px on mobile) */
.r-header { position: sticky; top: 0; z-index: 50; isolation: isolate; pointer-events: none; }
.r-header .btn { pointer-events: auto; }
/* Solid behind the buttons (the top 38% of a box reaching 120px below the 90px bar), then a cosine fade to clear.
   The cosine leaves the solid part with zero slope and lands on clear with zero slope, so neither end reads as a line;
   the bar's bottom edge is still ~98% covered. Sampled in 16 steps. */
.r-header::before {
  content: ""; position: absolute; inset: 0 0 -120px; z-index: -1; pointer-events: none;
  background: linear-gradient(to bottom, rgb(18 19 20 / 1) 0%, rgb(18 19 20 / 1) 38%, rgb(18 19 20 / 0.99) 41.9%, rgb(18 19 20 / 0.962) 45.8%,
    rgb(18 19 20 / 0.916) 49.6%, rgb(18 19 20 / 0.854) 53.5%, rgb(18 19 20 / 0.778) 57.4%, rgb(18 19 20 / 0.691) 61.3%, rgb(18 19 20 / 0.598) 65.1%,
    rgb(18 19 20 / 0.5) 69%, rgb(18 19 20 / 0.402) 72.9%, rgb(18 19 20 / 0.309) 76.8%, rgb(18 19 20 / 0.222) 80.6%, rgb(18 19 20 / 0.146) 84.5%,
    rgb(18 19 20 / 0.084) 88.4%, rgb(18 19 20 / 0.038) 92.3%, rgb(18 19 20 / 0.01) 96.1%, rgb(18 19 20 / 0) 100%);
}
.r-nav { --nav-pt: calc(24 * var(--u)); display: flex; justify-content: flex-end; gap: calc(24 * var(--u)); padding-top: var(--nav-pt); }
/* Slim state once the page is scrolled (sticky-header.js adds .is-slim): the buttons shrink to 80% toward the top right
   corner and move up by half their top gap; the fade behind them is squashed by the same proportion (73%: the bar's
   bottom edge goes from 24 + 66 to 12 + 66 x 0.8 design px), so it keeps its shape. Transforms only, so nothing reflows
   and the squircle paths stay valid. */
.r-nav { transform-origin: 100% 0; transition: scale 260ms ease, translate 260ms ease; }
.r-header::before { transform-origin: 50% 0; transition: scale 260ms ease; }
.r-header.is-slim .r-nav { scale: 0.8; translate: 0 calc(var(--nav-pt) * -0.3); }   /* the scale also shrinks the top padding to 0.8: 0.8 - 0.3 = half */
.r-header.is-slim::before { scale: 1 0.73; }
@media (prefers-reduced-motion: reduce) { .r-nav, .r-header::before { transition: none; } }

/* Grey divider: Work Gallery | Contact + Download */
.r-nav__sep { align-self: stretch; flex: none; width: 1px; opacity: 0.5; background: linear-gradient(to bottom, transparent, var(--muted) 50%, transparent); } /* same fade as .r-sep */

/* Hero */
.r-hero { width: min(100%, calc(1046 * var(--u))); margin: calc(187 * var(--u)) auto 0; padding-top: calc(18 * var(--u)); }
.r-hero__hello { width: calc(301 * var(--u)); height: auto; }
.r-hero__name { font-size: calc(52 * var(--u)); font-weight: 700; line-height: calc(77 * var(--u)); letter-spacing: -0.01em; }
.r-hero__tagline { margin-top: calc(95 * var(--u)); text-align: right; font-size: calc(36 * var(--u)); font-weight: 500; line-height: calc(55 * var(--u)); }
/* "at Porter" text-selection: tinted box, two carets, round handles (top-left / bottom-right) */
.r-hero__tagline .hl {
  position: relative; display: inline-block; height: 1.28em; line-height: 1.28em;
  padding: 0 0.25em 0 calc(3 * var(--u)); font-weight: 600; white-space: nowrap;
  background: rgba(38, 124, 253, 0.2);
}
.r-hero__tagline .hl::before, .r-hero__tagline .hl::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 2px; background: var(--blue-2);
}
.r-hero__tagline .hl::before { left: -1px; }
.r-hero__tagline .hl::after { right: -1px; }
.r-hero__tagline .hl > i { position: absolute; width: calc(20 * var(--u)); height: calc(20 * var(--u)); border-radius: 50%; background: var(--blue-2); }
.r-hero__tagline .hl > i:first-child { left: calc(-10 * var(--u)); top: calc(-10 * var(--u)); }
.r-hero__tagline .hl > i:last-child { right: calc(-10 * var(--u)); bottom: calc(-10 * var(--u)); }

/* Section titles */
.r-title { text-align: center; font-size: calc(20 * var(--u)); font-weight: 400; letter-spacing: calc(4 * var(--u)); text-transform: uppercase; color: #fcfcfd; line-height: calc(40 * var(--u)); }

/* Expertise */
.r-expertise { margin-top: calc(276 * var(--u)); }
/* divider pinned to the exact centre (under the section title); tags hug it from the left, icons from the right */
.r-expertise__row { display: grid; grid-template-columns: 1fr 1px 1fr; align-items: center; column-gap: calc(64 * var(--u)); min-height: calc(440 * var(--u)); margin-top: calc(36 * var(--u)); }
.r-expertise__row .r-tags { justify-self: end; }
.r-expertise__row .r-tools { justify-self: start; }
.r-tags { display: flex; flex-wrap: wrap; gap: calc(28.75 * var(--u)) calc(28 * var(--u)); width: calc(457 * var(--u)); }
/* tags grow to fill their row; --half pairs share a row equally, --fixed keep their natural width */
.r-tag { flex: 1 1 auto; padding: calc(20 * var(--u)); border-radius: calc(20 * var(--u)); background: var(--ink-2); text-align: center; font-size: calc(18 * var(--u)); line-height: calc(20 * var(--u)); white-space: nowrap; }
.r-tag--full { flex-basis: 100%; }
.r-tag--half { flex: 1 1 calc(180 * var(--u)); }
.r-tag--fixed { flex: none; }
.r-sep { align-self: stretch; width: 1px; background: linear-gradient(to bottom, transparent, var(--muted) 50%, transparent); }
/* each 150px cell has ~37px of glow space left of the visible key-cap; pull the grid in so the
   visible icons sit 64px from the divider, same as the tags on the left */
.r-tools { display: grid; grid-template-columns: repeat(3, calc(150 * var(--u))); gap: calc(20 * var(--u)) 0; margin-left: calc(-37 * var(--u)); }
.r-tool { display: flex; flex-direction: column; align-items: center; overflow: hidden; }
/* tool-*.svg are transparent Figma exports: a 90x85 key-cap plus 30px of soft glow on every side.
   Negative margins keep the key-cap in its 85px slot; the glow tucks under the label (as in Figma). */
.r-tool img { width: calc(150 * var(--u)); height: calc(145 * var(--u)); margin: calc(-30 * var(--u)) 0; }
.r-tool span { position: relative; font-size: calc(18 * var(--u)); font-weight: 300; line-height: calc(40 * var(--u)); color: var(--muted); text-align: center; }

/* Experience */
.r-experience { margin-top: calc(96 * var(--u)); }
.r-companies { display: flex; flex-direction: column; gap: calc(48 * var(--u)); margin-top: calc(76 * var(--u)); }
.r-company { position: relative; }
.r-company::before { /* timeline */
  content: ""; position: absolute; left: calc(17 * var(--u)); top: calc(75 * var(--u)); bottom: calc(17 * var(--u)); width: 2px;
  background: linear-gradient(to bottom, var(--blue) 5.7%, var(--line));
}
.r-company--past::before { top: calc(72 * var(--u)); bottom: calc(14 * var(--u)); background: var(--line); }
.r-company__head { display: flex; align-items: center; gap: calc(14 * var(--u)); }
.r-company__head img { width: calc(36 * var(--u)); height: calc(36 * var(--u)); border-radius: calc(8 * var(--u)); }
.r-company__head h3 { font-size: calc(24 * var(--u)); font-weight: 700; line-height: calc(24 * var(--u)); color: #fcfcfd; }

.r-roles { display: flex; flex-direction: column; gap: calc(26 * var(--u)); margin-top: calc(20 * var(--u)); padding-left: calc(10 * var(--u)); }
.r-role__head { display: flex; align-items: center; gap: calc(24 * var(--u)); }
.r-role__dot { position: relative; width: calc(16 * var(--u)); height: calc(16 * var(--u)); flex: none; border-radius: 50%; background: var(--blue); box-shadow: 0 0 6px 3px rgba(4, 69, 217, 0.55); }
.r-role--past .r-role__dot, .r-company--past .r-role__dot { background: var(--line); transform: scale(0.75); }
.r-role--past .r-role__dot { box-shadow: 0 0 6px 4px rgba(69, 71, 73, 0.4); }
.r-company--past .r-role__dot { box-shadow: none; }
.r-role__title { flex: 1; margin: 0; font-size: calc(24 * var(--u)); font-weight: 700; line-height: calc(24 * var(--u)); color: #fcfcfd; }
.r-role__date { font-size: calc(16 * var(--u)); font-weight: 300; letter-spacing: 2px; line-height: calc(24 * var(--u)); color: var(--muted); white-space: nowrap; }

.r-highlights { display: flex; flex-direction: column; gap: calc(24 * var(--u)); margin-top: calc(26 * var(--u)); padding-left: calc(4 * var(--u)); }
.r-hl__title { display: flex; align-items: baseline; gap: calc(27 * var(--u)); font-size: calc(20 * var(--u)); font-weight: 600; line-height: calc(24 * var(--u)); }
.r-hl__title::before { content: ""; width: calc(8 * var(--u)); height: calc(8 * var(--u)); flex: none; border-radius: 50%; background: var(--blue); transform: translateY(calc(-3 * var(--u))); }
.r-company--past .r-hl__title::before, .r-bullets li::before { background: var(--line); }
.r-hl__title em { margin-left: calc(8 * var(--u)); font-weight: 400; color: #ffe06f; }
.r-hl__desc { margin-top: calc(6 * var(--u)); padding-left: calc(35 * var(--u)); font-size: calc(18 * var(--u)); font-weight: 300; line-height: calc(24 * var(--u)); color: var(--muted); }

.r-bullets { display: flex; flex-direction: column; gap: calc(24 * var(--u)); margin-top: calc(26 * var(--u)); padding-left: calc(4 * var(--u)); }
.r-bullets li { position: relative; padding-left: calc(35 * var(--u)); font-size: calc(18 * var(--u)); font-weight: 300; line-height: calc(24 * var(--u)); color: var(--muted); }
.r-bullets li::before { content: ""; position: absolute; left: 0; top: calc(8 * var(--u)); width: calc(8 * var(--u)); height: calc(8 * var(--u)); border-radius: 50%; }

/* CTA */
.r-cta { margin: calc(64 * var(--u)) auto 0; padding-bottom: calc(93 * var(--u)); text-align: center; }
.r-cta p { margin-bottom: calc(12 * var(--u)); font-size: calc(24 * var(--u)); line-height: calc(48 * var(--u)); }
.r-cta p span { color: var(--yellow-2); }
.r-cta__btns { display: flex; justify-content: center; gap: calc(24 * var(--u)); }
.resume .btn__face { font-weight: 600; }   /* every resume button label is semi bold */

/* ---------- Responsive ---------- */
/* Desktop: same 1318px frame, 64px side margins and proportional scaling as the portfolio page. */
@media (min-width: 900px) {
  body.resume { --u: calc(min(100vw, 1318px) / 1318); }
  .r-wrap { width: calc(min(100%, 1318px) - 128 * var(--u)); }
  .resume .btn, .resume .btn::before { border-radius: calc(20 * var(--u)); }
  .resume .btn { padding-bottom: calc(6 * var(--u)); }
  .resume .btn::before { inset: calc(6 * var(--u)) 0 0 0; }
  .resume .btn__face {
    min-height: calc(60 * var(--u)); padding: calc(10 * var(--u)) calc(24 * var(--u)); gap: calc(12 * var(--u));
    border-radius: calc(20 * var(--u)); font-size: calc(20 * var(--u)); box-shadow: inset 0 0 0 calc(1.5 * var(--u)) var(--border);
  }
  .resume .btn--icon .btn__face { padding: calc(10 * var(--u)) calc(16 * var(--u)); }
  .resume .btn--caps .btn__face { letter-spacing: calc(2 * var(--u)); }
  .resume .btn__face img { width: calc(28 * var(--u)); height: calc(28 * var(--u)); }
  .resume .btn:hover .btn__face { transform: translateY(calc(-3 * var(--u))); }
  .resume .btn:active .btn__face { transform: translateY(calc(6 * var(--u))); }
  /* Reading text stops shrinking at a comfortable size. */
  .r-hl__desc, .r-bullets li { font-size: max(14px, calc(18 * var(--u))); line-height: max(20px, calc(24 * var(--u))); }
  .r-hl__title { font-size: max(15px, calc(20 * var(--u))); line-height: max(20px, calc(24 * var(--u))); }
  .r-role__date { font-size: max(12px, calc(16 * var(--u))); }
}
/* Mobile / tablet: switches at the same width as the portfolio page. */
@media (max-width: 899.98px) {
  .r-expertise__row { display: flex; flex-direction: column; align-items: center; gap: 40px; }
  .r-expertise__row .r-tags, .r-expertise__row .r-tools { justify-self: auto; }
  .r-sep { width: min(100%, 457px); height: 1px; align-self: center; background: linear-gradient(to right, transparent, var(--muted) 50%, transparent); }
  .r-nav { justify-content: center; gap: 12px; --nav-pt: 12px; transform-origin: 50% 0; }   /* centred: shrinks toward the top centre */
  /* Icon-only Contact, like the portfolio, so the bar is always one row. Labels stay for screen readers. */
  .r-nav__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .r-nav .btn--outline .btn__face { padding: 10px 16px; }
  .r-hero { margin-top: 72px; }
  .r-hero__hello { width: 200px; }
  .r-hero__name { font-size: 38px; }
  .r-hero__tagline { margin-top: 40px; text-align: left; font-size: 24px; line-height: 34px; }
  .r-hero__tagline br { display: none; }
  .r-hero__tagline .hl > i { width: 12px; height: 12px; }
  .r-hero__tagline .hl > i:first-child { left: -6px; top: -6px; }
  .r-hero__tagline .hl > i:last-child { right: -6px; bottom: -6px; }
  .r-expertise { margin-top: 96px; }
  .r-title { font-size: 16px; letter-spacing: 3px; }
  .r-tags { width: min(100%, 560px); gap: 12px; }
  .r-tag { padding: 14px 16px; font-size: 15px; border-radius: 14px; }
  .r-tag--half { flex-basis: 130px; }
  .r-tools { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 8px; width: min(100%, 560px); margin-left: 0; }
  .r-tool img { width: 104px; height: 100px; margin: -21px 0 -20px; }
  .r-tool span { font-size: 14px; line-height: 28px; }
  .r-experience { margin-top: 72px; }
  .r-roles { padding-left: 4px; }
  .r-role__head { flex-wrap: wrap; gap: 4px 16px; }
  .r-role__title { flex-basis: calc(100% - 40px); font-size: 19px; }
  .r-role__date { padding-left: 32px; font-size: 13px; letter-spacing: 1.5px; }
  .r-hl__title { flex-wrap: wrap; gap: 4px 20px; font-size: 17px; }
  .r-hl__title em { margin-left: 28px; flex-basis: 100%; font-size: 16px; }
  .r-hl__desc, .r-bullets li { padding-left: 28px; font-size: 15px; line-height: 22px; }
  .r-company::before { left: 17px; }
  .r-cta p { font-size: 18px; line-height: 30px; margin-bottom: 20px; }
  .r-cta__btns { flex-wrap: wrap; gap: 12px; }
}
@media (max-width: 640px) {
  .r-nav .btn--outline .btn__face { padding: 8px 12px; }
}
@media (max-width: 380px) {
  .r-nav { gap: 7px; }
  .r-nav .btn:not(.btn--outline) .btn__face { padding: 8px 12px; font-size: 13px; }
}
