/* Room-illustration homepage redesign. Ported from _reference/makerspace-final.html.
   Loaded sitewide via head.html, so every bare-tag selector (*, body, html, a, img) from the
   original spec is deliberately scoped under the new homepage-only section IDs below —
   porting them unscoped would break Bootstrap spacing/link/image styling on every other page
   (resume, publications, single project posts). Class-based selectors (.section, .pcard, etc.)
   are new, sitewide-unique classnames only used by the new partials, so they're left as-is. */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;1,6..72,400&display=swap');

:root{
  --room-bg:#18181B;--room-bg2:#1E1E22;--room-bg3:#242428;
  --room-card:#2A2A2F;--room-card-h:#32323A;
  --room-ink:#F0EDE8;--room-body:#C8C4BC;--room-mute:#8A8680;--room-faint:#5C5A56;
  --room-accent:#9B8ABF;--room-accent-l:#B8A8D8;--room-accent-d:#6E5A93;--room-accent-bg:rgba(155,138,191,.1);
  --room-gold:#C9A84C;--room-gold-bg:rgba(201,168,76,.1);
  --room-line:rgba(255,255,255,.08);--room-line2:rgba(255,255,255,.12);
  --room-wall:#D8D2C6;--room-sans:'Inter',system-ui,sans-serif;--room-serif:'Newsreader',Georgia,serif;
  --room-mono:'JetBrains Mono',ui-monospace,Menlo,monospace;
}

/* this file only loads on the homepage (see index.html) and after rover-rail.css (see
   head.html source order), so it's the right place to retheme the sitewide rover-rail to
   the room's purple/gold palette instead of its generic --text-color/--primary-color
   fallback. Declared on body (not :root) to match where rover-rail.css declares its own
   defaults — a body-level declaration here beats an inherited :root value regardless of
   source order, but for two declarations on the SAME element (body), source order decides,
   and this file loads later. The rover's wheel/panel fills derive from --rover-ink
   automatically (see rover-rail.css), no override needed here. */
body{
  --rover-ink: var(--room-ink);
  --rover-signal: var(--room-gold);
  --rover-track: var(--room-line2);
}

/* ---- scoped resets: only inside the new homepage sections ---- */
#room-nav, #hero-room, #projects, #stack, #publications, #about, #project-modal-overlay,
#room-nav *, #hero-room *, #projects *, #stack *, #publications *, #about *, #project-modal-overlay * {
  box-sizing: border-box;
}
#room-nav a, #projects a, #stack a, #publications a, #about a, #project-modal-overlay a {
  color: var(--room-accent-l); text-decoration: none;
}
#room-nav a:hover, #projects a:hover, #stack a:hover, #publications a:hover, #about a:hover, #project-modal-overlay a:hover {
  text-decoration: underline;
}
#projects img, #stack img, #publications img, #about img, #project-modal-overlay img {
  display: block; max-width: 100%;
}
.wrap{max-width:1560px;margin:0 auto;padding:0 32px}

/* ---- top nav ---- */
/* Collapsed behind a single menu icon at every width, not just mobile: the bookshelf
   already spells out all 5 destinations as the "real" nav (see the "the shelf is the menu"
   hand label), so this bar's job is just to be the accessible/keyboard/mobile/SEO-safe
   fallback — real <a href> links, reachable without needing to click an SVG book — and
   spelling out all 5 links a second time right next to the shelf read as pure duplication. */
#room-nav{display:flex;align-items:center;justify-content:space-between;padding:18px 28px;max-width:1320px;margin:0 auto;position:relative;background:var(--room-bg);font-family:var(--room-sans)}
#room-nav .name{font-weight:700;font-size:16px;color:var(--room-ink)}
#navToggle{display:flex;align-items:center;justify-content:center;background:none;border:1px solid var(--room-line2);color:var(--room-ink);font-size:18px;border-radius:6px;padding:4px 10px;cursor:pointer;transition:.2s}
#navToggle:hover{border-color:var(--room-accent);color:var(--room-accent-l)}
#room-nav .links{display:none;position:absolute;top:calc(100% + 8px);right:28px;flex-direction:column;gap:0;background:var(--room-bg2);border:1px solid var(--room-line2);border-radius:8px;padding:8px;z-index:20;min-width:180px;box-shadow:0 12px 32px rgba(0,0,0,.35)}
#room-nav .links.open{display:flex}
#room-nav .links a{font-size:13.5px;font-weight:500;color:var(--room-mute);transition:.2s;padding:9px 14px;border-radius:6px}
#room-nav .links a:hover{color:var(--room-ink);background:var(--room-card);text-decoration:none}

