:root {
  --bg: #EBDBB2;
  --text: #654735;
  --heading: #C35E0A;
  --link: #4C7A5D;
  --site-base-url: "https://reihan.org";
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171819;
    --text: #CAB591;
    --heading: #E1864C;
    --link: #89B482;
  }
}

html {
  background: var(--bg);
  color: var(--text);
}

main {
  max-width: 75ch;
  margin-inline: auto;
  padding: 0 1rem;
}

h1 { font-size: 2rem; }

h1, h2, h3, h4, h5, h6 {
  color: var(--heading);
}

a {
  color: var(--link);
}

a[target="_blank"] {
  position: relative;
  padding-right: 0.9em;
}

a[target="_blank"]::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: .75em;
  height: .75em;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%234C7A5D'%3E%3Cpath d='M6.22 8.72a.75.75 0 0 0 1.06 1.06l5.22-5.22v1.69a.75.75 0 0 0 1.5 0v-3.5a.75.75 0 0 0-.75-.75h-3.5a.75.75 0 0 0 0 1.5h1.69L6.22 8.72Z'/%3E%3Cpath d='M3.5 6.75c0-.69.56-1.25 1.25-1.25H7A.75.75 0 0 0 7 4H4.75A2.75 2.75 0 0 0 2 6.75v4.5A2.75 2.75 0 0 0 4.75 14h4.5A2.75 2.75 0 0 0 12 11.25V9a.75.75 0 0 0-1.5 0v2.25c0 .69-.56 1.25-1.25 1.25h-4.5c-.69 0-1.25-.56-1.25-1.25v-4.5Z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  pointer-events: none;
}

@media (prefers-color-scheme: dark) {
  a[target="_blank"]::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%2389B482'%3E%3Cpath d='M6.22 8.72a.75.75 0 0 0 1.06 1.06l5.22-5.22v1.69a.75.75 0 0 0 1.5 0v-3.5a.75.75 0 0 0-.75-.75h-3.5a.75.75 0 0 0 0 1.5h1.69L6.22 8.72Z'/%3E%3Cpath d='M3.5 6.75c0-.69.56-1.25 1.25-1.25H7A.75.75 0 0 0 7 4H4.75A2.75 2.75 0 0 0 2 6.75v4.5A2.75 2.75 0 0 0 4.75 14h4.5A2.75 2.75 0 0 0 12 11.25V9a.75.75 0 0 0-1.5 0v2.25c0 .69-.56 1.25-1.25 1.25h-4.5c-.69 0-1.25-.56-1.25-1.25v-4.5Z'/%3E%3C/svg%3E");
  }
}

html, body {
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  min-height: 97.5vh;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  margin-top: 0.6em;
  margin-bottom: 0.4em;
}

.about-corner-image {
  position: fixed;
  right: 2rem;
  bottom: 0;
  width: clamp(200px, 30vw, 40rem);
  height: auto;
  z-index: 0;
  pointer-events: none;
}

.novels-corner-image {
  position: fixed;
  left: 2rem;
  bottom: 0;
  width: clamp(150px, 20vw, 30rem);
  height: auto;
  z-index: 0;
  pointer-events: none;
  transform: scaleX(-1);
  padding-top: 30vh;
}

@font-face {
  font-family: "Open Sans";
  src: url("/fonts/open-sans/regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Open Sans";
  src: url("/fonts/open-sans/bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Open Sans";
  src: url("/fonts/open-sans/italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Open Sans";
  src: url("/fonts/open-sans/bold-italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Averia Serif Libre";
  src: url("/fonts/averia-serif-libre/regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Averia Serif Libre";
  src: url("/fonts/averia-serif-libre/bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Averia Serif Libre";
  src: url("/fonts/averia-serif-libre/italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Averia Serif Libre";
  src: url("/fonts/averia-serif-libre/bold-italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 700;
  font-display: swap;
}

:root {
  --font-body: "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-heading: "Averia Serif Libre", Georgia, "Times New Roman", serif;
}

@view-transition {
  navigation: auto;
}

::view-transition {
  background-color: var(--bg);
}

::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
  background-color: var(--bg);
}

::view-transition-old(root) {
  z-index: 1;
}

::view-transition-new(root) {
  z-index: 2;
  animation: vt-fade-in 0.25s ease;
}

@keyframes vt-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.navigation {
  display: flex;
  list-style: none;
  max-width: 75ch;
  padding: 0 1rem;
  margin: 0 auto;
  gap: 1ch;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  height: 1.7rem;
}

.navigation::-webkit-scrollbar {
  display: none;
}

nav {
  border-bottom: 1px solid;
  width: 100%;
}

@media (prefers-color-scheme: dark) {
  nav {
    border-bottom: 1px solid #3C3836;
  }
}

.reading-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 0.85rem;
  margin-bottom: 20vh;
}

.reading-table th,
.reading-table td {
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: 4px 10px;
  text-align: left;
}

.reading-table th {
  background: transparent;
  color: var(--text);
  font-family: var(--font-mono, monospace);
  font-size: 0.75rem;
  text-transform: uppercase;
  border-bottom: 2px solid var(--text);
}

.status-tag {
  font-family: var(--font-mono, monospace);
  font-size: 0.8rem;
}

.status-reading {
  color: #89b482;
  font-weight: bold;
}

.status-finished {
  color: #4c7a5d;
}

.status-planned {
  color: #999;
}

.progress-mini {
  display: block;
  width: 100%;
  max-width: 100px;
  height: 4px;
  background: rgba(0, 0, 0, 0.05);
}

.progress-bar-mini {
  height: 100%;
  width: var(--progress, 0%);
  background: var(--link);
}

@media (prefers-color-scheme: dark) {
  .reading-table th,
  .reading-table td {
    border-color: rgba(255, 255, 255, 0.1);
  }

  .reading-table th {
    border-bottom-color: var(--text);
  }

  .progress-mini {
    background: rgba(255, 255, 255, 0.05);
  }
}

@media (max-width: 600px) {
  .reading-table th:nth-child(2),
  .reading-table td:nth-child(2),
  .reading-table th:nth-child(4),
  .reading-table td:nth-child(4) {
    display: none;
  }
}

.project-list {
  margin-top: 1.5rem;
}

.project {
  padding: 1.25rem 0;
  border-top: 1px dashed #3c3836;
}

.project:first-child {
  border-top: none;
  padding-top: 0;
}

.project-title {
  margin: 0 0 0.35rem;
  color: #e0935c;
  font-size: 1.1rem;
}

.project-desc {
  color: #d8d3c5;
  font-size: 0.95rem;
  line-height: 1.5;
}

.project-desc p {
  margin: 0;
}

.project-meta {
  margin: 0.75rem 0 0;
  font-family: monospace;
  font-size: 0.85rem;
}

.project-meta .meta-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.project-meta .meta-row:first-child {
  margin-top: 0;
}

.project-meta dt {
  flex: 0 0 3.5rem;
  color: #7d8a78;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.project-meta dd {
  margin: 0;
  color: #d8d3c5;
}

.project-meta dd a {
  color: #9cbb8c;
  text-decoration: none;
  margin-right: 0.75rem;
}

.project-meta dd a:hover {
  text-decoration: underline;
}

.project-meta dd .closed {
  color: #7d8a78;
  font-style: italic;
  margin-right: 0.75rem;
}
