:root{
  --bg:#FFFFFF;
  --panel:#FAFAFA;
  --ink:#111111;
  --muted:#737373;
  --wine:#7C2C3B;
  --gold:#B6935F;
  --line:#DBDBDB;
}
@media (prefers-color-scheme: dark){
  :root{ --bg:#000000; --panel:#121212; --ink:#F5F5F5; --muted:#A8A8A8; --line:#262626; }
}
*{box-sizing:border-box;}
html,body{margin:0;}
body{
  background:var(--bg); color:var(--ink);
  font-family:'Jost',sans-serif; -webkit-font-smoothing:antialiased;
  padding-bottom:env(safe-area-inset-bottom,0px);
}
a{color:inherit;}
h1,h2,h3{margin:0;}

/* Top bar */
.ig-top{
  position:sticky; top:0; z-index:10;
  background:var(--bg); border-bottom:1px solid var(--line);
  padding-top:env(safe-area-inset-top,0px);
}
.ig-top-row{
  max-width:935px; margin:0 auto; padding:.75rem 1rem;
  display:grid; grid-template-columns:40px 1fr 40px; align-items:center;
}
.ig-back{display:flex; align-items:center; text-decoration:none; width:32px; height:32px;}
.ig-back svg{width:24px; height:24px;}
.ig-handle{text-align:center; font-weight:600; font-size:1rem; letter-spacing:.01em; display:flex; align-items:center; justify-content:center; gap:.3rem;}
.ig-handle svg{width:14px; height:14px; color:#0095F6;}

.ig{max-width:935px; margin:0 auto; padding:0 1rem;}

/* Profile header */
.ig-profile{display:grid; grid-template-columns:auto 1fr; gap:1.2rem 2.4rem; align-items:center; padding:1.6rem 0 1.2rem;}
@media(min-width:736px){ .ig-profile{grid-template-columns:290px 1fr; padding:2.4rem 0 2.6rem;} }
.ig-avatar{
  width:86px; height:86px; border-radius:50%; padding:3px; justify-self:center;
  background:conic-gradient(from 200deg, var(--gold), var(--wine), #D8B8BE, var(--gold));
}
@media(min-width:736px){ .ig-avatar{width:150px; height:150px;} }
.ig-avatar-inner{width:100%; height:100%; border-radius:50%; background:#fff; border:3px solid var(--bg); display:flex; align-items:center; justify-content:center; overflow:hidden;}
.ig-avatar-inner img{width:78%; height:auto;}
.ig-meta{min-width:0;}
.ig-name-row{display:flex; align-items:center; gap:.8rem; flex-wrap:wrap;}
.ig-name-row h1{font-family:'Jost',sans-serif; font-size:1.25rem; font-weight:400;}
.ig-btn{
  display:inline-block; text-decoration:none; text-align:center;
  font-size:.85rem; font-weight:600; padding:.4rem 1rem; border-radius:8px;
  background:#EFEFEF; color:#000; border:0; cursor:pointer;
}
.ig-btn.primary{background:#0095F6; color:#fff;}
@media (prefers-color-scheme: dark){ .ig-btn{background:#363636; color:#F5F5F5;} .ig-btn.primary{background:#0095F6; color:#fff;} }
.ig-stats{display:flex; gap:2.2rem; list-style:none; padding:0; margin:1rem 0; font-size:.95rem;}
.ig-stats b{font-weight:600;}
.ig-bio{font-size:.9rem; line-height:1.45;}
.ig-bio .title{font-weight:600;}
.ig-bio .cat{color:var(--muted);}
.ig-bio p{margin:.15rem 0;}
.ig-actions{display:none;}
@media(max-width:735px){
  .ig-profile{grid-template-columns:86px 1fr;}
  .ig-name-row .ig-btn{display:none;}
  .ig-stats{justify-content:space-around; gap:0; text-align:center; margin:.6rem 0 0;}
  .ig-stats li{display:flex; flex-direction:column; font-size:.85rem;}
  .ig-bio{grid-column:1 / -1;}
  .ig-actions{display:grid; grid-template-columns:1fr 1fr; gap:.4rem; grid-column:1 / -1;}
}

/* Story highlights = palette swatches */
.ig-highlights{display:flex; gap:1.6rem; overflow-x:auto; padding:.4rem 0 1.6rem; scrollbar-width:none;}
.ig-highlights::-webkit-scrollbar{display:none;}
@media(min-width:736px){ .ig-highlights{gap:2.6rem; padding:0 0 2.6rem 1.4rem;} }
.ig-hl{flex:0 0 auto; display:flex; flex-direction:column; align-items:center; gap:.4rem; width:72px;}
.ig-hl-ring{width:64px; height:64px; border-radius:50%; border:1px solid var(--line); padding:3px;}
@media(min-width:736px){ .ig-hl-ring{width:80px; height:80px;} .ig-hl{width:88px;} }
.ig-hl-ring span{display:block; width:100%; height:100%; border-radius:50%; background:var(--c); box-shadow:inset 0 0 0 1px rgba(0,0,0,.06);}
.ig-hl b{font-size:.75rem; font-weight:600; white-space:nowrap;}
.ig-hl small{font-size:.65rem; color:var(--muted); margin-top:-.3rem; letter-spacing:.03em;}

/* Tabs */
.ig-tabs{display:flex; justify-content:center; gap:3.5rem; border-top:1px solid var(--line);}
.ig-tab{display:flex; align-items:center; gap:.4rem; font-size:.75rem; font-weight:600; letter-spacing:.08em; text-transform:uppercase; color:var(--muted); padding:1rem 0; border-top:1px solid transparent; margin-top:-1px; background:none; border-left:0; border-right:0; border-bottom:0; cursor:pointer; font-family:inherit;}
.ig-tab svg{width:14px; height:14px;}
.ig-tab[aria-selected="true"]{color:var(--ink); border-top-color:var(--ink);}

/* Grid */
.ig-grid{display:grid; grid-template-columns:repeat(3,1fr); gap:3px; margin:0 -1rem;}
@media(min-width:736px){ .ig-grid{gap:4px; margin:0;} }
.ig-grid[hidden]{display:none;}
.ig-post{position:relative; aspect-ratio:4/5; overflow:hidden; background:var(--panel); border:0; padding:0; cursor:pointer; display:block; width:100%;}
.ig-post img{width:100%; height:100%; object-fit:cover; display:block;}
.ig-post .ig-badge{position:absolute; top:.5rem; right:.5rem; width:18px; height:18px; color:#fff; filter:drop-shadow(0 0 2px rgba(0,0,0,.5));}
.ig-post:hover::after{content:""; position:absolute; inset:0; background:rgba(0,0,0,.18);}

/* Palette post */
.ig-swatches{position:absolute; inset:0; display:flex; flex-direction:column;}
.ig-swatches div{flex:1; background:var(--c); display:flex; align-items:flex-end; justify-content:space-between; padding:.3rem .5rem; font-size:.6rem; letter-spacing:.06em; color:var(--t,#fff);}
@media(min-width:736px){ .ig-swatches div{font-size:.72rem; padding:.4rem .7rem;} }

/* Close-up placeholder slot */
.ig-slot{
  position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:.4rem;
  border:1px dashed #C9A66B; color:#9c8f84; text-align:center; padding:.5rem;
}
.ig-slot svg{width:24px; height:24px; opacity:.6;}
.ig-slot span{font-size:.7rem; letter-spacing:.02em;}
.ig-post.is-slot{cursor:default;}
.ig-post.is-slot:hover::after{display:none;}

.ig-foot{text-align:center; padding:3rem 1rem 3.5rem; font-size:.8rem; color:var(--muted);}
.ig-foot a{color:var(--wine); font-weight:600; text-decoration:none;}

/* Lightbox */
.ig-lightbox{position:fixed; inset:0; z-index:50; background:rgba(0,0,0,.85); display:flex; align-items:center; justify-content:center; padding:1.2rem;}
.ig-lightbox[hidden]{display:none;}
.ig-lightbox figure{margin:0; background:var(--bg); max-width:min(560px,100%); max-height:100%; display:flex; flex-direction:column; border-radius:4px; overflow:hidden;}
.ig-lightbox figure img{display:block; max-width:100%; max-height:calc(100vh - 9rem); object-fit:contain; margin:0 auto;}
.ig-lightbox figcaption{padding:.8rem 1rem; font-size:.85rem; line-height:1.4; border-top:1px solid var(--line);}
.ig-lightbox figcaption b{margin-right:.35rem;}
.ig-close{position:absolute; top:max(1rem, env(safe-area-inset-top)); right:1rem; background:none; border:0; color:#fff; cursor:pointer; width:36px; height:36px;}
.ig-close svg{width:28px; height:28px;}
