body {
  color: #454545;
  background-color: #fafafa;
  font-family: "EB Garamond", serif;
}

@media (min-width: 768px) {
  body {
    font-size: 2em;
  }

  .page-title {
    font-size: 1.5em;
    line-height: 1.5em;
    margin-bottom: 4px;
    font-weight: 500;
  }
}

@media (max-width: 767px) {
  body {
    font-size: 1.8em;
  }

  .page-title {
    font-size: 1.2em;
    line-height: 1.2em;
    margin-bottom: 4px;
    font-weight: 500;
  }
}

@media (min-width: 600px) {
  .container {
    top: 10%;
    padding-bottom: 5%;
    max-width: 800px;
  }
}

@media (max-width: 599px) {
  .container {
    top: 3rem;
    max-width: 800px;
  }
}

.story-container {
  max-width: 30em;
}

.menu-container {
  max-width: 30em;
  margin-top: 25em;
}

.by {
  color: #999;
}

a {
  color: #454545;
}

.subtitle {
  font-size: 0.8em;
}

p {
}

@keyframes fadein {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Firefox < 16 */
@-moz-keyframes fadein {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Safari, Chrome and Opera > 12.1 */
@-webkit-keyframes fadein {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Internet Explorer */
@-ms-keyframes fadein {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Opera < 12.1 */
@-o-keyframes fadein {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.recommendation-item-list {
  display: flex;
  flex-direction: column;
}

/* Floating Navigation */
.floating-nav {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translateY(-50%);
  margin-left: calc(512px + 2rem);
  max-width: 1024px;
  padding: 0;
  opacity: 0.6;
  transition: opacity 0.3s ease;
  z-index: 1000;
}

.floating-nav:hover {
  opacity: 1;
}

.floating-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.floating-nav li {
  margin: 0;
  padding: 0;
}

.floating-nav a {
  display: block;
  padding: 0.4rem 0;
  color: #454545;
  text-decoration: none;
  font-size: 2rem;
  font-weight: 500;
  margin: 0;
  transition: all 0.2s ease;
  position: relative;
}

.floating-nav a:hover {
  color: #222;
  transform: translateX(-3px);
}

.floating-nav a::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 0;
  background: #454545;
  border-radius: 1px;
  transition: height 0.2s ease;
}

.floating-nav a:hover::before,
.floating-nav a.active::before {
  height: 60%;
}

.floating-nav a.active {
  color: #222;
  font-weight: 600;
}

/* Hide on smaller screens */
@media (max-width: 1100px) {
  .floating-nav {
    display: none;
  }
}

/* Smooth scrolling for the whole page */
html {
  scroll-behavior: smooth;
}

/* Search trigger icon */
#search-trigger {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  width: 2.4rem;
  height: 2.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid rgba(69, 69, 69, 0.18);
  border-radius: 999px;
  color: #454545;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  z-index: 1001;
  padding: 0;
}

#search-trigger:hover,
#search-trigger:focus-visible {
  opacity: 1;
  border-color: rgba(69, 69, 69, 0.5);
  outline: none;
}

#search-trigger svg {
  display: block;
  width: 60%;
  height: 60%;
}

/* Search overlay */
#search-overlay[hidden] {
  display: none;
}

#search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(245, 245, 247, 0.55);
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  z-index: 2000;
}

#search-modal {
  width: min(94vw, 68rem);
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
  font-family: "EB Garamond", serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}

#search-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #888;
  padding: 0 0.25rem 0.85rem;
}

.search-label {
  font-weight: 500;
}

.search-count {
  font-variant-numeric: tabular-nums;
  color: #999;
}

.search-count:empty::before {
  content: "—";
  color: #ccc;
}

.search-count:not(:empty)::after {
  content: " results";
  color: #999;
}

#search-input-row {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.5rem 0.25rem 0.6rem;
  color: #111;
  border-bottom: 2px solid #1a1a1a;
}

