/* ==========================================================================
   Chris Bierbower Portfolio - Styles
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Custom Properties (Design Tokens)
   -------------------------------------------------------------------------- */
:root {
  /* Colors */
  --color-bg: #ffffff;
  --color-title: #222;
  --color-subtitle: #ddd;
  --color-nav: #999;
  --color-nav-active: #111;
  --color-card-label: #404040;
  --color-body-text: #575757;
  --color-card-fallback: #eee;

  /* Typography - Using Google Fonts alternatives */
  --font-heading: 'Jost', sans-serif;      /* Replaces Futura PT */
  --font-body: 'Inter', sans-serif;        /* Replaces Proxima Nova */

  /* Spacing */
  --padding-outer: 75px;
  --padding-outer-mobile: 20px;
  --header-margin: 40px;
  --header-margin-mobile: 30px;
  --nav-gap: 30px;
  --grid-gutter: 3%;

  /* Breakpoint */
  --breakpoint-mobile: 750px;
}

/* --------------------------------------------------------------------------
   Reset & Base
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.6em;
  color: var(--color-title);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* --------------------------------------------------------------------------
   Layout - Page Container
   -------------------------------------------------------------------------- */
.canvas {
  padding: var(--padding-outer);
  max-width: 1400px;
  margin: 0 auto;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--header-margin);
}

.header::after {
  content: '';
  display: table;
  clear: both;
}

/* Logo / Site Title */
.logo-wrapper {
  flex-shrink: 0;
}

.logo {
  font-family: var(--font-heading);
  font-size: 42px;
  font-weight: 700;
  color: var(--color-title);
  line-height: 1.2em;
  margin: 0;
}

.logo a {
  color: inherit;
}

.logo-subtitle {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 400;
  color: var(--color-subtitle);
  margin-top: 0.7em;
}

/* --------------------------------------------------------------------------
   Navigation
   -------------------------------------------------------------------------- */
.nav {
  display: flex;
  align-items: center;
  margin-left: auto; /* Push nav to the right */
}

.nav-list {
  display: flex;
  gap: var(--nav-gap);
}

.nav-link {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 400;
  color: var(--color-nav);
  line-height: 26px;
  transition: color 0.15s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--color-nav-active);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 400;
  color: var(--color-nav);
  letter-spacing: 1px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

/* Hidden checkbox for CSS-only mobile menu */
.mobile-menu-checkbox {
  display: none;
}

/* --------------------------------------------------------------------------
   Project Grid (Logo Cards)
   -------------------------------------------------------------------------- */
.project-grid {
  width: calc(100% + var(--grid-gutter));
  margin-left: calc(var(--grid-gutter) * -1);
  margin-top: calc(var(--grid-gutter) * -1);
  display: flex;
  flex-wrap: wrap;
}

.project-grid::after {
  content: '';
  display: table;
  clear: both;
}

.project {
  width: 30.42071197%;
  margin-left: 2.91262136%;
  margin-top: var(--grid-gutter);
}

/* Force new row every 3 items on desktop */
.project:nth-child(3n + 1) {
  clear: left;
}

/* Project Image Container */
.project-image {
  background: var(--color-card-fallback);
  margin-bottom: var(--grid-gutter);
  position: relative;
}

/* Square aspect ratio using padding trick */
.project-image::before {
  content: '';
  display: block;
  padding-bottom: 100%;
}

.project-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.14s ease-out;
}

.project:hover .project-image img {
  opacity: 0.8;
}

/* Project Title / Label */
.project-title {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 300;
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1.6em;
  text-align: center;
  color: var(--color-card-label);
}

/* --------------------------------------------------------------------------
   About Page
   -------------------------------------------------------------------------- */
.about-content {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.headshot {
  width: 280px;
  height: 280px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 50px;
}

.bio {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 300;
  line-height: 1.8em;
  color: var(--color-body-text);
  text-align: left;
}

.bio p {
  margin: 0 0 1em;
}

/* --------------------------------------------------------------------------
   Responsive - Mobile (max-width: 750px)
   -------------------------------------------------------------------------- */
@media only screen and (max-width: 750px) {
  /* Page Container */
  .canvas {
    padding: var(--padding-outer-mobile);
  }

  /* Header - Stack and Center */
  .header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: var(--header-margin-mobile);
  }

  /* On mobile: Menu first, then logo */
  .logo-wrapper {
    order: 2;
  }

  .mobile-menu-checkbox {
    order: 1;
  }

  .nav {
    order: 1;
    margin-left: 0; /* Reset desktop right-align */
    width: 100%;
  }

  .logo {
    text-align: center;
    letter-spacing: 0;
    margin: 0;
  }

  .logo-subtitle {
    text-align: center;
  }

  /* Navigation - Hide desktop, show mobile toggle */
  .nav {
    order: 1;
    width: 100%;
    flex-direction: column;
    margin-bottom: 15px;
  }

  .nav-list {
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 0;
    /* Accordion animation */
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s ease-in-out, padding 0.2s ease-in-out;
  }

  .nav-link {
    font-size: 13px;
    letter-spacing: 1px;
  }

  .mobile-menu-toggle {
    display: block;
  }

  /* Show nav when checkbox is checked (checkbox is sibling of .nav) */
  .mobile-menu-checkbox:checked + .nav .nav-list {
    max-height: 150px; /* Enough for 3 items */
    padding: 15px 0;
    border-top: 1px solid var(--color-subtitle); /* Divider below "Menu" */
    margin-top: 10px;
  }

  /* Hide checkbox visually but keep it functional */
  .mobile-menu-checkbox {
    position: absolute;
    opacity: 0;
    pointer-events: none;
  }

  /* Project Grid - 2 columns */
  .project {
    width: 47.08737864%;
  }

  /* Override desktop clear rule */
  .project:nth-child(3n + 1) {
    clear: none;
  }

  /* New row every 2 items on mobile */
  .project:nth-child(odd) {
    clear: left;
  }

  /* About Page */
  .headshot {
    width: 200px;
    height: 200px;
    margin-bottom: 30px;
  }

  .about-content {
    padding: 0 10px;
  }
}

/* --------------------------------------------------------------------------
   Utility Classes
   -------------------------------------------------------------------------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.clearfix::after {
  content: '';
  display: table;
  clear: both;
}
