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

:root {
  --bg: #dc7208;
  --text: #ffffff;
  --muted: hsl(219, 100%, 91%);
  --orange: #9fff40;
  --blue: #f9c7d8;
  --blue-dark: #e0c6f9;
  --bar-bg: #ec6641;
  /* --bg: #f8e6d9;
  --text: #424040;
  --muted: hsl(189,19%,63%);
  --orange: #eb6d12;
  --blue: #342b32;
  --blue-dark: #2f233a; */
}


html, body { height: 100%; }

body {
  /* font-family: 'Open Sans', sans-serif; */
  /* font-family: 'Source Serif 4', serif; */
  /* font-family: 'Quicksand', sans-serif; */
  /* font-family: 'Open Sans', monospace; */
  /* font-family: 'Zilla Slab', serif; */
  font-family: 'Spectral', serif;
  font-size: 0.95em;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  cursor: default;
}

#myCanvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* Woven texture overlay — subtle riso-like noise behind content */
#texture {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url('crack.jpg');
  /* Tile the woven texture like riso noise */
  background-repeat: repeat;
  background-size: auto;
  opacity: 0.08;              /* tweak to taste for more/less texture */
  mix-blend-mode: multiply;   /* lets the color underneath show through */
}

.page-wrapper {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-rows: 32px 1fr 32px;
  height: 100vh;
  transition: transform 0.8s cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* Base roof layout (used for both the real roof and empty spacers) */
.roof {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 1em;
}

/* Only the homepage roof gets visible styling */
.roof--filled {
  border-bottom: 1px solid var(--text);
  background: var(--bar-bg);
}

.roof > :last-child { text-align: right; }

/* Weather and clock sit on a single horizontal line:
   - weather block (winds / temp / clouds) on the left
   - clock on the right */
.weather {
  display: flex;
  flex-direction: row;
  gap: 0.75em;
}

.basement {
  display: flex;
  align-items: center;
  justify-content: center;
  border-top: 1px solid var(--text);
  background: var(--bar-bg);
}


/* When basement is open, use the basement bar as the top orange bar */
body.basement-open .roof {
  display: none;
}

body.basement-open .basement {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 32px;
  border-top: none;
  border-bottom: 1px solid var(--text);
  z-index: 6;
}

.roof button, .basement button {
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
  color: inherit;
  display: block;
  padding: 0;
  margin: 0;
}

.roof button:hover, .basement button:hover { text-decoration: underline; }

.site-container {
  display: grid;
  grid-template-columns: 16% 52% 32%;
  padding: 2em 2em;
}

/* On the home page, keep roof/basement pinned and let only the middle scroll */
.page-home {
  overflow: hidden;
}

.page-home .site-container {
  /* Allow scrolling only in the middle row of the page grid */
  overflow-y: auto;
  /* Required so grid child can actually shrink inside 1fr track */
  min-height: 0;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1em;
  padding: 1em;
}

.avatar-wrap {
  position: relative;
  display: inline-block;
}

.avatar-tooltip,
.title-tooltip {
  display: none;
  position: fixed;
  border: 1.5px solid var(--orange);
  z-index: 1000;
  pointer-events: none;
  background: var(--orange);
  border-radius: 4px;
  box-shadow: 0 0 25px 24px rgba(147, 242, 53, 0.6);
  filter: blur(0.6px);
}

.avatar-tooltip {
  color: var(--bg);
  font-family: 'Spectral', serif;
  font-size: 0.85em;
  line-height: 1.5;
  padding: 3px;
  white-space: nowrap;
}

.title-tooltip {
  padding: 3px;
}

.title-tooltip img {
  display: block;
  width: 180px;
}

.avatar-wrap:hover .avatar-tooltip,
.title-hover:hover .title-tooltip { display: block; }

.sidebar img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border: 2px solid var(--orange);
  /* bright glow around avatar */
  box-shadow:
    0 0 12px 4px rgba(240, 76, 114, 0.45),
    0 0 28px 10px rgba(147, 242, 53, 0.55),
    inset 0 0 8px 2px rgba(240, 76, 114, 0.15);
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* let link width hug its text */
}

