:root{
  --bg:#fff;
  --text:#0b0b0b;
  --muted:rgba(0,0,0,0.55);
  --faint:rgba(0,0,0,0.08);
  --accent:#00ff5a;
  
}

:root{
  --text-xs: 11px;
  --text-sm: 13px;
  --text-md: 15px;
  --text-lg: 18px;
  --text-xl: 28px;
  --text-2xl: 38px;
}

/* =========================
   BASE
========================= */

html, body{
  height: 100%;
  margin: 0;
  overflow-x: hidden;
}

body{
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  color: #3b3b3b;
}

/* =========================
   NAVBAR (FIXED)
========================= */

.navbar{
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10000;

  background: rgba(255,255,255,0.92) !important;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--faint);

  padding: 22px 20px;
}

/* =========================
   MODE BASE
========================= */

.mode{
  padding: 0 20px;
  padding-top: 90px;
  height: 100vh;
  box-sizing: border-box;
}

/* scroll vs immersive */
#workMode,
#blackboardMode{
  overflow: hidden;
}

#listMode,
#aboutMode{
  overflow-y: auto;
}

/* =========================
   BUTTONS
========================= */

button{
  font-size: 11px;
  padding: 14px 18px;
  border-radius: 999px;
  border: 1px solid var(--text);
  background: transparent;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: 0.15s ease;
}

button:hover{
  color: var(--accent);
  border-color: var(--accent);
}

.nav-btn.active{
  color: var(--accent);
  border-color: var(--accent);
  text-decoration-color: #0b0b0b;
  color:var(--text);
  background-color: #00ff591c;
}

/* =========================
   WORK MODE
========================= */

#workMode{
  position: fixed;
  inset: 0;
}

#archiveCanvas{
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.project-emoji{
  position: absolute;
  font-size: 6rem;
  transform: translate(-50%, -50%);
  cursor: pointer;
}

/* =========================
   LIST MODE (FIXED + CLEAN)
========================= */

#listMode{
  position: relative;
  height: 100vh;
  overflow: hidden;
}

/* FILTER BAR */
#filterBar{
  position: fixed;
  top: 70px;
  left: 0;
  right: 0;
  z-index: 999;

  display: flex;
  flex-wrap: wrap;
  gap: 12px;

  padding: 14px 16px;

  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--faint);
}

/* PROJECT LIST */
#projectList{
  position: absolute;
  top: 130px;
  left: 0;
  right: 0;
  bottom: 0;

  overflow-y: auto;
  padding: 20px;
}

/* LIST ITEMS */
.list-item{
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 18px;
  align-items: center;

  padding: 28px 0;
  border-bottom: 1px solid var(--faint);
}

.list-title-text{
  font-size: 32px;
  line-height: 1.1;
}

.list-title-hover:hover .list-title-text{
  color: var(--accent);
}

.list-meta{
  font-size: 11px;
  color: var(--muted);
}

/* FILTER BUTTONS */
.filter-btn{
  font-size: 11px;
  padding: 14px 16px;
  border-radius: 999px;
  border: 1px solid var(--text);
  background: transparent;
  cursor: pointer;
}

.filter-btn:hover,
.filter-btn.active{
  border-color: var(--accent);
  background: rgba(0,255,90,0.08);
}

.filter-btn.active{
  color: var(--text);
}

/* =========================
   BASE MODAL
========================= */

.project-modal{
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(10px);
  z-index: 9999;

  opacity: 0;
  pointer-events: none;

  display: flex;
  justify-content: center;
  align-items: flex-start;

  overflow-y: auto;
  padding: 60px 0;
    padding: 80px 0 60px;

}

/* ACTIVE (FULL SCREEN MODE) */
.project-modal.active{
  opacity: 1;
  pointer-events: auto;
  overflow-y: auto; /* ONLY scroll when open */
}

