/* ===========================================================
   Paul Celli — Painting Work
   Design tokens
   =========================================================== */
:root{
  --accent: #E7480F;
  --accent-dim: #c53d0c;
  --ink: #1b1b19;
  --ink-soft: #3a3733;
  --paper: #ffffff;
  --paper-dim: #faf9f7;
  --hairline: rgba(27,27,25,0.12);

  --font-display: 'Jost', 'Century Gothic', sans-serif;
  --font-body: 'Source Serif 4', Georgia, serif;
  --font-menu: 'Albert Sans', 'Century Gothic', sans-serif;

  --sidebar-w: 34%;
  --sidebar-w-min: 340px;
  --sidebar-w-max: 480px;

  --ease: cubic-bezier(.22,.61,.36,1);
}

*{ box-sizing: border-box; }
html,body{ margin:0; padding:0; }

body{
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a{ color: inherit; text-decoration: none; }
h1,h2,h3{ font-family: var(--font-display); font-weight: 400; margin: 0; }

::selection{ background: var(--accent); color: #fff; }

/* ===========================================================
   Layout shell
   =========================================================== */
.app{
  display: grid;
  grid-template-columns: clamp(var(--sidebar-w-min), var(--sidebar-w), var(--sidebar-w-max)) 1fr;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar{
  background: var(--paper);
  border-right: 1px solid var(--hairline);
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
}
.sidebar-inner{
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 6vh 4vw;
  gap: 9vh;
}

.brand{
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: absolute;
  top: 5vh;
  left: 4vw;
}
.brand-name{
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
}
.brand-sub{
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  opacity: 0.6;
}

.nav{
  display: flex;
  flex-direction: column;
  gap: 2.6rem;
}
.nav-link{
  font-family: var(--font-menu);
  font-weight: 500;
  font-size: clamp(24px, 2.6vw, 32px);
  color: var(--ink);
  letter-spacing: 0.01em;
  transition: color .25s var(--ease), letter-spacing .25s var(--ease);
  width: fit-content;
  position: relative;
}
.nav-link::after{
  content: "";
  position: absolute;
  left: 0; bottom: -6px;
  width: 0%;
  height: 1px;
  background: var(--accent);
  transition: width .3s var(--ease);
}
.nav-link:hover{ color: var(--accent-dim); }
.nav-link:hover::after{ width: 100%; }
.nav-link.active{
  color: var(--accent);
  letter-spacing: 0.02em;
}
.nav-link.active::after{ width: 100%; }

.menu-toggle{ display: none; }

/* ---------- Stage (right side) ---------- */
.stage{
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}
.stage-bg{
  position: fixed;
  top: 0;
  left: clamp(var(--sidebar-w-min), var(--sidebar-w), var(--sidebar-w-max));
  right: 0;
  bottom: 0;
  background-image: url('images/collage-bg.jpg');
  background-size: cover;
  background-position: center;
  filter: saturate(0.9);
  z-index: 0;
}
.stage-wash{
  position: fixed;
  top: 0;
  left: clamp(var(--sidebar-w-min), var(--sidebar-w), var(--sidebar-w-max));
  right: 0;
  bottom: 0;
  background: rgba(255,255,255,0.31);
  z-index: 1;
  pointer-events: none;
  transition: background .4s var(--ease);
}
body.route-text .stage-wash{ background: rgba(255,255,255,0.68); }
body.route-home .stage-wash{ background: rgba(255,255,255,0.02); }
body.route-gallery .stage-wash{ background: rgba(255,255,255,0.46); }

.stage-content{
  position: relative;
  z-index: 2;
  min-height: 100vh;
}

/* ===========================================================
   Panels
   =========================================================== */
.panel{
  display: none;
  min-height: 100vh;
  padding: 9vh 6vw 8vh;
  animation: rise .5s var(--ease);
}
.panel.is-active{ display: block; }

@keyframes rise{
  from{ opacity: 0; transform: translateY(14px); }
  to{ opacity: 1; transform: translateY(0); }
}

/* ---- Home ---- */
.panel[data-panel="/"]{ padding: 0 6vw; position: relative; }
.panel[data-panel="/"].is-active{ display: block; }

.home-mark{
  position: absolute;
  left: 6vw;
  right: 6vw;
  top: 49%;
  transform: translateY(calc(-50% + 8px));
  text-align: center;
}
.home-line{
  display: flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 0.5em;
  white-space: nowrap;
}
.home-name, .home-tagline{
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(22px, 3.4vw, 58px);
  line-height: 1;
  color: var(--ink);
  letter-spacing: 0.01em;
  margin: 0;
}

/* ---- Panel head ---- */
.panel-head{ max-width: 720px; margin-bottom: 3rem; }
.panel-head h2{
  font-size: clamp(32px, 3.6vw, 46px);
  font-weight: 300;
  color: var(--ink);
  margin-bottom: 0.6em;
}
.panel-intro{
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink-soft);
  max-width: 56ch;
}

/* ---- Text panels ---- */
.text-columns{
  display: grid;
  grid-template-columns: minmax(0,2.1fr) minmax(220px, 1fr);
  gap: 4vw;
  align-items: start;
}
.text-main p{
  font-family: var(--font-menu);
  font-weight: 500;
  font-size: 18px;
  line-height: 1.7;
  letter-spacing: 0.003em;
  color: var(--ink);
  margin: 0 0 1.3em;
  max-width: 62ch;
}
.text-main--wide{ max-width: 720px; }
.text-main--wide p{
  font-family: var(--font-menu);
  font-weight: 500;
  font-size: 18px;
  line-height: 1.7;
  letter-spacing: 0.003em;
}
.text-main .lede{
  font-size: 28px;
  line-height: 1.45;
  font-style: normal;
  color: var(--ink);
  max-width: 640px;
}
.attribution{
  font-style: italic;
  font-size: 15px !important;
  color: var(--ink-soft);
  margin-top: 2em !important;
  padding-top: 1.2em;
  border-top: 1px solid var(--hairline);
}
.attribution .not-italic{ font-style: normal; }

.text-aside{
  position: sticky;
  top: 8vh;
  background: rgba(255,255,255,0.6);
  border: 1px solid var(--hairline);
  padding: 1.6rem 1.7rem;
}
.text-aside h3{
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 1.1em;
}
.fact-list{
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1em;
}
.fact-list li{
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink-soft);
}
.fact-label{
  display: block;
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink);
  margin-bottom: 0.2em;
}

