/* =========================
   RESET
========================= */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* =========================
   BASE
========================= */

body {
  font-family: "Roboto Mono", monospace;
  font-weight: 400;
  cursor: crosshair;

 
}

img {
  display: block;
}

/* prevent images from overflowing their containers */
img {
  max-width: 100%;
  height: auto;
}

h1 {
  font-weight: 400;
  font-size: 2.2rem;
  letter-spacing: -0.02em;
}

main {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

section {
  margin: 3.5rem 0;
}

section p {
  margin-top: 0.7rem;
  max-width: 600px;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #555;
}

body.dark section p {
  color: #aaa;
}

/* =========================
   HEADER
========================= */

header {
  background: linear-gradient(#fff, #f2f2f2);
}



body.dark header {
  background: linear-gradient(#111, #1a1a1a);
}



/* =========================
   GRID (homepage)
========================= */

.grid {
  display: grid;
  grid-template-columns: repeat(2, 320px);
  gap: 1rem;
  margin-top: 1rem;
}

.thumb img {
  width: 100%;
}

.thumb img:hover {
  opacity: 0.7;
}

.thumb:hover {
  cursor: zoom-in;
}

@media (max-width: 600px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

/* =========================
   THUMB OVERLAY
========================= */

.thumb-wrap {
  position: relative;
  display: block;
  overflow: hidden;
}

.thumb-wrap img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  color: #111;
}

.thumb-wrap:hover .overlay {
  opacity: 1;
}

.thumb-wrap:hover img {
  opacity: 0.8;
}

/* mobile overlay */
@media (max-width: 600px) {
  .overlay {
    position: static;
    opacity: 1;
    background: none !important;
    padding-top: 0.5rem;
    font-size: 0.8rem;
    text-transform: lowercase;
  }

  .overlay::before {
    content: "→ ";
  }
}

/* colour variants */
.thumb:nth-child(1) .overlay { background: rgba(0,80,255,0.5); }
.thumb:nth-child(2) .overlay { background: rgba(255,0,120,0.5); }
.thumb:nth-child(3) .overlay { background: rgba(0,180,120,0.5); }
.thumb:nth-child(4) .overlay { background: rgba(255,120,0,0.5); }
.thumb:nth-child(5) .overlay { background: rgba(255,255,0,0.5); }
.thumb:nth-child(6) .overlay { background: rgba(0,255,255,0.5); }
.thumb:nth-child(7) .overlay { background: rgba(255,0,0,0.5); }
.thumb:nth-child(8) .overlay { background: rgba(128,0,255,0.5); }

/* =========================
   PROJECT GALLERY
========================= */

.gallery {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  margin-top: 2rem;
}




.item {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.item:nth-child(even) {
  flex-direction: row-reverse;
}

.item img {
  width: min(600px, 60%);
  height: auto;
  flex-shrink: 0;
}

.meta {
  width: 20%;
  font-size: 0.75rem;
  color: #666;
  line-height: 1.4;
}

/* mobile */
@media (max-width: 600px) {
  .item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .item img {
    width: 100%;
    max-width: 100%;
    height: auto;
    flex-shrink: 1;
  }

  .meta {
    width: 100%;
  }
}

/* =========================
   LIGHTBOX
========================= */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  cursor: zoom-out;
}

.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
}

body.dark .lightbox {
  background: rgb(3, 3, 3);
}

/* =========================
   UI ELEMENTS
========================= */

#theme-toggle {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 999;
  font: inherit;
  font-size: 0.8rem;
  background: #e6e6e6;
  border: 2px outset #ccc;
  padding: 0.3rem 0.6rem;
  cursor: pointer;
}

#theme-toggle:hover {
  background: #ddd;
}

body.dark {
  background: #111;
  color: #eee;
}

body.dark a {
  color: #eee;
}

body.dark input,
body.dark textarea {
  background: #111;
  color: #eee;
  border: 1px solid #555;
}

/* keep theme toggle and back-link text dark in dark mode */
body.dark #theme-toggle,
body.dark a[href="index.html"] {
  color: #111;
}

input[type="radio"],
input[type="checkbox"] {
  accent-color: #777;
}

body.dark input[type="radio"],
body.dark input[type="checkbox"] {
  accent-color: #aaa;
}

.radio-group {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
}

.radio-group label {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* =========================
   BACK BUTTON
========================= */

a[href="index.html"] {
  position: fixed;
  top: 1.5rem;
  left: 1.5rem;
  z-index: 9999;
  font: inherit;
  font-size: 0.8rem;
  background: #e6e6e6;
  border: 2px outset #ccc;
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  text-decoration: none;
}

a[href="index.html"]:hover {
  background: #ddd;
}

/* dotted internal links */
a[href$=".html"] {
  text-decoration-style: dotted;
}

/* =========================
   TIMESTAMP
========================= */

.timestamp {
  margin-top: 4rem;
  font-size: 0.8rem;
  color: #777;
}

/* =========================
   MOBILE SAFETY (minimal)
========================= */

@media (max-width: 600px) {
  html,
  body {
    overflow-x: hidden;
  }
}

.form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

@media (max-width: 600px) {

  .item {
    display: flex;
    flex-direction: column !important;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .item:nth-child(even) {
    flex-direction: column !important;
  }

  .item img {
    width: 100%;
    max-width: 100%;
    height: auto;
    flex: 0 0 auto;
  }

  .meta {
    width: 100%;
  }
}