:root {
  --background:        #f9f9f7;
  --surface:          #eeeeec;
  --surface-low:      #f4f4f2;
  --on-background:    #1a1c1b;
  --on-surface:       #1a1c1b;
  --on-surface-muted: #444748;
  --outline:          #c4c7c7;
  --accent:           #0000ff;
  --accent-hover:     #0000cc;
  --header-bg:        rgba(249, 249, 247, 0.85);
}

@media (prefers-color-scheme: dark) {
  :root {
    --background:        #131313;
    --surface:          #1f2020;
    --surface-low:      #1b1c1c;
    --on-background:    #e4e2e1;
    --on-surface:       #e4e2e1;
    --on-surface-muted: #c4c7c7;
    --outline:          #444748;
    --accent:           #c9c6c5;
    --accent-hover:     #e5e2e1;
    --header-bg:        rgba(19, 19, 19, 0.9);
  }
}

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

body {
  background-color: var(--background);
  color: var(--on-background);
  font-family: "Times New Roman", Times, serif;
  font-size: 18px;
  line-height: 1.7;
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

::selection {
  background: var(--accent);
  color: var(--background);
}

nav,
main,
footer {
  margin-left: auto;
  margin-right: auto;
}

main {
  width: 94%;
  flex: 1;
  padding-top: 5rem; /* space below fixed nav */
}

nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--header-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  padding: 0.6rem 4%;
  animation: nav-border ease-in both;
  animation-timeline: scroll();
  animation-range: 10px 100px;
}

@keyframes nav-border {
  to { border-bottom: 1px solid var(--outline); }
}

.nav-left,
.nav-right {
  display: flex;
  align-items: center;
}

.nav-link {
  color: var(--on-background);
  text-decoration: none;
  font-size: 96%;
  letter-spacing: 0.1em;
  font-weight: 500;
  padding: 0.4rem 0.6rem;
  transition: color 0.2s;
}

.nav-link:hover {
  color: var(--accent);
  text-decoration: none;
}

h1, h2, h3, h4, h5 {
  color: var(--on-surface);
  font-weight: normal;
}

h1, h2, h3, h4 {
  display: flex;
  align-items: center;
  gap: 1rem;
}

h1::after, h2::after, h3::after, h4::after {
  content: '';
  flex-grow: 1;
  border-radius: 2px;
  background-color: var(--outline);
}

h1::after { height: 4px; }
h2::after { height: 2px; }
h3::after { height: 1px; }

a {
  color: var(--on-background);
  text-underline-offset: 2px;
  transition: color 0.2s;
}

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

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

a[target="_blank"] {
  text-decoration-style: dashed;
  text-underline-offset: 2px;
}

footer {
  border-top: 1px solid var(--outline);
  margin-top: 3rem;
  padding: 1.5rem 4%;
  text-align: center;
  font-size: 80%;
  letter-spacing: 0.1em;
  color: var(--on-surface-muted);
}

footer a {
  text-decoration: none;
  color: var(--on-surface-muted);
}

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

table {
  margin: 0 auto;
  border-collapse: collapse;
}

th, td {
  border-bottom: 1px solid var(--outline);
  padding: 0.5rem;
}

/* ============================================================
 * Buttons
 * ============================================================ */
button {
  background-color: var(--surface);
  color: var(--on-background);
  border: 1px solid var(--outline);
  padding: 0.6rem 1rem;
  border-radius: 4px;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}

button:hover {
  background-color: var(--on-background);
  color: var(--background);
}

/* ============================================================
 * Images & figures
 * ============================================================ */
img {
  object-fit: contain;
  max-width: 100%;
  height: auto;
}

figure {
  margin-left: 0;
  margin-right: 0;
}

figcaption {
  text-align: center;
  font-style: italic;
  font-size: 90%;
  color: var(--on-surface-muted);
  padding: 0.5rem 10%;
}

