/* Reset https://piccalil.li/blog/a-modern-css-reset/ */
/* Box sizing rules */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Remove default margin */
body,
h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

/* Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed */
ul[role=list],
ol[role=list] {
  list-style: none;
}

/* Set core root defaults */
html:focus-within {
  scroll-behavior: smooth;
}

/* Set core body defaults */
body {
  min-height: 100vh;
  text-rendering: optimizeSpeed;
  line-height: 1.5;
}

/* A elements that don't have a class get default styles */
a:not([class]) {
  text-decoration-skip-ink: auto;
}

/* Make images easier to work with */
img,
picture,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Inherit fonts for inputs and buttons */
input,
button,
textarea,
select {
  font: inherit;
}

/* Remove all animations, transitions and smooth scroll for people that prefer not to see them */
@media (prefers-reduced-motion: reduce) {
  html:focus-within {
    scroll-behavior: auto;
  }

  *,
*::before,
*::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
:root {
  --color-text: #252525;
  --color-bg: #f3f3f3;
  --size-300: 0.8rem;
  --size-400: 1rem;
  --size-500: 1.2rem;
  --size-600: 1.4rem;
  --size-700: 1.6rem;
  --size-800: 1.8rem;
  --size-900: 2rem;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
  font-family: sytem-ui, sans-serif;
  padding: 2rem 0;
}

ol, ol {
  list-style-position: inside;
}

img {
  vertical-align: middle;
}

a {
  color: currentColor;
}

[href]:hover {
  text-decoration: none;
}

h1,
h2,
h3,
h4 {
  line-height: 1.3;
}

h1,
h2 {
  font-weight: 600;
}

h1 {
  font-size: var(--size-700);
}

h2 {
  font-size: var(--size-500);
}

h3 {
  font-size: var(--size-500);
}

iframe {
  border: none;
}

pre {
  white-space: pre-wrap;
}

main {
  max-width: 62ch;
  margin: 0 auto;
}

.card {
  background-color: white;
  overflow: hidden;
  padding: 1.5rem 1.25rem 0.625rem 1.25rem;
}

.browser-card {
  border: 2px solid rgba(46, 42, 26, 0.9);
  border-radius: 2px;
  box-shadow: 2px 2px 1px rgba(46, 42, 26, 0.1);
}

.browser-card-header {
  background-color: rgb(46, 42, 26);
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
}

.browser-card-url {
  color: white;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  text-align: center;
  display: block;
  width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin: 0 auto;
  padding: 0.2em 1em 0.2em 0.5em;
  font-size: 13px;
  text-decoration: none;
}

/* <details> image gallery */
.gallery summary {
  list-style-type: none;
  cursor: zoom-in;
}

.gallery summary::-webkit-details-marker,
.gallery[open] summary {
  display: none;
}

.gallery-preview {
  display: grid;
  grid-gap: 10px;
  grid-template-columns: repeat(auto-fit, calc(50% - 10px));
}

/* GitHub Activity */
.github {
  padding: 0;
}

.github img {
  margin-bottom: -3%;
  /* Crop bottom color bar */
}

.og .header {
  display: block;
  text-decoration: none;
}

.og .header h1 {
  font-size: 1.2rem;
  font-weight: 600;
  opacity: 0.95;
  margin-bottom: 0.2em;
}

.og .header h2 {
  font-size: var(--size-400);
  font-weight: normal;
  opacity: 0.7;
}

.og .description {
  margin-top: 1em;
}

.og img {
  max-width: 80px;
  margin: 0 0 0.75em 1.5em;
  border-radius: 6px;
  float: right;
}

/* https://css-tricks.com/responsive-iframes/ */
[style*="--aspect-ratio"] > :first-child {
  width: 100%;
}

@supports (--custom: property) {
  [style*="--aspect-ratio"] {
    position: relative;
  }

  [style*="--aspect-ratio"]::before {
    content: "";
    display: block;
    padding-bottom: calc(100% / (var(--aspect-ratio)));
  }

  [style*="--aspect-ratio"] > :first-child {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
  }
}
ol.timeline {
  list-style-type: none;
  position: relative;
  padding: 0;
  margin: 0;
}

.timeline::before {
  content: "";
  border-left: 2px dotted #e1e4e8;
  position: absolute;
  bottom: 0;
  top: -1.5em;
  left: 50%;
  transform: translateX(-50%);
}

.timeline > li {
  position: relative;
  margin: 4em 0;
  padding: 0;
  background-color: var(--color-bg);
  z-index: 1;
}

.timeline > li[data-year] {
  margin-top: 6em;
}

.timeline > li[data-year]::before {
  content: attr(data-year);
  font-size: var(--size-600);
  letter-spacing: 0.2em;
  background-color: var(--color-bg);
  padding: 0.2em 0;
  position: absolute;
  top: -3em;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}

.tweet {
  --tweet-link-color: #2b7bb9;
  --tweet-link-color-hover: #3b94d9;
  --tweet-color-gray: #697882;
}

.tweet--referenced {
  border: 1px solid #e1e8ed;
  border-radius: 6px;
}

.tweet > * + * {
  margin-top: 1em;
}

.tweet a {
  text-decoration: none;
}

.tweet-header {
  display: flex;
}

.tweet-avatar {
  margin-right: 0.4em;
}

.tweet-avatar img {
  height: 1.5em;
  width: 1.5em;
  border-radius: 50%;
}

.tweet-author:hover {
  color: var(--tweet-link-color-hover);
}

.tweet-name {
  font-weight: 700;
}

.tweet-username {
  color: var(--tweet-color-gray);
}

.tweet-brand {
  margin-left: auto;
  display: flex;
  text-indent: -9999px;
}

.tweet-brand::after {
  content: "";
  width: 1.2em;
  background: top center no-repeat url("/assets/images/twitter-logo.svg");
}

.tweet-text {
  white-space: pre-wrap;
  word-wrap: break-word;
}

.tweet-text a {
  color: var(--tweet-link-color);
}

.tweet-text a:hover {
  text-decoration: underline;
}

.tweet-attachments img,
.tweet-attachments video {
  border-radius: 5px;
}

.tweet-metrics {
  margin-top: 1.5em;
  font-size: 0.875rem;
  display: flex;
}

.tweet-metrics a {
  text-decoration: none;
}

.tweet-metric {
  color: var(--tweet-color-gray);
  display: flex;
  margin-right: 1em;
}

.tweet-metric::before {
  content: "";
  width: 1.7em;
  background-size: auto 80%;
  background-repeat: no-repeat;
  background-position: center center;
}

.tweet-metric--like::before {
  background-image: url("/assets/images/twitter-like-icon.svg");
}

.tweet-metric--retweet::before {
  background-image: url("/assets/images/twitter-retweet-icon.svg");
}

.tweet-metric--reply::before {
  background-image: url("/assets/images/twitter-reply-icon.svg");
}

.tweet-time {
  margin-left: auto;
  color: var(--tweet-color-gray);
}

.tweet-time:hover, .tweet-time:focus {
  color: var(--tweet-link-color-hover);
}

.tweet-time:focus {
  text-decoration: underline;
}

.youtube {
  padding: 0;
}

a[data-youtube] {
  position: relative;
}
a[data-youtube]::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: 68px 48px;
  background-repeat: no-repeat;
  background-position: center center;
  background-image: url("/assets/images/youtube-play-button.svg");
  filter: grayscale(100%);
  transition: filter 0.1s ease-in;
}
a[data-youtube]:hover::after {
  filter: none;
}