/* ---- room ---- */
/* aspect-ratio matches the SVG viewBox (1200/520) exactly and preserveAspectRatio is "meet"
   (see room-hero.html), so the illustration fills edge-to-edge full-width with no cropping
   (no padding needed for that anymore) and only letterboxes in the rare case a viewport's
   max-height/min-height clamp forces a mismatched aspect ratio. */
.room{position:relative;width:100%;aspect-ratio:1200/520;max-height:82vh;min-height:380px;overflow:hidden;background:var(--room-bg)}
.room svg{position:absolute;inset:0;width:100%;height:100%}
#hero-room .hoverable{cursor:pointer}
#hero-room .hoverable:hover{filter:brightness(1.1)}

/* ---- sections ---- */
.section{padding:72px 0;position:relative;background:var(--room-bg);color:var(--room-ink)}
.sec-head{display:flex;align-items:baseline;justify-content:space-between;flex-wrap:wrap;gap:12px;margin-bottom:28px}
.sec-head h2{font-family:var(--room-sans);font-weight:700;font-size:clamp(24px,3.4vw,34px);letter-spacing:-.02em;color:var(--room-ink)}
.sec-head .more{font-family:var(--room-sans);font-size:14px;font-weight:600;color:var(--room-accent-l)}
.lead{max-width:600px;margin-top:12px;font-size:17px;line-height:1.6;color:var(--room-body)}

/* ---- project cards (shared by Featured Projects and My Robotics Stack — one card
   format everywhere, per design decision, rather than two near-duplicate styles) ---- */
.feat-grid,.sgrid{display:grid;grid-template-columns:repeat(3,1fr);gap:22px}
@media(max-width:900px){.feat-grid,.sgrid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:560px){.feat-grid,.sgrid{grid-template-columns:1fr}}
.pcard{background:var(--room-card);border:1px solid var(--room-line2);border-radius:8px;overflow:hidden;cursor:pointer;transition:.2s;position:relative}
.pcard:hover{transform:translateY(-4px);box-shadow:0 16px 40px rgba(0,0,0,.3);border-color:var(--room-accent-d)}
.pcard.pop{animation:room-pop .4s backwards}
@keyframes room-pop{from{opacity:0;transform:translateY(10px)}to{opacity:1}}
.pcard .strip{display:flex;justify-content:space-between;align-items:center;background:var(--room-accent-d);color:#fff;
  padding:8px 14px;font-family:var(--room-mono);font-size:10.5px;font-weight:500;letter-spacing:.1em;text-transform:uppercase}
.pcard .strip .no{color:var(--room-gold)}
.pcard .media{aspect-ratio:16/9;background:var(--room-bg);overflow:hidden;border-top:1px solid var(--room-line);border-bottom:1px solid var(--room-line);position:relative}
.pcard .media img, .pcard .media video{width:100%;height:100%;object-fit:cover;transition:transform .4s}
.pcard:hover .media img, .pcard:hover .media video{transform:scale(1.04)}
.pcard .media::before,.pcard .media::after{content:'';position:absolute;width:10px;height:10px;border:1px solid var(--room-accent);z-index:1;pointer-events:none}
.pcard .media::before{top:6px;left:6px;border-right:0;border-bottom:0}
.pcard .media::after{bottom:6px;right:6px;border-left:0;border-top:0}
.pcard .body{padding:18px 20px 22px;background:
  repeating-linear-gradient(0deg,transparent 0 14px,rgba(155,138,191,.06) 14px 15px),
  repeating-linear-gradient(90deg,transparent 0 14px,rgba(155,138,191,.06) 14px 15px),var(--room-card)}
