/* ============ DESIGN TOKENS ============ */
:root{
  /* Palette 1 — "Gallery Mist" (light, calm, gallery-wall) */
  --bg:#F4F1EC;
  --bg-alt:#EBE6DF;
  --surface:#FFFFFF;
  --ink:#1F1D1A;
  --muted:#6B6257;
  --line:#D8D0C5;
  --accent:#46573B;          /* deep olive */
  --accent-soft:#E4E9DE;
  --accent-ink:#FFFFFF;
  --thumb-bg:#D9D2C6;
  --serif:"Fraunces",Georgia,"Times New Roman",serif;
  --sans:"Inter",system-ui,-apple-system,"Segoe UI",sans-serif;
}
[data-palette="2"]{ /* "Studio Charcoal" (dark, dramatic, gallery) */
  --bg:#191713;
  --bg-alt:#211E19;
  --surface:#241F1A;
  --ink:#F0EBE3;
  --muted:#B4A99A;
  --line:#3A342B;
  --accent:#C99B5B;          /* antique bronze */
  --accent-soft:#2C2620;
  --accent-ink:#191713;
  --thumb-bg:#3A342B;
}
[data-palette="3"]{ /* "Coastal Mist" (airy blue-grey) */
  --bg:#EFF1F2;
  --bg-alt:#E2E6E8;
  --surface:#FBFCFC;
  --ink:#25303A;
  --muted:#5C6A75;
  --line:#CBD4D9;
  --accent:#2E5E6E;          /* slate sea */
  --accent-soft:#DDE8EC;
  --accent-ink:#FFFFFF;
  --thumb-bg:#C6D0D5;
}
[data-palette="4"]{ /* "Warm Paper" (earthy, gallery-white alternative) */
  --bg:#F7F5F0;
  --bg-alt:#EFEBE2;
  --surface:#FFFFFF;
  --ink:#2B2621;
  --muted:#7A6F60;
  --line:#DDD5C8;
  --accent:#8C6A4A;          /* terra */
  --accent-soft:#EFE4D6;
  --accent-ink:#FFFFFF;
  --thumb-bg:#D8CEBE;
}

/* ============ BASE — fixed full-viewport, no scroll ============ */
*{box-sizing:border-box;margin:0;padding:0}
html{height:100%}
body{
  font-family:var(--sans);
  background:var(--bg);
  color:var(--ink);
  line-height:1.5;
  transition:background .35s ease,color .35s ease;
  display:flex;flex-direction:column;
  height:100vh;overflow:hidden;
}
::selection{background:var(--accent);color:var(--accent-ink)}
a{color:inherit}

/* ============ NAV (in flow, flex item) ============ */
header.site-nav{
  flex:0 0 auto;
  background:color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom:1px solid var(--line);
  z-index:50;
}
.nav-inner{
  max-width:1180px;margin:0 auto;padding:.55rem 1.5rem;
  display:flex;align-items:center;justify-content:space-between;gap:1rem;
  text-align:left;  /* never inherit centering (home page centers its body text) */
}
.brand{font-family:var(--serif);font-size:1.22rem;font-weight:500;letter-spacing:.02em;text-decoration:none;color:var(--ink);line-height:1.1;text-align:left}
.brand small{display:block;font-family:var(--sans);font-size:.56rem;letter-spacing:.24em;text-transform:uppercase;color:var(--muted);font-weight:500;margin-top:.04rem;text-align:left}
.site-nav ul{display:flex;gap:1.35rem;list-style:none;align-items:center}
.site-nav a:not(.brand){
  color:var(--ink);text-decoration:none;font-size:.88rem;
  letter-spacing:.04em;position:relative;padding:.22rem 0;white-space:nowrap;
}
.site-nav a:not(.brand)::after{
  content:"";position:absolute;left:0;bottom:0;height:1px;width:0;
  background:var(--accent);transition:width .25s ease;
}
.site-nav a:not(.brand):hover::after{width:100%}
.site-nav a:not(.brand)[aria-current]{color:var(--accent)}
.site-nav a[aria-current]::after{width:100%}