/* ---- Galleries ---- */
.gallery{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.6rem;
  max-width: 1100px;
}
.tile{
  background: var(--paper);
  border: 1px solid var(--hairline);
  cursor: pointer;
  overflow: hidden;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.tile:hover{
  transform: translateY(-4px);
  box-shadow: 0 14px 30px rgba(0,0,0,0.12);
}
.tile img{
  display: block;
  width: 100%;
  height: 260px;
  object-fit: contain;
  background: #f2efe9;
}
.tile-cap{
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.7rem 0.9rem 0.9rem;
  font-family: var(--font-display);
}
.tile-cap .t-title{ font-size: 13.5px; color: var(--ink); }
.tile-cap .t-meta{ font-size: 11.5px; color: var(--ink-soft); opacity: 0.7; }

/* ---- Contact form ---- */
.contact-form{
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 1.3rem;
}
.field{ display: flex; flex-direction: column; gap: 0.5em; }
.field label{
  font-family: var(--font-display);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.field input, .field textarea{
  font-family: var(--font-body);
  font-size: 16px;
  padding: 0.75em 0.85em;
  border: 1px solid var(--hairline);
  background: rgba(255,255,255,0.7);
  color: var(--ink);
  resize: vertical;
}
.field input:focus, .field textarea:focus{
  outline: none;
  border-color: var(--accent);
}
.submit-btn{
  align-self: flex-start;
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  background: var(--accent);
  border: none;
  padding: 0.9em 1.8em;
  cursor: pointer;
  transition: background .25s var(--ease);
}
.submit-btn:hover{ background: var(--accent-dim); }
.form-note{
  font-size: 13px;
  color: var(--ink-soft);
  opacity: 0.75;
  max-width: 46ch;
}

/* ===========================================================
   Lightbox
   =========================================================== */
.lightbox{
  position: fixed;
  inset: 0;
  background: rgba(20,18,16,0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 6vh 6vw;
}
.lightbox.is-open{ display: flex; }
.lightbox img{
  max-width: 100%;
  max-height: 88vh;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.lightbox-close{
  position: absolute;
  top: 4vh; right: 4vw;
  background: none;
  border: none;
  color: #fff;
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
  font-family: var(--font-display);
}

/* ===========================================================
   Focus visibility
   =========================================================== */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible{
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ===========================================================
   Responsive
   =========================================================== */
@media (max-width: 900px){
  .text-columns{ grid-template-columns: 1fr; }
  .text-aside{ position: static; }
}

@media (max-width: 720px){
  .app{ grid-template-columns: 1fr; }
  .sidebar{
    position: sticky;
    top: 0;
    height: auto;
    z-index: 50;
  }
  .sidebar-inner{
    height: auto;
    padding: 3.4rem 6vw 1.6rem;
    justify-content: flex-start;
    gap: 0;
  }
  .brand{ position: static; margin-bottom: 1.6rem; }
  .nav{
    display: none;
    flex-direction: column;
    gap: 1.2rem;
    padding-top: 1.2rem;
  }
  .nav.is-open{ display: flex; }
  .nav-link{ font-size: 22px; }

  .menu-toggle{
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    position: absolute;
    top: 3.2rem;
    right: 6vw;
    width: 26px;
    height: 20px;
    background: none;
    border: none;
    cursor: pointer;
  }
  .menu-toggle span{
    display: block;
    height: 1.5px;
    background: var(--ink);
    transition: transform .25s var(--ease), opacity .25s var(--ease);
  }
  .menu-toggle[aria-expanded="true"] span:nth-child(1){ transform: translateY(6.5px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] span:nth-child(2){ opacity: 0; }
  .menu-toggle[aria-expanded="true"] span:nth-child(3){ transform: translateY(-6.5px) rotate(-45deg); }

  .stage-bg, .stage-wash{ left: 0; }
  .panel{ padding: 6vh 6vw 6vh; }
  .home-mark{ text-align: center; left: 6vw; right: 6vw; }
  .home-line{ flex-direction: column; align-items: center; white-space: normal; gap: 0.15em; }
  .home-name, .home-tagline{ font-size: clamp(30px, 9vw, 46px); }
  .panel[data-panel="/"]{ padding: 10vh 6vw; min-height: 60vh; }
}
