@import url("https://fonts.googleapis.com/css2?family=Strait&display=swap");

/* ===== variables ===== */
:root {
  --background-color: #16181d;
  --text-color: #f4f1ea;
  --muted-text-color: #9aa1ae;
  --accent-color: #f9c53a;
  --dark-gray-color: #2f2c2e;
  --red-color: #e4473f;
  --link-color: #eceef2;
  --panel-color: #1f1d20;
  --line-color: rgba(236, 238, 242, 0.22);
  --article-text-color: #d5d8df;
  --main-font: "Strait", sans-serif;
  --code-font: ui-monospace, Menlo, Consolas, monospace;
}

/* ===== reset ===== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: none;
  cursor: pointer;
}

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

ul, ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-size: inherit;
  font-weight: inherit;
}

p, h1, h2, h3 {
  overflow-wrap: break-word;
}

code, pre {
  font-family: var(--code-font);
  font-size: inherit;
}

[hidden] {
  display: none !important;
}

/* ===== page ===== */
body {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
  color: var(--text-color);
  font-family: var(--main-font);
  background-color: var(--background-color);
}

.home {
  background-image: url("/img/bg_homePage.png");
  background-repeat: repeat;
  background-position: center 4.5rem;
  background-size: 100%;
}

.visuallyHidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ===== 404 page ===== */
.notFound {
  background-image: url("/img/bg_404.webp");
  background-size: 150px auto;
  background-repeat: repeat;
  background-position: center;
}

.notFoundMessage {
  margin-top: 40vh;
  padding: 2rem;
  text-align: center;
  font-weight: 800;
  color: goldenrod;
  background-color: var(--background-color);
}

.notFoundMessage h1 {
  font-size: 1.5rem;
  letter-spacing: 0.14em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.notFoundMessage a {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 1rem;
  letter-spacing: 0.14em;
  color: var(--muted-text-color);
  font-weight: 800;
}

/* ===== nav ===== */
.navContainer {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.5rem;
  padding: 2rem;
  font-size: 1.1rem;
  line-height: 1.5rem;
  letter-spacing: 0.04em;
  background-color: var(--background-color);
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.65);
}

.navLine {
  flex: 1;
  height: 1px;
  margin: 0 1.5rem;
  background-color: var(--line-color);
}

.navLinks {
  display: inline-flex;
  gap: 1.5rem;
}

.navLinks a {
  font-size: 18px;
  color: rgba(236, 238, 242, 0.6);
}

.navLinks .sep {
  color: var(--line-color);
}

/* ===== content panel ===== */
.contentContainer {
  display: flex;
  flex-grow: 1;
  gap: 1.5rem;
  min-height: 0;
  margin: 2rem clamp(1rem, 4vw, 4rem) 0;
  padding: 2rem;
  background-color: rgba(31, 29, 32, 0.84);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 240, 225, 0.09);
  border-bottom: 0;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.32);
  transform: translateY(15rem);
  transition: transform 0.65s cubic-bezier(0.65, 0, 0.35, 1);
}

.revealed .contentContainer {
  transform: translateY(0);
}

/* - claude - */
/* ===== article page ===== */
#articleTitle {
  max-width: 48rem;
  margin-top: 1.5rem;
  font-size: 3.5rem;
  line-height: 3.75rem;
  letter-spacing: 0.03em;
}

.articleInfo {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  letter-spacing: 0.14em;
  color: var(--muted-text-color);
}

.articleBody {
  margin-top: 1.5rem;
}

.articleBody p {
  max-width: 40rem;
  margin-top: 1.25rem;
  font-size: 1.125rem;
  line-height: 1.75rem;
  letter-spacing: 0.02em;
  color: var(--article-text-color);
}

/* the first paragraph is bigger, like an intro */
.articleBody p:first-child {
  font-size: 1.5rem;
  line-height: 2.25rem;
  color: var(--text-color);
}

.articleBody h2 {
  margin-top: 3rem;
  font-size: 2rem;
  line-height: 2.5rem;
  letter-spacing: 0.03em;
}

.articleBody blockquote {
  max-width: 40rem;
  margin-top: 2rem;
  padding-left: 1.5rem;
  border-left: 4px solid var(--accent-color);
  font-size: 1.5rem;
  line-height: 2.25rem;
  letter-spacing: 0.03em;
}

.articleBody figure {
  max-width: 40rem;
  margin-top: 2.5rem;
}

.articleBody figcaption {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  letter-spacing: 0.04em;
  color: var(--muted-text-color);
}

.articleBody pre {
  max-width: 40rem;
  margin-top: 1.75rem;
  padding: 1.25rem;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.5rem;
  color: var(--article-text-color);
  background-color: rgba(0, 0, 0, 0.38);
  box-shadow: inset 0 0 0 1px rgba(236, 238, 242, 0.12);
}

.backLink {
  display: inline-block;
  margin-top: 3rem;
  letter-spacing: 0.14em;
  color: var(--muted-text-color);
}
/* - end claude - */

/* ===== left column ===== */
.contentContainerL {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  padding: 2.5rem;
  overflow-y: auto;
}

