/**
 * ===============================
 * GLOBAL RESET + SITE STYLES (NO :root VARIABLES)
 * Header sizing matches homepage
 * ===============================
 */

* { box-sizing: border-box; }

::-moz-selection { background-color: rgba(0,0,0,0.12); color: inherit; }
::selection { background-color: rgba(0,0,0,0.12); color: inherit; }

:focus { outline: 0; }

/* ===============================
   CANVAS / WRAPPERS (kills white gutters)
   =============================== */

html,
body {
  min-height: 100vh;
  margin: 0;
  padding: 0;
  background: #fafafa;
}

html { position: relative; }

body {
  background: #fafafa;
  color: #1a1a1a;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 0.95rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Ensure CMS wrapper does not introduce a white canvas */
customhtml { background: #fafafa; }
customhtml > * { background: transparent; position: relative; z-index: 10; }

/* Backdrop plane (common white-edge culprit) */
#backdrop {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: 100%;
  z-index: 1;
  background: #fafafa;
}

/* ===============================
   MAIN CONTAINER
   =============================== */

main {
  background: #fafafa;
  position: relative;
  width: 100%;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
}

/* Some platforms inject a direct wrapper under main */
main > div {
  flex: 1 0 auto;
  width: 100%;
  background: transparent;
}

/* Content width wrapper (site standard) */
.content_width {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding-left: 2rem;
  padding-right: 2rem;
}

/* Grid attribute system: force transparency so gutters inherit body bg */
[grid-row],
[grid-col] {
  background: transparent;
}

/* ===============================
   ELEMENTS
   =============================== */

a { color: inherit; text-decoration: none; }
a:hover { opacity: 0.7; }

img {
  border: 0;
  padding: 0;
  max-width: 100%;
  height: auto;
  display: block;
}

hr {
  background: rgba(0,0,0,0.08);
  border: 0;
  height: 1px;
  display: block;
}

.clear:after {
  content: "";
  display: table;
  clear: both;
}

/* ===============================
   TYPOGRAPHY
   =============================== */

h1, h2, h3 {
  font-weight: 400;
  letter-spacing: 0.01em;
  margin: 0;
}

h1 {
  font-size: 1.8rem;
  line-height: 1.25;
  margin-bottom: 1.2rem;
}

h2 {
  font-size: 0.95rem; /* matches homepage header scale */
  line-height: 1.4;
  margin-bottom: 0.6rem;
}

h3 {
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}

p, small {
  max-width: 42rem;
  font-size: 0.95rem;
  line-height: 1.65;
}

blockquote {
  margin: 0;
  padding-left: 2rem;
}

/* ===============================
   VERTICAL RHYTHM
   =============================== */

section { margin-bottom: 6rem; }
.grid-row + .grid-row { margin-top: 4rem; }

/* ===============================
   HEADER (MATCH HOMEPAGE)
   =============================== */

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(250,250,250,0.94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(0,0,0,0.04);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem 2rem;              /* MATCH HOMEPAGE */
  display: grid;
  grid-template-columns: repeat(4, auto);
  column-gap: 3rem;                   /* MATCH HOMEPAGE */
  align-items: center;
}

.header-inner,
.header-inner * {
  background: transparent;
}

.header h2 {
  font-size: 0.95rem;                 /* MATCH HOMEPAGE */
  font-weight: 400;
  letter-spacing: 0.02em;
  margin: 0;
  line-height: 1.2;
}

/* If you include a spacer, this is the correct height */
.header-spacer {
  height: calc((1.5rem * 2) + 1.2em);
}

/* ===============================
   HERO OVERLAY BEHAVIOUR (if used)
   =============================== */

.hero {
  margin-top: -4rem;
  position: relative;
  z-index: 1;
}

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

.hero-text h1 {
  text-shadow: 0px 2px 6px rgba(0,0,0,0.25);
}

/* ===============================
   IMAGE INTERACTION (if used)
   =============================== */

.project-thumb {
  position: relative;
  display: inline-block;
  overflow: hidden;
}

.project-thumb img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.4s ease;
}

.project-thumb .overlay {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.72);
  color: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  opacity: 0;
  transition: opacity 0.35s ease;
  text-align: center;
  backdrop-filter: blur(3px);
}

.project-thumb:hover img { transform: scale(1.05); }
.project-thumb:hover .overlay { opacity: 1; }

/* ===============================
   FOOTER
   =============================== */

.footer {
  font-size: 0.85rem;
  color: #555;
}

/* ===============================
   SUBPAGE OVERLAY
   =============================== */

.subpage_overlay {
  display: block;
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 1;
}

body.homepage .subpage_overlay { display: none; }

/* ===============================
   MOBILE REFINEMENT
   =============================== */

@media (max-width: 800px) {

  body { font-size: 0.9rem; }

  h1 { font-size: 1.4rem; }

  section { margin-bottom: 4rem; }

  /* Mobile spacing */
  .content_width {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  /* Header stacks into 2 columns like homepage */
  .header-inner {
    grid-template-columns: repeat(2, auto);
    row-gap: 0.75rem;
    padding: 1.25rem 1.25rem;
    column-gap: 1.5rem;
  }

  .hero { margin-top: -3rem; }
}
