/* ==========================================================================
   DESIGN TOKENS
   ========================================================================== */
:root {
  --bg: #E7ECDD;
  --bg-alt: #DCE4CE;
  --ink: #22252A;
  --ink-soft: #545A4E;
  --line: #C9D2B9;
  --accent: #3D5A42;
  --accent-soft: #D3E0CB;
  --white: #FFFFFF;

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", -apple-system, sans-serif;

  --max-width: 1080px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
}

a { color: var(--accent); }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

img { max-width: 100%; display: block; }

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 28px;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; margin: 0; }

/* ==========================================================================
   NAV
   ========================================================================== */
.topnav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(231,236,221,0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}

.topnav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  flex-wrap: wrap;
}

.topnav .mark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  text-decoration: none;
  color: var(--ink);
}

.topnav nav {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.topnav nav a {
  font-size: 13.5px;
  text-decoration: none;
  color: var(--ink-soft);
  white-space: nowrap;
}

.topnav nav a:hover { color: var(--accent); }

@media (max-width: 760px) {
  .topnav nav { display: none; }
}

/* ==========================================================================
   HERO
   ========================================================================== */
.hero {
  padding: 88px 0 64px;
  text-align: left;
}

.hero .eyebrow {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
  font-weight: 600;
}

.hero h1 {
  font-size: clamp(36px, 5.5vw, 56px);
  line-height: 1.1;
  margin-bottom: 20px;
  max-width: 18ch;
}

.hero .lede {
  font-size: 20px;
  color: var(--ink-soft);
  max-width: 52ch;
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
}

.hero .focus-line {
  font-size: 15px;
  color: var(--ink-soft);
}

/* ==========================================================================
   SECTION HEADERS
   ========================================================================== */
.section {
  padding: 72px 0;
  border-top: 1px solid var(--line);
}

.section-head {
  margin-bottom: 40px;
  max-width: 64ch;
}

.section-head .label {
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 10px;
  display: block;
}

.section-head h2 {
  font-size: clamp(26px, 3.4vw, 34px);
  margin-bottom: 14px;
  line-height: 1.2;
}

.section-head p {
  color: var(--ink-soft);
  font-size: 16.5px;
}

.subhead {
  margin: 12px 0 24px;
  font-size: 15.5px;
  color: var(--ink-soft);
  max-width: 62ch;
}

/* ==========================================================================
   STORY BLOCKS (lead image + text, feeds into a collage below)
   ========================================================================== */
.story-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  margin-bottom: 36px;
}

.story-block.reverse .story-media { order: 2; }
.story-block.reverse .story-text { order: 1; }

.story-media img {
  border-radius: 6px;
  box-shadow: 0 12px 32px rgba(34,37,42,0.10);
  width: 100%;
  object-fit: cover;
}

.story-text h3 { font-size: 21px; margin-bottom: 12px; }
.story-text p { color: var(--ink-soft); font-size: 16px; }

