/* ============================================
   Binoy MS — Portfolio
   Design tokens
   ============================================ */
:root{
  --bg: #d9d9d9;
  --bg-soft: #ececE7;
  --ink: #232323;
  --ink-soft: #55534d;
  --paper-outline: #c9c6bd;
  --yellow: #f4b400;
  --yellow-deep: #e0a300;
  --card-radius: 18px;
  --pill-radius: 999px;
  --shadow-soft: 0 10px 30px rgba(30,30,25,0.12);
  --shadow-nav: 0 14px 28px rgba(20,20,15,0.18);
  --font-display: "Poppins", "Segoe UI", sans-serif;
  --font-body: "Poppins", "Segoe UI", sans-serif;
}

*{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }
body{
  margin:0;
  background:var(--bg) url('assets/hero/texture-bg.jpg');
  background-size:800px;
  background-repeat:repeat;
  color:var(--ink);
  font-family:var(--font-body);
  -webkit-font-smoothing:antialiased;
  overflow-x:hidden;
}
img{ max-width:100%; display:block; }
a{ color:inherit; text-decoration:none; }
button{ font-family:inherit; cursor:pointer; }

.visually-hidden{
  position:absolute !important;
  width:1px;height:1px;
  overflow:hidden;
  clip:rect(0 0 0 0);
  white-space:nowrap;
}

/* Focus visibility */
a:focus-visible, button:focus-visible{
  outline:3px solid var(--yellow-deep);
  outline-offset:3px;
}

/* ============================================
   Top bar: logo + nav
   ============================================ */
.topbar{
  position:fixed;
  top:0; left:0; right:0;
  z-index:200;
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  padding:28px clamp(20px,4vw,64px) 0;
  pointer-events:none;
}
.topbar > *{ pointer-events:auto; }

.brand-mark{
  width:64px; height:64px;
  border-radius:50%;
  background:transparent;
  border:none;
  padding:0;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:var(--shadow-soft);
  flex-shrink:0;
  overflow:hidden;
  transition:transform .18s ease;
}
.brand-mark:hover{ transform:scale(1.05); }
.brand-mark img{ width:100%; height:100%; object-fit:cover; }

.nav-pill{
  display:flex;
  gap:10px;
  background:transparent;
  padding:0;
}
.nav-pill button{
  border:none;
  background:#3a3a3a;
  color:#fff;
  font-family:var(--font-display);
  font-size:16px;
  font-weight:500;
  padding:14px 26px;
  border-radius:var(--pill-radius);
  box-shadow:var(--shadow-nav);
  transition:background .2s ease, color .2s ease, transform .15s ease;
  white-space:nowrap;
}
.nav-pill button:hover{ background:#2a2a2a; }
.nav-pill button.active{
  background:#fff;
  color:var(--ink);
}

@media (max-width:560px){
  .brand-mark{ width:52px; height:52px; }
  .nav-pill button{ padding:10px 14px; font-size:14px; }
}

/* ============================================
   View system
   ============================================ */
.view{
  display:none;
  min-height:100vh;
  padding-top:130px;
}
.view.active{ display:block; }

/* ============================================
   HOME
   ============================================ */
#view-home{
  position:relative;
  padding-bottom:0;
  padding-top:0;
}
.hero{
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:1022px;
  padding:0 clamp(20px,6vw,90px) 0 clamp(20px,6vw,90px);
  gap:40px;
  overflow:hidden;
}
.hero-sketch{
  position:absolute;
  right:0;
  bottom:0;
  width:min(42vw, 620px);
  height:auto;
  z-index:1;
  pointer-events:none;
}.hero-text{
  position:relative;
  z-index:2;
  max-width:640px;
  width:100%;
  padding-top:0;
  padding-bottom:0;
}
.hero-text h1{
  font-family:var(--font-display);
  font-weight:500;
  font-size:clamp(36px,5vw,52px);
  line-height:1.15;
  margin:0 0 20px;
  color:var(--ink);
}
.hero-text p.lede{
  font-size:clamp(15px,1.6vw,18px);
  font-weight:400;
  color:var(--ink-soft);
  max-width:480px;
  margin:0 0 48px;
}
.tag-stack{
  display:flex;
  flex-direction:column;
  gap:16px;
  align-items:flex-start;
}
.tag-pill{
  background:#fdfcfa;
  border:none;
  padding:16px 28px;
  border-radius:var(--pill-radius);
  font-family:var(--font-display);
  font-size:17px;
  font-weight:500;
  box-shadow:var(--shadow-soft);
  transition:transform .18s ease, box-shadow .18s ease;
}
.tag-pill:hover{
  transform:translateY(-3px);
  box-shadow:0 14px 26px rgba(30,30,25,0.16);
}

