/* jamespupalaikis.com
   one stylesheet, no build step */


/* tokens */

:root {
  --paper: #ffffff;
  --paper-alt: #f6fafb;
  --ink: #111315;
  --ink-muted: #5a6570;
  /* two blues. the pale one fails contrast on text, so it's decoration only */
  --accent-ink: #1f6b83;
  --accent: #7fc4d9;
  --rule: #e3eaec;

  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua",
           "Times New Roman", Times, serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", Menlo,
          Consolas, monospace;

  --measure: 68ch;
  --wrap: 46rem;
  --wrap-wide: 60rem;
}


/* base */

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

body, h1, h2, h3, h4, p, ul, ol, figure, blockquote, dl, dd {
  margin: 0;
  padding: 0;
}

ul, ol { list-style: none; }

img {
  display: block;
  max-width: 100%;
  height: auto;
}

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

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a:focus-visible,
summary:focus-visible,
.dialog-toggle:focus-visible + label,
label:focus-visible {
  outline: 2px solid var(--accent-ink);
  outline-offset: 3px;
  border-radius: 2px;
}


/* type */

h1, h2, h3, h4 {
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

h1 { font-size: 2.6rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.2rem; }

p { max-width: var(--measure); }

p + p { margin-top: 1.1em; }

a {
  color: var(--accent-ink);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

a:hover { border-bottom-color: var(--accent-ink); }

strong { font-weight: 700; }
em { font-style: italic; }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 0.75rem;
}

.lede {
  font-size: 1.2rem;
  line-height: 1.6;
  color: var(--ink-muted);
}

.rule {
  width: 3.5rem;
  height: 2px;
  background: var(--accent);
  border: 0;
  margin: 1.75rem 0;
}


/* layout */

.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.wrap-wide {
  max-width: var(--wrap-wide);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.section { padding-block: 3.5rem; }

/* tint spans the viewport, content stays wrapped */
.band {
  background: var(--paper-alt);
  border-block: 1px solid var(--rule);
}


/* nav + footer */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--paper);
  color: var(--ink);
  padding: 0.6rem 1rem;
  border: 1px solid var(--accent-ink);
  border-bottom-right-radius: 3px;
}

.skip-link:focus { left: 0; }

.site-nav {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}

.site-nav-inner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding-block: 1.15rem;
}

.site-nav-name {
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  color: var(--ink);
  border-bottom: 0;
}

.site-nav-name:hover { color: var(--accent-ink); }

.site-nav-links {
  display: flex;
  gap: 1.75rem;
  font-size: 0.95rem;
}

.site-nav-links a {
  color: var(--ink);
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
}

.site-nav-links a:hover { border-bottom-color: var(--accent); }

.site-nav-links a[aria-current="page"] {
  color: var(--accent-ink);
  border-bottom-color: var(--accent-ink);
}

.site-footer {
  margin-top: 4rem;
  border-top: 1px solid var(--rule);
  background: var(--paper-alt);
  padding-block: 2.5rem;
  font-size: 0.85rem;
  line-height: 1.65;
  color: var(--ink-muted);
}

.site-footer p { max-width: 60ch; }
.site-footer p + p { margin-top: 0.55em; }

.footer-fine {
  margin-top: 1.5rem !important;
  font-size: 0.78rem;
  opacity: 0.85;
}

.site-footer a {
  color: var(--ink-muted);
  border-bottom-color: var(--rule);
}

.site-footer a:hover {
  color: var(--accent-ink);
  border-bottom-color: var(--accent);
}


/* home */

/* text sits under the banner, never on it. stays legible at any width */
.banner {
  width: 100%;
  height: 320px;
  object-fit: cover;
  object-position: center 62%;
  background: #000;
  border-bottom: 1px solid var(--rule);
}

.masthead { padding-top: 3.25rem; }

.masthead h1 { letter-spacing: -0.02em; }

