/* jeroenstorm.com — warm paper, dark grey ink, Lato */

:root {
  --paper: #FAF8F3;
  --ink: #2B2A27;
  --ink-soft: #45433E;
  --muted: #6F6B63;
  --faint: #8A857B;
  --rule: #DDD7CC;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --slow: 1100ms;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: #E9E2D4;
}

a {
  color: inherit;
}

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

/* Layout */

.site-header,
main {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding-left: 32px;
  padding-right: 32px;
}

main {
  padding-bottom: 112px;
}

/* Header */

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 32px;
  padding-bottom: 32px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.site-name {
  font-weight: 700;
  text-decoration: none;
}

.site-nav {
  display: flex;
  gap: 28px;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  transition: color 400ms var(--ease);
}

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

/* Intro */

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px;
  gap: 56px;
  align-items: center;
  padding-top: 72px;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 1.4rem + 2.4vw, 2.75rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.lead {
  margin: 20px 0 0;
  max-width: 34em;
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink-soft);
}

.meta {
  margin: 14px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.portrait {
  display: block;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  background: #ECE7DE;
}

/* Thin lines */

.rule {
  height: 1px;
  margin: 72px 0 48px;
  border: 0;
  background: var(--rule);
  transform-origin: left center;
}

/* Sections */

h2 {
  margin: 0 0 28px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.entry + .entry {
  margin-top: 32px;
}

.entry-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  column-gap: 16px;
}

h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
}

.years {
  font-size: 13px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.role {
  margin: 4px 0 0;
  font-size: 15px;
  color: var(--ink);
}

.role + .role {
  margin-top: 2px;
}

.role .when {
  margin-left: 8px;
  font-size: 13px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.desc {
  margin: 6px 0 0;
  max-width: 40em;
  font-size: 15px;
  line-height: 1.7;
  color: var(--muted);
}

/* Contact */

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 36px;
  margin: 0;
  font-size: 16px;
}

.links a {
  text-decoration: none;
  padding-bottom: 3px;
  background-image: linear-gradient(var(--ink), var(--ink));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% 1px;
  transition: background-size 600ms var(--ease), color 400ms var(--ease);
}

.links a:hover {
  background-size: 0% 1px;
  background-position: 100% 100%;
}

/* Motion: a slow, quiet build-up. Nothing moves for people who ask for reduced motion. */

@media (prefers-reduced-motion: no-preference) {

  @keyframes rise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
  }

  @keyframes settle {
    from { opacity: 0; transform: scale(0.97); }
    to   { opacity: 1; transform: none; }
  }

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

  .load {
    animation: rise var(--slow) var(--ease) both;
    animation-delay: var(--d, 0ms);
  }

  .load-soft {
    animation: settle 1400ms var(--ease) both;
    animation-delay: var(--d, 0ms);
  }

  .load-rule {
    animation: draw 1400ms var(--ease) both;
    animation-delay: var(--d, 0ms);
  }

  /* Below the fold: only hidden when JavaScript runs, so the page never stays empty. */

  .js .reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity var(--slow) var(--ease), transform var(--slow) var(--ease);
    transition-delay: var(--d, 0ms);
  }

  .js .reveal-rule {
    transform: scaleX(0);
    transition: transform 1400ms var(--ease);
  }

  .js .reveal.is-visible,
  .js .reveal-rule.is-visible {
    opacity: 1;
    transform: none;
  }
}

/* Small screens */

@media (max-width: 640px) {
  .site-header,
  main {
    padding-left: 20px;
    padding-right: 20px;
  }

  .site-header {
    padding-top: 24px;
    padding-bottom: 24px;
  }

  .site-nav {
    gap: 20px;
  }

  .intro {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-top: 40px;
  }

  .portrait {
    width: 112px;
    height: 112px;
    grid-row: 1;
  }

  .rule {
    margin: 56px 0 40px;
  }

  .years {
    margin-top: 2px;
  }
}

/* Portfolio page (/portfolio) */

.pf-intro {
  padding-top: 72px;
}

.pf-intro .lead {
  margin-top: 16px;
}

.button {
  display: inline-block;
  margin-top: 12px;
  padding: 12px 22px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-size: 14px;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: background-color 500ms var(--ease), color 500ms var(--ease);
}

.button:hover {
  background: var(--ink);
  color: var(--paper);
}

.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 48px 32px;
}

.card {
  display: block;
  text-decoration: none;
}

