/* ============================================================
   madsolame.com — hand-written CSS, no frameworks.
   Edit the custom properties below to re-theme the site.
   ============================================================ */

:root {
  --ink: #1f2937;          /* gray-800  */
  --body: #374151;         /* gray-700  */
  --muted: #4b5563;        /* gray-600  */
  --accent: #2563eb;       /* blue-600  */
  --chip-bg: #bfdbfe;      /* blue-200  */
  --border: #d1d5db;       /* gray-300  */
  --paper: #ffffff;
  --radius: 0.25rem;
  --maxw: 56rem;           /* max-w-4xl */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---------- reset-ish ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
}
main { flex: 1; }
img { max-width: 100%; height: auto; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.25; }

/* ---------- footer (site-wide navigation) ---------- */
.site-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1rem 0.75rem;
  border-top: 1px solid var(--border);
}
.site-footer a {
  color: var(--muted);
  text-decoration: none;
}
.site-footer a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }

/* ---------- layout helpers ---------- */
.container { max-width: var(--maxw); margin-inline: auto; padding-inline: 0.75rem; }
.page-main { padding-block: 1rem 4rem; }
.mt-10 { margin-top: 2.5rem; }

/* ---------- cards & chips ---------- */
.card {
  margin-bottom: 0.5rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.card-title { font-weight: 700; color: var(--accent); margin: 0 0 0.5rem; }
.card-subtitle { font-weight: 600; color: var(--muted); margin: 0 0 0.25rem; }
.chip {
  display: inline-block;
  background: var(--chip-bg);
  border-radius: var(--radius);
  padding-inline: 0.5rem;
  margin: 0.25rem;
}
.card-link {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.card-link:hover { border-color: var(--accent); box-shadow: 0 4px 12px rgb(0 0 0 / 0.08); }

/* ---------- home / cover ---------- */
.cover {
  position: relative;
  /* height comes from the flex layout: viewport minus footer */
  overflow: hidden;
  background: url("/assets/img/cover-bg.jpg") center / cover no-repeat;
}
/* faint static grid so the cover looks intentional even with JS off */
.cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(to right, rgb(255 255 255 / 0.35) 0 2px, transparent 2px 8.3333%),
    repeating-linear-gradient(to bottom, rgb(255 255 255 / 0.35) 0 2px, transparent 2px 25%);
}
/* cursor spotlight, driven by --mx/--my set from cover.js */
.cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle 130px at var(--mx, 50%) var(--my, 40%),
    rgb(255 255 255 / 0.35),
    rgb(255 255 255 / 0.08) 60%,
    transparent 100%
  );
  pointer-events: none;
}
cover-grid {
  position: absolute;
  inset: 0;
  display: grid;
  pointer-events: none; /* cells re-enable it */
}
cover-grid .cell {
  pointer-events: auto;
  border: 2px solid rgb(255 255 255 / 0.85);
  background: rgb(220 225 220 / 0.35);
  transition: background-color 0.35s ease;
}
cover-grid .cell:hover { background: rgb(240 244 240 / 0.55); transition-duration: 0.05s; }
cover-grid .cell:active { background: rgb(255 235 56 / 0.45); transition-duration: 0.05s; }
.cover-title {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.cover-title p {
  margin: 0;
  padding: 1rem 2rem;
  max-width: 20rem;
  background: rgb(0 0 0 / 0.75);
  color: #fff;
  font-size: 1.5rem;
  text-align: center;
  border-radius: var(--radius);
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.3);
}

/* ---------- projects list ---------- */
.projects-grid {
  display: grid;
  gap: 1rem;
  text-align: center;
}
@media (min-width: 768px) { .projects-grid { grid-template-columns: repeat(3, 1fr); } }
.project-category { margin: 2rem 0 1rem; font-weight: 700; }
.project-list { list-style: none; margin: 0; padding: 0; }
.project-list a {
  color: var(--body);
  text-decoration: none;
  display: inline-block;
  padding: 0.15rem 0.25rem;
}
.project-list a:hover { opacity: 0.7; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- single project ---------- */
.project-layout { display: grid; gap: 1rem; margin-top: 1.5rem; }
@media (min-width: 1024px) { .project-layout { grid-template-columns: 1fr 2fr; } }
.project-links { list-style: none; margin: 0.5rem 0 0; padding: 0; }
.project-links li { margin-block: 0.15rem; }

project-media { display: block; }
.project-cover { display: block; margin-inline: auto; }
project-media .pm-main {
  width: 100%;
  max-height: 64vh;
  object-fit: contain;
  background: #fff;
}
project-media .pm-thumbs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem;
  margin-top: 0.5rem;
}
project-media .pm-thumbs a {
  display: block;
  width: 80px;
  height: 80px;
  padding: 0.25rem;
  border: 2px solid transparent;
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
}
project-media .pm-thumbs a:hover { border-color: var(--border); }
project-media .pm-thumbs a[aria-current="true"] { border-color: var(--accent); }
project-media .pm-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* ---------- gallery ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
@media (min-width: 1024px) { .gallery-grid { grid-template-columns: repeat(4, 1fr); } }
.gallery-grid a { display: block; overflow: hidden; border-radius: var(--radius); }
.gallery-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.gallery-grid a:hover img { transform: scale(1.05); opacity: 0.85; }

/* lightbox dialog */
.lightbox {
  padding: 0;
  border: none;
  background: transparent;
  max-width: 92vw;
  max-height: 92vh;
}
.lightbox::backdrop { background: rgb(0 0 0 / 0.8); }
.lightbox img {
  max-width: 92vw;
  max-height: 92vh;
  object-fit: contain;
  display: block;
}
.lightbox-nav {
  position: fixed;
  top: 50%;
  inset-inline: 0;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}
.lightbox-nav button {
  pointer-events: auto;
  margin-inline: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgb(0 0 0 / 0.4);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font: inherit;
}
.lightbox-nav button:hover { background: #000; }

/* ---------- about ---------- */
.about-top { display: grid; gap: 0.5rem; margin-top: 1rem; }
@media (min-width: 768px) { .about-top { grid-template-columns: 1fr 1fr; } }
.resume-heading { margin: 1rem 0 0.5rem 1rem; font-weight: 700; color: var(--ink); }
.contact a { white-space: nowrap; }
.contact .sep { color: var(--muted); }

/* ---------- accessibility & motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  .cover::after { display: none; }
}
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