/* ============ MAIN — flex fills the screen ============ */
main{flex:1 1 auto;min-height:0;display:flex;flex-direction:column}
.page-head{
  flex:0 0 auto;text-align:center;padding:.7rem 1.5rem .4rem;
}
.page-head .eyebrow{
  font-size:.68rem;letter-spacing:.3em;text-transform:uppercase;color:var(--accent);
  margin-bottom:.22rem;font-weight:500;
}
.page-head h1{
  font-family:var(--serif);font-weight:400;font-size:clamp(1.45rem,3.5vw,2.3rem);
  line-height:1.08;letter-spacing:-.01em;
}
.page-head p{max-width:640px;margin:.3rem auto 0;color:var(--muted);font-size:.9rem}

/* Section container that fills remaining height */
section.work{flex:1 1 auto;min-height:0;padding:.1rem 1.5rem .2rem;display:flex}
.section-inner{max-width:1240px;margin:0 auto;width:100%;display:flex;flex-direction:column}
/* Narrow the work grid so tiles sit smaller on desktop monitors
   (up to 1920x1200; larger reports fall back to the full-width grid below). */
/* Full-width grid spanning the same horizontal range as the top nav
   (from the brand to the "Contact" link). */
section.work .section-inner{max-width:1132px}

/* ============ WORK GRID — consistent thumbnail windows, no scroll ============ */
/* Default (up to ~1920x1200): a tidy 4-across grid with smaller tiles. */
.grid{
  display:grid;gap:1.2rem 1.8rem;align-content:start;align-items:start;
  grid-template-columns:repeat(4,minmax(0,1fr));
  grid-auto-rows:auto;
  flex:1 1 auto;min-height:0;
}
.item{
  cursor:pointer;border:none;background:none;text-align:left;color:inherit;
  font-family:inherit;display:flex;flex-direction:column;width:100%;padding:0;
}
.thumb{
  aspect-ratio:3/2;width:100%;
  background:var(--thumb-bg);
  border:1px solid var(--line);border-radius:3px;
  display:flex;align-items:center;justify-content:center;
  overflow:hidden;position:relative;
}
/* hover: frame outline stays locked; only the artwork inside enlarges
   (the box is overflow:hidden, so the border never moves) */
