/* dhruvindave.live: home page */

:root{
  --bg:#FBFAF7; --surface:#FFFFFF; --text:#1A1916; --text-2:#5F5C56;
  --hairline:#E6E2DA; --frame:#D9D4CA; --accent:#E4572E; --focus:#E4572E;
  --shadow:0 12px 32px rgba(26,25,22,.14);
  --ease:cubic-bezier(.2,.8,.2,1);
  --col:680px; --gutter:20px;
  color-scheme: light;

  --sans:"Instrument Sans", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --serif:Newsreader, Georgia, "Times New Roman", serif;

  /* type scale: M (375-639) is the base. h2 > feature title > row title at every size. */
  --fs-lede:30px; --fs-num:44px; --fs-name:24px; --fs-title:22px; --fs-email:24px;
  --fs-h2:28px; --fs-row:19px; --fs-body:17px; --fs-small:16px;

  --sec-gap:64px; --h2-gap:20px; --row-pad:16px;
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --bg:#1B1A19; --surface:#232220; --text:#EDEAE4; --text-2:#A29E97;
    --hairline:#2F2D2A; --frame:#3A3835; --accent:#FF7A4D; --focus:#FF7A4D;
    --shadow:0 12px 32px rgba(0,0,0,.45); color-scheme: dark;
  }
}
:root[data-theme="dark"]{
  --bg:#1B1A19; --surface:#232220; --text:#EDEAE4; --text-2:#A29E97;
  --hairline:#2F2D2A; --frame:#3A3835; --accent:#FF7A4D; --focus:#FF7A4D;
  --shadow:0 12px 32px rgba(0,0,0,.45); color-scheme: dark;
}

/* S: below 375 */
@media (max-width:374.98px){
  :root{ --fs-lede:28px; --fs-num:40px; --fs-h2:26px; --fs-email:22px; --fs-row:18px; --gutter:18px; }
}
/* T: 640-899 */
@media (min-width:640px){
  :root{
    --fs-lede:36px; --fs-num:48px; --fs-name:26px; --fs-title:24px; --fs-email:26px;
    --fs-h2:28px; --fs-row:20px; --gutter:24px; --sec-gap:80px; --row-pad:18px;
  }
}
/* D: 900 and up */
@media (min-width:900px){
  :root{
    --fs-lede:44px; --fs-num:56px; --fs-name:28px; --fs-title:26px; --fs-email:28px; --fs-h2:32px;
    --fs-body:clamp(17px, 0.35vw + 12px, 19px); --fs-row:clamp(20px, 0.4vw + 14px, 22px);
    --sec-gap:88px; --h2-gap:28px;
  }
}
/* wide screens: the column grows a little with the type */
@media (min-width:1600px){
  :root{ --col:720px; }
}

/* base */
*,*::before,*::after{ box-sizing:border-box; }
html{ -webkit-text-size-adjust:100%; text-size-adjust:100%; scroll-padding-top:24px; }
html,body{ background:var(--bg); color:var(--text); }
body{
  margin:0; overflow-x:clip;
  font-family:var(--sans); font-size:var(--fs-body); font-weight:400; line-height:1.65;
  font-optical-sizing:auto; -webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale;
}
h1,h2,h3,p,ul,figure{ margin:0; padding:0; }
ul{ list-style:none; }
img{ display:block; max-width:100%; height:auto; }
b{ font-weight:500; color:var(--text); }
button{ font:inherit; color:inherit; }

a{
  color:inherit;
  text-decoration:underline 1px; text-decoration-color:var(--frame); text-underline-offset:.22em;
  transition:text-decoration-color .15s ease;
}
a:hover,a:focus-visible{ text-decoration-color:var(--accent); }
a:focus-visible,button:focus-visible{ outline:2px solid var(--focus); outline-offset:3px; border-radius:2px; }

