/* ============================================================
   NICK TUSTIN — MASTER STYLESHEET
   Static multi-page portfolio
   ============================================================ */

/* ---------- 1. FONT LOADING ---------- */
@font-face {
  font-family: "Cobbler Sans Medium";
  src: url("fonts/CobblerSans-Medium.woff2") format("woff2"),
       url("fonts/CobblerSans-Medium.woff") format("woff");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* ---------- 2. DESIGN TOKENS ---------- */
:root {
  --bg:            #E8E3D6;                   /* Warm cream background */
  --ink-muted:     #898DA4;                   /* Solid slate-blue */
  --ink-deep:      #898DA4;                   /* Solid slate-blue */
  --divider:       #898DA4;                   /* Solid slate-blue lines */
  --hover-white:   #FFFFFF;                   /* Pure white for hovers */

  --header-pad-top: 2.5rem;                   
  --header-pad-bot: 1.5rem;                   
  --header-pad-x:  2.2rem;
  --divider-w:     1.5px;                     /* Locked to 1.5px for universal consistency */
  --gap-grid:      12px;                      

  --font-display:  "Cobbler Sans Medium", sans-serif;
  --font-body:     "Cobbler Sans Medium", sans-serif;
}

/* ---------- 3. GLOBAL RESET / BASE ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg);
  color: var(--ink-deep);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  text-transform: lowercase;  
  letter-spacing: 0.08em;     
}

/* Forces buttons and inputs to inherit the site's typography */
input, textarea, button {
  font-family: inherit;
  letter-spacing: inherit;
  text-transform: lowercase;
  color: inherit;
  -webkit-appearance: none;  
  border-radius: 0;
}

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

a { text-decoration: none; }

/* ============================================================
   4. GLOBAL NAVIGATION HEADER 
   ============================================================ */
.site-header {
  display: flex;
  align-items: flex-end;         
  justify-content: space-between;
  padding: var(--header-pad-top) var(--header-pad-x) var(--header-pad-bot); 
  font-family: var(--font-display);
}

/* --- Logo (far left) --- */
.site-logo {
  font-family: var(--font-display);
  font-size: 3.2rem;             
  color: var(--ink-deep);
  display: inline-block;
  letter-spacing: 0.12em; 
  transform: scale(1.08, 0.96);  
  transform-origin: left bottom; 
  transition: color 0.1s ease-in;
  line-height: 0.85;             
}

/* --- Right-hand navigation cluster --- */
.nav-cluster {
  display: flex;
  align-items: stretch;
  margin-bottom: 0.1rem;         
}

/* --- The vertical divider lines --- */
.nav-divider {
  width: var(--divider-w);
  background-color: var(--divider);
  margin: 0 2rem;                
  align-self: stretch;
  transform: translateY(3px);    
}

/* --- Each menu column --- */
.nav-col {
  display: flex;
  flex-direction: column;
  justify-content: center;       
  gap: 0.8rem;                   
}

.nav-col a {
  font-size: 1.05rem;            
  color: var(--ink-muted);
  display: inline-block;
  transform: scale(1.08, 0.96);  
  transform-origin: left center;
  transition: color 0.1s ease-in;
  line-height: 1;                
}

/* --- Shared Pure White Hover States --- */
.site-logo:hover,
.nav-col a:hover {
  color: var(--hover-white);
}

/* ============================================================
   5. MASONRY COLLAGE 
   ============================================================ */
.collage {
  column-count: 4;
  column-gap: var(--gap-grid);
  padding: 0 var(--header-pad-x) 3rem; 
}

.collage img {
  width: 100%;
  margin-bottom: var(--gap-grid);
  break-inside: avoid;           
}

.collage--dense {
  column-count: 5;
}

@media (max-width: 1100px) {
  .collage,
  .collage--dense { column-count: 3; }
}
@media (max-width: 720px) {
  .collage,
  .collage--dense { column-count: 2; }
}
@media (max-width: 440px) {
  .collage,
  .collage--dense { column-count: 1; }
}

/* ============================================================
   6. RESPONSIVE VIDEO CONTAINERS 
   ============================================================ */
.video-frame {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;        
  height: 0;
  overflow: hidden;
  background: var(--divider);    
}
.video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ============================================================
   7. MOTION PAGE 
   ============================================================ */
.showreel-wrap {
  max-width: 1100px;
  margin: 1rem auto 4rem;
  padding: 0 var(--header-pad-x);
}

/* ============================================================
   8. EARLY WORK 
   ============================================================ */
.timeline {
  max-width: 1200px;
  margin: 1rem auto 4rem;
  padding: 0 var(--header-pad-x);
}

.year-block { margin-bottom: 4rem; }

.year-heading {
  font-family: var(--font-display);
  font-size: 2.2rem;
  color: var(--ink-deep);
  margin-bottom: 1.2rem;
  border-bottom: var(--divider-w) solid var(--divider); 
  padding-bottom: 0.4rem;
  display: inline-block;
  transform: scale(1.08, 0.96); 
  transform-origin: left center;
}

.year-grid {
  column-count: 3;
  column-gap: var(--gap-grid);
}
.year-grid img,
.year-grid .video-frame {
  width: 100%;
  margin-bottom: var(--gap-grid);
  break-inside: avoid;
}

@media (max-width: 900px) { .year-grid { column-count: 2; } }
@media (max-width: 560px) { .year-grid { column-count: 1; } }

/* ============================================================
   9. STORE PAGE
   ============================================================ */
.store-banner {
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.3rem;             
  font-weight: 500;              
  color: var(--ink-deep);
  padding: 1rem 1rem 3rem;
  display: block;                
  width: 100%;
  transform: scale(1.08, 0.96);  
}

.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 2.2rem;
  max-width: 1200px;
  margin: 0 auto 4rem;
  padding: 0 var(--header-pad-x);
}

