* {
  box-sizing: border-box;
}

body {
  background: #333;
  padding-top: 5em;
  display: flex;
  flex-direction: column;
  justify-content: center;
  font-family: monospace;
  color: #fff;
  margin: 1em;
}

body.project-page {
  padding-top: 0.5rem;
  margin: 0.5em;
  justify-content: flex-start;
  min-height: 100vh;
}

.project h3, h4, h5 { color: orange; }

.project-div {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex: 1;
    max-width: 80em;
    width: 100%;
    margin: auto;
}

.project-header-div {
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: center;
}

.center-flex {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.app-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 2em;
    margin-bottom: 10em;
}

.app-button {
    display: flex;
    margin: 1em;
    color: #333;
    background: orange;
    text-align: center;
    font-weight: 700;
    border-radius: 12px;
    white-space: nowrap;
    border: 0;
    padding: 1em;
    justify-content: center;
}

.app-button:hover {
    color: #fff;
}

.header-div {
    display: flex;
    gap: .5em 2em;
    color: #fff;
    margin: auto;
    margin-top: 1em;
    flex-wrap: wrap;
    justify-content: center;
}

.header-div h3, h4, h5 { color: white; }

.header-div h3:hover, h5:hover {
    color: orange;
    cursor: pointer;
}

.project-chrome {
    position: fixed;
    inset: 0;
    z-index: 200;
    pointer-events: none;
}

.project-chrome-corner {
    pointer-events: auto;
    position: fixed;
    width: 3.75rem;
    height: 3.75rem;
    border: none;
    background: rgba(40, 40, 40, 0.92);
    color: #bbb;
    cursor: pointer;
    display: flex;
    font-size: 1.05rem;
    text-decoration: none;
    transition: color 0.15s, background 0.15s;
}

.project-chrome-corner--home {
    top: 0;
    left: 0;
    clip-path: polygon(0 0, 100% 0, 0 100%);
    align-items: flex-start;
    justify-content: flex-start;
    padding: 0.55rem 0 0 0.55rem;
}

.project-chrome-corner--about {
    top: 0;
    right: 0;
    clip-path: polygon(100% 0, 100% 100%, 0 0);
    align-items: flex-start;
    justify-content: flex-end;
    padding: 0.55rem 0.55rem 0 0;
}

.project-chrome-corner:hover,
.project-chrome-corner:focus {
    color: orange;
    background: rgba(55, 45, 30, 0.95);
}

.project-about-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 300;
    background: rgba(0, 0, 0, 0.88);
    padding: 2.5rem 1rem 1.5rem;
    overflow-y: auto;
}

.project-about-overlay.open {
    display: block;
}

.project-about-dialog {
    position: relative;
    max-width: 40em;
    margin: 0 auto;
    color: #fff;
}

.project-about-close {
    position: absolute;
    top: -0.25rem;
    right: 0;
    background: none;
    border: none;
    color: #aaa;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
}

.project-about-close:hover,
.project-about-close:focus {
    color: orange;
}

.project-mode-switch {
    display: inline-flex;
    gap: 0.25rem;
    margin: 0 auto 1rem auto;
    padding: 0.2rem;
    border: 1px solid #444;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.2);
}

.project-mode-btn {
    background: transparent;
    border: none;
    color: #aaa;
    font-family: inherit;
    font-size: 0.85rem;
    padding: 0.45rem 0.85rem;
    border-radius: 6px;
    cursor: pointer;
    min-height: 36px;
    white-space: nowrap;
}

.project-mode-btn:hover,
.project-mode-btn:focus {
    color: #fff;
}

.project-mode-btn.active {
    background: rgba(255, 165, 0, 0.15);
    color: orange;
}

#content-div {
    display: flex;
    flex-direction: column;
    gap: 5%;
    color: #fff;
    max-width: 54em;
    width: 100%;
    margin: 0.5em auto 4em auto;
}

#content-about {
    max-width: 40em;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

body.project-page #content-div {
    margin-top: auto;
    margin-bottom: auto;
}

#content-div img {
    max-width:100%;
    margin-bottom: 1em;
}

.subheader {
    margin: 1em auto;
    width: fit-content;

}

a { color: orange; }

.active { color: orange !important; }
.deactive { color: #666 !important; }

#jumpToTopBtn {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 30px;
  z-index: 99;
  font-size: 18px;
  border: none;
  outline: none;
  background-color: grey;
  color: white;
  cursor: pointer;
  padding: 15px;
  border-radius: 4px;
}

#jumpToTopBtn:hover {
  background-color: #555;
}

.blog-content h5 { color: orange; }
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(15em, 1fr));
    gap: 1em;
    width: 100%;
    margin-top: 1em;
}

#content-projects .project-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1em;
}

#content-projects .project-card {
    flex: 0 1 16em;
    width: 16em;
    max-width: 100%;
}

@media screen and (max-width: 900px) {
    #content-projects .project-card {
        flex: 0 1 calc(50% - 0.5em);
        width: calc(50% - 0.5em);
    }
}

@media screen and (max-width: 600px) {
    #content-projects .project-card {
        flex: 0 1 100%;
        width: 100%;
    }
}

.project-card {
    display: flex;
    flex-direction: column;
    gap: 0.5em;
    padding: 1em;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: inherit;
    text-decoration: none;
    transition: border-color 0.15s, transform 0.15s;
}

.project-card:hover {
    border-color: orange;
    transform: translateY(-2px);
}

.project-card:hover h3 {
    color: orange;
}

.project-card h3 {
    margin: 0;
}

/* The date floats rather than sharing a flex row: a flex item will not shrink below
   its longest word, so a title like "Poetry for Neanderthals" used to push the nowrap
   date out past the card border. Floating costs one row of height in the top-right
   corner and lets the title flow around it — the first line sits beside the date, the
   rest use the full card width. The date is first in source order because a float only
   wraps content that follows it. */
.project-card-top::after {
    content: '';
    display: block;
    clear: both;
}

.project-card-date {
    float: right;
    margin-left: 0.5em;
    color: #999;
    font-size: 0.8em;
    line-height: 1.6;
    white-space: nowrap;
}

.project-card-desc {
    margin: 0;
    color: #ccc;
    font-size: 0.85em;
    line-height: 1.4;
}

.build-stamp {
    margin: 2em auto 1em auto;
    text-align: center;
    color: #666;
    font-size: 0.75em;
}

.build-stamp a {
    color: #888;
    text-decoration: none;
}

.build-stamp a:hover {
    color: orange;
}