.masthead .tagline {
  margin-top: 0.6rem;
  font-size: 1.15rem;
  font-style: italic;
  color: var(--ink-muted);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.card {
  display: block;
  border: 1px solid var(--rule);
  border-top: 2px solid var(--rule);
  padding: 1.25rem 1.35rem 1.4rem;
  color: var(--ink);
  background: var(--paper);
  transition: border-top-color 0.18s ease, background-color 0.18s ease;
}

.card:hover {
  border-top-color: var(--accent);
  background: var(--paper-alt);
}

.card-title {
  font-size: 1.1rem;
  color: var(--accent-ink);
}

.card-desc {
  margin-top: 0.4rem;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--ink-muted);
  max-width: none;
}


/* contact */

.button-stack {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 2rem;
  max-width: 34rem;
}

/* same look whether it's an <a> or the <label> driving the dialog */
.button-block {
  display: block;
  position: relative;
  border: 1px solid var(--rule);
  border-left: 2px solid var(--accent);
  background: var(--paper);
  padding: 1.1rem 3rem 1.15rem 1.35rem;
  color: var(--ink);
  cursor: pointer;
  transition: border-left-color 0.18s ease, background-color 0.18s ease;
}

.button-block:hover {
  border-left-color: var(--accent-ink);
  background: var(--paper-alt);
}

.button-label {
  display: block;
  font-size: 1.1rem;
  color: var(--accent-ink);
}

.button-desc {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--ink-muted);
}

.button-block::after {
  content: "";
  position: absolute;
  right: 1.4rem;
  top: 50%;
  width: 0.5rem;
  height: 0.5rem;
  margin-top: -0.3rem;
  border-right: 1.5px solid var(--accent-ink);
  border-top: 1.5px solid var(--accent-ink);
  transform: rotate(45deg);
  transition: transform 0.18s ease;
}

.button-block:hover::after {
  transform: rotate(45deg) translate(2px, -2px);
}

/* dialog, driven by the checkbox above it in the markup.
   no js, so it can't trap focus or close on esc. not marked role=dialog
   for that reason */

.dialog-toggle {
  /* opacity, not display:none, or it drops out of the tab order */
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  margin: 0;
}

.dialog-scrim {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(17, 19, 21, 0.45);
  opacity: 0;
  /* visibility so it can fade out, and so the card leaves the tab order */
  visibility: hidden;
  transition: opacity 0.18s ease, visibility 0s linear 0.18s;
}

.dialog-toggle:checked ~ .dialog-scrim {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.18s ease, visibility 0s;
}

/* sits behind the card, catches click-outside */
.dialog-close-area {
  position: absolute;
  inset: 0;
  cursor: default;
}

.dialog-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 30rem;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--accent);
  padding: 2rem 2rem 1.75rem;
  box-shadow: 0 18px 50px rgba(17, 19, 21, 0.18);
  transform: translateY(8px);
  transition: transform 0.18s ease;
}

.dialog-toggle:checked ~ .dialog-scrim .dialog-card {
  transform: none;
}

.dialog-dismiss {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  font-size: 1.5rem;
  line-height: 1;
  padding: 0.25rem 0.4rem;
  color: var(--ink-muted);
  cursor: pointer;
}

.dialog-dismiss:hover { color: var(--ink); }

/* plain text, not a mailto. that's the point */
.email-address {
  font-family: var(--mono);
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  text-align: center;
  padding: 0.9rem 1rem;
  margin: 0.5rem 0 1.5rem;
  background: var(--paper-alt);
  border: 1px solid var(--rule);
  color: var(--ink);
  user-select: all;
  overflow-wrap: anywhere;
}

.dialog-note {
  font-size: 0.95rem;
  line-height: 1.6;
}

.dialog-subnote {
  margin-top: 0.9rem !important;
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--ink-muted);
}

