/* ===================================================================
   Nicholas Niemen — portfolio site
   Shared stylesheet for index.html / projects.html / about.html
=================================================================== */

@font-face {
  font-family: 'Maxeville Test';
  src: url('fonts/MaxevilleTest-Bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --navy: #20286C;
  --line: 1px solid var(--navy);
  --header-h: 30px;
  --font-main: 'Maxeville Test', -apple-system, BlinkMacSystemFont, sans-serif;
  --cursor-arrow: url("cursor/cursor.png") 0 0, auto;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  color: var(--navy);
  background: #ffffff;
  font-family: var(--font-main);
  font-weight: 700;
  -webkit-font-smoothing: antialiased;
  opacity: 0;
  animation: page-fade-in 1.2s ease forwards;
  cursor: var(--cursor-arrow);
}

a, .cell.filled {
  cursor: var(--cursor-arrow);
}

@keyframes page-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  html, body {
    animation: none;
    opacity: 1;
  }
}

/* ---------- Projects page (title list + hover preview) ---------- */

body.projects-page {
  overflow: hidden;
  height: 100vh;
}

.projects-main {
  position: relative;
  height: calc(100vh - var(--header-h));
  overflow: hidden;
}

.project-list {
  position: absolute;
  bottom: 0;
  overflow-y: auto;
  list-style: none;
  margin: 0;
  padding: 0 0 24px 0;
}

.project-row {
  margin: 0 0 6px 0;
}

.project-title {
  position: relative;
  display: inline-block;
  padding: 0 6px;
  font-family: var(--font-main);
  font-weight: 700;
  font-size: clamp(1.1rem, 2.4vw, 2rem);
  line-height: 1.35;
  cursor: var(--cursor-arrow);
  background-color: transparent;
}

.project-title.is-hovered {
  background-color: #3CFF00;
}

.project-title:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
}

.project-year {
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 0.5em;
  margin-left: 6px;
  vertical-align: text-top;
  opacity: 0.85;
}

.project-preview {
  position: absolute;
  background: #ffffff;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.project-preview.showing {
  opacity: 1;
}

.project-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: none;
}

.project-preview .thumb-fallback {
  width: 100%;
  height: 100%;
  display: none;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10%;
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.92);
}

a { color: inherit; }

/* ---------- Fixed header ---------- */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  z-index: 100;
  background: #ffffff;
  border-bottom: var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
}

.site-header .brand {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 10pt;
  text-decoration: none;
  white-space: nowrap;
}

.site-header nav a {
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 10pt;
  text-decoration: none;
  padding: 0;
}

.site-header nav a:hover,
.site-header .brand:hover {
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
}

.site-header nav a:focus-visible,
.site-header .brand:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 3px;
}


main {
  margin-top: var(--header-h);
  min-height: calc(100vh - var(--header-h));
}

/* ---------- The square grid ---------- */

.grid {
  display: grid;
  width: 100%;
  border-left: var(--line);
}

.cell {
  position: relative;
  aspect-ratio: 1 / 1;
  border-right: var(--line);
  border-bottom: var(--line);
  overflow: hidden;
}

.cell.filled:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: -4px;
}

.cell.filled img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: var(--cursor-arrow);
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
}

/* Placeholder swatch shown until a real photo is dropped in.
   Swap this for an <img> once you have real project photography —
   see the PROJECTS array at the top of grid.js */
.cell .thumb-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10%;
  font-family: var(--font-main);
  font-weight: 700;
  font-size: clamp(0.65rem, 1.1vw, 0.95rem);
  color: rgba(255, 255, 255, 0.92);
  letter-spacing: 0.01em;
  line-height: 1.3;
}

.cell.empty .info {
  position: absolute;
  inset: 0;
  padding: clamp(6px, 3%, 12px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  opacity: 0;
  pointer-events: none;
}

.cell.empty.showing .info {
  opacity: 1;
}

.info .info-top {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.info .p-title {
  font-family: var(--font-main);
  font-weight: 700;
  font-size: clamp(0.75rem, 1.5vw, 1.05rem);
  line-height: 1.2;
}

.info .p-year {
  font-family: var(--font-main);
  font-weight: 700;
  font-size: clamp(0.7rem, 1.1vw, 0.9rem);
  line-height: 1.2;
}

.info .p-desc {
  font-family: var(--font-main);
  font-weight: 700;
  font-size: clamp(0.6rem, 0.95vw, 0.78rem);
  line-height: 1.4;
  display: none;
}

/* Only show the longer description once cells are big enough to hold it */
@media (min-width: 500px) {
  .info .p-desc { display: block; }
}

/* ---------- About page ---------- */

.about-main {
  padding-top: 0;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  border-left: var(--line);
  min-height: calc(100vh - var(--header-h));
}

.about-text {
  border-right: var(--line);
  border-bottom: var(--line);
  padding: clamp(24px, 5vw, 64px);
}

.about-portrait {
  border-right: var(--line);
  border-bottom: var(--line);
}

.about-portrait {
  background: white;
  display: flex;
  align-items: flex-end;
}

.about-portrait {
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 0.8rem;
  opacity: 0.7;
}

.about-text {
  display: flex;
  flex-direction: column;
  gap: 20px;
  justify-content: center;
}

.about-text p {
  font-size: clamp(0.9rem, 1.3vw, 1.05rem);
  line-height: 1.2;
  max-width: 46ch;
  margin: 0;
}

.about-text .contact-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.about-text .contact-list a {
  font-family: var(--font-main);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.about-text .contact-list a:hover,
.about-text .contact-list a:focus-visible {
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
}

@media (max-width: 700px) {
  .about-grid {
    grid-template-columns: 1fr;
  }
  .about-portrait {
    aspect-ratio: 1.4 / 1;
  }
}