.sidebar nav a {
  font-family: 'Open Sans', sans-serif;
  font-weight: 500;
  text-transform: uppercase;
  color: var(--orange);
  font-size: 1.2em; /* match 'a note about this site...' heading */
  text-decoration: none;
  display: inline-block;
  padding: 0 0.16em;
  line-height: 1.3;
  margin: 0.3em 0;
}

.sidebar nav a:hover,
.sidebar nav a.active {
  text-decoration: none;
  background: rgb(255, 73, 37);
  
}

/* Hide the last four sidebar links (starting with poemics) */
.sidebar nav a:nth-last-child(-n+4) {
  display: none;
}

.social-links {
  display: flex;
  flex-direction: row;
  gap: 1em;
  margin-top: 1.5em;
}

.social-links a {
  color: var(--orange);
  text-decoration: none;
  opacity: 0.8;
  transition: opacity 0.2s ease;
  display: flex;
  align-items: center;
}

.social-links a:hover {
  opacity: 1;
}

.social-icon {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

/* Hide mobile social links on desktop */
.social-links--mobile {
  display: none;
}

.main-content {
  /* slightly tighter top padding so the main title sits closer to the roof */
  padding: 0.5em 2em 1.5em 1em;
  overflow-y: auto;
  max-width: 95%;
  margin: 0 auto;
}

.right-panel {
  padding: 1em;
  margin: 1em;
  border: 2px solid var(--blue-dark);
  overflow-y: auto;
  background: radial-gradient(ellipse at center, rgba(93, 127, 242, 0.18) 0%, transparent 75%);
  box-shadow: 0 0 40px 10px rgba(93, 127, 242, 0.2), inset 0 0 40px 5px rgba(93, 127, 242, 0.08);
  display: flex;
  flex-direction: column;
}

/* On the home page, let the orbits box height shrink-wrap to its content
   instead of stretching to fill the whole middle row of the layout grid. */
.page-home .right-panel {
  align-self: start;
}

/* Everything page: keep right panel top padding same as others */
.site-container--everything .right-panel {
  padding-top: 1em;
}

.right-panel ul {
  list-style: disc;
  padding-left: 1.2em;
  margin-bottom: 1em;
}


#rita-subtitle {
  height: 2lh;
  font-size: 1.2em;
}

.title-hover {
  position: relative;
}

.site-title {
  font-family: 'Idiqlat', serif;
  /* smaller, less dominant nameplate */
  font-size: 2em;
  color: var(--orange);
  line-height: 1.05;
  margin-bottom: 0.1em;
}

/* Sidebar page titles (e.g., RESEARCH, ARTIFACTS, EVERYTHING) */
.site-header h1 {
  color: var(--orange);
}

/* Everything page labels under the title */
.everything-label {
  font-family: 'Spectral', serif;
  font-style: italic;
  font-weight: 400;
  font-size: 1.2em;
  color: var(--orange);
  margin-top: 0.3em;
  margin-bottom: 0.9em;
}

.right-panel .everything-label {
  text-align: right;
  /* nudge up to better align with left 'formally' label */
  margin-top: 0.3em;
}

/* Embedded project index iframes on Everything page */
.projects-iframe {
  width: 100%;
  height: 480px;
  border: 1px solid var(--blue-dark);
  background: #fff;
  margin-bottom: 1em;
}

/* On the Everything page, give the first "informally" projects box
   extra breathing room below the heading. */
.site-container--everything .right-panel .projects-iframe:first-of-type {
  margin-top: 1em;
}
.heading {
  font-family: 'Open Sans', sans-serif;
  font-size: 1.2em;
  font-weight: 500;
  color: var(--blue);
  margin-top: 1.2em;
  margin-bottom: 0.4em;
  text-transform: uppercase;
}

/* Flower emoji bullets for main content lists */
.main-content ul {
  list-style: none;
  padding-left: 1.5em;
}

.main-content ul li::before {
  content: "❃ ";
  margin-left: -1.5em;
  margin-right: 0.5em;
}

/* Indented list */
.main-content ul.indented-list {
  padding-left: 3em;
}

/* CV-style lists on the Everything page */
.cv-section {
  margin-top: 1.4em;
}

