@charset "UTF-8";

/* --- Global Resets & Base --- */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
  margin: 0; padding: 0; border: 0; font-size: 100%; font: inherit; 
  vertical-align: baseline; box-sizing: border-box; 
}
article, aside, details, figcaption, figure, footer, header, hgroup, 
menu, nav, section, main { display: block; }
ol, ul { list-style: none; }
blockquote, q { quotes: none; }
blockquote:before, blockquote:after, q:before, q:after { content: ''; content: none; }
table { border-collapse: collapse; border-spacing: 0; }
img, video { max-width: 100%; height: auto; display: block; }

/* --- Font Definitions --- */
@font-face {
  font-family: 'PxGroteskRegular';
  src: url("font/PxGroteskRegular-Regular.eot"); /* <<< ENSURE CORRECT PATH */
  font-style: normal; font-weight: normal; 
}
/* Questrial, Playfair Display assumed linked in index.html */

/* --- Variables & Theming (Based on your provided "working" version) --- */
:root {
  --background-color: #ffffff; 
  --text-color: #003344;       
  --grid-line: #00000011;      

  /* Using Questrial as per your H1 observation, PxGrotesk for accents */
  --font-main-h1: 'Questrial', sans-serif; 
  --font-body: 'Questrial', sans-serif;
  --font-menu-items: 'Questrial', sans-serif;
  --font-menu-titles: 'PxGroteskRegular', sans-serif; /* For "David Gammage", "Projects" titles in menu */
}

html {
    width: 100%; height: 100%;
    background-color: var(--background-color); /* Should be white */
    transition: background-color 0.3s ease-in-out; /* For JS theme changes on article load */
}

