/* ============================================================
   GAURE MDEE — PORTFOLIO
   Design tokens
   ============================================================ */
:root{
  --color-primary:     #151513;
  --color-primary-rgb: 21,21,19;
  --color-surface:     #1E1E1B;
  --color-surface-2:   #26251F;
  --color-accent:      #C9975A;
  --color-accent-dim:  #8C6A3E;
  --color-text:        #F6F3EC;
  --color-text-rgb:    246,243,236;
  --color-muted:       #9C978C;
  --color-border:      #35332D;
  --color-void:        #0D0D0C;
  --color-void-rgb:    13,13,12;

  --font-display: 'Fraunces', serif;
  --font-body: 'Karla', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  --nav-h: 84px;
  --ease: cubic-bezier(.22,.68,0,1);
}

*,*::before,*::after{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }
body{
  margin:0;
  background:var(--color-primary);
  color:var(--color-text);
  font-family:var(--font-body);
  font-size:16px;
  line-height:1.55;
  -webkit-font-smoothing:antialiased;
  overflow-x:hidden;
}
img,video{ max-width:100%; display:block; }

/* Discourage saving/copying of Gaure's photography and footage:
   blocks drag-to-desktop, iOS long-press "Save Image", and text selection
   on media. (Right-click/context menu is blocked in js/main.js.) */
img, video,
.tile, .tile-media, .about-portrait, .lightbox-media{
  -webkit-user-select:none;
     -moz-user-select:none;
      -ms-user-select:none;
          user-select:none;
  -webkit-touch-callout:none;
  -webkit-user-drag:none;
}
a{ color:inherit; text-decoration:none; }
button{ font-family:inherit; cursor:pointer; }
:focus-visible{ outline:2px solid var(--color-accent); outline-offset:3px; }
.visually-hidden{ position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); }

/* ---------- kicker / labels ---------- */
.kicker{
  font-family:var(--font-mono);
  font-size:11px;
  letter-spacing:.18em;
  text-transform:uppercase;
  color:var(--color-accent);
}

/* ============================================================
   NAV
   ============================================================ */
.site-nav{
  position:fixed; top:0; left:0; right:0; z-index:500;
  height:var(--nav-h);
  display:flex; align-items:center; justify-content:space-between;
  padding:0 clamp(20px,4vw,56px);
  background:linear-gradient(to bottom, rgba(var(--color-primary-rgb),.85), rgba(var(--color-primary-rgb),0));
  backdrop-filter:blur(0px);
  transition:background .4s var(--ease), backdrop-filter .4s var(--ease), border-color .4s var(--ease);
  border-bottom:1px solid transparent;
}
.site-nav.is-scrolled{
  background:rgba(var(--color-primary-rgb),.82);
  backdrop-filter:blur(10px);
  border-bottom:1px solid var(--color-border);
}
.nav-mark{
  font-family:var(--font-display);
  font-style:italic;
  font-weight:500;
  font-size:22px;
  letter-spacing:.01em;
  color:var(--color-text);
}
.nav-mark span{ color:var(--color-accent); }

.tab-toggle{
  position:relative;
  display:flex;
  gap:2px;
  background:rgba(var(--color-text-rgb),.04);
  border:1px solid var(--color-border);
  border-radius:999px;
  padding:4px;
}
.tab-toggle button{
  position:relative; z-index:2;
  border:none; background:transparent;
  color:var(--color-muted);
  font-family:var(--font-mono);
  font-size:12px;
  letter-spacing:.14em;
  text-transform:uppercase;
  padding:9px 22px;
  border-radius:999px;
  transition:color .3s var(--ease);
}
.tab-toggle button.is-active{ color:var(--color-primary); }
.tab-toggle .tab-pill{
  position:absolute; top:4px; bottom:4px; left:4px;
  width:calc(50% - 4px);
  background:var(--color-accent);
  border-radius:999px;
  transition:transform .45s var(--ease);
  z-index:1;
}
.tab-toggle[data-active="me"] .tab-pill{ transform:translateX(100%); }