.cv-list {
  list-style: none;
  padding-left: 0;
  margin-left: 0;
  margin-top: 0.3em;
}

.cv-item {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  margin-bottom: 0.2em;
}

.cv-year {
  font-family: 'Open Sans', monospace;
  font-size: 0.9em;
  /* keep the year snug to the title while sharing the same left edge */
}


/* Make titles in the CV list look like links (orange),
   and actual links underlined. */
.cv-work-title {
  color: var(--orange);
}

.cv-title {
  color: var(--orange);
}

.cv-detail a {
  color: var(--orange);
  text-decoration: underline;
}

/* Research / general content */
.main-content a { color: var(--orange); }
.main-content ul { padding-left: 1.4em; margin-bottom: 0.8em; }
.main-content p  { margin-bottom: 0.7em; }

/* Research page: slightly narrower column */
.site-container--wide .research-content {
  width: 90%;
}

/* Artifacts wide layout */
.site-container--wide { grid-template-columns: 16% 1fr; }


/* Gallery grid */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 1.2em; }
.gallery-item { cursor: pointer; }
.gallery-item img, .gallery-item video {
  width: 100%; aspect-ratio: 1; object-fit: cover; display: block;
  border: 1.5px solid transparent; transition: border-color 0.15s;
}
.gallery-item:hover img, .gallery-item:hover video { border-color: var(--orange); }
.gallery-title { margin-top: 0.4em; font-family: 'Open Sans', sans-serif; font-size: 0.82em; font-weight: 600; }
.gallery-title a { color: var(--text); text-decoration: none; }
.gallery-title a:hover { color: var(--orange); }
.gallery-item p { font-size: 1em; color: var(--muted); margin-top: 0.15em; }
.gallery-info { font-family: 'Open Sans', monospace; font-size: 0.72em !important; }
.gallery-item--hidden { display: none; }

/* ===== Exploration / Project detail pages ===== */
.project-back {
  display: inline-block;
  font-family: 'Open Sans', monospace;
  font-size: 0.78em;
  color: var(--orange);
  text-decoration: none;
  margin-bottom: 0.6em;
  opacity: 0.8;
}
.project-back:hover { opacity: 1; text-decoration: underline; }

.project-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2em 0.7em;
  margin: 0.2em 0 1.4em;
  font-family: 'Open Sans', monospace;
  font-size: 0.78em;
  color: var(--muted);
}
.project-meta-sep { opacity: 0.5; }
.project-meta a { color: var(--orange); text-decoration: none; }
.project-meta a:hover { text-decoration: underline; }

.project-body {
  display: grid;
  grid-template-columns: 35% 1fr;
  gap: 6em;
  margin-top: 2.5em;
  margin-bottom: 2em;
  align-items: start;
}
.project-body--full { display: block; }

/* Research page: give text more space than media */
.research-project .project-body,
.research-project .project-body--reverse {
  grid-template-columns: 60% 40%;
}

.project-meta-col {
  font-family: 'Open Sans', monospace;
  font-size: 0.85em;
}

.meta-section {
  margin-bottom: 2em;
}

