/* Reset default browser spacing and sizing */
/* Styles for Portfolio.html: project overview, project previews, header, and footer. */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Site-wide colors and typography tokens */
:root {
    --color-1: #23513AFF;
    --color-2: #740C00FF;
    --color-3: #FDCD00FF;
    --color-4: #F0eFF4FF;
    --color-5: #212529FF;
    --font-1: 'Roboto Mono', monospace;
    --font-2: 'Inter', sans-serif;
    font-size: 16px;
}

/* Default text color */
body {
    background-color: var(--color-4);
    font-family: var(--font-1);
    color: var(--color-5);
}

/* Header and brand layout */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--color-4);
    padding: 10px 20px;
}

#logo {
    height: 75px;
    width: auto;
    padding: 5;
    margin: 0;
}

/* Brand name and slogan */
.brand {
    display: flex;
    flex-direction: column;
}

.brand h1 {
    color: var(--color-1);
}

.brand p  {
    color: var(--color-2);
}

.brand a {
    text-decoration: none;
}

/* Main navigation links */
.nav {
    list-style: none;
    display: flex;
    align-items: center;
}

.nav-item a {
    color: var(--color-1);
    text-decoration: none;
    padding: 14px 16px;
    font-size: 1rem;
    display: block;
}

.nav-item a:hover {
    background-color: var(--color-2);
    color: var(--color-3);
}

/* Portfolio dropdown menu */
.dropdown {
    position: relative;
}

.dropdown-item {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 160px;
    list-style: none;
    background-color: var(--color-4);
    z-index: 100;
}

.dropdown:hover .dropdown-item,
.dropdown:focus-within .dropdown-item {
    display: block;
}

/* Introductory project copy and expandable workflow steps. */
.general-project {
    margin: 0 3rem;
    padding: 3rem 0 1rem;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem;
}

.general-project > .general-information,
.fold-down {
    min-width: 0;
    padding: clamp(1.25rem, 3vw, 2rem);
    border: 2px solid var(--color-1);
    border-radius: 1rem;
    background: var(--color-4);
}

.general-project h2 {
    padding-bottom: 1.25rem;
    font-size: 1.5rem;
}

/* Expandable step headings and their descriptive text. */
.fold-down details {
    border-bottom: 1px solid var(--color-5);
}

.fold-down summary {
    display: block;
    padding: 1rem;
    cursor: pointer;
    font-weight: bold;
    font-family: var(--font-2);
}

.fold-down summary:focus-visible {
    outline: 3px solid var(--color-2);
    outline-offset: 2px;
}

.fold-down details[open] > summary {
    background-color: var(--color-3);
    color: var(--color-5);
}

.fold-down details p {
    padding: 1rem;
    line-height: 1.6;
}

/* Spacing for the portfolio introduction paragraph. */
.general-information p {
    margin-bottom: 1.25rem;
}

/* Shared button style */
.button {
    display: block;
    text-transform: uppercase;
    cursor: pointer;
    padding: 0.25em 0.5em;
    border-radius: 1rem;
    position: relative;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    text-align: center;
    text-decoration: none;
}

.button:active {
    box-shadow: 0px 0px 0px 0px;
    top: 5px;
    left: 5px;
}

/* Projects section and outer container */
.projects {
    margin: 3rem;
    margin-bottom: 0;
}

/* Border around the project list */
.projects__layout {
  border: 2px solid var(--color-2);
  border-radius: 1rem;
  overflow: hidden;
  background: linear-gradient(
    to right,
    var(--color-4) 0 50%,
    var(--color-1) 50% 100%
  );
}

/* Project list and item sizing */
.project-list {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 36rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Individual project entries */
.project-list > li {
  display: flex;
  flex-direction: column;
  flex: 0 0 5rem;
  width: 50%;
  border-bottom: 1px solid var(--color-5);
}

.project-list > li:last-child { border-bottom: 0; }

/* Project title row and its button */
.project-row {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: transparent;
  color: var(--color-5);
  cursor: pointer;
  transition: background-color .15s, color .15s;
}

.project-row h3 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 500;
}

/* Project button: hidden until its item is hovered or focused */
.project-row .button {
    flex: none;
    opacity: 0;
    transition: opacity .15s;
    box-shadow: 1px 1px 0px 0px var(--color-3), 2px 2px 0px 0px var(--color-3), 3px 3px 0px 0px var(--color-3), 4px 4px 0px 0px var(--color-3), 5px 5px 0px 0px var(--color-3);
    border: 3px solid var(--color-3);
    color: var(--color-3);
}

.project-row .button:hover {
    background: var(--color-5);
}

/* Detail panel positioned on the right side of the list */
.project-detail {
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    padding: 2rem;
    background: var(--color-1);
    color: var(--color-4);
    visibility: hidden;
}

/* Project detail title and description */
.project-detail h4 {
    margin: 0 0 .75rem;
    font-size: 1.5rem;
    color: var(--color-4);
}

.project-detail p { 
    margin: 0 0 1.5rem; line-height: 1.6; 
    color: var(--color-4);
}