#search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: 5rem;
  line-height: 1.25;
  color: #111;
  padding: 0;
  margin: 0;
  height: auto;
  letter-spacing: -0.025em;
  font-weight: 400;
  font-style: italic;
  min-width: 0;
}

#search-input::placeholder {
  color: rgba(20, 20, 20, 0.18);
  font-style: italic;
}

#search-esc {
  font-family: var(--mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #888;
  background: transparent;
  border: 1px solid rgba(20, 20, 20, 0.15);
  border-radius: 0;
  padding: 0.3rem 0.55rem;
  font-weight: 500;
}

#search-results {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  max-height: 42vh;
  overflow-y: auto;
}

#search-results li {
  padding: 0.65rem 0.25rem;
  cursor: pointer;
  display: grid;
  grid-template-columns: 2.5rem 1fr auto;
  align-items: baseline;
  gap: 1.25rem;
  border-radius: 0;
  border-bottom: 1px solid rgba(20, 20, 20, 0.08);
  transition: padding-left 0.12s ease;
}

#search-results li.active {
  padding-left: 0.85rem;
}

#search-results li.active .search-title {
  font-weight: 500;
}

.search-num {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: #bbb;
  font-variant-numeric: tabular-nums;
  align-self: center;
}

#search-results li.active .search-num {
  color: #1a1a1a;
}

.search-body {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 0;
}

.search-title {
  font-size: 1.7rem;
  color: #111;
  font-weight: 400;
  letter-spacing: -0.005em;
  line-height: 1.15;
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.search-title mark {
  background: transparent;
  color: inherit;
  border-bottom: 2px solid #1a1a1a;
  padding: 0;
  border-radius: 0;
}

.search-meta {
  font-size: 0.7rem;
  color: #999;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.search-synonym {
  font-size: 0.55rem;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #aaa;
  background: transparent;
  border: 1px solid rgba(20, 20, 20, 0.12);
  border-radius: 0;
  padding: 0.15rem 0.4rem;
  font-weight: 500;
  align-self: center;
}

.search-type {
  font-family: var(--mono);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #bbb;
  align-self: center;
  white-space: nowrap;
}

#search-empty {
  padding: 2.5rem 0.25rem;
  color: #999;
  font-style: italic;
  text-align: left;
  font-size: 1.4rem;
  font-family: "EB Garamond", serif;
}

@media (max-width: 599px) {
  #search-trigger {
    top: auto;
    bottom: 2rem;
    right: 2rem;
    width: 4.8rem;
    height: 4.8rem;
    opacity: 0.9;
    background: #fafafa;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
  }
  #search-overlay {
    padding: 1rem;
  }
  #search-modal {
    width: 94vw;
    border-radius: 0;
  }
  #search-header {
    font-size: 0.6rem;
    letter-spacing: 0.16em;
    padding-bottom: 0.6rem;
  }
  #search-input-row {
    gap: 0.75rem;
    padding: 0.35rem 0.1rem 0.4rem;
  }
  #search-input {
    font-size: 2.4rem;
    letter-spacing: -0.02em;
    line-height: 1.25;
  }
  #search-esc {
    display: none;
  }
  #search-results {
    margin-top: 1rem;
  }
  #search-results li {
    grid-template-columns: 1.8rem 1fr;
    gap: 0.85rem;
    padding: 0.55rem 0.1rem;
  }
  #search-results li.active {
    padding-left: 0.4rem;
  }
  .search-num {
    font-size: 0.6rem;
  }
  .search-title {
    font-size: 1.15rem;
  }
  .search-meta {
    font-size: 0.6rem;
    letter-spacing: 0.1em;
  }
  .search-type {
    display: none;
  }
  .search-synonym {
    font-size: 0.5rem;
  }
  #search-empty {
    font-size: 1.05rem;
    padding: 1.5rem 0.1rem;
  }
}