.meta-section h3 {
  font-size: 0.9em;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.3em;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.meta-section p {
  margin: 0;
  line-height: 1.6;
}

.meta-section--highlight p {
  color: var(--text);
  background: rgb(255, 73, 37);
  font-style: italic;
  padding: 0.2em 0.4em;
  display: inline-block;
}

.project-desc {
  font-family: 'Open Sans', monospace;
  font-size: 0.85em;
}

.project-desc h3 {
  font-size: 0.9em;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.5em;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Research page: larger publication titles + descriptions */
.research-project .project-desc {
  font-size: 1em;
}
.research-project .project-desc h3 {
  font-size: 1.1em;
}

.project-desc p {
  line-height: 1.6;
}

/* Reverse layout: put media on the right, text on the left */
.project-body--reverse {
  display: grid;
}
.project-body--reverse .project-media { order: 2; }
.project-body--reverse .project-desc  { order: 1; }

.project-desc p  { margin-bottom: 0.7em; }
.project-desc ul { padding-left: 1.4em; margin-bottom: 0.8em; }
.project-desc a  { color: var(--orange); }
.project-desc blockquote {
  border-left: 2px solid var(--orange);
  padding-left: 1em;
  margin: 0.8em 0;
  color: var(--muted);
  font-style: italic;
}

.project-media img,
.project-media video { width: 100%; display: block; margin-bottom: 0.5em; }

.video-embed {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 */
  margin-bottom: 0.5em;
}

.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.project-caption {
  font-family: 'Open Sans', monospace;
  font-size: 0.72em;
  color: var(--muted);
  margin-bottom: 0.9em;
  margin-top: -0.3em;
}

.project-video {
  width: 100%;
  max-width: 1000px;
  margin: 2em 0;
}

.project-video video {
  width: 100%;
  display: block;
}

/* Hero image section */
.project-hero {
  width: 100%;
  max-width: 900px;
  margin: 2em 0;
}

.project-hero img {
  width: 100%;
  height: auto;
  display: block;
}

/* Description section */
.project-description {
  max-width: 700px;
  margin: 2em 0;
  line-height: 1.7;
}

.project-description p {
  margin-bottom: 1em;
}

.project-description ul,
.project-description ol {
  margin-left: 1.5em;
  margin-bottom: 1em;
}

/* Gallery styling - grid layout */
.project-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5em;
  margin: 3em 0;
  width: 100%;
  max-width: 1000px;
}

.project-gallery--two-col {
  grid-template-columns: repeat(2, 1fr);
  width: 100%;
  max-width: 1000px;
}

.project-gallery img {
  width: 100%;
  height: auto;
  object-fit: cover;
  aspect-ratio: 4 / 3;
  display: block;
}

.project-gallery video {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 16 / 9;
}

.project-image-full {
  width: 100%;
  margin: 2em 0;
  max-width: 1000px;
}

.project-image-full img {
  width: 100%;
  height: auto;
  display: block;
}

/* Optional: Gallery captions */
.gallery-item {
  display: flex;
  flex-direction: column;
}

.gallery-item figcaption {
  font-family: 'Open Sans', sans-serif;
  font-size: 0.75em;
  color: var(--muted);
  margin-top: 0.5em;
}

/* Roof reveal iframe overlay — full viewport */
#roof-iframe-container {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: stretch;
  justify-content: center;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-100%);
  transition: transform 0.5s cubic-bezier(0.33, 1, 0.68, 1), opacity 0.4s ease;
}

body.roof-open {
  overflow: hidden; /* prevent scrolling back to the site */
}

body.roof-open #roof-iframe-container {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.roof-iframe-inner {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.roof-iframe-framewrap {
  flex: 1;
  background: #000;
  position: relative;
  overflow: hidden;
}

.roof-iframe-framewrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* Bottom bar inside overlay that mirrors the roof bar, covering Google's gray bar */
.roof-overlay-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  border-top: 1px solid var(--text);
  border-bottom: 0;
}

/* Basement overlay — slides up from the bottom, keeps roof visible at top */
#basement-iframe-container {
  position: fixed;
  left: 0;
  right: 0;
  top: 32px;   /* leave room for the roof bar */
  bottom: 0;
  z-index: 5;
  display: flex;
  align-items: stretch;
  justify-content: center;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transform: translateY(100%);
  transition: transform 0.5s cubic-bezier(0.33, 1, 0.68, 1), opacity 0.4s ease;
}

body.basement-open {
  overflow: hidden;
}

body.basement-open #basement-iframe-container {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.basement-iframe-inner {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.basement-iframe-framewrap {
  flex: 1;
  background: #000;
}

.basement-iframe-framewrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* ===== Right panel cycler ===== */

.panel-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75em;
  padding-bottom: 0.45em;
  border-bottom: 1px solid rgba(217, 179, 255, 0.35);
}

