/* ==========================================================================
   Base
   ========================================================================== */

html, body {
  overflow-x: hidden;
}

/* ==========================================================================
   Grain overlay
   ========================================================================== */

.grain {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.1;
  overflow: hidden;
  transform: translateZ(0);
}

/* ==========================================================================
   Profile / Home page
   ========================================================================== */

.profile-pic {
  width: 180px;
  height: 180px;
  object-fit: cover;
  border-radius: 50%;
  display: block;
  margin: 1rem 0 2.5rem 0;
}

.ludic-line {
  margin-top: 1.5rem;
}

/* ==========================================================================
   Favorite quote
   ========================================================================== */

.favorite-quote {
  margin: 1.2rem 0 2.5rem 0;
  padding-left: 0.2rem;
  font-size: 1.05rem;
  color: #cbd5e1;
  font-style: italic;
  letter-spacing: 0.3px;
  position: relative;
  display: inline-block;
}

.favorite-quote .quote-text {
  border-left: 2px solid rgba(255,255,255,0.25);
  padding-left: 0.75rem;
  display: inline-block;
  cursor: default;
}

.favorite-quote .cross {
  font-style: normal;
  font-size: 1.85rem;
  font-weight: bold;
  margin-left: 0.75rem;
  vertical-align: baseline;
  position: relative;
  top: 0.1rem;
  display: inline-block;
  margin-top: 1.5rem;
}

/* ==========================================================================
   Tooltip (accessible)
   ========================================================================== */

.tooltip {
  position: relative;
}

.tooltip .tooltip-text {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  left: 0;
  top: 120%;
  background: rgba(15, 23, 42, 0.92);
  color: #e5e5e5;
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.15);
  white-space: normal;
  max-width: 90vw;
  font-size: 0.75rem;
  transition: opacity 0.15s ease-out;
  z-index: 50;
  pointer-events: none;
  box-sizing: border-box;
}

.tooltip:hover .tooltip-text,
.tooltip:focus .tooltip-text,
.tooltip:focus-within .tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* ==========================================================================
   Posts list
   ========================================================================== */

.posts-heading {
  margin-top: 1.5rem;
  margin-bottom: 2.5rem;
  text-align: left;
}

.posts-list {
  padding-left: 0;
  margin-left: 0;
  margin-bottom: 3rem;
}

.posts-list .date {
  display: block;
  font-size: 0.8rem;
  color: #9ca3af;
  margin-bottom: 0.25rem;
}

.posts-list .post + .post {
  margin-top: 3.5rem;
  padding-top: 3.5rem;
  border-top: 1px solid rgba(255,255,255,0.12);
}

.posts-list .post h1 {
  margin-bottom: 1rem;
}

.posts-list .post h1 a {
  border-bottom: 1px dotted rgba(255,255,255,0.25);
  padding-bottom: 2px;
}

.posts-list .post h1 a:hover {
  border-bottom-color: rgba(255,255,255,0.5);
}

.posts-list .abstract {
  margin-bottom: 1.2rem;
}

.no-posts {
  font-size: 0.95rem;
  color: #9ca3af;
  font-style: italic;
  margin-top: 0.25rem;
}

/* ==========================================================================
   Post meta
   ========================================================================== */

.meta {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: #9ca3af;
  line-height: 1.3;
}

.meta-label {
  text-transform: lowercase;
  opacity: 0.85;
}

.meta-value {
  font-weight: 500;
}

.meta-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  opacity: 0.9;
}

.meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: baseline;
}

.meta-line + .meta-line {
  margin-top: 0.6rem;
}

.meta-separator {
  opacity: 0.5;
}

.meta .tag {
  display: inline-flex;
  align-items: center;
  padding: 0 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.25);
  text-decoration: none;
  color: inherit;
  font-size: 0.75rem;
  line-height: 1.6;
  background: rgba(15,23,42,0.5);
}

.meta .tag:hover {
  color: #ffffff;
  border-color: rgba(255,255,255,0.55);
  background: rgba(15,23,42,0.9);
}

/* ==========================================================================
   Footer
   ========================================================================== */

hr.footer-separator {
  border: none;
  margin: 3rem 0 2rem;
  text-align: center;
  opacity: 0.85;
}

hr.footer-separator::before {
  content: "--------------------------------------------------------------";
  color: rgba(255,255,255,0.20);
  font-family: "JetBrains Mono", "Fira Mono", "SF Mono", Menlo, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}

.footer-info {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px dotted rgba(255,255,255,0.35);
  color: #cbd5e1;
  font-size: 0.9rem;
  gap: 2rem;
  flex-wrap: wrap;
}

.location-status {
  opacity: 0.85;
  white-space: nowrap;
}

.location-status:hover {
  opacity: 1;
}

.contact-info {
  text-align: right;
  line-height: 1.4;
  color: #9ca3af;
}

.contact-info strong {
  color: #e5e5e5;
}

.pgp-link {
  color: #6e6e6e;
  text-decoration: underline;
}

.pgp-link:hover,
.pgp-link:focus {
  color: #a1a1a1;
}

/* PGP popup (accessible) */
.pgp-wrapper {
  position: relative;
  display: inline-block;
}

.pgp-popup {
  display: none;
  position: absolute;
  top: -0.75rem;
  right: 0;
  transform: translateY(-100%);
  background: rgba(17, 24, 39, 0.98);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid rgba(148,163,184,0.4);
  box-shadow: 0 12px 30px rgba(0,0,0,0.7);
  white-space: pre;
  font-family: monospace;
  font-size: 0.72rem;
  color: #e5e5e5;
  max-width: 420px;
  max-height: 200px;
  overflow: hidden;
  z-index: 50;
  opacity: 0;
  transition: opacity 0.12s ease-out;
  pointer-events: none;
}

/* Fade-out at bottom */
.pgp-popup::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 30px;
  background: linear-gradient(
    to bottom,
    rgba(17,24,39,0) 0%,
    rgba(17,24,39,0.98) 100%
  );
  pointer-events: none;
}

.pgp-wrapper:hover .pgp-popup,
.pgp-wrapper:focus-within .pgp-popup {
  display: block;
  opacity: 1;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 640px) {
  .footer-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .location-status {
    white-space: normal;
  }

  .contact-info {
    text-align: left;
    margin-top: 0.25rem;
  }
}

@media (max-width: 600px) {
  .favorite-quote {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
  }

  .favorite-quote .cross {
    font-size: 3.5rem;
    margin-left: 0;
    margin-top: 0;
    top: 0.5rem;
    flex-shrink: 0;
  }

  .tooltip .tooltip-text {
    position: absolute;
    white-space: normal;
    max-width: calc(100vw - 3rem);
    width: auto;
    left: 0;
    top: 100%;
    margin-top: 0.5rem;
  }
}
