:root {
  --blue: #0000FF;
  --white: #FFFFFF;
  --pink: #FF00FF;
  --cyan: #00FFFF;
  --yellow: #FFFF00;
  --green: #00FF00;
  --red: #FF0000;
  --dark-red: #800000;
  --dark-blue: #000080;
  --gray: #808080;

  /* Windows 98 UI Colors */
  --win98-bg: #c0c0c0;
  --win98-light: #ffffff;
  --win98-inner-light: #dfdfdf;
  --win98-shadow: #808080;
  --win98-dark: #000000;
}

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

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden; /* Prevents global page scroll */
}

/* ─── MASTER GRID FRAME LAYOUT ─── */
body.frame-layout {
  background-color: var(--blue);
  background-image: url('../media/background.gif');
  background-repeat: repeat;
  color: var(--white);
  font-family: "Times New Roman", Times, serif;
  font-size: 16px;
  line-height: 1.5;
  width: 100vw;
  margin: 0;
  
  /* GRID setup replicating cols="*,6,150" and rows="50,*" */
  /* minmax(0, 1fr) instead of bare 1fr: a bare `1fr` track has an
     implicit minimum size of `auto`, meaning Safari (and Firefox) will
     grow it to fit its widest content (e.g. the nowrap marquee text, or
     a wide fixed-width image) even past the viewport edge. That excess
     width pushes the fixed 150px nav column further right each time
     something forces a layout pass, and body's overflow:hidden then
     clips it out of view — this is what reads as the nav "migrating
     right" on Safari specifically. Capping the minimum at 0 stops the
     track from ever growing past the space actually available. */
  display: grid;
  grid-template-columns: minmax(0, 1fr) 6px 150px;
  grid-template-rows: 50px minmax(0, 1fr);
  grid-template-areas:
    "rtop    vdiv nav"
    "rbottom vdiv nav";
}

a {
  text-decoration: none;
}

/* ─── FRAME 1: TOP HEADER ("rtop") ─── */
.frame-rtop {
  grid-area: rtop;
  display: flex;
  align-items: center;
  padding: 0 20px;
  z-index: 10;
  position: relative;
  min-width: 0; /* grid items default to min-width:auto, which can force
                   the track wider regardless of minmax(0,1fr) above */

  /* Win 98 Raised Horizontal Frame Divider (space reserved, painted by ::after) */
  border-bottom: 6px solid transparent;
}

.frame-rtop::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 6px;
  background: linear-gradient(
    to bottom,
    var(--win98-light) 0%, var(--win98-light) 16.6%,
    var(--win98-bg) 16.6%, var(--win98-bg) 66.6%,
    var(--win98-shadow) 66.6%, var(--win98-shadow) 83.3%,
    var(--win98-dark) 83.3%, var(--win98-dark) 100%
  );
}

/* ─── FRAME 2: MAIN CONTENT AREA ("rbottom") ─── */
.frame-rbottom {
  grid-area: rbottom;
  overflow-y: auto; /* Independent scrollable content frame */
  min-width: 0; /* same reasoning as .frame-rtop above */
}

.body-text {
  text-align: center
}

/* ─── FRAME DIVIDER: RIGHT NAV ("vdiv") — separate from any overflow-clipped element ─── */
.frame-vdiv {
  grid-area: vdiv;
  background: linear-gradient(
    to right,
    var(--win98-light) 0%, var(--win98-light) 16.6%,
    var(--win98-bg) 16.6%, var(--win98-bg) 66.6%,
    var(--win98-shadow) 66.6%, var(--win98-shadow) 83.3%,
    var(--win98-dark) 83.3%, var(--win98-dark) 100%
  );
}

/* ─── FRAME 3: RIGHT NAVIGATION COLUMN ("nav") ─── */
/* Note: overflow lives on .feed_nav-inner, NOT this grid item —
   Safari has a known bug where a grid item that is also its own
   overflow:auto scroll container can fail to repaint and vanish. */
.frame-nav.feed_nav {
  grid-area: nav;
  position: relative;
  margin-right: 0;
  z-index: 99;
}

.feed_nav-inner {
  height: 100%;
  overflow-y: auto;
  padding: 20px 15px;
  text-align: left;
  font-family: "Times New Roman", Times, serif;
  font-size: 16px;
}

.feed_nav a,
.page_nav a {
  display: block;
  color: #ffffff;
  text-decoration: none;
  font-size: 16px;
  padding: 2px 4px;
  margin-bottom: 4px;
  border-width: 2px;
  border-style: solid;
  border-color: var(--win98-light) var(--win98-dark) var(--win98-dark) var(--win98-light);
  transform: translate(0, 0);
}

.feed_nav a:hover,
.page_nav a:hover {
  background: #00ffff;
  color: #ff0000;
  text-decoration: none;
  border-color: var(--win98-dark) var(--win98-light) var(--win98-light) var(--win98-dark);
  transform: translate(3px, 3px);
}

.feed_nav a:active,
.page_nav a:active {
  background: #ff00ff;
  color: #00ff00;
  border-color: var(--win98-dark) var(--win98-light) var(--win98-light) var(--win98-dark);
  transform: translate(3px, 3px);
}