.panel-nav-label {
  font-family: 'Open Sans', monospace;
  font-size: 0.68em;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.panel-nav-btns { display: flex; gap: 0.5em; }

.panel-nav-btn {
  background: none;
  border: none;
  color: var(--orange);
  font-size: 0.85em;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}
.panel-nav-btn:hover { text-decoration: underline; }

.panel-view { display: none; }
.panel-view.panel-active { display: block; }

/* Panel 1: NOW */
.now-grid {
  display: grid;
  grid-template-columns: 5em 1fr;
  gap: 0.45em 0.65em;
  margin-top: 0.2em;
}
.now-label {
  font-family: 'Open Sans', monospace;
  font-size: 0.72em;
  color: var(--muted);
  text-align: right;
  padding-top: 0.15em;
  white-space: nowrap;
}
.now-value { font-size: 0.86em; line-height: 1.4; }
.now-value a { color: var(--orange); }

/* Panel 2: LOGBOOK */
.log-entries { margin-top: 0.2em; }
.log-entry {
  display: grid;
  grid-template-columns: 5.2em 1fr;
  gap: 0.5em;
  margin-bottom: 0.6em;
  align-items: baseline;
}
.log-date {
  font-family: 'Open Sans', monospace;
  font-size: 0.68em;
  color: var(--muted);
  white-space: nowrap;
}
.log-text { font-size: 0.84em; line-height: 1.35; }
.log-text a { color: var(--orange); }

/* Panel 3: SELECTED WORKS */
.works-list { margin-top: 0.3em; }
.work-item {
  border-left: 2px solid var(--blue-dark);
  padding: 0.25em 0 0.25em 0.65em;
  margin-bottom: 0.7em;
  transition: border-color 0.15s;
}
.work-item:hover { border-left-color: var(--orange); }
.work-title { font-size: 0.86em; font-weight: 600; margin-bottom: 0.12em; }
.work-title a { color: var(--text); text-decoration: none; }
.work-title a:hover { color: var(--orange); }
.work-desc { font-size: 0.76em; color: var(--muted); line-height: 1.3; }
.work-tag { font-family: 'Open Sans', monospace; font-size: 0.66em; color: var(--blue-dark); margin-top: 0.18em; }

/* ===== ORBITS panel ===== */

/* Orbits-style lists (used in the right panel and elsewhere) */
.orbits-list { list-style: none; padding: 0; margin: 0; }

/* Static style label */
.orbits-style-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6em;
  flex-shrink: 0;
}
.orbits-style-label {
  font-family: 'Open Sans', monospace;
  font-size: 0.65em;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.55;
}

/* 2-col grid */
.orbits-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-content: space-between;
  gap: 0 1em;
}

.orbits-section {
  padding: 10px 0;
}

.orbits-section-label {
  font-family: 'Open Sans', monospace;
  font-weight: 500;
  font-size: 0.8em;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  margin-bottom: 0.28em;
  padding-bottom: 0.12em;
  color: var(--muted);
  
  opacity: 1;
  /* border drawn per style */
}

.orbits-list li {
  font-size: 0.94em;
  line-height: 1.4;
  margin-bottom: 0.08em;
  display: flex;
  gap: 0.3em;
}
.orbits-list li::before {
  content: '❃';
  flex-shrink: 0;
  font-size: 0.8em;
  color: var(--muted);
  opacity: 0.85;
}
.orbits-list li a { color: var(--orange); text-decoration: underline; text-decoration-color: rgba(255,255,255,0.3); }

/* 404 page: roomier flower list */
.main-content .not-found-list {
  list-style: none;
  margin: 0 0 1.2em;
  padding: 0;
}
.main-content .not-found-list li {
  display: flex;
  gap: 0.45em;
  font-size: 1em;
  line-height: 1.6;
  margin-bottom: 0.4em;
}
.main-content .not-found-list li::before {
  content: '❃';
  flex-shrink: 0;
  font-size: 1.05em;
  color: var(--muted);
  opacity: 0.9;
}
.main-content .not-found-list a {
  color: var(--orange);
  text-decoration: underline;
}

.orbits-log { display: flex; flex-direction: column; gap: 0.2em; }
.orbits-log-entry {
  display: grid;
  grid-template-columns: 3.8em 1fr;
  gap: 0.3em;
  align-items: baseline;
}
.orbits-log-date {
  font-family: 'Open Sans', monospace;
  font-size: 0.66em;
  opacity: 0.55;
  white-space: nowrap;
}
.orbits-log-text { font-size: 0.94em; line-height: 1.25; }
.orbits-log-text a { color: var(--orange); text-decoration: underline; text-decoration-color: rgba(255,255,255,0.3); }

