/* Lewis He portfolio, minimalist single column, light */

:root {
  --bg: #FAFAF8;
  --text: #1A1A1A;
  --muted: #6E6E6C;
  --line: #E5E5E1;
  --accent: #2563EB;
  --maxw: 1180px;
  --reading: 680px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 70px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: "Archivo", system-ui, sans-serif; letter-spacing: -0.015em; font-weight: 600; }

a { color: var(--accent); cursor: pointer; }
a:hover { text-decoration-thickness: 2px; text-underline-offset: 3px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }

/* top nav */
nav {
  max-width: var(--maxw); margin: 0 auto; padding: 26px 32px 0;
  display: flex; gap: 22px; flex-wrap: wrap;
}
nav a { color: var(--muted); font-size: 14.5px; text-decoration: none; }
nav a:hover { color: var(--text); }

main { max-width: var(--maxw); margin: 0 auto; padding: 0 32px; }

/* greeting */
.greet { padding: 100px 0 80px; }
.greet h1 { font-size: clamp(44px, 7vw, 84px); line-height: 1.05; }
.role {
  font-size: clamp(20px, 3vw, 26px); color: var(--muted); margin-top: 10px; font-weight: 500;
}
.intro { margin-top: 34px; font-size: 17.5px; max-width: 560px; }

/* sections */
section { padding: 70px 0; border-top: 1px solid var(--line); }
section h2 { font-size: clamp(28px, 4.5vw, 38px); margin-bottom: 26px; }
.lead { color: var(--muted); margin-bottom: 40px; max-width: 620px; }

/* prose blocks stay at reading width */
.prose { max-width: var(--reading); }
.prose h3 { font-size: 18px; margin: 26px 0 8px; }
.prose h3:first-child { margin-top: 0; }
.prose p { margin-bottom: 14px; }

/* rotation entries: two column, text beside gallery */
.entry {
  display: grid; grid-template-columns: minmax(300px, 5fr) 7fr;
  gap: 40px; padding: 48px 0; border-top: 1px solid var(--line);
  align-items: start;
}
.entry h3 { font-size: clamp(24px, 3vw, 30px); }
.meta { color: var(--muted); font-size: 14px; margin-top: 4px; }
.define { margin-top: 18px; }
.entry .text ul { margin: 16px 0 0 20px; display: grid; gap: 8px; }
.entry .text li::marker { color: var(--accent); }
.entry .text { max-width: 560px; }
.extlink { margin-top: 14px; font-size: 15px; }
.lesson { margin-top: 20px; color: var(--muted); }

/* text-only entries (Robotics 1 archive) */
.entry.solo { display: block; }
.entry.solo .text { max-width: var(--reading); }

/* gallery */
.entry .gallery {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 8px; margin-top: 0; align-content: start;
}
.shot { position: relative; }
.shot img {
  width: 100%; height: 130px; object-fit: cover; display: block;
  border-radius: 6px; cursor: zoom-in;
  transition: opacity 0.18s ease;
}
.shot:hover img { opacity: 0.85; }
.shot figcaption {
  position: absolute; bottom: 6px; right: 8px;
  font-size: 10.5px; color: rgba(255, 255, 255, 0.85);
  background: rgba(0, 0, 0, 0.4); padding: 0 6px; border-radius: 4px;
  line-height: 1.5;
}

/* contact */
.big-link { font-size: clamp(20px, 3.5vw, 26px); }

/* footer */
footer {
  max-width: var(--maxw); margin: 0 auto; padding: 40px 32px 60px;
  color: var(--muted); font-size: 14px; border-top: 1px solid var(--line);
}

/* lightbox */
.lightbox {
  display: none; position: fixed; inset: 0; z-index: 100;
  background: rgba(20, 20, 20, 0.94); cursor: zoom-out;
  align-items: center; justify-content: center; padding: 24px;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 6px; }

/* small screens: back to single column stacking */
@media (max-width: 860px) {
  .entry { grid-template-columns: 1fr; gap: 22px; padding: 40px 0; }
  .entry .text { max-width: none; }
}
@media (max-width: 640px) {
  .greet { padding: 70px 0 56px; }
  section { padding: 52px 0; }
  main, nav, footer { padding-left: 20px; padding-right: 20px; }
  .entry .gallery { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .shot img { height: 100px; }
}