.nav-social{ display:flex; align-items:center; gap:18px; }
.nav-social > a{
  width:36px; height:36px;
  display:flex; align-items:center; justify-content:center;
  color:var(--color-muted);
  border:1px solid var(--color-border);
  border-radius:50%;
  transition:color .3s var(--ease), border-color .3s var(--ease), transform .3s var(--ease);
}
.nav-social > a:hover{ color:var(--color-accent); border-color:var(--color-accent); transform:translateY(-2px); }
.nav-social svg{ width:16px; height:16px; }

/* Articles dropdown — matches the social-icon treatment (muted, accent on hover) */
.nav-articles{ position:relative; }
.nav-articles-btn{
  border:1px solid var(--color-border);
  background:transparent;
  color:var(--color-muted);
  font-family:var(--font-mono);
  font-size:12px; letter-spacing:.14em; text-transform:uppercase;
  padding:9px 18px; border-radius:999px;
  transition:color .3s var(--ease), border-color .3s var(--ease);
}
.nav-articles-btn:hover,
.nav-articles-btn[aria-expanded="true"]{ color:var(--color-accent); border-color:var(--color-accent); }
.nav-articles-menu{
  position:absolute; top:calc(100% + 12px); right:0;
  width:min(320px, 80vw);
  background:var(--color-surface-2);
  border:1px solid var(--color-border);
  border-radius:12px;
  padding:8px;
  display:none; flex-direction:column; gap:2px;
  box-shadow:0 20px 48px rgba(var(--color-void-rgb),.55);
  z-index:600;
}
.nav-articles.open .nav-articles-menu{ display:flex; }
.nav-articles-menu a{
  display:block; width:auto; height:auto;
  padding:13px 15px; border-radius:8px;
  color:var(--color-text); font-size:13.5px; line-height:1.4;
  transition:background .2s var(--ease), color .2s var(--ease);
}
.nav-articles-menu a:hover{ background:rgba(var(--color-text-rgb),.05); color:var(--color-accent); }
.na-src{ display:block; font-family:var(--font-mono); font-size:10px; letter-spacing:.12em; text-transform:uppercase; color:var(--color-accent); margin-bottom:6px; }

/* ============================================================
   HERO
   ============================================================ */
.hero{
  position:relative;
  height:100svh;
  min-height:560px;
  display:flex; align-items:center; justify-content:center;
  overflow:hidden;
  background:var(--color-void);
}
.hero-bg-layer{
  position:absolute; inset:0;
  opacity:0;
  transition:opacity 1.6s ease;
}
.hero-bg-layer.is-active{ opacity:1; z-index:1; }
.hero-bg-layer video,
.hero-bg-layer img{
  width:100%; height:100%; object-fit:cover;
}
.hero-bg-layer img{ animation:kenburns 9s ease-in-out forwards; }
@keyframes kenburns{
  from{ transform:scale(1.06) translate(0,0); }
  to{ transform:scale(1.14) translate(-1%,-1%); }
}
.hero::after{
  content:'';
  position:absolute; inset:0; z-index:2;
  background:
    linear-gradient(to bottom, rgba(var(--color-void-rgb),.55) 0%, rgba(var(--color-void-rgb),.25) 30%, rgba(var(--color-void-rgb),.55) 68%, rgba(var(--color-void-rgb),.92) 100%);
}
.hero-content{
  position:relative; z-index:3;
  text-align:center;
  padding:0 20px;
  max-width:900px;
}
.hero-eyebrow{
  font-family:var(--font-mono);
  font-size:12px;
  letter-spacing:.22em;
  text-transform:uppercase;
  color:var(--color-accent);
  margin-bottom:22px;
}
.signature-wrap{ position:relative; display:inline-block; }
.hero-name{
  font-family:var(--font-display);
  font-style:italic;
  font-weight:500;
  font-size:clamp(52px, 11vw, 128px);
  line-height:1;
  margin:0;
  letter-spacing:-.01em;
}
.signature-swash{
  display:block;
  width:min(560px, 82vw);
  height:auto;
  margin:6px auto 0;
}
.signature-swash path{
  fill:none;
  stroke:var(--color-accent);
  stroke-width:2.5;
  stroke-linecap:round;
  stroke-dasharray:900;
  stroke-dashoffset:900;
  animation:draw 2.1s var(--ease) .5s forwards;
}
@keyframes draw{ to{ stroke-dashoffset:0; } }