body {
  width: 100%; min-height: 100%; 
  font-family: var(--font-body); 
  font-size: 16px; /* From your CSS dump */
  line-height: 1.5; /* General readability baseline */
  color: var(--text-color); /* Default text color for body */

  /* BODY background grid - from your CSS dump */
  background-size: 32px 32px;
  background-image: linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
                    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-position: center center;
  /* Body is on top of HTML's solid white BG. The body grid shows against HTML's white */
  background-color: transparent; /* So html color can act as a base IF body has transparent areas */
  
  transition: color 1s; /* For titles.js H1 color change via body class */
}
/* body.color classes affect the --text-color variable, which H1 inherits for hover effects */
body.yellow { --text-color: #f8d11c; }
body.green  { --text-color: #00f9b5; }
body.blue   { --text-color: #2248cd; }
body.pink   { --text-color: #aa3035; }


a { color: var(--text-color); text-decoration: none; } /* Default links use themed text color */

/* --- Menu System (Reverting to style.css menu styling from input_file_1, often had bigger fonts) --- */
.menu-link {
  position: fixed; bottom: 3.33333vw; left: 3.33333vw;
  z-index: 10002; background: #fff; height: 53px; width: 53px;
  text-align: center; line-height: 53px; text-transform: uppercase;
  letter-spacing: 0.15em; font-family: 'PxGroteskRegular', sans-serif; /* Specific font */
  font-size: 11px; font-weight: 600; border-radius: 100px; color: #444;
  box-shadow: rgba(0, 0, 0, 0.08) 0px 0px 30px 0px; cursor: pointer;
}
@media (min-width: 1300px) { .menu-link { bottom: 42.66667px; left: 42.66667px; } }
@media (max-width: 760px) { .menu-link { bottom: 15px; left: 15px; } }
.menu-link:after { content: 'Menu'; }
.show-menu .menu-link:after { content: 'Close'; }
.menu-link:hover { background: #f3f3f3; }
@media (max-width: 760px) { .menu-link:hover { background: #fff; } }

.menu {
  position: fixed; bottom: 3.33333vw; left: 3.33333vw;
  z-index: 10001; background: #fff;
  padding: 2.94118vw 3.33333vw 3.33333vw 3.33333vw; /* From original styles */
  display: none; font-family: var(--font-menu-items); /* Questrial */
  font-size: 1.7vw; /* From original body/menu style.css for text */
  line-height: 1.5em;
}
@media (min-width: 1300px) { 
    .menu { bottom: 42.66667px; left: 42.66667px; font-size: 22px; /* original input_file_2 pages.css body font */ }
}
@media (max-width: 760px) { 
    .menu { 
        padding: 5vw 7.5vw; right: 0; margin: 0; left: 0; top: 0; bottom: 0; 
        overflow-y: auto; font-size: 4vw; /* original input_file_2 pages.css body mobile */
    } 
}
.show-menu .menu { display: block; }

.menu ul { margin-left: 2.5vw; margin-top: 0.3em; }
@media (min-width: 1300px) { .menu ul { margin-left: 32px; } }
@media (max-width: 760px) { .menu ul { margin-left: 7.5vw; } }

.menu li { position: relative; display: block; float: left; clear: both; }
.menu > li + li { margin-top: 0.7em; } /* Spacing between menu sections */
@media (max-width: 760px) { 
  .menu li { font-size: 1em; /* Relative to parent .menu font-size for mobile */ line-height: 1.3em; margin: 0.1em 0; }
}

.menu-title {
  text-transform: uppercase; font-family: var(--font-menu-titles); /* PxGrotesk for menu section titles */
  font-size: 1.2vw; line-height: 2.1em; letter-spacing: 0.08em; color: #999;
}
@media (min-width: 1300px) { .menu-title { font-size: 15px; } }
@media (max-width: 760px) { .menu-title { font-size: 11px; letter-spacing: 0.15em; } }

.menu ul li:before { content: '×'; position: absolute; left: -2.5vw; top: -0.07em; pointer-events: none; color: #aaa;}
@media (min-width: 1300px) { .menu ul li:before { left: -32px; } }
@media (max-width: 760px) { .menu ul li:before { left: -7.5vw; } }
.menu ul li.info-link:before { content: '+'; }
.menu ul li a { display: inline-block; padding: 0.1em 0; color: #111; } /* Dark link text in menu */
.menu ul li:hover:before { content: '→'; top: -0.05em; color: var(--text-color); } /* Color changes with theme */
.menu ul li a:hover { color: var(--text-color); } /* Link color also changes with theme on hover */
.menu ul li.visited > a { text-decoration: line-through; color: #777;}
.menu ul li.visited > a:hover { text-decoration: none; color: var(--text-color);}
.menu ul li.current-item > a { font-weight: bold; color: var(--text-color);}


/* Page Cover (for menu open state) */
.page-cover {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  z-index: 10000; background: rgba(240, 240, 240, 0.8); display: none; 
}
.show-menu .page-cover { display: block; }

/* Nav Cover (Mainly for page loading state) */
.nav-cover {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  z-index: 100000; opacity: 0; background: rgba(255,255,255,0.8); 
  display: none; pointer-events: none; cursor: default;
}
body.loading .nav-cover { display: block !important; opacity: 1 !important; pointer-events: auto !important; cursor: wait !important; }


/* --- Homepage Backgrounds & Main Title --- */
/* Container for the optional SVG GRID Background - if scripts.js pans it */
.nav-container {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background-color: transparent; 
  overflow: hidden; 
  z-index: 0; /* Below everything except body/html */
}
.nav-container-inner { 
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  overflow: hidden; 
}
.nav { /* The actual graphical SVG grid that is panned */
  position: absolute; 
  width: 150vw; height: 103vw;  
  background-image: url("grid.svg"); /* <<< CORRECT PATH - e.g. "img/grid.svg" */
  background-position: center center; background-size: 4001px; 
  opacity: 0.1; /* SUBTLE - Increase to 1 if you want it stronger / for testing */
  /* This grid will appear on TOP of the body's linear-gradient grid IF both are active */
}

/* Homepage Main H1 Title (Uses Questrial, 180px, based on your provided working example styles) */
h1.main-site-title {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 20; /* Above .main-grid-section (10) and .nav-container (0) */
  pointer-events: none;
  font-family: var(--font-main-h1); /* Questrial */
  font-size: 180px; 
  font-weight: 700; /* Questrial's normal weight */
  line-height: 1.0; 
  text-align: left; width: 70vw; 
  color: var(--text-color); /* Inherits from body, which is changed by titles.js via body.color classes */
  transition: color 0.15s ease-out, font-size 0.2s ease-out;
}
h1.main-site-title.title-hovered { font-size: 80px; } /* For project titles */


/* Homepage Image Grid Section (panned by pan.js) */
section.main-grid-section {
  position: fixed; top: 0; left: 0;
  width: 3000px; height: 2400px; /* For pan.js */
  padding: 112px; display: grid;
  grid-template-columns: repeat(5, 1fr); grid-template-rows: repeat(3, 1fr);  
  gap: 152px;                           
  z-index: 10; /* Below H1, above .nav-container's SVG grid & body's linear-gradient grid */
  touch-action: none; 
  background-color: transparent; /* Important: shows underlying grids/backgrounds */
}
/* ... section a, img, body.hovered styles from your original dump (input_file_3) ... */
section.main-grid-section a { display: flex; align-items: center; justify-content: center; height: 100%;}
section.main-grid-section img { max-width: 100%; max-height: 600px; transition: opacity 0.25s, transform 0.25s, box-shadow 0.25s; box-shadow: 0 0 16px #00000000;}
body.hovered section.main-grid-section img { opacity: 0.1; }
body.hovered section.main-grid-section a.hovered img { opacity: 1; transform: scale(1.6); box-shadow: 0 0 16px #00000033;}


/* --- AJAX Content Container --- */
article.main-content-container { 
  position: relative; z-index: 1000; 
  background: #fff; /* White box on project-themed HTML background */
  display: none; margin-top: 0; opacity: 0; 
  min-height: 100vh; 
}
body.single article.main-content-container { display: block; }
.article-content-padded-inner { /* Wrapper for content inside main-content-container */
    padding: clamp(40px, 5vh, 64px) clamp(20px, 5vw, 80px);
    max-width: 1170px; margin: 0 auto; 
}

/* --- Utility --- */
.media-check { display:none !important; }