.pcard h3{font-family:var(--room-sans);font-weight:600;font-size:17px;line-height:1.3;color:var(--room-ink)}
.pcard p{font-size:14.5px;color:var(--room-mute);margin-top:7px;line-height:1.55}
.pcard .tags{margin-top:12px;display:flex;flex-wrap:wrap;gap:6px}
.pcard .tag{font-family:var(--room-mono);font-size:11px;color:var(--room-accent-l);background:var(--room-accent-bg);padding:4px 9px;border-radius:3px}
.pcard .arrow{margin-top:14px;font-family:var(--room-mono);font-size:11.5px;font-weight:500;letter-spacing:.04em;color:var(--room-accent-l)}
.pcard .flag{position:absolute;top:36px;right:12px;color:var(--room-gold);font-size:15px;z-index:2}

/* ---- stack ---- */
.stack{background:var(--room-bg2)}
.chips{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:22px}
.chip{cursor:pointer;font-family:var(--room-sans);font-size:13px;font-weight:600;
  color:var(--room-mute);background:var(--room-card);border:1px solid var(--room-line2);padding:8px 16px;border-radius:6px;transition:.2s}
.chip:hover{color:var(--room-ink);border-color:var(--room-accent)}
.chip.active{background:var(--room-accent-d);color:#fff;border-color:var(--room-accent-d)}
.chip .n{opacity:.5;margin-left:4px;font-weight:400;font-size:12px}
.stack-head{display:flex;align-items:baseline;gap:14px;flex-wrap:wrap;margin-bottom:16px}
.stack-head .sh{font-family:var(--room-sans);font-weight:700;font-size:22px;color:var(--room-ink)}
.stack-head .meta{font-family:var(--room-mono);font-size:12px;color:var(--room-accent)}

/* ---- news ---- */
.news-list{list-style:none;margin:0;padding:0}
.news-list li{display:flex;align-items:baseline;gap:14px;padding:2px 0;font-size:18px;line-height:1.35}
.news-list li.news-extra{display:none}
.news-list.expanded li.news-extra{display:flex}
.news-date{font-family:var(--room-mono);font-size:13px;color:var(--room-gold);white-space:nowrap}
.news-text{color:var(--room-body)}
.news-text a{color:var(--room-accent-l)}
.news-text .hl{color:var(--room-accent);font-weight:700}
.news-toggle{appearance:none;background:none;border:none;cursor:pointer;margin-top:14px;
  font-family:var(--room-mono);font-size:12px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;
  color:var(--room-accent-l);padding:0}
.news-toggle:hover{color:var(--room-ink);text-decoration:underline}

/* ---- publications ---- */
.pubs{border-top:1px solid var(--room-line2)}
.pub{display:grid;grid-template-columns:130px 56px 1fr;gap:18px;padding:22px 0;border-bottom:1px solid var(--room-line);align-items:start}
.pub-thumb{width:130px;height:88px;border-radius:6px;overflow:hidden;border:1px solid var(--room-line2);background:var(--room-bg)}
.pub-thumb img{width:100%;height:100%;object-fit:cover;display:block}
.pub .yr{font-family:var(--room-mono);font-size:14px;font-weight:500;color:var(--room-gold)}
.pub h4{font-family:var(--room-sans);font-weight:600;font-size:17px;line-height:1.35;color:var(--room-ink)}
.pub .authors{font-size:15px;color:var(--room-mute);margin-top:4px}.pub .authors b{color:var(--room-ink);font-weight:600}
.pub .venue{font-family:var(--room-mono);font-size:12px;color:var(--room-accent);margin-top:4px}
@media(max-width:640px){
  .pub{grid-template-columns:1fr;gap:10px}
  .pub-thumb{width:100%;height:160px}
  .pub .yr{order:-1}
}

/* ---- about ---- */
.about-grid{display:grid;grid-template-columns:1fr 1.3fr;gap:44px;align-items:start;margin-top:24px}
.about-img{border-radius:10px;border:1px solid var(--room-line2);box-shadow:0 8px 28px rgba(0,0,0,.2)}
.about-text{font-family:var(--room-serif)}
.about-text p{font-size:18px;line-height:1.65;color:var(--room-body)}
.about-text p+p{margin-top:16px}
.about-text .quiet{color:var(--room-mute)}.about-text .warm{color:var(--room-accent-l);font-style:italic}
@media(max-width:760px){.about-grid{grid-template-columns:1fr}}

/* ---- modal ---- */
#project-modal-overlay{position:fixed;inset:0;z-index:100;display:none;background:rgba(0,0,0,.65);backdrop-filter:blur(4px);align-items:center;justify-content:center;padding:20px}
#project-modal-overlay.open{display:flex;animation:room-mfade .2s}
@keyframes room-mfade{from{opacity:0}to{opacity:1}}
#project-modal-overlay .pm-box{width:100%;max-width:880px;max-height:calc(100vh - 40px);overflow:auto;background:var(--room-bg3);
  border:1px solid var(--room-line2);border-radius:14px;box-shadow:0 30px 80px rgba(0,0,0,.5);animation:room-mrise .25s}