.product-card { text-align: center; }
.product-card img {
  width: 100%;
  margin-bottom: 0.8rem;
}
.product-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--ink-deep);
  margin-bottom: 0.25rem;
  display: inline-block;
  transform: scale(1.08, 0.96);
}
.product-price {
  font-size: 0.95rem;
  color: var(--ink-deep);
  margin-bottom: 0.7rem;
}
.product-btn {
  display: inline-block;
  font-size: 0.85rem;
  padding: 0.5rem 1.4rem;
  background: transparent;
  color: var(--ink-muted);
  border: var(--divider-w) solid var(--divider); 
  transform: scale(1.08, 0.96);
  transition: color 0.1s, border-color 0.1s;
}
.product-btn:hover {
  color: var(--hover-white);
  border-color: var(--hover-white);
}

/* ============================================================
   10. INFO PAGE (Contact & Bio)
   ============================================================ */
.info-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem var(--header-pad-x) 4rem;
  text-align: center;
}

.info-statement {
  font-family: var(--font-display);
  font-size: 1.4rem;             
  line-height: 1.6;              
  color: var(--ink-deep);
  margin-bottom: 2rem;        
}

.social-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.6rem;
  margin-bottom: 2.5rem;      
  font-family: var(--font-display);
}
.social-links a {
  font-size: 1rem;
  color: var(--ink-muted);
  display: inline-block;
  transform: scale(1.08, 0.96);
  transition: color 0.1s;
}
.social-links a:hover { 
  color: var(--hover-white); 
}

/* Contact form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;                
  text-align: left;
}
.contact-form label {
  font-family: var(--font-display);
  font-size: 1rem;            
  color: var(--ink-deep);
  display: inline-block;
  transform: scale(1.08, 0.96);
  transform-origin: left center;
  margin-bottom: 0.2rem;      
}
.contact-form input,
.contact-form textarea {
  font-size: 0.95rem;
  padding: 0.7rem 0.9rem;
  background: var(--bg); 
  border: var(--divider-w) solid var(--divider); 
  color: var(--ink-deep);
  outline: none; 
  transition: border-color 0.1s;
}
.contact-form textarea { resize: vertical; min-height: 130px; }

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--hover-white);
}

.contact-form button {
  align-self: flex-start;
  font-size: 0.9rem;
  padding: 0.7rem 2rem;
  background: transparent;
  color: var(--ink-muted);
  border: var(--divider-w) solid var(--divider); 
  cursor: pointer;
  transform: scale(1.08, 0.96);
  transform-origin: left center;
  transition: color 0.1s, border-color 0.1s;
  margin-top: 0.4rem;
}
.contact-form button:hover {
  color: var(--hover-white);
  border-color: var(--hover-white);
}

/* ============================================================
   11. MOBILE HEADER ADJUSTMENTS
   ============================================================ */
@media (max-width: 680px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.2rem;
    padding: 2rem var(--header-pad-x) 2rem;
  }
  .nav-cluster { width: 100%; }
  .nav-divider { margin: 0 1.1rem; transform: translateY(0); }
  .nav-col a { font-size: 0.85rem; }
}

/* ============================================================
   12. LIGHTBOX MODAL (Image Popup)
   ============================================================ */

/* Setup custom magnifying glass click targets and clear default focus outlines */
.collage img, .year-grid img, .product-card img {
  cursor: zoom-in;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

/* Reverts image hover states back to original clarity (no pale effect, no outlines) */
.collage img:hover, .year-grid img:hover, .product-card img:hover,
.collage img:focus, .year-grid img:focus, .product-card img:focus {
  opacity: 1 !important;
  outline: none !important;
  border: none !important;
}

/* The solid background overlay */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--bg); 
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

/* Hard-locks the illustration asset to prevent over-scaling past max native limits */
.lightbox img {
  flex: 0 0 auto !important;         /* Prevents flexbox from force-stretching the image */
  width: auto !important;            /* Strictly maps to the image file's native pixel width */
  height: auto !important;     
  max-width: 90vw !important;  
  max-height: 85vh !important; 
  object-fit: scale-down !important; /* Double-failsafe: scales down if too big, never scales up */
  cursor: zoom-out;
}

/* The clean boxless X button */
.lightbox-close {
  position: absolute;
  top: 2.5rem;
  right: 2.2rem;
  font-family: var(--font-display);
  font-size: 2.6rem;         
  background: transparent;
  border: none;              
  color: var(--ink-muted);
  cursor: pointer;
  transform: scale(1.08, 0.96);
  transition: color 0.1s ease;
  line-height: 0.5;
  outline: none;
}

.lightbox-close:hover {
  color: var(--hover-white);
}