.project-modal-inner{
  width: min(1100px, 92vw);
  background: white;
  border: 1px solid var(--faint);
  padding: 28px;
   margin-top: 20px;


  margin: 0 auto;
  max-height: 85vh;
  overflow-y: auto;
}

/* =========================
   HOVER PREVIEW MODE
========================= */

.project-modal.preview{
  opacity: 1;
  pointer-events: none;
  background: transparent;
  backdrop-filter: none;
}

.project-modal.preview .project-modal-inner{
  width: 280px;
  padding: 12px;
  font-size: 12px;

  position: fixed;
  top: 120px;
  right: 40px;

  border: 1px solid var(--faint);
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

/* =========================
   BLACKBOARD
========================= */

#blackboardMode{
  height: 100vh;
}

#board{
  width: 100%;
  height: 100vh;
  display: block;
  background: #fff;
}

.blackboard-subnav{
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;

  display: flex;
  justify-content: space-between;
  align-items: center;

  padding: 22px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;

  border-top: 1px solid var(--faint);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  z-index: 9999;
}

.blackboard-actions{
  display: flex;
  gap: 14px;
}

/* =========================
   ABOUT
========================= */

.about-wrap{
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 80px;
  padding: 80px 0 120px;
}

.about-left{
  position: sticky;
  top: 140px;
}

.about-right{
  max-width: 75ch;
}

.about-right h1{
  font-size: 42px;
  font-weight: 400;
  margin-bottom: 60px;
}

.about-right p{
  font-size: 16px;
  line-height: 1.9;
  color: rgba(0,0,0,0.85);
}

.about-meta{
  margin-top: 100px;
}

.about-section{
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 32px;
  padding: 28px 0;
  border-top: 1px solid var(--faint);
}

.about-label{
  font-size: 11px;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.about-site{
  margin-top: 80px;
}

.about-contact{
  margin-top: 120px;
}

/* CONTACT */
.contact-form{
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 420px;
}

.contact-form input,
.contact-form textarea{
  font: inherit;
  padding: 14px;
  border: 1px solid var(--faint);
  background: transparent;
  outline: none;
}

.contact-form textarea{
  min-height: 120px;
}

/* =========================
   RESPONSIVE FIX (IMPORTANT)
========================= */

@media (max-width: 768px){

  .navbar{
    padding: 12px 14px;
  }

  .nav-btn{
    padding: 10px 12px;
    font-size: 10px;
  }

  .mode{
    padding: 0 14px;
    padding-top: 80px;
  }

  #filterBar{
    top: 52px;
    padding: 10px 12px;
    gap: 8px;
  }

  #projectList{
    top: 110px;
    padding: 14px;
  }

  .list-title-text{
    font-size: 22px;
  }

  .about-wrap{
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .about-right h1{
    font-size: 32px;
  }

  .about-section{
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

/* =========================================================
   FINAL MOBILE SPACING FIX PATCH (APPEND ONLY)
   fixes: list cutoff, nav vs filter scaling, about spacing
========================================================= */

/* ---------- 1. NAV shrinks more aggressively on mobile ---------- */
@media (max-width: 768px) {

  .navbar {
    padding: 15px 15px !important;
  }

  .nav-btn {
    /*padding: 8px 10px !important;*/
    font-size: 9px !important;
    letter-spacing: 0.05em !important;
  }

  .navbar .d-flex {
    gap: 6px !important;
    flex-wrap: wrap;
  }
}

/* ---------- 2. FILTER BAR is ALWAYS smaller than nav ---------- */
@media (max-width: 768px) {

  #filterBar {
    top: 64px !important; /* sits tighter under nav */
    padding: 8px 10px !important;
    gap: 6px !important;
  }

  .filter-btn {
    padding: 6px 10px !important;
    font-size: 9px !important;
    letter-spacing: 0.04em;
  }
}

/* ---------- 3. FIX FIRST LIST ITEM CUT OFF ---------- */
@media (max-width: 768px) {

  #projectList {
    top: 120px !important; /* pulls list DOWN below filter */
    padding-top: 16px !important;
  }

  .list-item:first-child {
    padding-top: 40px !important; /* extra breathing room */
  }
}