.item:hover .thumb{box-shadow:0 12px 28px rgba(0,0,0,.16)}
.thumb img{width:100%;height:100%;object-fit:contain;display:block;transition:transform .4s ease}
.item:hover .thumb img{transform:scale(1.03)}
.thumb svg{width:44%;height:auto;opacity:.85}
.item .cap{flex:0 0 auto;padding-top:.28rem;text-align:center}
.item .t{font-family:var(--serif);font-size:.88rem;line-height:1.2}
.item .m{font-size:.68rem;color:var(--muted);letter-spacing:.02em;margin-top:.04rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.item .pr{font-size:.72rem;color:var(--accent);margin-top:.08rem}
.item .pr.line{color:var(--muted);font-size:.66rem}

/* ============ PAGINATION ============ */
.pager{
  flex:0 0 auto;display:flex;align-items:center;justify-content:center;gap:1.2rem;
  padding:.6rem 0 1.9rem;margin-top:auto;
}
.pager button.arrow{
  background:var(--accent);color:var(--accent-ink);border:none;width:42px;height:42px;
  border-radius:50%;font-size:1.2rem;cursor:pointer;display:flex;align-items:center;justify-content:center;
  line-height:1;transition:filter .2s ease;
}
.pager button.arrow:hover{filter:brightness(1.1)}
.pager button.arrow:disabled{opacity:.35;cursor:default;filter:none}
.pager .count{font-size:.85rem;color:var(--muted);letter-spacing:.12em}
.pager .count b{color:var(--ink);font-weight:500}

/* ============ LIGHTBOX — large viewer fitted between the top & bottom bars ============ */
.lightbox{
  position:fixed;left:0;right:0;z-index:100;display:none;flex-direction:column;
  /* top/bottom are set by openWork() to sit between the nav and the footer */
  top:0;bottom:0;
  background:rgba(8,7,6,.96);opacity:0;transition:opacity .22s ease;
}
.lightbox.open{display:flex;opacity:1}
.lb-stage{
  flex:1 1 auto;min-height:0;position:relative;
  display:flex;align-items:center;justify-content:center;padding:2rem;
}
.lb-art{width:100%;height:100%;display:flex;align-items:center;justify-content:center}
.lb-art img{max-width:100%;max-height:100%;object-fit:contain}
.lb-art svg{max-width:70%;max-height:85%}
/* nav arrows */
.lb-nav{
  position:absolute;top:50%;transform:translateY(-50%);
  width:54px;height:54px;border-radius:50%;border:1px solid rgba(255,255,255,.25);
  background:rgba(0,0,0,.35);color:#FFF;font-size:1.9rem;cursor:pointer;
  display:flex;align-items:center;justify-content:center;line-height:1;z-index:2;transition:background .2s,border-color .2s;
}
.lb-nav:hover{background:rgba(255,255,255,.18);border-color:rgba(255,255,255,.5)}
.lb-prev{left:1.6rem}
.lb-next{right:1.6rem}
.lb-nav:disabled{opacity:.28;cursor:default}
/* caption bar — artwork info centred under the image */
.lb-bar{
  flex:0 0 auto;background:rgba(0,0,0,.55);border-top:1px solid rgba(255,255,255,.08);
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.15rem;
  text-align:center;padding:.8rem 2.2rem;
}
.lb-title{font-family:var(--serif);font-size:1.25rem;color:#FFF;line-height:1.2}
.lb-sub{color:#B9B0A3;font-size:.85rem;margin-top:.1rem}
.lb-sub .sep{margin:0 .5rem;opacity:.5}
#lb-p{color:#C9A36A;font-size:.8rem;margin-top:.1rem}
.lb-counter{color:#8C8477;font-size:.78rem;letter-spacing:.12em;margin-top:.15rem}
.lb-close{
  position:absolute;top:1.1rem;right:1.3rem;z-index:3;background:none;border:1px solid rgba(255,255,255,.28);
  border-radius:50%;color:#FFF;width:42px;height:42px;font-size:1.4rem;line-height:1;cursor:pointer;transition:background .2s;
}
.lb-close:hover{background:rgba(255,255,255,.18)}

/* ============ HOME — hero + cards fit one screen ============ */
.home-main{flex:1 1 auto;min-height:0;display:flex;padding:.4rem 1.5rem 1rem}
.home-inner{justify-content:center;gap:1.5rem}
.home-intro{text-align:center}
.home-intro .eyebrow{
  font-size:.72rem;letter-spacing:.32em;text-transform:uppercase;color:var(--muted);margin-bottom:.5rem;
}
.home-intro h1{
  font-family:var(--serif);font-weight:400;font-size:clamp(2.1rem,6vw,3.9rem);
  line-height:1.02;letter-spacing:-.01em;
}
.home-intro .tagline{
  margin:.55rem auto 0;font-size:1rem;color:var(--muted);max-width:540px;
}
.home-intro .cta{margin-top:1.3rem;display:flex;gap:.8rem;justify-content:center;flex-wrap:wrap}
.btn{
  display:inline-block;background:var(--accent);color:var(--accent-ink);text-decoration:none;
  padding:.68rem 1.5rem;font-size:.83rem;letter-spacing:.1em;text-transform:uppercase;
  border-radius:2px;border:1px solid var(--accent);
}
.btn:hover{filter:brightness(1.07)}
.btn.ghost{background:transparent;color:var(--ink);border-color:var(--line)}
.btn.ghost:hover{border-color:var(--accent);color:var(--accent)}

.category-grid{display:grid;gap:1.1rem;grid-template-columns:repeat(4,1fr)}
@media(max-width:900px){.category-grid{grid-template-columns:repeat(2,1fr)}}
.cat-link{
  display:flex;flex-direction:column;justify-content:center;border:1px solid var(--line);
  background:var(--surface);padding:1.1rem 1.3rem;text-decoration:none;
  transition:transform .28s ease,box-shadow .28s ease,border-color .28s ease;
}
.cat-link:hover{transform:translateY(-3px);box-shadow:0 14px 30px rgba(0,0,0,.1);border-color:var(--accent)}
.cat-link .num{font-family:var(--serif);font-size:1.15rem;color:var(--accent)}
.cat-link h3{font-family:var(--serif);font-weight:400;font-size:1.18rem;margin:.3rem 0 .25rem;line-height:1.2}
.cat-link p{font-size:.81rem;color:var(--muted);line-height:1.4}

/* ============ ABOUT / CONTACT ============ */
.page-scroll{flex:1 1 auto;min-height:0;display:flex;flex-direction:column;padding:.8rem 1.5rem 0}
.about-grid{display:grid;gap:2.4rem;grid-template-columns:300px 1fr;align-items:start;max-width:1180px;margin:0 auto;width:100%}
@media(max-width:820px){.about-grid{grid-template-columns:1fr}}
.about-photo{aspect-ratio:3/4;background:var(--thumb-bg);border:1px solid var(--line);border-radius:2px;max-width:300px}
.about-text h3{font-family:var(--serif);font-weight:400;font-size:1.45rem;margin-bottom:.7rem}
.about-text p{color:var(--ink);margin-bottom:1rem;max-width:64ch;font-size:.97rem}
.about-text p b{color:var(--accent)}

.contact-wrap{max-width:1180px;margin:0 auto;width:100%}
.contact-grid{display:block;max-width:560px;margin:0 auto}
@media(max-width:760px){.contact-grid{grid-template-columns:1fr}}
.field{margin-bottom:1.1rem}
.field label{display:block;font-size:.75rem;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);margin-bottom:.35rem}
.field input,.field textarea{
  width:100%;background:var(--surface);border:1px solid var(--line);color:var(--ink);
  padding:.7rem .85rem;font-family:var(--sans);font-size:.92rem;border-radius:2px;
}
.field textarea{min-height:110px;resize:none}
.success-msg{color:var(--ink);font-family:var(--serif);font-size:1.15rem;line-height:1.5;padding:2rem 0;text-align:center}
button.submit{background:var(--accent);color:var(--accent-ink);border:none;padding:.75rem 1.9rem;font-family:var(--sans);font-size:.84rem;letter-spacing:.1em;text-transform:uppercase;cursor:pointer;border-radius:2px}
button.submit:hover{filter:brightness(1.06)}
.contact-details p{font-size:.93rem;margin-bottom:.35rem}
.contact-details .lbl{color:var(--muted);font-size:.7rem;text-transform:uppercase;letter-spacing:.12em;margin-top:1.1rem}

/* ============ FOOTER (slim, flex item) ============ */
footer{
  flex:0 0 auto;border-top:1px solid var(--line);
  padding:.45rem 1.5rem;text-align:center;color:var(--muted);font-size:.76rem;line-height:1.4;
}
footer .fbrand{font-family:var(--serif);font-size:1rem;color:var(--ink)}

/* ============ RESPONSIVE ============ */
/* The work grid stays at 4 columns across on all desktop/laptop widths
   (fewer per row once the window narrows, so tiles never get too small).
   Paging shows up to two rows per page. */
@media(max-width:900px){
  .grid{grid-template-columns:repeat(3,minmax(0,1fr));}
}
@media(max-width:640px){
  .nav-inner{flex-wrap:wrap;padding:.5rem 1rem}
  .site-nav ul{width:100%;overflow-x:auto;gap:1.1rem;padding-bottom:.2rem}
  .site-nav ul li{white-space:nowrap}
  .grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:.8rem}
  .category-grid{grid-template-columns:repeat(2,1fr)}
  .about-grid{grid-template-columns:1fr}
  .contact-grid{grid-template-columns:1fr}
  section.work .section-inner{max-width:none}
}
/* Guard against very large/ultrawide monitors: keep 4 across (no auto-fill regen)
   so the gallery never silently jumps to 5+ columns. */
@media (min-width:1921px), (min-height:1201px){
  .grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:1.2rem 1.8rem}
  section.work .section-inner{max-width:1132px}
}
