/* =============================
   General Page Styles
   ============================= */
*,
*::before,
*::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: #1f2937;            /* slate-800 */
  background: #f8fafc;       /* slate-50 */
}

/* A simple page width constraint for nicer line lengths */
body {
  max-width: 1100px;
  margin: 0 auto;
}

/* Utility spacing */
:root {
  --gap: 1rem;
  --nav-width: 25%;
  --main-width: 70%;
  --accent: #0ea5e9;   /* sky-500 */
  --accent-dark: #0369a1; /* sky-800 */
  --header-bg: #0f172a;  /* slate-900 */
  --header-fg: #e2e8f0;  /* slate-200 */
  --footer-bg: #0f172a;
  --footer-fg: #e2e8f0;
  --card-bg: #ffffff;
}

/* =============================
   Header Styles
   ============================= */
header {
  background: var(--header-bg);
  color: var(--header-fg);
  padding: 2rem 1.25rem;
  text-align: center;          /* centered header text */
  border-bottom: 4px solid var(--accent);
}

header h1 {
  margin: 0 0 .25rem 0;
  font-size: clamp(1.5rem, 2.8vw, 2.25rem);
  letter-spacing: 0.3px;
}

header .tagline {
  margin: 0;
  opacity: 0.9;
}

/* =============================
   Navigation Styles
   ============================= */
nav {
  float: left;                  /* Two-column: nav floats left */
  width: var(--nav-width);
  padding: 1rem;
  margin-top: var(--gap);
  background: var(--card-bg);
  border: 1px solid #e5e7eb;    /* slate-200 */
  border-radius: 8px;
}

/* OPTIONAL: Fixed nav experiment
   --------------------------------
   To try fixed navigation, add class "fixed-nav" to <nav> in the HTML.
   This pins the nav while scrolling and reserves space in the layout.
*/
nav.fixed-nav {
  position: fixed;
  top: 120px;         /* approximate header height */
  left: calc(50% - 550px); /* centers fixed nav relative to page max-width */
  width: calc(var(--nav-width) - 6px); /* account for border/padding visually */
  z-index: 1000;
}

nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .5rem;
}

nav ul li a {
  display: block;
  padding: .5rem .75rem;
  text-decoration: none;
  color: #111827; /* gray-900 */
  border-radius: 6px;
  transition: color .15s ease, background-color .15s ease;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
}

/* Hover effect for links */
nav ul li a:hover {
  color: #ffffff;
  background: var(--accent);
  border-color: var(--accent);
}

/* =============================
   Main Content Styles
   ============================= */
main {
  float: right;                 /* Two-column: main floats right */
  width: var(--main-width);
  padding: 1rem;
  margin-top: var(--gap);
  background: var(--card-bg);
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  min-height: 60vh;
}

main h2 {
  margin-top: 0;
}

article, section {
  margin-bottom: 1.25rem;
}

/* If the nav is fixed, give main a left margin so text doesn't hide under it */
nav.fixed-nav + main {
  margin-left: calc(var(--nav-width) + var(--gap));
}

/* =============================
   Footer Styles
   ============================= */
footer {
  clear: both;                  /* Ensure footer stays below floated columns */
  background: var(--footer-bg);
  color: var(--footer-fg);
  text-align: center;           /* centered footer text */
  padding: 1.25rem .75rem;
  margin-top: 1.5rem;
  border-top: 4px solid var(--accent);
}

footer a {
  color: var(--accent);
  text-decoration: none;
  padding: .25rem .5rem;
  border-radius: 4px;
  transition: background-color .15s ease, color .15s ease;
}

footer a:hover {
  background: var(--accent);
  color: #fff;
}

/* =============================
   Responsive (stack on small screens)
   ============================= */
@media (max-width: 900px) {
  :root {
    --nav-width: 100%;
    --main-width: 100%;
  }
  nav,
  main {
    float: none;
    width: 100%;
  }
  nav.fixed-nav {
    position: static; /* disable fixed on small screens for usability */
    left: auto;
    top: auto;
  }
}