.wrap{ max-width:calc(var(--col) + 2*var(--gutter)); margin-inline:auto; padding-inline:var(--gutter); }
.nw{ white-space:nowrap; }
.sr-only{ position:absolute; width:1px; height:1px; margin:-1px; padding:0; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0; }

.skip{
  position:absolute; left:16px; top:-100px; z-index:10; padding:10px 14px;
  background:var(--text); color:var(--bg); font-size:var(--fs-small); font-weight:500; text-decoration:none; border-radius:6px;
}
.skip:focus{ top:12px; }

/* header */
.top{
  display:flex; justify-content:space-between; align-items:baseline; flex-wrap:wrap; row-gap:8px; column-gap:16px;
  padding-top:24px;
}
.name{ font-size:var(--fs-name); font-weight:600; line-height:1.2; letter-spacing:-.015em; text-wrap:balance; }
.nav{ display:flex; column-gap:20px; font-size:var(--fs-small); font-weight:500; line-height:1.5; }
.nav a{ display:inline-flex; align-items:center; min-height:44px; text-decoration-color:transparent; }
.nav a:hover,.nav a:focus-visible{ text-decoration-color:var(--accent); }

/* intro */
.intro{ padding-top:40px; }
.lede{
  max-width:17em;
  font-size:var(--fs-lede); font-weight:400; line-height:1.15; letter-spacing:-.022em; text-wrap:balance;
}
.lede em{ font-family:var(--serif); font-style:italic; font-weight:400; font-size:1.06em; line-height:1; letter-spacing:-.01em; }
.intro-p{
  margin-top:22px; max-width:36em;
  font-size:var(--fs-row); line-height:1.5; color:var(--text); text-wrap:pretty;
}
.intro-p a,.intro-p b{ color:var(--text); font-weight:500; }
.links{
  display:flex; flex-wrap:wrap; column-gap:24px; row-gap:4px; margin-top:20px;
  font-size:var(--fs-body); font-weight:500; line-height:1.5;
}
.links a{ display:inline-flex; align-items:center; min-height:44px; }

/* sections */
.sec{ margin-top:var(--sec-gap); }
.h2{ font-size:var(--fs-h2); font-weight:600; line-height:1.25; letter-spacing:-.01em; text-wrap:balance; margin-bottom:var(--h2-gap); }
.sec-p{ text-wrap:pretty; }
.sec-p + *{ margin-top:var(--h2-gap); }

/* hairline rows */
.rows > li{ border-top:1px solid var(--hairline); }
.rows > li:last-child{ border-bottom:1px solid var(--hairline); }

/* highlights */
.hl-row{ padding-block:20px; border-top:1px solid var(--hairline); }
.hl-row:last-child{ border-bottom:1px solid var(--hairline); }
.hl-num{
  font-family:var(--serif); font-weight:400; font-size:var(--fs-num); line-height:1; letter-spacing:-.01em;
  font-variant-numeric:lining-nums tabular-nums; font-optical-sizing:auto;
}
.hl-num .u,.hl-num .num-arrow{ color:var(--text-2); }
.hl-num .u{ font-size:.62em; letter-spacing:0; }
.hl-key{ margin-top:10px; max-width:560px; font-size:var(--fs-row); font-weight:500; line-height:1.45; text-wrap:pretty; }
.hl-detail{ margin-top:6px; max-width:560px; text-wrap:pretty; }