/* Chalk — hand-drawn dashed outline, glowy + colored */
.rp-s5 {
  background: none;
  /* chalky, glowy dashed frame */
  border: 2px dashed rgba(217, 179, 255, 0.9);
  box-shadow:
    0 0 10px rgba(217, 179, 255, 0.8),
    0 0 25px rgba(217, 179, 255, 0.65);
  /* pull the text closer to the frame so there's less empty orange space */
  padding: 0.75em 1.3em 1em;
}
.rp-s5 .orbits-section-label {
  border-bottom: 1px dashed rgba(217, 179, 255, 0.9);
}
.rp-s5 .orbits-list li a,
.rp-s5 .orbits-log-text a { color: var(--orange); text-decoration-color: rgba(255,239,239,0.3); }

/* Panel 5: FIELD NOTES */
.field-note-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.4em 0.4em 0.6em;
}
.field-note-glyph {
  font-size: 1.1em;
  color: var(--orange);
  margin-bottom: 1em;
}
.field-note-text {
  font-family: 'Spectral', serif;
  font-style: italic;
  font-size: 0.96em;
  line-height: 1.65;
  margin-bottom: 0.9em;
}
.field-note-attr {
  font-family: 'Open Sans', monospace;
  font-size: 0.68em;
  color: var(--muted);
}
.field-note-attr a { color: var(--orange); }
.field-note-hint {
  font-family: 'Open Sans', monospace;
  font-size: 0.62em;
  color: var(--muted);
  opacity: 0.55;
  margin-top: 1.2em;
}
#field-note-content { cursor: pointer; }

/* Candle cursor for basement links */
.candle-cursor {
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32"><text y="24" font-size="24">🕯️</text></svg>') 16 28, auto !important;
}

/* Ladder cursor trigger elements (roof button / overlay bar) */
.ladder-cursor {
  cursor: inherit; /* let body.ladder-cursor-active control actual cursor */
}

/* Ladder cursor that follows mouse over roof */
#ladder-cursor {
  position: fixed;
  font-size: 2.1rem; /* slightly larger ladder */
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.15s ease;
}

body.ladder-cursor-active,
body.ladder-cursor-active * {
  cursor: none !important;
}

/* ========================================
   RESPONSIVE DESIGN - MOBILE & TABLET
   ======================================== */

/* Tablet breakpoint (768-1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
  .site-container {
    grid-template-columns: 200px 1fr;
  }

  .site-container--wide {
    grid-template-columns: 200px 1fr;
  }

  /* Hide right panel on tablet homepage */
  .page-home .right-panel {
    display: none;
  }
}

