/* -------------------------------
   Shared styles for all pages
   Fonts: Libre Baskerville (serif) + Inter (sans)
   Color scheme: soft sage / sea green
-------------------------------- */

/* ---- Self‑hosted fonts ---- */

/* Inter */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  size-adjust: 100%;
  font-display: swap;
  src: url('/assets/fonts/inter-v20-latin-regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: italic;
  font-weight: 400;
  size-adjust: 100%;
  font-display: swap;
  src: url('/assets/fonts/inter-v20-latin-italic.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  size-adjust: 100%;
  font-display: swap;
  src: url('/assets/fonts/inter-v20-latin-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: italic;
  font-weight: 600;
  size-adjust: 100%;
  font-display: swap;
  src: url('/assets/fonts/inter-v20-latin-600italic.woff2') format('woff2');
}

/* Libre Baskerville */
@font-face {
  font-family: 'Libre Baskerville';
  font-style: normal;
  font-weight: 400;
  size-adjust: 106%;
  font-display: swap;
  src: url('/assets/fonts/libre-baskerville-v24-latin-regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Libre Baskerville';
  font-style: italic;
  font-weight: 400;
  size-adjust: 106%;
  font-display: swap;
  src: url('/assets/fonts/libre-baskerville-v24-latin-italic.woff2') format('woff2');
}
@font-face {
  font-family: 'Libre Baskerville';
  font-style: normal;
  font-weight: 700;
  size-adjust: 106%;
  font-display: swap;
  src: url('/assets/fonts/libre-baskerville-v24-latin-700.woff2') format('woff2');
}

/* IBM Plex Mono */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/ibm-plex-mono-v20-latin-regular.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/ibm-plex-mono-v20-latin-600.woff2') format('woff2');
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f4faf8; /* very light sage */
  color: #1d5a7a;
  line-height: 1.5;
  font-size:1.1em;
}

/* navigation */
.site-nav {
  position: relative;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(250, 252, 252, 1);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #c2dfd8;
  z-index: 1000;
  padding: 1.2rem 2rem;
}
.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}
.nav-brand {
  font-family: "Libre Baskerville", serif;
  font-size: 1.3rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: #427b88;                     /* solid colour, no gradient */
  text-decoration: none;
  border-bottom: none;                /* no default underline */
  padding-bottom: 0.12em;
  transition: color 0.2s;
}

.nav-brand:hover {
  border-bottom: none;                /* remove any border */
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg id='squiggle-link' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 4'%3E%3Cstyle%3E.squiggle{animation:shift .3s linear infinite;}@keyframes shift {from {transform:translateX(0);}to {transform:translateX(-20px);}}%3C/style%3E%3Cpath fill='none' stroke='%235c9c8f' stroke-width='2' class='squiggle' d='M0,3.5 c 5,0,5,-3,10,-3 s 5,3,10,3 c 5,0,5,-3,10,-3 s 5,3,10,3'/%3E%3C/svg%3E");
  background-position: 0 calc(100% - 1.5px);
  background-size: auto 3px;
  background-repeat: repeat-x;
  padding-bottom: 3px;
  text-decoration: none;
  color: #427b88;                     }
.nav-links {
  margin: 0;
  padding: 0;
  display: flex;
  gap: 2rem;
  list-style: none;
}
.nav-links a {
  color: #427b88;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}
.nav-links a:hover {
  text-decoration: none;
  color: #427b88;      
}
/* ============================================
   Dropdown navigation – no hover jump
   ============================================ */

/* Parent container */
.nav-dropdown {
  position: relative;
}

/* Hidden menu */
.nav-dropdown .dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  border: 1px solid #c2dfd8;
  border-radius: 4px;
  padding: 0.5rem 0;
  min-width: 180px;
  list-style: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.1s, visibility 0.1s;
  z-index: 1000;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  box-sizing: border-box;
}

/* Show on hover/focus */
.nav-dropdown:hover .dropdown-menu,
.nav-dropdown:focus-within .dropdown-menu {
  opacity: 1;
  visibility: visible;
}

/* Reset list items */
.nav-dropdown .dropdown-menu li {
  margin: 0;
  padding: 0;
  list-style: none;
  line-height: normal;
}

/* Anchor – normal state */
.nav-dropdown .dropdown-menu a {
  display: block;
  padding: 0.5rem 1rem !important;   /* force consistent padding */
  margin: 0;
  color: #1d5a7a;
  text-decoration: none;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: normal;
  line-height: 1.3;
  background: transparent;
  border: none;
  box-sizing: border-box;
  transition: none;
}

/* Anchor – hover state (only background changes) */
.nav-dropdown .dropdown-menu a:hover {
  background: #eef3fa;
  /* No padding, margin, border, line-height, or font changes here */
}
/* main container */
main {
  max-width: 1000px;
  margin: 2rem auto;
  padding: 0 2rem;
}

/* headings (serif) */
h1,
h2,
h3,
.nav-brand,
.card h2,
.hero-home h1,
.dao-explanation h3,
.log-entry h2 {
  font-family: "Libre Baskerville", serif;
  font-weight: 400;
}

/* footer */
.site-footer {
  margin-top: 4rem;
  padding: 2rem;
  background: #e2efe9;
  border-top: 1px solid #c2dfd8;
  text-align: center;
}
.footer-content p {
  font-size: 0.8rem;
  color: #3b6b62;
}
.credit {
  font-size: 0.75rem;
  margin-top: 0.5rem;
  color: #4a7c72;
}
.credit a {
  color: #2a5a52;
  text-decoration: none;
}
.credit a:hover {
  text-decoration: underline;
}
.footer-links {
  margin-top: 0.8rem;
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.footer-links a {
  text-decoration: none;
  font-size: 0.8rem;
  color: #3b6b62;
  font-weight: 450;
}
.footer-links a:hover {
  text-decoration: underline;
  color: #1e554a;
}

/* ----- FANCY LINK (triangle hover fill effect) ----- */
.fancy-link {
  --text-color: #5c9c8f;
  position: relative;
  display: inline-block;
}
.fancy-link .link-triangle {
  position: absolute;
  width: 100%;
  height: 100%;
  z-index: 1;
  cursor: pointer;
}
.fancy-link .link-triangle:nth-child(1) {
  -webkit-clip-path: polygon(0 0, 100% 0, 50% 50%);
  clip-path: polygon(0 0, 100% 0, 50% 50%);
}
.fancy-link .link-triangle:nth-child(2) {
  -webkit-clip-path: polygon(100% 0, 100% 100%, 50% 50%);
  clip-path: polygon(100% 0, 100% 100%, 50% 50%);
}
.fancy-link .link-triangle:nth-child(3) {
  -webkit-clip-path: polygon(0 100%, 50% 50%, 100% 100%);
  clip-path: polygon(0 100%, 50% 50%, 100% 100%);
}
.fancy-link .link-triangle:nth-child(4) {
  -webkit-clip-path: polygon(0 0, 50% 50%, 0 100%);
  clip-path: polygon(0 0, 50% 50%, 0 100%);
}
.fancy-link .link-triangle:hover {
  -webkit-clip-path: none;
  clip-path: none;
  z-index: 2;
}
/* fill-text element */
.fancy-link .fill-text {
  color: transparent;
  -webkit-text-stroke: 1px var(--text-color);
  font-family: "Inter", sans-serif;
  font-size: inherit;
  position: relative;
}
.fancy-link .fill-text::before {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  color: var(--text-color);
  -webkit-text-stroke: 0;
  clip-path: circle(0% at 50% 50%);
  animation: none;
}
/* hover animations for each triangle */
.fancy-link .link-triangle:nth-child(1):hover ~ .fill-text::before {
  animation: fill-text-top 0.5s forwards;
}
.fancy-link .link-triangle:nth-child(2):hover ~ .fill-text::before {
  animation: fill-text-right 0.5s forwards;
}
.fancy-link .link-triangle:nth-child(3):hover ~ .fill-text::before {
  animation: fill-text-bottom 0.5s forwards;
}
.fancy-link .link-triangle:nth-child(4):hover ~ .fill-text::before {
  animation: fill-text-left 0.5s forwards;
}

@keyframes fill-text-top {
  0% {
    clip-path: circle(0% at 50% 0%);
  }
  100% {
    clip-path: circle(150% at 50% 0%);
  }
}
@keyframes fill-text-right {
  0% {
    clip-path: circle(0% at 100% 50%);
  }
  100% {
    clip-path: circle(150% at 100% 50%);
  }
}
@keyframes fill-text-bottom {
  0% {
    clip-path: circle(0% at 50% 100%);
  }
  100% {
    clip-path: circle(150% at 50% 100%);
  }
}
@keyframes fill-text-left {
  0% {
    clip-path: circle(0% at 0% 50%);
  }
  100% {
    clip-path: circle(150% at 0% 50%);
  }
}

/* responsive */
@media (max-width: 700px) {
  body {
    padding-top: 90px;
  }
  .nav-container {
    flex-direction: column;
    gap: 0.5rem;
  }
  .hero-home h1 {
    font-size: 2.4rem;
  }
  .card-grid {
    flex-direction: column;
  }
}

/* ----- WAVY LINK UNDERLINE (only for content links) ----- */
a {
  text-decoration: none;
  color: #5c9c8f;
  border-bottom: 1px solid #5c9c8f;
  padding-bottom: 0.12em;
  transition: border-bottom 0.1s ease;
}

/* Content links (not nav, not footer) get the wavy effect */
a:hover {
  border-bottom: none;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg id='squiggle-link' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 4'%3E%3Cstyle type='text/css'%3E.squiggle{animation:shift .3s linear infinite;}@keyframes shift {from {transform:translateX(0);}to {transform:translateX(-20px);}}%3C/style%3E%3Cpath fill='none' stroke='%235c9c8f' stroke-width='2' class='squiggle' d='M0,3.5 c 5,0,5,-3,10,-3 s 5,3,10,3 c 5,0,5,-3,10,-3 s 5,3,10,3'/%3E%3C/svg%3E");
  background-position: 0 calc(100% - 1.5px);
  background-size: auto 3px;
  background-repeat: repeat-x;
  padding-bottom: 3px;
  text-decoration: none;
}

/* Navigation and footer links: no border, no wavy – just simple hover underline */
.nav-links a,
.footer-links a {
  text-decoration: none;
  border-bottom: none;
  background-image: none;
  padding-bottom: 0;
}
.nav-links a:hover,
.footer-links a:hover {
  text-decoration: none;
  border-bottom: 1px solid #5c9c8f;
  background-image: none;
  padding-bottom: 0;
}

/* Credit links inside footer (the attribution) – we want them to behave like content links */
.footer-content .credit a {
  text-decoration: none;
  border-bottom: 1px solid #5c9c8f;
  background-image: none;
}
.footer-content .credit a:hover {
  border-bottom: none;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg id='squiggle-link' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 4'%3E%3Cstyle type='text/css'%3E.squiggle{animation:shift .3s linear infinite;}@keyframes shift {from {transform:translateX(0);}to {transform:translateX(-20px);}}%3C/style%3E%3Cpath fill='none' stroke='%235c9c8f' stroke-width='2' class='squiggle' d='M0,3.5 c 5,0,5,-3,10,-3 s 5,3,10,3 c 5,0,5,-3,10,-3 s 5,3,10,3'/%3E%3C/svg%3E");
  background-position: 0 calc(100% - 1.5px);
  background-size: auto 3px;
  background-repeat: repeat-x;
  padding-bottom: 3px;
}
