/* =========================================================
   GLOBAL TOKENS + BASE
   (Single source of truth. No duplicate :root / body blocks.)
   ========================================================= */

:root{
  /* Core */
  --bg: #ffffff;
  --ink: #111111;

  --text: rgba(17,17,17,.90);
  --muted: rgba(17,17,17,.55);
  --muted2: rgba(17,17,17,.38);
  --line: rgba(17,17,17,.08);

  --link: rgba(17,17,17,.82);

  --radius: 14px;
  --shadow: 0 10px 28px rgba(0,0,0,.08);

  /* Layout */
  --page-x: clamp(22px, 3.2vw, 48px);
  --nav-w: 180px;
  --content-w: 1200px;

  /* If you use the bottom blur anywhere */
  --blur-h: 120px;
}

*{ box-sizing: border-box; }
html, body{ height: 100%; }

html{ scroll-behavior: smooth; }
section[id]{ scroll-margin-top: 120px; }

body{
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

a{ color: inherit; text-decoration: none; }
a:focus-visible{
  outline: 2px solid rgba(0,0,0,.25);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Anchor targets: give jump links breathing room */
#home, #projects, #craft, #genai, #about, #resume{
  scroll-margin-top: 24px;
}

/* =========================================================
   HOMEPAGE SHELL
   ========================================================= */

.page{
  display: grid;
  grid-template-columns: var(--nav-w) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 64px);
  padding: clamp(18px, 2.4vw, 36px) var(--page-x);
  align-items: start;
  min-height: 100vh;
  padding-bottom: calc(var(--blur-h) + 48px);
  max-width: calc(var(--nav-w) + var(--content-w) + 64px);
  margin: 0 auto;
}

/* Left nav (sticky) */
.sidebar{
  position: sticky;
  top: 18px;
  align-self: start;
  padding-top: 4px;
}

.brand{
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted2);
  margin-bottom: 18px;
}

.nav a{
  display: block;
  padding: 6px 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.25;
  transition: color .15s ease, opacity .15s ease;
}

.nav a.is-active{ color: rgba(17,17,17,.95); }
.nav a:not(.is-active){ opacity: .75; }

/* Main column */
.content{
  max-width: var(--content-w);
  width: 100%;
  min-width: 0;
}

/* Hero */
.hero{
  display: grid;
  gap: 14px;
  margin-top: 10px;
  margin-bottom: 34px;
}

.hero h1{
  font-size: clamp(22px, 2.35vw, 28px);
  line-height: 1.25;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 0;
  color: rgba(17,17,17,.78);
}

.meta{
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted2);
  line-height: 1.55;
}

.meta strong{
  font-weight: 600;
  color: rgba(17,17,17,.70);
}

/* Sections */
.section{
  display: block;
  margin: 38px 0 0;
}

.section-title{
  font-size: 14px;
  font-weight: 500;
  color: rgba(17,17,17,.75);
  margin: 0 0 14px;
  letter-spacing: -0.01em;
}

.section-sub{
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 14px;
  max-width: 58ch;
  line-height: 1.7;
}

/* keep GenAI grid spacing sane */
#genai .grid-3{ margin-top: 14px; }

/* Grids */
.grid-2{
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 18px;
}

.grid-3{
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 14px;
}

/* Cards */
.card{
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  border: none;
  box-shadow: 0 6px 18px rgba(0,0,0,.08);
  transform: translateY(0);
  transition: transform .18s ease, box-shadow .18s ease;
}

.card:hover{
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(0,0,0,.12);
}

/* =========================================================
   CARD — DISABLED / WORK IN PROGRESS
   ========================================================= */

.card--disabled{
  cursor: default;
}

.card--disabled:hover{
  transform: none;
  box-shadow: 0 6px 18px rgba(0,0,0,.08); /* same as base card */
}

.card--disabled .lock{
  opacity: .9;
}

.card-media{
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #f3f3f3;
}

