/* Tim Phelps resume site. Engraved-letterhead look: deeper warm paper,
   rich navy ink, oxidized copper. Display type is Source Serif 4 (sturdy,
   conventional ampersands); text is its companion Source Sans 3.
   Hierarchy comes from the serif/sans contrast, weight, and letter-spacing,
   like a finely set printed letterhead. Layout and copy are frozen. */

:root {
  --paper: #f5f1e6;
  --paper-deep: #ebe4d3;
  --ink: #172136;
  --ink-soft: #3f4a63;
  --ink-faint: #656c82;
  --accent: #9a4516;
  --accent-soft: #d3bda3;
  --rule: #d8ccb4;
  --card: #fcfaf4;
  --max: 61rem;
  --serif: "Source Serif 4", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --shadow-card: 0 1px 2px rgba(23, 33, 54, 0.04), 0 10px 26px -20px rgba(23, 33, 54, 0.22);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(120rem 60rem at 85% -10%, #fbf7ec 0%, transparent 55%),
    var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0rem;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

/* Faint paper grain, laid over everything like stock texture. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.045;
  mix-blend-mode: multiply;
}

::selection { background: var(--ink); color: var(--paper); }

.page {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent-soft);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  transition: color 150ms ease, text-decoration-color 150ms ease;
}
a:hover { color: #7d370f; text-decoration-color: var(--accent); }

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

/* ------------------------------------------------ masthead */
.masthead {
  padding: 3.75rem 0 2rem;
  border-bottom: 3px solid var(--ink);
  position: relative;
}

/* Classic thick-thin letterhead rule under the masthead. */
.masthead::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 1px;
  background: var(--ink);
  opacity: 0.5;
}

.kicker {
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}

.kicker::before {
  content: "";
  display: inline-block;
  width: 1.6rem;
  height: 2px;
  background: var(--accent);
  vertical-align: 0.22em;
  margin-right: 0.65rem;
}

.masthead h1 {
  margin: 0;
  font-family: var(--serif);
  font-optical-sizing: none;
  font-weight: 700;
  font-size: clamp(2.5rem, 6.6vw, 3.9rem);
  line-height: 1.08;
  letter-spacing: -0.012em;
}

.subtitle {
  margin: 0.8rem 0 0;
  font-family: var(--serif);
  font-optical-sizing: none;
  font-size: clamp(1.1rem, 2.6vw, 1.35rem);
  font-weight: 400;
  letter-spacing: 0.002em;
  color: var(--ink-soft);
}

.subtitle-item { display: none; }
body[data-track="growth"] .subtitle-item[data-subtitle="growth"],
body[data-track="product"] .subtitle-item[data-subtitle="product"],
body[data-track="systems"] .subtitle-item[data-subtitle="systems"] { display: inline; }

/* ------------------------------------------------ track switcher */
/* A whisper, tucked into the top margin. Text links, no buttons. */
.tracks {
  position: absolute;
  top: 0.7rem;
  right: 0;
}

.tablist {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.tab {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--ink-faint);
  font: 500 0.78rem/1.5 var(--sans);
  letter-spacing: 0.05em;
  padding: 0.1rem 0;
  cursor: pointer;
  transition: color 140ms ease, text-decoration-color 140ms ease;
  text-decoration: none;
  text-underline-offset: 0.35em;
}

.tab + .tab {
  margin-left: 0.85rem;
  padding-left: 0.85rem;
  border-left: 1px solid var(--rule);
}

.tab:hover {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--accent);
}

.tab[aria-selected="true"] {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--accent);
}

.tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ------------------------------------------------ panes */
.pane { display: none; }
body[data-track="growth"] .pane[data-pane="growth"],
body[data-track="product"] .pane[data-pane="product"],
body[data-track="systems"] .pane[data-pane="systems"] { display: block; }

.summary { padding: 1.8rem 0 0.5rem; }

.lede {
  margin: 0;
  font-family: var(--serif);
  font-optical-sizing: none;
  font-size: clamp(1.06rem, 2.4vw, 1.22rem);
  line-height: 1.6;
  font-weight: 400;
  max-width: 52rem;
}

