/* Basic Reset */
html, body, div, section, header,
h1, h2, h3, p, a, img, ul, li, b, i {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline;
}

section, header { display: block; }
body { line-height: 1; }
ul { list-style: none; }

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

:root {
  --link-color: #8880b0;
  --link-color-secondary: #6f6698;
}

body {
  background: #f0f4f4;
  color: #5b5b5b;
  font-size: 12pt;
  line-height: 1.6em;
  font-family:
    -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    system-ui, "Segoe UI", Roboto, sans-serif;
  font-weight: 300;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Dark mode */
body.dark-mode { background: #0f0f0f; color: #e0e0e0; }
body.dark-mode .wrapper { background: #1a1a1a; }
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3 { color: #ffffff; }
body.dark-mode b { color: #ffffff; }
body.dark-mode p { color: #e0e0e0; }
body.dark-mode a { color: var(--link-color); }
body.dark-mode a:hover { color: var(--link-color-secondary); }
body.dark-mode #footer { background-color: #1a1a1a; }
body.dark-mode i b { color: #ffffff; font-weight: 425; font-style: italic; }
body.dark-mode .experience-date { color: #ccc; }

body.is-preload *,
body.is-preload *:before,
body.is-preload *:after {
  animation: none !important;
  transition: none !important;
}

h1, h2, h3 {
  font-weight: 500;
  color: #000000;
  line-height: 1.25em;
}
h1 { font-size: 1.8em; text-align: left; }
h2 { font-size: 1.3em; text-align: left; }
h3 { font-size: 1em; }

b { font-weight: 450; color: #000000; }
i b { font-style: italic; color: #000000; font-weight: 425; }
i { font-style: italic; }

a {
  color: var(--link-color);
  border-bottom: solid 1px rgba(128, 128, 128, 0.15);
  text-decoration: none;
  transition:
    background-color 0.35s ease-in-out,
    color 0.35s ease-in-out,
    border-bottom-color 0.35s ease-in-out;
}

a:hover {
  color: var(--link-color-secondary);
  border-bottom-color: transparent;
}

p {
  margin-bottom: 1em;
  text-align: left;
  color: #000000;
}

/* Container */
.container {
  margin: 0 auto;
  max-width: 100%;
  width: 1200px;
  padding: 0 80px;
}

@media screen and (max-width: 1680px) {
  .container { width: 1000px; padding: 0 64px; }
}

@media screen and (max-width: 1280px) {
  .container { width: 100%; padding: 0 64px; }
}

/* Row */
.row {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
}

.row > * { box-sizing: border-box; }
.row > .col-12 { width: 100%; }

/* Profile and Description Layout */
.profile {
  width: 28%;
  padding: 20px 30px 8px 0;
  margin-top: 2em;
  display: flex;
  align-items: center;
}

.description {
  width: 72%;
  padding: 20px 0 8px 30px;
}

.description p:last-child { margin-bottom: 0; }

.row:first-of-type { align-items: center; }

.container::after,
.row::after { content: ""; clear: both; display: table; }

/* Image */
.image {
  position: relative;
  display: inline-block;
  border: 0;
  outline: 0;
}
.image img { display: block; width: 100%; }

.image.featured {
  display: block;
  width: 100%;
  margin: 0 0 4em 0;
  border-radius: 12px;
  overflow: hidden;
}

.profile .image.featured {
  aspect-ratio: 2 / 3;
  max-width: 220px;
  margin-left: auto;
  margin-right: auto;
}

.profile .image.featured img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Sections */
section { margin-bottom: 1.5em; }
section > :last-child,
section:last-child { margin-bottom: 0; }
section.special > header { text-align: center; }
.row > section { margin-bottom: 0; }
header { margin: 0 0 1em 0; }

/* Icons */
ul.icons {
  position: relative;
  border-radius: 4em;
  display: inline-block;
  padding: 0.35em 0.75em;
  font-size: 1em;
  cursor: default;
}

ul.icons li {
  display: inline-block;
  margin: 0 0.4em;
}

ul.icons li a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  width: 1.6em;
  height: 1.6em;
  text-align: center;
  border-radius: 100%;
  border: 0;
  color: var(--link-color);
}

ul.icons li a:hover { color: var(--link-color-secondary); }

/* Wrapper */
.wrapper {
  background: #fff;
  margin: 0;
  padding: 3em 0 1em 0;
  transition: background-color 0.3s ease;
}

.space {
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
}

.row:first-of-type + .space { margin-top: 0.3rem; }

.emailspace { margin-bottom: 2%; }

/* Contact */
.contact { text-align: center; }
.contact p { text-align: center; }

/* Theme Toggle */
.theme-toggle {
  position: fixed;
  top: 15px;
  right: 15px;
  background: transparent;
  border: none;
  width: 28px;
  height: 28px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  z-index: 1000;
  padding: 0;
  transition: transform 0.2s ease;
  color: inherit;
}

.theme-toggle:hover { transform: scale(1.15); }

/* Experience */
.experience-item {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 1.25em;
  align-items: center;
  margin-bottom: 0.6em;
  padding: 0.2em 0;
}

.experience-content { grid-column: 1; }

.experience-content p {
  margin-bottom: 0;
  line-height: 1.35;
}

.experience-content p:last-child { margin-bottom: 0; }

.experience-date {
  grid-column: 2;
  justify-self: end;
  text-align: right;
  font-weight: 300;
  color: #666;
  margin: 0 !important;
  line-height: 1.35;
}

.experience-role {
  margin-top: 0.1em;
  line-height: 1.35;
}

/* Link pills */
.link-pills {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35em;
  margin-left: 0.2em;
  vertical-align: middle;
  font-size: inherit;
}

.link-pill {
  display: inline-block;
  padding: 0.01em 0.45em;
  border: 1px solid rgba(128, 128, 128, 0.55);
  border-radius: 0.45em;
  font-size: 0.9em;
  line-height: 1.4;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.link-pill:hover {
  border-color: var(--link-color);
  background-color: rgba(136, 128, 176, 0.15);
}

body.dark-mode .link-pill:hover {
  background-color: rgba(136, 128, 176, 0.2);
}

/* Footer */
#footer {
  position: relative;
  overflow: hidden;
  padding: 1em 0;
  background-color: #fff;
  transition: background-color 0.3s ease;
}

#footer header { text-align: center; cursor: default; }

/* Responsive */
@media screen and (max-width: 1280px) {
  body { font-size: 10.5pt; line-height: 1.5em; }
  .wrapper { padding-left: 2em; padding-right: 2em; }
  #footer { padding-left: 2em; padding-right: 2em; }
}

@media screen and (max-width: 840px) {
  body { font-size: 11pt; line-height: 1.55em; }
  .container { padding: 0 40px; }
  #footer { padding: 2em 2em; }
}

@media screen and (max-width: 736px) {
  html, body { overflow-x: hidden; }
  body { font-size: 11pt; line-height: 1.45em; }
  h2 { font-size: 1.4em; }
  h3 { font-size: 1.1em; }
  section { margin-bottom: 2em; }
  section:last-child { margin-bottom: 0; }
  .row > section { margin-bottom: 2em; }
  .row:first-of-type + .space { margin-top: 1.1rem; }
  .image.featured { margin: 0 0 0.25em 0; }
  ul.icons { font-size: 1em; padding: 0.35em 0.5em; }

  .wrapper { padding: 3em 1em 3em 1em; }
  #footer { padding: 1.5em 1em; }

  .row:first-of-type { display: block; }

  .profile {
    float: left;
    width: 38%;
    max-width: 220px;
    margin: 0 16px 8px 0;
    padding: 0;
  }

  .description {
    width: auto;
    margin: 0;
    padding: 0;
  }

  .experience-item {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    align-items: start;
  }

  .experience-date {
    grid-column: 1;
    grid-row: 2;
    justify-self: start;
    text-align: left;
    margin-top: 0.15em !important;
  }

  .container {
    width: 90% !important;
    max-width: 90% !important;
    margin: 0 auto !important;
    padding: 0 !important;
  }
}

@media screen and (max-width: 420px) {
  .profile { width: 32%; max-width: 180px; margin: 0 12px 8px 0; }
}