/* work: feature */
.feature-title{ font-size:var(--fs-title); font-weight:600; line-height:1.2; letter-spacing:-.015em; }
.meta{ margin-top:6px; font-size:var(--fs-small); line-height:1.5; color:var(--text-2); }
.ovt-media{ margin-top:20px; scroll-margin-top:80px; }
.ovt-shot{ display:block; transition:opacity .16s ease; text-decoration:none; border-radius:10px; }
.ovt-shot img{
  width:100%; height:auto; aspect-ratio:16/9;
  border:1px solid var(--frame); border-radius:10px; background:var(--surface);
}
@media (max-width:639.98px){
  .ovt-shot img{ aspect-ratio:360/576; max-width:360px; }
}
.ovt-shot.is-out{ opacity:0; }
.ovt-shot[hidden]{ display:none; }
.replay-cap{ margin-top:16px; color:var(--text-2); text-wrap:pretty; }
.ovt-media .twin{ transition:opacity .24s var(--ease), transform .24s var(--ease); }
.ovt-media .twin.is-pre{ opacity:0; transform:translateY(8px); }
.desc{ margin-top:20px; text-wrap:pretty; }
.facts{ margin-top:12px; text-wrap:pretty; }
.actions{
  display:flex; flex-wrap:wrap; align-items:center; column-gap:28px; row-gap:4px; margin-top:12px;
  font-weight:500; line-height:1.5;
}
.actions a{ display:inline-flex; align-items:center; gap:.3em; min-height:44px; }
.arr{ display:inline-block; color:var(--text-2); transition:transform .18s var(--ease); }
.actions a:hover .arr,.actions a:focus-visible .arr{ transform:translateX(3px); }
.replay-btn{
  display:inline-flex; align-items:center; gap:10px; min-height:44px; padding:0; margin:0;
  background:none; border:0; cursor:pointer; font-weight:500;
  text-decoration:underline 1px; text-decoration-color:var(--frame); text-underline-offset:.22em;
  transition:text-decoration-color .15s ease;
}
.replay-btn::before{ content:""; flex:0 0 auto; width:8px; height:8px; border-radius:50%; background:var(--accent); }
.replay-btn:hover,.replay-btn:focus-visible{ text-decoration-color:var(--accent); }

@media (min-width:900px){
  .breakout{ width:min(960px, calc(100vw - 48px)); margin-left:calc(50% - min(480px, 50vw - 24px)); }
}

/* work: project rows */
.projects{ margin-top:36px; }
.row-link{
  display:block; padding-block:var(--row-pad); min-height:44px;
  text-decoration:none; color:inherit;
}
.row-title{ display:block; font-size:var(--fs-row); font-weight:500; line-height:1.45; }
.row-title .t{ text-decoration:underline 1px; text-decoration-color:var(--frame); text-underline-offset:.22em; transition:text-decoration-color .15s ease; }
.row-desc{ display:block; margin-top:4px; line-height:1.65; text-wrap:pretty; }
.row-link:hover .t,.row-link:focus-visible .t{ text-decoration-color:var(--accent); }
.row-link:hover .arr,.row-link:focus-visible .arr{ transform:translateX(3px); }

/* open source */
.group + .group{ margin-top:32px; }
.group-label{ font-size:var(--fs-row); font-weight:500; line-height:1.45; }
.group-label a{ display:inline-flex; align-items:center; min-height:44px; }
.group-repo{ font-size:var(--fs-small); line-height:1.5; color:var(--text-2); margin-bottom:12px; }
.pr-row{ display:flex; flex-wrap:wrap; justify-content:space-between; align-items:baseline; column-gap:16px; padding-block:var(--row-pad); text-decoration:none; color:inherit; }
.pr-desc{ text-decoration:underline 1px; text-decoration-color:var(--frame); text-underline-offset:.22em; transition:text-decoration-color .15s ease; line-height:1.55; }
.pr-row:hover .pr-desc,.pr-row:focus-visible .pr-desc{ text-decoration-color:var(--accent); }
.pr-num{ font-size:var(--fs-small); color:var(--text-2); font-variant-numeric:tabular-nums; }

/* experience */
.exp-row{ padding-block:var(--row-pad); }
.exp-head{ display:flex; flex-direction:column; }
.exp-org{ font-size:var(--fs-row); font-weight:500; line-height:1.45; }
.exp-date{ font-size:var(--fs-small); line-height:1.5; color:var(--text-2); font-variant-numeric:tabular-nums; }
.exp-role{ margin-top:6px; font-weight:500; }
.exp-txt{ margin-top:2px; text-wrap:pretty; }