h2 {
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 2.2rem 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

h2::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule);
}

/* competencies */
.chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chips li {
  background: var(--card);
  border: 1px solid var(--rule);
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 500;
  letter-spacing: 0.012em;
  padding: 0.38rem 0.8rem;
  border-radius: 4px;
  box-shadow: 0 1px 0 rgba(23, 33, 54, 0.04);
}

/* experience */
.position {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 1.6rem 1.8rem 1.35rem;
  margin: 0 0 1.25rem;
  box-shadow: var(--shadow-card);
}

.position-head {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.9rem;
  margin-bottom: 0.9rem;
}

.position-head h3 {
  margin: 0;
  font-family: var(--serif);
  font-optical-sizing: none;
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: 0;
}

.position-meta {
  margin: 0.2rem 0 0;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
}

.roles { text-align: right; min-width: 16rem; flex: 1; }

.role { margin: 0 0 0.3rem; }
.role:last-child { margin-bottom: 0; }

.role-title {
  display: block;
  font-weight: 600;
  font-size: 0.94rem;
}

.role-dates {
  display: block;
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.bullets {
  margin: 0;
  padding: 0 0 0 1.1rem;
}

.bullets li {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
}

.bullets li::marker { color: var(--accent); font-size: 0.9em; }

/* ------------------------------------------------ aside + footer */
.alsobar {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 2.5rem;
  border-top: 3px solid var(--ink);
  margin-top: 2.8rem;
}

.aside-item h3 {
  margin: 0 0 0.25rem;
  font-family: var(--serif);
  font-optical-sizing: none;
  font-size: 1.04rem;
  font-weight: 600;
}

.aside-item { margin-bottom: 1.3rem; }
.aside-item p { margin: 0; font-size: 0.92rem; color: var(--ink-soft); }

.plain {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
}

.plain li {
  font-size: 0.92rem;
  margin-bottom: 0.45rem;
  color: var(--ink-soft);
}

.plain strong { color: var(--ink); font-weight: 600; }

.colophon {
  margin-top: 2.5rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--rule);
  font-size: 0.85rem;
  letter-spacing: 0.01em;
  color: var(--ink-soft);
}

/* ------------------------------------------------ responsive */
@media (max-width: 700px) {
  .masthead { padding-top: 2.8rem; }
  .tracks { position: static; margin: 1.5rem 0 0; }
  .tablist { justify-content: flex-start; }
  .position { padding: 1.25rem 1.2rem 1.05rem; }
  .position-head { flex-direction: column; gap: 0.5rem; }
  .roles { text-align: left; min-width: 0; }
  .alsobar { grid-template-columns: 1fr; gap: 0.5rem; }
}

/* ------------------------------------------------ reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  a, .tab { transition: none; }
}

/* ------------------------------------------------ print: clean paper resume */
@media print {
  :root { --paper: #fff; --card: #fff; --paper-deep: #fff; }
  body { background: #fff; font-size: 10.5pt; line-height: 1.4; }
  body::before { display: none; }
  .page { max-width: 100%; padding: 0; }
  .tracks, .colophon { display: none; }
  .masthead { padding: 0 0 0.8rem; border-bottom-width: 2px; }
  .masthead::after { display: none; }
  .masthead h1 { font-size: 24pt; }
  .subtitle { font-size: 13pt; margin-top: 0.3rem; }
  .kicker::before { display: none; }
  a { color: var(--ink); text-decoration: none; }
  .summary { padding-top: 0.8rem; }
  .lede { font-size: 11pt; }
  h2 { margin: 1.1rem 0 0.5rem; }
  .chips li { border: 1px solid #999; box-shadow: none; padding: 0.15rem 0.5rem; font-size: 8.5pt; }
  .position {
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0 0 0.4rem;
    margin-bottom: 0.7rem;
    border-bottom: 1px solid #ddd;
    break-inside: avoid;
  }
  .position-head { border-bottom: none; padding-bottom: 0.2rem; margin-bottom: 0.2rem; }
  .bullets li { font-size: 10pt; margin-bottom: 0.2rem; }
  .alsobar { margin-top: 0.8rem; border-top-width: 2px; gap: 1.2rem; }
}
