/* coding interface styling
--------------------------------------------------------
*/
:root {
  --bg: #0d1117;
  --bg-2: #161b22;
  --panel: #0d1117;
  --panel-alt: #161b22;
  --line: #30363d;
  --line-soft: #21262d;
  --text: #c9d1d9;
  --muted: #8b949e;
  --primary: #58a6ff;
  --secondary: #a5d6ff;
  --accent: #3fb950;
  --warning: #d29922;
  --glow: rgba(88, 166, 255, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--text);
  line-height: 1.7;
  letter-spacing: normal;
  font-weight: 400;
  overflow-y: scroll;
  position: relative;
  animation: fadeInBody 0.35s ease-out;
}

@keyframes fadeInBody {
  from { opacity: 0; }
  to { opacity: 1; }
}

body::before,
body::after {
  content: "############################################################";
  position: fixed;
  left: 1rem;
  right: 1rem;
  font-family: "Consolas", monospace;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: rgba(88, 166, 255, 0.28);
  line-height: 1;
  pointer-events: none;
}

body::before {
  top: 0.5rem;
}

body::after {
  bottom: 0.5rem;
}

img {
  max-width: 100%;
  height: auto;
  border: 0;
  display: block;
}

p,
ul,
ol {
  margin-top: 0;
  color: var(--muted);
}

p::before,
li::before {
  content: "";
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0 0 0.8rem;
  color: var(--text);
  line-height: 1.2;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.45rem;
  font-weight: 500;
  letter-spacing: normal;
  text-transform: none;
}

h1 { font-size: 2.1rem; }
h2 { font-size: 1.7rem; }
h3 { font-size: 1.3rem; }

/* links
--------------------------------------------------------
*/
a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

a:hover {
  color: var(--secondary);
  text-decoration: underline;
  transform: translateY(-1px);
}

/* page structure
--------------------------------------------------------
*/
header#top,
div#content,
footer#bottom {
  margin: 0 auto;
  width: min(1100px, calc(100% - 2rem));
}

header#top {
  padding: 1.5rem 0 0.8rem;
  position: relative;
  animation: slideDown 0.45s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

header#top::before {
  content: "// project: webbserver / status: online // version: 1.0.0";
  display: block;
  font-family: "Consolas", monospace;
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: lowercase;
  margin-bottom: 0.75rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 0.45rem 0;
}

/* main content area */
div#content {
  overflow: auto;
  padding: 1.5rem 1rem 2rem;
  margin-top: 1rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 2px solid var(--primary);
  border-radius: 1px;
  box-shadow: none;
  position: relative;
  animation: panelGlow 0.5s ease-out;
}

@keyframes panelGlow {
  from {
    opacity: 0;
    box-shadow: 0 0 0 rgba(88, 166, 255, 0);
  }
  to {
    opacity: 1;
    box-shadow: 0 0 0 rgba(88, 166, 255, 0);
  }
}

div#content::before,
div#content::after {
  content: ">> ----------------------------------------------- <<";
  display: block;
  font-family: "Consolas", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: rgba(88, 166, 255, 0.38);
  white-space: nowrap;
  overflow: hidden;
}

div#content::after {
  margin-top: 1rem;
  content: ">> // end of section -------------------------------- <<";
}

article {
  width: calc(100% - 290px);
  float: left;
  padding-right: 1rem;
}

aside {
  float: left;
  width: 250px;
  margin-right: 1.25rem;
  padding: 1rem;
  background: var(--panel-alt);
  border: 1px solid var(--line-soft);
  border-radius: 1px;
  box-shadow: none;
}

/* footer */
footer#bottom {
  font: normal 0.9rem/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--muted);
  background: #0b1016;
  padding: 1rem 1.25rem 1.5rem;
  margin-top: 2rem;
  border-top: 1px solid var(--line);
  border-radius: 1px 1px 0 0;
  position: relative;
}

footer#bottom::before {
  content: "// footer: html css js php / version: 1.0.0";
  display: block;
  font-family: "Consolas", monospace;
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.45rem;
}

footer#bottom a {
  color: var(--primary);
}

footer#bottom a:hover {
  color: var(--secondary);
}

/* logo text */
.logga {
  display: block;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: clamp(2rem, 3vw, 3.2rem);
  font-weight: 600;
  letter-spacing: normal;
  color: var(--text);
  margin-bottom: 0.9rem;
  text-transform: none;
}

/* navigation menu
--------------------------------------------------------
*/
nav.navmenu {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-weight: 500;
  padding: 0.7rem 0.8rem;
  background: var(--panel-alt);
  border: 1px solid var(--line-soft);
  border-radius: 1px;
  box-shadow: none;
}

nav.navmenu a {
  padding: 0.7rem 1rem;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 1px;
  color: var(--text);
  background: transparent;
  font-size: 0.9rem;
  text-transform: none;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

nav.navmenu a:hover {
  background: rgba(56, 139, 253, 0.08);
  border-color: var(--line);
  text-decoration: none;
  transform: translateY(-1px);
}

/* figure & figcaption
--------------------------------------------------------
*/
figure {
  border: 1px solid var(--line-soft);
  padding: 0.7rem;
  margin: 1rem 0;
  background: #0b1016;
  border-radius: 1px;
  box-shadow: none;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

figure:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
}

figcaption {
  font-style: italic;
  font-size: 0.85rem;
  color: var(--muted);
  padding-left: 0.5rem;
  padding-top: 0.5rem;
}

figure.right { margin: 0 0 1rem 1.5rem; }
figure.top { margin-top: 0; }

/* Misc classes
--------------------------------------------------------
*/
.right { float: right; }
.left { float: left; }

/* highlight current choice in navigation menu
--------------------------------------------------------
*/
body#start a#start-,
body#comments a#comments-,
body#exercises a#exercises-,
body#viewsource a#viewsource- {
  background: rgba(56, 139, 253, 0.12);
  border: 1px solid var(--primary);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(88, 166, 255, 0.16);
}

/* responsiveness
--------------------------------------------------------
*/
@media (max-width: 800px) {
  article,
  aside {
    float: none;
    width: 100%;
    margin-right: 0;
    padding-right: 0;
  }

  nav.navmenu {
    flex-direction: column;
  }

  div#content {
    padding: 1rem 0.9rem 1.5rem;
  }
}