.card-media img{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Lock overlay */
.lock{
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 16px;
  opacity: .85;
}

.card-foot{
  padding: 10px 12px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.tag{
  font-size: 9.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(17,17,17,.55);
  white-space: nowrap;
}

.title{
  font-size: 12px;
  color: rgba(17,17,17,.82);
  font-weight: 500;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Smaller media tiles */
.tile .card-media{ aspect-ratio: 1 / 1; }
.tile .card-foot{ padding: 0; }

/* About */
.about{
  margin-top: 18px;
  margin-bottom: 48px;
  display: grid;
  grid-template-columns: minmax(0, 720px) 260px;
  gap: 40px;
  align-items: start;
}

.about h3{
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 500;
  color: rgba(17,17,17,.75);
}

.about p{
  margin: 0 0 14px 0;
  font-size: 12px;
  line-height: 1.75;
  color: var(--muted);
}

.avatar{
  border-radius: 12px;
  overflow: hidden;
  background: #f4f4f4;
  aspect-ratio: 4 / 5;
}

.avatar img{
  width: 100%;
  height: 100%;
  max-height: 360px;
  object-fit: cover;
  display: block;
}

.footer-links{
  margin-top: 60px;
  display: flex;
  gap: 60px;
  flex-wrap: wrap;
  font-size: 14px;
  color: var(--muted);
  padding-bottom: 10px;
}

.footer-links a:hover{ color: rgba(17,17,17,.85); }

/* Fallback if blur unsupported */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))){
  .bottom-blur{
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

/* Homepage responsive */
@media (max-width: 920px){
  :root{ --nav-w: 150px; }
  .about{ grid-template-columns: 1fr; }
  .avatar{ width: 220px; max-width: 60vw; }
}

@media (max-width: 760px){
  .page{ grid-template-columns: 1fr; gap: 18px; }
  .sidebar{ position: relative; top: 0; }
  .grid-2{ grid-template-columns: 1fr; }
  .grid-3{ grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 420px){
  .grid-3{ grid-template-columns: 1fr; }
}

/* =========================================================
   CASE STUDY PAGE
   Use a wrapper class on body or main container: .cs
   ========================================================= */

/* If your case study page has <body class="cs"> this will apply */
.cs body,
body.cs{
  background: #fbfbfb;
  color: rgba(17,17,17,.92);
}

.cs .page,
body.cs .page{
  display: grid;
  grid-template-columns: 220px minmax(0, 1200px);
  gap: 72px;
  align-items: start;
  padding: 40px 48px 96px;
}

/* Left side */
.cs .side,
body.cs .side{
  position: sticky;
  top: 28px;
}

.cs .side__name,
body.cs .side__name{
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(17,17,17,.42);
  margin-bottom: 14px;
}

.cs .nav__divider,
body.cs .nav__divider{
  height: 1px;
  background: rgba(17,17,17,.10);
  margin: 14px 0;
}

.cs .nav__external,
body.cs .nav__external{
  opacity: .9;
}

/* Case study hero */
.cs-hero{
  padding-top: 8px;
  margin-bottom: 36px;
}

/* raw hero image (no card) */
.cs-hero .cs-img{
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.cs-title{
  font-size: 40px;
  letter-spacing: 0em;
  line-height: 1.05;
  margin: 0 0 4px 0;
}

.cs-subtitle{
  margin: 0;
  color: rgba(17,17,17,.58);
  font-size: 14px;
  line-height: 1.6;
}

.cs-meta{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
  padding: 0 16px;
  background: rgba(255,255,255,.75);
}

.cs-meta span{
  display: block;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(17,17,17,.45);
  margin-bottom: 6px;
}

.cs-meta strong{
  font-size: 13px;
  color: rgba(17,17,17,.90);
  font-weight: 400;
}

/* Sections */
.cs-section{
  padding: 22px 0;
  border-top: 1px solid rgba(17,17,17,.10);
}

.cs-section:first-of-type{ border-top: none; }

.cs-section h2{
  font-size: 18px;
  letter-spacing: -0.01em;
  margin: 0 0 10px 0;
}

.cs-section h3{
  font-size: 13px;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: rgba(17,17,17,.55);
  margin: 0 0 12px 0;
}

.cs-section p{
  color: rgba(17,17,17,.58);
  font-size: 14px;
  line-height: 1.85;
  margin: 0 0 12px 0;
}

.cs-section ul{
  margin: 10px 0 0 0;
  padding-left: 18px;
}

.cs-section li{
  color: rgba(17,17,17,.58);
  font-size: 14px;
  line-height: 1.75;
  margin-bottom: 10px;
}

.cs-callout{
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(17,17,17,.10);
  border-radius: 12px;
  background: rgba(255,255,255,.75);
}

.cs-callout__title{
  font-size: 12px;
  font-weight: 600;
  color: rgba(17,17,17,.85);
  margin-bottom: 10px;
}

.cs-quote{
  margin-top: 14px;
  padding: 16px 18px;
  border-left: 3px solid rgba(17,17,17,.22);
  background: rgba(255,255,255,.70);
  border-radius: 12px;
}

.cs-quote p{
  margin: 0;
  color: rgba(17,17,17,.66);
}

/* Media */
.cs-figure{ margin: 16px 0 0 0; }

.cs-img{
  width: 100%;
  display: block;
  border-radius: 16px;
  background: rgba(17,17,17,.04);
  border: 1px solid rgba(17,17,17,.10);
  box-shadow: 0 10px 28px rgba(0,0,0,.06);
}

.cs-caption{
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.55;
  color: rgba(17,17,17,.55);
}

/* 2-up / 3-up grids */
.cs-grid{
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.cs-grid.two{ grid-template-columns: 1fr 1fr; }
.cs-grid.three{ grid-template-columns: 1fr 1fr 1fr; }

@media (max-width: 900px){
  .cs-grid.two,
  .cs-grid.three{
    grid-template-columns: 1fr;
  }
}

/* Full-width figure helper */
.cs-figure--full{ width: 100%; }
.cs-figure--full .cs-img{ width: 100%; height: auto; }

/* Stack helper (when you want single column even on desktop) */
.cs .cs-grid.stack{
  grid-template-columns: 1fr !important;
}

/* Case study footer */
.cs-footer{
  margin-top: 48px;
  padding-top: 18px;
  border-top: 1px solid rgba(17,17,17,.10);
  display: flex;
  gap: 10px;
  align-items: center;
  color: rgba(17,17,17,.55);
  font-size: 13px;
}

.cs-footer a{
  color: rgba(17,17,17,.72);
  text-decoration: none;
}
.cs-footer a:hover{ color: rgba(17,17,17,.92); }

/* Case study responsive */
@media (max-width: 980px){
  .cs .page,
  body.cs .page{
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 28px 18px 72px;
  }
  .cs .side,
  body.cs .side{
    position: relative;
    top: auto;
  }
  .cs-meta{ grid-template-columns: 1fr; }
}

/* Section reveal */
.reveal{
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 500ms ease, transform 500ms ease;
  will-change: opacity, transform;
}

.reveal.is-visible{
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  .reveal{ opacity: 1; transform: none; transition: none; }
}

/* =========================================================
   GATE OVERLAY (if you use it)
   ========================================================= */

.gate{
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(10,10,12,.75);
  backdrop-filter: blur(10px);
}

.gate__card{
  width: min(520px, 100%);
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(20,20,22,.78);
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
  padding: 20px;
}

.gate__kicker{
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255,255,255,.55);
  margin-bottom: 10px;
}

.gate__title{
  font-size: 22px;
  line-height: 1.2;
  margin: 0 0 10px 0;
  color: rgba(255,255,255,.92);
}

.gate__desc{
  margin: 0 0 16px 0;
  color: rgba(255,255,255,.66);
  line-height: 1.6;
}

.gate__label{
  display: block;
  font-size: 12px;
  color: rgba(255,255,255,.60);
  margin-bottom: 8px;
}

.gate__row{ display: flex; gap: 10px; }

.gate__input{
  flex: 1;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.92);
  padding: 0 12px;
  outline: none;
}

.gate__input:focus{ border-color: rgba(255,255,255,.30); }

.gate__btn{
  height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.10);
  color: rgba(255,255,255,.92);
  font-weight: 600;
  cursor: pointer;
}

.gate__btn:hover{ background: rgba(255,255,255,.14); }

.gate__error{
  min-height: 18px;
  margin: 10px 0 0 0;
  font-size: 12px;
  color: rgba(255,120,120,.95);
}

.gate__links{
  margin-top: 14px;
  font-size: 13px;
  color: rgba(255,255,255,.60);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.gate__link{
  color: rgba(255,255,255,.78);
  text-decoration: none;
}
.gate__link:hover{
  color: rgba(255,255,255,.95);
  text-decoration: underline;
}

.gate__dot{ opacity: .4; }

/* =========================================================
   FULLSCREEN BLUEPRINT MODAL
   (This replaces the old centered-card modal.)
   ========================================================= */

.cs-expand__summary{
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--link);
  cursor: pointer;
}

/* Modal shell */
.cs-modal{
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
}

.cs-modal[aria-hidden="false"]{ display: block; }

.cs-modal__overlay{
  position: absolute;
  inset: 0;
  background: rgba(10,10,12,.72);
}

/* Fullscreen panel */
.cs-modal__content{
  position: relative;
  width: 100vw;
  height: 100vh;
  margin: 0;
  background: #fff;
  border-radius: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Header pinned */
.cs-modal__header{
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  border-bottom: 1px solid rgba(0,0,0,.08);
}

.cs-modal__header h3{
  margin: 0;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(17,17,17,.55);
}

.cs-modal__close{
  background: none;
  border: none;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: rgba(17,17,17,.72);
}

.cs-modal__close:hover{ color: rgba(17,17,17,.92); }

/* =========================================================
   DESIGNS: image left (3/4) + text right (1/4)
   (Isolated classes so nothing overrides it.)
   ========================================================= */

.cs-designs{
  display: grid;
  gap: 28px;
  margin-top: 18px;
}

.cs-design{
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 28px;
  align-items: start;
}

.cs-design__media{ margin: 0; }

.cs-design__media .cs-img{
  width: 100%;
  height: auto;
  display: block;
}

.cs-design__title{
  margin: 0 0 10px 0;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(17,17,17,.55);
}

.cs-design__desc{
  margin: 0 0 10px 0;
  color: rgba(17,17,17,.58);
  font-size: 14px;
  line-height: 1.85;
}

.cs-design__outcome{
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
  color: rgba(17,17,17,.55);
}

/* Responsive */
@media (max-width: 980px){
  .cs-design{
    grid-template-columns: 1fr;
    gap: 14px;
  }
}
/* =========================================================
   CASE STUDY — DESIGNS LAYOUT (3/4 image, text on right)
   Paste at END of styles.css
   ========================================================= */

.cs-designs{
  display: grid;
  gap: 32px; /* space between screens */
  margin-top: 18px;
}

/* 3/4 + 1/4 layout */
.cs-design{
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

/* ensure media doesn’t overflow */
.cs-design__media{
  margin: 0;
  min-width: 0;
}

/* remove any “divider” feel + tighten hierarchy */
.cs-design__copy{
  min-width: 0;
  border: none;
  padding: 0;
}

.cs-design__title{
  margin: 0 0 10px 0;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(17,17,17,.55);
}

.cs-design__desc{
  margin: 0 0 12px 0;
  font-size: 14px;
  line-height: 1.85;
  color: rgba(17,17,17,.58);
}

.cs-design__outcome{
  margin: 0;
  font-size: 14px;
  line-height: 1.75;
  color: rgba(17,17,17,.58);
}

/* mobile: stack cleanly */
@media (max-width: 980px){
  .cs-design{
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

/* FORCE ABOUT TO STACK (OVERRIDE) */
@media (max-width: 1200px){
  .about{
    grid-template-columns: 1fr !important;
    gap: 18px !important;
  }

  .avatar{
    width: min(340px, 100%) !important;
    max-width: 100% !important;
    justify-self: start !important;
  }

  .avatar img{
    width: 100% !important;
    height: auto !important;
    display: block !important;
  }
}

@media (max-width: 520px){
  .about{
    padding: 24px 18px !important;
  }
}