@media (max-width: 900px) {
  .hero {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100vh;
    /* Space reserved above text below topbar (Green Box area) */
    padding: 140px clamp(20px, 6vw, 40px) 0; 
    box-sizing: border-box;
  }

  .hero-text {
    /* Vertically centers the text block in the remaining middle space (Red Box) */
    margin: auto 0; 
    max-width: 100%;
    text-align: left;
  }

  .hero-sketch {
    /* Takes sketch out of absolute positioning to prevent overlap */
    position: relative;
    right: auto;
    bottom: 0;
    /* Adjusts width & centers horizontally across the bottom (Red Arrow area) */
    width: min(85vw, 360px);
    margin: 0 0 0 auto; /* Keep '0 auto' if you want it fully centered horizontally */
    display: block;
  }
}
/* ============================================
   Section heading (Work / About Me / Let's Talk)
   ============================================ */
.section-heading{
  text-align:center;
  font-family:var(--font-display);
  font-weight:800;
  font-size:clamp(64px,13vw,140px);
  line-height:1;
  color:#adaaa3;
  letter-spacing:0px;
  margin:0 0 30px;
  user-select:none;
}

/* ============================================
   WORK VIEW
   ============================================ */
#view-work{ padding-bottom:80px; }
.work-intro{ padding:0 clamp(20px,6vw,90px); }
.filter-row{
  display:flex;
  justify-content:center;
  flex-wrap:wrap;
  gap:12px;
  margin-bottom:48px;
}
.filter-pill{
  background:#fdfcfa;
  border:none;
  padding:12px 24px;
  border-radius:var(--pill-radius);
  font-family:var(--font-display);
  font-weight:500;
  font-size:15px;
  box-shadow:0 4px 12px rgba(30,30,25,0.08);
  transition:background .2s ease, color .2s ease, transform .15s ease;
}
.filter-pill:hover{ transform:translateY(-2px); }
.filter-pill.active{
  background:var(--yellow);
  color:var(--ink);
}

.work-grid{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:22px;
  padding:0 clamp(20px,6vw,90px);
}
@media (max-width:1100px){ .work-grid{ grid-template-columns:repeat(3,1fr); } }
@media (max-width:800px){ .work-grid{ grid-template-columns:repeat(2,1fr); } }
@media (max-width:520px){ .work-grid{ grid-template-columns:1fr; } }

.work-card{
  position:relative;
  display:flex;
  flex-direction:column;
  border-radius:var(--card-radius);
  overflow:hidden;
  background:#fdfcfa;
  border:none;
  padding:0;
  box-shadow:0 6px 18px rgba(20,20,15,0.10);
  transition:transform .22s ease, box-shadow .22s ease;
}
.work-card:hover{
  transform:translateY(-6px);
  box-shadow:0 16px 32px rgba(20,20,15,0.20);
}
.thumb-frame{
  display:block;
  width:100%;
  height:260px;
  overflow:hidden;
  background:#999;
}
.thumb-frame img{
  width:100%; height:100%;
  transition:transform .35s ease;
}
.thumb-frame--cover img{ object-fit:cover; }
.thumb-frame--contain img{ object-fit:contain; }
.work-card:hover .thumb-frame img{ transform:scale(1.045); }