/* ---------- 4. ABOUT PAGE IMAGE SPACING FIX ---------- */
@media (max-width: 768px) {

  .about-wrap {
    gap: 28px !important;
  }

  .about-left {
    margin-bottom: 18px;
  }

  .about-image-placeholder,
  .about-image-placeholder.small {
    width: 100% !important;
    max-width: 100% !important;
    aspect-ratio: 4 / 3;
  }

  .about-right {
    padding-top: 10px;
  }
}

/* ---------- 5. ENSURE SCROLL WORKS CLEANLY ON MOBILE ---------- */
@media (max-width: 768px) {

  #listMode,
  #aboutMode {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }

}

/* =========================================================
   ABOUT IMAGE RESPONSIVE FLOW FIX (FINAL PATCH)
========================================================= */

/* desktop stays 2-column */
.about-left{
  display: flex;
  flex-direction: column;
}

/* image base behavior */
.about-image{
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--faint);
}

/* ensures it behaves like part of layout */
.about-left,
.about-right{
  min-width: 0;
}

/* =========================
   MOBILE: merge into single flow
   image becomes part of content stack
========================= */
@media (max-width: 768px){

  .about-wrap{
    display: block; /* overrides grid stacking issues */
  }

  .about-left{
    position: relative;
    top: auto;
    margin-bottom: 24px;
  }

  .about-image{
    width: 100%;
    max-width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
  }

  /* ensure spacing feels like ONE container */
  .about-right{
    padding-top: 0;
  }

  .about-site,
  .about-contact{
    margin-top: 60px;
  }
}

/* =========================================================
   ORGANIC FILM / BURN FRAME EFFECT
========================================================= */

.about-image-frame{
  position: relative;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--faint);
}

/* main image */
.about-image{
  width: 100%;
  height: auto;
  display: block;
  filter: contrast(1.05) saturate(1.05);
}

/* organic “film burn” overlay */
.about-image-frame::before{
  content: "";
  position: absolute;
  inset: -20%;
  pointer-events: none;
  z-index: 2;

  background:
    radial-gradient(circle at 10% 20%, rgba(0,0,0,0.25), transparent 40%),
    radial-gradient(circle at 80% 10%, rgba(0,0,0,0.18), transparent 45%),
    radial-gradient(circle at 30% 90%, rgba(0,0,0,0.22), transparent 50%),
    radial-gradient(circle at 90% 80%, rgba(0,0,0,0.15), transparent 55%);

  mix-blend-mode: multiply;
  opacity: 0.6;
}

/* subtle film grain texture */
.about-image-frame::after{
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;

  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='.25'/%3E%3C/svg%3E");

  opacity: 0.08;
  mix-blend-mode: overlay;
}

/* keep it responsive clean */
@media (max-width: 768px){
  .about-image-frame{
    border: 1px solid var(--faint);
  }
}

/* =========================================================
   FIX: IMAGE TOO TALL ON MOBILE
========================================================= */

.about-image-frame{
  aspect-ratio: 4 / 3;
  max-height: 520px;
}