/* Image frame and its empty-state placeholder */
.project-figure {
    margin: 0 0 1.5rem;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border: 1px solid var(--color-4);
    background-color: var(--color-1);
    background-image:
    linear-gradient(var(--color-5) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-5) 1px, transparent 1px);
    background-size: 1.5rem 1.5rem;
}

.project-figure img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-figure:empty { display: grid; place-items: center; }

/* Placeholder label shown until a project image is added */
.project-figure:empty::after {
    content: attr(data-label);
    padding: .25rem .5rem;
    background: var(--color-1);
    color: var(--color-3);
    font-size: .875rem;
}

/* Highlight the active project and reveal its button */
.project-list > li:hover .project-row,
.project-list > li:focus-within .project-row {
    background: var(--color-1);
    color: var(--color-3);
}

.project-list > li:hover .project-row h3,
.project-list > li:focus-within .project-row h3 {
    color: var(--color-4);
}

.project-list > li:hover .button,
.project-list > li:focus-within .button {
    opacity: 1;
}

/* Reveal the matching detail panel */
.project-list > li:hover .project-detail,
.project-list > li:focus-within .project-detail {
    visibility: visible;
}

/* Default state: show the first project until the list is hovered or focused */
.project-list:not(:hover):not(:focus-within) > li:first-child .project-row {
    background: var(--color-1);
    color: var(--color-3);
}

.project-list:not(:hover):not(:focus-within) > li:first-child .project-row h3 {
    color: var(--color-4);
}

.project-list:not(:hover):not(:focus-within) > li:first-child .button {
    opacity: 1;
}

.project-list:not(:hover):not(:focus-within) > li:first-child .project-detail {
    visibility: visible;
}

/*Footer*/

.site-footer { 
    background: var(--color-5); 
    color: var(--color-4); 
}
 
/* Four columns on desktop, fewer on smaller screens (see bottom) */
.site-footer__inner {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 2rem;
    max-width: 1200px;
    margin: 2rem auto;
    margin-bottom: 0.5rem;
    padding-top: 2rem;
}

.site-footer h2 { 
    margin: 0 0 1rem; 
    font-size: 1rem; 
    font-weight: 700; 
    color: var(--color-3); 
}

.site-footer p  { 
    margin: 0;
}

.site-footer ul {
    margin: 0;
    padding: 0; 
    list-style: none; 
}

.site-footer li { 
    margin-bottom: .625rem;
    line-height: 1;
    font-size: 0.75rem; 
}
 
.site-footer__logo { 
    margin-bottom: .75rem !important; 
    font-size: 1.75rem; 
    font-weight: 700;
    color: var(--color-3); 
}

#site-footer__slogan {
    font-size: 0.75rem;
    color: var(--color-4);
}
 
/* Links */
.site-footer a { 
    color: var(--color-4);
    text-decoration: none; 
    border-bottom: 1px solid transparent;
}

.site-footer a:hover { 
    color: var(--color-3);
    border-bottom-color: var(--color-3); 
}

.site-footer a:focus-visible { 
    outline: 3px solid var(--color-3); 
    outline-offset: 3px; 
}
 
/* Bottom bar */
.site-footer__bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
    border-top: 2px solid var(--color-1);
    font-size: .8125rem;
}
.site-footer__bottom ul { 
    display: flex; 
    gap: 1.5rem; 
}

.site-footer__bottom li { 
    margin: 0; 
}


/* Tablet: two columns, brand block on its own row */
@media (max-width: 900px) {
  .site-footer__inner { grid-template-columns: 1fr 1fr; }
  .site-footer__brand { grid-column: 1 / -1; }
}
 
/* Phone: one column */
@media (max-width: 500px) {
  .site-footer__inner { grid-template-columns: 1fr; }
}

/* Stack the portfolio intro and wrap shared navigation on tablet screens. */
@media (max-width: 800px) {
  header {
    flex-wrap: wrap;
    gap: .75rem 1rem;
  }

  header > .nav {
    flex-basis: 100%;
    justify-content: center;
  }

  header > .nav > .nav {
    justify-content: center;
    flex-wrap: wrap;
  }

  .general-project { grid-template-columns: 1fr; margin: 0 1.5rem; }
  .projects__layout { background: var(--color-4); }
  .project-list { height: auto; }
  .project-list > li { flex: none; width: 100%; }
  .project-row { flex: none; min-height: 4.5rem; }
  .project-detail {
    position: static;
    display: none;
    width: auto;
    height: auto;
    visibility: visible;
  }
  .project-list > li:hover .project-detail,
  .project-list > li:focus-within .project-detail { display: block; }
}

/* Tighten portfolio spacing and project rows for small phones. */
@media (max-width: 600px) {
  header { padding: .75rem 1rem; }
  .nav-item a { padding: .6rem .75rem; }
  .site-footer__inner { padding-left: 1.5rem; padding-right: 1.5rem; }
  .general-project { margin: 0 1rem; padding-top: 2rem; }
  .projects { margin: 2rem 1rem; }
  .project-row { gap: .5rem; padding: .75rem; }
  .project-row .button { font-size: .8rem; }
  .project-detail { padding: 1rem; }
  .site-footer__bottom { justify-content: center; text-align: center; padding: 1rem; }
}