@media (min-width:640px){
  .pr-row{ display:grid; grid-template-columns:1fr auto; column-gap:24px; align-items:baseline; }
  .pr-num{ margin-top:0; font-size:var(--fs-body); }
  .exp-head{ display:grid; grid-template-columns:1fr auto; column-gap:24px; align-items:baseline; }
  .exp-role{ margin-top:2px; }
}

/* contact */
.email-line{ display:flex; flex-direction:column; align-items:flex-start; margin-top:16px; }
.sec-p + .email-line{ margin-top:16px; }
.email{
  font-size:var(--fs-email); font-weight:600; line-height:1.2; letter-spacing:-.015em;
  overflow-wrap:anywhere; padding-block:6px; min-height:44px;
}
.copy{
  display:inline-flex; align-items:center; gap:8px; min-height:44px; padding:0; margin:0;
  background:none; border:0; cursor:pointer;
  font-size:var(--fs-small); font-weight:500; color:var(--text-2);
  text-decoration:underline 1px; text-decoration-color:var(--frame); text-underline-offset:.22em;
}
.copy:hover,.copy:focus-visible{ color:var(--text); text-decoration-color:var(--accent); }
.copy-label{ transition:opacity .12s ease; }
.copy-label.is-fading{ opacity:0; }
.copy svg{ width:12px; height:12px; flex:0 0 auto; display:none; }
.copy svg path{ fill:none; stroke:var(--accent); stroke-width:2.2; stroke-linecap:round; stroke-linejoin:round; stroke-dasharray:20; stroke-dashoffset:20; }
.copy.is-done svg{ display:block; }
.copy.is-done svg path{ animation:tick .24s var(--ease) forwards; }
@keyframes tick{ to{ stroke-dashoffset:0; } }
.contact-links{ margin-top:20px; }
@media (min-width:640px){
  .email-line{ flex-direction:row; flex-wrap:wrap; align-items:baseline; column-gap:20px; }
}

/* footer */
.foot{ margin-top:64px; padding-bottom:24px; font-size:var(--fs-small); line-height:1.5; color:var(--text-2); }
.foot p{ border-top:1px solid var(--hairline); padding-top:24px; }

/* hover preview (desktop, fine pointer) */
.peek{
  position:fixed; left:0; top:0; z-index:20; width:280px; pointer-events:none;
  will-change:transform;
}
.peek img{
  width:280px; height:auto; border:1px solid var(--frame); border-radius:10px; background:var(--surface);
  box-shadow:var(--shadow);
  opacity:0; transform:scale(.96); transform-origin:top left;
  transition:opacity .12s ease, transform .12s ease;
}
.peek.is-on img{ opacity:1; transform:none; transition-duration:.18s; transition-timing-function:var(--ease); }

/* image fade (class only added by JS) */
img.pending{ opacity:0; }
img.loaded{ opacity:1; transition:opacity .24s ease; }

/* intro motion: runs without JS */
@keyframes rise{ from{ opacity:0; transform:translateY(8px); } to{ opacity:1; transform:none; } }
.in{ animation:rise .42s var(--ease) both; animation-delay:calc(var(--i, 0) * 50ms); }

@media (min-width:640px){
  .top{ padding-top:32px; }
}
@media (min-width:900px){
  .top{ padding-top:40px; }
  .nav{ column-gap:24px; }
  .intro{ padding-top:72px; }
  .intro-p{ margin-top:28px; }
  .links{ margin-top:24px; }
}

@media (prefers-reduced-motion: reduce){
  *,*::before,*::after{
    animation-duration:.01ms !important; animation-delay:0ms !important; animation-iteration-count:1 !important;
    transition-duration:.01ms !important; scroll-behavior:auto !important;
  }
}
