/* =========================================================
   brandonmurveit.com — shared styles
   Every page loads this one file, so a change here changes
   the whole site.
   ========================================================= */

/* ---------- 0. Fonts ----------
   The font files live in assets/fonts, so the site loads them from
   itself instead of from Google. Space Grotesk is for headings and
   labels, DM Sans for everything else. */
@font-face { font-family: "Space Grotesk"; src: url(../assets/fonts/space-grotesk-latin-500-normal.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url(../assets/fonts/space-grotesk-latin-600-normal.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url(../assets/fonts/space-grotesk-latin-700-normal.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url(../assets/fonts/dm-sans-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url(../assets/fonts/dm-sans-latin-400-italic.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url(../assets/fonts/dm-sans-latin-500-normal.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url(../assets/fonts/dm-sans-latin-600-normal.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url(../assets/fonts/dm-sans-latin-700-normal.woff2) format("woff2"); font-weight: 700; font-display: swap; }

/* ---------- 1. Color tokens ----------
   A "token" is a named color. Pages use the names, never the
   raw codes, so swapping a color means editing one line here. */
:root {
  --bg:        #0a0f1d;   /* page background: deep navy */
  --panel:     #101829;   /* cards, header */
  --line:      #1f2b44;   /* borders */
  --text:      #e9edf5;   /* main text */
  --muted:     #8e9bb4;   /* secondary text */

  --accent-pro:           #38d9c4;   /* teal: professional pages */
  --accent-pro-deep:      #0d4a52;   /* darker teal for background glows */
  --accent-personal:      #ff7a59;   /* coral: personal pages */
  --accent-personal-deep: #6b2414;   /* dark coral for background glows */

  /* The colors the page actually uses. Professional by default. */
  --accent: var(--accent-pro);
  --accent-deep: var(--accent-pro-deep);

  /* Faint honeycomb pattern for page headers, a nod to Terraforming Mars.
     It's a tiny drawing (SVG) written right into the CSS. */
  --hex: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48.5' height='84'%3E%3Cpath d='M24.25 0 L48.5 14 L48.5 42 L24.25 56 L0 42 L0 14 Z M24.25 56 L24.25 84' fill='none' stroke='%2338d9c4' stroke-opacity='0.13' stroke-width='1'/%3E%3C/svg%3E");
}

/* Personal pages put class="personal" on <body>, which swaps
   the accent. That one line is the whole two-mood system.
   Any single section can use it too, like the "My #1s" row. */
.personal {
  --accent: var(--accent-personal);
  --accent-deep: var(--accent-personal-deep);
  --hex: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48.5' height='84'%3E%3Cpath d='M24.25 0 L48.5 14 L48.5 42 L24.25 56 L0 42 L0 14 Z M24.25 56 L24.25 84' fill='none' stroke='%23ff7a59' stroke-opacity='0.13' stroke-width='1'/%3E%3C/svg%3E");
}

/* ---------- 2. Base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "DM Sans", system-ui, sans-serif;
  line-height: 1.6;
}

/* Headings, the name in the corner, and the menu use Space Grotesk */
h1, h2, h3, .brand, .nav a { font-family: "Space Grotesk", system-ui, sans-serif; }

a { color: inherit; }

/* Small all-caps labels */
.label {
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 32px; }

/* ---------- 3. Top navigation bar ---------- */
.topbar {
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand {
  font-weight: 700;
  font-size: 17px;
  line-height: 1.05;
  text-decoration: none;
  letter-spacing: -0.01em;
}

.nav { display: flex; align-items: center; gap: 22px; }
.nav > a, .menu-btn {
  font-family: "Space Grotesk", system-ui, sans-serif;
  text-decoration: none;
  color: var(--muted);
  font-size: 15px;
}
.nav > a:hover, .nav > a[aria-current="page"] { color: var(--text); }
.nav > a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--accent); padding-bottom: 4px; }

/* "Get in touch" is a solid button */
.nav a.cta {
  background: var(--accent);
  color: #0b0c0f;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 4px;
  box-shadow: none;
}

/* ---------- Drop-down menus ----------
   Each menu is a button plus a hidden list (the "panel").
   The panel shows on hover (computers) or when js/nav.js adds
   the class "is-open" (clicks and taps). */
.menu { position: relative; }
.menu-btn {
  font: inherit;
  font-family: "Space Grotesk", system-ui, sans-serif;
  background: none;
  border: none;
  padding: 6px 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.menu-btn:hover, .menu.is-open .menu-btn, .menu.is-current .menu-btn { color: var(--text); }
.menu.is-current .menu-btn { box-shadow: inset 0 -2px 0 var(--accent); }

/* small down-arrow made from two borders, like on BoardGameGeek */
.caret {
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform .15s;
}
.menu:hover .caret, .menu.is-open .caret { transform: rotate(-135deg) translateY(-1px); }

.menu-panel {
  list-style: none;
  margin: 0;
  padding: 6px;
  position: absolute;
  top: 100%;
  left: -12px;
  min-width: 210px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 2px solid var(--accent);
  border-radius: 6px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .45);
  z-index: 20;
  /* hidden until opened */
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity .12s, transform .12s, visibility .12s;
}
.menu:hover .menu-panel,
.menu:focus-within .menu-panel,
.menu.is-open .menu-panel { opacity: 1; visibility: visible; transform: none; }

.menu-panel a {
  display: block;
  padding: 8px 12px;
  border-radius: 4px;
  text-decoration: none;
  color: var(--text);
  font-size: 15px;
  white-space: nowrap;
}
.menu-panel a:hover, .menu-panel a:focus { background: var(--bg); color: var(--accent); }

/* Personal menus use coral, even on teal pages */
.menu:nth-of-type(3) .menu-panel, .menu:nth-of-type(4) .menu-panel { border-top-color: var(--accent-personal); }

/* ---------- 4. Shared pieces ---------- */
.icons { display: flex; gap: 18px; }
.icons a { color: var(--muted); display: inline-flex; }
.icons a:hover { color: var(--accent); }
.icons svg { width: 22px; height: 22px; }

.portrait {
  border: 1px solid var(--line);
  padding: 6px;
  border-radius: 4px;
  aspect-ratio: 3 / 4;
}
.portrait img, .portrait .placeholder {
  width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 2px;
}
.portrait .placeholder {
  display: grid; place-items: center;
  background: var(--panel); color: var(--accent);
  font-size: 48px; font-weight: 700;
}

/* Page header band used at the top of every page except Home */
.page-head {
  border-bottom: 1px solid var(--line);
  background: var(--hex),
    linear-gradient(180deg, color-mix(in srgb, var(--accent-deep) 45%, transparent), transparent 80%);
}
.page-head .wrap { padding-top: 56px; padding-bottom: 48px; }
.label.accent { color: var(--accent); margin: 0 0 10px; }
.page-head h1 { font-size: 40px; line-height: 1.1; letter-spacing: -0.02em; margin: 0 0 12px; }
.lede { color: var(--muted); font-size: 18px; margin: 0; max-width: 60ch; }

/* ---------- 5. Phones ---------- */
@media (max-width: 800px) {
  .wrap { padding: 0 16px; }
  .topbar .wrap { height: auto; padding-top: 14px; padding-bottom: 14px; flex-wrap: wrap; gap: 10px; }
  .nav { gap: 14px; flex-wrap: wrap; }
  .nav > a, .menu-btn { font-size: 14px; }
  .nav a.cta { padding: 6px 12px; }
  /* Phones: each menu opens as a full-width panel under the menu row,
     so it can never run off the edge of the screen. */
  .nav { position: relative; }
  .menu { position: static; }
  .menu-panel { left: 0; right: 0; min-width: 0; top: calc(100% + 4px); }
  .menu:hover .menu-panel { opacity: 0; visibility: hidden; } /* phones: open by tap only */
  .menu.is-open .menu-panel { opacity: 1; visibility: visible; transform: none; }
  .page-head .wrap { padding-top: 32px; padding-bottom: 32px; }
  .page-head h1 { font-size: 30px; }
  .lede { font-size: 16px; }
}