.image {
  object-fit: contain;
  max-width: 100%;
  height: auto;
}

.small {
  display: block;
  max-width: 80%;
  margin: 0 auto;
}

.shadow {
  box-shadow: 0 0 50px -10px rgba(0, 0, 0, 0.4);
}

svg {
  height: auto;
  max-width: 100%;
}

.svg-icon {
  width: 1.8rem;
  height: 1.8rem;
  padding: 0 0.2rem;
}

/* ============================================================
 * Code
 * ============================================================ */
pre {
  padding: 5px 0;
  border-top: 1px solid var(--outline);
  border-bottom: 1px solid var(--outline);
  background-color: transparent !important;
  line-height: 1;
  overflow-x: auto;
}

/* ============================================================
 * Blockquote
 * ============================================================ */
blockquote {
  border-left: 2px solid var(--accent);
  background-color: var(--surface);
  padding: 0.5rem 0.75rem;
  border-radius: 0 8px 8px 0;
  font-style: italic;
  margin: 1rem 0;
}

blockquote > * {
  margin: 4px 0;
}

/* ============================================================
 * Horizontal rule
 * ============================================================ */
hr {
  border: none;
  border-top: 1px solid var(--outline);
  width: 80%;
  margin: 2rem auto;
}

/* ============================================================
 * Index page
 * ============================================================ */
.index-div {
  margin-top: auto;
  margin-bottom: auto;
  margin-left: auto;
  margin-right: auto;
}

.index-page-title {
  font-weight: 400;
  color: var(--on-surface);
  opacity: 0.4;
  text-underline-offset: 10px;
}

.index-image {
  background-image: url("https://github.com/wint3rmute.png");
  background-position: center center;
  background-size: cover;
  width: 24vh;
  height: 24vh;
  margin: 0 auto 1.5rem;
  border-radius: 50%;
  border: 1px solid var(--outline);
}

.index-list-container {
  text-align: left;
  display: flex;
  justify-content: center;
}

.recently-updated-list {
  padding-left: 12px;
}

.recently-updated-item {
  opacity: 0.8;
  ::after {
    font-size: 80%;
    content: " >";
    opacity: 0.8;
  }
  list-style: none;

  a {
    text-decoration: none;
  }
}

.index-list-container > ul {
  padding-left: 0px;
  li {
    list-style: none;
    ::after {
        content: " ≫";
        opacity: 0.5;
        font-size: 80%;
    }
    line-height: 2.0;

    a {
      text-decoration: none;
    }
  }
}
/* ============================================================
 * Post page
 * ============================================================ */
.post-title {
  padding-top: 4rem;
  padding-bottom: 2rem;
  font-size: 2rem;
  line-height: 1.2;
  color: var(--on-surface);
  text-align: center;
}

/* ============================================================
 * Dictionary / special content
 * ============================================================ */
.dictionary-word {
  font-family: "Times New Roman", serif;
}

.dictionary-source {
  font-size: 80%;
  margin-top: -15px;
  margin-bottom: 30px;
  color: var(--on-surface-muted);
}

.dictionary-letter {
  font-family: "Times New Roman", serif;
  border-top: 1px solid var(--outline);
  border-bottom: 1px solid var(--outline);
  padding: 0 1%;
  margin-right: 98%;
  color: var(--on-surface-muted);
}

/* ============================================================
 * Desktop breakpoint
 * ============================================================ */
@media only screen and (min-width: 768px) {
  nav {
    padding-left: 25%;
    padding-right: 25%;
  }

  .index-page-title {
    position: absolute;
    top: 0px;
    left: 0px;
    margin-top: 1vh;
    margin-left: 2vh;
  }

  main {
    width: 40%;
  }

  .small {
    max-width: 60%;
  }

  main svg {
    position: relative;
    max-width: 180%;
    margin-left: -20%;
    margin-right: auto;
  }

  blockquote {
    margin: 1rem 5%;
  }
}