.card-img {
  display: flex;
  align-items: flex-end;
  aspect-ratio: 16 / 10;
  padding: 16px 18px;
  border: 1px solid #E6E0D5;
  border-radius: 10px;
  background: #EFEBE3;
  transition: border-color 700ms var(--ease), transform 700ms var(--ease);
}

.card:hover .card-img {
  border-color: #D3CABA;
}

.card-num,
.case-num {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--faint);
}

.card-title {
  display: block;
  margin-top: 16px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
}

.card-role {
  display: block;
  margin-top: 4px;
  font-size: 14px;
}

.card-line {
  display: block;
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}

.case-num {
  margin: 0 0 12px;
}

h2.case-title {
  margin: 0;
  font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.1rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-transform: none;
}

.case-sub {
  margin: 8px 0 0;
  font-size: 17px;
  color: var(--ink-soft);
}

.case-lead {
  margin: 20px 0 0;
  max-width: 38em;
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink-soft);
}

.tags {
  margin: 16px 0 0;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}

.case-body {
  margin: 40px 0 0;
}

.row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 24px;
}

.row + .row {
  margin-top: 28px;
}

.row dt {
  padding-top: 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.row dd {
  margin: 0;
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-soft);
}

.row dd p {
  margin: 0;
}

.row dd p + p {
  margin-top: 12px;
}

.row ol {
  margin: 0;
  padding-left: 1.2em;
}

.row li + li {
  margin-top: 10px;
}

.row li strong {
  color: var(--ink);
}

.artifact {
  margin: 40px 0 0;
}

.artifact-img {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 9;
  padding: 24px;
  border: 1px solid #E6E0D5;
  border-radius: 10px;
  background: #EFEBE3;
  font-size: 13px;
  text-align: center;
  color: var(--faint);
}

.artifact-img img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
}

.artifact figcaption {
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
}

/* Placeholder text until the content chat delivers the copy */
.tbd {
  font-style: italic;
  color: var(--faint);
}

@media (prefers-reduced-motion: no-preference) {
  .card:hover .card-img {
    transform: translateY(-3px);
  }
}

@media (max-width: 640px) {
  .pf-intro {
    padding-top: 40px;
  }

  .cards {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

/* Side projects page (/side-projects) */

.lead a {
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-decoration-thickness: 1.5px;
  text-decoration-color: var(--rule);
  text-underline-offset: 5px;
  transition: text-decoration-color 400ms var(--ease);
}

.lead a:hover {
  text-decoration-color: var(--muted);
}

/* App Store-style card: icon left, text right */
.app-card {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.app-icon {
  width: 96px;
  height: 96px;
  overflow: hidden;
  border-radius: 22.5%;
  box-shadow: 0 0 0 1px rgba(43, 42, 39, 0.08);
}

.app-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* trims the light rim that is baked into the App Store artwork */
  transform: scale(1.08);
}

h2.app-title {
  margin: 4px 0 0;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: 0;
  text-transform: none;
}

.app-sub {
  margin: 8px 0 0;
  max-width: 34em;
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink-soft);
}

/* Row of App Store screenshots under the card, scrolls sideways */
.screens {
  grid-column: 1 / -1;
  display: flex;
  gap: 14px;
  margin-top: 16px;
  padding-bottom: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: var(--rule) transparent;
  -webkit-overflow-scrolling: touch;
}

.screens:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
  border-radius: 4px;
}

/* Two and a half screenshots in view at any width; the half one hints at the sideways scroll */
.screens img {
  flex: 0 0 calc((100% - 2 * 14px) / 2.5);
  width: calc((100% - 2 * 14px) / 2.5);
  height: auto;
  border-radius: 18px;
  background: #EFEBE3;
  box-shadow: 0 0 0 1px rgba(43, 42, 39, 0.06);
  scroll-snap-align: start;
}

.project-body {
  margin: 14px 0 28px;
  max-width: 34em;
  font-size: 15px;
  line-height: 1.7;
  color: var(--muted);
}

@media (max-width: 640px) {
  .app-card {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 20px;
  }

  .app-icon {
    width: 72px;
    height: 72px;
  }

  h2.app-title {
    margin-top: 0;
  }
}

/* Little Lines: screenshots on top, text underneath */
.project-stack .screens {
  margin: 0 0 32px;
}

.project-stack h2.app-title {
  margin-top: 0;
}