.hero-role{
  margin:26px 0 0;
  font-size:clamp(14px,2vw,18px);
  color:var(--color-text);
  font-weight:400;
}
.hero-role b{ color:var(--color-accent); font-weight:600; }

.hero-jump{
  margin-top:40px;
  display:flex; gap:14px; justify-content:center; flex-wrap:wrap;
}
.hero-jump button{
  border:1px solid rgba(var(--color-text-rgb),.35);
  background:rgba(var(--color-text-rgb),.06);
  color:var(--color-text);
  font-family:var(--font-mono);
  font-size:12px;
  letter-spacing:.14em;
  text-transform:uppercase;
  padding:13px 28px;
  border-radius:999px;
  transition:all .3s var(--ease);
}
.hero-jump button:hover{ background:var(--color-accent); border-color:var(--color-accent); color:var(--color-primary); }

.hero-scroll{
  position:absolute; bottom:28px; left:50%; z-index:3;
  transform:translateX(-50%);
  color:var(--color-muted);
  display:flex; flex-direction:column; align-items:center; gap:8px;
  font-family:var(--font-mono); font-size:10px; letter-spacing:.2em; text-transform:uppercase;
}
.hero-scroll .line{ width:1px; height:34px; background:linear-gradient(to bottom, var(--color-accent), transparent); animation:pulse 2s ease-in-out infinite; }
@keyframes pulse{ 0%,100%{ opacity:.3; } 50%{ opacity:1; } }

/* ============================================================
   SECTIONS / GRID
   ============================================================ */
.panel{ padding:96px clamp(20px,4vw,56px) 60px; max-width:1600px; margin:0 auto; }
.panel-head{ margin-bottom:44px; }
.panel-head h2{
  font-family:var(--font-display);
  font-style:italic;
  font-weight:500;
  font-size:clamp(30px,4vw,48px);
  margin:10px 0 0;
}
.panel-head p{ color:var(--color-muted); max-width:560px; margin:14px 0 0; font-size:15.5px; }

.view{ display:none; }
.view.is-active{ display:block; animation:fadeIn .5s ease; }
@keyframes fadeIn{ from{ opacity:0; transform:translateY(8px);} to{ opacity:1; transform:translateY(0);} }

/* Uniform gallery: every tile is exactly the same size and shape, so the
   grid reads as one clean, ordered set rather than a ragged collage.
   Media fills its frame with object-fit:cover (centre-weighted crop). */
.grid{
  display:grid;
  grid-template-columns:repeat(3, 1fr);
  gap:22px;
  align-items:start;
}
@media (max-width:1080px){ .grid{ grid-template-columns:repeat(2, 1fr); gap:18px; } }
@media (max-width:560px){  .grid{ grid-template-columns:1fr; gap:16px; } }
.tile{
  position:relative;
  width:100%;
  aspect-ratio:4 / 3;          /* the single shared shape for every tile */
  border-radius:18px;
  overflow:hidden;
  background:var(--color-surface);
  cursor:pointer;
  box-shadow:0 8px 26px rgba(var(--color-void-rgb),.42);
  transition:box-shadow .45s var(--ease);
}
/* NOTE: no `isolation` and no transform on the tile itself. Both create
   compositing layers that Safari mis-paints inside a CSS multi-column
   grid, making large tiles flicker or vanish until the cursor moves. */
.tile:hover{
  box-shadow:0 16px 40px rgba(var(--color-void-rgb),.55);
}
/* media carries its own rounding, so corners stay clean without the tile
   needing to clip a transformed child (which is the Safari failure case). */
.tile .tile-media{ border-radius:inherit; }

/* Default for photos and everything else: fill the frame (as before). */
.tile-media{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; transition:transform .7s var(--ease), opacity .5s ease; }