.dialog-close-button {
  display: inline-block;
  margin-top: 1.5rem;
  padding: 0.5rem 1.4rem;
  font-size: 0.9rem;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

.dialog-close-button:hover {
  border-color: var(--accent);
  background: var(--paper-alt);
}


/* resume */

.resume-grid {
  display: grid;
  grid-template-columns: 1fr 16rem;
  gap: 3.5rem;
  align-items: start;
}

.entry { border-top: 1px solid var(--rule); }

.entry:last-of-type { border-bottom: 1px solid var(--rule); }

.entry > summary {
  position: relative;
  display: block;
  list-style: none;
  cursor: pointer;
  padding: 1.35rem 2.5rem 1.35rem 0;
  transition: background-color 0.15s ease;
}

/* kill the default triangle everywhere */
.entry > summary::-webkit-details-marker { display: none; }
.entry > summary::marker { content: ""; }

.entry > summary:hover { background: var(--paper-alt); }

/* chevron */
.entry > summary::after {
  content: "";
  position: absolute;
  right: 0.85rem;
  top: 1.85rem;
  width: 0.5rem;
  height: 0.5rem;
  border-right: 1.5px solid var(--accent-ink);
  border-bottom: 1.5px solid var(--accent-ink);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.entry[open] > summary::after {
  transform: rotate(-135deg);
  top: 2.05rem;
}

.entry-title {
  display: block;
  font-size: 1.2rem;
  font-weight: 700;
}

/* spans, not <p>. summary only takes phrasing content */
.entry-meta {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.9rem;
  color: var(--ink-muted);
}

.entry-lede {
  display: block;
  margin-top: 0.5rem;
  font-style: italic;
  font-size: 0.97rem;
  line-height: 1.6;
  color: var(--ink-muted);
  max-width: var(--measure);
}

.entry-body { padding: 0 2.5rem 1.75rem 0; }

.entry-body ul { max-width: var(--measure); }

.entry-body li {
  position: relative;
  padding-left: 1.25rem;
  margin-top: 0.6rem;
  font-size: 0.97rem;
  line-height: 1.65;
}

.entry-body li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 5px;
  height: 5px;
  background: var(--accent);
}

.aside-block + .aside-block { margin-top: 2.25rem; }

.aside-block h2 {
  font-size: 1.15rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent);
  margin-bottom: 0.9rem;
}

.aside-block p {
  font-size: 0.92rem;
  line-height: 1.6;
}

.skill-group + .skill-group { margin-top: 1.1rem; }

.skill-group-label {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 0.45rem;
}

/* li in the sidebar, span inside a summary */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tags > li,
.tags > span {
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.4;
  padding: 0.22rem 0.5rem;
  background: var(--paper-alt);
  border: 1px solid var(--rule);
  color: var(--ink);
  white-space: nowrap;
}

.project {
  border: 1px solid var(--rule);
  border-top: 2px solid var(--rule);
  background: var(--paper);
  margin-top: 1rem;
  transition: border-top-color 0.18s ease;
}

.project:hover { border-top-color: var(--accent); }

.project > summary { padding: 1.25rem 2.5rem 1.3rem 1.35rem; }

.project > summary::after {
  right: 1.25rem;
  top: 1.75rem;
}

.project[open] > summary::after { top: 1.95rem; }

.project .entry-body { padding: 0 1.35rem 1.5rem; }

.project .tags { margin-top: 0.7rem; }


/* small screens */

@media (max-width: 760px) {
  h1 { font-size: 2.1rem; }
  h2 { font-size: 1.4rem; }

  .banner { height: 190px; }

  .section { padding-block: 2.5rem; }

  .site-nav-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .site-nav-links { gap: 1.4rem; }

  .resume-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .dialog-card { padding: 1.75rem 1.35rem 1.5rem; }
}

@media (max-width: 420px) {
  body { font-size: 1rem; }
  h1 { font-size: 1.8rem; }
  .banner { height: 150px; }
  .email-address { font-size: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}


/* print */

@media print {
  .skip-link,
  .site-nav,
  .site-footer,
  .banner {
    display: none !important;
  }

  body {
    font-size: 10.5pt;
    line-height: 1.45;
    color: #000;
    background: #fff;
  }

  .section { padding-block: 0; }

  .wrap, .wrap-wide {
    max-width: none;
    padding-inline: 0;
  }

  .resume-grid {
    grid-template-columns: 1fr 15rem;
    gap: 2rem;
  }

  a { color: #000; border-bottom: 0; }

  .entry > summary::after,
  .project > summary::after { display: none; }

  .entry > summary {
    padding-right: 0;
    cursor: auto;
  }

  .entry-body { padding-bottom: 0.9rem; }

  /* tries to print collapsed sections. chromium honors it, others may not.
     worst case they print as just the summary */
  details:not([open]) > *:not(summary) { display: block !important; }
  details { content-visibility: visible !important; }
}