/* Active page highlight */
.feed_nav a.select {
  background: #800000;
  color: #ffff00;
  text-decoration: none;
}

.page_nav {
  margin-top: 16px;
}

/* ─── PAGES ─── */
.page {
  display: none;
  min-height: auto;
}

.page.active {
  display: block;
}

/* No-JS fallback: only active while html.no-js is present (JS removes it immediately) */
html.no-js .page:target {
  display: block !important;
}

/* ─── CONTENT CONTAINER ─── */
#content_container {
  padding: 30px 20px 0 20px;
  position: relative;
  z-index: 10;
}

.entry {
  clear: both;
}

.project_content {
  color: #ffffff;
  width: 100%;
  max-width: 905px;
  margin: 0 auto;
  text-align: center;
}

.project_content img {
  float: none !important;
  display: block;
  position: relative;
  margin: 0 auto 15px auto;
  max-width: 100%;
  height: auto;
}

.project_content a:not(:has(.feedimg-frame)) {
  color: #ffff00;
  background: #800000;
  text-decoration: none;
}

.project_content a:not(:has(.feedimg-frame)):hover {
  background: #00ffff;
  color: #ff0000;
}

.project_content a:not(:has(.feedimg-frame)):active {
  background: #00ffff;
  color: #000080;
}

.project_bottom {
  clear: both;
  margin: 10px 0 60px 0;
}

/* ─── FOOTER ─── */
#site_footer {
  clear: both;
  color: #000080;
  padding: 15px 0 30px 0;
  font-size: 1px;
  text-align: center;
}

/* ─── BLINK ANIMATIONS ─── */
.blink-link {
  animation: blink 0.2s infinite;
  display: inline-block;
  will-change: opacity;
}

.blink-arrows {
  animation: blink 0.6s infinite;
  display: inline-block;
  font-family: "Lucida Console", Monaco, monospace;
  font-size: 14px;
  will-change: opacity;
}

@keyframes blink {
  0%, 15%  { opacity: 0; }
  16%, 100% { opacity: 1; }
}

/* ─── INDEX PAGE ─── */
#index {
  padding: 30px 20px 0 20px;
}

.index {
  margin: 20px 0 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
}

.index .module {
  position: relative;
  text-align: center;
}

/* ─── FEED IMAGE FRAMES (all main-page images, sized to each image's own dimensions) ─── */
.feedimg-frame {
  display: inline-block;
  max-width: 100%;
  margin-bottom: 15px;
  border-width: 2px;
  border-style: solid;
  border-color: var(--win98-light) var(--win98-dark) var(--win98-dark) var(--win98-light);
  transform: translate(0, 0);
}

.feedimg-frame .crop-inner {
  display: block;
  max-width: 100%;
  border-width: 2px;
  border-style: solid;
  border-color: var(--win98-bg) var(--win98-shadow) var(--win98-shadow) var(--win98-bg);
}

.feedimg-frame img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0;
}

/* When a feedimg-frame sits inside a real link, make the anchor itself
   shrink-wrap tightly around it (inline-block, same technique), instead
   of staying `inline` and generating a wider hover/click box than the
   image itself. */
.project_content a:has(.feedimg-frame) {
  display: inline-block;
  max-width: 100%;
  margin-bottom: 15px;
  line-height: 0;
}

.project_content a:has(.feedimg-frame) .feedimg-frame {
  margin-bottom: 0;
}

/* Depress (sunken bevel + slight down-left shift) ONLY when the frame
   sits inside a real hyperlink — reinforces the "pressed button" feel */
a:hover .feedimg-frame {
  border-color: var(--win98-dark) var(--win98-light) var(--win98-light) var(--win98-dark);
  transform: translate(3px, 3px);
}

a:hover .feedimg-frame .crop-inner {
  border-color: var(--win98-shadow) var(--win98-bg) var(--win98-bg) var(--win98-shadow);
}

.cardimgcrop {
  margin: 0 0 12px 0;
  position: relative;
  width: 200px;
  height: 200px;
  overflow: hidden;
  border-width: 2px;
  border-style: solid;
  border-color: var(--win98-light) var(--win98-dark) var(--win98-dark) var(--win98-light);
  transform: translate(0, 0);
}

.cardimgcrop:hover {
  border-color: var(--win98-dark) var(--win98-light) var(--win98-light) var(--win98-dark);
  transform: translate(3px, 3px);
}

.crop-inner img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb_title {
  overflow: hidden;
  padding-top: 2px;
  white-space: nowrap;
  text-align: center;
  width: 200px;
  font-size: 14px;
  line-height: 15px;
}

.thumb_title a {
  background: #800000;
  color: #ffff00;
  font-size: 14px;
  line-height: 15px;
  display: block;
  text-decoration: none;
  text-transform: uppercase;
}

.thumb_title a:hover {
  background: #00ffff;
  color: #ff0000;
}

/* ─── BIOGRAPHY PAGE ─── */
#biography {
  padding: 30px 20px 0 20px;
}