@keyframes room-mrise{from{transform:translateY(12px);opacity:0}to{transform:none;opacity:1}}
#project-modal-overlay .close{float:right;margin:16px 18px 0 0;cursor:pointer;font-size:20px;color:var(--room-mute);
  width:34px;height:34px;display:flex;align-items:center;justify-content:center;border-radius:8px;
  transition:.2s;background:transparent;border:1px solid var(--room-line2)}
#project-modal-overlay .close:hover{background:var(--room-card)}
.modal-inner{padding:28px 32px 36px;font-family:var(--room-sans)}
.modal-inner .eb{font-family:var(--room-mono);font-size:12px;font-weight:500;letter-spacing:.08em;text-transform:uppercase;color:var(--room-accent)}
.modal-inner h2{font-family:var(--room-sans);font-weight:700;font-size:clamp(22px,3.2vw,30px);letter-spacing:-.02em;margin-top:6px;color:var(--room-ink)}
.pm-body{display:grid;grid-template-columns:1.4fr 1fr;gap:24px;margin-top:18px}
.pm-body .img-wrap{border-radius:8px;overflow:hidden;border:1px solid var(--room-line2);background:var(--room-bg)}
.pm-body .img-wrap img, .pm-body .img-wrap video{width:100%;display:block}
.pm-body .notes .desc{font-size:16px;line-height:1.6;color:var(--room-body)}
.pm-body .notes .lbl{font-family:var(--room-mono);font-size:11px;font-weight:500;letter-spacing:.1em;text-transform:uppercase;color:var(--room-accent);margin:18px 0 8px}
.pm-body .notes .tags{display:flex;flex-wrap:wrap;gap:6px}
.pm-body .notes .tag{font-family:var(--room-mono);font-size:11px;color:var(--room-accent-l);background:var(--room-accent-bg);padding:4px 9px;border-radius:4px}
.pm-body .notes .explore{display:inline-block;margin-top:20px;font-family:var(--room-sans);font-size:14px;font-weight:600;
  color:#fff;background:var(--room-accent-d);padding:10px 20px;border-radius:6px}
.pm-body .notes .explore:hover{background:#5A4580;text-decoration:none}
@media(max-width:680px){.pm-body{grid-template-columns:1fr}}

/* ---- buttons ---- */
.btn{display:inline-flex;align-items:center;gap:8px;font-family:var(--room-sans);font-size:14px;font-weight:600;
  padding:11px 22px;border-radius:6px;transition:.2s;text-decoration:none!important}
.btn-primary{background:var(--room-accent-d);color:#fff}.btn-primary:hover{background:#5A4580}
.btn-outline{background:transparent;color:var(--room-accent-l);border:1.5px solid var(--room-line2)}
.btn-outline:hover{border-color:var(--room-accent);background:var(--room-accent-bg)}

@media(prefers-reduced-motion:reduce){
  #hero-room, #hero-room *{animation-duration:.01s!important}
}
