/* ================ */
/*  Color Variables */
/* ================ */
:root {
  --text-primary: #fafaf9; /* stone-50 */
  --text-secondary: #d6ded1;
  --text-emphasis: #fff;
  --text-link: #ea580c; /* orange-600 */
  --text-link-hover: #9a3412; /* orange-800 */
  --bg-primary: #1f1b1b;
  --border-color: #fff;
  --transition-duration: 0.2s;
}

/* ============= */
/*  Base Styles  */
/* ============= */
html {
  color: var(--text-primary);
  background-color: var(--bg-primary);
  font-family: "Georgia", serif;
  font-size: clamp(1em, 0.95em + 0.25vw, 1.25em); /* Fluid base font size */
  display: flex;
  justify-content: center;
}

@media screen and (min-width: 800px) {
  html {
    font-size: 1.3em; /* 30% larger base font */
  }
}

@media screen and (min-width: 1000px) {
  html {
    font-size: 1.5em; /* 30% larger base font */
  }
}

body {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 15px 5%;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ============= */
/*  Typography   */
/* ============= */
p {
  line-height: 1.6; /* More readable line height */
  margin-bottom: 1.25em;
  color: var(--text-primary);
}

h1, h2, h3, h4, h5 {
  color: var(--text-secondary);
  font-family: "Verdana", sans-serif;
  margin-top: 1.5em;
  margin-bottom: 0.75em;
  line-height: 1.3;
}

.site-title {
  font-size: clamp(1.8rem, 1.5rem + 1.5vw, 3rem); /* Fluid scaling title */
  margin-bottom: 0.5em;
}

b, strong {
  color: var(--text-emphasis);
  font-weight: bold;
}

.small {
  font-size: 0.85em;
}

blockquote {
  font-size: 0.95em;
  font-style: italic;
  margin: 1.5em 1em;
  padding-left: 1em;
  border-left: 2px solid var(--text-secondary);
}

/* ============= */
/*  Links        */
/* ============= */
a {
  color: var(--text-link);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--text-emphasis);
  text-decoration: underline;
}

span.date + a > h3 {
  margin-top: 0.2em;
}

/* ============= */
/*  Navigation   */
/* ============= */
nav {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(0.5em, 0.5em + 0.5vw, 1em); /* Fluid gap */
  font-size: clamp(1rem, 0.9rem + 0.5vw, 1.25rem); /* Fluid nav font size */
  margin-bottom: 1.5em;
}

nav a {
  margin-right: 0.4em;
  white-space: nowrap;
}

nav a:hover {
  text-decoration: underline;
}

/* ============= */
/*  Code Blocks  */
/* ============= */
pre, code {
  overflow-x: auto;
  max-width: 100%;
  white-space: pre-wrap;
  word-wrap: break-word;
  word-break: break-word;
  border-radius: 4px;
  font-size: 0.9em;
}

pre {
  padding: 1em;
}

p:has(+pre) {
  margin-bottom: 0;
}
p+pre {
  margin-top: 5px;
}

/* ============= */
/*  Components   */
/* ============= */
.block {
  border: 1px dotted var(--border-color);
  padding: clamp(0.5em, 0.5em + 0.5vw, 1em); /* Fluid padding */
  margin: clamp(0.5em, 0.5em + 0.5vw, 1em); /* Fluid margins */
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.block h1 {
  font-size: 1em;
  margin-bottom: 0;
}

.wave {
  background: var(--bg-primary);
  color: var(--text-emphasis);
  text-shadow: 1px 1px 10px var(--text-emphasis), 
               1px 1px 10px var(--text-primary);
}

/* ============= */
/*  Footer       */
/* ============= */
footer {
  margin-top: 2em;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.9em;
  color: var(--text-secondary);
}

footer hr {
  width: 100%;
  border: 0;
  height: 1px;
  background-color: var(--text-secondary);
  opacity: 0.2;
  margin: 1em 0;
}

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

/* Medium devices (tablets, 600px and up) */
@media screen and (min-width: 600px) {
  body {
    padding: 20px 5%;
  }
  
  blockquote {
    margin: 1.5em 2em;
  }
  
  pre, code {
    font-size: 0.95em;
  }
}

/* Large devices (desktops, 900px and up) */
@media screen and (min-width: 900px) {
  body {
    padding: 25px 5%;
  }
  
  .site-title {
    margin-bottom: 0.75em;
  }
  
  nav {
    margin-bottom: 2em;
  }
}

/* Small devices (mobile, up to 480px) */
@media screen and (max-width: 480px) {
  body {
    padding: 15px 3%;
  }
  
  nav {
    gap: 0.6em;
  }
}

/* Very small devices (320px and below) */
@media screen and (max-width: 320px) {
  nav {
    flex-direction: column;
    gap: 0.5em;
  }
}