/* Mobile breakpoint (<768px) */
@media (max-width: 767px) {
  /* Typography adjustments */
  body {
    font-size: 0.9em;
  }

  .site-title {
    font-size: 1.8em;
  }

  .heading {
    font-size: 1em;
  }

  .sidebar nav a {
    font-size: 1.1em;
  }

  /* Roof/basement height reduction */
  .page-wrapper {
    grid-template-rows: 28px 1fr 28px;
    height: auto;  /* Allow page wrapper to expand beyond viewport on mobile */
    min-height: 100vh;  /* Ensure at least full height */
  }

  /* Allow page-level scrolling on mobile instead of nested scrolling */
  .page-home {
    overflow: visible;
  }

  /* Site container should not scroll on mobile - allow natural document flow */
  .page-home .site-container {
    overflow-y: visible;
  }

  /* Roof bar: compact on mobile */
  .roof {
    padding: 0 0.5em;
    font-size: 0.85em;
  }

  .weather {
    gap: 0.5em;
  }

  /* Hide winds and clouds, keep only temp */
  .weather span:first-child,
  .weather span:last-child {
    display: none;
  }

  /* Shorten button text on mobile */
  .roof button {
    font-size: 0.85em;
  }

  /* Basement bar: match roof styling, flow naturally at bottom */
  .basement {
    padding: 0 0.5em;
    font-size: 0.85em;
    position: relative;
    /* Remove fixed positioning to avoid iOS Safari UI collision */
  }

  .basement button {
    font-size: 0.85em;
  }

  /* Add padding to site-container for spacing */
  .site-container {
    padding-bottom: 0;
  }

  /* Layout: stack all columns */
  .site-container {
    grid-template-columns: 1fr;
    padding: 1em;
  }

  .site-container--wide {
    grid-template-columns: 1fr;
  }

  /* Ensure proper stacking order: sidebar -> main -> right panel */
  .main-content {
    order: 2;
  }

  .right-panel {
    order: 3;
  }

  /* Sidebar adjustments */
  .sidebar {
    order: 1;
    padding: 0.8em;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.8em;
  }

  .avatar-wrap {
    flex-shrink: 0;
  }

  .sidebar nav {
    flex: 1;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5em;
    align-items: flex-start;
  }

  .sidebar nav a {
    font-size: 0.95em;
  }

  /* Hide sidebar social links on mobile */
  .sidebar .social-links {
    display: none;
  }

  /* Show mobile social links in main content */
  .social-links--mobile {
    display: flex !important;
    flex-direction: row;
    gap: 0.8em;
    margin: 0.5em 0 1em 0;
  }

  .social-links--mobile .social-icon {
    width: 14px;
    height: 14px;
  }

  /* Main content */
  .main-content {
    padding: 0.5em 1em;
    max-width: 100%;
    overflow-y: visible;  /* Remove nested scrolling - allow natural document flow */
    max-height: none;
  }

  /* Right panel - show on mobile */
  .right-panel {
    display: flex;
    margin: 0.5em auto;
    padding: 0.6em;
    max-width: 85%;
    overflow-y: visible;  /* Remove nested scrolling - allow natural document flow */
    max-height: none;
    font-size: 0.92em;
  }

  /* Tighter spacing in orbits panel on mobile */
  .orbits-body {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .orbits-section {
    padding: 0.5em 0 0.3em;
  }

  .orbits-section:first-child {
    padding-top: 0;
  }

  /* Gallery adjustments - single column on mobile */
  .gallery {
    grid-template-columns: 1fr;
    gap: 1em;
  }

  .artifacts-gallery {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .project-gallery {
    grid-template-columns: 1fr;
    gap: 1.2em;
  }

  .project-gallery--two-col {
    grid-template-columns: 1fr;
  }

  /* Project detail layouts */
  .project-body {
    grid-template-columns: 1fr;
    gap: 2em;
  }

  .research-project .project-body,
  .research-project .project-body--reverse {
    grid-template-columns: 1fr;
  }

  /* Artifacts gallery hover → always visible */
  .gallery-desc,
  .gallery-info {
    position: static;
    opacity: 1;
    transform: none;
    text-shadow: none;
    margin-top: 0.5em;
    font-size: 0.85em;
    color: var(--text);
    text-align: left;
  }

  .gallery-desc {
    font-size: 0.95em;
  }

  .gallery-info {
    font-size: 0.8em;
    color: var(--muted);
  }

  .gallery-item:hover img,
  .gallery-item:hover video {
    filter: none;
  }

  /* Preserve 4:3 aspect ratio for artifacts gallery on mobile */
  .artifacts-gallery .gallery-item img,
  .artifacts-gallery .gallery-item video {
    aspect-ratio: 4 / 3;
    object-fit: cover;
  }

  /* Filter buttons: better touch targets */
  .filter-btn {
    padding: 6px 10px;
    font-size: 0.8em;
  }

  /* Touch feedback for interactive elements */
  .sidebar nav a:active {
    background: rgb(255, 73, 37);
  }

  .filter-btn:active {
    background: rgba(217, 179, 255, 0.12);
  }

  /* Hide ladder cursor on mobile */
  #ladder-cursor {
    display: none;
  }

  /* Tooltip positioning for mobile */
  .avatar-tooltip,
  .title-tooltip {
    max-width: 200px;
  }
}

/* Extra small devices (<480px) */
@media (max-width: 479px) {
  .site-container {
    padding: 0.5em;
  }

  .main-content {
    padding: 0.5em;
  }

  .sidebar {
    padding: 0.5em;
  }

  .site-title {
    font-size: 1.5em;
  }

  .gallery {
    grid-template-columns: 1fr;
  }

  .artifacts-gallery {
    grid-template-columns: 1fr;
  }
}