/* Pin the footer to the bottom of the visible frame (not just after the
   content) on pages that may be shorter than the viewport. min-height
   fills the .frame-rbottom viewport when content is short; on longer
   content the page grows past 100% as normal and the footer trails it,
   scrolling into view like anywhere else. */
#biography.active,
#introductions.active {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

#biography #site_footer,
#introductions #site_footer {
  margin-top: auto;
}

.bio-text {
  font-size: 14px;
  font-family: "Times New Roman", Times, serif;
  line-height: 1.5;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-top: 0px;
  
}

.bio-text a {
  color: #ffff00;
  background: #800000;
  text-decoration: none;
}

.bio-text a:hover {
  background: #00ffff;
  color: #ff0000;
}

.bio-text a:active {
  background: #ff00ff;
  color: #00ff00;
}

/* ─── INTRODUCTIONS PAGE ─── */
#introductions {
  padding: 30px 20px 0 20px;
}

.intro-text {
  font-size: 14px;
  font-family: "Times New Roman", Times, serif;
  line-height: 1.5;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-top: 0px;
}

.intro-text a {
  color: #ffff00;
  background: #800000;
  text-decoration: none;
}

.intro-text a:hover {
  background: #00ffff;
  color: #ff0000;
}

.intro-text a:active {
  background: #ff00ff;
  color: #00ff00;
}

.marquee-container {
  overflow: hidden;
  white-space: nowrap;
  width: 100%;
  color: #ffffff;
  padding: 10px 0;
  
  font-family: "Times New Roman", Times, serif;
  font-size: 16px;
}

.marquee-content {
  display: inline-block;
  padding-left: 100%;
  animation: scroll-left 15s steps(150, end) infinite;
}

@keyframes scroll-left {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-100%);
  }
}

/* ─── WIN98 SCROLLBARS (Chromium/Safari full effect, Firefox flat fallback) ─── */
.frame-rbottom,
.feed_nav-inner {
  scrollbar-width: auto;
  scrollbar-color: var(--win98-bg) var(--win98-shadow);
}

.frame-rbottom::-webkit-scrollbar,
.feed_nav-inner::-webkit-scrollbar {
  width: 16px;
}

.frame-rbottom::-webkit-scrollbar-track,
.feed_nav-inner::-webkit-scrollbar-track {
  background: var(--win98-shadow);
  border-top: 1px solid var(--win98-dark);
  border-left: 1px solid var(--win98-dark);
  border-right: 1px solid var(--win98-light);
  border-bottom: 1px solid var(--win98-light);
}

.frame-rbottom::-webkit-scrollbar-thumb,
.feed_nav-inner::-webkit-scrollbar-thumb {
  background: var(--win98-bg);
  border-top: 1px solid var(--win98-light);
  border-left: 1px solid var(--win98-light);
  border-right: 1px solid var(--win98-dark);
  border-bottom: 1px solid var(--win98-dark);
}

.frame-rbottom::-webkit-scrollbar-button,
.feed_nav-inner::-webkit-scrollbar-button {
  display: block;
  height: 16px;
  background-color: var(--win98-bg);
  background-repeat: no-repeat;
  background-position: center;
  border-top: 1px solid var(--win98-light);
  border-left: 1px solid var(--win98-light);
  border-right: 1px solid var(--win98-dark);
  border-bottom: 1px solid var(--win98-dark);
}

.frame-rbottom::-webkit-scrollbar-button:vertical:start:decrement,
.feed_nav-inner::-webkit-scrollbar-button:vertical:start:decrement {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Cpolygon points='4,1 7,6 1,6' fill='black'/%3E%3C/svg%3E");
}

.frame-rbottom::-webkit-scrollbar-button:vertical:end:increment,
.feed_nav-inner::-webkit-scrollbar-button:vertical:end:increment {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Cpolygon points='1,1 7,1 4,6' fill='black'/%3E%3C/svg%3E");
}

.frame-rbottom::-webkit-scrollbar-button:vertical:start:increment,
.feed_nav-inner::-webkit-scrollbar-button:vertical:start:increment,
.frame-rbottom::-webkit-scrollbar-button:vertical:end:decrement,
.feed_nav-inner::-webkit-scrollbar-button:vertical:end:decrement {
  display: none;
}

.frame-rbottom::-webkit-scrollbar-corner,
.feed_nav-inner::-webkit-scrollbar-corner {
  background: var(--win98-bg);
}

/* ─── RESPONSIVE MOBILE VIEW ─── */
@media (max-width: 768px) {
  body.frame-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 50px 1fr 6px auto;
    grid-template-areas:
      "rtop"
      "rbottom"
      "vdiv"
      "nav";
  }

  .frame-vdiv {
    background: linear-gradient(
      to bottom,
      var(--win98-light) 0%, var(--win98-light) 16.6%,
      var(--win98-bg) 16.6%, var(--win98-bg) 66.6%,
      var(--win98-shadow) 66.6%, var(--win98-shadow) 83.3%,
      var(--win98-dark) 83.3%, var(--win98-dark) 100%
    );
  }
}