@media (max-width: 760px) {
  .story-block, .story-block.reverse {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .story-block.reverse .story-media,
  .story-block.reverse .story-text,
  .story-block .story-media,
  .story-block .story-text { order: initial; }
}

/* ==========================================================================
   COLLAGE — scattered, overlapping tiles; hover lifts, click opens lightbox
   ========================================================================== */
.collage {
  position: relative;
  height: 320px;
  margin: 32px 0 8px;
}

.collage img {
  position: absolute;
  width: 190px;
  border-radius: 6px;
  box-shadow: 0 10px 26px rgba(34,37,42,0.16);
  cursor: pointer;
  object-fit: cover;
  transition: transform 0.2s ease, box-shadow 0.2s ease, z-index 0s;
  border: 4px solid var(--white);
}

.collage img:hover,
.collage img:focus-visible {
  transform: scale(1.12) rotate(0deg) !important;
  z-index: 50 !important;
  box-shadow: 0 18px 40px rgba(34,37,42,0.28);
}

/* Scattered placement presets, cycled by position in each collage */
.collage img:nth-of-type(8n+1) { top: 4%;  left: 2%;  transform: rotate(-6deg); z-index: 5; }
.collage img:nth-of-type(8n+2) { top: 14%; left: 24%; transform: rotate(4deg);  z-index: 6; }
.collage img:nth-of-type(8n+3) { top: 0%;  left: 46%; transform: rotate(-3deg); z-index: 4; }
.collage img:nth-of-type(8n+4) { top: 18%; left: 66%; transform: rotate(6deg);  z-index: 7; }
.collage img:nth-of-type(8n+5) { top: 2%;  left: 82%; transform: rotate(-5deg); width: 150px; z-index: 3; }
.collage img:nth-of-type(8n+6) { top: 40%; left: 10%; transform: rotate(5deg);  width: 160px; z-index: 2; }
.collage img:nth-of-type(8n+7) { top: 44%; left: 36%; transform: rotate(-4deg); width: 170px; z-index: 8; }
.collage img:nth-of-type(8n+8) { top: 42%; left: 60%; transform: rotate(3deg);  width: 150px; z-index: 1; }

.collage.collage-tall { height: 420px; }

@media (max-width: 760px) {
  .collage {
    height: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
  }
  .collage img {
    position: static !important;
    width: calc(50% - 6px) !important;
    transform: none !important;
    border: 2px solid var(--white);
  }
  .collage img:hover { transform: none !important; }
}

/* ==========================================================================
   PROJECT BLOCKS (feature treatment for current work)
   ========================================================================== */
.project-block {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 56px;
  align-items: start;
  background: var(--bg-alt);
  border-radius: 10px;
  padding: 40px;
  margin-bottom: 40px;
}

.project-block:last-child { margin-bottom: 0; }

.project-media img {
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(34,37,42,0.08);
  cursor: pointer;
}

.project-media .thumb-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.project-media .thumb-row img {
  height: 72px;
  width: auto;
  border-radius: 4px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(34,37,42,0.10);
}

.project-tag {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 600;
  margin-bottom: 14px;
}

.project-text h3 { font-size: 24px; margin-bottom: 14px; }
.project-text p { color: var(--ink-soft); margin-bottom: 14px; }
.project-text p:last-child { margin-bottom: 0; }

@media (max-width: 760px) {
  .project-block { grid-template-columns: 1fr; padding: 26px; gap: 24px; }
}

/* ==========================================================================
   ROBOTICS ENTRIES
   ========================================================================== */
.robo-entry {
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}
.robo-entry:last-child { border-bottom: none; }

.robo-entry-head {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 32px;
  align-items: start;
}

.robo-entry-head img { border-radius: 6px; box-shadow: 0 8px 20px rgba(34,37,42,0.08); cursor: pointer; }

.robo-text .years { font-size: 13px; color: var(--accent); font-weight: 600; margin-bottom: 4px; }
.robo-text h3 { font-size: 19px; margin-bottom: 2px; }
.robo-text .subtitle { font-size: 14px; color: var(--ink-soft); margin-bottom: 10px; font-style: italic; }
.robo-text p { color: var(--ink-soft); font-size: 15.5px; margin: 0; }

@media (max-width: 640px) {
  .robo-entry-head { grid-template-columns: 1fr; }
}

/* ==========================================================================
   ALSO SECTION
   ========================================================================== */
.also-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: start;
}

.also-list { list-style: none; margin: 0; padding: 0; }
.also-list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 15px;
}
.also-list li .what { color: var(--ink); }
.also-list li .detail { color: var(--ink-soft); text-align: right; }

.also-photos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.also-photos .photo-frame {
  aspect-ratio: 1;
  background: var(--bg-alt);
  border-radius: 5px;
  box-shadow: 0 4px 14px rgba(34,37,42,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.also-photos .photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

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

/* ==========================================================================
   CLOSING NOTE
   ========================================================================== */
.closing { padding: 72px 0 96px; border-top: 1px solid var(--line); }
.closing blockquote {
  font-family: var(--font-display);
  font-size: clamp(22px, 3vw, 28px);
  line-height: 1.5;
  max-width: 46ch;
  margin: 0;
  font-weight: 500;
  color: var(--ink);
}

/* ==========================================================================
   LIGHTBOX
   ========================================================================== */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(20, 22, 20, 0.92);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 85vh; box-shadow: 0 10px 40px rgba(0,0,0,0.5); border-radius: 4px; }
.lightbox .close {
  position: absolute; top: 18px; right: 24px;
  background: none; border: none; color: #fff; font-size: 28px; cursor: pointer;
}
.lightbox .nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,0.12); border: none; color: #fff;
  font-size: 22px; width: 44px; height: 44px; cursor: pointer;
}
.lightbox .nav:hover { background: rgba(255,255,255,0.24); }
.lightbox .prev { left: 18px; }
.lightbox .next { right: 18px; }
.lightbox .counter {
  position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
  color: #fff; font-size: 12px; opacity: 0.8;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
footer {
  border-top: 1px solid var(--line);
  padding: 24px 0 48px;
  font-size: 12.5px;
  color: var(--ink-soft);
}

/* ==========================================================================
   IMAGE PROTECTION + USAGE NOTICE
   ========================================================================== */
img {
  -webkit-user-drag: none;
  user-drag: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none; /* blocks the long-press "Save image" menu on iPhone/iPad */
}

footer .notice-title {
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 6px;
}
footer .notice {
  max-width: 78ch;
  margin: 0 0 8px;
  line-height: 1.6;
}