/* ONLY the Work-section video tiles opt into "show the whole frame" mode, so
   their compositions aren't sliced. Photos and the Me section are untouched. */
.tile-fit .tile-media{ object-fit:contain; }
.tile-fit .tile-backdrop{
  position:absolute; inset:0; width:100%; height:100%;
  object-fit:cover;
  transform:scale(1.25);
  filter:blur(30px) saturate(1.15);
  opacity:.42;
  z-index:0;
  pointer-events:none;
}

/* Desktop only (mouse/trackpad): keep the zoomed media on a stable paint
   layer so Safari doesn't drop it mid-transition. Touch devices are left
   completely untouched. */
@media (hover:hover) and (pointer:fine){
  .tile-media{
    -webkit-backface-visibility:hidden;
            backface-visibility:hidden;
  }
  .tile:hover .tile-media{ transform:scale(1.045); }
}

/* Single-image (photo) tiles fade in on load */
.tile:not(.tile-hasposter) .tile-media{ opacity:0; }
.tile:not(.tile-hasposter).media-ready .tile-media{ opacity:1; }

/* Video tiles: instant poster underneath, live video fades in over it while playing */
.tile-poster{ opacity:0; z-index:1; }
.tile-hasposter.media-ready .tile-poster{ opacity:1; }
.tile-video{ opacity:0; z-index:2; }
.tile-hasposter.is-playing .tile-video{ opacity:1; }

/* Loading state: a quiet shimmer so a tile reads as "loading", never blank/broken. */
.tile:not(.tile-article):not(.media-ready){
  background-image:linear-gradient(100deg,
    var(--color-surface) 30%,
    var(--color-surface-2) 50%,
    var(--color-surface) 70%);
  background-size:200% 100%;
  animation:tileShimmer 1.5s ease-in-out infinite;
}
@keyframes tileShimmer{ from{ background-position:200% 0; } to{ background-position:-200% 0; } }
@media (prefers-reduced-motion: reduce){
  .tile:not(.tile-article):not(.media-ready){ animation:none; }
  .tile-media{ transition:opacity .3s ease; }
}

.tile-scrim{
  position:absolute; inset:0;
  z-index:3;                 /* must sit above .tile-video (z-index:2) */
  border-radius:inherit;
  background:linear-gradient(to top, rgba(var(--color-void-rgb),.86) 0%, rgba(var(--color-void-rgb),0) 46%);
  opacity:.75;
  transition:opacity .35s ease;
}
.tile:hover .tile-scrim{ opacity:.92; }

.tile-info{
  position:absolute; left:0; right:0; bottom:0;
  z-index:4;                 /* title + play button always on top of the media */
  padding:16px 18px;
  display:flex; align-items:flex-end; justify-content:space-between; gap:10px;
}
.tile-title{ font-family:var(--font-body); font-weight:700; font-size:14.5px; line-height:1.3; }
.tile-tag{ font-family:var(--font-mono); font-size:10px; letter-spacing:.1em; text-transform:uppercase; color:var(--color-muted); margin-top:4px; display:block;}

.tile-play{
  flex:none;
  width:38px; height:38px;
  border-radius:50%;
  border:1px solid rgba(var(--color-text-rgb),.5);
  background:rgba(var(--color-primary-rgb),.35);
  display:flex; align-items:center; justify-content:center;
  color:var(--color-text);
  transition:all .3s var(--ease);
}
.tile:hover .tile-play{ background:var(--color-accent); border-color:var(--color-accent); color:var(--color-primary); transform:scale(1.08); }
.tile-play svg{ width:13px; height:13px; margin-left:2px; }

/* article card tile */
.tile-article{
  background:var(--color-surface-2);
  border:1px solid var(--color-border);
  display:flex; flex-direction:column; justify-content:center;
  min-height:300px;
  padding:30px 28px 26px;
  cursor:default;
}
.tile-article .kicker{ margin-bottom:12px; }
.tile-article h3{ font-family:var(--font-display); font-style:italic; font-size:19px; line-height:1.3; margin:0 0 10px; font-weight:500; }
.tile-article p{ color:var(--color-muted); font-size:13.5px; line-height:1.5; margin:0 0 16px; }
.tile-article a{
  font-family:var(--font-mono); font-size:11px; letter-spacing:.1em; text-transform:uppercase;
  color:var(--color-accent);
  display:inline-flex; align-items:center; gap:8px;
}
.tile-article a:hover{ text-decoration:underline; }