.card-caption{
  display:block;
  padding:14px 16px;
  text-align:left;
  min-height:70px;
}
.card-caption .cat{
  display:block;
  font-size:11px;
  letter-spacing:1.5px;
  text-transform:uppercase;
  color:var(--ink-soft);
  margin-bottom:4px;
}
.card-caption .title{
  font-family:var(--font-display);
  font-weight:600;
  font-size:17px;
  color:var(--ink);
}
.work-card.fade-hide{ display:none; }

/* ============================================
   CASE STUDY VIEWER (overlay)
   ============================================ */
.viewer-overlay{
  position:fixed;
  inset:0;
  z-index:500;
  background:var(--bg);
  display:none;
  overflow-y:auto;
}
.viewer-overlay.active{ display:block; }
.viewer-bar{
  position:sticky;
  top:0;
  z-index:5;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:18px clamp(16px,4vw,48px);
  background:rgba(228,226,220,0.92);
  backdrop-filter:blur(6px);
  border-bottom:1px solid rgba(0,0,0,0.06);
}
.viewer-title{
  font-family:var(--font-display);
  font-weight:700;
  font-size:clamp(16px,2.4vw,22px);
}
.viewer-close{
  border:none;
  background:var(--ink);
  color:#fff;
  width:44px; height:44px;
  border-radius:50%;
  font-size:20px;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:var(--shadow-soft);
}
.viewer-close:hover{ background:#000; }
.viewer-nav{
  position:fixed;
  top:50%;
  transform:translateY(-50%);
  z-index:10;
  width:56px; height:56px;
  border-radius:50%;
  border:none;
  background:var(--ink);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:var(--shadow-soft);
  transition:transform .18s ease, background .2s ease;
}
.viewer-nav:hover{ background:#000; transform:translateY(-50%) scale(1.08); }
.viewer-nav--prev{ left:28px; }
.viewer-nav--next{ right:28px; }
@media (max-width:900px){
  .viewer-nav{ width:44px; height:44px; }
  .viewer-nav--prev{ left:10px; }
  .viewer-nav--next{ right:10px; }
}
.viewer-body{
  max-width:1000px;
  margin:0 auto;
  padding:0 0 60px;
}
.viewer-body img{ width:100%; height:auto; }
.viewer-body video{ width:100%; height:auto; border-radius:12px; margin-top:24px; }
.viewer-note{
  text-align:center;
  color:var(--ink-soft);
  font-size:14px;
  padding:18px 20px 0;
}
.proto-btn{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  margin:24px auto;
  width:fit-content;
  background:var(--yellow);
  color:var(--ink);
  font-family:var(--font-display);
  font-weight:600;
  font-size:15px;
  padding:14px 28px;
  border-radius:var(--pill-radius);
  box-shadow:var(--shadow-soft);
  transition:transform .18s ease;
}
.proto-btn:hover{ transform:translateY(-2px); }

/* ============================================
   ABOUT VIEW
   ============================================ */
#view-about{ padding-bottom:80px; }
.about-wrap{
  display:grid;
  grid-template-columns:340px 1fr;
  gap:60px;
  padding:0 clamp(20px,6vw,90px);
  align-items:start;
}
@media (max-width:900px){
  .about-wrap{ grid-template-columns:1fr; }
}
.about-photo-block{ position:relative; }
.about-photo{
  position:relative;
  display:block;
  transform:rotate(-4deg);
  background:#fff;
  padding:14px 14px 34px;
  border-radius:6px;
  border:none;
  box-shadow:var(--shadow-soft);
  max-width:340px;
  width:100%;
  transition:transform .2s ease, box-shadow .2s ease;
}
.about-photo:hover{
  transform:rotate(-1deg) translateY(-4px);
  box-shadow:0 20px 40px rgba(20,20,15,0.22);
}
.about-photo img{ border-radius:2px; width:100%; transition:opacity .15s ease; }
.photo-dots{
  position:absolute;
  bottom:10px; left:0; right:0;
  display:flex;
  justify-content:center;
  gap:6px;
}
.photo-dots span{
  width:6px; height:6px;
  border-radius:50%;
  background:#d8d5cd;
  display:inline-block;
}
.photo-dots span.active{ background:var(--ink); }
.photo-hint{
  font-size:13px;
  color:var(--ink-soft);
  text-align:center;
  max-width:340px;
  margin:14px 0 0;
}

/* Inline story photo next to AME paragraph */
.story-row{
  display:flex;
  gap:24px;
  align-items:flex-start;
  margin-bottom:20px;
}
.story-row p{ margin-bottom:0; flex:1; }
.story-photo{
  width:150px;
  flex-shrink:0;
  border-radius:10px;
  box-shadow:var(--shadow-soft);
  transform:rotate(2deg);
}
@media (max-width:640px){
  .story-row{ flex-direction:column-reverse; }
  .story-photo{ width:120px; }
}
.sticky-note{
  position:absolute;
  background:var(--yellow);
  padding:10px 18px;
  border-radius:4px;
  font-family:var(--font-display);
  font-weight:600;
  font-size:14px;
  box-shadow:0 6px 14px rgba(0,0,0,0.18);
  transform:rotate(-3deg);
}
.sticky-note.note-1{ top:-16px; right:-30px; transform:rotate(4deg); }
.sticky-note.note-2{ bottom:30px; right:-20px; left:auto; transform:rotate(4deg); }
.resume-btn{
  margin-top:34px;
  display:inline-flex;
  align-items:center;
  gap:10px;
  background:var(--yellow);
  border:none;
  padding:16px 26px;
  border-radius:var(--pill-radius);
  font-family:var(--font-display);
  font-weight:700;
  font-size:16px;
  box-shadow:var(--shadow-soft);
  transition:transform .18s ease;
}
.resume-btn:hover{ transform:translateY(-3px); }

.about-copy h2.big-heading{
  font-family:var(--font-display);
  font-weight:800;
  font-size:clamp(64px,13vw,140px);
  line-height:1;
  color:#adaaa3;
  margin:0 0 20px;
}
.about-copy p.intro-line{
  font-size:17px;
  font-weight:400;
  line-height:1.6;
  max-width:640px;
  margin:0 0 34px;
}
.about-copy h3{
  font-family:var(--font-display);
  font-weight:600;
  font-size:22px;
  margin:0 0 18px;
}
.about-copy p{
  font-size:16px;
  font-weight:400;
  line-height:1.75;
  text-align:justify;
  color:var(--ink-soft);
  max-width:680px;
  margin:0 0 20px;
}
.about-copy mark{
  background:var(--yellow);
  color:var(--ink);
  padding:1px 4px;
  border-radius:3px;
  box-decoration-break:clone;
  -webkit-box-decoration-break:clone;
}
.about-copy strong{ color:var(--ink); }

/* ============================================
   CONTACT VIEW
   ============================================ */
#view-contact{
  text-align:center;
  padding-bottom:80px;
}
.contact-details{ margin:10px 0 40px; }
.contact-link{
  display:block;
  font-family:var(--font-display);
  font-weight:500;
  font-size:clamp(20px,3vw,30px);
  margin:10px 0;
  transition:color .2s ease;
}
.contact-link:hover{ color:var(--yellow-deep); }
.contact-illustration{
  max-width:420px;
  margin:20px auto 30px;
}
.social-row{
  display:flex;
  justify-content:center;
  gap:16px;
  flex-wrap:wrap;
}
.social-pill{
  background:var(--yellow);
  padding:14px 30px;
  border-radius:var(--pill-radius);
  font-family:var(--font-display);
  font-weight:600;
  font-size:15px;
  box-shadow:var(--shadow-soft);
  transition:transform .18s ease;
}
.social-pill:hover{ transform:translateY(-3px); }

/* ============================================
   Reduced motion
   ============================================ */
@media (prefers-reduced-motion: reduce){
  *{ transition:none !important; animation:none !important; scroll-behavior:auto !important; }
}
