/* Homepage styles: shared site layout plus home-specific sections and project previews. */
/* Reset default browser spacing and sizing */
* {
    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;
}

/* Set the page's default background, text color, and inherited typeface. */
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 hero banner */
.hero-banner {
    background-image: url('resources/hero-banner-background.svg');
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 2rem 5%;
    background-size: cover;
    background-position: center;
    height: 330px;
}

.hero-text {
    text-align: left;
    width: 40%;
    padding: 10px 10px;
    margin: 2%;
}

.hero-text h2 {
    font-size: 2rem;
    color: var(--color-3);
}

.hero-text h3 {
    color: var(--color-3);
    padding-top: 10px;
}

/* Compact services cards */
.services-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem;
    margin: 3rem 3rem ;
}

.service-card {
    display: block;
    position: relative;
    padding: 1rem 1.5rem;
    border: 3px solid var(--color-2);
    border-radius: 1rem;
    background: var(--color-4);
    color: var(--color-5);
    text-decoration: none;
    box-shadow: 1px 1px 0px 0px var(--color-2), 2px 2px 0px 0px var(--color-2), 3px 3px 0px 0px var(--color-2), 4px 4px 0px 0px var(--color-2), 5px 5px 0px 0px var(--color-2);
    transition: background-color .15s, color .15s;
}

/* Pressed state, same as the other buttons */
.service-card:active {
    box-shadow: 0px 0px 0px 0px;
    top: 5px;
    left: 5px;
}

.service-card h3 {
    padding-bottom: .25rem;
    font-size: 1.125rem;
}

.service-card p {
    font-family: var(--font-2);
    font-size: .9rem;
    line-height: 1.5;
}

.service-card:hover,
.service-card:focus-visible {
    background: var(--color-1);
    color: var(--color-4);
}

.service-card:hover h3,
.service-card:focus-visible h3 {
    color: var(--color-3);
}

.service-card:focus-visible {
    outline: 3px solid var(--color-3);
    outline-offset: 2px;
}

/* About section: text on the left, image and call-to-action on the right. */
.about {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-areas: "text text visual";
    gap: 2rem;
    margin: 3rem;
}

/* About copy and bordered text panel */
.about-text {
    grid-area: text;
    border: 2px solid var(--color-2);
    border-radius: 1rem;
    display: flex;
    align-items: center;
}

/* Let the content fill the whole bordered panel */
.about-text-content {
    padding: 1.5rem;
    flex: 1;
}

/* Three equal-width columns, so the headers are equidistant */
.about-columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.about-column h3 {
    padding-bottom: .5rem;
}

.about-column ul {
    margin: 0;
    padding-left: 1.25rem;
    list-style: disc;
}

.about-intro {
    margin: 0;
    padding-bottom: 1.5rem;
}

.about-column li {
    padding-bottom: .4rem;
}

/* Stack the columns on narrow screens */
@media (max-width: 700px) {
    .about-columns {
        grid-template-columns: 1fr;
    }
}

.about-text h2 {
    padding-bottom: 1rem;
}

/* About image and call-to-action */
.about-visual {
    grid-area: visual;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.about-button {
    /* Fill the remaining column height so the button aligns with the text panel. */
    margin-top: auto;
    margin-bottom: .5rem;
}

.img-about {
    width: 100%;
    padding-bottom: 1rem;
}

.img-about img {
    display: block;
    width: 100%;
    height: auto;
    border: 2px solid var(--color-2);
    border-radius: 1rem;
}

/* 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;
}

/* About button fills the visual column */
.about-button .button {
    width: 100%;
    color: var(--color-5);
    box-shadow: 1px 1px 0px 0px var(--color-2), 2px 2px 0px 0px var(--color-2), 3px 3px 0px 0px var(--color-2), 4px 4px 0px 0px var(--color-2), 5px 5px 0px 0px var(--color-2);
    border: 3px solid var(--color-2);
    transition: background-color .15s, color .15s;
}

/* Same green hover as the service cards */
.about-button .button:hover,
.about-button .button:focus-visible {
    background: var(--color-1);
    color: var(--color-3);
}

/* Hero buttons: same yellow outline style as the project buttons */
.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    padding-top: 1.5rem;
}

.hero-buttons .button,
.cta-band .button {
    padding: 0.4em 1.25em;
    color: var(--color-3);
    border: 3px solid var(--color-3);
    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);
}

/* Filled version for the main action */
.hero-buttons .button-primary {
    background: var(--color-3);
    color: var(--color-5);
}

.cta-band .button {
    display: inline-block;
}

/* Pressed button state */
.button:active {
    box-shadow: 0px 0px 0px 0px;
    top: 5px;
    left: 5px;
}