/* ============================================================
   ABOUT STRIP (within ME view)
   ============================================================ */
.about-strip{
  display:grid;
  grid-template-columns:220px 1fr;
  gap:40px;
  align-items:start;
  margin-bottom:52px;
  padding-bottom:52px;
  border-bottom:1px solid var(--color-border);
}
.about-portrait{ border-radius:18px; overflow:hidden; border:1px solid var(--color-border); }
.about-copy p{ font-size:16.5px; color:var(--color-text); max-width:640px; margin:0 0 14px; }
.about-copy p:last-child{ color:var(--color-muted); font-size:14.5px; }

/* ============================================================
   LIGHTBOX
   ============================================================ */
.lightbox{
  position:fixed; inset:0; z-index:1000;
  background:rgba(var(--color-void-rgb),.96);
  display:flex; align-items:center; justify-content:center;
  opacity:0; visibility:hidden;
  transition:opacity .35s ease, visibility .35s ease;
  padding:min(6vh,60px) min(6vw,80px);
}
.lightbox.is-open{ opacity:1; visibility:visible; }
.lightbox-stage{ position:relative; max-width:1200px; width:100%; max-height:88vh; }
.lightbox-media{ width:100%; max-height:88vh; object-fit:contain; border-radius:4px; background:#000; }
.lightbox-caption{ margin-top:14px; display:flex; justify-content:space-between; gap:20px; align-items:baseline; flex-wrap:wrap; }
.lightbox-caption h3{ font-family:var(--font-display); font-style:italic; font-weight:500; font-size:19px; margin:0; }
.lightbox-close, .lightbox-prev, .lightbox-next{
  position:fixed;
  background:rgba(var(--color-text-rgb),.06);
  border:1px solid rgba(var(--color-text-rgb),.18);
  color:var(--color-text);
  width:46px; height:46px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  transition:all .25s var(--ease);
}
.lightbox-close:hover, .lightbox-prev:hover, .lightbox-next:hover{ background:var(--color-accent); border-color:var(--color-accent); color:var(--color-primary); }
.lightbox-close{ top:24px; right:24px; }
.lightbox-prev{ left:24px; top:50%; transform:translateY(-50%); }
.lightbox-next{ right:24px; top:50%; transform:translateY(-50%); }
.lightbox-close svg, .lightbox-prev svg, .lightbox-next svg{ width:18px; height:18px; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer{
  border-top:1px solid var(--color-border);
  padding:40px clamp(20px,4vw,56px) 34px;
  display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:18px;
}
.footer-mark{ font-family:var(--font-display); font-style:italic; font-size:18px; color:var(--color-muted); }
.footer-credit{ font-family:var(--font-mono); font-size:11px; letter-spacing:.06em; color:var(--color-muted); text-align:center; }
.footer-credit a{ color:var(--color-accent); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width:900px){
  .about-strip{ grid-template-columns:1fr; }
  .about-portrait{ max-width:220px; }
}
@media (max-width:640px){
  :root{ --nav-h:66px; }
  .site-nav{ padding:0 14px; }
  .nav-mark{ font-size:17px; }
  .nav-social{ gap:8px; }
  .nav-social > a{ width:30px; height:30px; }
  .nav-articles-btn{ padding:7px 11px; font-size:10px; letter-spacing:.1em; }
  .tab-toggle button{ padding:8px 14px; font-size:10.5px; }
  .panel{ padding:64px 16px 40px; }
  .grid{ gap:8px; }
  .lightbox{ padding:0; }
  .lightbox-close{ top:14px; right:14px; width:40px; height:40px; }
  .lightbox-prev{ left:8px; width:40px; height:40px; }
  .lightbox-next{ right:8px; width:40px; height:40px; }
  .hero-jump{ flex-direction:column; align-items:center; }
}
