/*
 * style.css — the one stylesheet shared by every page on the site.
 *
 * Every HTML page links to this file with:
 *   <link rel="stylesheet" href="/style.css">
 * so a change here changes the whole site at once.
 *
 * Layout of this file, top to bottom:
 *   1. Color + font variables (change the look of the site here)
 *   2. Base page styles (body, text, links)
 *   3. Header + navigation
 *   4. Main content area
 *   5. Reusable pieces (lists of posts, portfolio items, resume entries)
 *   6. Footer
 *   7. Small-screen adjustments
 */


/* ------------------------------------------------------------------
 * 1. Variables
 *
 * CSS custom properties ("variables") defined on :root are available
 * everywhere. Use them with var(--name). Change a value here and every
 * place that uses it updates.
 * ------------------------------------------------------------------ */
:root {
  /* Monochrome palette: everything is a shade of gray, darkest to lightest. */
  --bg: #0b0b0b;          /* page background: near-black, softer than pure #000 */
  --surface: #161616;     /* slightly lighter panels (unused now, handy later) */
  --border: #2a2a2a;      /* thin divider lines */
  --muted: #8a8a8a;       /* secondary text: dates, labels, the footer */
  --text: #d8d8d8;        /* main body text: light gray, easier on the eyes than white */
  --heading: #ffffff;     /* headings and the site name: full white for contrast */

  /* Helvetica first. Linux and Windows rarely have it installed, so the
   * browser falls through the list until it finds a font it has.
   * Arial is metrically almost identical to Helvetica. */
  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;

  /* Maximum width of the text column. ~40rem keeps lines readable
   * (roughly 70–80 characters per line). */
  --measure: 40rem;

  /* Tell the browser this is a dark page, so built-in things like
   * scrollbars and form controls are drawn dark too. */
  color-scheme: dark;
}


/* ------------------------------------------------------------------
 * 2. Base styles
 * ------------------------------------------------------------------ */

/* Make width/height include padding and borders. Without this, adding
 * padding to a box makes it wider than you asked for. */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  /* Keep phone browsers from enlarging text on their own when rotated. */
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;     /* 17px: a bit larger than the 16px default */
  line-height: 1.6;         /* space between lines of text */

  /* Stack header, main and footer vertically, and let main grow to fill
   * the leftover space. This keeps the footer at the bottom of the
   * window even on short pages. */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* All headings share the same font weight and color. */
h1,
h2,
h3 {
  color: var(--heading);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;  /* Helvetica headings look better slightly tightened */
}

h1 {
  font-size: 2.25rem;
  margin: 0 0 1.5rem;
}

h2 {
  font-size: 1.25rem;
  margin: 2.5rem 0 1rem;
}

h3 {
  font-size: 1.0625rem;
  margin: 0;
}

p {
  margin: 0 0 1rem;
}

/* Links are underlined (so they're recognizable without color) and turn
 * white on hover. */
a {
  color: var(--heading);
  text-decoration: underline;
  text-decoration-color: var(--muted);
  text-underline-offset: 0.2em;
}

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

/* Visible outline when a link is reached with the keyboard (Tab key). */
a:focus-visible {
  outline: 2px solid var(--heading);
  outline-offset: 3px;
}

/* A thin horizontal line, if you ever use <hr>. */
hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

/* Gray, smaller text for secondary details. Use with class="muted". */
.muted {
  color: var(--muted);
}


/* ------------------------------------------------------------------
 * 3. Header and navigation
 * ------------------------------------------------------------------ */

.site-header {
  /* Center the header contents in a column the same width as the text. */
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 2.5rem 1rem 0;

  /* Site name on the left, nav links on the right. flex-wrap lets the
   * nav drop below the name on narrow screens instead of overflowing. */
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}

/* The site name in the top-left corner, which links back home. */
.site-name {
  color: var(--heading);
  font-weight: 700;
  text-decoration: none;
  letter-spacing: -0.01em;
}

/* The nav is a plain list of links laid out in a row. */
.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--heading);
}

/* The link for the page you're on. Each page marks its own nav link with
 * aria-current="page", which also tells screen readers where you are. */
.site-nav a[aria-current="page"] {
  color: var(--heading);
}


/* ------------------------------------------------------------------
 * 4. Main content area
 * ------------------------------------------------------------------ */

main {
  flex: 1;                  /* grow to push the footer down (see body) */
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 4rem 1rem;
}

/* The big opening sentence on the home page. */
.intro {
  font-size: 1.5rem;
  line-height: 1.4;
  color: var(--heading);
  margin-bottom: 1.5rem;
}


/* ------------------------------------------------------------------
 * 5. Reusable pieces
 * ------------------------------------------------------------------ */

/* A list of items with a line between each one. Used for the blog post
 * list, portfolio projects and resume entries:
 *
 *   <ul class="entries">
 *     <li> ... </li>
 *   </ul>
 */
.entries {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--border);
}

.entries > li {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
}

/* The top row of an entry: title on the left, date/years on the right. */
.entry-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.25rem 1rem;
}

/* Dates and years: gray, and digits all the same width so columns of
 * dates line up neatly. */
.entry-date {
  color: var(--muted);
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* The description under an entry's title. */
.entries p {
  margin: 0.5rem 0 0;
}

/* Small gray label under a title, e.g. a job's company or a project's
 * tools. */
.entry-meta {
  color: var(--muted);
  font-size: 0.9375rem;
  margin-top: 0.25rem;
}

/* Bulleted lists inside entries (e.g. resume highlights). */
.entries ul {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
}

/* A simple bulleted list of short items, e.g. resume skills. */
.plain-list {
  margin: 0;
  padding-left: 1.25rem;
}


/* ------------------------------------------------------------------
 * 6. Footer
 * ------------------------------------------------------------------ */

.site-footer {
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 2rem 1rem 2.5rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.875rem;

  /* Copyright on the left, links on the right. */
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}

.site-footer a {
  color: var(--muted);
}


/* ------------------------------------------------------------------
 * 7. Small screens (phones)
 *
 * Everything inside this block only applies when the window is 600px
 * wide or less.
 * ------------------------------------------------------------------ */
@media (max-width: 600px) {
  body {
    font-size: 1rem;
  }

  h1 {
    font-size: 1.75rem;
  }

  .intro {
    font-size: 1.25rem;
  }

  .site-header {
    padding-top: 1.5rem;
  }

  main {
    padding: 2.5rem 1rem;
  }
}
