/* root */
@font-face {
  font-family: 'Castledown';
  src:
    url('/assets/fonts/castledown-regular.woff2') format('woff2'),
    url('/assets/fonts/castledown-regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Castledown';
  src:
    url('/assets/fonts/castledown-heavy.woff') format('woff'),
    url('/assets/fonts/castledown-heavy.ttf') format('truetype');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --font-sans: 'Castledown', sans-serif;
  --font-size: 18px;
  --breakpoint-tablet: 50rem;

  font-size: var(--font-size);
}

/***** common *****/
body {
  font-family: var(--font-sans);
  min-width: 360px;
}

.container {
  max-width: 75rem;
  margin: 0 auto;
  padding: 0 1rem;
}

.typing__cursor::after {
  content: ' ';
  margin-left: 0.25em;
  height: 1.5em;
  width: 0.1em;
  vertical-align: top;
  background-color: currentColor;
  display: inline-block;
}

.typing__cursor--blink::after {
  animation: blink 1s infinite;
}

@keyframes blink {
  0%,
  50%,
  100% {
    opacity: 1;
  }
  25%,
  75% {
    opacity: 0;
  }
}

.prose {
  line-height: 1.5em;
  max-width: 75em;
  margin: 0 auto;
}

/* Headings */

.prose h1,
.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6 {
  font-weight: bold;
  line-height: 1.15em;
  margin-top: 1.5em;
}

.prose h1:first-child,
.prose h2:first-child,
.prose h3:first-child,
.prose h4:first-child,
.prose h5:first-child,
.prose h6:first-child {
  margin-top: 0;
}

.prose h1 {
  font-size: 2em;
}

.prose h2 {
  font-size: 1.5em;
}

.prose h3 {
  font-size: 1.3em;
}

.prose h4 {
  font-size: 1.2em;
}

/* Paragraph */

.prose p {
  margin-top: 1.5em;
}

/* Links */

.prose a {
  text-decoration: none;
}

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

/* Lists */

.prose ul,
.prose ol {
  padding-left: 1.5em;
  margin-top: 1.5em;
}

.prose li {
  margin: 0.35em 0;
}

/* Blockquote */

.prose blockquote {
  border-left: 4px solid var(--color-border);
  padding: 0.6em 1em;
  margin: 1.4em 0;
  color: #57606a;
  background: var(--color-surface);
  border-radius: 4px;
}

/* Inline code */

.prose code {
  background: var(--color-surface);
  padding: 0.2em 0.4em;
  border-radius: 6px;
  font-family: monospace;
  font-size: 0.9em;
}

/* Code block */

.prose pre {
  background: var(--color-surface);
  padding: 1em;
  border-radius: 0.5em;
  white-space: pre-wrap;
  word-break: break-word;
  margin-top: 1.5em;
  width: 100%;
}

.prose pre code {
  background: none;
  padding: 0;
  font-size: 0.9rem;
}

/* Tables */

.prose table {
  border-collapse: collapse;
  width: 100%;
  margin-top: 1.5em;
}

.prose th,
.prose td {
  border: 1px solid var(--color-border);
  padding: 0.6em 0.8em;
}

.prose th {
  background: var(--color-surface);
  font-weight: 600;
}

/* Images */

.prose img {
  max-width: 100%;
  border-radius: 6px;
  margin: 1em 0;
}

/* Horizontal rule */

.prose hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin-top: 1.5em;
}

/* Strong */

.prose strong {
  font-weight: 600;
}

/* Emphasis */

.prose em {
  font-style: italic;
}

/* Code scrollbar */

.prose pre::-webkit-scrollbar {
  height: 8px;
}

.prose pre::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 4px;
}

/***** site-header *****/
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem 0.25rem 0.5rem;
}

.site-header__logo {
  width: 3rem;
  height: 3rem;
  padding: 0.25rem;
}

.site-header__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-header__nav a.active {
  font-weight: bold;
}

@media screen and (min-width: 50rem /* tablet */) {
  .site-header {
    padding: 1rem;
  }

  .site-header__logo {
    width: 4rem;
    height: 4rem;
  }

  .site-header__nav {
    gap: 2rem;
    font-size: 1.25rem;
  }
}

/***** site-footer *****/
.site-content {
  min-height: calc(100vh - 6.5rem);
}

@media screen and (min-width: 50rem /* tablet */) {
  .site-content {
    min-height: calc(100vh - 10rem);
  }
}

/***** site-footer *****/
.site-footer {
  font-size: 0.825rem;
  text-align: center;
  padding: 1rem 0;
}

@media screen and (min-width: 50rem /* tablet */) {
  .site-footer {
    font-size: 1rem;
  }
}

/***** headline *****/
@media screen and (min-width: 50rem /* tablet */) {
  .headline {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
}

/***** intro *****/
.intro {
  padding: 1rem 0;
}

.intro__role {
  font-size: 2rem;
  font-weight: bold;
}

@media screen and (min-width: 50rem /* tablet */) {
  .intro__role {
    font-size: 4rem;
  }

  .intro__name {
    font-size: 1.5rem;
  }
}

/***** contact *****/
.contact {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.contact__item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.contact__item img {
  width: 1.5rem;
  height: 1.5rem;
}

@media screen and (min-width: 50rem /* tablet */) {
  .contact {
    gap: 1rem;
  }
}

/***** page *****/
.page__title {
  font-size: 2rem;
  text-align: center;
  font-weight: bold;
  margin: 1rem 0;
}

/***** gallery *****/
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
  gap: 1rem;
}

.gallery__card {
  position: relative;
  padding-top: 100%;
  height: 0;
}

.gallery__card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
}

.gallery__card h3 {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  overflow: hidden;
  padding: 0.25rem 0.5rem;
  display: none;
  background-color: black;
  color: white;
}

.gallery__card:hover h3 {
  display: block;
}