/* force image to obey container height */
.about-image{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* mobile correction */
@media (max-width: 768px){

  .about-image-frame{
    aspect-ratio: 4 / 3;
    max-height: 320px; /* prevents giant vertical image */
  }

  .about-image{
    height: 100%;
    width: 100%;
    object-fit: cover;
  }
}

/* =========================================================
   ABOUT — FULL WIDTH SYSTEM (REDUCE WHITE SPACE)
========================================================= */

.about-wrap{
  display:grid;
  grid-template-columns: 360px 1fr;
  gap: 80px;
  padding: 100px 40px;
  max-width: 1400px;
  margin: 0 auto;
}

/* IMAGE CONTROL */
.about-image-frame{
  position: sticky;
  top: 120px;
  align-self: start;
}

.about-image{
  width: 100%;
  height: auto;
  max-height: 70vh;
  object-fit: cover;
  border-radius: 2px;
  display: block;
}

/* MOBILE FIX */
@media (max-width: 768px){
  .about-wrap{
    grid-template-columns: 1fr;
    padding: 40px 20px;
    gap: 30px;
  }

  .about-image-frame{
    position: relative;
    top: auto;
  }

  .about-image{
    max-height: 420px;
    width: 100%;
  }
}

/* =========================
   MODAL TYPOGRAPHY SYSTEM
========================= */

.modal-title-wrap{
  margin-bottom: 20px;
}

.modal-title{
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.modal-sub{
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

/* =========================
   CASE STUDY LAYOUT
========================= */

.case-study{
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* text blocks */
.cs-block.text{
  max-width: 70ch;
}

.cs-block.text p{
  font-size: 14px;
  line-height: 1.8;
  color: rgba(0,0,0,0.85);
}

.cs-block.text h3{
  font-size: 16px;
  margin-bottom: 10px;
  font-weight: 500;
}

/* images */
.cs-block.image img{
  width: 100%;
  display: block;
}

/* end emphasis */
.cs-block.end p{
  opacity: 0.6;
  font-style: italic;
}

.project-modal.d-none {
  display: none !important;
  pointer-events: none;
}

/* =========================================================
   TYPOGRAPHY SYSTEM — CARD0 / NICONNE / FIRA CODE
========================================================= */

:root{
  --font-body: system-ui, -apple-system, Arial, sans-serif;
  --font-serif: "Cardo", serif;
  --font-script: "Niconne", cursive;
  --font-mono: "Fira Code", monospace;
}

/* BODY */
body{
  font-family: var(--font-body);
  letter-spacing: -0.01em;
}

/* =========================
   HEADERS (EDITORIAL SERIF)
========================= */

h1, h2, h3, h4, h5,
.about-right h1,
.modal-title,
.list-title-text{
  font-family: var(--font-serif);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

/* BIG HERO / ABOUT TITLE */
.about-right h1{
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

/* =========================
   ACCENT / FUNKY SCRIPT (USE SPARINGLY)
========================= */

.funky,
.brand-script,
.nav-brand{
  font-family: var(--font-script);
  font-weight: 400;
  letter-spacing: 0;
}

/* =========================
   UI / LABEL SYSTEM (MONO)
========================= */

button,
.filter-btn,
.list-meta,
.blackboard-subnav{
  font-family: var(--font-mono);
  font-weight: 400;
  letter-spacing: 0.08em;
}

/* =========================
   MODAL TYPOGRAPHY TIGHTENING
========================= */

.modal-title{
  font-size: 30px;
  letter-spacing: -0.02em;
}

.modal-sub{
  font-family: var(--font-mono);
}

/* =========================
   LIST TITLES ENHANCEMENT
========================= */

.list-title-text{
  font-size: 34px;
  line-height: 1.05;
}

/* hover feel (subtle editorial shift) */
.list-title-hover:hover .list-title-text{
  letter-spacing: -0.03em;
}

/* =========================================================
   CLEAN TECH TYPOGRAPHY LAYER (NO SERIF)
   system + mono only
========================================================= */

:root{
  --font-body: system-ui, -apple-system, Arial, sans-serif;
  --font-mono: "Fira Code", monospace;
}

/* =========================
   GLOBAL BASE
========================= */

body{
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  color: #0b0b0b;
}

/* =========================
   NAV = SYSTEM INTERFACE
========================= */

.navbar{
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding-top: 1%;
  padding-bottom: 1%;
}

.nav-identity{
  font-family: var(--font-body);
  font-size: 13px;
  letter-spacing: -0.01em;
  text-transform: none;
  opacity: 0.7;
}

/* =========================
   BUTTON SYSTEM = UI LANGUAGE
========================= */

button,
.filter-btn,
.tool-btn{
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* =========================
   HEADINGS (NO SERIF — PURE SYSTEM)
========================= */

h1, h2, h3, h4, h5,
.modal-title,
.list-title-text,
.about-right h1{
  font-family: var(--font-body);
  font-weight: 500;
  letter-spacing: -0.02em;
}

/* LIST TITLES = STRONG SYSTEM HIERARCHY */
.list-title-text{
  font-size: 34px;
  line-height: 1.05;
}

/* =========================
   META TEXT = TECH LAYER
========================= */

.list-meta,
.about-label,
.blackboard-subnav,
.modal-sub{
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(0,0,0,0.55);
}

/* =========================
   ABOUT BODY TEXT
========================= */

.about-right p{
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.8;
  color: rgba(0,0,0,0.85);
}

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

.modal-title{
  font-size: 28px;
  letter-spacing: -0.02em;
}

.modal-sub{
  font-size: 10px;
}

/* =========================
   BLACKBOARD UI (TECH INTERFACE FEEL)
========================= */

.blackboard-actions button,
.blackboard-subnav{
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* TOOL SWITCHER */
.tool-btn{
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
}

.tool-btn.active{
  border-color: #00ff5a;
  color: #00ff5a;
}

/* =========================
   REMOVE ANY LEFTOVER SERIF OVERRIDES
========================= */

.about-right h1,
.modal-title,
.list-title-text{
  font-family: var(--font-body) !important;
}


.list-item > div:first-child {
  font-size: 34px;
  line-height: 1;
}

.modal-close{
  top: 0;
  float: right;
  z-index: 1000;
  margin-bottom: 20px;
  height: 5%;
}

.modal-close:hover{
  color: var(--accent);
  border-color: var(--accent);
}


/* =========================
   Modal — Additive Spacing
   (append only)
========================= */

/* Overall modal breathing room */
.modal {
  padding: 48px;
}

/* Consistent vertical rhythm for all modal children */
.modal > * + * {
  margin-top: 28px;
}

/* Content stack spacing (for wrappers like .content) */
.modal .content {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* Text blocks */
.modal .text {
  line-height: 1.55;
  max-width: 65ch;
  margin: 0;
}

/* Story blocks (heading + body grouping) */
.modal .story {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.modal .story h4 {
  margin: 0;
  font-weight: 500;
  opacity: 0.7;
}

.project-modal-inner img {
  max-width: 100%;
  align-content: center;
  border-radius: 6px;
  border-color: #ffffff00;
  padding: 2%;
}

/* Optional: slightly better visual separation on scroll-heavy modals */
.modal {
  scroll-padding: 48px;
}


/* =========================
   Background Watermark
========================= */

body::after {
  content: "www.ralphp.info";
  position: fixed;
  inset: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 140px;
  font-weight: 400;
  letter-spacing: 2px;

  color: rgba(0, 0, 0, 0.02);
  pointer-events: none;
  z-index: -2;

  white-space: nowrap;
  transform: rotate(-20deg);
}

/* optional subtle variation for smaller screens */
@media (max-width: 768px) {
  body::after {
    font-size: 72px;
    transform: rotate(-15deg);
  }
}

.modal-tags {
  flex-wrap: wrap;
  margin-top: 1%;
  margin-bottom: 1%;
  color: #3f3f3f;
}

.nav-btn.tag {
  font-family: inherit;
  padding: 0%;
}

/* base tag style (inherits nav feel) */
.modal-tags {
  font-size: 14px;
  opacity: 0.75;
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none; /* keeps them purely informational */
}

#formStatus {
  margin-top: 8px;
  font-size: 12px;
  opacity: 0.7;
}

input,
textarea,
.contact-form input,
.contact-form textarea{
  text-transform: none !important;
  white-space: pre-wrap !important;
  letter-spacing: normal !important;
  word-spacing: normal !important;
}

.contact-form{
  text-transform: none !important;
}
#board {
  touch-action: none;
  -webkit-touch-callout: none;
  user-select: none;
}