.contentLinkContainer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 2rem;
}

.socialIcon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  min-width: 2rem;
  height: 2rem;
}

.socialIcon:hover {
  color: var(--accent-color);
}

.socialIcon:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

.contentPathContainer {
  display: flex;
  justify-content: flex-end;
  width: 100%;
}

.contentLine {
  /* - claude - */
  flex-shrink: 0;
  /* - end claude - */
  height: 1px;
  margin-top: 1rem;
  background-color: var(--line-color);
}

#contentPath {
  padding-top: 2px;
  font-size: 1rem;
  letter-spacing: 0.1em;
  color: var(--accent-color);
}

#contentPath > span {
  color: var(--muted-text-color);
}

.pathShort {
  display: none;
}

#pageTitle h1 {
  margin-top: 1rem;
  font-size: 3.5rem;
  line-height: 3.75rem;
  letter-spacing: 0.03em;
}

#pageTitle p {
  max-width: 40rem;
  margin-top: 0.75rem;
  font-size: 1.5rem;
  line-height: 2.25rem;
  letter-spacing: 0.03em;
  color: var(--article-text-color);
}

/* ===== right column ===== */
.contentContainerR {
  display: flex;
  flex-direction: column;
  flex: 0 0 24rem;
  padding: 2.5rem 2rem;
}

.contentContainerHeading {
  display: flex;
  align-items: center;
  min-height: 2rem;
  margin-bottom: 1rem;
  font-size: 1rem;
  letter-spacing: 0.14em;
  color: var(--accent-color);
}

.recentHeading {
  margin-top: 1rem;
}

/* keywords */
.keywordsContainer {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 1rem;
  letter-spacing: 0.03em;
}

.keywordsContainer a {
  line-height: 1.1;
}

/* search */
.searchContainer {
  margin-top: 1.5rem;
}

.searchBar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.searchBar input {
  flex: 1 1 10rem;
  min-width: 10rem;
  min-height: 2.5rem;
  padding: 2px 0.75rem 0;
  font-size: 1rem;
  letter-spacing: 0.04em;
  background-color: transparent;
  border: 1px solid rgba(236, 238, 242, 0.3);
  border-radius: 0;
}

.searchBar input::placeholder {
  color: var(--muted-text-color);
}

.searchBar select {
  flex: none;
  width: 7rem;
  min-height: 2.5rem;
  padding: 0 0.5rem;
  font-size: 1rem;
  letter-spacing: 0.04em;
  color: var(--muted-text-color);
  background-color: var(--background-color);
  border: 1px solid rgba(236, 238, 242, 0.3);
  border-radius: 0;
  cursor: pointer;
}

.searchBar input:focus-visible,
.searchBar select:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
  border-color: var(--accent-color);
}

/* articles */
.recentArticleContainer a {
  display: block;
  padding: 1.25rem 0;
  box-shadow: inset 0 1px 0 rgba(236, 238, 242, 0.16);
}

.articleTop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.articleTop h3 {
  font-size: 1.5rem;
  line-height: 1.75rem;
  letter-spacing: 0.03em;
}

.articleMeta {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  letter-spacing: 0.04em;
  color: var(--muted-text-color);
}

/* keyword cloud pattern: sizes repeat every 3, colors every 4 */
.keywordsContainer a:nth-child(3n+1) { font-size: 2rem; }
.keywordsContainer a:nth-child(3n+2) { font-size: 1.25rem; }
.keywordsContainer a:nth-child(3n)   { font-size: 1.5rem; }

.keywordsContainer a:nth-child(4n+1) { color: var(--accent-color); }
.keywordsContainer a:nth-child(4n+2) { color: var(--text-color); }
.keywordsContainer a:nth-child(4n+3) { color: var(--red-color); }
.keywordsContainer a:nth-child(4n)   { color: var(--muted-text-color); }

/* ===== hover states ===== */
.navLinks a:hover {
  color: var(--accent-color);
}

.keywordsContainer a:hover {
  opacity: 0.7;
}

.notFoundMessage a:hover {
  color: var(--accent-color);
}

#contentPath a:hover {
  text-decoration: underline;
}

#contentPath a:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

/* ===== responsive ===== */
@media (prefers-reduced-motion: reduce) {
  .contentContainer {
    transition: none;
  }
}

@media (max-width: 895px) {
  #contentPath {
    font-size: 0.75rem;
  }

  .pathFull {
    display: none;
  }

  .pathShort {
    display: inline;
  }
}

@media (max-width: 768px) {
  .navContainer {
    flex-direction: column;
    justify-content: center;
    height: auto;
    gap: 0.75rem;
    padding: 1rem;
  }

  .navLine {
    display: none;
  }

  .contentContainer {
    padding: 0;
  }

  .contentContainerL {
    padding: 1.5rem;
  }

  .contentLinkContainer {
    gap: 0.25rem;
  }

  #pageTitle h1 {
    font-size: 2.5rem;
    line-height: 2.75rem;
  }

  #pageTitle p {
    font-size: 1rem;
  }

  .contentContainerR {
    display: none;
  }
}