@import "./syntax.css";

:root {
  /* Base palette */
  --color-red-500: #f7768e;          
  --color-orange-400: #ff9e64;       
  --color-amber-400: #e0af68;        
  --color-stone-200: #cfc9c2;         
  --color-green-400: #9ece6a;        
  --color-teal-300: #73daca;         
  --color-cyan-200: #b4f9f8;         
  --color-sky-300: #2ac3de;
  --color-sky-400: #7dcfff;          
  --color-indigo-400: #7aa2f7;       
  --color-violet-400: #bb9af7;       
  --color-slate-200: #c0caf5;        
  --color-slate-300: #a9b1d6;        
  --color-slate-400: #9aa5ce;        
  --color-slate-600: #565f89;        
  --color-slate-800: #414868;        
  --color-night-900: #1a1b26;        

  /* Surfaces */
  --bg-surface-blur: rgba(36, 40, 59, 0.5); 
}

body {
  font-family: "Lora", serif;
  margin: 0;
  padding: 0;
  background-color: var(--color-night-900);
  background-image:
    linear-gradient(rgba(26, 27, 38, 0.8), rgba(26, 27, 38, 0.85)),
    url("./background.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--color-slate-200);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
  padding: 1rem 20%;
  position: sticky;
  line-height: 1.5;
}

header {
  background: var(--bg-surface-blur);
  position: fixed;
  color: var(--color-slate-200);
  padding: 1rem 20%;
  position: sticky;
  z-index: 1000;
}

header nav {
  font-size: 1.25rem;
}

.flex-wrapper {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.flex-wrapper > div {
  order: 2;
}

.flex-wrapper > aside {
  order: 1 !important;
}

details {
  background: var(--bg-surface-blur);
  padding: 0.5rem;
}

summary {
  color: var(--color-sky-400);
  cursor: pointer;
  list-style-type: none;
}

summary::marker {
  font-family: "JetBrains Mono", monospace;
  content: "+\00A0";
}
details[open] > summary::marker { content: "-\00A0"; }

footer {
  background: var(--bg-surface-blur);
  color: var(--color-slate-200);
  text-align: center;
  padding: 1rem;
}

section { margin-bottom: 2rem; }

h1, h2, h3, h4, h5, h6 {
  font-weight: normal;
  color: var(--color-sky-400);
  margin-bottom: 1rem;
}

pre {
  font-family: "JetBrains Mono", monospace;
  background: var(--bg-surface-blur);
  padding: 0.75rem 0.75rem;
  box-sizing: border-box;
  overflow-x: auto;
  white-space: pre;
  line-height: 1.375;
}

code {
  font-family: "JetBrains Mono", monospace;
}

p code,
span code {
  display: inline;
}

pre code {
  white-space: pre;
  display: block;
}

math {
  overflow-x: auto;
  overflow-y: clip;
  max-width: 100%;
}

math[display="block"] {
  font-size: 115%;
  margin: 1rem 1rem;
}

blockquote {
  border-left: 5px solid var(--color-violet-400);
  background: var(--bg-surface-blur);
  margin: 1rem 0;
  padding-left: 1rem;
}

ul,
ol {
  list-style-position: outside;
  padding-left: 0;
  margin-left: 1rem;
}

ul ul, ol ol, ul ol, ol ul {
  list-style-position: outside;
  padding-left: 0rem;
  margin-left: 1rem;
}

ul, ul ul ul { list-style-type: disc; }
ul ul, ul ul ul ul { list-style-type: square; }

li {
  padding-left: 0.5rem;
}

a,
a * {
  color: var(--color-indigo-400);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
}

hr {
  color: var(--color-indigo-400);
  border-color: var(--color-indigo-400);
}

header nav {
  display: flex;
  gap: 2rem;
  align-items: center;
}

header nav ul {
  list-style: none;
  margin: 0;
  display: flex;
  gap: 2rem;
}

header nav ul li {
  display: inline;
}

.ascii {
  color: var(--color-teal-300);
}

@media (max-width: 768px) {
  body {
    background-position: right center;
  }
  header,
  footer,
  main {
    padding: 1rem 1rem;
    overflow-wrap: anywhere;
    word-break: break-word; /* fallback/help for some engines */
    hyphens: auto;          /* optional, nicer breaks for prose */
  }

  math {
    font-size: 100%;
    max-width: 100%;
    margin-left: 0;
  }
}