/* Featured projects */
.featured {
    margin: 3rem;
}

.featured h2 {
    padding: 0 0 1.25rem calc(1.5rem + 2px);
    font-size: 1.5rem;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem;
}

.featured-card {
    display: block;
    padding: 1rem;
    border: 2px solid var(--color-2);
    border-radius: 1rem;
    background: var(--color-4);
    color: var(--color-5);
    text-decoration: none;
    transition: background-color .15s, color .15s;
}

.featured-card .project-figure {
    margin-bottom: 1rem;
}

.featured-card h3 {
    padding-bottom: .25rem;
    font-size: 1.125rem;
}

.featured-card p {
    font-family: var(--font-2);
    font-size: .9rem;
    line-height: 1.5;
}

.featured-card:hover,
.featured-card:focus-visible {
    background: var(--color-1);
    color: var(--color-4);
}

.featured-card:hover h3,
.featured-card:focus-visible h3 {
    color: var(--color-3);
}

.featured-card:focus-visible {
    outline: 3px solid var(--color-3);
    outline-offset: 2px;
}

/* Closing call-to-action band */
.cta-band {
    background: var(--color-1);
    color: var(--color-4);
    text-align: center;
    padding: 3rem 1rem;
}

.cta-band h2 {
    padding-bottom: .5rem;
    color: var(--color-3);
}

.cta-band p {
    padding-bottom: 1.5rem;
    font-family: var(--font-2);
}

/* Homepage project previews: project list beside its matching detail panel. */
.projects {
    margin: 3rem;
    margin-bottom: 0;
}

/* Border around the project list */
.projects__layout {
  border: 2px solid var(--color-5);
  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 {
    border-radius: 1rem;
    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;
}

/* Homepage FAQ and contact panels share a responsive two-column section. */
.contact {
    margin: 0 3rem;
    padding: 3rem 0 1rem;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem;
}

.contact > .FAQ,
.contact-form {
    min-width: 0;
    padding: clamp(1.25rem, 3vw, 2rem);
    border: 2px solid var(--color-5);
    border-radius: 1rem;
    background: var(--color-4);
}

.contact h2 {
    padding-bottom: 1.25rem;
    font-size: 1.5rem;
}

/* FAQ questions and answers */
.FAQ details {
    border-bottom: 1px solid var(--color-5);
}

.FAQ summary {
    display: block;
    padding: 1rem;
    cursor: pointer;
    font-weight: bold;
    font-family: var(--font-2);
}

.FAQ summary:focus-visible {
    outline: 3px solid var(--color-2);
    outline-offset: 2px;
}

.FAQ details[open] > summary {
    background-color: var(--color-3);
    color: var(--color-5);
}

.FAQ details p {
    padding: 1rem;
    line-height: 1.6;
}

#FAQ-more {
    margin-top: 1.5rem;
    border: 1px solid var(--color-5);
    text-align: center;
    font-family: var(--font-2);
    border-radius: 1rem;
    padding: 1rem;
}

/* Contact information links */
.contact-form p {
    margin-bottom: 1.25rem;
}

.contact-form ul {
    display: grid;
    gap: .75rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.contact-form li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    font-family: var(--font-2);
    padding: .875rem 1rem;
    border-bottom: 1px solid var(--color-5);
}

.contact-form li a {
    overflow-wrap: anywhere;
    text-align: right;
}

/*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: 3rem 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; 
}


/* Stack project rows and details on narrow screens */
@media (max-width: 800px) {
  .contact { grid-template-columns: 1fr; }
  .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;
  }
}

/* Respect reduced-motion accessibility settings */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* 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; }
}

/* Keep the shared navigation readable when the header no longer fits one row. */
@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;
  }
}

/* Stack home-page columns and reduce outer spacing on 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; }
  .hero-banner {
    min-height: 260px;
    height: auto;
    background-image: none;
    background-color: #000;
  }
  .hero-text { width: 100%; }
  .hero-text h2 { font-size: 1.6rem; }
  .hero-buttons { gap: 1rem; }
  .services-strip { grid-template-columns: 1fr; margin: 2rem 1rem; gap: 1rem; }
  .featured { margin: 2rem 1rem; }
  .featured-grid { grid-template-columns: 1fr; gap: 1rem; }
  .about { grid-template-columns: 1fr; grid-template-areas: "text" "visual"; margin: 2rem 1rem; }
  .about-visual { max-width: 32rem; width: 100%; margin: 0 auto; }
  .projects { margin: 2rem 1rem; }
  .contact { margin: 0 1rem; padding-top: 2rem; }
  .site-footer__bottom { justify-content: center; text-align: center; padding: 1rem; }
}